@chevre/domain 21.8.0-alpha.6 → 21.8.0-alpha.60

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.
Files changed (129) hide show
  1. package/example/src/chevre/countOffers.ts +32 -0
  2. package/example/src/chevre/findItemListElementByCatalogId.ts +23 -0
  3. package/example/src/chevre/importOffersFromCOA.ts +7 -1
  4. package/example/src/chevre/migrateAggregateOffers.ts +89 -0
  5. package/example/src/chevre/migrateOrderPaymentMethodIdentifier.ts +81 -0
  6. package/example/src/chevre/migratePayTransactionPaymentMethodId.ts +72 -0
  7. package/example/src/chevre/migratePayTransactionPaymentMethodIdentifier.ts +78 -0
  8. package/example/src/chevre/processPay.ts +3 -4
  9. package/example/src/chevre/publishPermitOwnershipInfoToken.ts +56 -0
  10. package/example/src/chevre/pullAddOnsFromOffer.ts +26 -0
  11. package/example/src/chevre/searchAggregateOffers.ts +48 -0
  12. package/example/src/chevre/searchEventTicketOffers.ts +3 -1
  13. package/example/src/chevre/searchEvents.ts +9 -7
  14. package/example/src/chevre/searchOffersByCatalog.ts +9 -5
  15. package/example/src/chevre/searchOffersFromAggregateOffer.ts +168 -0
  16. package/example/src/chevre/searchOrders.ts +9 -7
  17. package/example/src/chevre/sync2aggregateOffer.ts +27 -0
  18. package/example/src/chevre/syncAggregateOffer.ts +25 -0
  19. package/lib/chevre/emailMessageBuilder.js +6 -5
  20. package/lib/chevre/repo/aggregateOffer.d.ts +62 -0
  21. package/lib/chevre/repo/aggregateOffer.js +534 -0
  22. package/lib/chevre/repo/assetTransaction.d.ts +16 -1
  23. package/lib/chevre/repo/assetTransaction.js +54 -2
  24. package/lib/chevre/repo/mongoose/schemas/aggregateOffer.d.ts +74 -0
  25. package/lib/chevre/repo/mongoose/schemas/aggregateOffer.js +177 -0
  26. package/lib/chevre/repo/mongoose/schemas/authorization.d.ts +3 -3
  27. package/lib/chevre/repo/mongoose/schemas/creativeWork.d.ts +3 -3
  28. package/lib/chevre/repo/mongoose/schemas/event.d.ts +3 -3
  29. package/lib/chevre/repo/mongoose/schemas/offer.d.ts +24 -33
  30. package/lib/chevre/repo/mongoose/schemas/offer.js +4 -3
  31. package/lib/chevre/repo/mongoose/schemas/order.d.ts +3 -0
  32. package/lib/chevre/repo/mongoose/schemas/order.js +7 -0
  33. package/lib/chevre/repo/mongoose/schemas/priceSpecification.d.ts +9 -9
  34. package/lib/chevre/repo/mongoose/schemas/product.d.ts +3 -3
  35. package/lib/chevre/repo/mongoose/schemas/project.d.ts +3 -3
  36. package/lib/chevre/repo/mongoose/schemas/task.d.ts +3 -0
  37. package/lib/chevre/repo/mongoose/schemas/task.js +8 -0
  38. package/lib/chevre/repo/offer.d.ts +82 -47
  39. package/lib/chevre/repo/offer.js +1279 -289
  40. package/lib/chevre/repo/offerCatalog.d.ts +6 -0
  41. package/lib/chevre/repo/offerCatalog.js +13 -0
  42. package/lib/chevre/repo/order.d.ts +15 -0
  43. package/lib/chevre/repo/order.js +58 -26
  44. package/lib/chevre/repo/task.d.ts +7 -1
  45. package/lib/chevre/repo/task.js +100 -0
  46. package/lib/chevre/repository.d.ts +3 -0
  47. package/lib/chevre/repository.js +5 -1
  48. package/lib/chevre/service/aggregation/event/aggregateScreeningEvent.js +2 -1
  49. package/lib/chevre/service/aggregation/event/aggregateUseActionsOnEvent.js +2 -1
  50. package/lib/chevre/service/assetTransaction/pay/account/validation.js +2 -2
  51. package/lib/chevre/service/assetTransaction/pay/factory.js +26 -18
  52. package/lib/chevre/service/assetTransaction/pay/potentialActions.js +3 -3
  53. package/lib/chevre/service/assetTransaction/pay.js +65 -46
  54. package/lib/chevre/service/assetTransaction/refund/factory.js +8 -2
  55. package/lib/chevre/service/assetTransaction/registerService.js +2 -1
  56. package/lib/chevre/service/assetTransaction/reserve.js +111 -35
  57. package/lib/chevre/service/delivery.js +17 -0
  58. package/lib/chevre/service/offer/event/authorize.js +39 -35
  59. package/lib/chevre/service/offer/event/factory.d.ts +1 -1
  60. package/lib/chevre/service/offer/event/factory.js +8 -8
  61. package/lib/chevre/service/offer/event/importFromCOA.d.ts +2 -0
  62. package/lib/chevre/service/offer/event/searchEventTicketOffers.d.ts +1 -0
  63. package/lib/chevre/service/offer/event/searchEventTicketOffers.js +6 -3
  64. package/lib/chevre/service/offer/event/voidTransaction.js +57 -36
  65. package/lib/chevre/service/offer/eventServiceByCOA/factory.d.ts +2 -1
  66. package/lib/chevre/service/offer/eventServiceByCOA/factory.js +7 -11
  67. package/lib/chevre/service/offer/eventServiceByCOA.js +55 -27
  68. package/lib/chevre/service/offer/factory.d.ts +12 -4
  69. package/lib/chevre/service/offer/factory.js +9 -11
  70. package/lib/chevre/service/offer/product/searchProductOffers.d.ts +8 -1
  71. package/lib/chevre/service/offer/product/searchProductOffers.js +10 -3
  72. package/lib/chevre/service/offer/product.d.ts +1 -0
  73. package/lib/chevre/service/offer/product.js +3 -2
  74. package/lib/chevre/service/offer.d.ts +1 -0
  75. package/lib/chevre/service/offer.js +7 -1
  76. package/lib/chevre/service/order/confirmPayTransaction.d.ts +0 -2
  77. package/lib/chevre/service/order/confirmPayTransaction.js +29 -40
  78. package/lib/chevre/service/order/onAssetTransactionStatusChanged.d.ts +27 -0
  79. package/lib/chevre/service/order/onAssetTransactionStatusChanged.js +226 -0
  80. package/lib/chevre/service/order/onOrderStatusChanged/factory.d.ts +8 -6
  81. package/lib/chevre/service/order/onOrderStatusChanged/factory.js +80 -57
  82. package/lib/chevre/service/order/onOrderStatusChanged.js +81 -54
  83. package/lib/chevre/service/order/payOrder.d.ts +2 -10
  84. package/lib/chevre/service/order/payOrder.js +4 -45
  85. package/lib/chevre/service/order/placeOrder.js +11 -13
  86. package/lib/chevre/service/order.d.ts +3 -1
  87. package/lib/chevre/service/order.js +6 -2
  88. package/lib/chevre/service/payment/any/factory.js +33 -8
  89. package/lib/chevre/service/payment/any.js +30 -21
  90. package/lib/chevre/service/payment/creditCard.js +12 -12
  91. package/lib/chevre/service/payment/movieTicket/validation.js +2 -2
  92. package/lib/chevre/service/payment/movieTicket.js +10 -11
  93. package/lib/chevre/service/payment/paymentCard.js +9 -12
  94. package/lib/chevre/service/project.js +1 -1
  95. package/lib/chevre/service/reserve/checkInReservation.d.ts +8 -0
  96. package/lib/chevre/service/reserve/checkInReservation.js +3 -2
  97. package/lib/chevre/service/reserve/potentialActions/onReservationCanceled.d.ts +3 -0
  98. package/lib/chevre/service/reserve/potentialActions/onReservationCanceled.js +4 -5
  99. package/lib/chevre/service/reserve/potentialActions/onReservationCheckedIn.d.ts +8 -0
  100. package/lib/chevre/service/reserve/potentialActions/onReservationCheckedIn.js +16 -11
  101. package/lib/chevre/service/reserve/potentialActions/onReservationConfirmed.js +2 -1
  102. package/lib/chevre/service/reserve/potentialActions/onReservationUsed.d.ts +3 -0
  103. package/lib/chevre/service/reserve/potentialActions/onReservationUsed.js +3 -5
  104. package/lib/chevre/service/task/confirmPayTransaction.js +1 -3
  105. package/lib/chevre/service/task/importOffersFromCOA.js +3 -0
  106. package/lib/chevre/service/task/onAssetTransactionStatusChanged.d.ts +6 -0
  107. package/lib/chevre/service/task/onAssetTransactionStatusChanged.js +37 -0
  108. package/lib/chevre/service/task/onAuthorizationCreated.js +5 -1
  109. package/lib/chevre/service/task/onOrderPaymentCompleted.d.ts +6 -0
  110. package/lib/chevre/service/task/onOrderPaymentCompleted.js +35 -0
  111. package/lib/chevre/service/task/onResourceUpdated/onResourceDeleted.d.ts +2 -0
  112. package/lib/chevre/service/task/onResourceUpdated/onResourceDeleted.js +7 -0
  113. package/lib/chevre/service/task/onResourceUpdated/syncOfferCatalog.d.ts +17 -0
  114. package/lib/chevre/service/task/onResourceUpdated/syncOfferCatalog.js +60 -0
  115. package/lib/chevre/service/task/onResourceUpdated.js +12 -0
  116. package/lib/chevre/service/task/returnPayTransaction.js +8 -3
  117. package/lib/chevre/service/task/syncAggregateOffer.d.ts +7 -0
  118. package/lib/chevre/service/task/syncAggregateOffer.js +23 -0
  119. package/lib/chevre/service/transaction/placeOrderInProgress/result.js +32 -16
  120. package/lib/chevre/service/transaction/placeOrderInProgress/validation/validateMovieTicket.js +13 -11
  121. package/lib/chevre/service/transaction/placeOrderInProgress/validation.js +53 -17
  122. package/lib/chevre/service/transaction/placeOrderInProgress.js +4 -1
  123. package/lib/chevre/service/transaction/returnOrder/potentialActions/returnPaymentMethod.js +7 -6
  124. package/lib/chevre/service/transaction/returnOrder.js +5 -1
  125. package/lib/chevre/settings.d.ts +5 -3
  126. package/lib/chevre/settings.js +6 -6
  127. package/package.json +3 -3
  128. package/example/src/chevre/migrateAuthorizePaymentActionResult.ts +0 -83
  129. package/example/src/chevre/migrateEventOrganizer.ts +0 -154
@@ -69,6 +69,12 @@ export declare class MongoRepository {
69
69
  search(params: factory.offerCatalog.ISearchConditions): Promise<(Omit<factory.offerCatalog.IOfferCatalog, 'itemListElement'> & {
70
70
  numberOfItems?: number;
71
71
  })[]>;
72
+ findItemListElementById(params: {
73
+ id: string;
74
+ project: {
75
+ id: string;
76
+ };
77
+ }): Promise<Pick<factory.offerCatalog.IOfferCatalog, 'itemListElement'>>;
72
78
  deleteById(params: {
73
79
  id: string;
74
80
  }): Promise<void>;
@@ -240,6 +240,19 @@ class MongoRepository {
240
240
  return aggregate.exec();
241
241
  });
242
242
  }
243
+ findItemListElementById(params) {
244
+ return __awaiter(this, void 0, void 0, function* () {
245
+ const doc = yield this.offerCatalogModel.findOne({
246
+ 'project.id': { $eq: params.project.id },
247
+ _id: { $eq: params.id }
248
+ }, { 'itemListElement.id': 1 })
249
+ .exec();
250
+ if (doc === null) {
251
+ throw new factory.errors.NotFound(this.offerCatalogModel.modelName);
252
+ }
253
+ return doc.toObject();
254
+ });
255
+ }
243
256
  deleteById(params) {
244
257
  return __awaiter(this, void 0, void 0, function* () {
245
258
  yield this.offerCatalogModel.findOneAndRemove({
@@ -70,6 +70,21 @@ export declare class MongoRepository {
70
70
  }): Promise<{
71
71
  updatedAt: Date;
72
72
  }>;
73
+ /**
74
+ * 注文後に決済方法区分を確定する
75
+ */
76
+ fixPaymentMethodIdentifier(params: {
77
+ project: {
78
+ id: string;
79
+ };
80
+ orderNumber: string;
81
+ invoice: {
82
+ paymentMethodId: string;
83
+ paymentMethod: {
84
+ identifier: string;
85
+ };
86
+ };
87
+ }): Promise<void>;
73
88
  findById(params: {
74
89
  id: string;
75
90
  inclusion: string[];
@@ -24,7 +24,7 @@ class MongoRepository {
24
24
  }
25
25
  // tslint:disable-next-line:cyclomatic-complexity max-func-body-length
26
26
  static CREATE_MONGO_CONDITIONS(params) {
27
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12, _13, _14, _15, _16, _17, _18, _19;
27
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12, _13, _14, _15, _16, _17, _18, _19, _20, _21, _22;
28
28
  const andConditions = [];
29
29
  const projectIdEq = (_b = (_a = params.project) === null || _a === void 0 ? void 0 : _a.id) === null || _b === void 0 ? void 0 : _b.$eq;
30
30
  if (typeof projectIdEq === 'string') {
@@ -82,10 +82,11 @@ class MongoRepository {
82
82
  if (Array.isArray(sellerIds)) {
83
83
  andConditions.push({ 'seller.id': { $exists: true, $in: sellerIds } });
84
84
  }
85
- if (typeof ((_m = params.seller) === null || _m === void 0 ? void 0 : _m.typeOf) === 'string') {
86
- andConditions.push({ 'seller.typeOf': { $exists: true, $eq: params.seller.typeOf } });
87
- }
88
- const brokerIdEq = (_p = (_o = params.broker) === null || _o === void 0 ? void 0 : _o.id) === null || _p === void 0 ? void 0 : _p.$eq;
85
+ // 不要なので廃止(2023-09-11~)
86
+ // if (typeof params.seller?.typeOf === 'string') {
87
+ // andConditions.push({ 'seller.typeOf': { $exists: true, $eq: params.seller.typeOf } });
88
+ // }
89
+ const brokerIdEq = (_o = (_m = params.broker) === null || _m === void 0 ? void 0 : _m.id) === null || _o === void 0 ? void 0 : _o.$eq;
89
90
  if (typeof brokerIdEq === 'string') {
90
91
  andConditions.push({
91
92
  'broker.id': {
@@ -302,7 +303,7 @@ class MongoRepository {
302
303
  }
303
304
  }
304
305
  }
305
- const nameEq = (_q = params.name) === null || _q === void 0 ? void 0 : _q.$eq;
306
+ const nameEq = (_p = params.name) === null || _p === void 0 ? void 0 : _p.$eq;
306
307
  if (typeof nameEq === 'string') {
307
308
  andConditions.push({
308
309
  name: {
@@ -311,7 +312,7 @@ class MongoRepository {
311
312
  }
312
313
  });
313
314
  }
314
- const nameRegex = (_r = params.name) === null || _r === void 0 ? void 0 : _r.$regex;
315
+ const nameRegex = (_q = params.name) === null || _q === void 0 ? void 0 : _q.$regex;
315
316
  if (typeof nameRegex === 'string' && nameRegex.length > 0) {
316
317
  andConditions.push({
317
318
  name: {
@@ -344,7 +345,7 @@ class MongoRepository {
344
345
  }
345
346
  });
346
347
  }
347
- const itemOfferedIdentifierIn = (_u = (_t = (_s = params.acceptedOffers) === null || _s === void 0 ? void 0 : _s.itemOffered) === null || _t === void 0 ? void 0 : _t.identifier) === null || _u === void 0 ? void 0 : _u.$in;
348
+ const itemOfferedIdentifierIn = (_t = (_s = (_r = params.acceptedOffers) === null || _r === void 0 ? void 0 : _r.itemOffered) === null || _s === void 0 ? void 0 : _s.identifier) === null || _t === void 0 ? void 0 : _t.$in;
348
349
  if (Array.isArray(itemOfferedIdentifierIn)) {
349
350
  andConditions.push({
350
351
  'acceptedOffers.itemOffered.identifier': {
@@ -353,7 +354,7 @@ class MongoRepository {
353
354
  }
354
355
  });
355
356
  }
356
- const itemOfferedTypeOfIn = (_x = (_w = (_v = params.acceptedOffers) === null || _v === void 0 ? void 0 : _v.itemOffered) === null || _w === void 0 ? void 0 : _w.typeOf) === null || _x === void 0 ? void 0 : _x.$in;
357
+ const itemOfferedTypeOfIn = (_w = (_v = (_u = params.acceptedOffers) === null || _u === void 0 ? void 0 : _u.itemOffered) === null || _v === void 0 ? void 0 : _v.typeOf) === null || _w === void 0 ? void 0 : _w.$in;
357
358
  if (Array.isArray(itemOfferedTypeOfIn)) {
358
359
  andConditions.push({
359
360
  'acceptedOffers.itemOffered.typeOf': {
@@ -362,7 +363,7 @@ class MongoRepository {
362
363
  }
363
364
  });
364
365
  }
365
- const itemOfferedIssuedThroughTypeOfEq = (_1 = (_0 = (_z = (_y = params.acceptedOffers) === null || _y === void 0 ? void 0 : _y.itemOffered) === null || _z === void 0 ? void 0 : _z.issuedThrough) === null || _0 === void 0 ? void 0 : _0.typeOf) === null || _1 === void 0 ? void 0 : _1.$eq;
366
+ const itemOfferedIssuedThroughTypeOfEq = (_0 = (_z = (_y = (_x = params.acceptedOffers) === null || _x === void 0 ? void 0 : _x.itemOffered) === null || _y === void 0 ? void 0 : _y.issuedThrough) === null || _z === void 0 ? void 0 : _z.typeOf) === null || _0 === void 0 ? void 0 : _0.$eq;
366
367
  if (typeof itemOfferedIssuedThroughTypeOfEq === 'string') {
367
368
  andConditions.push({
368
369
  'acceptedOffers.itemOffered.issuedThrough.typeOf': {
@@ -371,7 +372,7 @@ class MongoRepository {
371
372
  }
372
373
  });
373
374
  }
374
- const itemOfferedIssuedThroughIdIn = (_5 = (_4 = (_3 = (_2 = params.acceptedOffers) === null || _2 === void 0 ? void 0 : _2.itemOffered) === null || _3 === void 0 ? void 0 : _3.issuedThrough) === null || _4 === void 0 ? void 0 : _4.id) === null || _5 === void 0 ? void 0 : _5.$in;
375
+ const itemOfferedIssuedThroughIdIn = (_4 = (_3 = (_2 = (_1 = params.acceptedOffers) === null || _1 === void 0 ? void 0 : _1.itemOffered) === null || _2 === void 0 ? void 0 : _2.issuedThrough) === null || _3 === void 0 ? void 0 : _3.id) === null || _4 === void 0 ? void 0 : _4.$in;
375
376
  if (Array.isArray(itemOfferedIssuedThroughIdIn)) {
376
377
  andConditions.push({
377
378
  'acceptedOffers.itemOffered.issuedThrough.id': {
@@ -380,7 +381,7 @@ class MongoRepository {
380
381
  }
381
382
  });
382
383
  }
383
- const itemOfferedProgramMembershipUsedIdentifierEq = (_9 = (_8 = (_7 = (_6 = params.acceptedOffers) === null || _6 === void 0 ? void 0 : _6.itemOffered) === null || _7 === void 0 ? void 0 : _7.programMembershipUsed) === null || _8 === void 0 ? void 0 : _8.identifier) === null || _9 === void 0 ? void 0 : _9.$eq;
384
+ const itemOfferedProgramMembershipUsedIdentifierEq = (_8 = (_7 = (_6 = (_5 = params.acceptedOffers) === null || _5 === void 0 ? void 0 : _5.itemOffered) === null || _6 === void 0 ? void 0 : _6.programMembershipUsed) === null || _7 === void 0 ? void 0 : _7.identifier) === null || _8 === void 0 ? void 0 : _8.$eq;
384
385
  if (typeof itemOfferedProgramMembershipUsedIdentifierEq === 'string') {
385
386
  andConditions.push({
386
387
  'acceptedOffers.itemOffered.programMembershipUsed.identifier': {
@@ -389,7 +390,7 @@ class MongoRepository {
389
390
  }
390
391
  });
391
392
  }
392
- const itemOfferedProgramMembershipUsedIssuedThroughServiceTypeCodeValueEq = (_15 = (_14 = (_13 = (_12 = (_11 = (_10 = params.acceptedOffers) === null || _10 === void 0 ? void 0 : _10.itemOffered) === null || _11 === void 0 ? void 0 : _11.programMembershipUsed) === null || _12 === void 0 ? void 0 : _12.issuedThrough) === null || _13 === void 0 ? void 0 : _13.serviceType) === null || _14 === void 0 ? void 0 : _14.codeValue) === null || _15 === void 0 ? void 0 : _15.$eq;
393
+ const itemOfferedProgramMembershipUsedIssuedThroughServiceTypeCodeValueEq = (_14 = (_13 = (_12 = (_11 = (_10 = (_9 = params.acceptedOffers) === null || _9 === void 0 ? void 0 : _9.itemOffered) === null || _10 === void 0 ? void 0 : _10.programMembershipUsed) === null || _11 === void 0 ? void 0 : _11.issuedThrough) === null || _12 === void 0 ? void 0 : _12.serviceType) === null || _13 === void 0 ? void 0 : _13.codeValue) === null || _14 === void 0 ? void 0 : _14.$eq;
393
394
  if (typeof itemOfferedProgramMembershipUsedIssuedThroughServiceTypeCodeValueEq === 'string') {
394
395
  andConditions.push({
395
396
  'acceptedOffers.itemOffered.programMembershipUsed.issuedThrough.serviceType.codeValue': {
@@ -551,6 +552,14 @@ class MongoRepository {
551
552
  }
552
553
  }
553
554
  }
555
+ const paymentMethodIdentifierIn = (_17 = (_16 = (_15 = params.paymentMethods) === null || _15 === void 0 ? void 0 : _15.paymentMethod) === null || _16 === void 0 ? void 0 : _16.identifier) === null || _17 === void 0 ? void 0 : _17.$in;
556
+ if (Array.isArray(paymentMethodIdentifierIn)) {
557
+ andConditions.push({ 'paymentMethods.paymentMethod.identifier': { $exists: true, $in: paymentMethodIdentifierIn } });
558
+ }
559
+ const paymentMethodsTypeOfIn = (_18 = params.paymentMethods) === null || _18 === void 0 ? void 0 : _18.typeOfs;
560
+ if (Array.isArray(paymentMethodsTypeOfIn)) {
561
+ andConditions.push({ 'paymentMethods.typeOf': { $exists: true, $in: paymentMethodsTypeOfIn } });
562
+ }
554
563
  // tslint:disable-next-line:no-single-line-block-comment
555
564
  /* istanbul ignore else */
556
565
  if (params.paymentMethods !== undefined) {
@@ -566,16 +575,6 @@ class MongoRepository {
566
575
  }
567
576
  // tslint:disable-next-line:no-single-line-block-comment
568
577
  /* istanbul ignore else */
569
- if (Array.isArray(params.paymentMethods.typeOfs)) {
570
- andConditions.push({
571
- 'paymentMethods.typeOf': {
572
- $exists: true,
573
- $in: params.paymentMethods.typeOfs
574
- }
575
- });
576
- }
577
- // tslint:disable-next-line:no-single-line-block-comment
578
- /* istanbul ignore else */
579
578
  if (Array.isArray(params.paymentMethods.paymentMethodIds)) {
580
579
  andConditions.push({
581
580
  'paymentMethods.paymentMethodId': {
@@ -585,7 +584,7 @@ class MongoRepository {
585
584
  });
586
585
  }
587
586
  }
588
- const paymentMethodAdditionalPropertyAll = (_17 = (_16 = params.paymentMethods) === null || _16 === void 0 ? void 0 : _16.additionalProperty) === null || _17 === void 0 ? void 0 : _17.$all;
587
+ const paymentMethodAdditionalPropertyAll = (_20 = (_19 = params.paymentMethods) === null || _19 === void 0 ? void 0 : _19.additionalProperty) === null || _20 === void 0 ? void 0 : _20.$all;
589
588
  if (Array.isArray(paymentMethodAdditionalPropertyAll)) {
590
589
  andConditions.push({
591
590
  'paymentMethods.additionalProperty': {
@@ -594,7 +593,7 @@ class MongoRepository {
594
593
  }
595
594
  });
596
595
  }
597
- const paymentMethodAdditionalPropertyIn = (_19 = (_18 = params.paymentMethods) === null || _18 === void 0 ? void 0 : _18.additionalProperty) === null || _19 === void 0 ? void 0 : _19.$in;
596
+ const paymentMethodAdditionalPropertyIn = (_22 = (_21 = params.paymentMethods) === null || _21 === void 0 ? void 0 : _21.additionalProperty) === null || _22 === void 0 ? void 0 : _22.$in;
598
597
  if (Array.isArray(paymentMethodAdditionalPropertyIn)) {
599
598
  andConditions.push({
600
599
  'paymentMethods.additionalProperty': {
@@ -681,7 +680,10 @@ class MongoRepository {
681
680
  orderNumber: { $eq: params.orderNumber },
682
681
  orderStatus: { $eq: params.previousOrderStatus },
683
682
  'project.id': { $eq: params.project.id }
684
- }, { orderStatus: params.orderStatus }, {
683
+ }, {
684
+ previousOrderStatus: params.previousOrderStatus,
685
+ orderStatus: params.orderStatus
686
+ }, {
685
687
  new: true,
686
688
  projection: {
687
689
  __v: 0,
@@ -723,6 +725,7 @@ class MongoRepository {
723
725
  orderStatus: { $eq: factory.orderStatus.OrderDelivered },
724
726
  'project.id': { $eq: params.project.id }
725
727
  }, {
728
+ previousOrderStatus: factory.orderStatus.OrderDelivered,
726
729
  orderStatus: factory.orderStatus.OrderReturned,
727
730
  dateReturned: params.dateReturned,
728
731
  returner: params.returner
@@ -782,6 +785,35 @@ class MongoRepository {
782
785
  return { updatedAt: doc.updatedAt };
783
786
  });
784
787
  }
788
+ /**
789
+ * 注文後に決済方法区分を確定する
790
+ */
791
+ fixPaymentMethodIdentifier(params) {
792
+ return __awaiter(this, void 0, void 0, function* () {
793
+ const doc = yield this.orderModel.findOneAndUpdate({
794
+ orderNumber: { $eq: params.orderNumber },
795
+ 'project.id': { $eq: params.project.id },
796
+ 'paymentMethods.paymentMethodId': { $exists: true, $eq: params.invoice.paymentMethodId }
797
+ }, {
798
+ $set: {
799
+ 'paymentMethods.$[invoice].paymentMethod.identifier': params.invoice.paymentMethod.identifier,
800
+ // tslint:disable-next-line:no-suspicious-comment
801
+ // TODO 互換性維持対応としてtypeOfも変更しているが、そのうち廃止(2023-08-30)
802
+ 'paymentMethods.$[invoice].typeOf': params.invoice.paymentMethod.identifier
803
+ }
804
+ }, {
805
+ arrayFilters: [{ 'invoice.paymentMethodId': { $eq: params.invoice.paymentMethodId } }],
806
+ new: true,
807
+ projection: {
808
+ _id: 1
809
+ }
810
+ })
811
+ .exec();
812
+ if (doc === null) {
813
+ throw new factory.errors.NotFound(this.orderModel.modelName);
814
+ }
815
+ });
816
+ }
785
817
  findById(params) {
786
818
  return __awaiter(this, void 0, void 0, function* () {
787
819
  let projection = {};
@@ -30,11 +30,17 @@ export declare class MongoRepository {
30
30
  saveMany(taskAttributes: factory.task.IAttributes<factory.taskName>[], options: IOptionOnCreate): Promise<{
31
31
  id: string;
32
32
  }[]>;
33
+ /**
34
+ * タスク識別子から冪等作成する
35
+ */
36
+ createIfNotExistByIdentifier(params: factory.task.IAttributes<factory.taskName>, options: IOptionOnCreate): Promise<void>;
33
37
  createInformTaskIfNotExist(params: factory.task.IAttributes<factory.taskName.TriggerWebhook>, options: IOptionOnCreate): Promise<void>;
34
38
  /**
35
39
  * 取引削除タスク冪等作成
36
40
  */
37
41
  createDeleteTransactionTaskIfNotExist(params: factory.task.IAttributes<factory.taskName.DeleteTransaction>, options: IOptionOnCreate): Promise<void>;
42
+ createConfirmReserveTransactionTaskIfNotExist(params: factory.task.IAttributes<factory.taskName.ConfirmReserveTransaction>, options: IOptionOnCreate): Promise<void>;
43
+ createOnAssetTransactionStatusChangedTaskIfNotExist(params: factory.task.IAttributes<factory.taskName.OnAssetTransactionStatusChanged>, options: IOptionOnCreate): Promise<void>;
38
44
  createSendOrderTaskIfNotExist(params: factory.task.IAttributes<factory.taskName.SendOrder>, options: IOptionOnCreate): Promise<void>;
39
45
  executeById(params: {
40
46
  id: string;
@@ -68,7 +74,7 @@ export declare class MongoRepository {
68
74
  */
69
75
  $nin?: factory.taskName[];
70
76
  };
71
- }): Promise<Pick<import("@chevre/factory/lib/task").ITask | import("@chevre/factory/lib/task/confirmMoneyTransfer").ITask | import("@chevre/factory/lib/task/confirmRegisterService").ITask | import("@chevre/factory/lib/task/confirmPayTransaction").ITask | import("@chevre/factory/lib/task/confirmRegisterServiceTransaction").ITask | import("@chevre/factory/lib/task/confirmReserveTransaction").ITask | import("@chevre/factory/lib/task/createEvent").ITask | import("@chevre/factory/lib/task/deleteTransaction").ITask | import("@chevre/factory/lib/task/givePointAward").ITask | import("@chevre/factory/lib/task/onAuthorizationCreated").ITask | import("@chevre/factory/lib/task/onEventChanged").ITask | import("@chevre/factory/lib/task/onResourceUpdated").ITask | import("@chevre/factory/lib/task/placeOrder").ITask | import("@chevre/factory/lib/task/returnOrder").ITask | import("@chevre/factory/lib/task/returnMoneyTransfer").ITask | import("@chevre/factory/lib/task/returnPayTransaction").ITask | import("@chevre/factory/lib/task/returnPointAward").ITask | import("@chevre/factory/lib/task/returnReserveTransaction").ITask | import("@chevre/factory/lib/task/sendEmailMessage").ITask | import("@chevre/factory/lib/task/sendOrder").ITask | import("@chevre/factory/lib/task/syncScreeningRooms").ITask | import("@chevre/factory/lib/task/triggerWebhook").ITask | import("@chevre/factory/lib/task/useReservation").ITask | import("@chevre/factory/lib/task/voidMoneyTransferTransaction").ITask | import("@chevre/factory/lib/task/voidPayTransaction").ITask | import("@chevre/factory/lib/task/voidRegisterServiceTransaction").ITask | import("@chevre/factory/lib/task/voidReserveTransaction").ITask, "id" | "name" | "status">[]>;
77
+ }): Promise<Pick<import("@chevre/factory/lib/task").ITask | import("@chevre/factory/lib/task/confirmMoneyTransfer").ITask | import("@chevre/factory/lib/task/confirmRegisterService").ITask | import("@chevre/factory/lib/task/confirmPayTransaction").ITask | import("@chevre/factory/lib/task/confirmRegisterServiceTransaction").ITask | import("@chevre/factory/lib/task/confirmReserveTransaction").ITask | import("@chevre/factory/lib/task/createEvent").ITask | import("@chevre/factory/lib/task/deleteTransaction").ITask | import("@chevre/factory/lib/task/givePointAward").ITask | import("@chevre/factory/lib/task/onAssetTransactionStatusChanged").ITask | import("@chevre/factory/lib/task/onAuthorizationCreated").ITask | import("@chevre/factory/lib/task/onEventChanged").ITask | import("@chevre/factory/lib/task/onResourceUpdated").ITask | import("@chevre/factory/lib/task/onOrderPaymentCompleted").ITask | import("@chevre/factory/lib/task/placeOrder").ITask | import("@chevre/factory/lib/task/returnOrder").ITask | import("@chevre/factory/lib/task/returnMoneyTransfer").ITask | import("@chevre/factory/lib/task/returnPayTransaction").ITask | import("@chevre/factory/lib/task/returnPointAward").ITask | import("@chevre/factory/lib/task/returnReserveTransaction").ITask | import("@chevre/factory/lib/task/sendEmailMessage").ITask | import("@chevre/factory/lib/task/sendOrder").ITask | import("@chevre/factory/lib/task/syncAggregateOffer").ITask | import("@chevre/factory/lib/task/syncScreeningRooms").ITask | import("@chevre/factory/lib/task/triggerWebhook").ITask | import("@chevre/factory/lib/task/useReservation").ITask | import("@chevre/factory/lib/task/voidMoneyTransferTransaction").ITask | import("@chevre/factory/lib/task/voidPayTransaction").ITask | import("@chevre/factory/lib/task/voidRegisterServiceTransaction").ITask | import("@chevre/factory/lib/task/voidReserveTransaction").ITask, "id" | "name" | "status">[]>;
72
78
  retry(params: {
73
79
  intervalInMinutes: number;
74
80
  }): Promise<void>;
@@ -174,6 +174,30 @@ class MongoRepository {
174
174
  }
175
175
  });
176
176
  }
177
+ /**
178
+ * タスク識別子から冪等作成する
179
+ */
180
+ createIfNotExistByIdentifier(params, options) {
181
+ return __awaiter(this, void 0, void 0, function* () {
182
+ if (typeof params.identifier !== 'string' || params.identifier.length === 0) {
183
+ throw new factory.errors.ArgumentNull('identifier');
184
+ }
185
+ const createdTask = yield this.taskModel.findOneAndUpdate({
186
+ 'project.id': { $eq: params.project.id },
187
+ name: { $eq: params.name },
188
+ identifier: { $exists: true, $eq: params.identifier }
189
+ }, { $setOnInsert: params }, { new: true, upsert: true })
190
+ .select({ _id: 1 })
191
+ .exec();
192
+ if (options.emitImmediately) {
193
+ task_2.taskEventEmitter.emitTaskStatusChanged({
194
+ id: createdTask.id,
195
+ name: params.name,
196
+ status: factory.taskStatus.Ready
197
+ });
198
+ }
199
+ });
200
+ }
177
201
  createInformTaskIfNotExist(params, options) {
178
202
  return __awaiter(this, void 0, void 0, function* () {
179
203
  const createdTask = yield this.taskModel.findOneAndUpdate({
@@ -219,6 +243,56 @@ class MongoRepository {
219
243
  }
220
244
  });
221
245
  }
246
+ createConfirmReserveTransactionTaskIfNotExist(params, options) {
247
+ return __awaiter(this, void 0, void 0, function* () {
248
+ const createdTask = yield this.taskModel.findOneAndUpdate({
249
+ 'project.id': { $eq: params.project.id },
250
+ name: { $eq: params.name },
251
+ 'data.object.transactionNumber': {
252
+ $exists: true,
253
+ $eq: String(params.data.object.transactionNumber)
254
+ },
255
+ 'data.purpose.orderNumber': {
256
+ $exists: true,
257
+ $eq: String(params.data.purpose.orderNumber)
258
+ }
259
+ }, { $setOnInsert: params }, { new: true, upsert: true })
260
+ .select({ _id: 1 })
261
+ .exec();
262
+ if (options.emitImmediately) {
263
+ task_2.taskEventEmitter.emitTaskStatusChanged({
264
+ id: createdTask.id,
265
+ name: params.name,
266
+ status: factory.taskStatus.Ready
267
+ });
268
+ }
269
+ });
270
+ }
271
+ createOnAssetTransactionStatusChangedTaskIfNotExist(params, options) {
272
+ return __awaiter(this, void 0, void 0, function* () {
273
+ const createdTask = yield this.taskModel.findOneAndUpdate({
274
+ 'project.id': { $eq: params.project.id },
275
+ name: { $eq: params.name },
276
+ 'data.object.transactionNumber': {
277
+ $exists: true,
278
+ $eq: String(params.data.object.transactionNumber)
279
+ },
280
+ 'data.purpose.orderNumber': {
281
+ $exists: true,
282
+ $eq: String(params.data.purpose.orderNumber)
283
+ }
284
+ }, { $setOnInsert: params }, { new: true, upsert: true })
285
+ .select({ _id: 1 })
286
+ .exec();
287
+ if (options.emitImmediately) {
288
+ task_2.taskEventEmitter.emitTaskStatusChanged({
289
+ id: createdTask.id,
290
+ name: params.name,
291
+ status: factory.taskStatus.Ready
292
+ });
293
+ }
294
+ });
295
+ }
222
296
  createSendOrderTaskIfNotExist(params, options) {
223
297
  return __awaiter(this, void 0, void 0, function* () {
224
298
  const createdTask = yield this.taskModel.findOneAndUpdate({
@@ -240,6 +314,32 @@ class MongoRepository {
240
314
  }
241
315
  });
242
316
  }
317
+ // public async createOnOrderPaymentCompletedTaskIfNotExist(
318
+ // params: factory.task.IAttributes<factory.taskName.OnOrderPaymentCompleted>,
319
+ // options: IOptionOnCreate
320
+ // ): Promise<void> {
321
+ // const createdTask = await this.taskModel.findOneAndUpdate(
322
+ // {
323
+ // 'project.id': { $eq: params.project.id },
324
+ // name: { $eq: params.name },
325
+ // 'data.object.orderNumber': {
326
+ // $exists: true,
327
+ // $eq: String(params.data.object.orderNumber)
328
+ // }
329
+ // },
330
+ // { $setOnInsert: params },
331
+ // { new: true, upsert: true }
332
+ // )
333
+ // .select({ _id: 1 })
334
+ // .exec();
335
+ // if (options.emitImmediately) {
336
+ // taskEventEmitter.emitTaskStatusChanged({
337
+ // id: createdTask.id,
338
+ // name: params.name,
339
+ // status: factory.taskStatus.Ready
340
+ // });
341
+ // }
342
+ // }
243
343
  executeById(params) {
244
344
  return __awaiter(this, void 0, void 0, function* () {
245
345
  const doc = yield this.taskModel.findOneAndUpdate({
@@ -7,6 +7,7 @@ import { MongoRepository as AccountTitleRepo } from './repo/accountTitle';
7
7
  import { MongoRepository as AccountTransactionRepo } from './repo/accountTransaction';
8
8
  import { MongoRepository as ActionRepo } from './repo/action';
9
9
  import { MongoRepository as AdditionalPropertyRepo } from './repo/additionalProperty';
10
+ import { MongoRepository as AggregateOfferRepo } from './repo/aggregateOffer';
10
11
  import { MongoRepository as AggregationRepo } from './repo/aggregation';
11
12
  import { MongoRepository as AssetTransactionRepo } from './repo/assetTransaction';
12
13
  import { MongoRepository as CategoryCodeRepo } from './repo/categoryCode';
@@ -71,6 +72,8 @@ export declare class Action extends ActionRepo {
71
72
  */
72
73
  export declare class AdditionalProperty extends AdditionalPropertyRepo {
73
74
  }
75
+ export declare class AggregateOffer extends AggregateOfferRepo {
76
+ }
74
77
  export declare class Aggregation extends AggregationRepo {
75
78
  }
76
79
  export declare namespace action {
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.rateLimit = exports.Trip = exports.TransactionNumber = exports.Transaction = exports.Telemetry = exports.Task = exports.StockHolder = exports.ServiceOutputIdentifier = exports.ServiceOutput = exports.Seller = exports.Role = exports.Reservation = exports.Project = exports.ProductOffer = exports.Product = exports.PriceSpecification = exports.Place = exports.Permit = exports.Person = exports.paymentMethod = exports.PaymentServiceProvider = exports.OwnershipInfo = exports.OrderNumber = exports.Order = exports.Offer = exports.OfferItemCondition = exports.OfferCatalog = exports.MerchantReturnPolicy = exports.Member = exports.Event = exports.EmailMessage = exports.Customer = exports.CreativeWork = exports.ConfirmationNumber = exports.Comment = exports.Code = exports.CategoryCode = exports.AssetTransaction = exports.action = exports.Aggregation = exports.AdditionalProperty = exports.Action = exports.AccountTransaction = exports.AccountTitle = exports.AccountingReport = exports.Account = void 0;
3
+ exports.rateLimit = exports.Trip = exports.TransactionNumber = exports.Transaction = exports.Telemetry = exports.Task = exports.StockHolder = exports.ServiceOutputIdentifier = exports.ServiceOutput = exports.Seller = exports.Role = exports.Reservation = exports.Project = exports.ProductOffer = exports.Product = exports.PriceSpecification = exports.Place = exports.Permit = exports.Person = exports.paymentMethod = exports.PaymentServiceProvider = exports.OwnershipInfo = exports.OrderNumber = exports.Order = exports.Offer = exports.OfferItemCondition = exports.OfferCatalog = exports.MerchantReturnPolicy = exports.Member = exports.Event = exports.EmailMessage = exports.Customer = exports.CreativeWork = exports.ConfirmationNumber = exports.Comment = exports.Code = exports.CategoryCode = exports.AssetTransaction = exports.action = exports.Aggregation = exports.AggregateOffer = exports.AdditionalProperty = exports.Action = exports.AccountTransaction = exports.AccountTitle = exports.AccountingReport = exports.Account = void 0;
4
4
  // tslint:disable:max-classes-per-file completed-docs
5
5
  /**
6
6
  * リポジトリ
@@ -11,6 +11,7 @@ const accountTitle_1 = require("./repo/accountTitle");
11
11
  const accountTransaction_1 = require("./repo/accountTransaction");
12
12
  const action_1 = require("./repo/action");
13
13
  const additionalProperty_1 = require("./repo/additionalProperty");
14
+ const aggregateOffer_1 = require("./repo/aggregateOffer");
14
15
  const aggregation_1 = require("./repo/aggregation");
15
16
  const assetTransaction_1 = require("./repo/assetTransaction");
16
17
  const categoryCode_1 = require("./repo/categoryCode");
@@ -81,6 +82,9 @@ exports.Action = Action;
81
82
  class AdditionalProperty extends additionalProperty_1.MongoRepository {
82
83
  }
83
84
  exports.AdditionalProperty = AdditionalProperty;
85
+ class AggregateOffer extends aggregateOffer_1.MongoRepository {
86
+ }
87
+ exports.AggregateOffer = AggregateOffer;
84
88
  class Aggregation extends aggregation_1.MongoRepository {
85
89
  }
86
90
  exports.Aggregation = Aggregation;
@@ -180,7 +180,8 @@ function findOffers(params) {
180
180
  const findOffersByOfferCatalogIdResult = yield repos.offer.findOffersByOfferCatalogId({
181
181
  offerCatalog: { id: eventService.hasOfferCatalog.id },
182
182
  excludeAppliesToMovieTicket: false,
183
- sort: false // ソート不要(2023-01-27~)
183
+ useOffersAsPrimaryForcible: false
184
+ // sort: false // ソート不要(2023-01-27~) // 完全廃止(2023-09-04~)
184
185
  });
185
186
  availableOffers = findOffersByOfferCatalogIdResult.offers;
186
187
  }
@@ -105,7 +105,8 @@ function findOffers(params) {
105
105
  const findOffersByOfferCatalogIdResult = yield repos.offer.findOffersByOfferCatalogId({
106
106
  offerCatalog: { id: eventService.hasOfferCatalog.id },
107
107
  excludeAppliesToMovieTicket: false,
108
- sort: false // ソート不要(2023-01-27~)
108
+ useOffersAsPrimaryForcible: false
109
+ // sort: false // ソート不要(2023-01-27~) // 完全廃止(2023-09-04~)
109
110
  });
110
111
  availableOffers = findOffersByOfferCatalogIdResult.offers;
111
112
  }
@@ -15,9 +15,9 @@ function validateAccount(params) {
15
15
  return (repos) => __awaiter(this, void 0, void 0, function* () {
16
16
  var _a, _b, _c, _d;
17
17
  // 引き出し口座の存在を確認する
18
- const paymentMethodType = (_a = params.object.paymentMethod) === null || _a === void 0 ? void 0 : _a.typeOf;
18
+ const paymentMethodType = (_a = params.object.paymentMethod) === null || _a === void 0 ? void 0 : _a.identifier;
19
19
  if (typeof paymentMethodType !== 'string') {
20
- throw new factory.errors.ArgumentNull('object.paymentMethod.typeOf');
20
+ throw new factory.errors.ArgumentNull('object.paymentMethod.identifier');
21
21
  }
22
22
  const accountNumber = (_b = params.object.paymentMethod) === null || _b === void 0 ? void 0 : _b.accountId;
23
23
  if (typeof accountNumber !== 'string') {
@@ -8,16 +8,16 @@ const factory = require("../../../factory");
8
8
  const settings_1 = require("../../../settings");
9
9
  // tslint:disable-next-line:cyclomatic-complexity max-func-body-length
10
10
  function createStartParams(params) {
11
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1;
11
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0;
12
12
  const paymentServiceId = (params.paymentService !== undefined)
13
13
  ? String(params.paymentService.id)
14
14
  : '';
15
15
  const paymentMethodType = (params.paymentService !== undefined)
16
16
  // FaceToFace以外は、プロダクトから決済方法タイプを自動取得
17
17
  ? (_a = params.paymentService.serviceType) === null || _a === void 0 ? void 0 : _a.codeValue
18
- : (_b = params.object.paymentMethod) === null || _b === void 0 ? void 0 : _b.typeOf;
18
+ : (_b = params.object.paymentMethod) === null || _b === void 0 ? void 0 : _b.identifier;
19
19
  if (typeof paymentMethodType !== 'string') {
20
- throw new factory.errors.ArgumentNull('object.paymentMethod.typeOf');
20
+ throw new factory.errors.ArgumentNull('object.paymentMethod.identifier');
21
21
  }
22
22
  let totalPaymentDue;
23
23
  switch (params.paymentServiceType) {
@@ -68,10 +68,16 @@ function createStartParams(params) {
68
68
  }
69
69
  }
70
70
  else if (params.paymentServiceType === factory.service.paymentService.PaymentServiceType.CreditCard) {
71
+ const creditCardPaymentServiceOutput = (_l = params.paymentService) === null || _l === void 0 ? void 0 : _l.serviceOutput;
72
+ const invoiceAsServiceOutput = (Array.isArray(creditCardPaymentServiceOutput))
73
+ ? creditCardPaymentServiceOutput.find((output) => output.typeOf === 'Invoice')
74
+ : creditCardPaymentServiceOutput;
71
75
  // カード通貨区分が存在すれば適用
72
- const creditCardAsPaymentServiceOutputCurrency = (_p = (_o = (_m = (_l = params.paymentService) === null || _l === void 0 ? void 0 : _l.serviceOutput) === null || _m === void 0 ? void 0 : _m.paymentMethod) === null || _o === void 0 ? void 0 : _o.amount) === null || _p === void 0 ? void 0 : _p.currency;
73
- if (typeof creditCardAsPaymentServiceOutputCurrency === 'string') {
74
- paymentMethodCurrency = creditCardAsPaymentServiceOutputCurrency;
76
+ if ((invoiceAsServiceOutput === null || invoiceAsServiceOutput === void 0 ? void 0 : invoiceAsServiceOutput.typeOf) === 'Invoice') {
77
+ const creditCardAsPaymentServiceOutputCurrency = (_o = (_m = invoiceAsServiceOutput.paymentMethod) === null || _m === void 0 ? void 0 : _m.amount) === null || _o === void 0 ? void 0 : _o.currency;
78
+ if (typeof creditCardAsPaymentServiceOutputCurrency === 'string') {
79
+ paymentMethodCurrency = creditCardAsPaymentServiceOutputCurrency;
80
+ }
75
81
  }
76
82
  }
77
83
  const paymentMethodAmount = {
@@ -79,22 +85,24 @@ function createStartParams(params) {
79
85
  currency: paymentMethodCurrency,
80
86
  value: params.amount
81
87
  };
82
- const paymentMethod = Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({ additionalProperty: (Array.isArray((_q = params.object.paymentMethod) === null || _q === void 0 ? void 0 : _q.additionalProperty))
83
- ? (_r = params.object.paymentMethod) === null || _r === void 0 ? void 0 : _r.additionalProperty
84
- : [], name: (typeof ((_s = params.object.paymentMethod) === null || _s === void 0 ? void 0 : _s.name) === 'string')
88
+ const paymentMethod = Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({ additionalProperty: (Array.isArray((_p = params.object.paymentMethod) === null || _p === void 0 ? void 0 : _p.additionalProperty))
89
+ ? (_q = params.object.paymentMethod) === null || _q === void 0 ? void 0 : _q.additionalProperty
90
+ : [], name: (typeof ((_r = params.object.paymentMethod) === null || _r === void 0 ? void 0 : _r.name) === 'string')
85
91
  ? params.object.paymentMethod.name
86
92
  : paymentMethodType,
87
93
  // MonetaryAmount対応(2023-08-14~)
88
- amount: (settings_1.USE_OBJECT_AS_PAY_TRANSACTION_AMOUNT) ? paymentMethodAmount : params.amount, paymentMethodId: params.transactionNumber, typeOf: paymentMethodType }, (typeof ((_t = params.object.paymentMethod) === null || _t === void 0 ? void 0 : _t.description) === 'string')
89
- ? { description: (_u = params.object.paymentMethod) === null || _u === void 0 ? void 0 : _u.description }
94
+ amount: (settings_1.USE_OBJECT_AS_PAY_TRANSACTION_AMOUNT) ? paymentMethodAmount : params.amount,
95
+ // paymentMethodId: params.transactionNumber, // object.paymentMethodIdへ完全移行(2023-08-30~)
96
+ identifier: paymentMethodType }, (typeof ((_s = params.object.paymentMethod) === null || _s === void 0 ? void 0 : _s.description) === 'string')
97
+ ? { description: (_t = params.object.paymentMethod) === null || _t === void 0 ? void 0 : _t.description }
90
98
  : undefined), (totalPaymentDue !== undefined)
91
99
  ? { totalPaymentDue: totalPaymentDue }
92
- : undefined), (typeof accountId === 'string') ? { accountId: accountId } : undefined), (typeof ((_v = params.object.paymentMethod) === null || _v === void 0 ? void 0 : _v.method) === 'string')
93
- ? { method: (_w = params.object.paymentMethod) === null || _w === void 0 ? void 0 : _w.method }
94
- : undefined), (((_x = params.object.paymentMethod) === null || _x === void 0 ? void 0 : _x.creditCard) !== undefined)
95
- ? { creditCard: (_y = params.object.paymentMethod) === null || _y === void 0 ? void 0 : _y.creditCard }
96
- : undefined), (Array.isArray((_z = params.object.paymentMethod) === null || _z === void 0 ? void 0 : _z.movieTickets))
97
- ? { movieTickets: (_0 = params.object.paymentMethod) === null || _0 === void 0 ? void 0 : _0.movieTickets }
100
+ : undefined), (typeof accountId === 'string') ? { accountId: accountId } : undefined), (typeof ((_u = params.object.paymentMethod) === null || _u === void 0 ? void 0 : _u.method) === 'string')
101
+ ? { method: (_v = params.object.paymentMethod) === null || _v === void 0 ? void 0 : _v.method }
102
+ : undefined), (((_w = params.object.paymentMethod) === null || _w === void 0 ? void 0 : _w.creditCard) !== undefined)
103
+ ? { creditCard: (_x = params.object.paymentMethod) === null || _x === void 0 ? void 0 : _x.creditCard }
104
+ : undefined), (Array.isArray((_y = params.object.paymentMethod) === null || _y === void 0 ? void 0 : _y.movieTickets))
105
+ ? { movieTickets: (_z = params.object.paymentMethod) === null || _z === void 0 ? void 0 : _z.movieTickets }
98
106
  : undefined);
99
107
  const object = {
100
108
  // パラメータから必要なもののみ取り込む
@@ -105,7 +113,7 @@ function createStartParams(params) {
105
113
  onPaymentStatusChanged: { informPayment: informPaymentParams },
106
114
  paymentMethod
107
115
  };
108
- return Object.assign({ project: { typeOf: factory.organizationType.Project, id: params.project.id }, transactionNumber: params.transactionNumber, typeOf: factory.assetTransactionType.Pay, agent: params.agent, recipient: params.recipient, object, expires: params.expires }, (typeof ((_1 = params.location) === null || _1 === void 0 ? void 0 : _1.typeOf) === 'string')
116
+ return Object.assign({ project: { typeOf: factory.organizationType.Project, id: params.project.id }, transactionNumber: params.transactionNumber, typeOf: factory.assetTransactionType.Pay, agent: params.agent, recipient: params.recipient, object, expires: params.expires }, (typeof ((_0 = params.location) === null || _0 === void 0 ? void 0 : _0.typeOf) === 'string')
109
117
  ? { location: params.location }
110
118
  : undefined);
111
119
  }
@@ -33,9 +33,9 @@ function createPayObject(params) {
33
33
  var _a;
34
34
  const transaction = params.transaction;
35
35
  const paymentMethod = transaction.object.paymentMethod;
36
- const paymentMethodType = String(paymentMethod === null || paymentMethod === void 0 ? void 0 : paymentMethod.typeOf);
36
+ const paymentMethodType = String(paymentMethod === null || paymentMethod === void 0 ? void 0 : paymentMethod.identifier);
37
37
  const additionalProperty = paymentMethod === null || paymentMethod === void 0 ? void 0 : paymentMethod.additionalProperty;
38
- const paymentMethodId = (typeof (paymentMethod === null || paymentMethod === void 0 ? void 0 : paymentMethod.paymentMethodId) === 'string') ? paymentMethod === null || paymentMethod === void 0 ? void 0 : paymentMethod.paymentMethodId : transaction.id;
38
+ const paymentMethodId = transaction.object.paymentMethodId;
39
39
  const paymentMethodName = (typeof (paymentMethod === null || paymentMethod === void 0 ? void 0 : paymentMethod.name) === 'string') ? paymentMethod === null || paymentMethod === void 0 ? void 0 : paymentMethod.name : paymentMethodType;
40
40
  // MonetaryAmount対応(2023-08-13~)
41
41
  const paymentMethodAmountValue = (typeof (paymentMethod === null || paymentMethod === void 0 ? void 0 : paymentMethod.amount) === 'number')
@@ -139,7 +139,7 @@ function createPayObjectServiceOutput(params) {
139
139
  // }
140
140
  break;
141
141
  case factory.service.paymentService.PaymentServiceType.MovieTicket:
142
- const paymentMethodType = paymentMethod === null || paymentMethod === void 0 ? void 0 : paymentMethod.typeOf;
142
+ const paymentMethodType = paymentMethod === null || paymentMethod === void 0 ? void 0 : paymentMethod.identifier;
143
143
  const movieTickets = paymentMethod === null || paymentMethod === void 0 ? void 0 : paymentMethod.movieTickets;
144
144
  if (Array.isArray(movieTickets)) {
145
145
  paymentServiceOutput = movieTickets.map((movieTicket) => {