wsp-ms-core 1.1.7 → 1.1.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.cjs CHANGED
@@ -162,6 +162,12 @@ var _DateTime = class _DateTime extends ValueObject {
162
162
  right.diff(left, "days").days
163
163
  );
164
164
  }
165
+ diffInDaysInclusive(other) {
166
+ const left = this._dt.startOf("day");
167
+ const right = other._dt.startOf("day");
168
+ const days = Math.floor(right.diff(left, "days").days);
169
+ return days >= 0 ? days + 1 : days - 1;
170
+ }
165
171
  diffInDaysAbs(other) {
166
172
  return Math.abs(this.diffInDays(other));
167
173
  }
@@ -527,7 +533,7 @@ var _UUID = class _UUID extends ValueObject {
527
533
  super(value);
528
534
  }
529
535
  validate(uuid) {
530
- if (!_UUID.isValid(uuid)) {
536
+ if (!_UUID.isValid(uuid, { allowNil: true })) {
531
537
  throw new InternalError(`Invalid uuid <${uuid}>`);
532
538
  }
533
539
  }
@@ -2132,7 +2138,7 @@ var ExchangeRates = class _ExchangeRates extends BaseObject {
2132
2138
  exchangeToBase(price) {
2133
2139
  const rate = this.getRate(price.currency);
2134
2140
  if (!rate) {
2135
- throw new InternalError("INVALID_EXCHANGE_RATE_CURRENCY", `Avaiable rates: ${this.props.rates} - Base Currency:${this.props.base.value} - Price Currency: ${price.currency.value}`);
2141
+ throw new InternalError("INVALID_EXCHANGE_RATE_CURRENCY", `Avaiable rates: ${Object.keys(this.props.rates).toString()} - Base Currency:${this.props.base.value} - Price Currency: ${price.currency.value}`);
2136
2142
  }
2137
2143
  if (price.currency.value === this.props.base.value) {
2138
2144
  return price;