@chevre/domain 25.2.0-alpha.9 → 26.0.0-alpha.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (260) 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.d.ts +16 -9
  7. package/lib/chevre/repo/action.js +99 -180
  8. package/lib/chevre/repo/adminTask.d.ts +37 -0
  9. package/lib/chevre/repo/adminTask.js +163 -0
  10. package/lib/chevre/repo/aggregateOffer.d.ts +3 -14
  11. package/lib/chevre/repo/aggregateOffer.js +16 -125
  12. package/lib/chevre/repo/aggregateTask.d.ts +37 -0
  13. package/lib/chevre/repo/aggregateTask.js +136 -0
  14. package/lib/chevre/repo/asyncAction.d.ts +69 -0
  15. package/lib/chevre/repo/asyncAction.js +237 -0
  16. package/lib/chevre/repo/concurrentLock.d.ts +3 -1
  17. package/lib/chevre/repo/creativeWork.d.ts +2 -3
  18. package/lib/chevre/repo/credentials.d.ts +2 -1
  19. package/lib/chevre/repo/customerType.d.ts +2 -3
  20. package/lib/chevre/repo/event.d.ts +10 -11
  21. package/lib/chevre/repo/eventOffer.d.ts +4 -5
  22. package/lib/chevre/repo/eventSellerMakesOffer.d.ts +2 -3
  23. package/lib/chevre/repo/eventSeries.d.ts +4 -5
  24. package/lib/chevre/repo/message.d.ts +1 -1
  25. package/lib/chevre/repo/message.js +1 -1
  26. package/lib/chevre/repo/mongoose/schemas/asyncAction.d.ts +13 -0
  27. package/lib/chevre/repo/mongoose/schemas/asyncAction.js +89 -0
  28. package/lib/chevre/repo/mongoose/schemas/order.d.ts +4 -0
  29. package/lib/chevre/repo/mongoose/schemas/order.js +10 -0
  30. package/lib/chevre/repo/mongoose/schemas/scheduledTasks.d.ts +16 -0
  31. package/lib/chevre/repo/mongoose/schemas/scheduledTasks.js +103 -0
  32. package/lib/chevre/repo/mongoose/schemas/setting.d.ts +4 -0
  33. package/lib/chevre/repo/mongoose/schemas/task.d.ts +6 -1
  34. package/lib/chevre/repo/mongoose/schemas/task.js +12 -12
  35. package/lib/chevre/repo/note.d.ts +3 -4
  36. package/lib/chevre/repo/noteAboutOrder.d.ts +2 -3
  37. package/lib/chevre/repo/offer/offerInCatalogReadOnly.d.ts +2 -2
  38. package/lib/chevre/repo/offer/unitPriceInCatalog.d.ts +2 -2
  39. package/lib/chevre/repo/offer/unitPriceInCatalog.js +59 -11
  40. package/lib/chevre/repo/offerCatalog.d.ts +2 -3
  41. package/lib/chevre/repo/offerCatalogItem.d.ts +2 -3
  42. package/lib/chevre/repo/order.d.ts +2 -0
  43. package/lib/chevre/repo/order.js +14 -14
  44. package/lib/chevre/repo/orderInTransaction.d.ts +68 -1
  45. package/lib/chevre/repo/orderInTransaction.js +181 -3
  46. package/lib/chevre/repo/passport.d.ts +2 -1
  47. package/lib/chevre/repo/person.d.ts +0 -15
  48. package/lib/chevre/repo/person.js +122 -108
  49. package/lib/chevre/repo/place/entranceGate.d.ts +4 -5
  50. package/lib/chevre/repo/place/movieTheater.d.ts +3 -4
  51. package/lib/chevre/repo/place/screeningRoom.d.ts +4 -5
  52. package/lib/chevre/repo/place/seat.d.ts +4 -5
  53. package/lib/chevre/repo/place/section.d.ts +3 -4
  54. package/lib/chevre/repo/priceSpecification.d.ts +4 -4
  55. package/lib/chevre/repo/product.d.ts +3 -4
  56. package/lib/chevre/repo/rateLimit/offer.d.ts +3 -1
  57. package/lib/chevre/repo/rateLimit/offer.js +0 -12
  58. package/lib/chevre/repo/reservation.d.ts +2 -3
  59. package/lib/chevre/repo/scheduledTask.d.ts +90 -0
  60. package/lib/chevre/repo/scheduledTask.js +223 -0
  61. package/lib/chevre/repo/sellerMakesOffer.d.ts +3 -4
  62. package/lib/chevre/repo/stockHolder.d.ts +1 -1
  63. package/lib/chevre/repo/stockHolder.js +0 -146
  64. package/lib/chevre/repo/task.d.ts +30 -71
  65. package/lib/chevre/repo/task.js +59 -345
  66. package/lib/chevre/repo/transaction/placeOrder.d.ts +2 -45
  67. package/lib/chevre/repo/transaction/placeOrder.js +43 -83
  68. package/lib/chevre/repo/transaction.d.ts +2 -2
  69. package/lib/chevre/repo/transactionNumberCounter.js +0 -34
  70. package/lib/chevre/repo/transactionProcess.d.ts +2 -1
  71. package/lib/chevre/repo/transactionProcess.js +0 -13
  72. package/lib/chevre/repository.d.ts +20 -0
  73. package/lib/chevre/repository.js +46 -2
  74. package/lib/chevre/service/aggregation/event/aggregateScreeningEvent.js +1 -1
  75. package/lib/chevre/service/aggregation/system.d.ts +2 -2
  76. package/lib/chevre/service/aggregation/system.js +1 -1
  77. package/lib/chevre/service/assetTransaction/cancelReservation.js +1 -1
  78. package/lib/chevre/service/assetTransaction/pay/exportTasksById.js +1 -1
  79. package/lib/chevre/service/assetTransaction/pay/publishPaymentUrl.js +1 -1
  80. package/lib/chevre/service/assetTransaction/pay/start/factory.d.ts +1 -1
  81. package/lib/chevre/service/assetTransaction/pay/start/factory.js +3 -4
  82. package/lib/chevre/service/assetTransaction/pay/start.d.ts +1 -1
  83. package/lib/chevre/service/assetTransaction/refund.js +1 -1
  84. package/lib/chevre/service/assetTransaction/reserve/exportTasksById.js +1 -1
  85. package/lib/chevre/service/assetTransaction/reserveCOA/cancel.js +1 -67
  86. package/lib/chevre/service/asyncAction.d.ts +16 -0
  87. package/lib/chevre/service/asyncAction.js +36 -0
  88. package/lib/chevre/service/asyncActionHandler/onOperationFailed.d.ts +15 -0
  89. package/lib/chevre/service/asyncActionHandler/onOperationFailed.js +42 -0
  90. package/lib/chevre/service/asyncActionHandler.d.ts +13 -0
  91. package/lib/chevre/service/asyncActionHandler.js +89 -0
  92. package/lib/chevre/service/notification/factory.d.ts +2 -4
  93. package/lib/chevre/service/notification/factory.js +26 -24
  94. package/lib/chevre/service/notification/notifyAbortedTasksByEmail.d.ts +12 -6
  95. package/lib/chevre/service/notification/notifyAbortedTasksByEmail.js +12 -4
  96. package/lib/chevre/service/offer/event/authorize/factory.d.ts +3 -5
  97. package/lib/chevre/service/offer/event/authorize/factory.js +93 -75
  98. package/lib/chevre/service/offer/event/authorize.d.ts +0 -4
  99. package/lib/chevre/service/offer/event/authorize.js +2 -2
  100. package/lib/chevre/service/offer/event/voidTransaction.d.ts +1 -1
  101. package/lib/chevre/service/offer/event/voidTransactionByActionId.d.ts +1 -1
  102. package/lib/chevre/service/offer/eventServiceByCOA/authorize/factory.d.ts +6 -7
  103. package/lib/chevre/service/offer/eventServiceByCOA/authorize/factory.js +10 -10
  104. package/lib/chevre/service/offer/eventServiceByCOA/authorize/validateAcceptedOffers.js +2 -1
  105. package/lib/chevre/service/offer/eventServiceByCOA/authorize.d.ts +0 -5
  106. package/lib/chevre/service/offer/eventServiceByCOA/authorize.js +15 -12
  107. package/lib/chevre/service/offer/eventServiceByCOA/authorizeByAcceptAction.d.ts +0 -5
  108. package/lib/chevre/service/offer/eventServiceByCOA/authorizeByAcceptAction.js +2 -2
  109. package/lib/chevre/service/offer/eventServiceByCOA/findAcceptAction.d.ts +4 -0
  110. package/lib/chevre/service/offer/eventServiceByCOA/findAcceptAction.js +20 -9
  111. package/lib/chevre/service/offer/onEventChanged.js +2 -2
  112. package/lib/chevre/service/order/confirmPayTransaction.js +1 -1
  113. package/lib/chevre/service/order/deleteOrder.d.ts +5 -1
  114. package/lib/chevre/service/order/deleteOrder.js +8 -1
  115. package/lib/chevre/service/order/onAssetTransactionStatusChanged/onPayTransactionCanceled.js +19 -11
  116. package/lib/chevre/service/order/onAssetTransactionStatusChanged/onPayTransactionConfirmed.d.ts +2 -0
  117. package/lib/chevre/service/order/onAssetTransactionStatusChanged/paymentDue2Processing.d.ts +2 -2
  118. package/lib/chevre/service/order/onAssetTransactionStatusChanged/paymentDue2Processing.js +1 -7
  119. package/lib/chevre/service/order/onAssetTransactionStatusChanged.d.ts +2 -0
  120. package/lib/chevre/service/order/onAssetTransactionStatusChanged.js +2 -0
  121. package/lib/chevre/service/order/onOrderStatusChanged/onOrderCancelled/factory.d.ts +1 -1
  122. package/lib/chevre/service/order/onOrderStatusChanged/onOrderCancelled.js +1 -1
  123. package/lib/chevre/service/order/onOrderStatusChanged/onOrderDelivered.js +1 -1
  124. package/lib/chevre/service/order/onOrderStatusChanged/onOrderDeliveredPartially/factory.d.ts +1 -1
  125. package/lib/chevre/service/order/onOrderStatusChanged/onOrderDeliveredPartially.js +1 -1
  126. package/lib/chevre/service/order/onOrderStatusChanged/onOrderInTransit.js +3 -3
  127. package/lib/chevre/service/order/onOrderStatusChanged/onOrderPaymentDue.d.ts +0 -3
  128. package/lib/chevre/service/order/onOrderStatusChanged/onOrderPaymentDue.js +73 -44
  129. package/lib/chevre/service/order/onOrderStatusChanged/onOrderProcessing/createSendEmailMessageTaskIfNotExist.d.ts +5 -1
  130. package/lib/chevre/service/order/onOrderStatusChanged/onOrderProcessing/createSendEmailMessageTaskIfNotExist.js +53 -33
  131. package/lib/chevre/service/order/onOrderStatusChanged/onOrderProcessing/processOrder.js +1 -1
  132. package/lib/chevre/service/order/onOrderStatusChanged/onOrderProcessing.d.ts +2 -2
  133. package/lib/chevre/service/order/onOrderStatusChanged/onOrderProcessing.js +6 -4
  134. package/lib/chevre/service/order/onOrderStatusChanged/onOrderReturned/factory.d.ts +1 -1
  135. package/lib/chevre/service/order/onOrderStatusChanged/onOrderReturned.js +3 -7
  136. package/lib/chevre/service/order/onOrderUpdated.js +1 -1
  137. package/lib/chevre/service/order/payOrder.d.ts +2 -0
  138. package/lib/chevre/service/order/placeOrder/createPlacingOrderFromExistingTransaction.d.ts +2 -1
  139. package/lib/chevre/service/order/placeOrder/createPlacingOrderFromExistingTransaction.js +13 -58
  140. package/lib/chevre/service/order/placeOrder/factory.js +3 -21
  141. package/lib/chevre/service/order/placeOrder.d.ts +4 -5
  142. package/lib/chevre/service/order/placeOrder.js +20 -31
  143. package/lib/chevre/service/payment/any/authorize/fixOrderAsNeeded.js +1 -2
  144. package/lib/chevre/service/payment/any/authorize/fixTransactionNumber.d.ts +3 -2
  145. package/lib/chevre/service/payment/any/authorize/handlePrePublishedPaymentMethodIdOnAuthorizing.d.ts +4 -3
  146. package/lib/chevre/service/payment/any/authorize/handlePrePublishedPaymentMethodIdOnAuthorizing.js +3 -31
  147. package/lib/chevre/service/payment/any/authorize.js +7 -5
  148. package/lib/chevre/service/payment/any/factory.d.ts +7 -7
  149. package/lib/chevre/service/payment/any/factory.js +18 -21
  150. package/lib/chevre/service/payment/any/findAcceptAction.d.ts +7 -1
  151. package/lib/chevre/service/payment/any/findAcceptAction.js +34 -15
  152. package/lib/chevre/service/payment/any/findAuthorizeAction.d.ts +4 -0
  153. package/lib/chevre/service/payment/any/findAuthorizeAction.js +20 -9
  154. package/lib/chevre/service/payment/any/findCheckAction.d.ts +4 -0
  155. package/lib/chevre/service/payment/any/findCheckAction.js +20 -9
  156. package/lib/chevre/service/payment/any/invalidatePaymentUrl.d.ts +2 -0
  157. package/lib/chevre/service/payment/any/invalidatePaymentUrl.js +5 -67
  158. package/lib/chevre/service/payment/any/onPayActionCompleted.js +1 -1
  159. package/lib/chevre/service/payment/any/onRefundActionCompletedOrFailed.js +1 -1
  160. package/lib/chevre/service/payment/any/publishPaymentUrl.d.ts +4 -0
  161. package/lib/chevre/service/payment/any/publishPaymentUrl.js +4 -18
  162. package/lib/chevre/service/payment/any/voidPayTransaction.d.ts +2 -0
  163. package/lib/chevre/service/payment/any/voidPayTransaction.js +1 -23
  164. package/lib/chevre/service/payment/creditCard/authorize/processAuthorizeCreditCard.d.ts +1 -1
  165. package/lib/chevre/service/payment/creditCard/authorize/processAuthorizeCreditCard.js +5 -9
  166. package/lib/chevre/service/reserve/adminFindReservations.d.ts +15 -0
  167. package/lib/chevre/service/reserve/adminFindReservations.js +35 -0
  168. package/lib/chevre/service/reserve/potentialActions/onPendingReservationCanceled.js +1 -1
  169. package/lib/chevre/service/reserve/potentialActions/onReservationCanceled.js +1 -1
  170. package/lib/chevre/service/reserve/potentialActions/onReservationCheckedIn.js +1 -1
  171. package/lib/chevre/service/reserve/potentialActions/onReservationConfirmed.js +20 -11
  172. package/lib/chevre/service/reserve/potentialActions/onReservationUsed.js +1 -1
  173. package/lib/chevre/service/reserve/potentialActions/onReservationsCreated.js +1 -1
  174. package/lib/chevre/service/reserve/searchByOrder.js +2 -6
  175. package/lib/chevre/service/reserve.d.ts +2 -2
  176. package/lib/chevre/service/reserve.js +3 -3
  177. package/lib/chevre/service/scheduledTask.d.ts +11 -0
  178. package/lib/chevre/service/scheduledTask.js +40 -0
  179. package/lib/chevre/service/scheduledTaskHandler/onOperationFailed.d.ts +14 -0
  180. package/lib/chevre/service/scheduledTaskHandler/onOperationFailed.js +56 -0
  181. package/lib/chevre/service/scheduledTaskHandler.d.ts +12 -0
  182. package/lib/chevre/service/scheduledTaskHandler.js +66 -0
  183. package/lib/chevre/service/task/aggregateOffers.d.ts +2 -2
  184. package/lib/chevre/service/task/aggregateOffers.js +2 -1
  185. package/lib/chevre/service/task/aggregateScreeningEvent.d.ts +2 -2
  186. package/lib/chevre/service/task/aggregateScreeningEvent.js +2 -1
  187. package/lib/chevre/service/task/authorizePayment.js +3 -1
  188. package/lib/chevre/service/task/cancelReservation.d.ts +2 -2
  189. package/lib/chevre/service/task/cancelReservation.js +2 -1
  190. package/lib/chevre/service/task/confirmPayTransaction.js +0 -1
  191. package/lib/chevre/service/task/confirmReserveTransaction.js +3 -8
  192. package/lib/chevre/service/task/deleteTransaction.d.ts +2 -2
  193. package/lib/chevre/service/task/deleteTransaction.js +2 -1
  194. package/lib/chevre/service/task/onAssetTransactionStatusChanged.d.ts +2 -2
  195. package/lib/chevre/service/task/onAssetTransactionStatusChanged.js +4 -3
  196. package/lib/chevre/service/task/onEventChanged.d.ts +2 -2
  197. package/lib/chevre/service/task/onEventChanged.js +2 -1
  198. package/lib/chevre/service/task/onOrderPaymentCompleted.d.ts +2 -2
  199. package/lib/chevre/service/task/onOrderPaymentCompleted.js +4 -1
  200. package/lib/chevre/service/task/onResourceUpdated/onAggregateOfferUpdated.js +2 -2
  201. package/lib/chevre/service/task/onResourceUpdated/onHasPOSUpdated.js +1 -1
  202. package/lib/chevre/service/task/onResourceUpdated/onOfferCatalogUpdated.js +1 -1
  203. package/lib/chevre/service/task/onResourceUpdated.d.ts +2 -2
  204. package/lib/chevre/service/task/onResourceUpdated.js +10 -9
  205. package/lib/chevre/service/task/placeOrder.d.ts +2 -2
  206. package/lib/chevre/service/task/placeOrder.js +6 -3
  207. package/lib/chevre/service/task/publishPaymentUrl.js +7 -3
  208. package/lib/chevre/service/task/refund.d.ts +2 -2
  209. package/lib/chevre/service/task/refund.js +4 -10
  210. package/lib/chevre/service/task/reserve.d.ts +2 -2
  211. package/lib/chevre/service/task/reserve.js +2 -1
  212. package/lib/chevre/service/task/returnOrder.d.ts +2 -2
  213. package/lib/chevre/service/task/returnOrder.js +2 -1
  214. package/lib/chevre/service/task/returnPayTransaction.js +1 -1
  215. package/lib/chevre/service/task/sendOrder.d.ts +2 -2
  216. package/lib/chevre/service/task/sendOrder.js +2 -1
  217. package/lib/chevre/service/task/voidPayTransaction.js +3 -7
  218. package/lib/chevre/service/task/voidPayment.d.ts +2 -2
  219. package/lib/chevre/service/task/voidPayment.js +2 -1
  220. package/lib/chevre/service/task/voidReserveTransaction.d.ts +1 -1
  221. package/lib/chevre/service/taskHandler/onOperationFailed/informTaskIfNeeded.js +1 -1
  222. package/lib/chevre/service/taskHandler/onOperationFailed.js +1 -1
  223. package/lib/chevre/service/taskHandler.d.ts +2 -2
  224. package/lib/chevre/service/taskHandler.js +36 -37
  225. package/lib/chevre/service/transaction/deleteTransaction/deletePayTransactionsByPlaceOrder.d.ts +15 -0
  226. package/lib/chevre/service/transaction/deleteTransaction/deletePayTransactionsByPlaceOrder.js +51 -0
  227. package/lib/chevre/service/transaction/deleteTransaction/deleteReservationsByPlaceOrder.d.ts +23 -0
  228. package/lib/chevre/service/transaction/deleteTransaction/deleteReservationsByPlaceOrder.js +64 -0
  229. package/lib/chevre/service/transaction/deleteTransaction.d.ts +1 -1
  230. package/lib/chevre/service/transaction/deleteTransaction.js +15 -152
  231. package/lib/chevre/service/transaction/placeOrder/confirm/potentialActions/sendEmailMessage.d.ts +28 -2
  232. package/lib/chevre/service/transaction/placeOrder/confirm/potentialActions/sendEmailMessage.js +11 -12
  233. package/lib/chevre/service/transaction/placeOrder/confirm/potentialActions.d.ts +4 -2
  234. package/lib/chevre/service/transaction/placeOrder/confirm/potentialActions.js +6 -7
  235. package/lib/chevre/service/transaction/placeOrder/confirm/prepareUnitPriceOfferConditions.d.ts +32 -4
  236. package/lib/chevre/service/transaction/placeOrder/confirm/prepareUnitPriceOfferConditions.js +10 -1
  237. package/lib/chevre/service/transaction/placeOrder/confirm/validation/factory.d.ts +5 -1
  238. package/lib/chevre/service/transaction/placeOrder/confirm/validation.d.ts +6 -2
  239. package/lib/chevre/service/transaction/placeOrder/confirm/validation.js +23 -9
  240. package/lib/chevre/service/transaction/placeOrder/confirm.d.ts +6 -5
  241. package/lib/chevre/service/transaction/placeOrder/confirm.js +30 -40
  242. package/lib/chevre/service/transaction/placeOrder/exportTasks/factory.d.ts +1 -1
  243. package/lib/chevre/service/transaction/placeOrder/exportTasksById.js +1 -1
  244. package/lib/chevre/service/transaction/placeOrder/publishConfirmationNumberIfNotExist.d.ts +4 -7
  245. package/lib/chevre/service/transaction/placeOrder/publishConfirmationNumberIfNotExist.js +33 -15
  246. package/lib/chevre/service/transaction/placeOrder/start.d.ts +1 -1
  247. package/lib/chevre/service/transaction/placeOrder/updateAgent/fixCustomer.d.ts +20 -0
  248. package/lib/chevre/service/transaction/placeOrder/updateAgent/fixCustomer.js +63 -0
  249. package/lib/chevre/service/transaction/placeOrder/updateAgent.d.ts +0 -1
  250. package/lib/chevre/service/transaction/placeOrder/updateAgent.js +17 -86
  251. package/lib/chevre/service/transaction/returnOrder/preStart.js +1 -1
  252. package/lib/chevre/service/transaction/returnOrder.js +1 -1
  253. package/lib/chevre/service.d.ts +8 -0
  254. package/lib/chevre/service.js +23 -1
  255. package/lib/chevre/taskSettings.d.ts +3 -4
  256. package/package.json +8 -11
  257. package/lib/chevre/service/order/findConfirmedPlaceOrder.d.ts +0 -13
  258. package/lib/chevre/service/order/findConfirmedPlaceOrder.js +0 -32
  259. package/lib/chevre/service/reserve/findReservations.d.ts +0 -33
  260. package/lib/chevre/service/reserve/findReservations.js +0 -61
@@ -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
  {
@@ -0,0 +1,16 @@
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' | 'description' | 'executor' | 'lastTriedAt' | 'name' | 'numberOfTried' | 'project' | 'remainingNumberOfTries' | 'runsAt' | 'status'> & {
5
+ /**
6
+ * ttlの基準にするので必須
7
+ */
8
+ expires: Date;
9
+ };
10
+ type IModel = Model<IDocType, Record<string, never>, Record<string, never>, IVirtuals>;
11
+ type ISchemaDefinition = SchemaDefinition<IDocType>;
12
+ type ISchema = Schema<IDocType, IModel, Record<string, never>, Record<string, never>, IVirtuals, Record<string, never>, ISchemaDefinition, IDocType>;
13
+ declare const modelName = "ScheduledTask";
14
+ declare const indexes: [d: IndexDefinition, o: IndexOptions][];
15
+ declare function createSchema(): ISchema;
16
+ export { createSchema, IDocType, IModel, indexes, modelName };
@@ -0,0 +1,103 @@
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 = 'ScheduledTask';
9
+ exports.modelName = modelName;
10
+ const schemaDefinition = {
11
+ description: String, // add(2025-03-30~)
12
+ project: { type: mongoose_1.SchemaTypes.Mixed, required: true },
13
+ name: { type: String, required: true },
14
+ status: { type: String, required: true },
15
+ runsAt: { type: Date, required: true },
16
+ expires: { type: Date, required: true },
17
+ remainingNumberOfTries: { type: Number, required: true },
18
+ numberOfTried: { type: Number, required: true },
19
+ lastTriedAt: Date,
20
+ executionResults: [mongoose_1.SchemaTypes.Mixed],
21
+ executor: mongoose_1.SchemaTypes.Mixed,
22
+ data: mongoose_1.SchemaTypes.Mixed,
23
+ dateAborted: Date,
24
+ };
25
+ const schemaOptions = {
26
+ autoIndex: settings_1.MONGO_AUTO_INDEX,
27
+ autoCreate: false,
28
+ collection: 'scheduledTasks',
29
+ id: true,
30
+ read: 'primary',
31
+ writeConcern: writeConcern_1.writeConcern,
32
+ strict: true,
33
+ strictQuery: false,
34
+ timestamps: false,
35
+ versionKey: false,
36
+ toJSON: {
37
+ getters: false,
38
+ virtuals: false,
39
+ minimize: false,
40
+ versionKey: false
41
+ },
42
+ toObject: {
43
+ getters: false,
44
+ virtuals: true,
45
+ minimize: false,
46
+ versionKey: false
47
+ }
48
+ };
49
+ const EXPIRE_AFTER_SECONDS = 0;
50
+ const indexes = [
51
+ [
52
+ { expires: 1 },
53
+ {
54
+ name: 'ttlByExpires',
55
+ expireAfterSeconds: EXPIRE_AFTER_SECONDS
56
+ }
57
+ ],
58
+ [
59
+ { runsAt: -1 },
60
+ { name: 'runsAt' }
61
+ ],
62
+ [
63
+ { 'project.id': 1, runsAt: -1 },
64
+ { name: 'projectId' }
65
+ ],
66
+ [
67
+ { name: 1, runsAt: -1 },
68
+ { name: 'scheduledTaskName' }
69
+ ],
70
+ [
71
+ { status: 1, runsAt: -1 },
72
+ { name: 'status' }
73
+ ],
74
+ [
75
+ { status: 1, name: 1, runsAt: 1 },
76
+ { name: 'runScheduledTaskIfExists' }
77
+ ],
78
+ [
79
+ { status: 1, remainingNumberOfTries: 1, lastTriedAt: 1 },
80
+ {
81
+ name: 'retryOrAbortScheduledTasks',
82
+ partialFilterExpression: {
83
+ lastTriedAt: { $exists: true }
84
+ }
85
+ }
86
+ ],
87
+ ];
88
+ exports.indexes = indexes;
89
+ /**
90
+ * 予定タスクスキーマ
91
+ */
92
+ let schema;
93
+ function createSchema() {
94
+ if (schema === undefined) {
95
+ schema = new mongoose_1.Schema(schemaDefinition, schemaOptions);
96
+ if (settings_1.MONGO_AUTO_INDEX) {
97
+ indexes.forEach((indexParams) => {
98
+ schema?.index(...indexParams);
99
+ });
100
+ }
101
+ }
102
+ return schema;
103
+ }
@@ -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
  /**
@@ -1,7 +1,12 @@
1
1
  import { IndexDefinition, IndexOptions, Model, Schema, SchemaDefinition } from 'mongoose';
2
2
  import { IVirtuals } from '../virtuals';
3
3
  import { factory } from '../../../factory';
4
- type IDocType = Omit<factory.task.ITask<factory.taskName>, 'id'>;
4
+ type IDocType = Omit<factory.task.ITask<factory.taskName>, 'id'> & {
5
+ /**
6
+ * 非同期アクション移行前のタスクには残っている(2026-07-29時点)
7
+ */
8
+ expires?: Date;
9
+ };
5
10
  type IModel = Model<IDocType, Record<string, never>, Record<string, never>, IVirtuals>;
6
11
  type ISchemaDefinition = SchemaDefinition<IDocType>;
7
12
  type ISchema = Schema<IDocType, IModel, Record<string, never>, Record<string, never>, IVirtuals, Record<string, never>, ISchemaDefinition, IDocType>;
@@ -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
  }[];
@@ -1,5 +1,4 @@
1
- import type { BulkWriteResult } from 'mongodb';
2
- import { Connection, FilterQuery } from 'mongoose';
1
+ import { Connection, FilterQuery, mongo } from 'mongoose';
3
2
  import { factory } from '../factory';
4
3
  export type IAggregatedOfferCatalog = Pick<factory.offerCatalog.IOfferCatalog, 'id' | 'name' | 'description' | 'project' | 'typeOf' | 'identifier' | 'itemOffered' | 'additionalProperty' | 'relatedOffer'> & {
5
4
  numberOfItems?: number;
@@ -42,7 +41,7 @@ export declare class OfferCatalogItemRepo {
42
41
  */
43
42
  productType: factory.product.ProductType;
44
43
  }): Promise<{
45
- bulkWriteResult?: BulkWriteResult;
44
+ bulkWriteResult?: mongo.BulkWriteResult;
46
45
  modifiedCatalogs?: {
47
46
  id: string;
48
47
  }[];
@@ -135,6 +135,7 @@ export declare class OrderRepo {
135
135
  getCursor(conditions: any, projection: any): import("mongoose").Cursor<import("mongoose").Document<unknown, Record<string, never>, IDocType, import("./mongoose/virtuals").IVirtuals, {}> & Omit<factory.order.IOrder, "id"> & {
136
136
  acceptedOffers?: factory.order.IAcceptedOffer[];
137
137
  identifier?: string;
138
+ paymentMethodId?: string;
138
139
  } & {
139
140
  _id: import("mongoose").Types.ObjectId;
140
141
  } & {
@@ -142,6 +143,7 @@ export declare class OrderRepo {
142
143
  }, import("mongoose").QueryOptions<IDocType>, (import("mongoose").Document<unknown, Record<string, never>, IDocType, import("./mongoose/virtuals").IVirtuals, {}> & Omit<factory.order.IOrder, "id"> & {
143
144
  acceptedOffers?: factory.order.IAcceptedOffer[];
144
145
  identifier?: string;
146
+ paymentMethodId?: string;
145
147
  } & {
146
148
  _id: import("mongoose").Types.ObjectId;
147
149
  } & {
@@ -848,24 +848,24 @@ class OrderRepo {
848
848
  })
849
849
  .exec();
850
850
  }
851
- // public async updateIdentifier4migration(params: {
852
- // project: { id: string };
853
- // orderNumber: string;
854
- // identifier: string;
851
+ // public async savePaymentMethodId4migaration(params: {
852
+ // id: string;
853
+ // paymentMethod: IPaymentMethodByPaymentUrl;
855
854
  // }) {
856
- // const { orderNumber, project, identifier } = params;
857
- // return this.orderModel.updateOne(
855
+ // const { paymentMethodId } = params.paymentMethod;
856
+ // if (typeof paymentMethodId !== 'string' || paymentMethodId === '') {
857
+ // throw new factory.errors.ArgumentNull('paymentMethod.paymentMethodId');
858
+ // }
859
+ // // 注文ドキュメントにも保管する(2026-07-12~)
860
+ // return this.orderModel.findOneAndUpdate(
858
861
  // {
859
- // orderNumber: { $eq: orderNumber },
860
- // 'project.id': { $eq: project.id },
861
- // typeOf: { $eq: factory.order.OrderType.Order }
862
+ // identifier: { $eq: params.id },
863
+ // paymentMethodId: { $exists: false }
862
864
  // },
863
- // {
864
- // $set: {
865
- // ...(typeof identifier === 'string') ? { identifier } : undefined
866
- // }
867
- // }
865
+ // { $set: { paymentMethodId } },
866
+ // { projection: { _id: 1 } }
868
867
  // )
868
+ // .lean()
869
869
  // .exec();
870
870
  // }
871
871
  async aggregateOrder(params) {
@@ -11,14 +11,25 @@ export type IOrderInTransaction = Pick<factory.order.IOrder, 'orderNumber' | 'pr
11
11
  acceptedOffers: factory.order.IAcceptedOffer[];
12
12
  customer?: factory.order.ICustomer;
13
13
  seller?: factory.order.ISeller;
14
+ confirmationNumber?: string;
14
15
  };
15
16
  /**
16
17
  * typeOf: Orderへドキュメント変換時の編集フィールド
17
18
  */
18
- export type IPlacingOrder = Pick<factory.order.IOrder, 'confirmationNumber' | 'orderDate' | 'orderNumber' | 'orderStatus' | 'orderedItem' | 'paymentMethods' | 'price' | 'priceCurrency' | 'typeOf'> & {
19
+ export type IPlacingOrder = Pick<factory.order.IOrder, 'orderDate' | 'orderStatus' | 'orderedItem' | 'paymentMethods' | 'price' | 'priceCurrency' | 'typeOf'> & {
19
20
  url?: never;
20
21
  identifier?: never;
21
22
  name?: never;
23
+ /**
24
+ * 上書きしてはいけない
25
+ * 注文取引進行中にセット済であり上書きしてはいけない
26
+ */
27
+ orderNumber?: never;
28
+ /**
29
+ * 上書きしてはいけない
30
+ * 注文取引進行中にセット済であり上書きしてはいけない
31
+ */
32
+ confirmationNumber?: never;
22
33
  /**
23
34
  * 上書きしてはいけない
24
35
  */
@@ -56,11 +67,19 @@ export type IMinimizedAcceptedOffer = Pick<factory.order.IOptimizedAcceptedOffer
56
67
  priceSpecification?: never;
57
68
  name?: never;
58
69
  };
70
+ export interface IPaymentMethodByPaymentUrl {
71
+ /**
72
+ * 決済採用時に発行済の決済方法ID
73
+ * 決済承認時に指定が可能
74
+ */
75
+ paymentMethodId: string;
76
+ }
59
77
  /**
60
78
  * 取引中注文リポジトリ
61
79
  */
62
80
  export declare class OrderInTransactionRepo extends AcceptedOfferInReserveRepo {
63
81
  private readonly orderModel;
82
+ private readonly transactionModel;
64
83
  constructor(connection: Connection);
65
84
  createPlaceOrderIfNotExists(params: Pick<IOrderInTransaction, 'orderNumber' | 'project' | 'identifier' | 'broker' | 'seller' | 'customer'>): Promise<import("mongoose").UpdateWriteOpResult | undefined>;
66
85
  /**
@@ -94,6 +113,11 @@ export declare class OrderInTransactionRepo extends AcceptedOfferInReserveRepo {
94
113
  project: {
95
114
  id: string;
96
115
  };
116
+ }, options: {
117
+ /**
118
+ * 注文取引タイプのドキュメントのみを参照対象にするかどうか
119
+ */
120
+ onlyPlaceOrder: boolean;
97
121
  }): Promise<(Pick<factory.order.IAcceptedOffer, 'id' | 'itemOffered' | 'offeredThrough' | 'serialNumber' | 'typeOf'> & {
98
122
  priceSpecification?: factory.order.ITicketPriceSpecification;
99
123
  })[]>;
@@ -127,6 +151,49 @@ export declare class OrderInTransactionRepo extends AcceptedOfferInReserveRepo {
127
151
  setCustomerByIdentifier(params: Pick<IOrderInTransaction, 'project' | 'identifier'> & {
128
152
  customer: factory.order.ICustomer;
129
153
  }): Promise<import("mongoose").UpdateWriteOpResult>;
154
+ /**
155
+ * 確認番号を参照する
156
+ */
157
+ findConfirmationNumberByIdentifier(params: {
158
+ identifier: string;
159
+ }): Promise<string | undefined>;
160
+ /**
161
+ * 注文ドキュメントに確認番号を保管する
162
+ * 確認番号未発行の場合のみ保管される
163
+ */
164
+ saveConfirmationNumberIfNotExist(params: {
165
+ identifier: string;
166
+ confirmationNumber: string;
167
+ }, options: {
168
+ /**
169
+ * 注文取引タイプのドキュメントのみを参照対象にするかどうか
170
+ */
171
+ onlyPlaceOrder: boolean;
172
+ }): Promise<import("mongoose").UpdateWriteOpResult>;
173
+ /**
174
+ * 特定の進行中取引の決済方法IDを保管する
175
+ * transactionsへの保管としてひとまず定義(2026-07-11~)
176
+ */
177
+ savePaymentMethodId(params: {
178
+ id: string;
179
+ paymentMethod: IPaymentMethodByPaymentUrl;
180
+ }, options: {
181
+ savePaymentMethodIdInTransaction: boolean;
182
+ }): Promise<void>;
183
+ /**
184
+ * 進行中取引に保管された採用済決済方法を検索する
185
+ * 注文ドキュメントから参照する(2026-07-13~)
186
+ */
187
+ findInProgressPaymentMethodId(params: {
188
+ id: string;
189
+ }): Promise<string | undefined>;
190
+ /**
191
+ * 保管された採用済決済方法を検索する
192
+ * 注文ドキュメントから参照する(2026-07-13~)
193
+ */
194
+ findPaymentMethodId(params: {
195
+ id: string;
196
+ }): Promise<string | undefined>;
130
197
  deleteByIdentifier(params: {
131
198
  identifier: string;
132
199
  }): Promise<import("mongodb").DeleteResult>;