@chevre/domain 28.0.0 → 28.1.0-alpha.0

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.
@@ -18,7 +18,9 @@ export declare function validateAcceptedOffers(params: {
18
18
  result: {
19
19
  order: PlaceOrderFactory.IResultOrderParams;
20
20
  };
21
- acceptedOffers: (Pick<factory.acceptedOffer.IAcceptedOffer, 'itemOffered' | 'offeredThrough' | 'serialNumber'>)[];
21
+ acceptedOffers: (Pick<factory.acceptedOffer.IAcceptedOffer, 'itemOffered' | 'offeredThrough' | 'serialNumber' | 'id'>)[];
22
+ }, options: {
23
+ maxNumUnitPriceOffers: number;
22
24
  }): void;
23
25
  export declare function validateOrderedItem(params: {
24
26
  order: Pick<factory.order.IOrder, 'orderedItem'>;
@@ -196,7 +196,7 @@ function validatePaymentUrl(params) {
196
196
  /**
197
197
  * 注文オファー数検証
198
198
  */
199
- function validateAcceptedOffers(params) {
199
+ function validateAcceptedOffers(params, options) {
200
200
  if (!Array.isArray(params.acceptedOffers)) {
201
201
  throw new factory_1.factory.errors.Argument('order.acceptedOffers', 'must be array');
202
202
  }
@@ -266,6 +266,12 @@ function validateAcceptedOffers(params) {
266
266
  throw new factory_1.factory.errors.Argument('Transaction', 'ticketNumbers must be unique');
267
267
  }
268
268
  }
269
+ // 単価オファー数検証(2026-10-26~)
270
+ const { maxNumUnitPriceOffers } = options;
271
+ const numUnitPriceOffers = [...new Set(params.acceptedOffers.map(({ id }) => String(id)))].length;
272
+ if (numUnitPriceOffers > maxNumUnitPriceOffers) {
273
+ throw new factory_1.factory.errors.Argument('Transaction', (0, util_1.format)('Number of unitPriceOffers must be less than or equal to %s', maxNumUnitPriceOffers));
274
+ }
269
275
  }
270
276
  function validateOrderedItem(params) {
271
277
  if (!Array.isArray(params.order.orderedItem)) {
@@ -40,6 +40,11 @@ interface IConfirmOptions {
40
40
  * 注文における最大CreditCardIF決済方法数
41
41
  */
42
42
  maxNumCreditCardPaymentMethod: number;
43
+ /**
44
+ * ユニークな単価オファー最大数
45
+ * 2026-10-26~
46
+ */
47
+ maxNumUnitPriceOffers: number;
43
48
  }
44
49
  type IConfirmParams = PlaceOrderFactory.IConfirmParams & {
45
50
  /**
@@ -327,7 +327,7 @@ function createResult(params, options) {
327
327
  (0, validation_1.validateAcceptedOffers)({
328
328
  result: params.result,
329
329
  acceptedOffers: params.acceptedOffers
330
- });
330
+ }, options);
331
331
  // 注文アイテム検証(2024-01-20~)
332
332
  (0, validation_1.validateOrderedItem)({
333
333
  order: { orderedItem },
package/package.json CHANGED
@@ -88,5 +88,5 @@
88
88
  "postversion": "git push origin --tags",
89
89
  "prepublishOnly": "npm run clean && npm run build"
90
90
  },
91
- "version": "28.0.0"
91
+ "version": "28.1.0-alpha.0"
92
92
  }