@chevre/domain 24.0.0-alpha.1 → 24.0.0-alpha.11

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 (184) hide show
  1. package/lib/chevre/repo/acceptedPaymentMethod.js +1 -1
  2. package/lib/chevre/repo/additionalProperty.js +1 -1
  3. package/lib/chevre/repo/aggregateOffer.js +1 -1
  4. package/lib/chevre/repo/confirmationNumber.js +2 -4
  5. package/lib/chevre/repo/creativeWork.js +1 -1
  6. package/lib/chevre/repo/eventOffer.js +1 -1
  7. package/lib/chevre/repo/eventSeries.js +1 -1
  8. package/lib/chevre/repo/identity.js +1 -2
  9. package/lib/chevre/repo/issuer.js +2 -4
  10. package/lib/chevre/repo/message.js +1 -1
  11. package/lib/chevre/repo/mongoose/schemas/transaction.js +31 -0
  12. package/lib/chevre/repo/note.js +1 -1
  13. package/lib/chevre/repo/noteAboutOrder.js +1 -1
  14. package/lib/chevre/repo/offer/unitPriceInCatalog.js +1 -1
  15. package/lib/chevre/repo/offerItemCondition.js +1 -1
  16. package/lib/chevre/repo/order.js +1 -1
  17. package/lib/chevre/repo/orderInTransaction.d.ts +8 -0
  18. package/lib/chevre/repo/orderInTransaction.js +17 -4
  19. package/lib/chevre/repo/orderNumber.d.ts +3 -2
  20. package/lib/chevre/repo/orderNumber.js +25 -32
  21. package/lib/chevre/repo/place/movieTheater.js +1 -1
  22. package/lib/chevre/repo/place/seat.js +1 -1
  23. package/lib/chevre/repo/product.js +1 -1
  24. package/lib/chevre/repo/productOffer.js +1 -1
  25. package/lib/chevre/repo/project.js +1 -1
  26. package/lib/chevre/repo/reservation.js +1 -1
  27. package/lib/chevre/repo/role.js +1 -2
  28. package/lib/chevre/repo/seller.js +1 -1
  29. package/lib/chevre/repo/serviceOutputIdentifier.js +2 -4
  30. package/lib/chevre/repo/transaction/placeOrder.d.ts +140 -0
  31. package/lib/chevre/repo/transaction/placeOrder.js +528 -0
  32. package/lib/chevre/repo/transaction/returnOrder.d.ts +23 -0
  33. package/lib/chevre/repo/transaction/returnOrder.js +213 -0
  34. package/lib/chevre/repo/transaction.d.ts +11 -84
  35. package/lib/chevre/repo/transaction.js +331 -270
  36. package/lib/chevre/repo/transactionNumber.js +2 -4
  37. package/lib/chevre/repo/trip.js +1 -2
  38. package/lib/chevre/repository.d.ts +12 -0
  39. package/lib/chevre/repository.js +26 -1
  40. package/lib/chevre/service/account.js +14 -21
  41. package/lib/chevre/service/accountTransaction/deposit.js +2 -8
  42. package/lib/chevre/service/accountTransaction/transfer.js +2 -8
  43. package/lib/chevre/service/accountTransaction/withdraw.js +2 -8
  44. package/lib/chevre/service/aggregation/event/aggregateScreeningEvent.js +24 -32
  45. package/lib/chevre/service/assetTransaction/cancelReservationCOA.js +2 -4
  46. package/lib/chevre/service/assetTransaction/moneyTransfer.js +2 -23
  47. package/lib/chevre/service/assetTransaction/pay/check.js +6 -11
  48. package/lib/chevre/service/assetTransaction/pay/confirm.js +1 -2
  49. package/lib/chevre/service/assetTransaction/pay/searchGMOTrade.d.ts +1 -1
  50. package/lib/chevre/service/assetTransaction/pay/start/factory.d.ts +51 -3
  51. package/lib/chevre/service/assetTransaction/pay/start/factory.js +58 -21
  52. package/lib/chevre/service/assetTransaction/pay/start/preStart/fixPaymentService.d.ts +10 -0
  53. package/lib/chevre/service/assetTransaction/pay/start/preStart/fixPaymentService.js +88 -0
  54. package/lib/chevre/service/assetTransaction/pay/start/processAuthorize.d.ts +53 -0
  55. package/lib/chevre/service/assetTransaction/pay/start/processAuthorize.js +56 -0
  56. package/lib/chevre/service/assetTransaction/pay/start/processAuthorizeMovieTicket.d.ts +1 -1
  57. package/lib/chevre/service/assetTransaction/pay/start/processAuthorizeMovieTicket.js +1 -11
  58. package/lib/chevre/service/assetTransaction/pay/start.js +8 -132
  59. package/lib/chevre/service/assetTransaction/refund.js +13 -20
  60. package/lib/chevre/service/assetTransaction/registerService.js +1 -7
  61. package/lib/chevre/service/assetTransaction/reserve/validateStartRequest/validateIssuedOfferIfExists.js +2 -4
  62. package/lib/chevre/service/assetTransaction/reserveCOA.js +2 -4
  63. package/lib/chevre/service/delivery/product/factory.js +1 -2
  64. package/lib/chevre/service/delivery/reservation/factory.js +1 -2
  65. package/lib/chevre/service/event/saveScreeningEvents.js +1 -0
  66. package/lib/chevre/service/event.js +0 -1
  67. package/lib/chevre/service/moneyTransfer.js +2 -2
  68. package/lib/chevre/service/notification/factory.js +1 -1
  69. package/lib/chevre/service/notification/notifyByEmail.js +50 -56
  70. package/lib/chevre/service/notification/sendEmailMessage.js +2 -3
  71. package/lib/chevre/service/notification/triggerWebhook.js +32 -37
  72. package/lib/chevre/service/offer/event/authorize/processStartReserve4chevre.js +1 -2
  73. package/lib/chevre/service/offer/event/authorize.d.ts +2 -2
  74. package/lib/chevre/service/offer/event/authorize.js +4 -4
  75. package/lib/chevre/service/offer/event/issueEventOfferTicket.d.ts +2 -2
  76. package/lib/chevre/service/offer/event/issueEventOfferTicket.js +1 -1
  77. package/lib/chevre/service/offer/event/voidTransaction/processVoidTransaction4chevre.d.ts +0 -2
  78. package/lib/chevre/service/offer/event/voidTransaction/processVoidTransaction4chevre.js +1 -0
  79. package/lib/chevre/service/offer/event/voidTransaction.d.ts +2 -2
  80. package/lib/chevre/service/offer/event/voidTransaction.js +2 -2
  81. package/lib/chevre/service/offer/event/voidTransactionByActionId.d.ts +2 -2
  82. package/lib/chevre/service/offer/event/voidTransactionByActionId.js +2 -2
  83. package/lib/chevre/service/offer/eventServiceByCOA/acceptOffer/authorize.js +1 -2
  84. package/lib/chevre/service/offer/eventServiceByCOA/acceptOffer.d.ts +2 -2
  85. package/lib/chevre/service/offer/eventServiceByCOA/acceptOffer.js +6 -6
  86. package/lib/chevre/service/offer/eventServiceByCOA/authorize.d.ts +2 -2
  87. package/lib/chevre/service/offer/eventServiceByCOA/authorize.js +3 -10
  88. package/lib/chevre/service/offer/eventServiceByCOA/changeOffers.js +2 -2
  89. package/lib/chevre/service/offer/moneyTransfer/authorize.d.ts +2 -2
  90. package/lib/chevre/service/offer/moneyTransfer/authorize.js +53 -57
  91. package/lib/chevre/service/offer/moneyTransfer/voidTransaction.d.ts +2 -2
  92. package/lib/chevre/service/offer/moneyTransfer/voidTransaction.js +4 -1
  93. package/lib/chevre/service/offer/product.d.ts +3 -3
  94. package/lib/chevre/service/offer/product.js +4 -4
  95. package/lib/chevre/service/order/confirmPayTransaction.d.ts +0 -2
  96. package/lib/chevre/service/order/confirmPayTransaction.js +1 -0
  97. package/lib/chevre/service/order/findPlaceOrderTransaction.d.ts +2 -2
  98. package/lib/chevre/service/order/findPlaceOrderTransaction.js +1 -1
  99. package/lib/chevre/service/order/onAssetTransactionStatusChanged.d.ts +4 -4
  100. package/lib/chevre/service/order/onAssetTransactionStatusChanged.js +10 -19
  101. package/lib/chevre/service/order/onOrderStatusChanged/onOrderCancelled.js +1 -1
  102. package/lib/chevre/service/order/onOrderStatusChanged/onOrderDelivered.js +1 -1
  103. package/lib/chevre/service/order/onOrderStatusChanged/onOrderDeliveredPartially.js +1 -1
  104. package/lib/chevre/service/order/onOrderStatusChanged/onOrderInTransit.d.ts +2 -2
  105. package/lib/chevre/service/order/onOrderStatusChanged/onOrderInTransit.js +1 -1
  106. package/lib/chevre/service/order/onOrderStatusChanged/onOrderPaymentDue.js +1 -1
  107. package/lib/chevre/service/order/onOrderStatusChanged/onOrderProcessing.js +1 -1
  108. package/lib/chevre/service/order/onOrderStatusChanged/onOrderReturned.js +1 -1
  109. package/lib/chevre/service/order/onOrderUpdated.js +1 -2
  110. package/lib/chevre/service/order/payOrder.d.ts +2 -2
  111. package/lib/chevre/service/order/placeOrder/createPlacingOrderFromExistingTransaction.d.ts +2 -2
  112. package/lib/chevre/service/order/placeOrder/createPlacingOrderFromExistingTransaction.js +2 -3
  113. package/lib/chevre/service/order/placeOrder.d.ts +2 -2
  114. package/lib/chevre/service/order/returnOrder.d.ts +2 -2
  115. package/lib/chevre/service/order/returnOrder.js +2 -2
  116. package/lib/chevre/service/order/sendOrder.d.ts +2 -2
  117. package/lib/chevre/service/order/sendOrder.js +1 -1
  118. package/lib/chevre/service/payment/any/authorize/fixTransactionNumber.d.ts +3 -3
  119. package/lib/chevre/service/payment/any/authorize/handlePrePublishedPaymentMethodIdOnAuthorizing.d.ts +3 -3
  120. package/lib/chevre/service/payment/any/authorize/handlePrePublishedPaymentMethodIdOnAuthorizing.js +1 -1
  121. package/lib/chevre/service/payment/any/fixOrderAsNeeded.d.ts +2 -2
  122. package/lib/chevre/service/payment/any/fixOrderAsNeeded.js +4 -8
  123. package/lib/chevre/service/payment/any/publishPaymentUrl/fixTransactionNumberOnPublishPaymentUrl.d.ts +2 -2
  124. package/lib/chevre/service/payment/any.d.ts +6 -6
  125. package/lib/chevre/service/payment/any.js +10 -11
  126. package/lib/chevre/service/payment/creditCard/authorize/processAuthorizeCreditCard.js +1 -2
  127. package/lib/chevre/service/payment/creditCard/authorize/processAuthorizeCreditCard3ds.d.ts +1 -1
  128. package/lib/chevre/service/payment/creditCard/authorize/processAuthorizeCreditCard3ds.js +1 -2
  129. package/lib/chevre/service/payment/creditCard/authorize/processAuthorizeCreditCard3dsResult2recipe.d.ts +1 -1
  130. package/lib/chevre/service/payment/creditCard/authorize/processAuthorizeCreditCardResult2recipe.d.ts +1 -1
  131. package/lib/chevre/service/payment/creditCard/factory.d.ts +1 -1
  132. package/lib/chevre/service/payment/movieTicket/authorize.js +1 -1
  133. package/lib/chevre/service/payment/movieTicket/processPurchaseNumberAuth.js +2 -4
  134. package/lib/chevre/service/payment/movieTicket/refundMovieTicket.js +4 -6
  135. package/lib/chevre/service/payment/movieTicket/voidTransaction.js +1 -2
  136. package/lib/chevre/service/payment/paymentCard.js +2 -4
  137. package/lib/chevre/service/report/telemetry.d.ts +4 -0
  138. package/lib/chevre/service/report/telemetry.js +7 -12
  139. package/lib/chevre/service/reserve/potentialActions/onReservationUsed.js +2 -6
  140. package/lib/chevre/service/task/acceptCOAOffer.js +6 -4
  141. package/lib/chevre/service/task/authorizePayment.js +4 -2
  142. package/lib/chevre/service/task/confirmPayTransaction.js +2 -2
  143. package/lib/chevre/service/task/confirmReserveTransaction.js +1 -2
  144. package/lib/chevre/service/task/deleteTransaction.js +5 -1
  145. package/lib/chevre/service/task/onAssetTransactionStatusChanged.js +4 -2
  146. package/lib/chevre/service/task/onOrderPaymentCompleted.js +2 -2
  147. package/lib/chevre/service/task/onResourceDeleted/deleteResourcesByProduct.js +3 -6
  148. package/lib/chevre/service/task/onResourceUpdated/onOfferCatalogUpdated.js +1 -1
  149. package/lib/chevre/service/task/onResourceUpdated/syncOfferCatalog.js +1 -1
  150. package/lib/chevre/service/task/pay.js +1 -2
  151. package/lib/chevre/service/task/placeOrder.js +6 -4
  152. package/lib/chevre/service/task/publishPaymentUrl.js +4 -2
  153. package/lib/chevre/service/task/returnOrder.js +4 -4
  154. package/lib/chevre/service/task/returnPayTransaction.js +4 -3
  155. package/lib/chevre/service/task/sendOrder.js +2 -2
  156. package/lib/chevre/service/task/voidMoneyTransferTransaction.js +6 -3
  157. package/lib/chevre/service/task/voidPayTransaction.js +4 -2
  158. package/lib/chevre/service/task/voidRegisterServiceTransaction.js +3 -3
  159. package/lib/chevre/service/task/voidReserveTransaction.js +5 -4
  160. package/lib/chevre/service/transaction/deleteTransaction.d.ts +4 -0
  161. package/lib/chevre/service/transaction/deleteTransaction.js +57 -15
  162. package/lib/chevre/service/transaction/moneyTransfer.js +15 -23
  163. package/lib/chevre/service/transaction/placeOrder/confirm/publishCode.js +1 -1
  164. package/lib/chevre/service/transaction/placeOrder/confirm.d.ts +2 -2
  165. package/lib/chevre/service/transaction/placeOrder/confirm.js +12 -13
  166. package/lib/chevre/service/transaction/placeOrder/exportTasksById.d.ts +2 -2
  167. package/lib/chevre/service/transaction/placeOrder/exportTasksById.js +1 -1
  168. package/lib/chevre/service/transaction/placeOrder/{publishOrderNumberIfNotExist.d.ts → issueOrderNumberIfNotExist.d.ts} +4 -4
  169. package/lib/chevre/service/transaction/placeOrder/{publishOrderNumberIfNotExist.js → issueOrderNumberIfNotExist.js} +21 -13
  170. package/lib/chevre/service/transaction/placeOrder/publishConfirmationNumberIfNotExist.d.ts +2 -2
  171. package/lib/chevre/service/transaction/placeOrder/publishConfirmationNumberIfNotExist.js +3 -3
  172. package/lib/chevre/service/transaction/placeOrder/start/validateStartRequest.js +1 -2
  173. package/lib/chevre/service/transaction/placeOrder/start.d.ts +3 -3
  174. package/lib/chevre/service/transaction/placeOrder/start.js +2 -2
  175. package/lib/chevre/service/transaction/placeOrder/updateAgent.d.ts +23 -0
  176. package/lib/chevre/service/transaction/placeOrder/updateAgent.js +126 -0
  177. package/lib/chevre/service/transaction/placeOrder.d.ts +2 -1
  178. package/lib/chevre/service/transaction/placeOrder.js +3 -1
  179. package/lib/chevre/service/transaction/returnOrder/potentialActions.js +1 -2
  180. package/lib/chevre/service/transaction/returnOrder/preStart/getReturnPolicyByProject.js +1 -1
  181. package/lib/chevre/service/transaction/returnOrder.js +4 -4
  182. package/lib/chevre/service/transaction.d.ts +5 -21
  183. package/lib/chevre/service/transaction.js +5 -111
  184. package/package.json +6 -18
@@ -2,7 +2,7 @@ import * as factory from '../../../../factory';
2
2
  import type { ActionRepo } from '../../../../repo/action';
3
3
  import type { AuthorizationRepo } from '../../../../repo/authorization';
4
4
  import type { TicketRepo } from '../../../../repo/ticket';
5
- import type { ITransactionInProgress, TransactionRepo } from '../../../../repo/transaction';
5
+ import type { ITransactionInProgress, PlaceOrderRepo } from '../../../../repo/transaction/placeOrder';
6
6
  import type { TransactionNumberRepo } from '../../../../repo/transactionNumber';
7
7
  import * as PayTransactionService from '../../../assetTransaction/pay';
8
8
  import { IInvoiceByTicketToken } from '../factory';
@@ -10,7 +10,7 @@ interface IFixTransactionNumberRepos {
10
10
  action: ActionRepo;
11
11
  authorization: AuthorizationRepo;
12
12
  ticket: TicketRepo;
13
- transaction: TransactionRepo;
13
+ placeOrder: PlaceOrderRepo;
14
14
  transactionNumber: TransactionNumberRepo;
15
15
  }
16
16
  type IFixTransactionNumberOperation<T> = (repos: IFixTransactionNumberRepos) => Promise<T>;
@@ -22,7 +22,7 @@ type IObjectWithoutDetail = factory.action.authorize.paymentMethod.any.IObjectWi
22
22
  */
23
23
  declare function fixTransactionNumber(params: {
24
24
  object: IObjectWithoutDetail;
25
- transaction: Pick<ITransactionInProgress<factory.transactionType.PlaceOrder>, 'agent' | 'expires' | 'id' | 'typeOf' | 'project' | 'seller'>;
25
+ transaction: Pick<ITransactionInProgress, 'agent' | 'expires' | 'id' | 'typeOf' | 'project' | 'seller'>;
26
26
  paymentServiceType: factory.service.paymentService.PaymentServiceType;
27
27
  }): IFixTransactionNumberOperation<{
28
28
  transactionNumber: string;
@@ -2,7 +2,7 @@ import * as factory from '../../../../factory';
2
2
  import type { ActionRepo } from '../../../../repo/action';
3
3
  import type { AuthorizationRepo } from '../../../../repo/authorization';
4
4
  import type { TicketRepo } from '../../../../repo/ticket';
5
- import type { ITransactionInProgress, TransactionRepo } from '../../../../repo/transaction';
5
+ import type { ITransactionInProgress, PlaceOrderRepo } from '../../../../repo/transaction/placeOrder';
6
6
  import * as PayTransactionService from '../../../assetTransaction/pay';
7
7
  import type { IInvoiceByTicketToken } from '../factory';
8
8
  type IObjectWithoutDetail = factory.action.authorize.paymentMethod.any.IObjectWithoutDetail;
@@ -16,12 +16,12 @@ interface IAcceptAction2ticketResult {
16
16
  declare function handlePrePublishedPaymentMethodIdOnAuthorizing(params: {
17
17
  object: Pick<IObjectWithoutDetail, 'amount' | 'issuedThrough' | 'paymentMethod' | 'referencesOrder'>;
18
18
  prePublishedPaymentMethodId: string;
19
- transaction: Pick<ITransactionInProgress<factory.transactionType.PlaceOrder>, 'agent' | 'expires' | 'id' | 'typeOf' | 'project' | 'seller'>;
19
+ transaction: Pick<ITransactionInProgress, 'agent' | 'expires' | 'id' | 'typeOf' | 'project' | 'seller'>;
20
20
  }): (repos: {
21
21
  action: ActionRepo;
22
22
  authorization: AuthorizationRepo;
23
23
  ticket: TicketRepo;
24
- transaction: TransactionRepo;
24
+ placeOrder: PlaceOrderRepo;
25
25
  }) => Promise<{
26
26
  authorizeParams?: {
27
27
  creditCard: factory.action.authorize.paymentMethod.any.ICreditCard;
@@ -122,7 +122,7 @@ function handlePrePublishedPaymentMethodIdOnAuthorizing(params) {
122
122
  let acceptPayAction;
123
123
  // transaction.objectへのアクセス回避(2024-05-30~)
124
124
  // const paymentMethodByTransaction = transaction.object.paymentMethods;
125
- const paymentMethodByTransaction = await repos.transaction.findInProgressPaymentMethodId({ id: params.transaction.id });
125
+ const paymentMethodByTransaction = await repos.placeOrder.findInProgressPaymentMethodId({ id: params.transaction.id });
126
126
  if (params.prePublishedPaymentMethodId === paymentMethodByTransaction?.paymentMethodId) {
127
127
  // check existence of acceptAction when authorizing payment(2024-06-01~)
128
128
  acceptPayAction = (await repos.action.search({
@@ -2,7 +2,7 @@ import * as factory from '../../../factory';
2
2
  import type { ConfirmationNumberRepo } from '../../../repo/confirmationNumber';
3
3
  import type { OrderNumberRepo } from '../../../repo/orderNumber';
4
4
  import type { ProjectRepo } from '../../../repo/project';
5
- import type { TransactionRepo } from '../../../repo/transaction';
5
+ import type { PlaceOrderRepo } from '../../../repo/transaction/placeOrder';
6
6
  declare function fixOrderAsNeeded(params: {
7
7
  project: {
8
8
  id: string;
@@ -10,7 +10,7 @@ declare function fixOrderAsNeeded(params: {
10
10
  purpose: factory.action.authorize.paymentMethod.any.IPurpose;
11
11
  }): (repos: {
12
12
  project: ProjectRepo;
13
- transaction: TransactionRepo;
13
+ placeOrder: PlaceOrderRepo;
14
14
  confirmationNumber: ConfirmationNumberRepo;
15
15
  orderNumber: OrderNumberRepo;
16
16
  }) => Promise<{
@@ -26,26 +26,22 @@ Object.defineProperty(exports, "__esModule", { value: true });
26
26
  exports.fixOrderAsNeeded = fixOrderAsNeeded;
27
27
  const factory = __importStar(require("../../../factory"));
28
28
  const publishConfirmationNumberIfNotExist_1 = require("../../transaction/placeOrder/publishConfirmationNumberIfNotExist");
29
- const publishOrderNumberIfNotExist_1 = require("../../transaction/placeOrder/publishOrderNumberIfNotExist");
29
+ const issueOrderNumberIfNotExist_1 = require("../../transaction/placeOrder/issueOrderNumberIfNotExist");
30
30
  function fixOrderAsNeeded(params) {
31
31
  return async (repos) => {
32
32
  const orderDate = new Date();
33
33
  // publish always(2025-02-12~)
34
34
  // MovieTicketの場合、確認番号を発行(着券に連携するため)(2024-05-27~)
35
35
  // let confirmationNumber: string | undefined;
36
- let confirmationNumber;
37
36
  // if (params.paymentServiceType === factory.service.paymentService.PaymentServiceType.MovieTicket) {
38
- confirmationNumber = await (0, publishConfirmationNumberIfNotExist_1.publishConfirmationNumberIfNotExist)({
37
+ const confirmationNumber = await (0, publishConfirmationNumberIfNotExist_1.publishConfirmationNumberIfNotExist)({
39
38
  id: params.purpose.id,
40
39
  status: { $in: [factory.transactionStatusType.InProgress] },
41
40
  object: { orderDate }
42
- })({
43
- confirmationNumber: repos.confirmationNumber,
44
- transaction: repos.transaction
45
- });
41
+ })(repos);
46
42
  // }
47
43
  // publish orderNumber(2025-02-14~)
48
- const orderNumber = await (0, publishOrderNumberIfNotExist_1.publishOrderNumberIfNotExist)({
44
+ const orderNumber = await (0, issueOrderNumberIfNotExist_1.issueOrderNumberIfNotExist)({
49
45
  project: { id: params.project.id },
50
46
  id: params.purpose.id,
51
47
  object: { orderDate }
@@ -1,7 +1,7 @@
1
1
  import * as factory from '../../../../factory';
2
2
  import type { AuthorizationRepo } from '../../../../repo/authorization';
3
3
  import type { TicketRepo } from '../../../../repo/ticket';
4
- import type { ITransactionInProgress } from '../../../../repo/transaction';
4
+ import type { ITransactionInProgress } from '../../../../repo/transaction/placeOrder';
5
5
  import type { TransactionNumberRepo } from '../../../../repo/transactionNumber';
6
6
  interface IFixTransactionNumberRepos {
7
7
  authorization: AuthorizationRepo;
@@ -17,7 +17,7 @@ type IObjectWithoutDetail = factory.action.authorize.paymentMethod.any.IObjectWi
17
17
  */
18
18
  declare function fixTransactionNumberOnPublishPaymentUrl(params: {
19
19
  object: IObjectWithoutDetail;
20
- transaction: Pick<ITransactionInProgress<factory.transactionType.PlaceOrder>, 'id' | 'project'>;
20
+ transaction: Pick<ITransactionInProgress, 'id' | 'project'>;
21
21
  paymentServiceType: factory.service.paymentService.PaymentServiceType;
22
22
  }): IFixTransactionNumberOperation<{
23
23
  transactionNumber: string;
@@ -18,7 +18,7 @@ import type { ProjectRepo } from '../../repo/project';
18
18
  import type { SellerPaymentAcceptedRepo } from '../../repo/sellerPaymentAccepted';
19
19
  import type { TaskRepo } from '../../repo/task';
20
20
  import type { TicketRepo } from '../../repo/ticket';
21
- import type { TransactionRepo } from '../../repo/transaction';
21
+ import type { PlaceOrderRepo } from '../../repo/transaction/placeOrder';
22
22
  import type { TransactionNumberRepo } from '../../repo/transactionNumber';
23
23
  import * as PayTransactionService from '../assetTransaction/pay';
24
24
  import { onPaymentStatusChanged } from './any/onPaymentStatusChanged';
@@ -42,7 +42,7 @@ declare function voidPayTransaction(params: factory.task.IData<factory.taskName.
42
42
  paymentService: PaymentServiceRepo;
43
43
  paymentServiceProvider: PaymentServiceProviderRepo;
44
44
  task: TaskRepo;
45
- transaction: TransactionRepo;
45
+ placeOrder: PlaceOrderRepo;
46
46
  }) => Promise<void>;
47
47
  declare function invalidatePaymentUrl(params: factory.task.IData<factory.taskName.VoidPayTransaction> & {
48
48
  sameAs?: {
@@ -56,7 +56,7 @@ declare function invalidatePaymentUrl(params: factory.task.IData<factory.taskNam
56
56
  paymentService: PaymentServiceRepo;
57
57
  paymentServiceProvider: PaymentServiceProviderRepo;
58
58
  task: TaskRepo;
59
- transaction: TransactionRepo;
59
+ placeOrder: PlaceOrderRepo;
60
60
  }) => Promise<void>;
61
61
  /**
62
62
  * 決済承認中止
@@ -77,7 +77,7 @@ declare function processVoidPayTransaction(params: factory.task.IData<factory.ta
77
77
  accountingReport: AccountingReportRepo;
78
78
  assetTransaction: AssetTransactionRepo;
79
79
  task: TaskRepo;
80
- transaction: TransactionRepo;
80
+ placeOrder: PlaceOrderRepo;
81
81
  }) => Promise<void>;
82
82
  interface IAuthorizeRepos {
83
83
  acceptedPaymentMethod: AcceptedPaymentMethodRepo;
@@ -98,7 +98,7 @@ interface IAuthorizeRepos {
98
98
  project: ProjectRepo;
99
99
  task: TaskRepo;
100
100
  ticket: TicketRepo;
101
- transaction: TransactionRepo;
101
+ placeOrder: PlaceOrderRepo;
102
102
  transactionNumber: TransactionNumberRepo;
103
103
  }
104
104
  type IAuthorizeOperation<T> = (repos: IAuthorizeRepos, settings: Settings) => Promise<T>;
@@ -115,7 +115,7 @@ interface IPublishPaymentUrlRepos {
115
115
  paymentServiceProvider: PaymentServiceProviderRepo;
116
116
  project: ProjectRepo;
117
117
  ticket: TicketRepo;
118
- transaction: TransactionRepo;
118
+ placeOrder: PlaceOrderRepo;
119
119
  transactionNumber: TransactionNumberRepo;
120
120
  }
121
121
  type IPublishPaymentUrlOperation<T> = (repos: IPublishPaymentUrlRepos, settings: Settings) => Promise<T>;
@@ -36,7 +36,7 @@ const util = __importStar(require("util"));
36
36
  const factory = __importStar(require("../../factory"));
37
37
  // import type { TransactionProcessRepo } from '../../repo/transactionProcess';
38
38
  const PayTransactionService = __importStar(require("../assetTransaction/pay"));
39
- const publishOrderNumberIfNotExist_1 = require("../transaction/placeOrder/publishOrderNumberIfNotExist");
39
+ const issueOrderNumberIfNotExist_1 = require("../transaction/placeOrder/issueOrderNumberIfNotExist");
40
40
  const fixTransactionNumber_1 = require("./any/authorize/fixTransactionNumber");
41
41
  const fixTransactionNumberOnPublishPaymentUrl_1 = require("./any/publishPaymentUrl/fixTransactionNumberOnPublishPaymentUrl");
42
42
  const factory_1 = require("./any/factory");
@@ -85,7 +85,7 @@ function invalidatePaymentUrl(params) {
85
85
  if (params.purpose.typeOf !== factory.transactionType.PlaceOrder) {
86
86
  throw new factory.errors.Argument('purpose.typeOf', `must be ${factory.transactionType.PlaceOrder}`);
87
87
  }
88
- const transaction = await repos.transaction.projectFieldsById({
88
+ const transaction = await repos.placeOrder.findPlaceOrderById({
89
89
  typeOf: params.purpose.typeOf,
90
90
  id: params.purpose.id
91
91
  }, ['typeOf', 'status', 'object', 'project', 'seller', 'agent']);
@@ -247,10 +247,10 @@ function processVoidPayTransaction(params) {
247
247
  let transaction;
248
248
  // アクションID指定の場合、進行中取引検証(2023-02-24~)
249
249
  if (typeof params.id === 'string') {
250
- transaction = await repos.transaction.projectFieldsInProgressById({ typeOf: params.purpose.typeOf, id: params.purpose.id }, ['typeOf', 'status']);
250
+ transaction = await repos.placeOrder.findPlaceOrderInProgressById({ typeOf: params.purpose.typeOf, id: params.purpose.id }, ['typeOf', 'status']);
251
251
  }
252
252
  else {
253
- transaction = await repos.transaction.projectFieldsById({ typeOf: params.purpose.typeOf, id: params.purpose.id }, ['typeOf', 'status', 'result']);
253
+ transaction = await repos.placeOrder.findPlaceOrderById({ typeOf: params.purpose.typeOf, id: params.purpose.id }, ['typeOf', 'status', 'result']);
254
254
  }
255
255
  // 承認アクションを取得
256
256
  let authorizeActions;
@@ -340,12 +340,12 @@ function publishPaymentUrl(params) {
340
340
  throw new factory.errors.NotImplemented(`purpose.typeOf '${purpose.typeOf} not implemented'`);
341
341
  }
342
342
  try {
343
- const transaction = await repos.transaction.projectFieldsInProgressById({ typeOf: purpose.typeOf, id: purpose.id }, ['expires', 'seller', 'project']);
343
+ const transaction = await repos.placeOrder.findPlaceOrderInProgressById({ typeOf: purpose.typeOf, id: purpose.id }, ['expires', 'seller', 'project']);
344
344
  if (project.id !== transaction.project.id) {
345
345
  throw new factory.errors.NotFound(factory.transactionType.PlaceOrder);
346
346
  }
347
- // publishOrderNumber(2025-03-11~)
348
- await (0, publishOrderNumberIfNotExist_1.publishOrderNumberIfNotExist)({
347
+ // issueOrderNumber(2025-03-11~)
348
+ await (0, issueOrderNumberIfNotExist_1.issueOrderNumberIfNotExist)({
349
349
  project: { id: transaction.project.id },
350
350
  id: transaction.id,
351
351
  object: { orderDate: new Date() }
@@ -370,7 +370,6 @@ function publishPaymentUrl(params) {
370
370
  // const publishTransactionNumberResult = await repos.transactionNumber.publishByTimestamp({ startDate: new Date() });
371
371
  // transactionNumber = publishTransactionNumberResult.transactionNumber;
372
372
  // }
373
- let result;
374
373
  // URL発行
375
374
  const authorizeObject = {
376
375
  ...params.object,
@@ -393,7 +392,7 @@ function publishPaymentUrl(params) {
393
392
  ...(typeof ticketToken === 'string') ? { ticketToken } : undefined
394
393
  });
395
394
  const taskId = params.sameAs?.id;
396
- result = await PayTransactionService.publishPaymentUrl(startParams, {
395
+ const result = await PayTransactionService.publishPaymentUrl(startParams, {
397
396
  purposeAsTransaction: { id: transaction.id },
398
397
  executor: (typeof taskId === 'string') ? { id: taskId } : {} // タスク関連付け(2024-05-22~)
399
398
  })(repos, settings);
@@ -412,7 +411,7 @@ function publishPaymentUrl(params) {
412
411
  // execTranResult: result.execTranResult, // migrate to recipe(2024-06-05~)
413
412
  // paymentMethod: startParams.object.paymentMethod // 拡張(2024-01-04~) // migrate to acceptAction(2024-06-05~)
414
413
  };
415
- await repos.transaction.findByIdAndUpdateInProgress({
414
+ await repos.placeOrder.findByIdAndUpdateInProgress({
416
415
  id: transaction.id,
417
416
  update: { $set: { 'object.paymentMethods': paymentMethodByPaymentUrl } }
418
417
  });
@@ -448,7 +447,7 @@ function authorize(params) {
448
447
  if (purpose.typeOf !== factory.transactionType.PlaceOrder) {
449
448
  throw new factory.errors.NotImplemented(`purpose.typeOf '${purpose.typeOf} not implemented'`);
450
449
  }
451
- const transaction = await repos.transaction.projectFieldsInProgressById({ typeOf: purpose.typeOf, id: purpose.id }, ['agent', 'expires', 'typeOf', 'project', 'seller']);
450
+ const transaction = await repos.placeOrder.findPlaceOrderInProgressById({ typeOf: purpose.typeOf, id: purpose.id }, ['agent', 'expires', 'typeOf', 'project', 'seller']);
452
451
  if (project.id !== transaction.project.id) {
453
452
  throw new factory.errors.NotFound(factory.transactionType.PlaceOrder);
454
453
  }
@@ -94,7 +94,6 @@ function processAuthorizeCreditCard(params) {
94
94
  siteId: params.availableChannel.credentials?.siteId,
95
95
  sitePass: params.availableChannel.credentials?.sitePass
96
96
  };
97
- let action;
98
97
  let recipe = (0, processAuthorizeCreditCardResult2recipe_1.processAuthorizeCreditCardResult2recipe)({
99
98
  project: { id: params.project.id },
100
99
  result: { entryTranArgs }
@@ -110,7 +109,7 @@ function processAuthorizeCreditCard(params) {
110
109
  sameAs: { id: params.payTransaction.id, typeOf: factory.assetTransactionType.Pay }
111
110
  };
112
111
  // add action(2024-06-12~)
113
- action = await repos.action.start(actionAttributes, { recipe });
112
+ const action = await repos.action.start(actionAttributes, { recipe });
114
113
  try {
115
114
  entryTranResult = await repos.creditCardService.entryTran(entryTranArgs);
116
115
  execTranArgs = {
@@ -1,4 +1,4 @@
1
- import * as GMO from '@motionpicture/gmo-service';
1
+ import type * as GMO from '@motionpicture/gmo-service';
2
2
  import { ActionRepo } from '../../../../repo/action';
3
3
  import * as factory from '../../../../factory';
4
4
  interface ICreditCardPaymentAgencyTransaction3ds {
@@ -32,7 +32,6 @@ function processAuthorizeCreditCard3ds(params) {
32
32
  const { accessId, accessPass } = entryTranResult;
33
33
  const secureTran2Args = { accessId, accessPass };
34
34
  let secureTran2Result;
35
- let action;
36
35
  let recipe = (0, processAuthorizeCreditCard3dsResult2recipe_1.processAuthorizeCreditCard3dsResult2recipe)({
37
36
  project: { id: params.project.id },
38
37
  result: { secureTran2Args }
@@ -48,7 +47,7 @@ function processAuthorizeCreditCard3ds(params) {
48
47
  sameAs: { id: params.payTransaction.id, typeOf: factory.assetTransactionType.Pay }
49
48
  };
50
49
  // add action(2024-06-12~)
51
- action = await repos.action.start(actionAttributes, { recipe });
50
+ const action = await repos.action.start(actionAttributes, { recipe });
52
51
  try {
53
52
  secureTran2Result = await repos.creditCardService.secureTran2(secureTran2Args);
54
53
  }
@@ -1,4 +1,4 @@
1
- import * as GMO from '@motionpicture/gmo-service';
1
+ import type * as GMO from '@motionpicture/gmo-service';
2
2
  import * as factory from '../../../../factory';
3
3
  interface IProcessAuthorizeCreditCard3dsResult {
4
4
  secureTran2Args?: GMO.factory.credit.ISecureTran2Args;
@@ -1,4 +1,4 @@
1
- import * as GMO from '@motionpicture/gmo-service';
1
+ import type * as GMO from '@motionpicture/gmo-service';
2
2
  import * as factory from '../../../../factory';
3
3
  interface IProcessAuthorizeCreditCardResult {
4
4
  entryTranArgs?: GMO.factory.credit.IEntryTranArgs;
@@ -1,4 +1,4 @@
1
- import * as GMO from '@motionpicture/gmo-service';
1
+ import type * as GMO from '@motionpicture/gmo-service';
2
2
  import * as factory from '../../../factory';
3
3
  interface IProcessAlterTranResult {
4
4
  searchTradeArgs?: GMO.factory.credit.ISearchTradeArgs & GMO.factory.credit.IOptionalSiteArgs;
@@ -35,7 +35,7 @@ const validation_1 = require("./validation");
35
35
  function authorize(params, transaction, paymentServiceId, options) {
36
36
  return async (repos, settings) => {
37
37
  let accountId;
38
- let accountsReceivablesByServiceType = [];
38
+ let accountsReceivablesByServiceType;
39
39
  try {
40
40
  // MovieTicket決済の場合、認証
41
41
  const validateMovieTicketResult = await (0, validation_1.validateMovieTicket)(params, paymentServiceId, options.checkedAction, options.purpose)(repos, settings);
@@ -33,8 +33,6 @@ const factory = __importStar(require("../../../factory"));
33
33
  const getCredentials_1 = require("./getCredentials");
34
34
  function processPurchaseNumberAuth(params) {
35
35
  return async (repos, settings) => {
36
- let purchaseNumberAuthIn;
37
- let purchaseNumberAuthResult;
38
36
  // movieTickets.typeOfへの依存廃止(2024-03-15~)
39
37
  // MovieTicket系統の決済方法タイプは動的
40
38
  // const paymentMethodType = params.movieTickets[0]?.typeOf;
@@ -77,7 +75,7 @@ function processPurchaseNumberAuth(params) {
77
75
  seller: { id: String(params.seller.id), project: { id: params.screeningEvent.project.id } },
78
76
  paymentServiceId: params.paymentServiceId
79
77
  })(repos);
80
- purchaseNumberAuthIn = {
78
+ const purchaseNumberAuthIn = {
81
79
  kgygishCd: sellerCredentials.kgygishCd,
82
80
  jhshbtsCd: surfrock.factory.service.auth.purchaseNumberAuth.InformationTypeCode.All,
83
81
  knyknrNoInfoIn: knyknrNoInfoIn,
@@ -99,7 +97,7 @@ function processPurchaseNumberAuth(params) {
99
97
  endpoint: String(availableChannel.serviceUrl),
100
98
  auth: mvtkReserveAuthClient
101
99
  }, { timeout: settings.movieticketReserve.timeoutCheck });
102
- purchaseNumberAuthResult = await authService.purchaseNumberAuth(purchaseNumberAuthIn);
100
+ const purchaseNumberAuthResult = await authService.purchaseNumberAuth(purchaseNumberAuthIn);
103
101
  return { purchaseNumberAuthIn, purchaseNumberAuthResult };
104
102
  };
105
103
  }
@@ -152,8 +152,8 @@ function refundMovieTicket(params, options) {
152
152
  catch (__) {
153
153
  // 失敗したら仕方ない
154
154
  }
155
- error = (0, errorHandler_1.handleMvtkReserveError)({ ...error, message: message });
156
- throw error;
155
+ const handledError = (0, errorHandler_1.handleMvtkReserveError)({ ...error, message: message });
156
+ throw handledError;
157
157
  }
158
158
  // アクションとしてはFailedだが後続処理を実行するケースに対応(2024-03-21~)
159
159
  const seatInfoSyncResultAsError = processSeatInfoSyncResult?.seatInfoSyncResultAsError;
@@ -196,9 +196,8 @@ function createSeatInfoSyncInOnRefund(params) {
196
196
  if (seatInfoSyncInOnPay === undefined) {
197
197
  throw new factory.errors.NotFound('PayAction.recipe.step.itemListElement.itemListElement.beforeMedia');
198
198
  }
199
- let seatInfoSyncIn;
200
199
  // 着券時のseatInfoSyncInに対してtrkshFlgだけ変更してリクエストする
201
- seatInfoSyncIn = {
200
+ const seatInfoSyncIn = {
202
201
  ...seatInfoSyncInOnPay,
203
202
  trkshFlg: surfrock.factory.service.seat.seatInfoSync.DeleteFlag.True // 取消フラグ
204
203
  };
@@ -215,8 +214,7 @@ function createSeatInfoSyncCancelInOnRefund(params) {
215
214
  if (seatInfoSyncInOnPay === undefined) {
216
215
  throw new factory.errors.NotFound('PayAction.recipe.step.itemListElement.itemListElement.beforeMedia');
217
216
  }
218
- let seatInfoSyncCancelIn;
219
- seatInfoSyncCancelIn = {
217
+ const seatInfoSyncCancelIn = {
220
218
  kgygishCd: seatInfoSyncInOnPay.kgygishCd,
221
219
  kgysystmzskyykNo: seatInfoSyncInOnPay.kgygishSstmZskyykNo,
222
220
  kgysystmzskyykNoIkktsCnclFlg: '1',
@@ -52,7 +52,6 @@ function voidTransaction(params) {
52
52
  }
53
53
  });
54
54
  if (payAction !== undefined) {
55
- let refundAction;
56
55
  const seller = transaction.recipient;
57
56
  if (typeof seller?.id !== 'string') {
58
57
  throw new factory.errors.NotFound('payTransaction.recipient');
@@ -60,7 +59,7 @@ function voidTransaction(params) {
60
59
  if (payAction.purpose.typeOf !== factory.order.OrderType.Order) {
61
60
  throw new factory.errors.Internal(`unexpected payAction.purpose.typeOf ${payAction.purpose.typeOf}`);
62
61
  }
63
- refundAction = {
62
+ const refundAction = {
64
63
  project: transaction.project,
65
64
  typeOf: factory.actionType.RefundAction,
66
65
  object: [{
@@ -149,7 +149,6 @@ function validatePaymentMethod(params, paymentServiceId) {
149
149
  }
150
150
  function processAccountTransaction(params) {
151
151
  return async (repos) => {
152
- let pendingTransaction;
153
152
  const defaultName = `${factory.assetTransactionType.Pay} Transaction ${params.transactionNumber}`;
154
153
  const agent = {
155
154
  // ...params.agent,
@@ -186,7 +185,7 @@ function processAccountTransaction(params) {
186
185
  })
187
186
  });
188
187
  // ひとまず出金取引に限定
189
- pendingTransaction = await accountTransactionService.start({
188
+ const pendingTransaction = await accountTransactionService.start({
190
189
  transactionNumber: params.transactionNumber,
191
190
  project: { typeOf: params.project.typeOf, id: params.project.id },
192
191
  typeOf: factory.account.transactionType.Withdraw,
@@ -303,8 +302,7 @@ function refundPaymentCard(params) {
303
302
  transactionNumber: paymentMethodId
304
303
  });
305
304
  // accountNumberをpendingTransactionから取得する
306
- let accountNumber;
307
- accountNumber = payTransaction.object.pendingTransaction?.object.fromLocation?.accountNumber;
305
+ const accountNumber = payTransaction.object.pendingTransaction?.object.fromLocation?.accountNumber;
308
306
  if (typeof accountNumber !== 'string') {
309
307
  throw new factory.errors.ArgumentNull('serviceOutput.paymentAccount.accountNumber');
310
308
  }
@@ -6,6 +6,7 @@ import type { ActionRepo } from '../../repo/action';
6
6
  import type { TaskRepo } from '../../repo/task';
7
7
  import type { TelemetryRepo } from '../../repo/telemetry';
8
8
  import type { TransactionRepo } from '../../repo/transaction';
9
+ import type { PlaceOrderRepo } from '../../repo/transaction/placeOrder';
9
10
  import * as factory from '../../factory';
10
11
  export type TelemetryOperation<T> = (repos: {
11
12
  telemetry: TelemetryRepo;
@@ -15,6 +16,7 @@ export type TaskOperation<T> = (repos: {
15
16
  }) => Promise<T>;
16
17
  export type TransactionOperation<T> = (repos: {
17
18
  transaction: TransactionRepo;
19
+ placeOrder: PlaceOrderRepo;
18
20
  }) => Promise<T>;
19
21
  export type TaskAndTransactionOperation<T> = (repos: {
20
22
  task: TaskRepo;
@@ -27,12 +29,14 @@ export type TaskAndTransactionAndActionOperation<T> = (repos: {
27
29
  }) => Promise<T>;
28
30
  export type TransactionAndActionOperation<T> = (repos: {
29
31
  transaction: TransactionRepo;
32
+ placeOrder: PlaceOrderRepo;
30
33
  action: ActionRepo;
31
34
  }) => Promise<T>;
32
35
  export type TaskAndTelemetryAndTransactionOperation<T> = (repos: {
33
36
  task: TaskRepo;
34
37
  telemetry: TelemetryRepo;
35
38
  transaction: TransactionRepo;
39
+ placeOrder: PlaceOrderRepo;
36
40
  action: ActionRepo;
37
41
  }) => Promise<T>;
38
42
  export interface IGlobalFlowTaskResultByName {
@@ -100,10 +100,7 @@ function createFlow(target) {
100
100
  .add(-TELEMETRY_UNIT_OF_MEASUREMENT_IN_SECONDS, 'seconds');
101
101
  let telemetry;
102
102
  if (target.sellerId !== undefined) {
103
- const flowData = await createSellerFlow(measuredFrom.toDate(), measuredThrough.toDate(), target.sellerId)({
104
- transaction: repos.transaction,
105
- action: repos.action
106
- });
103
+ const flowData = await createSellerFlow(measuredFrom.toDate(), measuredThrough.toDate(), target.sellerId)(repos);
107
104
  debug('flowData created.');
108
105
  telemetry = {
109
106
  purpose: { typeOf: TelemetryPurposeType.Flow },
@@ -146,9 +143,7 @@ function createStock(target) {
146
143
  const startDate = new Date();
147
144
  let telemetry;
148
145
  if (target.sellerId !== undefined) {
149
- const stockData = await createSellerStock(target.measuredAt, target.sellerId)({
150
- transaction: repos.transaction
151
- });
146
+ const stockData = await createSellerStock(target.measuredAt, target.sellerId)(repos);
152
147
  debug('stockData created.');
153
148
  telemetry = {
154
149
  purpose: { typeOf: TelemetryPurposeType.Stock },
@@ -224,7 +219,7 @@ function createSellerFlow(measuredFrom, measuredThrough, sellerId) {
224
219
  function createSellerFlowTransactionResult(measuredFrom, measuredThrough, sellerId) {
225
220
  return async (repos) => {
226
221
  // 計測期間内に開始された取引数を算出する
227
- const { count } = await repos.transaction.count({
222
+ const { count } = await repos.placeOrder.countPlaceOrder({
228
223
  typeOf: factory.transactionType.PlaceOrder,
229
224
  seller: { ids: [sellerId] },
230
225
  startFrom: measuredFrom,
@@ -232,7 +227,7 @@ function createSellerFlowTransactionResult(measuredFrom, measuredThrough, seller
232
227
  });
233
228
  const numberOfTransactionsStarted = count;
234
229
  // 計測期間内に開始され、かつ、すでに終了している取引を検索
235
- const startedAndEndedTransactions = await repos.transaction.projectFields({
230
+ const startedAndEndedTransactions = await repos.placeOrder.findPlaceOrderTransactions({
236
231
  typeOf: factory.transactionType.PlaceOrder,
237
232
  seller: { ids: [sellerId] },
238
233
  startFrom: measuredFrom,
@@ -242,7 +237,7 @@ function createSellerFlowTransactionResult(measuredFrom, measuredThrough, seller
242
237
  });
243
238
  const numberOfStartedAndConfirmed = startedAndEndedTransactions.filter((transaction) => transaction.status === factory.transactionStatusType.Confirmed).length;
244
239
  const numberOfStartedAndExpired = startedAndEndedTransactions.filter((transaction) => transaction.status === factory.transactionStatusType.Expired).length;
245
- const endedTransactions = await repos.transaction.projectFields({
240
+ const endedTransactions = await repos.placeOrder.findPlaceOrderTransactions({
246
241
  typeOf: factory.transactionType.PlaceOrder,
247
242
  seller: { ids: [sellerId] },
248
243
  endFrom: measuredFrom,
@@ -323,7 +318,7 @@ function createSellerFlowTransactionResult(measuredFrom, measuredThrough, seller
323
318
  function createSellerStock(measuredAt, sellerId) {
324
319
  return async (repos) => {
325
320
  // {measuredAt}以前に開始し、{measuredAt}以後に成立あるいは期限切れした取引
326
- const { count } = await repos.transaction.count({
321
+ const { count } = await repos.placeOrder.countPlaceOrder({
327
322
  typeOf: factory.transactionType.PlaceOrder,
328
323
  seller: { ids: [sellerId] },
329
324
  startThrough: measuredAt,
@@ -331,7 +326,7 @@ function createSellerStock(measuredAt, sellerId) {
331
326
  });
332
327
  const numTransactionsUnderway1 = count;
333
328
  // {measuredAt}以前に開始し、いまだに進行中の取引
334
- const count2Result = await repos.transaction.count({
329
+ const count2Result = await repos.placeOrder.countPlaceOrder({
335
330
  typeOf: factory.transactionType.PlaceOrder,
336
331
  seller: { ids: [sellerId] },
337
332
  startThrough: measuredAt,
@@ -48,14 +48,10 @@ function onReservationUsed(attendedReservation, action) {
48
48
  const informReservations = setting?.onReservationStatusChanged?.informReservation;
49
49
  const informTaskRunsAt = now;
50
50
  // support notification.reservation.IUseAction(2024-11-11~)
51
- let action4inform;
52
- let reservation4inform;
53
- // let reservation4inform: factory.notification.reservation.IReservation4informUsed
54
- // | factory.notification.reservation.IUseAction;
55
51
  const useForTheFirstTime = attendedReservation.reservedTicket.dateUsed !== undefined
56
52
  && (0, moment_1.default)(action.startDate)
57
53
  .isSame((0, moment_1.default)(attendedReservation.reservedTicket.dateUsed), 'milliseconds');
58
- reservation4inform = {
54
+ const reservation4inform = {
59
55
  typeOf: attendedReservation.typeOf,
60
56
  id: attendedReservation.id,
61
57
  // dateUsedの通知は初使用時のみで十分(2024-11-27~)
@@ -66,7 +62,7 @@ function onReservationUsed(attendedReservation, action) {
66
62
  }
67
63
  : undefined
68
64
  };
69
- action4inform = {
65
+ const action4inform = {
70
66
  typeOf: action.typeOf,
71
67
  project: action.project,
72
68
  id: action.id,
@@ -32,8 +32,8 @@ const event_1 = require("../../repo/event");
32
32
  const orderNumber_1 = require("../../repo/orderNumber");
33
33
  const project_1 = require("../../repo/project");
34
34
  const reserveInterface_1 = require("../../repo/reserveInterface");
35
- const transaction_1 = require("../../repo/transaction");
36
- // import { TransactionProcessRepo } from '../../repo/transactionProcess';
35
+ // import { TransactionRepo } from '../../repo/transaction';
36
+ const placeOrder_1 = require("../../repo/transaction/placeOrder");
37
37
  const acceptOffer_1 = require("../offer/eventServiceByCOA/acceptOffer");
38
38
  let coaAuthClient;
39
39
  /**
@@ -106,7 +106,8 @@ function call(params) {
106
106
  event: new event_1.EventRepo(connection),
107
107
  orderNumber: new orderNumber_1.OrderNumberRepo({ connection }),
108
108
  project: new project_1.ProjectRepo(connection),
109
- transaction: new transaction_1.TransactionRepo(connection),
109
+ placeOrder: new placeOrder_1.PlaceOrderRepo(connection),
110
+ // transaction: new TransactionRepo(connection),
110
111
  reserveService,
111
112
  masterService
112
113
  });
@@ -124,7 +125,8 @@ function call(params) {
124
125
  event: new event_1.EventRepo(connection),
125
126
  orderNumber: new orderNumber_1.OrderNumberRepo({ connection }),
126
127
  project: new project_1.ProjectRepo(connection),
127
- transaction: new transaction_1.TransactionRepo(connection),
128
+ placeOrder: new placeOrder_1.PlaceOrderRepo(connection),
129
+ // transaction: new TransactionRepo(connection),
128
130
  reserveService,
129
131
  masterService
130
132
  });
@@ -43,7 +43,8 @@ const project_1 = require("../../repo/project");
43
43
  const sellerPaymentAccepted_1 = require("../../repo/sellerPaymentAccepted");
44
44
  const task_1 = require("../../repo/task");
45
45
  const ticket_1 = require("../../repo/ticket");
46
- const transaction_1 = require("../../repo/transaction");
46
+ // import { TransactionRepo } from '../../repo/transaction';
47
+ const placeOrder_1 = require("../../repo/transaction/placeOrder");
47
48
  const transactionNumber_1 = require("../../repo/transactionNumber");
48
49
  // import { TransactionProcessRepo } from '../../repo/transactionProcess';
49
50
  const any_1 = require("../payment/any");
@@ -93,7 +94,8 @@ function call(params) {
93
94
  project: new project_1.ProjectRepo(connection),
94
95
  task: new task_1.TaskRepo(connection),
95
96
  ticket: new ticket_1.TicketRepo(connection),
96
- transaction: new transaction_1.TransactionRepo(connection),
97
+ placeOrder: new placeOrder_1.PlaceOrderRepo(connection),
98
+ // transaction: new TransactionRepo(connection),
97
99
  transactionNumber: new transactionNumber_1.TransactionNumberRepo({ connection })
98
100
  // transactionProcess: transactionProcessRepo
99
101
  }, settings);