@chevre/domain 25.2.0-alpha.5 → 25.2.0-alpha.50

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 (202) hide show
  1. package/lib/chevre/eventEmitter/task.d.ts +2 -1
  2. package/lib/chevre/factory/customerTelephone2COATelNum.d.ts +3 -0
  3. package/lib/chevre/factory/customerTelephone2COATelNum.js +22 -0
  4. package/lib/chevre/repo/action/acceptPay.d.ts +15 -0
  5. package/lib/chevre/repo/action/acceptPay.js +47 -19
  6. package/lib/chevre/repo/action/actionProcess.js +57 -57
  7. package/lib/chevre/repo/action.d.ts +16 -9
  8. package/lib/chevre/repo/action.js +99 -180
  9. package/lib/chevre/repo/aggregateOffer.d.ts +3 -14
  10. package/lib/chevre/repo/aggregateOffer.js +16 -125
  11. package/lib/chevre/repo/asyncAction.d.ts +64 -0
  12. package/lib/chevre/repo/asyncAction.js +178 -0
  13. package/lib/chevre/repo/concurrentLock.d.ts +3 -1
  14. package/lib/chevre/repo/creativeWork.d.ts +2 -3
  15. package/lib/chevre/repo/credentials.d.ts +2 -1
  16. package/lib/chevre/repo/customerType.d.ts +2 -3
  17. package/lib/chevre/repo/event.d.ts +10 -11
  18. package/lib/chevre/repo/eventOffer.d.ts +4 -5
  19. package/lib/chevre/repo/eventSellerMakesOffer.d.ts +2 -3
  20. package/lib/chevre/repo/eventSeries.d.ts +4 -5
  21. package/lib/chevre/repo/message.d.ts +1 -1
  22. package/lib/chevre/repo/message.js +1 -1
  23. package/lib/chevre/repo/mongoose/schemas/action.js +67 -66
  24. package/lib/chevre/repo/mongoose/schemas/asyncAction.d.ts +11 -0
  25. package/lib/chevre/repo/mongoose/schemas/asyncAction.js +89 -0
  26. package/lib/chevre/repo/mongoose/schemas/order.d.ts +4 -0
  27. package/lib/chevre/repo/mongoose/schemas/order.js +10 -0
  28. package/lib/chevre/repo/mongoose/schemas/setting.d.ts +4 -0
  29. package/lib/chevre/repo/mongoose/schemas/task.js +12 -12
  30. package/lib/chevre/repo/note.d.ts +3 -4
  31. package/lib/chevre/repo/noteAboutOrder.d.ts +2 -3
  32. package/lib/chevre/repo/offer/offerInCatalogReadOnly.d.ts +2 -2
  33. package/lib/chevre/repo/offer/unitPriceInCatalog.d.ts +2 -2
  34. package/lib/chevre/repo/offer/unitPriceInCatalog.js +59 -11
  35. package/lib/chevre/repo/offerCatalog.d.ts +2 -3
  36. package/lib/chevre/repo/offerCatalogItem.d.ts +2 -3
  37. package/lib/chevre/repo/order.d.ts +2 -0
  38. package/lib/chevre/repo/order.js +14 -14
  39. package/lib/chevre/repo/orderInTransaction.d.ts +68 -1
  40. package/lib/chevre/repo/orderInTransaction.js +181 -3
  41. package/lib/chevre/repo/passport.d.ts +2 -1
  42. package/lib/chevre/repo/person.d.ts +0 -15
  43. package/lib/chevre/repo/person.js +122 -108
  44. package/lib/chevre/repo/place/entranceGate.d.ts +4 -5
  45. package/lib/chevre/repo/place/movieTheater.d.ts +3 -4
  46. package/lib/chevre/repo/place/screeningRoom.d.ts +4 -5
  47. package/lib/chevre/repo/place/seat.d.ts +4 -5
  48. package/lib/chevre/repo/place/section.d.ts +3 -4
  49. package/lib/chevre/repo/priceSpecification.d.ts +4 -4
  50. package/lib/chevre/repo/product.d.ts +3 -4
  51. package/lib/chevre/repo/rateLimit/offer.d.ts +3 -1
  52. package/lib/chevre/repo/rateLimit/offer.js +0 -12
  53. package/lib/chevre/repo/reservation.d.ts +2 -3
  54. package/lib/chevre/repo/sellerMakesOffer.d.ts +3 -4
  55. package/lib/chevre/repo/stockHolder.d.ts +1 -1
  56. package/lib/chevre/repo/stockHolder.js +0 -146
  57. package/lib/chevre/repo/transaction/placeOrder.d.ts +2 -45
  58. package/lib/chevre/repo/transaction/placeOrder.js +43 -83
  59. package/lib/chevre/repo/transaction.d.ts +2 -2
  60. package/lib/chevre/repo/transactionNumberCounter.js +0 -34
  61. package/lib/chevre/repo/transactionProcess.d.ts +2 -1
  62. package/lib/chevre/repo/transactionProcess.js +0 -13
  63. package/lib/chevre/repository.d.ts +5 -0
  64. package/lib/chevre/repository.js +12 -1
  65. package/lib/chevre/service/assetTransaction/pay/publishPaymentUrl.js +1 -1
  66. package/lib/chevre/service/assetTransaction/pay/start/factory.d.ts +1 -1
  67. package/lib/chevre/service/assetTransaction/pay/start/factory.js +3 -4
  68. package/lib/chevre/service/assetTransaction/pay/start.d.ts +1 -1
  69. package/lib/chevre/service/asyncAction.d.ts +16 -0
  70. package/lib/chevre/service/asyncAction.js +36 -0
  71. package/lib/chevre/service/asyncActionHandler/onOperationFailed.d.ts +15 -0
  72. package/lib/chevre/service/asyncActionHandler/onOperationFailed.js +42 -0
  73. package/lib/chevre/service/asyncActionHandler.d.ts +13 -0
  74. package/lib/chevre/service/asyncActionHandler.js +89 -0
  75. package/lib/chevre/service/notification/factory.d.ts +2 -4
  76. package/lib/chevre/service/notification/factory.js +26 -24
  77. package/lib/chevre/service/notification/notifyAbortedTasksByEmail.d.ts +11 -5
  78. package/lib/chevre/service/notification/notifyAbortedTasksByEmail.js +11 -3
  79. package/lib/chevre/service/offer/event/authorize/factory.d.ts +3 -5
  80. package/lib/chevre/service/offer/event/authorize/factory.js +93 -75
  81. package/lib/chevre/service/offer/event/authorize.d.ts +0 -4
  82. package/lib/chevre/service/offer/event/authorize.js +2 -2
  83. package/lib/chevre/service/offer/eventServiceByCOA/authorize/factory.d.ts +6 -7
  84. package/lib/chevre/service/offer/eventServiceByCOA/authorize/factory.js +10 -10
  85. package/lib/chevre/service/offer/eventServiceByCOA/authorize/validateAcceptedOffers.js +2 -1
  86. package/lib/chevre/service/offer/eventServiceByCOA/authorize.d.ts +0 -5
  87. package/lib/chevre/service/offer/eventServiceByCOA/authorize.js +15 -12
  88. package/lib/chevre/service/offer/eventServiceByCOA/authorizeByAcceptAction.d.ts +0 -5
  89. package/lib/chevre/service/offer/eventServiceByCOA/authorizeByAcceptAction.js +2 -2
  90. package/lib/chevre/service/offer/eventServiceByCOA/findAcceptAction.d.ts +4 -0
  91. package/lib/chevre/service/offer/eventServiceByCOA/findAcceptAction.js +22 -9
  92. package/lib/chevre/service/order/deleteOrder.d.ts +5 -1
  93. package/lib/chevre/service/order/deleteOrder.js +8 -1
  94. package/lib/chevre/service/order/onAssetTransactionStatusChanged/onPayTransactionCanceled.js +19 -11
  95. package/lib/chevre/service/order/onAssetTransactionStatusChanged/onPayTransactionConfirmed.d.ts +2 -0
  96. package/lib/chevre/service/order/onAssetTransactionStatusChanged/paymentDue2Processing.d.ts +2 -2
  97. package/lib/chevre/service/order/onAssetTransactionStatusChanged/paymentDue2Processing.js +1 -7
  98. package/lib/chevre/service/order/onAssetTransactionStatusChanged.d.ts +2 -0
  99. package/lib/chevre/service/order/onAssetTransactionStatusChanged.js +2 -0
  100. package/lib/chevre/service/order/onOrderStatusChanged/onOrderProcessing/createSendEmailMessageTaskIfNotExist.d.ts +5 -1
  101. package/lib/chevre/service/order/onOrderStatusChanged/onOrderProcessing/createSendEmailMessageTaskIfNotExist.js +95 -33
  102. package/lib/chevre/service/order/onOrderStatusChanged/onOrderProcessing.d.ts +2 -2
  103. package/lib/chevre/service/order/onOrderStatusChanged/onOrderProcessing.js +4 -2
  104. package/lib/chevre/service/order/onOrderStatusChanged/onOrderReturned.js +2 -6
  105. package/lib/chevre/service/order/payOrder.d.ts +2 -0
  106. package/lib/chevre/service/order/placeOrder/createPlacingOrderFromExistingTransaction.d.ts +2 -1
  107. package/lib/chevre/service/order/placeOrder/createPlacingOrderFromExistingTransaction.js +13 -58
  108. package/lib/chevre/service/order/placeOrder/factory.js +3 -21
  109. package/lib/chevre/service/order/placeOrder.d.ts +4 -5
  110. package/lib/chevre/service/order/placeOrder.js +20 -31
  111. package/lib/chevre/service/payment/any/authorize/fixOrderAsNeeded.js +1 -2
  112. package/lib/chevre/service/payment/any/authorize/fixTransactionNumber.d.ts +3 -2
  113. package/lib/chevre/service/payment/any/authorize/handlePrePublishedPaymentMethodIdOnAuthorizing.d.ts +4 -3
  114. package/lib/chevre/service/payment/any/authorize/handlePrePublishedPaymentMethodIdOnAuthorizing.js +3 -31
  115. package/lib/chevre/service/payment/any/authorize.js +13 -37
  116. package/lib/chevre/service/payment/any/factory.d.ts +7 -7
  117. package/lib/chevre/service/payment/any/factory.js +19 -22
  118. package/lib/chevre/service/payment/any/findAcceptAction.d.ts +3 -1
  119. package/lib/chevre/service/payment/any/findAcceptAction.js +14 -6
  120. package/lib/chevre/service/payment/any/invalidatePaymentUrl.d.ts +2 -0
  121. package/lib/chevre/service/payment/any/invalidatePaymentUrl.js +4 -66
  122. package/lib/chevre/service/payment/any/publishPaymentUrl.d.ts +4 -0
  123. package/lib/chevre/service/payment/any/publishPaymentUrl.js +4 -18
  124. package/lib/chevre/service/payment/any/voidPayTransaction.d.ts +2 -0
  125. package/lib/chevre/service/payment/any/voidPayTransaction.js +1 -23
  126. package/lib/chevre/service/payment/creditCard/authorize/processAuthorizeCreditCard.d.ts +1 -1
  127. package/lib/chevre/service/payment/creditCard/authorize/processAuthorizeCreditCard.js +5 -9
  128. package/lib/chevre/service/reserve/adminFindReservations.d.ts +15 -0
  129. package/lib/chevre/service/reserve/adminFindReservations.js +35 -0
  130. package/lib/chevre/service/reserve/potentialActions/onReservationConfirmed.js +17 -8
  131. package/lib/chevre/service/reserve/searchByOrder.js +2 -6
  132. package/lib/chevre/service/reserve.d.ts +2 -2
  133. package/lib/chevre/service/reserve.js +3 -3
  134. package/lib/chevre/service/task/aggregateOffers.d.ts +2 -2
  135. package/lib/chevre/service/task/aggregateOffers.js +2 -1
  136. package/lib/chevre/service/task/aggregateScreeningEvent.d.ts +2 -2
  137. package/lib/chevre/service/task/aggregateScreeningEvent.js +2 -1
  138. package/lib/chevre/service/task/authorizePayment.js +3 -1
  139. package/lib/chevre/service/task/cancelReservation.d.ts +2 -2
  140. package/lib/chevre/service/task/cancelReservation.js +2 -1
  141. package/lib/chevre/service/task/confirmPayTransaction.js +0 -1
  142. package/lib/chevre/service/task/confirmReserveTransaction.js +2 -7
  143. package/lib/chevre/service/task/deleteTransaction.d.ts +2 -2
  144. package/lib/chevre/service/task/deleteTransaction.js +2 -1
  145. package/lib/chevre/service/task/onAssetTransactionStatusChanged.d.ts +2 -2
  146. package/lib/chevre/service/task/onAssetTransactionStatusChanged.js +4 -3
  147. package/lib/chevre/service/task/onEventChanged.d.ts +2 -2
  148. package/lib/chevre/service/task/onEventChanged.js +2 -1
  149. package/lib/chevre/service/task/onOrderPaymentCompleted.d.ts +2 -2
  150. package/lib/chevre/service/task/onOrderPaymentCompleted.js +4 -1
  151. package/lib/chevre/service/task/onResourceUpdated/onAggregateOfferUpdated.js +1 -1
  152. package/lib/chevre/service/task/onResourceUpdated.d.ts +2 -2
  153. package/lib/chevre/service/task/onResourceUpdated.js +2 -1
  154. package/lib/chevre/service/task/placeOrder.d.ts +2 -2
  155. package/lib/chevre/service/task/placeOrder.js +6 -3
  156. package/lib/chevre/service/task/publishPaymentUrl.js +7 -3
  157. package/lib/chevre/service/task/refund.d.ts +2 -2
  158. package/lib/chevre/service/task/refund.js +4 -10
  159. package/lib/chevre/service/task/reserve.d.ts +2 -2
  160. package/lib/chevre/service/task/reserve.js +2 -1
  161. package/lib/chevre/service/task/returnOrder.d.ts +2 -2
  162. package/lib/chevre/service/task/returnOrder.js +2 -1
  163. package/lib/chevre/service/task/sendOrder.d.ts +2 -2
  164. package/lib/chevre/service/task/sendOrder.js +2 -1
  165. package/lib/chevre/service/task/voidPayTransaction.js +3 -7
  166. package/lib/chevre/service/task/voidPayment.d.ts +2 -2
  167. package/lib/chevre/service/task/voidPayment.js +2 -1
  168. package/lib/chevre/service/taskHandler/onOperationFailed.js +1 -1
  169. package/lib/chevre/service/taskHandler.d.ts +2 -2
  170. package/lib/chevre/service/taskHandler.js +36 -37
  171. package/lib/chevre/service/transaction/deleteTransaction/deletePayTransactionsByPlaceOrder.d.ts +15 -0
  172. package/lib/chevre/service/transaction/deleteTransaction/deletePayTransactionsByPlaceOrder.js +51 -0
  173. package/lib/chevre/service/transaction/deleteTransaction/deleteReservationsByPlaceOrder.d.ts +23 -0
  174. package/lib/chevre/service/transaction/deleteTransaction/deleteReservationsByPlaceOrder.js +64 -0
  175. package/lib/chevre/service/transaction/deleteTransaction.js +15 -152
  176. package/lib/chevre/service/transaction/placeOrder/confirm/potentialActions/sendEmailMessage.d.ts +28 -2
  177. package/lib/chevre/service/transaction/placeOrder/confirm/potentialActions/sendEmailMessage.js +11 -12
  178. package/lib/chevre/service/transaction/placeOrder/confirm/potentialActions.d.ts +4 -2
  179. package/lib/chevre/service/transaction/placeOrder/confirm/potentialActions.js +6 -7
  180. package/lib/chevre/service/transaction/placeOrder/confirm/prepareUnitPriceOfferConditions.d.ts +35 -2
  181. package/lib/chevre/service/transaction/placeOrder/confirm/prepareUnitPriceOfferConditions.js +15 -11
  182. package/lib/chevre/service/transaction/placeOrder/confirm/validation/factory.d.ts +5 -1
  183. package/lib/chevre/service/transaction/placeOrder/confirm/validation.d.ts +11 -2
  184. package/lib/chevre/service/transaction/placeOrder/confirm/validation.js +53 -32
  185. package/lib/chevre/service/transaction/placeOrder/confirm.d.ts +6 -5
  186. package/lib/chevre/service/transaction/placeOrder/confirm.js +33 -78
  187. package/lib/chevre/service/transaction/placeOrder/publishConfirmationNumberIfNotExist.d.ts +4 -7
  188. package/lib/chevre/service/transaction/placeOrder/publishConfirmationNumberIfNotExist.js +33 -15
  189. package/lib/chevre/service/transaction/placeOrder/start.d.ts +1 -1
  190. package/lib/chevre/service/transaction/placeOrder/updateAgent/fixCustomer.d.ts +20 -0
  191. package/lib/chevre/service/transaction/placeOrder/updateAgent/fixCustomer.js +63 -0
  192. package/lib/chevre/service/transaction/placeOrder/updateAgent.d.ts +0 -1
  193. package/lib/chevre/service/transaction/placeOrder/updateAgent.js +17 -86
  194. package/lib/chevre/service/transaction/returnOrder/preStart.js +1 -1
  195. package/lib/chevre/service.d.ts +4 -0
  196. package/lib/chevre/service.js +12 -1
  197. package/lib/chevre/taskSettings.d.ts +1 -3
  198. package/package.json +8 -11
  199. package/lib/chevre/service/order/findConfirmedPlaceOrder.d.ts +0 -13
  200. package/lib/chevre/service/order/findConfirmedPlaceOrder.js +0 -32
  201. package/lib/chevre/service/reserve/findReservations.d.ts +0 -33
  202. package/lib/chevre/service/reserve/findReservations.js +0 -61
@@ -1,5 +1,4 @@
1
- import type { BulkWriteResult, DeleteResult } from 'mongodb';
2
- import { Connection, FilterQuery } from 'mongoose';
1
+ import type { Connection, FilterQuery, mongo } from 'mongoose';
3
2
  import { factory } from '../factory';
4
3
  import { IDocType } from './mongoose/schemas/eventOffer';
5
4
  type IUnset = {
@@ -32,7 +31,7 @@ export declare class EventOfferRepo {
32
31
  */
33
32
  update: boolean;
34
33
  }): Promise<{
35
- bulkWriteResult?: BulkWriteResult;
34
+ bulkWriteResult?: mongo.BulkWriteResult;
36
35
  modifiedProductOffers?: {
37
36
  id: string;
38
37
  }[];
@@ -47,7 +46,7 @@ export declare class EventOfferRepo {
47
46
  seller: {
48
47
  id: string;
49
48
  };
50
- }): Promise<DeleteResult>;
49
+ }): Promise<mongo.DeleteResult>;
51
50
  /**
52
51
  * 有効期間を過ぎたイベントオファーを削除する
53
52
  */
@@ -55,6 +54,6 @@ export declare class EventOfferRepo {
55
54
  validThrough: {
56
55
  $lte: Date;
57
56
  };
58
- }): Promise<DeleteResult>;
57
+ }): Promise<mongo.DeleteResult>;
59
58
  }
60
59
  export {};
@@ -1,5 +1,4 @@
1
- import type { BulkWriteResult } from 'mongodb';
2
- import type { Connection } from 'mongoose';
1
+ import type { Connection, mongo } from 'mongoose';
3
2
  import { factory } from '../factory';
4
3
  /**
5
4
  * イベントのアプリケーションオファーリポジトリ
@@ -31,7 +30,7 @@ export declare class EventSellerMakesOfferRepo {
31
30
  };
32
31
  };
33
32
  }[]): Promise<{
34
- bulkWriteResult?: BulkWriteResult;
33
+ bulkWriteResult?: mongo.BulkWriteResult;
35
34
  modifiedEvents?: {
36
35
  id: string;
37
36
  }[];
@@ -1,5 +1,4 @@
1
- import type { BulkWriteResult } from 'mongodb';
2
- import type { Connection, FilterQuery } from 'mongoose';
1
+ import type { Connection, FilterQuery, mongo } from 'mongoose';
3
2
  import { factory } from '../factory';
4
3
  type ISearchConditions = factory.eventSeries.ISearchConditions;
5
4
  type IKeyOfProjection = Exclude<keyof factory.eventSeries.IEvent, 'id' | 'videoFormat'>;
@@ -26,7 +25,7 @@ export declare class EventSeriesRepo {
26
25
  */
27
26
  upsert: boolean;
28
27
  }): Promise<{
29
- bulkWriteResult?: BulkWriteResult;
28
+ bulkWriteResult?: mongo.BulkWriteResult;
30
29
  modifiedEvents: {
31
30
  id: string;
32
31
  }[];
@@ -55,7 +54,7 @@ export declare class EventSeriesRepo {
55
54
  organizer: {
56
55
  id: string;
57
56
  };
58
- }): Promise<import("mongodb").DeleteResult>;
57
+ }): Promise<mongo.DeleteResult>;
59
58
  deleteManyByLocationId(params: {
60
59
  project: {
61
60
  id: string;
@@ -63,7 +62,7 @@ export declare class EventSeriesRepo {
63
62
  location: {
64
63
  id: string;
65
64
  };
66
- }): Promise<import("mongodb").DeleteResult>;
65
+ }): Promise<mongo.DeleteResult>;
67
66
  /**
68
67
  * 既存施設コンテンツの最大バージョンを集計する
69
68
  */
@@ -43,7 +43,7 @@ export declare class MessageRepo {
43
43
  /**
44
44
  * 検索
45
45
  */
46
- projectFields(params: ISearchConditions, inclusion: IKeyOfProjection[]): Promise<(IEmailMessage & {
46
+ findMessages(params: ISearchConditions, inclusion: IKeyOfProjection[]): Promise<(IEmailMessage & {
47
47
  id: string;
48
48
  })[]>;
49
49
  /**
@@ -53,7 +53,7 @@ class MessageRepo {
53
53
  /**
54
54
  * 検索
55
55
  */
56
- async projectFields(params, inclusion) {
56
+ async findMessages(params, inclusion) {
57
57
  const conditions = MessageRepo.CREATE_MONGO_CONDITIONS(params);
58
58
  let positiveProjectionFields;
59
59
  if (Array.isArray(inclusion) && inclusion.length > 0) {
@@ -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
  {
@@ -0,0 +1,11 @@
1
+ import { IndexDefinition, IndexOptions, Model, Schema, SchemaDefinition } from 'mongoose';
2
+ import { IVirtuals } from '../virtuals';
3
+ import { factory } from '../../../factory';
4
+ type IDocType = Pick<factory.task.ITask<factory.taskName>, 'data' | 'dateAborted' | 'executionResults' | 'executor' | 'expires' | 'lastTriedAt' | 'name' | 'project' | 'runsAt' | 'status'>;
5
+ type IModel = Model<IDocType, Record<string, never>, Record<string, never>, IVirtuals>;
6
+ type ISchemaDefinition = SchemaDefinition<IDocType>;
7
+ type ISchema = Schema<IDocType, IModel, Record<string, never>, Record<string, never>, IVirtuals, Record<string, never>, ISchemaDefinition, IDocType>;
8
+ declare const modelName = "AsyncAction";
9
+ declare const indexes: [d: IndexDefinition, o: IndexOptions][];
10
+ declare function createSchema(): ISchema;
11
+ export { createSchema, IDocType, IModel, indexes, modelName };
@@ -0,0 +1,89 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.modelName = exports.indexes = void 0;
4
+ exports.createSchema = createSchema;
5
+ const mongoose_1 = require("mongoose");
6
+ const writeConcern_1 = require("../writeConcern");
7
+ const settings_1 = require("../../../settings");
8
+ const modelName = 'AsyncAction';
9
+ exports.modelName = modelName;
10
+ const schemaDefinition = {
11
+ project: { type: mongoose_1.SchemaTypes.Mixed, required: true },
12
+ name: { type: String, required: true },
13
+ status: { type: String, required: true },
14
+ runsAt: { type: Date, required: true },
15
+ expires: { type: Date, required: true },
16
+ lastTriedAt: Date,
17
+ executionResults: [mongoose_1.SchemaTypes.Mixed],
18
+ executor: mongoose_1.SchemaTypes.Mixed,
19
+ data: mongoose_1.SchemaTypes.Mixed,
20
+ dateAborted: Date,
21
+ // remainingNumberOfTries: { type: Number, required: true }, // ワンタイム前提につき不要
22
+ // numberOfTried: { type: Number, required: true }, // ワンタイム前提につき不要
23
+ };
24
+ const schemaOptions = {
25
+ autoIndex: settings_1.MONGO_AUTO_INDEX,
26
+ autoCreate: false,
27
+ collection: 'asyncActions',
28
+ id: true,
29
+ read: 'primary',
30
+ writeConcern: writeConcern_1.writeConcern,
31
+ strict: true,
32
+ strictQuery: false,
33
+ timestamps: false,
34
+ versionKey: false,
35
+ toJSON: {
36
+ getters: false,
37
+ virtuals: false,
38
+ minimize: false,
39
+ versionKey: false
40
+ },
41
+ toObject: {
42
+ getters: false,
43
+ virtuals: true,
44
+ minimize: false,
45
+ versionKey: false
46
+ }
47
+ };
48
+ const EXPIRE_AFTER_SECONDS = 3600; // 1 hour
49
+ const indexes = [
50
+ [
51
+ { expires: 1 },
52
+ {
53
+ name: 'ttlByExpires',
54
+ expireAfterSeconds: EXPIRE_AFTER_SECONDS
55
+ }
56
+ ],
57
+ [
58
+ { runsAt: -1 },
59
+ { name: 'runsAt' }
60
+ ],
61
+ [
62
+ { 'project.id': 1, runsAt: -1 },
63
+ { name: 'projectId' }
64
+ ],
65
+ [
66
+ { name: 1, runsAt: -1 },
67
+ { name: 'asyncActionName' }
68
+ ],
69
+ [
70
+ { status: 1, runsAt: -1 },
71
+ { name: 'status' }
72
+ ],
73
+ ];
74
+ exports.indexes = indexes;
75
+ /**
76
+ * 非同期アクションスキーマ
77
+ */
78
+ let schema;
79
+ function createSchema() {
80
+ if (schema === undefined) {
81
+ schema = new mongoose_1.Schema(schemaDefinition, schemaOptions);
82
+ if (settings_1.MONGO_AUTO_INDEX) {
83
+ indexes.forEach((indexParams) => {
84
+ schema?.index(...indexParams);
85
+ });
86
+ }
87
+ }
88
+ return schema;
89
+ }
@@ -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
  /**
@@ -1,5 +1,4 @@
1
- import type { BulkWriteResult, DeleteResult } from 'mongodb';
2
- import type { Connection, FilterQuery } from 'mongoose';
1
+ import type { Connection, FilterQuery, mongo } from 'mongoose';
3
2
  import { factory } from '../factory';
4
3
  type INoteDigitalDocument = factory.creativeWork.noteDigitalDocument.INoteDigitalDocument;
5
4
  type IKeyOfProjection = keyof INoteDigitalDocument;
@@ -29,7 +28,7 @@ export declare class NoteRepo {
29
28
  */
30
29
  update: boolean;
31
30
  }): Promise<{
32
- bulkWriteResult?: BulkWriteResult;
31
+ bulkWriteResult?: mongo.BulkWriteResult;
33
32
  modifiedNotes?: {
34
33
  id: string;
35
34
  }[];
@@ -42,7 +41,7 @@ export declare class NoteRepo {
42
41
  id: string;
43
42
  typeOf: factory.creativeWork.noteDigitalDocument.IAbout['typeOf'];
44
43
  };
45
- }): Promise<DeleteResult>;
44
+ }): Promise<mongo.DeleteResult>;
46
45
  unsetUnnecessaryFields(params: {
47
46
  filter: any;
48
47
  $unset: any;
@@ -1,5 +1,4 @@
1
- import type { BulkWriteResult } from 'mongodb';
2
- import type { Connection, FilterQuery } from 'mongoose';
1
+ import type { Connection, FilterQuery, mongo } from 'mongoose';
3
2
  import { factory } from '../factory';
4
3
  type INoteAboutOrder = factory.creativeWork.noteDigitalDocument.INoteAboutOrder;
5
4
  type IKeyOfProjection = keyof INoteAboutOrder;
@@ -21,7 +20,7 @@ export declare class NoteAboutOrderRepo {
21
20
  */
22
21
  upsertOrderNoteByIdentifier(params: Pick<INoteAboutOrder, 'about' | 'creator' | 'identifier' | 'project' | 'provider' | 'text' | 'version'>[], options: {
23
22
  overwrite: boolean;
24
- }): Promise<BulkWriteResult | undefined>;
23
+ }): Promise<mongo.BulkWriteResult | undefined>;
25
24
  updateById(params: {
26
25
  id: string;
27
26
  attributes: Pick<INoteAboutOrder, 'text' | 'editor'>;
@@ -128,7 +128,7 @@ declare abstract class OfferInCatalogReadOnlyRepo {
128
128
  */
129
129
  id: string;
130
130
  }[]>;
131
- abstract count(params: Omit<factory.unitPriceOffer.ISearchConditions, 'limit' | 'page' | 'sort'>): Promise<number>;
132
- abstract search(params: factory.unitPriceOffer.ISearchConditions, projection?: IProjection): Promise<IOfferInCatalog[]>;
131
+ abstract countUnitPriceOffers(params: Omit<factory.unitPriceOffer.ISearchConditions, 'limit' | 'page' | 'sort'>): Promise<number>;
132
+ abstract findUnitPriceOffers(params: factory.unitPriceOffer.ISearchConditions, projection?: IProjection): Promise<IOfferInCatalog[]>;
133
133
  }
134
134
  export { KeyOfOffer, IProjection, IOfferInCatalog, IPriceSpecificationConditionsOnSearchWithSortIndex, OfferInCatalogReadOnlyRepo };
@@ -137,8 +137,8 @@ export declare class OfferRepo implements OfferInCatalogReadOnlyRepo {
137
137
  };
138
138
  unacceptedPaymentMethod: string[];
139
139
  }): Promise<boolean>;
140
- count(params: Omit<factory.unitPriceOffer.ISearchConditions, 'limit' | 'page' | 'sort'>): Promise<number>;
141
- search(params: factory.unitPriceOffer.ISearchConditions, projection?: IProjection): Promise<IOfferInCatalog[]>;
140
+ countUnitPriceOffers(params: Omit<factory.unitPriceOffer.ISearchConditions, 'limit' | 'page' | 'sort'>): Promise<number>;
141
+ findUnitPriceOffers(params: factory.unitPriceOffer.ISearchConditions, projection?: IProjection): Promise<IOfferInCatalog[]>;
142
142
  /**
143
143
  * サブカタログから集計オファーIDリストを検索する
144
144
  */
@@ -109,7 +109,7 @@ class OfferRepo {
109
109
  const searchOffersConditions = {
110
110
  parentOffer: { id: { $in: sortedOfferIds } }
111
111
  };
112
- offers = await this.search(searchOffersConditions, params.projection);
112
+ offers = await this.findUnitPriceOffers(searchOffersConditions, params.projection);
113
113
  }
114
114
  return { offers };
115
115
  }
@@ -165,7 +165,7 @@ class OfferRepo {
165
165
  ? { availableAtOrFrom: { id: { $eq: params.availableAtOrFrom.id } } } // store.idでのフィルターをmongoで処理(2023-01-27~)
166
166
  : undefined
167
167
  };
168
- offers = await this.search(searchOffersConditions, params.projection);
168
+ offers = await this.findUnitPriceOffers(searchOffersConditions, params.projection);
169
169
  }
170
170
  return offers;
171
171
  }
@@ -227,7 +227,7 @@ class OfferRepo {
227
227
  ...(typeof params.limit === 'number') ? { limit: params.limit } : undefined,
228
228
  ...(typeof params.page === 'number') ? { page: params.page } : undefined
229
229
  };
230
- offers = await this.search(searchOffersConditions, params.projection);
230
+ offers = await this.findUnitPriceOffers(searchOffersConditions, params.projection);
231
231
  }
232
232
  return { offers, sortedOfferIds };
233
233
  }
@@ -370,12 +370,13 @@ class OfferRepo {
370
370
  .exec();
371
371
  return doc !== null;
372
372
  }
373
- async count(params) {
373
+ async countUnitPriceOffers(params) {
374
374
  const matchStages = aggregateOffer_1.AggregateOfferRepo.CREATE_MATCH_STAGE(params);
375
375
  const result = await this.aggregateOfferModel.aggregate([
376
- {
377
- $unwind: { path: '$offers' }
378
- },
376
+ // // offers.length:1の前提であるため、unwindは不要(2026-07-23~)
377
+ // {
378
+ // $unwind: { path: '$offers' }
379
+ // },
379
380
  ...matchStages,
380
381
  {
381
382
  $count: 'offerCount'
@@ -384,19 +385,63 @@ class OfferRepo {
384
385
  .exec();
385
386
  return (result.length > 0) ? result[0].offerCount : 0;
386
387
  }
387
- async search(params, projection) {
388
+ // findUnitPriceOffersへ移行(2026-07-23~)
389
+ // /**
390
+ // * @deprecated use findUnitPriceOffers
391
+ // */
392
+ // public async search(
393
+ // params: factory.unitPriceOffer.ISearchConditions,
394
+ // projection?: IProjection
395
+ // ): Promise<IOfferInCatalog[]> {
396
+ // const matchStages = AggregateOfferRepo.CREATE_MATCH_STAGE(params);
397
+ // const projectStage = OfferRepo.CREATE_AGGREGATE_OFFERS_PROJECTION({ ...projection });
398
+ // const sortByPrice = params.sort?.['priceSpecification.price'];
399
+ // const sortByIdentifier = params.sort?.identifier;
400
+ // const aggregate = this.aggregateOfferModel.aggregate<IOfferInCatalog>([
401
+ // {
402
+ // $unwind: {
403
+ // path: '$offers',
404
+ // includeArrayIndex: OFFERS_ARRAY_INDEX_NAME
405
+ // }
406
+ // },
407
+ // ...matchStages,
408
+ // ...(typeof sortByPrice === 'number' || typeof sortByIdentifier === 'number')
409
+ // ? [
410
+ // {
411
+ // $sort: {
412
+ // ...(typeof sortByPrice === 'number')
413
+ // ? { 'offers.priceSpecification.price': sortByPrice }
414
+ // : undefined,
415
+ // ...(typeof sortByIdentifier === 'number')
416
+ // ? { 'offers.identifier': sortByIdentifier }
417
+ // : undefined
418
+ // }
419
+ // }
420
+ // ]
421
+ // : [],
422
+ // { $project: projectStage }
423
+ // ]);
424
+ // /* istanbul ignore else */
425
+ // if (typeof params.limit === 'number' && params.limit > 0) {
426
+ // const page: number = (typeof params.page === 'number' && params.page > 0) ? params.page : 1;
427
+ // aggregate.limit(params.limit * page)
428
+ // .skip(params.limit * (page - 1));
429
+ // }
430
+ // return aggregate.exec();
431
+ // }
432
+ async findUnitPriceOffers(params, projection) {
388
433
  const matchStages = aggregateOffer_1.AggregateOfferRepo.CREATE_MATCH_STAGE(params);
389
434
  const projectStage = OfferRepo.CREATE_AGGREGATE_OFFERS_PROJECTION({ ...projection });
390
435
  const sortByPrice = params.sort?.['priceSpecification.price'];
391
436
  const sortByIdentifier = params.sort?.identifier;
392
437
  const aggregate = this.aggregateOfferModel.aggregate([
438
+ ...matchStages, // match -> unwind(2026-07-23~)
393
439
  {
394
440
  $unwind: {
395
441
  path: '$offers',
396
442
  includeArrayIndex: OFFERS_ARRAY_INDEX_NAME
397
443
  }
398
444
  },
399
- ...matchStages,
400
445
  ...(typeof sortByPrice === 'number' || typeof sortByIdentifier === 'number')
401
446
  ? [
402
447
  {
@@ -416,8 +461,11 @@ class OfferRepo {
416
461
  /* istanbul ignore else */
417
462
  if (typeof params.limit === 'number' && params.limit > 0) {
418
463
  const page = (typeof params.page === 'number' && params.page > 0) ? params.page : 1;
419
- aggregate.limit(params.limit * page)
420
- .skip(params.limit * (page - 1));
464
+ // support skip -> limit(2026-07-23~)
465
+ // aggregate.limit(params.limit * page)
466
+ // .skip(params.limit * (page - 1));
467
+ aggregate.skip(params.limit * (page - 1))
468
+ .limit(params.limit);
421
469
  }
422
470
  return aggregate.exec();
423
471
  }
@@ -1,5 +1,4 @@
1
- import type { BulkWriteResult } from 'mongodb';
2
- import type { Connection, FilterQuery } from 'mongoose';
1
+ import type { Connection, FilterQuery, mongo } from 'mongoose';
3
2
  import { factory } from '../factory';
4
3
  import { IDocType } from './mongoose/schemas/offerCatalog';
5
4
  export type IAggregatedOfferCatalog = Pick<factory.offerCatalog.IOfferCatalog, 'id' | 'name' | 'description' | 'project' | 'typeOf' | 'identifier' | 'itemOffered' | 'additionalProperty'> & {
@@ -49,7 +48,7 @@ export declare class OfferCatalogRepo {
49
48
  */
50
49
  itemListElementType: factory.offerCatalog.IItemListElement['typeOf'];
51
50
  }): Promise<{
52
- bulkWriteResult?: BulkWriteResult;
51
+ bulkWriteResult?: mongo.BulkWriteResult;
53
52
  modifiedCatalogs?: {
54
53
  id: string;
55
54
  }[];