@chevre/domain 25.2.0-alpha.4 → 25.2.0-alpha.40

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 (172) hide show
  1. package/lib/chevre/factory/customerTelephone2COATelNum.d.ts +3 -0
  2. package/lib/chevre/factory/customerTelephone2COATelNum.js +22 -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/aggregateOffer.d.ts +2 -3
  9. package/lib/chevre/repo/creativeWork.d.ts +2 -3
  10. package/lib/chevre/repo/customerType.d.ts +2 -3
  11. package/lib/chevre/repo/event.d.ts +10 -11
  12. package/lib/chevre/repo/eventOffer.d.ts +4 -5
  13. package/lib/chevre/repo/eventSellerMakesOffer.d.ts +2 -3
  14. package/lib/chevre/repo/eventSeries.d.ts +4 -5
  15. package/lib/chevre/repo/message.d.ts +1 -1
  16. package/lib/chevre/repo/message.js +1 -1
  17. package/lib/chevre/repo/mongoose/schemas/action.js +67 -66
  18. package/lib/chevre/repo/mongoose/schemas/order.d.ts +4 -0
  19. package/lib/chevre/repo/mongoose/schemas/order.js +10 -0
  20. package/lib/chevre/repo/mongoose/schemas/setting.d.ts +4 -0
  21. package/lib/chevre/repo/mongoose/schemas/task.js +12 -12
  22. package/lib/chevre/repo/note.d.ts +3 -4
  23. package/lib/chevre/repo/noteAboutOrder.d.ts +2 -3
  24. package/lib/chevre/repo/offerCatalog.d.ts +2 -3
  25. package/lib/chevre/repo/offerCatalogItem.d.ts +2 -3
  26. package/lib/chevre/repo/order.d.ts +2 -0
  27. package/lib/chevre/repo/order.js +14 -14
  28. package/lib/chevre/repo/orderInTransaction.d.ts +68 -1
  29. package/lib/chevre/repo/orderInTransaction.js +181 -3
  30. package/lib/chevre/repo/person.d.ts +0 -15
  31. package/lib/chevre/repo/person.js +122 -108
  32. package/lib/chevre/repo/place/entranceGate.d.ts +4 -5
  33. package/lib/chevre/repo/place/movieTheater.d.ts +3 -4
  34. package/lib/chevre/repo/place/screeningRoom.d.ts +4 -5
  35. package/lib/chevre/repo/place/seat.d.ts +4 -5
  36. package/lib/chevre/repo/place/section.d.ts +3 -4
  37. package/lib/chevre/repo/product.d.ts +3 -4
  38. package/lib/chevre/repo/rateLimit/offer.js +0 -12
  39. package/lib/chevre/repo/reservation.d.ts +2 -3
  40. package/lib/chevre/repo/sellerMakesOffer.d.ts +3 -4
  41. package/lib/chevre/repo/stockHolder.d.ts +1 -1
  42. package/lib/chevre/repo/stockHolder.js +0 -146
  43. package/lib/chevre/repo/transaction/placeOrder.d.ts +2 -45
  44. package/lib/chevre/repo/transaction/placeOrder.js +43 -83
  45. package/lib/chevre/repo/transaction.d.ts +2 -2
  46. package/lib/chevre/repo/transactionNumberCounter.js +0 -34
  47. package/lib/chevre/repo/transactionProcess.js +0 -13
  48. package/lib/chevre/service/assetTransaction/pay/publishPaymentUrl.js +1 -1
  49. package/lib/chevre/service/assetTransaction/pay/start/factory.d.ts +1 -1
  50. package/lib/chevre/service/assetTransaction/pay/start/factory.js +3 -4
  51. package/lib/chevre/service/assetTransaction/pay/start.d.ts +1 -1
  52. package/lib/chevre/service/notification/factory.d.ts +2 -4
  53. package/lib/chevre/service/notification/factory.js +26 -24
  54. package/lib/chevre/service/notification/notifyAbortedTasksByEmail.d.ts +11 -5
  55. package/lib/chevre/service/notification/notifyAbortedTasksByEmail.js +11 -3
  56. package/lib/chevre/service/offer/event/authorize/factory.d.ts +3 -5
  57. package/lib/chevre/service/offer/event/authorize/factory.js +93 -75
  58. package/lib/chevre/service/offer/event/authorize.d.ts +0 -4
  59. package/lib/chevre/service/offer/event/authorize.js +2 -2
  60. package/lib/chevre/service/offer/eventServiceByCOA/authorize/factory.d.ts +6 -7
  61. package/lib/chevre/service/offer/eventServiceByCOA/authorize/factory.js +10 -10
  62. package/lib/chevre/service/offer/eventServiceByCOA/authorize.d.ts +0 -5
  63. package/lib/chevre/service/offer/eventServiceByCOA/authorize.js +17 -14
  64. package/lib/chevre/service/offer/eventServiceByCOA/authorizeByAcceptAction.d.ts +0 -5
  65. package/lib/chevre/service/offer/eventServiceByCOA/authorizeByAcceptAction.js +2 -2
  66. package/lib/chevre/service/offer/eventServiceByCOA/changeOffers.js +1 -1
  67. package/lib/chevre/service/order/deleteOrder.d.ts +5 -1
  68. package/lib/chevre/service/order/deleteOrder.js +8 -1
  69. package/lib/chevre/service/order/onAssetTransactionStatusChanged/onPayTransactionCanceled.js +19 -11
  70. package/lib/chevre/service/order/onAssetTransactionStatusChanged/onPayTransactionConfirmed.d.ts +2 -0
  71. package/lib/chevre/service/order/onAssetTransactionStatusChanged/paymentDue2Processing.d.ts +2 -2
  72. package/lib/chevre/service/order/onAssetTransactionStatusChanged/paymentDue2Processing.js +1 -7
  73. package/lib/chevre/service/order/onAssetTransactionStatusChanged.d.ts +2 -0
  74. package/lib/chevre/service/order/onAssetTransactionStatusChanged.js +2 -0
  75. package/lib/chevre/service/order/onOrderStatusChanged/onOrderProcessing/createSendEmailMessageTaskIfNotExist.d.ts +5 -1
  76. package/lib/chevre/service/order/onOrderStatusChanged/onOrderProcessing/createSendEmailMessageTaskIfNotExist.js +95 -33
  77. package/lib/chevre/service/order/onOrderStatusChanged/onOrderProcessing.d.ts +2 -2
  78. package/lib/chevre/service/order/onOrderStatusChanged/onOrderProcessing.js +4 -2
  79. package/lib/chevre/service/order/onOrderStatusChanged/onOrderReturned.js +2 -6
  80. package/lib/chevre/service/order/payOrder.d.ts +2 -0
  81. package/lib/chevre/service/order/placeOrder/createPlacingOrderFromExistingTransaction.d.ts +2 -1
  82. package/lib/chevre/service/order/placeOrder/createPlacingOrderFromExistingTransaction.js +13 -58
  83. package/lib/chevre/service/order/placeOrder/factory.js +3 -21
  84. package/lib/chevre/service/order/placeOrder.d.ts +4 -5
  85. package/lib/chevre/service/order/placeOrder.js +20 -31
  86. package/lib/chevre/service/payment/any/authorize/fixOrderAsNeeded.js +1 -2
  87. package/lib/chevre/service/payment/any/authorize/fixTransactionNumber.d.ts +3 -2
  88. package/lib/chevre/service/payment/any/authorize/handlePrePublishedPaymentMethodIdOnAuthorizing.d.ts +4 -3
  89. package/lib/chevre/service/payment/any/authorize/handlePrePublishedPaymentMethodIdOnAuthorizing.js +3 -31
  90. package/lib/chevre/service/payment/any/authorize.js +13 -37
  91. package/lib/chevre/service/payment/any/factory.d.ts +7 -7
  92. package/lib/chevre/service/payment/any/factory.js +19 -22
  93. package/lib/chevre/service/payment/any/findAcceptAction.d.ts +3 -1
  94. package/lib/chevre/service/payment/any/findAcceptAction.js +14 -6
  95. package/lib/chevre/service/payment/any/invalidatePaymentUrl.d.ts +2 -0
  96. package/lib/chevre/service/payment/any/invalidatePaymentUrl.js +4 -66
  97. package/lib/chevre/service/payment/any/publishPaymentUrl.d.ts +4 -0
  98. package/lib/chevre/service/payment/any/publishPaymentUrl.js +4 -18
  99. package/lib/chevre/service/payment/any/voidPayTransaction.d.ts +2 -0
  100. package/lib/chevre/service/payment/any/voidPayTransaction.js +1 -23
  101. package/lib/chevre/service/payment/creditCard/authorize/processAuthorizeCreditCard.d.ts +1 -1
  102. package/lib/chevre/service/payment/creditCard/authorize/processAuthorizeCreditCard.js +5 -9
  103. package/lib/chevre/service/reserve/adminFindReservations.d.ts +15 -0
  104. package/lib/chevre/service/reserve/adminFindReservations.js +35 -0
  105. package/lib/chevre/service/reserve/potentialActions/onReservationConfirmed.js +17 -8
  106. package/lib/chevre/service/reserve/searchByOrder.js +2 -6
  107. package/lib/chevre/service/reserve.d.ts +2 -2
  108. package/lib/chevre/service/reserve.js +3 -3
  109. package/lib/chevre/service/task/aggregateOffers.d.ts +2 -2
  110. package/lib/chevre/service/task/aggregateOffers.js +2 -1
  111. package/lib/chevre/service/task/aggregateScreeningEvent.d.ts +2 -2
  112. package/lib/chevre/service/task/aggregateScreeningEvent.js +2 -1
  113. package/lib/chevre/service/task/authorizePayment.js +3 -1
  114. package/lib/chevre/service/task/cancelReservation.d.ts +2 -2
  115. package/lib/chevre/service/task/cancelReservation.js +2 -1
  116. package/lib/chevre/service/task/confirmPayTransaction.js +0 -1
  117. package/lib/chevre/service/task/confirmReserveTransaction.js +2 -7
  118. package/lib/chevre/service/task/deleteTransaction.d.ts +2 -2
  119. package/lib/chevre/service/task/deleteTransaction.js +2 -1
  120. package/lib/chevre/service/task/onAssetTransactionStatusChanged.d.ts +2 -2
  121. package/lib/chevre/service/task/onAssetTransactionStatusChanged.js +4 -3
  122. package/lib/chevre/service/task/onEventChanged.d.ts +2 -2
  123. package/lib/chevre/service/task/onEventChanged.js +2 -1
  124. package/lib/chevre/service/task/onOrderPaymentCompleted.d.ts +2 -2
  125. package/lib/chevre/service/task/onOrderPaymentCompleted.js +4 -1
  126. package/lib/chevre/service/task/onResourceUpdated.d.ts +2 -2
  127. package/lib/chevre/service/task/onResourceUpdated.js +2 -1
  128. package/lib/chevre/service/task/placeOrder.d.ts +2 -2
  129. package/lib/chevre/service/task/placeOrder.js +6 -3
  130. package/lib/chevre/service/task/publishPaymentUrl.js +7 -3
  131. package/lib/chevre/service/task/refund.d.ts +2 -2
  132. package/lib/chevre/service/task/refund.js +4 -10
  133. package/lib/chevre/service/task/reserve.d.ts +2 -2
  134. package/lib/chevre/service/task/reserve.js +2 -1
  135. package/lib/chevre/service/task/returnOrder.d.ts +2 -2
  136. package/lib/chevre/service/task/returnOrder.js +2 -1
  137. package/lib/chevre/service/task/sendOrder.d.ts +2 -2
  138. package/lib/chevre/service/task/sendOrder.js +2 -1
  139. package/lib/chevre/service/task/voidPayTransaction.js +3 -7
  140. package/lib/chevre/service/task/voidPayment.d.ts +2 -2
  141. package/lib/chevre/service/task/voidPayment.js +2 -1
  142. package/lib/chevre/service/taskHandler.d.ts +2 -2
  143. package/lib/chevre/service/taskHandler.js +36 -37
  144. package/lib/chevre/service/transaction/deleteTransaction/deletePayTransactionsByPlaceOrder.d.ts +15 -0
  145. package/lib/chevre/service/transaction/deleteTransaction/deletePayTransactionsByPlaceOrder.js +51 -0
  146. package/lib/chevre/service/transaction/deleteTransaction/deleteReservationsByPlaceOrder.d.ts +23 -0
  147. package/lib/chevre/service/transaction/deleteTransaction/deleteReservationsByPlaceOrder.js +64 -0
  148. package/lib/chevre/service/transaction/deleteTransaction.js +15 -152
  149. package/lib/chevre/service/transaction/placeOrder/confirm/potentialActions/sendEmailMessage.d.ts +28 -2
  150. package/lib/chevre/service/transaction/placeOrder/confirm/potentialActions/sendEmailMessage.js +11 -12
  151. package/lib/chevre/service/transaction/placeOrder/confirm/potentialActions.d.ts +4 -2
  152. package/lib/chevre/service/transaction/placeOrder/confirm/potentialActions.js +6 -7
  153. package/lib/chevre/service/transaction/placeOrder/confirm/prepareUnitPriceOfferConditions.d.ts +35 -2
  154. package/lib/chevre/service/transaction/placeOrder/confirm/prepareUnitPriceOfferConditions.js +16 -12
  155. package/lib/chevre/service/transaction/placeOrder/confirm/validation/factory.d.ts +5 -1
  156. package/lib/chevre/service/transaction/placeOrder/confirm/validation.d.ts +11 -2
  157. package/lib/chevre/service/transaction/placeOrder/confirm/validation.js +112 -91
  158. package/lib/chevre/service/transaction/placeOrder/confirm.d.ts +6 -5
  159. package/lib/chevre/service/transaction/placeOrder/confirm.js +33 -78
  160. package/lib/chevre/service/transaction/placeOrder/publishConfirmationNumberIfNotExist.d.ts +4 -7
  161. package/lib/chevre/service/transaction/placeOrder/publishConfirmationNumberIfNotExist.js +33 -15
  162. package/lib/chevre/service/transaction/placeOrder/start.d.ts +1 -1
  163. package/lib/chevre/service/transaction/placeOrder/updateAgent/fixCustomer.d.ts +20 -0
  164. package/lib/chevre/service/transaction/placeOrder/updateAgent/fixCustomer.js +63 -0
  165. package/lib/chevre/service/transaction/placeOrder/updateAgent.d.ts +0 -1
  166. package/lib/chevre/service/transaction/placeOrder/updateAgent.js +17 -86
  167. package/lib/chevre/taskSettings.d.ts +1 -3
  168. package/package.json +8 -11
  169. package/lib/chevre/service/order/findConfirmedPlaceOrder.d.ts +0 -13
  170. package/lib/chevre/service/order/findConfirmedPlaceOrder.js +0 -32
  171. package/lib/chevre/service/reserve/findReservations.d.ts +0 -33
  172. package/lib/chevre/service/reserve/findReservations.js +0 -61
@@ -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
  import * as EventFactory from '../factory/event';
5
4
  export interface IAttributes4patchUpdate {
@@ -83,7 +82,7 @@ export declare class EventRepo {
83
82
  */
84
83
  update: boolean;
85
84
  }): Promise<{
86
- bulkWriteResult?: BulkWriteResult;
85
+ bulkWriteResult?: mongo.BulkWriteResult;
87
86
  modifiedEvents: {
88
87
  id: string;
89
88
  }[];
@@ -202,7 +201,7 @@ export declare class EventRepo {
202
201
  organizer: {
203
202
  id: string;
204
203
  };
205
- }): Promise<import("mongodb").DeleteResult>;
204
+ }): Promise<mongo.DeleteResult>;
206
205
  deleteManyEventsByScreeningRoom(params: {
207
206
  project: {
208
207
  id: string;
@@ -219,7 +218,7 @@ export declare class EventRepo {
219
218
  id: string;
220
219
  };
221
220
  };
222
- }): Promise<import("mongodb").DeleteResult>;
221
+ }): Promise<mongo.DeleteResult>;
223
222
  deleteManyBySuperEventId(params: {
224
223
  project: {
225
224
  id: string;
@@ -227,7 +226,7 @@ export declare class EventRepo {
227
226
  superEvent: {
228
227
  id: string;
229
228
  };
230
- }): Promise<import("mongodb").DeleteResult>;
229
+ }): Promise<mongo.DeleteResult>;
231
230
  deleteManyBySuperEventLocationId(params: {
232
231
  project: {
233
232
  id: string;
@@ -237,7 +236,7 @@ export declare class EventRepo {
237
236
  id: string;
238
237
  };
239
238
  };
240
- }): Promise<import("mongodb").DeleteResult>;
239
+ }): Promise<mongo.DeleteResult>;
241
240
  /**
242
241
  * 興行(プロダクト)から削除する
243
242
  */
@@ -252,7 +251,7 @@ export declare class EventRepo {
252
251
  };
253
252
  };
254
253
  };
255
- }): Promise<import("mongodb").DeleteResult>;
254
+ }): Promise<mongo.DeleteResult>;
256
255
  deleteManyEventsEndedByProject(params: {
257
256
  typeOf: {
258
257
  $in: factory.eventType.ScreeningEvent[];
@@ -263,7 +262,7 @@ export declare class EventRepo {
263
262
  endDate: {
264
263
  $lte: Date;
265
264
  };
266
- }): Promise<import("mongodb").DeleteResult>;
265
+ }): Promise<mongo.DeleteResult>;
267
266
  deleteManyEventsEnded(params: {
268
267
  typeOf: {
269
268
  $eq: factory.eventType.ScreeningEvent;
@@ -271,7 +270,7 @@ export declare class EventRepo {
271
270
  endDate: {
272
271
  $lte: Date;
273
272
  };
274
- }): Promise<import("mongodb").DeleteResult>;
273
+ }): Promise<mongo.DeleteResult>;
275
274
  deleteByProject(params: {
276
275
  project: {
277
276
  id: string;
@@ -283,7 +282,7 @@ export declare class EventRepo {
283
282
  updateAggregationById(params: {
284
283
  id: string;
285
284
  }, update: IUpdateAggregateReservationParams): Promise<void>;
286
- bulkWrite(bulkWriteOps: any[]): Promise<BulkWriteResult & {
285
+ bulkWrite(bulkWriteOps: any[]): Promise<mongo.BulkWriteResult & {
287
286
  mongoose?: {
288
287
  validationErrors: import("mongoose").Error[];
289
288
  } | undefined;
@@ -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
  {
@@ -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'>;
@@ -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>;