@chevre/domain 24.0.0-alpha.16 → 24.0.0-alpha.18

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 (41) hide show
  1. package/lib/chevre/repo/action/acceptCOAOffer.d.ts +23 -0
  2. package/lib/chevre/repo/action/acceptCOAOffer.js +64 -0
  3. package/lib/chevre/repo/action/acceptPay.d.ts +8 -0
  4. package/lib/chevre/repo/action/acceptPay.js +13 -0
  5. package/lib/chevre/repo/action/actionProcess.d.ts +115 -0
  6. package/lib/chevre/repo/action/actionProcess.js +293 -0
  7. package/lib/chevre/repo/action/authorizeOffer.d.ts +21 -0
  8. package/lib/chevre/repo/action/authorizeOffer.js +85 -0
  9. package/lib/chevre/repo/action/checkMovieTicket.d.ts +55 -0
  10. package/lib/chevre/repo/action/checkMovieTicket.js +145 -0
  11. package/lib/chevre/repo/action/checkThing.d.ts +8 -0
  12. package/lib/chevre/repo/action/checkThing.js +13 -0
  13. package/lib/chevre/repo/action.d.ts +9 -249
  14. package/lib/chevre/repo/action.js +308 -708
  15. package/lib/chevre/repo/aggregateAction.d.ts +102 -0
  16. package/lib/chevre/repo/aggregateAction.js +379 -0
  17. package/lib/chevre/repository.d.ts +27 -0
  18. package/lib/chevre/repository.js +60 -2
  19. package/lib/chevre/service/aggregation/system.d.ts +10 -10
  20. package/lib/chevre/service/aggregation/system.js +9 -9
  21. package/lib/chevre/service/assetTransaction/pay/check.d.ts +5 -4
  22. package/lib/chevre/service/assetTransaction/pay/publishPaymentUrl.d.ts +5 -2
  23. package/lib/chevre/service/assetTransaction/pay/publishPaymentUrl.js +3 -3
  24. package/lib/chevre/service/offer/eventServiceByCOA/acceptOffer.d.ts +14 -3
  25. package/lib/chevre/service/offer/eventServiceByCOA/acceptOffer.js +1 -1
  26. package/lib/chevre/service/offer/eventServiceByCOA/authorize.d.ts +4 -2
  27. package/lib/chevre/service/offer/eventServiceByCOA/authorizeByAcceptAction.js +21 -13
  28. package/lib/chevre/service/offer/eventServiceByCOA/changeOffers.js +17 -8
  29. package/lib/chevre/service/offer/eventServiceByCOA/findAcceptAction.d.ts +2 -2
  30. package/lib/chevre/service/payment/any/findAcceptAction.d.ts +2 -2
  31. package/lib/chevre/service/payment/any/findAcceptAction.js +2 -2
  32. package/lib/chevre/service/payment/any/findCheckAction.d.ts +7 -6
  33. package/lib/chevre/service/payment/any/findCheckAction.js +2 -2
  34. package/lib/chevre/service/payment/any/publishPaymentUrl.d.ts +2 -0
  35. package/lib/chevre/service/payment/movieTicket/checkMovieTicket.d.ts +3 -3
  36. package/lib/chevre/service/payment/movieTicket/checkMovieTicket.js +3 -3
  37. package/lib/chevre/service/task/acceptCOAOffer.js +5 -2
  38. package/lib/chevre/service/task/checkMovieTicket.js +3 -3
  39. package/lib/chevre/service/task/checkResource.js +2 -2
  40. package/lib/chevre/service/task/publishPaymentUrl.js +4 -2
  41. package/package.json +1 -1
@@ -1,4 +1,4 @@
1
- import type { ActionRepo } from '../../repo/action';
1
+ import type { AggregateActionRepo } from '../../repo/aggregateAction';
2
2
  import { AggregationRepo } from '../../repo/aggregation';
3
3
  import type { AssetTransactionRepo } from '../../repo/assetTransaction';
4
4
  import type { EventRepo } from '../../repo/event';
@@ -46,7 +46,7 @@ declare function aggregatePlaceOrder(params: IAggregateParams & {
46
46
  */
47
47
  declare function aggregateAuthorizeEventServiceOfferAction(params: IAggregateParams): (repos: {
48
48
  agregation: AggregationRepo;
49
- action: ActionRepo;
49
+ aggregateAction: AggregateActionRepo;
50
50
  }) => Promise<{
51
51
  aggregationCount: number;
52
52
  aggregateDuration: string;
@@ -56,14 +56,14 @@ declare function aggregateAuthorizeEventServiceOfferAction(params: IAggregatePar
56
56
  */
57
57
  declare function aggregateAuthorizePaymentAction(params: IAggregateParams): (repos: {
58
58
  agregation: AggregationRepo;
59
- action: ActionRepo;
59
+ aggregateAction: AggregateActionRepo;
60
60
  }) => Promise<{
61
61
  aggregationCount: number;
62
62
  aggregateDuration: string;
63
63
  }>;
64
64
  declare function aggregateAuthorizeOrderAction(params: IAggregateParams): (repos: {
65
65
  agregation: AggregationRepo;
66
- action: ActionRepo;
66
+ aggregateAction: AggregateActionRepo;
67
67
  }) => Promise<{
68
68
  aggregationCount: number;
69
69
  aggregateDuration: string;
@@ -73,7 +73,7 @@ declare function aggregateAuthorizeOrderAction(params: IAggregateParams): (repos
73
73
  */
74
74
  declare function aggregateUseAction(params: IAggregateParams): (repos: {
75
75
  agregation: AggregationRepo;
76
- action: ActionRepo;
76
+ aggregateAction: AggregateActionRepo;
77
77
  }) => Promise<{
78
78
  aggregationCount: number;
79
79
  aggregateDuration: string;
@@ -83,7 +83,7 @@ declare function aggregateUseAction(params: IAggregateParams): (repos: {
83
83
  */
84
84
  declare function aggregateReserveAction(params: IAggregateParams): (repos: {
85
85
  agregation: AggregationRepo;
86
- action: ActionRepo;
86
+ aggregateAction: AggregateActionRepo;
87
87
  }) => Promise<{
88
88
  aggregationCount: number;
89
89
  aggregateDuration: string;
@@ -93,7 +93,7 @@ declare function aggregateReserveAction(params: IAggregateParams): (repos: {
93
93
  */
94
94
  declare function aggregateOrderAction(params: IAggregateParams): (repos: {
95
95
  agregation: AggregationRepo;
96
- action: ActionRepo;
96
+ aggregateAction: AggregateActionRepo;
97
97
  }) => Promise<{
98
98
  aggregationCount: number;
99
99
  aggregateDuration: string;
@@ -103,21 +103,21 @@ declare function aggregateOrderAction(params: IAggregateParams): (repos: {
103
103
  */
104
104
  declare function aggregateCancelReservationAction(params: IAggregateParams): (repos: {
105
105
  agregation: AggregationRepo;
106
- action: ActionRepo;
106
+ aggregateAction: AggregateActionRepo;
107
107
  }) => Promise<{
108
108
  aggregationCount: number;
109
109
  aggregateDuration: string;
110
110
  }>;
111
111
  declare function aggregateCheckMovieTicketAction(params: IAggregateParams): (repos: {
112
112
  agregation: AggregationRepo;
113
- action: ActionRepo;
113
+ aggregateAction: AggregateActionRepo;
114
114
  }) => Promise<{
115
115
  aggregationCount: number;
116
116
  aggregateDuration: string;
117
117
  }>;
118
118
  declare function aggregatePayMovieTicketAction(params: IAggregateParams): (repos: {
119
119
  agregation: AggregationRepo;
120
- action: ActionRepo;
120
+ aggregateAction: AggregateActionRepo;
121
121
  }) => Promise<{
122
122
  aggregationCount: number;
123
123
  aggregateDuration: string;
@@ -219,7 +219,7 @@ function aggregateAuthorizeEventServiceOfferAction(params) {
219
219
  .add(-i, params.aggregateDurationUnit)
220
220
  .endOf(params.aggregateDurationUnit)
221
221
  .toDate();
222
- const aggregateResult = await repos.action.aggregateAuthorizeEventServiceOfferAction({
222
+ const aggregateResult = await repos.aggregateAction.aggregateAuthorizeEventServiceOfferAction({
223
223
  project: { id: { $ne: params.excludedProjectId } },
224
224
  startFrom,
225
225
  startThrough,
@@ -264,7 +264,7 @@ function aggregateAuthorizePaymentAction(params) {
264
264
  .add(-i, params.aggregateDurationUnit)
265
265
  .endOf(params.aggregateDurationUnit)
266
266
  .toDate();
267
- const aggregateResult = await repos.action.aggregateAuthorizePaymentAction({
267
+ const aggregateResult = await repos.aggregateAction.aggregateAuthorizePaymentAction({
268
268
  project: { id: { $ne: params.excludedProjectId } },
269
269
  startFrom,
270
270
  startThrough,
@@ -306,7 +306,7 @@ function aggregateAuthorizeOrderAction(params) {
306
306
  .add(-i, params.aggregateDurationUnit)
307
307
  .endOf(params.aggregateDurationUnit)
308
308
  .toDate();
309
- const aggregateResult = await repos.action.aggregateAuthorizeOrderAction({
309
+ const aggregateResult = await repos.aggregateAction.aggregateAuthorizeOrderAction({
310
310
  project: { id: { $ne: params.excludedProjectId } },
311
311
  startFrom,
312
312
  startThrough,
@@ -351,7 +351,7 @@ function aggregateUseAction(params) {
351
351
  .add(-i, params.aggregateDurationUnit)
352
352
  .endOf(params.aggregateDurationUnit)
353
353
  .toDate();
354
- const aggregateResult = await repos.action.aggregateByTypeOf({
354
+ const aggregateResult = await repos.aggregateAction.aggregateByTypeOf({
355
355
  project: { id: { $ne: params.excludedProjectId } },
356
356
  startFrom,
357
357
  startThrough,
@@ -396,7 +396,7 @@ function aggregateReserveAction(params) {
396
396
  .add(-i, params.aggregateDurationUnit)
397
397
  .endOf(params.aggregateDurationUnit)
398
398
  .toDate();
399
- const aggregateResult = await repos.action.aggregateByTypeOf({
399
+ const aggregateResult = await repos.aggregateAction.aggregateByTypeOf({
400
400
  project: { id: { $ne: params.excludedProjectId } },
401
401
  startFrom,
402
402
  startThrough,
@@ -441,7 +441,7 @@ function aggregateOrderAction(params) {
441
441
  .add(-i, params.aggregateDurationUnit)
442
442
  .endOf(params.aggregateDurationUnit)
443
443
  .toDate();
444
- const aggregateResult = await repos.action.aggregateByTypeOf({
444
+ const aggregateResult = await repos.aggregateAction.aggregateByTypeOf({
445
445
  project: { id: { $ne: params.excludedProjectId } },
446
446
  startFrom,
447
447
  startThrough,
@@ -486,7 +486,7 @@ function aggregateCancelReservationAction(params) {
486
486
  .add(-i, params.aggregateDurationUnit)
487
487
  .endOf(params.aggregateDurationUnit)
488
488
  .toDate();
489
- const aggregateResult = await repos.action.aggregateCancelReservationAction({
489
+ const aggregateResult = await repos.aggregateAction.aggregateCancelReservationAction({
490
490
  project: { id: { $ne: params.excludedProjectId } },
491
491
  startFrom,
492
492
  startThrough
@@ -527,7 +527,7 @@ function aggregateCheckMovieTicketAction(params) {
527
527
  .add(-i, params.aggregateDurationUnit)
528
528
  .endOf(params.aggregateDurationUnit)
529
529
  .toDate();
530
- const aggregateResult = await repos.action.aggregateCheckMovieTicketAction({
530
+ const aggregateResult = await repos.aggregateAction.aggregateCheckMovieTicketAction({
531
531
  project: { id: { $ne: params.excludedProjectId } },
532
532
  startFrom,
533
533
  startThrough
@@ -568,7 +568,7 @@ function aggregatePayMovieTicketAction(params) {
568
568
  .add(-i, params.aggregateDurationUnit)
569
569
  .endOf(params.aggregateDurationUnit)
570
570
  .toDate();
571
- const aggregateResult = await repos.action.aggregatePayMovieTicketAction({
571
+ const aggregateResult = await repos.aggregateAction.aggregatePayMovieTicketAction({
572
572
  project: { id: { $ne: params.excludedProjectId } },
573
573
  startFrom,
574
574
  startThrough
@@ -1,20 +1,21 @@
1
1
  import * as factory from '../../../factory';
2
2
  import { Settings } from '../../../settings';
3
- import type { ActionRepo } from '../../../repo/action';
3
+ import type { CheckMovieTicketActionRepo } from '../../../repo/action/checkMovieTicket';
4
4
  import type { CredentialsRepo } from '../../../repo/credentials';
5
5
  import type { EventRepo } from '../../../repo/event';
6
6
  import type { PaymentServiceRepo } from '../../../repo/paymentService';
7
7
  import type { PaymentServiceProviderRepo } from '../../../repo/paymentServiceProvider';
8
8
  import type { SellerPaymentAcceptedRepo } from '../../../repo/sellerPaymentAccepted';
9
9
  import * as MovieTicketPayment from '../../payment/movieTicket';
10
- export type ICheckOperation<T> = (repos: {
11
- action: ActionRepo;
10
+ export interface ICheckRepos {
11
+ checkMovieTicketAction: CheckMovieTicketActionRepo;
12
12
  credentials: CredentialsRepo;
13
13
  event: EventRepo;
14
14
  paymentAccepted: SellerPaymentAcceptedRepo;
15
15
  paymentService: PaymentServiceRepo;
16
16
  paymentServiceProvider: PaymentServiceProviderRepo;
17
- }, settings: Settings) => Promise<T>;
17
+ }
18
+ export type ICheckOperation<T> = (repos: ICheckRepos, settings: Settings) => Promise<T>;
18
19
  /**
19
20
  * 決済方法認証
20
21
  */
@@ -2,21 +2,24 @@ import * as factory from '../../../factory';
2
2
  import { Settings } from '../../../settings';
3
3
  import type { AcceptedPaymentMethodRepo } from '../../../repo/acceptedPaymentMethod';
4
4
  import type { ActionRepo } from '../../../repo/action';
5
+ import type { AcceptPayActionRepo } from '../../../repo/action/acceptPay';
5
6
  import type { EventRepo } from '../../../repo/event';
6
7
  import type { EventSeriesRepo } from '../../../repo/eventSeries';
7
8
  import type { PaymentServiceRepo } from '../../../repo/paymentService';
8
9
  import type { PaymentServiceProviderRepo } from '../../../repo/paymentServiceProvider';
9
10
  import type { SellerPaymentAcceptedRepo } from '../../../repo/sellerPaymentAccepted';
10
11
  import * as CreditCardPayment from '../../payment/creditCard';
11
- export type IPublishPaymentUrlOperation<T> = (repos: {
12
+ export interface IPublishPaymentUrlRepos {
12
13
  acceptedPaymentMethod: AcceptedPaymentMethodRepo;
13
14
  action: ActionRepo;
15
+ acceptPayAction: AcceptPayActionRepo;
14
16
  event: EventRepo;
15
17
  eventSeries: EventSeriesRepo;
16
18
  paymentAccepted: SellerPaymentAcceptedRepo;
17
19
  paymentService: PaymentServiceRepo;
18
20
  paymentServiceProvider: PaymentServiceProviderRepo;
19
- }, settings: Settings) => Promise<T>;
21
+ }
22
+ export type IPublishPaymentUrlOperation<T> = (repos: IPublishPaymentUrlRepos, settings: Settings) => Promise<T>;
20
23
  export type IPublishPaymentUrlResult = CreditCardPayment.IPaymentAgencyTransaction & {
21
24
  paymentMethodId: string;
22
25
  paymentUrl: string;
@@ -102,7 +102,7 @@ function publishPaymentUrl(params, options) {
102
102
  : undefined,
103
103
  ...(typeof params.identifier === 'string') ? { identifier: params.identifier } : undefined
104
104
  };
105
- const action = await repos.action.start(actionAttributes);
105
+ const action = await repos.acceptPayAction.start(actionAttributes);
106
106
  let result;
107
107
  let recipe;
108
108
  try {
@@ -147,7 +147,7 @@ function publishPaymentUrl(params, options) {
147
147
  }
148
148
  catch (error) {
149
149
  try {
150
- await repos.action.giveUp({ typeOf: actionAttributes.typeOf, id: action.id, error });
150
+ await repos.acceptPayAction.giveUp({ typeOf: actionAttributes.typeOf, id: action.id, error });
151
151
  }
152
152
  catch (__) {
153
153
  // 失敗したら仕方ない
@@ -158,7 +158,7 @@ function publishPaymentUrl(params, options) {
158
158
  paymentMethodId: result.paymentMethodId,
159
159
  paymentUrl: result.paymentUrl
160
160
  };
161
- await repos.action.completeWithVoid({ typeOf: actionAttributes.typeOf, id: action.id, result: actionResult, recipe });
161
+ await repos.acceptPayAction.completeWithVoid({ typeOf: actionAttributes.typeOf, id: action.id, result: actionResult, recipe });
162
162
  return result;
163
163
  };
164
164
  }
@@ -1,12 +1,23 @@
1
1
  import type * as COA from '@motionpicture/coa-service';
2
- import type { ActionRepo } from '../../../repo/action';
2
+ import type { AcceptCOAOfferActionRepo } from '../../../repo/action/acceptCOAOffer';
3
+ import type { AuthorizeOfferActionRepo } from '../../../repo/action/authorizeOffer';
3
4
  import type { EventRepo } from '../../../repo/event';
4
5
  import type { OrderNumberRepo } from '../../../repo/orderNumber';
5
6
  import type { ProjectRepo } from '../../../repo/project';
6
7
  import type { PlaceOrderRepo } from '../../../repo/transaction/placeOrder';
7
8
  import * as factory from '../../../factory';
8
9
  interface IAcceptRepos {
9
- action: ActionRepo;
10
+ action: AcceptCOAOfferActionRepo;
11
+ event: EventRepo;
12
+ orderNumber: OrderNumberRepo;
13
+ project: ProjectRepo;
14
+ placeOrder: PlaceOrderRepo;
15
+ reserveService: COA.service.Reserve;
16
+ masterService: COA.service.Master;
17
+ }
18
+ interface IReAcceptRepos {
19
+ action: AcceptCOAOfferActionRepo;
20
+ authorizeOfferAction: AuthorizeOfferActionRepo;
10
21
  event: EventRepo;
11
22
  orderNumber: OrderNumberRepo;
12
23
  project: ProjectRepo;
@@ -34,5 +45,5 @@ declare function reAcceptOffer(params: IAccepteOfferParams & {
34
45
  */
35
46
  id: string;
36
47
  };
37
- }): (repos: IAcceptRepos) => Promise<void>;
48
+ }): (repos: IReAcceptRepos) => Promise<void>;
38
49
  export { acceptOffer, reAcceptOffer };
@@ -155,7 +155,7 @@ function reAcceptOffer(params) {
155
155
  }
156
156
  const coaInfo = await findCOAInfo({ id: params.object.event.id, project: { id: transaction.project.id } })(repos);
157
157
  // 承認アクション存在検証
158
- await repos.action.findById({ id: params.potentialActions.id, typeOf: factory.actionType.AuthorizeAction }, ['id'], []);
158
+ await repos.authorizeOfferAction.findById({ id: params.potentialActions.id, typeOf: factory.actionType.AuthorizeAction }, ['id'], []);
159
159
  const actionAttributes = {
160
160
  project: transaction.project,
161
161
  typeOf: factory.actionType.AcceptAction,
@@ -1,4 +1,5 @@
1
- import type { ActionRepo } from '../../../repo/action';
1
+ import type { AuthorizeOfferActionRepo } from '../../../repo/action/authorizeOffer';
2
+ import type { AcceptCOAOfferActionRepo } from '../../../repo/action/acceptCOAOffer';
2
3
  import type { CategoryCodeRepo } from '../../../repo/categoryCode';
3
4
  import type { EventRepo } from '../../../repo/event';
4
5
  import type { OfferRepo } from '../../../repo/offer/unitPriceInCatalog';
@@ -10,7 +11,8 @@ import * as factory from '../../../factory';
10
11
  export { IRequestBody, IResponseBody };
11
12
  export type IAuthorizeActionResult = factory.action.authorize.offer.eventService.IResult;
12
13
  export interface IAuthorizeRepos {
13
- action: ActionRepo;
14
+ action: AuthorizeOfferActionRepo;
15
+ accpetCOAOfferAction: AcceptCOAOfferActionRepo;
14
16
  categoryCode: CategoryCodeRepo;
15
17
  event: EventRepo;
16
18
  offer: OfferRepo;
@@ -32,18 +32,26 @@ const factory = __importStar(require("../../../factory"));
32
32
  */
33
33
  function authorizeByAcceptAction(params) {
34
34
  return async (repos) => {
35
- const acceptAction = (await repos.action.search({
36
- limit: 1,
37
- page: 1,
38
- project: { id: { $eq: params.project.id } },
39
- id: { $in: [params.object.id] },
40
- typeOf: { $eq: factory.actionType.AcceptAction },
41
- purpose: { id: { $in: [params.purpose.id] } },
42
- actionStatus: { $in: [factory.actionStatusType.CompletedActionStatus] }
43
- }, ['result', 'object', 'potentialActions'])).shift();
44
- if (acceptAction === undefined) {
45
- throw new factory.errors.NotFound(factory.actionType.AcceptAction);
46
- }
35
+ // const acceptAction = (<IAcceptAction[]>await repos.action.search(
36
+ // {
37
+ // limit: 1,
38
+ // page: 1,
39
+ // project: { id: { $eq: params.project.id } },
40
+ // id: { $in: [params.object.id] },
41
+ // typeOf: { $eq: factory.actionType.AcceptAction },
42
+ // purpose: { id: { $in: [params.purpose.id] } },
43
+ // actionStatus: { $in: [factory.actionStatusType.CompletedActionStatus] }
44
+ // },
45
+ // ['result', 'object', 'potentialActions']
46
+ // )).shift();
47
+ // if (acceptAction === undefined) {
48
+ // throw new factory.errors.NotFound(factory.actionType.AcceptAction);
49
+ // }
50
+ const acceptAction = await repos.accpetCOAOfferAction.findCompletedById({
51
+ project: { id: params.project.id },
52
+ id: params.object.id,
53
+ purpose: { id: params.purpose.id },
54
+ }, ['result', 'object', 'potentialActions']);
47
55
  const acceptResult = acceptAction.result;
48
56
  if (acceptResult === undefined) {
49
57
  throw new factory.errors.NotFound(`${factory.actionType.AcceptAction}.result`);
@@ -67,7 +75,7 @@ function authorizeByAcceptAction(params) {
67
75
  }
68
76
  else {
69
77
  // recipe依存へ変更(2024-06-11~)
70
- const recipe = await repos.action.findRecipeByAction({
78
+ const recipe = await repos.accpetCOAOfferAction.findRecipeByAction({
71
79
  project: { id: params.project.id },
72
80
  recipeFor: { id: params.object.id }
73
81
  });
@@ -32,6 +32,7 @@ const any_1 = require("../any");
32
32
  const factory_1 = require("./authorize/factory");
33
33
  const validateAcceptedOffers_1 = require("./authorize/validateAcceptedOffers");
34
34
  const factory = __importStar(require("../../../factory"));
35
+ // type IAcceptAction = Pick<factory.action.accept.coaOffer.IAction, 'result'>;
35
36
  /**
36
37
  * COA興行オファー承認のオファーを変更
37
38
  */
@@ -61,13 +62,21 @@ function changeOffers(params) {
61
62
  if (typeof originalAcceptActionId !== 'string' || originalAcceptActionId === '') {
62
63
  throw new factory.errors.NotFound('authorizeAction.object.id');
63
64
  }
64
- const originalAcceptResult = (await repos.action.search({
65
- limit: 1,
66
- page: 1,
67
- project: { id: { $eq: authorizeAction.project.id } },
68
- id: { $in: [originalAcceptActionId] },
69
- typeOf: { $eq: factory.actionType.AcceptAction }
70
- }, ['result'])).shift()?.result;
65
+ // const originalAcceptResult = (<IAcceptAction[]>await repos.action.search(
66
+ // {
67
+ // limit: 1,
68
+ // page: 1,
69
+ // project: { id: { $eq: authorizeAction.project.id } },
70
+ // id: { $in: [originalAcceptActionId] },
71
+ // typeOf: { $eq: factory.actionType.AcceptAction }
72
+ // },
73
+ // ['result']
74
+ // )).shift()?.result;
75
+ const originalAcceptResult = (await repos.accpetCOAOfferAction.findCompletedById({
76
+ project: { id: authorizeAction.project.id },
77
+ id: originalAcceptActionId,
78
+ purpose: { id: authorizeAction.purpose.id },
79
+ }, ['result'])).result;
71
80
  if (originalAcceptResult === undefined) {
72
81
  throw new factory.errors.NotFound(`${factory.actionType.AcceptAction}.result`);
73
82
  }
@@ -126,7 +135,7 @@ function changeOffers(params) {
126
135
  // authorizeAction.object.acceptedOffer = acceptedOffers; // discontinue acceptedOffers(2024-06-21~)
127
136
  // recipe依存へ変更(2024-06-11~)
128
137
  // const updTmpReserveSeatResult = authorizeAction.result?.responseBody;
129
- const recipe = await repos.action.findRecipeByAction({
138
+ const recipe = await repos.accpetCOAOfferAction.findRecipeByAction({
130
139
  project: { id: transaction.project.id },
131
140
  recipeFor: { id: originalAcceptActionId }
132
141
  });
@@ -1,5 +1,5 @@
1
1
  import * as factory from '../../../factory';
2
- import type { ActionRepo } from '../../../repo/action';
2
+ import type { AcceptCOAOfferActionRepo } from '../../../repo/action/acceptCOAOffer';
3
3
  import type { TaskRepo } from '../../../repo/task';
4
4
  interface IFindAcceptActionResult {
5
5
  /**
@@ -35,7 +35,7 @@ declare function findAcceptAction(params: {
35
35
  id: string;
36
36
  };
37
37
  }): (repos: {
38
- action: ActionRepo;
38
+ action: AcceptCOAOfferActionRepo;
39
39
  task: TaskRepo;
40
40
  }) => Promise<IFindAcceptActionResult>;
41
41
  export { findAcceptAction };
@@ -1,5 +1,5 @@
1
1
  import * as factory from '../../../factory';
2
- import type { ActionRepo } from '../../../repo/action';
2
+ import type { AcceptPayActionRepo } from '../../../repo/action/acceptPay';
3
3
  import type { TaskRepo } from '../../../repo/task';
4
4
  interface IFindAcceptActionResult {
5
5
  /**
@@ -37,7 +37,7 @@ declare function findAcceptAction(params: {
37
37
  id: string;
38
38
  };
39
39
  }): (repos: {
40
- action: ActionRepo;
40
+ acceptPayAction: AcceptPayActionRepo;
41
41
  task: TaskRepo;
42
42
  }) => Promise<IFindAcceptActionResult>;
43
43
  export { findAcceptAction, };
@@ -55,7 +55,7 @@ function findAcceptAction(params) {
55
55
  break;
56
56
  default:
57
57
  // タスクがReadyでなければアクション検索
58
- const acceptAction = (await repos.action.searchBySameAs({
58
+ const acceptAction = (await repos.acceptPayAction.searchBySameAs({
59
59
  sameAs: { id: { $eq: task.id } },
60
60
  typeOf: { $eq: factory.actionType.AcceptAction }
61
61
  // purpose: { id: { $eq: String(params.purpose.id) } }
@@ -65,7 +65,7 @@ function findAcceptAction(params) {
65
65
  if (acceptAction.purpose?.id !== params.purpose.id) {
66
66
  throw new factory.errors.NotFound('Action');
67
67
  }
68
- const acceptActionWithResult = await repos.action.findById({ id: acceptAction.id, typeOf: factory.actionType.AcceptAction }, ['result', 'object'], []);
68
+ const acceptActionWithResult = await repos.acceptPayAction.findById({ id: acceptAction.id, typeOf: factory.actionType.AcceptAction }, ['result', 'object'], []);
69
69
  action = {
70
70
  id: acceptAction.id,
71
71
  actionStatus: acceptAction.actionStatus,
@@ -1,6 +1,10 @@
1
1
  import * as factory from '../../../factory';
2
- import type { ActionRepo, IMinimizedPurchaseNumberAuthResult } from '../../../repo/action';
2
+ import type { CheckMovieTicketActionRepo, IMinimizedPurchaseNumberAuthResult } from '../../../repo/action/checkMovieTicket';
3
3
  import type { TaskRepo } from '../../../repo/task';
4
+ interface IFindCheckActionRepos {
5
+ checkMovieTicketAction: CheckMovieTicketActionRepo;
6
+ task: TaskRepo;
7
+ }
4
8
  interface IFindCheckActionResult {
5
9
  /**
6
10
  * アクションID
@@ -37,8 +41,5 @@ declare function findCheckAction(params: {
37
41
  */
38
42
  id: string;
39
43
  };
40
- }): (repos: {
41
- action: ActionRepo;
42
- task: TaskRepo;
43
- }) => Promise<IFindCheckActionResult>;
44
- export { findCheckAction, };
44
+ }): (repos: IFindCheckActionRepos) => Promise<IFindCheckActionResult>;
45
+ export { IFindCheckActionRepos, findCheckAction, };
@@ -55,7 +55,7 @@ function findCheckAction(params) {
55
55
  break;
56
56
  default:
57
57
  // タスクがReadyでなければアクション検索
58
- const authorizeAction = (await repos.action.searchBySameAs({
58
+ const authorizeAction = (await repos.checkMovieTicketAction.searchBySameAs({
59
59
  sameAs: { id: { $eq: task.id } },
60
60
  typeOf: { $eq: factory.actionType.CheckAction }
61
61
  // purpose: { id: { $eq: String(params.purpose.id) } }
@@ -66,7 +66,7 @@ function findCheckAction(params) {
66
66
  throw new factory.errors.NotFound('Action');
67
67
  }
68
68
  // result from recipe(2024-06-10~)
69
- const purchaseNumberAuthResult = await repos.action.findIMinimizedPurchaseNumberAuthResultByCheckMovieTicketRecipe({
69
+ const purchaseNumberAuthResult = await repos.checkMovieTicketAction.findIMinimizedPurchaseNumberAuthResultByCheckMovieTicketRecipe({
70
70
  project: { id: params.project.id },
71
71
  recipeFor: { id: authorizeAction.id }
72
72
  });
@@ -2,6 +2,7 @@ import * as factory from '../../../factory';
2
2
  import { Settings } from '../../../settings';
3
3
  import type { AcceptedPaymentMethodRepo } from '../../../repo/acceptedPaymentMethod';
4
4
  import type { ActionRepo } from '../../../repo/action';
5
+ import type { AcceptPayActionRepo } from '../../../repo/action/acceptPay';
5
6
  import type { AssetTransactionRepo } from '../../../repo/assetTransaction';
6
7
  import type { AuthorizationRepo } from '../../../repo/authorization';
7
8
  import type { EventRepo } from '../../../repo/event';
@@ -18,6 +19,7 @@ import * as PayTransactionService from '../../assetTransaction/pay';
18
19
  interface IPublishPaymentUrlRepos {
19
20
  acceptedPaymentMethod: AcceptedPaymentMethodRepo;
20
21
  action: ActionRepo;
22
+ acceptPayAction: AcceptPayActionRepo;
21
23
  assetTransaction: AssetTransactionRepo;
22
24
  authorization: AuthorizationRepo;
23
25
  event: EventRepo;
@@ -1,4 +1,4 @@
1
- import type { ActionRepo } from '../../../repo/action';
1
+ import type { CheckMovieTicketActionRepo } from '../../../repo/action/checkMovieTicket';
2
2
  import type { CredentialsRepo } from '../../../repo/credentials';
3
3
  import type { EventRepo } from '../../../repo/event';
4
4
  import type { PaymentServiceRepo } from '../../../repo/paymentService';
@@ -8,7 +8,7 @@ import * as factory from '../../../factory';
8
8
  import { Settings } from '../../../settings';
9
9
  import { ICheckResult } from './processPurchaseNumberAuth';
10
10
  interface ICheckOperationRepos {
11
- action: ActionRepo;
11
+ checkMovieTicketAction: CheckMovieTicketActionRepo;
12
12
  credentials: CredentialsRepo;
13
13
  event: EventRepo;
14
14
  paymentAccepted: SellerPaymentAcceptedRepo;
@@ -22,4 +22,4 @@ type ICheckOperation<T> = (repos: ICheckOperationRepos, settings: Settings) => P
22
22
  declare function checkMovieTicket(params: factory.action.check.paymentMethod.movieTicket.IAttributes): ICheckOperation<{
23
23
  result: ICheckResult;
24
24
  }>;
25
- export { checkMovieTicket };
25
+ export { ICheckOperationRepos, checkMovieTicket };
@@ -65,7 +65,7 @@ function checkMovieTicket(params) {
65
65
  ? { sameAs: { id: params.sameAs.id, typeOf: 'Task' } } // タスク関連付け(2024-05-21~)
66
66
  : undefined
67
67
  };
68
- const action = await repos.action.start(actionAttributes);
68
+ const action = await repos.checkMovieTicketAction.start(actionAttributes);
69
69
  let processPurchaseNumberAuthResult;
70
70
  let recipe;
71
71
  try {
@@ -99,7 +99,7 @@ function checkMovieTicket(params) {
99
99
  // アクション保管用のエラーと両方保管(2024-05-22~)
100
100
  const errors = [(0, errorHandler_1.handleMvtkReserveError)(error), error];
101
101
  try {
102
- await repos.action.giveUp({ typeOf: actionAttributes.typeOf, id: action.id, error: errors });
102
+ await repos.checkMovieTicketAction.giveUp({ typeOf: actionAttributes.typeOf, id: action.id, error: errors });
103
103
  }
104
104
  catch (__) {
105
105
  // 失敗したら仕方ない
@@ -107,7 +107,7 @@ function checkMovieTicket(params) {
107
107
  throw errors[0];
108
108
  }
109
109
  const result = {};
110
- await repos.action.completeWithVoid({ typeOf: actionAttributes.typeOf, id: action.id, result, recipe });
110
+ await repos.checkMovieTicketAction.completeWithVoid({ typeOf: actionAttributes.typeOf, id: action.id, result, recipe });
111
111
  return { result: processPurchaseNumberAuthResult };
112
112
  };
113
113
  }
@@ -26,7 +26,9 @@ Object.defineProperty(exports, "__esModule", { value: true });
26
26
  exports.call = call;
27
27
  const COA = __importStar(require("@motionpicture/coa-service"));
28
28
  const factory = __importStar(require("../../factory"));
29
- const action_1 = require("../../repo/action");
29
+ // import { ActionRepo } from '../../repo/action';
30
+ const acceptCOAOffer_1 = require("../../repo/action/acceptCOAOffer");
31
+ const authorizeOffer_1 = require("../../repo/action/authorizeOffer");
30
32
  const credentials_1 = require("../../repo/credentials");
31
33
  const event_1 = require("../../repo/event");
32
34
  const orderNumber_1 = require("../../repo/orderNumber");
@@ -76,7 +78,7 @@ function call(params) {
76
78
  ...(credentialsRepo !== undefined) ? { credentialsRepo } : undefined
77
79
  });
78
80
  }
79
- const actionRepo = new action_1.ActionRepo(connection);
81
+ const actionRepo = new acceptCOAOffer_1.AcceptCOAOfferActionRepo(connection);
80
82
  // const transactionProcessRepo = new TransactionProcessRepo(redisClient, { lockExpiresInSeconds: 120 });
81
83
  try {
82
84
  const reserveService = new COA.service.Reserve({
@@ -103,6 +105,7 @@ function call(params) {
103
105
  isMember
104
106
  })({
105
107
  action: actionRepo,
108
+ authorizeOfferAction: new authorizeOffer_1.AuthorizeOfferActionRepo(connection),
106
109
  event: new event_1.EventRepo(connection),
107
110
  orderNumber: new orderNumber_1.OrderNumberRepo({ connection }),
108
111
  project: new project_1.ProjectRepo(connection),
@@ -25,7 +25,7 @@ var __importStar = (this && this.__importStar) || function (mod) {
25
25
  Object.defineProperty(exports, "__esModule", { value: true });
26
26
  exports.call = call;
27
27
  const factory = __importStar(require("../../factory"));
28
- const action_1 = require("../../repo/action");
28
+ const checkMovieTicket_1 = require("../../repo/action/checkMovieTicket");
29
29
  const credentials_1 = require("../../repo/credentials");
30
30
  const event_1 = require("../../repo/event");
31
31
  const paymentService_1 = require("../../repo/paymentService");
@@ -45,7 +45,7 @@ function call(params) {
45
45
  if (!options.executeById) {
46
46
  return;
47
47
  }
48
- const actionRepo = new action_1.ActionRepo(connection);
48
+ const actionRepo = new checkMovieTicket_1.CheckMovieTicketActionRepo(connection);
49
49
  // const transactionProcessRepo = new TransactionProcessRepo(redisClient, { lockExpiresInSeconds: 120 });
50
50
  const paymentServiceId = params.data.object[0]?.id;
51
51
  const credentialsExpireInSeconds = settings.movieticketReserve.credentialsExpireInSeconds;
@@ -56,7 +56,7 @@ function call(params) {
56
56
  ...params.data,
57
57
  sameAs: { id: params.id, typeOf: 'Task' }
58
58
  })({
59
- action: actionRepo,
59
+ checkMovieTicketAction: actionRepo,
60
60
  credentials: new credentials_1.CredentialsRepo(redisClient, {
61
61
  scope: `${factory.service.paymentService.PaymentServiceType.MovieTicket}:${paymentServiceId}`,
62
62
  expireInSeconds: (useCredentialsRepo) ? credentialsExpireInSeconds : 0
@@ -26,7 +26,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
26
26
  exports.call = call;
27
27
  const factory = __importStar(require("../../factory"));
28
28
  const acceptedOffer_1 = require("../../repo/acceptedOffer");
29
- const action_1 = require("../../repo/action");
29
+ const checkThing_1 = require("../../repo/action/checkThing");
30
30
  const assetTransaction_1 = require("../../repo/assetTransaction");
31
31
  const event_1 = require("../../repo/event");
32
32
  const order_1 = require("../../repo/order");
@@ -43,7 +43,7 @@ function call(params) {
43
43
  if (redisClient === undefined) {
44
44
  throw new factory.errors.Argument('settings', 'redisClient required');
45
45
  }
46
- const actionRepo = new action_1.ActionRepo(connection);
46
+ const actionRepo = new checkThing_1.CheckThingActionRepo(connection);
47
47
  const { data } = params;
48
48
  const actionAttributes = {
49
49
  agent: { id: params.project.id, typeOf: factory.organizationType.Project },