@chevre/domain 22.11.0-alpha.4 → 22.11.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 (184) hide show
  1. package/example/src/chevre/aggregation/aggregateOrderOfCustomer.ts +21 -10
  2. package/example/src/chevre/aggregation/aggregateTasks.ts +41 -0
  3. package/example/src/chevre/assetTransaction/processReserve.ts +0 -1
  4. package/example/src/chevre/checkCustomerAttributesLength.ts +109 -0
  5. package/example/src/chevre/notifyAbortedTasksByEmail.ts +1 -1
  6. package/example/src/chevre/reIndex.ts +1 -1
  7. package/example/src/chevre/roles/addAdminPermissionIfNotExists.ts +132 -0
  8. package/example/src/chevre/roles/addDefaultPermissionIfNotExists.ts +37 -0
  9. package/example/src/chevre/roles/addEventOfferPermissionIfNotExists.ts +27 -0
  10. package/example/src/chevre/roles/addPermissionIfNotExists.ts +39 -6
  11. package/example/src/chevre/roles/addProjectCreatorRole.ts +48 -0
  12. package/example/src/chevre/roles/assignGlobalRoles.ts +72 -0
  13. package/example/src/chevre/roles/findPermissions.ts +84 -0
  14. package/example/src/chevre/roles/findRoleNames.ts +117 -0
  15. package/example/src/chevre/roles/removeConsolePermissionIfExists.ts +38 -0
  16. package/example/src/chevre/roles/removePermissionFromAPIRoles.ts +46 -0
  17. package/example/src/chevre/roles/removePermissionIfExists.ts +39 -0
  18. package/example/src/chevre/searchEventSeats.ts +1 -1
  19. package/example/src/chevre/searchProducts.ts +28 -0
  20. package/example/src/chevre/settings/addSettings.ts +31 -17
  21. package/example/src/chevre/task/countPotentiallyRunning.ts +41 -0
  22. package/example/src/chevre/task/countTasks.ts +51 -0
  23. package/example/src/chevre/{deleteRunsAtPassedCertainPeriod.ts → task/deleteRunsAtPassedCertainPeriod.ts} +4 -3
  24. package/example/src/chevre/task/deleteUnexpectedTasks.ts +23 -0
  25. package/example/src/chevre/task/emitRunning.ts +89 -0
  26. package/example/src/chevre/unsetUnnecessaryFields.ts +8 -5
  27. package/example/src/idaas/auth0/adminApplications.ts +183 -0
  28. package/example/src/idaas/auth0/getToken.ts +55 -0
  29. package/example/src/idaas/auth0/getTokenByPrivateKeyJWT.ts +84 -0
  30. package/example/src/regex.ts +31 -0
  31. package/lib/chevre/eventEmitter/task.d.ts +29 -6
  32. package/lib/chevre/index.d.ts +0 -2
  33. package/lib/chevre/index.js +0 -10
  34. package/lib/chevre/repo/confirmationNumber.d.ts +0 -3
  35. package/lib/chevre/repo/confirmationNumber.js +12 -47
  36. package/lib/chevre/repo/identity.d.ts +11 -33
  37. package/lib/chevre/repo/identity.js +10 -15
  38. package/lib/chevre/repo/member.d.ts +22 -4
  39. package/lib/chevre/repo/member.js +81 -27
  40. package/lib/chevre/repo/mongoose/schemas/identity.d.ts +1 -1
  41. package/lib/chevre/repo/mongoose/schemas/member/global.d.ts +14 -0
  42. package/lib/chevre/repo/mongoose/schemas/member/global.js +82 -0
  43. package/lib/chevre/repo/mongoose/schemas/product.js +9 -0
  44. package/lib/chevre/repo/mongoose/schemas/setting.d.ts +15 -0
  45. package/lib/chevre/repo/mongoose/schemas/setting.js +1 -0
  46. package/lib/chevre/repo/mongoose/schemas/task.js +9 -0
  47. package/lib/chevre/repo/order.d.ts +17 -2
  48. package/lib/chevre/repo/order.js +47 -8
  49. package/lib/chevre/repo/orderNumber.d.ts +0 -3
  50. package/lib/chevre/repo/orderNumber.js +10 -44
  51. package/lib/chevre/repo/pendingReservation.js +1 -0
  52. package/lib/chevre/repo/product.js +12 -17
  53. package/lib/chevre/repo/role.d.ts +16 -4
  54. package/lib/chevre/repo/role.js +71 -32
  55. package/lib/chevre/repo/serviceOutputIdentifier.d.ts +0 -3
  56. package/lib/chevre/repo/serviceOutputIdentifier.js +10 -27
  57. package/lib/chevre/repo/setting.d.ts +5 -10
  58. package/lib/chevre/repo/setting.js +4 -7
  59. package/lib/chevre/repo/stockHolder.d.ts +4 -27
  60. package/lib/chevre/repo/stockHolder.js +163 -186
  61. package/lib/chevre/repo/task.d.ts +58 -38
  62. package/lib/chevre/repo/task.js +126 -296
  63. package/lib/chevre/repo/transaction.js +10 -10
  64. package/lib/chevre/repo/transactionNumber.d.ts +0 -3
  65. package/lib/chevre/repo/transactionNumber.js +10 -44
  66. package/lib/chevre/repo/transactionNumberCounter.d.ts +0 -10
  67. package/lib/chevre/repo/transactionNumberCounter.js +34 -29
  68. package/lib/chevre/service/assetTransaction/cancelReservation/start.d.ts +1 -1
  69. package/lib/chevre/service/assetTransaction/registerService.js +4 -0
  70. package/lib/chevre/service/assetTransaction/reserve/start/createSubReservations.js +19 -16
  71. package/lib/chevre/service/code.d.ts +5 -28
  72. package/lib/chevre/service/code.js +3 -79
  73. package/lib/chevre/service/iam.d.ts +17 -7
  74. package/lib/chevre/service/iam.js +26 -6
  75. package/lib/chevre/service/notification/notifyAbortedTasksByEmail.d.ts +15 -0
  76. package/lib/chevre/service/notification/notifyAbortedTasksByEmail.js +38 -0
  77. package/lib/chevre/service/notification.d.ts +2 -1
  78. package/lib/chevre/service/notification.js +3 -1
  79. package/lib/chevre/service/offer/product.js +4 -0
  80. package/lib/chevre/service/order/confirmPayTransaction.d.ts +6 -1
  81. package/lib/chevre/service/order/onOrderStatusChanged/onOrderProcessing/processOrder.js +3 -3
  82. package/lib/chevre/service/task/acceptCOAOffer.d.ts +1 -1
  83. package/lib/chevre/service/task/acceptCOAOffer.js +6 -5
  84. package/lib/chevre/service/task/aggregateOffers.d.ts +1 -1
  85. package/lib/chevre/service/task/aggregateOffers.js +1 -1
  86. package/lib/chevre/service/task/aggregateOnSystem.d.ts +4 -2
  87. package/lib/chevre/service/task/aggregateScreeningEvent.d.ts +1 -1
  88. package/lib/chevre/service/task/aggregateScreeningEvent.js +1 -1
  89. package/lib/chevre/service/task/authorizePayment.d.ts +1 -1
  90. package/lib/chevre/service/task/authorizePayment.js +7 -6
  91. package/lib/chevre/service/task/cancelMoneyTransfer.d.ts +1 -1
  92. package/lib/chevre/service/task/cancelPendingReservation.d.ts +1 -1
  93. package/lib/chevre/service/task/cancelPendingReservation.js +1 -1
  94. package/lib/chevre/service/task/cancelReservation.d.ts +1 -1
  95. package/lib/chevre/service/task/cancelReservation.js +1 -1
  96. package/lib/chevre/service/task/checkMovieTicket.d.ts +1 -1
  97. package/lib/chevre/service/task/checkMovieTicket.js +4 -3
  98. package/lib/chevre/service/task/checkResource.d.ts +1 -1
  99. package/lib/chevre/service/task/checkResource.js +1 -1
  100. package/lib/chevre/service/task/confirmMoneyTransfer.d.ts +1 -1
  101. package/lib/chevre/service/task/confirmPayTransaction.d.ts +2 -2
  102. package/lib/chevre/service/task/confirmPayTransaction.js +3 -2
  103. package/lib/chevre/service/task/confirmRegisterService.d.ts +1 -1
  104. package/lib/chevre/service/task/confirmRegisterServiceTransaction.d.ts +1 -1
  105. package/lib/chevre/service/task/confirmReserveTransaction.d.ts +6 -2
  106. package/lib/chevre/service/task/confirmReserveTransaction.js +3 -3
  107. package/lib/chevre/service/task/createAccountingReport.d.ts +1 -1
  108. package/lib/chevre/service/task/createEvent.d.ts +1 -1
  109. package/lib/chevre/service/task/deletePerson.d.ts +1 -1
  110. package/lib/chevre/service/task/deleteTransaction.d.ts +1 -1
  111. package/lib/chevre/service/task/givePointAward.d.ts +1 -1
  112. package/lib/chevre/service/task/givePointAward.js +1 -1
  113. package/lib/chevre/service/task/handleNotification.d.ts +4 -2
  114. package/lib/chevre/service/task/importEventCapacitiesFromCOA.d.ts +1 -1
  115. package/lib/chevre/service/task/importEventsFromCOA.d.ts +1 -1
  116. package/lib/chevre/service/task/importOffersFromCOA.d.ts +1 -1
  117. package/lib/chevre/service/task/invalidatePaymentUrl.d.ts +1 -1
  118. package/lib/chevre/service/task/moneyTransfer.d.ts +1 -1
  119. package/lib/chevre/service/task/moneyTransfer.js +1 -1
  120. package/lib/chevre/service/task/onAssetTransactionStatusChanged.d.ts +1 -1
  121. package/lib/chevre/service/task/onAuthorizationCreated.d.ts +1 -1
  122. package/lib/chevre/service/task/onEventChanged.d.ts +1 -1
  123. package/lib/chevre/service/task/onOrderPaymentCompleted.d.ts +1 -1
  124. package/lib/chevre/service/task/onResourceUpdated.d.ts +1 -1
  125. package/lib/chevre/service/task/pay.d.ts +1 -1
  126. package/lib/chevre/service/task/placeOrder.d.ts +1 -1
  127. package/lib/chevre/service/task/publishPaymentUrl.d.ts +1 -1
  128. package/lib/chevre/service/task/publishPaymentUrl.js +6 -7
  129. package/lib/chevre/service/task/refund.d.ts +1 -1
  130. package/lib/chevre/service/task/refund.js +1 -1
  131. package/lib/chevre/service/task/registerService.d.ts +1 -1
  132. package/lib/chevre/service/task/reserve.d.ts +1 -1
  133. package/lib/chevre/service/task/returnMoneyTransfer.d.ts +1 -1
  134. package/lib/chevre/service/task/returnMoneyTransfer.js +1 -1
  135. package/lib/chevre/service/task/returnOrder.d.ts +1 -1
  136. package/lib/chevre/service/task/returnPayTransaction.d.ts +1 -1
  137. package/lib/chevre/service/task/returnPayTransaction.js +1 -1
  138. package/lib/chevre/service/task/returnPointAward.d.ts +1 -1
  139. package/lib/chevre/service/task/returnPointAward.js +1 -1
  140. package/lib/chevre/service/task/returnReserveTransaction.d.ts +1 -1
  141. package/lib/chevre/service/task/returnReserveTransaction.js +1 -1
  142. package/lib/chevre/service/task/sendEmailMessage.d.ts +1 -1
  143. package/lib/chevre/service/task/sendOrder.d.ts +1 -1
  144. package/lib/chevre/service/task/triggerWebhook.d.ts +1 -1
  145. package/lib/chevre/service/task/useReservation.d.ts +1 -1
  146. package/lib/chevre/service/task/voidMoneyTransferTransaction.d.ts +1 -1
  147. package/lib/chevre/service/task/voidPayTransaction.d.ts +1 -1
  148. package/lib/chevre/service/task/voidPayment.d.ts +1 -1
  149. package/lib/chevre/service/task/voidRegisterServiceTransaction.d.ts +1 -1
  150. package/lib/chevre/service/task/voidReserveTransaction.d.ts +1 -1
  151. package/lib/chevre/service/task/voidReserveTransaction.js +5 -4
  152. package/lib/chevre/service/task.d.ts +7 -29
  153. package/lib/chevre/service/task.js +9 -114
  154. package/lib/chevre/service/taskHandler/onOperationFailed/informTaskIfNeeded.d.ts +11 -0
  155. package/lib/chevre/service/taskHandler/onOperationFailed/informTaskIfNeeded.js +105 -0
  156. package/lib/chevre/service/taskHandler/onOperationFailed.d.ts +17 -0
  157. package/lib/chevre/service/taskHandler/onOperationFailed.js +70 -0
  158. package/lib/chevre/service/taskHandler.d.ts +26 -0
  159. package/lib/chevre/service/taskHandler.js +97 -0
  160. package/lib/chevre/service/validation/validateEvent.d.ts +2 -2
  161. package/lib/chevre/service/validation/validateEvent.js +16 -10
  162. package/lib/chevre/service/validation/validateOrder.js +55 -37
  163. package/lib/chevre/service.d.ts +0 -4
  164. package/lib/chevre/service.js +10 -14
  165. package/lib/chevre/settings/aggregation.d.ts +6 -1
  166. package/lib/chevre/settings/aggregation.js +2 -1
  167. package/package.json +6 -4
  168. package/example/src/chevre/adminAuth/adminIdentity.ts +0 -38
  169. package/example/src/chevre/executeOneTask.ts +0 -41
  170. package/example/src/chevre/executeTaskIfExists.ts +0 -80
  171. package/example/src/chevre/findExecutableTask.ts +0 -50
  172. package/example/src/chevre/findSetting.ts +0 -79
  173. package/example/src/chevre/roles/addRoleMembers.ts +0 -75
  174. package/example/src/chevre/searchPermissions.ts +0 -46
  175. package/example/src/chevre/searchProductOffers.ts +0 -29
  176. package/example/src/chevre/stockHolder/checkIfConflicted.ts +0 -76
  177. package/example/src/chevre/stockHolder/checkRedisKeyCount.ts +0 -195
  178. package/example/src/chevre/stockHolder/migratePendingReservations.ts +0 -96
  179. package/example/src/chevre/stockHolder/playAroundStockHolder.ts +0 -256
  180. package/example/src/chevre/transactionNumber/publishConfimationNumber.ts +0 -37
  181. package/example/src/chevre/transactionNumber/publishOrderNumber.ts +0 -40
  182. package/example/src/chevre/upsertProductsByProductId.ts +0 -100
  183. package/lib/chevre/adminAuth.d.ts +0 -2
  184. package/lib/chevre/adminAuth.js +0 -6
@@ -189,6 +189,10 @@ function fixProductAndOffers(params) {
189
189
  if (product === undefined) {
190
190
  throw new factory.errors.NotFound('Product');
191
191
  }
192
+ if (product.typeOf !== factory.product.ProductType.MembershipService
193
+ && product.typeOf !== factory.product.ProductType.PaymentCard) {
194
+ throw new factory.errors.Argument('object.itemOffered.id', `invalid product type: ${product.typeOf}`);
195
+ }
192
196
  const { offers } = yield search(Object.assign({ ids: params.object.map((o) => String(o.id)), project: { id: params.project.id }, itemOffered: { id: String(product.id) }, onlyValid: true, includedInDataCatalog: { id: '' }, addSortIndex: false, useIncludeInDataCatalog: false }, (typeof ((_c = params.location) === null || _c === void 0 ? void 0 : _c.id) === 'string') ? { availableAt: { id: params.location.id } } : undefined))(repos);
193
197
  return { product, availableOffers: offers };
194
198
  });
@@ -8,7 +8,12 @@ import type { OrderRepo } from '../../repo/order';
8
8
  import type { ProjectRepo } from '../../repo/project';
9
9
  import type { TaskRepo } from '../../repo/task';
10
10
  import type { TransactionRepo } from '../../repo/transaction';
11
- declare function confirmPayTransaction(data: factory.task.IData<factory.taskName.ConfirmPayTransaction>, options: {}): (repos: {
11
+ declare function confirmPayTransaction(data: factory.task.IData<factory.taskName.ConfirmPayTransaction> & {
12
+ project: {
13
+ id: string;
14
+ typeOf: factory.organizationType.Project;
15
+ };
16
+ }, options: {}): (repos: {
12
17
  acceptedOffer: AcceptedOfferRepo;
13
18
  action: ActionRepo;
14
19
  assetTransaction: AssetTransactionRepo;
@@ -60,14 +60,14 @@ function createConfirmReserveTransactionTasksIfNotExist(order, simpleOrder, opti
60
60
  }
61
61
  yield Promise.all(confirmObjects.map((confirmObject) => __awaiter(this, void 0, void 0, function* () {
62
62
  const data = {
63
- project: order.project,
63
+ // project: order.project, // discontinue(2025-08-20~)
64
64
  typeOf: factory.actionType.ConfirmAction,
65
65
  object: confirmObject,
66
- agent: order.project,
66
+ // agent: order.project, // discontinue(2025-08-20~)
67
67
  purpose: simpleOrder
68
68
  // instrument廃止(2024-03-13~)
69
69
  };
70
- const taskIdentifier = util.format('%s:%s:%s:%s:%s:%s', data.project.id, factory.taskName.ConfirmReserveTransaction, data.purpose.typeOf, data.purpose.orderNumber, data.object.typeOf, data.object.transactionNumber);
70
+ const taskIdentifier = util.format('%s:%s:%s:%s:%s:%s', order.project.id, factory.taskName.ConfirmReserveTransaction, data.purpose.typeOf, data.purpose.orderNumber, data.object.typeOf, data.object.transactionNumber);
71
71
  const confirmReserveTransactionTask = {
72
72
  alternateName: taskIdentifier,
73
73
  identifier: taskIdentifier,
@@ -1,5 +1,5 @@
1
1
  import * as factory from '../../factory';
2
- import type { ICallResult, IExecutableTaskKeys, IOperationExecute } from '../task';
2
+ import type { ICallResult, IExecutableTaskKeys, IOperationExecute } from '../taskHandler';
3
3
  /**
4
4
  * タスク実行関数
5
5
  */
@@ -19,7 +19,7 @@ const orderNumber_1 = require("../../repo/orderNumber");
19
19
  const project_1 = require("../../repo/project");
20
20
  const reserveInterface_1 = require("../../repo/reserveInterface");
21
21
  const transaction_1 = require("../../repo/transaction");
22
- const transactionProcess_1 = require("../../repo/transactionProcess");
22
+ // import { TransactionProcessRepo } from '../../repo/transactionProcess';
23
23
  const acceptOffer_1 = require("../offer/eventServiceByCOA/acceptOffer");
24
24
  let coaAuthClient;
25
25
  /**
@@ -62,7 +62,7 @@ function call(params) {
62
62
  coaAuthClient = new COA.auth.RefreshToken(Object.assign(Object.assign({}, credentials), (credentialsRepo !== undefined) ? { credentialsRepo } : undefined));
63
63
  }
64
64
  const actionRepo = new action_1.ActionRepo(connection);
65
- const transactionProcessRepo = new transactionProcess_1.TransactionProcessRepo(redisClient, { lockExpiresInSeconds: 120 });
65
+ // const transactionProcessRepo = new TransactionProcessRepo(redisClient, { lockExpiresInSeconds: 120 });
66
66
  try {
67
67
  const reserveService = new COA.service.Reserve({
68
68
  endpoint: coaAuthClient.options.endpoint, // same as authClient(2024-07-17~)
@@ -86,7 +86,7 @@ function call(params) {
86
86
  })({
87
87
  action: actionRepo,
88
88
  event: new event_1.EventRepo(connection),
89
- orderNumber: new orderNumber_1.OrderNumberRepo({ redisClient, connection }),
89
+ orderNumber: new orderNumber_1.OrderNumberRepo({ connection }),
90
90
  project: new project_1.ProjectRepo(connection),
91
91
  transaction: new transaction_1.TransactionRepo(connection),
92
92
  reserveService,
@@ -104,7 +104,7 @@ function call(params) {
104
104
  })({
105
105
  action: actionRepo,
106
106
  event: new event_1.EventRepo(connection),
107
- orderNumber: new orderNumber_1.OrderNumberRepo({ redisClient, connection }),
107
+ orderNumber: new orderNumber_1.OrderNumberRepo({ connection }),
108
108
  project: new project_1.ProjectRepo(connection),
109
109
  transaction: new transaction_1.TransactionRepo(connection),
110
110
  reserveService,
@@ -128,8 +128,9 @@ function call(params) {
128
128
  }
129
129
  }
130
130
  finally {
131
+ // taskRepo.runImmediatelyのnextパラメータでの解決へ移行したためここでの解除は不要(2025-07-12~)
131
132
  // 取引プロセスロック解除
132
- yield transactionProcessRepo.unlock({ typeOf: factory.transactionType.PlaceOrder, id: params.data.purpose.id });
133
+ // await transactionProcessRepo.unlock({ typeOf: factory.transactionType.PlaceOrder, id: params.data.purpose.id });
133
134
  }
134
135
  });
135
136
  }
@@ -1,5 +1,5 @@
1
1
  import * as factory from '../../factory';
2
- import type { IOperationExecute } from '../task';
2
+ import type { IOperationExecute } from '../taskHandler';
3
3
  /**
4
4
  * タスク実行関数
5
5
  */
@@ -32,7 +32,7 @@ function call(data) {
32
32
  yield (0, aggregateOffers_1.aggregateOffers)(data)({
33
33
  aggregateReservation: new aggregateReservation_1.AggregateReservationRepo(connection),
34
34
  event: new event_1.EventRepo(connection),
35
- stockHolder: new stockHolder_1.StockHolderRepo(redisClient, connection),
35
+ stockHolder: new stockHolder_1.StockHolderRepo({ connection }),
36
36
  offer: new unitPriceInCatalog_1.OfferRepo(connection),
37
37
  offerCatalog: new offerCatalog_1.OfferCatalogRepo(connection),
38
38
  offerRateLimit: new offer_1.OfferRateLimitRepo(redisClient),
@@ -1,3 +1,5 @@
1
1
  import * as factory from '../../factory';
2
- import type { ICallResult, IExecutableTaskKeys, IOperationExecute } from '../task';
3
- export declare function call(params: Pick<factory.task.aggregateOnSystem.ITask, IExecutableTaskKeys>): IOperationExecute<ICallResult>;
2
+ import type { ICallResult, IExecutableTaskKeys, IOperationExecute } from '../taskHandler';
3
+ export declare function call(params: Pick<factory.task.aggregateOnSystem.ITask, IExecutableTaskKeys> & {
4
+ status: factory.taskStatus.Running;
5
+ }): IOperationExecute<ICallResult>;
@@ -1,5 +1,5 @@
1
1
  import * as factory from '../../factory';
2
- import type { IOperationExecute } from '../task';
2
+ import type { IOperationExecute } from '../taskHandler';
3
3
  /**
4
4
  * タスク実行関数
5
5
  */
@@ -32,7 +32,7 @@ function call(data) {
32
32
  }
33
33
  yield AggregationService.event.aggregateScreeningEvent(data)({
34
34
  event: new event_1.EventRepo(connection),
35
- stockHolder: new stockHolder_1.StockHolderRepo(redisClient, connection),
35
+ stockHolder: new stockHolder_1.StockHolderRepo({ connection }),
36
36
  offer: new unitPriceInCatalog_1.OfferRepo(connection),
37
37
  offerCatalog: new offerCatalog_1.OfferCatalogRepo(connection),
38
38
  offerRateLimit: new offer_1.OfferRateLimitRepo(redisClient),
@@ -1,4 +1,4 @@
1
- import type { ICallResult, IExecutableTaskKeys, IOperationExecute } from '../task';
1
+ import type { ICallResult, IExecutableTaskKeys, IOperationExecute } from '../taskHandler';
2
2
  import * as factory from '../../factory';
3
3
  /**
4
4
  * タスク実行関数
@@ -29,7 +29,7 @@ const task_1 = require("../../repo/task");
29
29
  const ticket_1 = require("../../repo/ticket");
30
30
  const transaction_1 = require("../../repo/transaction");
31
31
  const transactionNumber_1 = require("../../repo/transactionNumber");
32
- const transactionProcess_1 = require("../../repo/transactionProcess");
32
+ // import { TransactionProcessRepo } from '../../repo/transactionProcess';
33
33
  const any_1 = require("../payment/any");
34
34
  /**
35
35
  * タスク実行関数
@@ -45,7 +45,7 @@ function call(params) {
45
45
  }
46
46
  let callResult;
47
47
  const actionRepo = new action_1.ActionRepo(connection);
48
- const transactionProcessRepo = new transactionProcess_1.TransactionProcessRepo(redisClient, { lockExpiresInSeconds: 120 });
48
+ // const transactionProcessRepo = new TransactionProcessRepo(redisClient, { lockExpiresInSeconds: 120 });
49
49
  const paymentServiceId = params.data.object.issuedThrough.id;
50
50
  const credentialsExpireInSeconds = settings.movieticketReserve.credentialsExpireInSeconds;
51
51
  const useCredentialsRepo = typeof paymentServiceId === 'string' && paymentServiceId !== ''
@@ -57,13 +57,13 @@ function call(params) {
57
57
  action: actionRepo,
58
58
  assetTransaction: new assetTransaction_1.AssetTransactionRepo(connection),
59
59
  authorization: new authorization_1.AuthorizationRepo(connection),
60
- confirmationNumber: new confirmationNumber_1.ConfirmationNumberRepo({ redisClient, connection }),
60
+ confirmationNumber: new confirmationNumber_1.ConfirmationNumberRepo({ connection }),
61
61
  credentials: new credentials_1.CredentialsRepo(redisClient, {
62
62
  scope: `${factory.service.paymentService.PaymentServiceType.MovieTicket}:${paymentServiceId}`,
63
63
  expireInSeconds: (useCredentialsRepo) ? credentialsExpireInSeconds : 0
64
64
  }),
65
65
  event: new event_1.EventRepo(connection),
66
- orderNumber: new orderNumber_1.OrderNumberRepo({ redisClient, connection }),
66
+ orderNumber: new orderNumber_1.OrderNumberRepo({ connection }),
67
67
  paymentAccepted: new sellerPaymentAccepted_1.SellerPaymentAcceptedRepo(connection),
68
68
  paymentService: new paymentService_1.PaymentServiceRepo(connection),
69
69
  paymentServiceProvider: new paymentServiceProvider_1.PaymentServiceProviderRepo(connection),
@@ -73,7 +73,7 @@ function call(params) {
73
73
  task: new task_1.TaskRepo(connection),
74
74
  ticket: new ticket_1.TicketRepo(connection),
75
75
  transaction: new transaction_1.TransactionRepo(connection),
76
- transactionNumber: new transactionNumber_1.TransactionNumberRepo({ redisClient, connection })
76
+ transactionNumber: new transactionNumber_1.TransactionNumberRepo({ connection })
77
77
  // transactionProcess: transactionProcessRepo
78
78
  }, settings);
79
79
  }
@@ -101,7 +101,8 @@ function call(params) {
101
101
  finally {
102
102
  // 取引プロセスロック解除(2024-04-20~)
103
103
  if (params.data.options.useUnlockTransactionProcess) {
104
- yield transactionProcessRepo.unlock({ typeOf: params.data.purpose.typeOf, id: params.data.purpose.id });
104
+ // taskRepo.runImmediatelyのnextパラメータでの解決へ移行したためここでの解除は不要(2025-07-12~)
105
+ // await transactionProcessRepo.unlock({ typeOf: params.data.purpose.typeOf, id: params.data.purpose.id });
105
106
  }
106
107
  }
107
108
  if (callResult !== undefined) {
@@ -1,5 +1,5 @@
1
1
  import * as factory from '../../factory';
2
- import type { IOperationExecute } from '../task';
2
+ import type { IOperationExecute } from '../taskHandler';
3
3
  /**
4
4
  * タスク実行関数
5
5
  */
@@ -1,5 +1,5 @@
1
1
  import * as factory from '../../factory';
2
- import type { ICallResult, IExecutableTaskKeys, IOperationExecute } from '../task';
2
+ import type { ICallResult, IExecutableTaskKeys, IOperationExecute } from '../taskHandler';
3
3
  /**
4
4
  * タスク実行関数
5
5
  */
@@ -43,7 +43,7 @@ function call(params) {
43
43
  yield (0, cancelReservation_1.cancelPendingReservation)({ purpose: data.purpose })({
44
44
  action: new action_1.ActionRepo(connection),
45
45
  assetTransaction: new assetTransaction_1.AssetTransactionRepo(connection),
46
- stockHolder: new stockHolder_1.StockHolderRepo(redisClient, connection),
46
+ stockHolder: new stockHolder_1.StockHolderRepo({ connection }),
47
47
  offerRateLimit: new offer_1.OfferRateLimitRepo(redisClient),
48
48
  reservation: new reservation_1.ReservationRepo(connection),
49
49
  setting: new setting_1.SettingRepo(connection),
@@ -1,5 +1,5 @@
1
1
  import * as factory from '../../factory';
2
- import type { IOperationExecute } from '../task';
2
+ import type { IOperationExecute } from '../taskHandler';
3
3
  /**
4
4
  * タスク実行関数
5
5
  */
@@ -34,7 +34,7 @@ function call(data) {
34
34
  task: new task_1.TaskRepo(connection),
35
35
  assetTransaction: new assetTransaction_1.AssetTransactionRepo(connection),
36
36
  offerRateLimit: new offer_1.OfferRateLimitRepo(redisClient),
37
- stockHolder: new stockHolder_1.StockHolderRepo(redisClient, connection)
37
+ stockHolder: new stockHolder_1.StockHolderRepo({ connection })
38
38
  }
39
39
  // settings
40
40
  );
@@ -1,4 +1,4 @@
1
- import type { ICallResult, IExecutableTaskKeys, IOperationExecute } from '../task';
1
+ import type { ICallResult, IExecutableTaskKeys, IOperationExecute } from '../taskHandler';
2
2
  import * as factory from '../../factory';
3
3
  /**
4
4
  * タスク実行関数
@@ -17,7 +17,7 @@ const event_1 = require("../../repo/event");
17
17
  const paymentService_1 = require("../../repo/paymentService");
18
18
  const paymentServiceProvider_1 = require("../../repo/paymentServiceProvider");
19
19
  const sellerPaymentAccepted_1 = require("../../repo/sellerPaymentAccepted");
20
- const transactionProcess_1 = require("../../repo/transactionProcess");
20
+ // import { TransactionProcessRepo } from '../../repo/transactionProcess';
21
21
  const pay_1 = require("../assetTransaction/pay");
22
22
  /**
23
23
  * タスク実行関数
@@ -33,7 +33,7 @@ function call(params) {
33
33
  return;
34
34
  }
35
35
  const actionRepo = new action_1.ActionRepo(connection);
36
- const transactionProcessRepo = new transactionProcess_1.TransactionProcessRepo(redisClient, { lockExpiresInSeconds: 120 });
36
+ // const transactionProcessRepo = new TransactionProcessRepo(redisClient, { lockExpiresInSeconds: 120 });
37
37
  const paymentServiceId = (_b = params.data.object[0]) === null || _b === void 0 ? void 0 : _b.id;
38
38
  const credentialsExpireInSeconds = settings.movieticketReserve.credentialsExpireInSeconds;
39
39
  const useCredentialsRepo = typeof paymentServiceId === 'string' && paymentServiceId !== ''
@@ -67,7 +67,8 @@ function call(params) {
67
67
  finally {
68
68
  // 取引プロセスロック解除
69
69
  if (typeof ((_d = params.data.purpose) === null || _d === void 0 ? void 0 : _d.id) === 'string') {
70
- yield transactionProcessRepo.unlock({ typeOf: params.data.purpose.typeOf, id: params.data.purpose.id });
70
+ // taskRepo.runImmediatelyのnextパラメータでの解決へ移行したためここでの解除は不要(2025-07-12~)
71
+ // await transactionProcessRepo.unlock({ typeOf: params.data.purpose.typeOf, id: params.data.purpose.id });
71
72
  }
72
73
  }
73
74
  });
@@ -1,5 +1,5 @@
1
1
  import * as factory from '../../factory';
2
- import type { IOperationExecute } from '../task';
2
+ import type { IOperationExecute } from '../taskHandler';
3
3
  /**
4
4
  * タスク実行関数
5
5
  */
@@ -59,7 +59,7 @@ function call(data) {
59
59
  project: { id: data.project.id }
60
60
  })({
61
61
  event: new event_1.EventRepo(connection),
62
- stockHolder: new stockHolder_1.StockHolderRepo(redisClient, connection)
62
+ stockHolder: new stockHolder_1.StockHolderRepo({ connection })
63
63
  });
64
64
  break;
65
65
  default:
@@ -1,4 +1,4 @@
1
- import type { IOperationExecute } from '../task';
1
+ import type { IOperationExecute } from '../taskHandler';
2
2
  import * as factory from '../../factory';
3
3
  /**
4
4
  * タスク実行関数
@@ -1,6 +1,6 @@
1
- import type { IOperationExecute } from '../task';
1
+ import type { ICallResult, IExecutableTaskKeys, IOperationExecute } from '../taskHandler';
2
2
  import * as factory from '../../factory';
3
3
  /**
4
4
  * タスク実行関数
5
5
  */
6
- export declare function call(data: factory.task.IData<factory.taskName.ConfirmPayTransaction>): IOperationExecute<void>;
6
+ export declare function call(params: Pick<factory.task.ITask<factory.taskName.ConfirmPayTransaction>, IExecutableTaskKeys>): IOperationExecute<ICallResult>;
@@ -23,9 +23,10 @@ const confirmPayTransaction_1 = require("../order/confirmPayTransaction");
23
23
  /**
24
24
  * タスク実行関数
25
25
  */
26
- function call(data) {
26
+ function call(params) {
27
+ // export function call(data: factory.task.IData<factory.taskName.ConfirmPayTransaction>): IOperationExecute<void> {
27
28
  return (_a) => __awaiter(this, [_a], void 0, function* ({ connection }) {
28
- yield (0, confirmPayTransaction_1.confirmPayTransaction)(data, {})({
29
+ yield (0, confirmPayTransaction_1.confirmPayTransaction)(Object.assign(Object.assign({}, params.data), { project: params.project }), {})({
29
30
  acceptedOffer: new acceptedOffer_1.AcceptedOfferRepo(connection),
30
31
  action: new action_1.ActionRepo(connection),
31
32
  assetTransaction: new assetTransaction_1.AssetTransactionRepo(connection),
@@ -1,4 +1,4 @@
1
- import type { IOperationExecute } from '../task';
1
+ import type { IOperationExecute } from '../taskHandler';
2
2
  import * as factory from '../../factory';
3
3
  /**
4
4
  * タスク実行関数
@@ -1,4 +1,4 @@
1
- import type { IOperationExecute } from '../task';
1
+ import type { IOperationExecute } from '../taskHandler';
2
2
  import * as factory from '../../factory';
3
3
  import { ActionRepo } from '../../repo/action';
4
4
  import { AssetTransactionRepo } from '../../repo/assetTransaction';
@@ -1,7 +1,7 @@
1
1
  import * as COA from '@motionpicture/coa-service';
2
2
  import * as factory from '../../factory';
3
3
  import { Settings } from '../../settings';
4
- import type { ICallResult, IExecutableTaskKeys, IOperationExecute } from '../task';
4
+ import type { ICallResult, IExecutableTaskKeys, IOperationExecute } from '../taskHandler';
5
5
  import { AcceptedOfferRepo } from '../../repo/acceptedOffer';
6
6
  import { ActionRepo } from '../../repo/action';
7
7
  import { AssetTransactionRepo } from '../../repo/assetTransaction';
@@ -17,10 +17,14 @@ export declare function call(params: Pick<factory.task.ITask<factory.taskName.Co
17
17
  /**
18
18
  * 予約を確定する
19
19
  */
20
- export declare function confirmReserveTransaction(params: factory.task.IData<factory.taskName.ConfirmReserveTransaction> & {
20
+ export declare function confirmReserveTransaction(params: Omit<factory.task.IData<factory.taskName.ConfirmReserveTransaction>, 'agent' | 'project'> & {
21
21
  sameAs?: {
22
22
  id: string;
23
23
  };
24
+ project: {
25
+ id: string;
26
+ typeOf: factory.organizationType.Project;
27
+ };
24
28
  }, options: {
25
29
  sendOrder: boolean;
26
30
  useOnOrderStatusChanged: boolean;
@@ -52,7 +52,7 @@ function call(params) {
52
52
  endpoint: coaAuthClient.options.endpoint, // same as authClient(2024-07-17~)
53
53
  auth: coaAuthClient
54
54
  }, { timeout: settings.coa.timeout });
55
- yield confirmReserveTransaction(Object.assign(Object.assign({}, params.data), { sameAs: { id: params.id } }), {
55
+ yield confirmReserveTransaction(Object.assign(Object.assign({}, params.data), { project: params.project, sameAs: { id: params.id } }), {
56
56
  sendOrder: true,
57
57
  useOnOrderStatusChanged: true
58
58
  })({
@@ -179,8 +179,8 @@ function confirmReserveTransaction(params, options) {
179
179
  default:
180
180
  confirmActionObject = params.object;
181
181
  }
182
- const { agent, project, purpose, typeOf, sameAs } = params;
183
- const confirmActionAttributes = Object.assign({ agent, project, purpose, typeOf, object: confirmActionObject }, (typeof (sameAs === null || sameAs === void 0 ? void 0 : sameAs.id) === 'string') ? { sameAs: { id: sameAs.id, typeOf: 'Task' } } : undefined // link sameAs(2024-06-10~)
182
+ const { project, purpose, typeOf, sameAs } = params;
183
+ const confirmActionAttributes = Object.assign({ agent: project, project, purpose, typeOf, object: confirmActionObject }, (typeof (sameAs === null || sameAs === void 0 ? void 0 : sameAs.id) === 'string') ? { sameAs: { id: sameAs.id, typeOf: 'Task' } } : undefined // link sameAs(2024-06-10~)
184
184
  );
185
185
  const action = yield repos.action.start(confirmActionAttributes, Object.assign({}, (recipe !== undefined) ? { recipe } : undefined // add recipe(2024-06-11~)
186
186
  ));
@@ -1,4 +1,4 @@
1
- import type { IOperationExecute } from '../task';
1
+ import type { IOperationExecute } from '../taskHandler';
2
2
  import * as factory from '../../factory';
3
3
  /**
4
4
  * タスク実行関数
@@ -1,5 +1,5 @@
1
1
  import * as factory from '../../factory';
2
- import type { IOperationExecute } from '../task';
2
+ import type { IOperationExecute } from '../taskHandler';
3
3
  /**
4
4
  * タスク実行関数
5
5
  */
@@ -1,5 +1,5 @@
1
1
  import * as factory from '../../factory';
2
- import type { ICallResult, IExecutableTaskKeys, IOperationExecute } from '../task';
2
+ import type { ICallResult, IExecutableTaskKeys, IOperationExecute } from '../taskHandler';
3
3
  /**
4
4
  * タスク実行関数
5
5
  */
@@ -1,4 +1,4 @@
1
- import type { IOperationExecute } from '../task';
1
+ import type { IOperationExecute } from '../taskHandler';
2
2
  import * as factory from '../../factory';
3
3
  /**
4
4
  * タスク実行関数
@@ -1,4 +1,4 @@
1
- import type { IOperationExecute } from '../task';
1
+ import type { IOperationExecute } from '../taskHandler';
2
2
  import * as factory from '../../factory';
3
3
  /**
4
4
  * タスク実行関数
@@ -29,7 +29,7 @@ function call(data) {
29
29
  const assetTransactionRepo = new assetTransaction_1.AssetTransactionRepo(connection);
30
30
  const productRepo = new product_1.ProductRepo(connection);
31
31
  const projectRepo = new project_1.ProjectRepo(connection);
32
- const transactionNumberRepo = new transactionNumber_1.TransactionNumberRepo({ redisClient, connection });
32
+ const transactionNumberRepo = new transactionNumber_1.TransactionNumberRepo({ connection });
33
33
  yield DeliveryService.givePointAward(data)({
34
34
  action: actionRepo,
35
35
  assetTransaction: assetTransactionRepo,
@@ -1,3 +1,5 @@
1
1
  import * as factory from '../../factory';
2
- import type { ICallResult, IExecutableTaskKeys, IOperationExecute } from '../task';
3
- export declare function call(params: Pick<factory.task.handleNotification.ITask, IExecutableTaskKeys>): IOperationExecute<ICallResult>;
2
+ import type { ICallResult, IExecutableTaskKeys, IOperationExecute } from '../taskHandler';
3
+ export declare function call(params: Pick<factory.task.handleNotification.ITask, IExecutableTaskKeys> & {
4
+ status: factory.taskStatus.Running;
5
+ }): IOperationExecute<ICallResult>;
@@ -1,5 +1,5 @@
1
1
  import * as factory from '../../factory';
2
- import type { ICallResult, IOperationExecute } from '../task';
2
+ import type { ICallResult, IOperationExecute } from '../taskHandler';
3
3
  /**
4
4
  * タスク実行関数
5
5
  */
@@ -1,5 +1,5 @@
1
1
  import * as factory from '../../factory';
2
- import type { ICallResult, IOperationExecute } from '../task';
2
+ import type { ICallResult, IOperationExecute } from '../taskHandler';
3
3
  /**
4
4
  * タスク実行関数
5
5
  */
@@ -1,5 +1,5 @@
1
1
  import * as factory from '../../factory';
2
- import type { ICallResult, IOperationExecute } from '../task';
2
+ import type { ICallResult, IOperationExecute } from '../taskHandler';
3
3
  /**
4
4
  * タスク実行関数
5
5
  */
@@ -1,3 +1,3 @@
1
- import type { IExecutableTaskKeys, IOperationExecute } from '../task';
1
+ import type { IExecutableTaskKeys, IOperationExecute } from '../taskHandler';
2
2
  import * as factory from '../../factory';
3
3
  export declare function call(params: Pick<factory.task.invalidatePaymentUrl.ITask, IExecutableTaskKeys>): IOperationExecute<void>;
@@ -1,5 +1,5 @@
1
1
  import * as factory from '../../factory';
2
- import type { IOperationExecute } from '../task';
2
+ import type { IOperationExecute } from '../taskHandler';
3
3
  /**
4
4
  * タスク実行関数
5
5
  */
@@ -25,7 +25,7 @@ function call(data) {
25
25
  }
26
26
  const actionRepo = new action_1.ActionRepo(connection);
27
27
  const productRepo = new product_1.ProductRepo(connection);
28
- const transactionNumberRepo = new transactionNumber_1.TransactionNumberRepo({ redisClient, connection });
28
+ const transactionNumberRepo = new transactionNumber_1.TransactionNumberRepo({ connection });
29
29
  yield MoneyTransferService.moneyTransfer(data)({
30
30
  action: actionRepo,
31
31
  product: productRepo,
@@ -1,4 +1,4 @@
1
- import type { IOperationExecute } from '../task';
1
+ import type { IOperationExecute } from '../taskHandler';
2
2
  import * as factory from '../../factory';
3
3
  /**
4
4
  * タスク実行関数
@@ -1,5 +1,5 @@
1
1
  import * as factory from '../../factory';
2
- import type { IExecutableTaskKeys, IOperationExecute } from '../task';
2
+ import type { IExecutableTaskKeys, IOperationExecute } from '../taskHandler';
3
3
  /**
4
4
  * タスク実行関数
5
5
  */
@@ -1,5 +1,5 @@
1
1
  import * as factory from '../../factory';
2
- import type { IOperationExecute } from '../task';
2
+ import type { IOperationExecute } from '../taskHandler';
3
3
  /**
4
4
  * タスク実行関数
5
5
  */
@@ -1,4 +1,4 @@
1
- import type { IOperationExecute } from '../task';
1
+ import type { IOperationExecute } from '../taskHandler';
2
2
  import * as factory from '../../factory';
3
3
  /**
4
4
  * タスク実行関数
@@ -1,5 +1,5 @@
1
1
  import * as factory from '../../factory';
2
- import type { IOperationExecute } from '../task';
2
+ import type { IOperationExecute } from '../taskHandler';
3
3
  /**
4
4
  * タスク実行関数
5
5
  */
@@ -1,4 +1,4 @@
1
- import type { ICallResult, IExecutableTaskKeys, IOperationExecute } from '../task';
1
+ import type { ICallResult, IExecutableTaskKeys, IOperationExecute } from '../taskHandler';
2
2
  import * as factory from '../../factory';
3
3
  /**
4
4
  * タスク実行関数
@@ -1,4 +1,4 @@
1
- import type { IOperationExecute } from '../task';
1
+ import type { IOperationExecute } from '../taskHandler';
2
2
  import * as factory from '../../factory';
3
3
  /**
4
4
  * タスク実行関数
@@ -1,4 +1,4 @@
1
- import type { ICallResult, IExecutableTaskKeys, IOperationExecute } from '../task';
1
+ import type { ICallResult, IExecutableTaskKeys, IOperationExecute } from '../taskHandler';
2
2
  import * as factory from '../../factory';
3
3
  /**
4
4
  * タスク実行関数