@chevre/domain 25.2.0-alpha.3 → 25.2.0-alpha.30

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 (89) hide show
  1. package/lib/chevre/factory/customerTelephone2COATelNum.d.ts +3 -0
  2. package/lib/chevre/factory/customerTelephone2COATelNum.js +23 -0
  3. package/lib/chevre/repo/action/acceptPay.d.ts +15 -0
  4. package/lib/chevre/repo/action/acceptPay.js +47 -19
  5. package/lib/chevre/repo/action/actionProcess.js +57 -57
  6. package/lib/chevre/repo/action.d.ts +16 -9
  7. package/lib/chevre/repo/action.js +99 -180
  8. package/lib/chevre/repo/message.d.ts +1 -1
  9. package/lib/chevre/repo/message.js +1 -1
  10. package/lib/chevre/repo/mongoose/schemas/action.js +67 -66
  11. package/lib/chevre/repo/mongoose/schemas/order.d.ts +4 -0
  12. package/lib/chevre/repo/mongoose/schemas/order.js +10 -0
  13. package/lib/chevre/repo/mongoose/schemas/setting.d.ts +4 -0
  14. package/lib/chevre/repo/mongoose/schemas/task.js +12 -12
  15. package/lib/chevre/repo/order.d.ts +735 -0
  16. package/lib/chevre/repo/order.js +13 -20
  17. package/lib/chevre/repo/orderInTransaction.d.ts +45 -0
  18. package/lib/chevre/repo/orderInTransaction.js +175 -0
  19. package/lib/chevre/repo/person.d.ts +0 -15
  20. package/lib/chevre/repo/person.js +122 -108
  21. package/lib/chevre/repo/transaction/placeOrder.d.ts +2 -45
  22. package/lib/chevre/repo/transaction/placeOrder.js +43 -83
  23. package/lib/chevre/service/assetTransaction/pay/publishPaymentUrl.js +1 -1
  24. package/lib/chevre/service/assetTransaction/pay/start/factory.js +3 -4
  25. package/lib/chevre/service/offer/event/authorize/factory.d.ts +5 -5
  26. package/lib/chevre/service/offer/event/authorize/factory.js +30 -20
  27. package/lib/chevre/service/offer/event/authorize.d.ts +2 -2
  28. package/lib/chevre/service/offer/event/authorize.js +3 -3
  29. package/lib/chevre/service/offer/eventServiceByCOA/authorize/factory.d.ts +6 -7
  30. package/lib/chevre/service/offer/eventServiceByCOA/authorize/factory.js +10 -10
  31. package/lib/chevre/service/offer/eventServiceByCOA/authorize.d.ts +0 -5
  32. package/lib/chevre/service/offer/eventServiceByCOA/authorize.js +17 -14
  33. package/lib/chevre/service/offer/eventServiceByCOA/authorizeByAcceptAction.d.ts +0 -5
  34. package/lib/chevre/service/offer/eventServiceByCOA/authorizeByAcceptAction.js +2 -2
  35. package/lib/chevre/service/offer/eventServiceByCOA/changeOffers.js +1 -1
  36. package/lib/chevre/service/order/deleteOrder.d.ts +5 -1
  37. package/lib/chevre/service/order/deleteOrder.js +8 -1
  38. package/lib/chevre/service/order/onAssetTransactionStatusChanged/onPayTransactionConfirmed.d.ts +2 -0
  39. package/lib/chevre/service/order/onAssetTransactionStatusChanged/paymentDue2Processing.d.ts +2 -0
  40. package/lib/chevre/service/order/onAssetTransactionStatusChanged.d.ts +2 -0
  41. package/lib/chevre/service/order/onOrderStatusChanged/onOrderProcessing/createSendEmailMessageTaskIfNotExist.d.ts +5 -1
  42. package/lib/chevre/service/order/onOrderStatusChanged/onOrderProcessing/createSendEmailMessageTaskIfNotExist.js +95 -33
  43. package/lib/chevre/service/order/onOrderStatusChanged/onOrderProcessing.d.ts +2 -0
  44. package/lib/chevre/service/order/onOrderStatusChanged/onOrderReturned.js +2 -6
  45. package/lib/chevre/service/order/payOrder.d.ts +2 -0
  46. package/lib/chevre/service/order/placeOrder.d.ts +2 -0
  47. package/lib/chevre/service/payment/any/authorize/fixOrderAsNeeded.js +1 -2
  48. package/lib/chevre/service/payment/any/authorize/fixTransactionNumber.d.ts +3 -2
  49. package/lib/chevre/service/payment/any/authorize/handlePrePublishedPaymentMethodIdOnAuthorizing.d.ts +4 -3
  50. package/lib/chevre/service/payment/any/authorize/handlePrePublishedPaymentMethodIdOnAuthorizing.js +3 -31
  51. package/lib/chevre/service/payment/any/authorize.js +13 -37
  52. package/lib/chevre/service/payment/any/factory.d.ts +6 -6
  53. package/lib/chevre/service/payment/any/factory.js +19 -22
  54. package/lib/chevre/service/payment/any/findAcceptAction.d.ts +3 -1
  55. package/lib/chevre/service/payment/any/findAcceptAction.js +14 -6
  56. package/lib/chevre/service/payment/any/invalidatePaymentUrl.d.ts +2 -0
  57. package/lib/chevre/service/payment/any/invalidatePaymentUrl.js +4 -66
  58. package/lib/chevre/service/payment/any/publishPaymentUrl.d.ts +4 -0
  59. package/lib/chevre/service/payment/any/publishPaymentUrl.js +4 -18
  60. package/lib/chevre/service/payment/any/voidPayTransaction.d.ts +2 -0
  61. package/lib/chevre/service/payment/any/voidPayTransaction.js +1 -23
  62. package/lib/chevre/service/payment/creditCard/authorize/processAuthorizeCreditCard.d.ts +1 -1
  63. package/lib/chevre/service/payment/creditCard/authorize/processAuthorizeCreditCard.js +5 -9
  64. package/lib/chevre/service/reserve/potentialActions/onReservationConfirmed.js +17 -8
  65. package/lib/chevre/service/reserve/searchByOrder.js +2 -6
  66. package/lib/chevre/service/task/confirmReserveTransaction.js +2 -7
  67. package/lib/chevre/service/task/onAssetTransactionStatusChanged.js +2 -2
  68. package/lib/chevre/service/task/onOrderPaymentCompleted.js +2 -0
  69. package/lib/chevre/service/task/placeOrder.js +2 -2
  70. package/lib/chevre/service/task/publishPaymentUrl.js +7 -3
  71. package/lib/chevre/service/task/voidPayTransaction.js +3 -7
  72. package/lib/chevre/service/transaction/deleteTransaction/deletePayTransactionsByPlaceOrder.d.ts +15 -0
  73. package/lib/chevre/service/transaction/deleteTransaction/deletePayTransactionsByPlaceOrder.js +51 -0
  74. package/lib/chevre/service/transaction/deleteTransaction/deleteReservationsByPlaceOrder.d.ts +23 -0
  75. package/lib/chevre/service/transaction/deleteTransaction/deleteReservationsByPlaceOrder.js +64 -0
  76. package/lib/chevre/service/transaction/deleteTransaction.js +15 -152
  77. package/lib/chevre/service/transaction/placeOrder/confirm/potentialActions.js +0 -1
  78. package/lib/chevre/service/transaction/placeOrder/confirm/prepareUnitPriceOfferConditions.d.ts +7 -2
  79. package/lib/chevre/service/transaction/placeOrder/confirm/prepareUnitPriceOfferConditions.js +16 -12
  80. package/lib/chevre/service/transaction/placeOrder/confirm/validation/factory.d.ts +5 -1
  81. package/lib/chevre/service/transaction/placeOrder/confirm/validation.d.ts +11 -2
  82. package/lib/chevre/service/transaction/placeOrder/confirm/validation.js +112 -91
  83. package/lib/chevre/service/transaction/placeOrder/confirm.d.ts +4 -0
  84. package/lib/chevre/service/transaction/placeOrder/confirm.js +31 -74
  85. package/lib/chevre/service/transaction/placeOrder/publishConfirmationNumberIfNotExist.d.ts +4 -7
  86. package/lib/chevre/service/transaction/placeOrder/publishConfirmationNumberIfNotExist.js +33 -15
  87. package/lib/chevre/service/transaction/placeOrder/updateAgent.d.ts +2 -0
  88. package/lib/chevre/service/transaction/placeOrder/updateAgent.js +19 -9
  89. package/package.json +5 -4
@@ -21,9 +21,9 @@ const schemaDefinition = {
21
21
  endDate: Date,
22
22
  purpose: mongoose_1.SchemaTypes.Mixed,
23
23
  potentialActions: mongoose_1.SchemaTypes.Mixed,
24
- amount: mongoose_1.SchemaTypes.Mixed,
25
- fromLocation: mongoose_1.SchemaTypes.Mixed,
26
- toLocation: mongoose_1.SchemaTypes.Mixed,
24
+ // amount: SchemaTypes.Mixed, // discontinue(2026-07-08~)
25
+ // fromLocation: SchemaTypes.Mixed, // discontinue(2026-07-08~)
26
+ // toLocation: SchemaTypes.Mixed, // discontinue(2026-07-08~)
27
27
  instrument: mongoose_1.SchemaTypes.Mixed,
28
28
  location: mongoose_1.SchemaTypes.Mixed, // add location(2022-11-11~)
29
29
  replacer: mongoose_1.SchemaTypes.Mixed, // add replacer(2024-03-19~)
@@ -221,15 +221,16 @@ const indexes = [
221
221
  }
222
222
  }
223
223
  ],
224
- [
225
- { 'object.event.id': 1, startDate: -1 },
226
- {
227
- name: 'searchByObjectEventId',
228
- partialFilterExpression: {
229
- 'object.event.id': { $exists: true }
230
- }
231
- }
232
- ],
224
+ // 承認アクションのobject.event廃止につき検索条件も廃止(2026-07-07~)
225
+ // [
226
+ // { 'object.event.id': 1, startDate: -1 },
227
+ // {
228
+ // name: 'searchByObjectEventId',
229
+ // partialFilterExpression: {
230
+ // 'object.event.id': { $exists: true }
231
+ // }
232
+ // }
233
+ // ],
233
234
  [
234
235
  { 'about.id': 1, startDate: -1 },
235
236
  {
@@ -329,60 +330,60 @@ const indexes = [
329
330
  }
330
331
  }
331
332
  ],
332
- [
333
- { 'fromLocation.typeOf': 1, startDate: -1 },
334
- {
335
- name: 'searchByFromLocationTypeOf',
336
- partialFilterExpression: {
337
- 'fromLocation.typeOf': { $exists: true }
338
- }
339
- }
340
- ],
341
- [
342
- { 'fromLocation.accountNumber': 1, startDate: -1 },
343
- {
344
- name: 'searchByFromLocationAccountNumber',
345
- partialFilterExpression: {
346
- 'fromLocation.accountNumber': { $exists: true }
347
- }
348
- }
349
- ],
350
- [
351
- { 'fromLocation.accountType': 1, startDate: -1 },
352
- {
353
- name: 'searchByFromLocationAccountType',
354
- partialFilterExpression: {
355
- 'fromLocation.accountType': { $exists: true }
356
- }
357
- }
358
- ],
359
- [
360
- { 'toLocation.typeOf': 1, startDate: -1 },
361
- {
362
- name: 'searchByToLocationTypeOf',
363
- partialFilterExpression: {
364
- 'toLocation.typeOf': { $exists: true }
365
- }
366
- }
367
- ],
368
- [
369
- { 'toLocation.accountNumber': 1, startDate: -1 },
370
- {
371
- name: 'searchByToLocationAccountNumber',
372
- partialFilterExpression: {
373
- 'toLocation.accountNumber': { $exists: true }
374
- }
375
- }
376
- ],
377
- [
378
- { 'toLocation.accountType': 1, startDate: -1 },
379
- {
380
- name: 'searchByToLocationAccountType',
381
- partialFilterExpression: {
382
- 'toLocation.accountType': { $exists: true }
383
- }
384
- }
385
- ],
333
+ // [
334
+ // { 'fromLocation.typeOf': 1, startDate: -1 },
335
+ // {
336
+ // name: 'searchByFromLocationTypeOf',
337
+ // partialFilterExpression: {
338
+ // 'fromLocation.typeOf': { $exists: true }
339
+ // }
340
+ // }
341
+ // ],
342
+ // [
343
+ // { 'fromLocation.accountNumber': 1, startDate: -1 },
344
+ // {
345
+ // name: 'searchByFromLocationAccountNumber',
346
+ // partialFilterExpression: {
347
+ // 'fromLocation.accountNumber': { $exists: true }
348
+ // }
349
+ // }
350
+ // ],
351
+ // [
352
+ // { 'fromLocation.accountType': 1, startDate: -1 },
353
+ // {
354
+ // name: 'searchByFromLocationAccountType',
355
+ // partialFilterExpression: {
356
+ // 'fromLocation.accountType': { $exists: true }
357
+ // }
358
+ // }
359
+ // ],
360
+ // [
361
+ // { 'toLocation.typeOf': 1, startDate: -1 },
362
+ // {
363
+ // name: 'searchByToLocationTypeOf',
364
+ // partialFilterExpression: {
365
+ // 'toLocation.typeOf': { $exists: true }
366
+ // }
367
+ // }
368
+ // ],
369
+ // [
370
+ // { 'toLocation.accountNumber': 1, startDate: -1 },
371
+ // {
372
+ // name: 'searchByToLocationAccountNumber',
373
+ // partialFilterExpression: {
374
+ // 'toLocation.accountNumber': { $exists: true }
375
+ // }
376
+ // }
377
+ // ],
378
+ // [
379
+ // { 'toLocation.accountType': 1, startDate: -1 },
380
+ // {
381
+ // name: 'searchByToLocationAccountType',
382
+ // partialFilterExpression: {
383
+ // 'toLocation.accountType': { $exists: true }
384
+ // }
385
+ // }
386
+ // ],
386
387
  [
387
388
  { 'instrument.transactionNumber': 1, startDate: -1 },
388
389
  {
@@ -7,6 +7,10 @@ type IDocType = Omit<factory.order.IOrder, 'id'> & {
7
7
  * 注文取引IDとして再定義(2026-06-22~)
8
8
  */
9
9
  identifier?: string;
10
+ /**
11
+ * 外部URL決済の場合に発行される決済方法IDとして定義(2026-07-12~)
12
+ */
13
+ paymentMethodId?: string;
10
14
  };
11
15
  type IModel = Model<IDocType, Record<string, never>, Record<string, never>, IVirtuals>;
12
16
  type ISchemaDefinition = SchemaDefinition<IDocType>;
@@ -27,6 +27,7 @@ const schemaDefinition = {
27
27
  dateReturned: Date,
28
28
  orderedItem: [mongoose_1.SchemaTypes.Mixed],
29
29
  identifier: { type: String, required: true }, // 注文取引IDとして再定義(2026-06-22~)
30
+ paymentMethodId: { type: String, required: false }, // 注文取引から移行(2026-07-12~)
30
31
  // 以下廃止(2026-06-13~)
31
32
  // identifier: SchemaTypes.Mixed, // 廃止するためにMixed化(2026-06-12~)
32
33
  // isGift: Boolean,
@@ -343,6 +344,15 @@ const indexes = [
343
344
  }
344
345
  }
345
346
  ],
347
+ [
348
+ { paymentMethodId: 1, orderDate: -1 },
349
+ {
350
+ name: 'paymentMethodId',
351
+ partialFilterExpression: {
352
+ paymentMethodId: { $exists: true }
353
+ }
354
+ }
355
+ ],
346
356
  [
347
357
  { price: 1, orderDate: -1 },
348
358
  {
@@ -13,6 +13,10 @@ interface IOnReservationStatusChanged {
13
13
  * AggService通知先
14
14
  */
15
15
  informReservation?: factory.project.IInformParams[];
16
+ /**
17
+ * 確定予約最小化をサポート(2026-07-14~)
18
+ */
19
+ minimizeReservation?: boolean;
16
20
  }
17
21
  interface IOnTaskStatusChanged {
18
22
  /**
@@ -214,19 +214,19 @@ const indexes = [
214
214
  alternateName: { $exists: true }
215
215
  }
216
216
  }
217
+ ],
218
+ // add unique index(dev)(2025-03-28~)
219
+ // add unique index(test,prod)(2026-07-08~)
220
+ [
221
+ { identifier: 1 },
222
+ {
223
+ unique: true,
224
+ name: 'uniqueIdentifier',
225
+ partialFilterExpression: {
226
+ identifier: { $exists: true }
227
+ }
228
+ }
217
229
  ]
218
- // eslint-disable-next-line no-warning-comments
219
- // TODO add unique index(2025-03-28~)
220
- // [
221
- // { identifier: 1 },
222
- // {
223
- // unique: true,
224
- // name: 'uniqueIdentifier',
225
- // partialFilterExpression: {
226
- // identifier: { $exists: true }
227
- // }
228
- // }
229
- // ]
230
230
  ];
231
231
  exports.indexes = indexes;
232
232
  /**