@chevre/domain 26.0.0 → 26.1.0-alpha.1

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 (53) hide show
  1. package/lib/chevre/repo/action/acceptCOAOffer.d.ts +8 -0
  2. package/lib/chevre/repo/action/acceptCOAOffer.js +17 -0
  3. package/lib/chevre/repo/action/acceptPay.d.ts +8 -0
  4. package/lib/chevre/repo/action/acceptPay.js +19 -2
  5. package/lib/chevre/repo/action/anyAction/actionProcess.d.ts +12 -21
  6. package/lib/chevre/repo/action/anyAction/actionProcess.js +4 -360
  7. package/lib/chevre/repo/action/anyAction/actionRecipe.d.ts +1 -1
  8. package/lib/chevre/repo/action/authorizeInvoice.js +1 -1
  9. package/lib/chevre/repo/action/authorizeOffer.js +1 -5
  10. package/lib/chevre/repo/action/authorizePaymentMethod.d.ts +8 -0
  11. package/lib/chevre/repo/action/authorizePaymentMethod.js +18 -1
  12. package/lib/chevre/repo/action/checkMovieTicket.d.ts +46 -53
  13. package/lib/chevre/repo/action/checkMovieTicket.js +85 -63
  14. package/lib/chevre/repo/action/dedicatedAction/dedicatedActionProcess.d.ts +46 -0
  15. package/lib/chevre/repo/action/dedicatedAction/dedicatedActionProcess.js +92 -0
  16. package/lib/chevre/repo/action/inform.d.ts +2 -1
  17. package/lib/chevre/repo/action/inform.js +14 -45
  18. package/lib/chevre/repo/action/pay.js +1 -1
  19. package/lib/chevre/repo/action/update.d.ts +8 -6
  20. package/lib/chevre/repo/action/update.js +14 -51
  21. package/lib/chevre/repo/action/use.d.ts +2 -1
  22. package/lib/chevre/repo/action/use.js +14 -45
  23. package/lib/chevre/repo/adminAction.d.ts +1 -1
  24. package/lib/chevre/repo/adminAction.js +27 -1
  25. package/lib/chevre/repo/factory/action/createMongoConditions.d.ts +4 -0
  26. package/lib/chevre/repo/factory/action/createMongoConditions.js +335 -0
  27. package/lib/chevre/repo/mongoose/schemas/action/abstractAction.d.ts +5 -0
  28. package/lib/chevre/repo/mongoose/schemas/action/abstractAction.js +2 -0
  29. package/lib/chevre/repo/mongoose/schemas/action/checkMovieTicket.d.ts +11 -0
  30. package/lib/chevre/repo/mongoose/schemas/action/checkMovieTicket.js +108 -0
  31. package/lib/chevre/service/assetTransaction/pay/check.d.ts +3 -1
  32. package/lib/chevre/service/assetTransaction/pay/start/processAuthorize.d.ts +1 -1
  33. package/lib/chevre/service/assetTransaction/pay/start/processAuthorizeMovieTicket.d.ts +1 -1
  34. package/lib/chevre/service/assetTransaction/pay/start.d.ts +1 -1
  35. package/lib/chevre/service/offer/eventServiceByCOA/findAcceptAction.js +4 -5
  36. package/lib/chevre/service/payment/any/authorize.d.ts +1 -1
  37. package/lib/chevre/service/payment/any/findAcceptAction.js +4 -5
  38. package/lib/chevre/service/payment/any/findAuthorizeAction.js +4 -5
  39. package/lib/chevre/service/payment/any/findCheckAction.d.ts +3 -1
  40. package/lib/chevre/service/payment/any/findCheckAction.js +5 -6
  41. package/lib/chevre/service/payment/movieTicket/authorize.d.ts +1 -1
  42. package/lib/chevre/service/payment/movieTicket/checkMovieTicket.d.ts +3 -1
  43. package/lib/chevre/service/payment/movieTicket/checkMovieTicket.js +3 -3
  44. package/lib/chevre/service/payment/movieTicket/validation.d.ts +3 -1
  45. package/lib/chevre/service/payment/movieTicket/validation.js +13 -43
  46. package/lib/chevre/service/task/acceptCOAOffer.js +4 -5
  47. package/lib/chevre/service/task/authorizePayment.js +5 -6
  48. package/lib/chevre/service/task/checkMovieTicket.js +7 -6
  49. package/lib/chevre/service/task/pay.js +3 -2
  50. package/lib/chevre/service/task/payment/payByTask.d.ts +3 -1
  51. package/lib/chevre/service/task/payment/payByTask.js +1 -1
  52. package/lib/chevre/service/task/publishPaymentUrl.js +4 -5
  53. package/package.json +1 -1
@@ -0,0 +1,108 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.modelName = exports.indexes = void 0;
4
+ exports.createSchema = createSchema;
5
+ const mongoose_1 = require("mongoose");
6
+ const writeConcern_1 = require("../../writeConcern");
7
+ const settings_1 = require("../../../../settings");
8
+ const modelName = 'Action.CheckMovieTicket';
9
+ exports.modelName = modelName;
10
+ const schemaDefinition = {
11
+ project: { type: mongoose_1.SchemaTypes.Mixed, required: true },
12
+ actionStatus: { type: String, required: true },
13
+ typeOf: { type: String, required: true },
14
+ agent: { type: mongoose_1.SchemaTypes.Mixed, required: true },
15
+ object: { type: mongoose_1.SchemaTypes.Mixed, required: true },
16
+ startDate: { type: Date, required: true },
17
+ expires: { type: Date, required: true },
18
+ result: mongoose_1.SchemaTypes.Mixed,
19
+ error: mongoose_1.SchemaTypes.Mixed,
20
+ endDate: Date,
21
+ purpose: mongoose_1.SchemaTypes.Mixed,
22
+ potentialActions: mongoose_1.SchemaTypes.Mixed,
23
+ instrument: mongoose_1.SchemaTypes.Mixed,
24
+ sameAs: mongoose_1.SchemaTypes.Mixed,
25
+ };
26
+ const schemaOptions = {
27
+ autoIndex: settings_1.MONGO_AUTO_INDEX,
28
+ autoCreate: false,
29
+ collection: 'actions.checkMovieTicket',
30
+ id: true,
31
+ read: 'primary',
32
+ writeConcern: writeConcern_1.writeConcern,
33
+ strict: true,
34
+ strictQuery: false,
35
+ timestamps: false,
36
+ versionKey: false,
37
+ toJSON: {
38
+ getters: false,
39
+ virtuals: false,
40
+ minimize: false,
41
+ versionKey: false
42
+ },
43
+ toObject: {
44
+ getters: false,
45
+ virtuals: true,
46
+ minimize: false,
47
+ versionKey: false
48
+ }
49
+ };
50
+ const indexes = [
51
+ [
52
+ { expires: 1 },
53
+ {
54
+ name: 'expires',
55
+ expireAfterSeconds: 0
56
+ }
57
+ ],
58
+ [
59
+ { startDate: -1 },
60
+ { name: 'startDate' }
61
+ ],
62
+ [
63
+ { 'project.id': 1, startDate: -1 },
64
+ { name: 'projectId' }
65
+ ],
66
+ [
67
+ { typeOf: 1, startDate: -1 },
68
+ { name: 'typeOf' }
69
+ ],
70
+ [
71
+ { actionStatus: 1, startDate: -1 },
72
+ { name: 'actionStatus' }
73
+ ],
74
+ [
75
+ { 'sameAs.id': 1, startDate: -1 },
76
+ {
77
+ name: 'sameAsId',
78
+ partialFilterExpression: {
79
+ 'sameAs.id': { $exists: true }
80
+ }
81
+ }
82
+ ],
83
+ [
84
+ { 'purpose.id': 1, startDate: -1 },
85
+ {
86
+ name: 'purposeId',
87
+ partialFilterExpression: {
88
+ 'purpose.id': { $exists: true }
89
+ }
90
+ }
91
+ ],
92
+ ];
93
+ exports.indexes = indexes;
94
+ /**
95
+ * サーフロック認証アクションスキーマ
96
+ */
97
+ let schema;
98
+ function createSchema() {
99
+ if (schema === undefined) {
100
+ schema = new mongoose_1.Schema(schemaDefinition, schemaOptions);
101
+ }
102
+ if (settings_1.MONGO_AUTO_INDEX) {
103
+ indexes.forEach((indexParams) => {
104
+ schema?.index(...indexParams);
105
+ });
106
+ }
107
+ return schema;
108
+ }
@@ -8,7 +8,9 @@ import type { PaymentServiceProviderRepo } from '../../../repo/paymentServicePro
8
8
  import type { SellerPaymentAcceptedRepo } from '../../../repo/sellerPaymentAccepted';
9
9
  import * as MovieTicketPayment from '../../payment/movieTicket';
10
10
  export interface ICheckRepos {
11
- checkMovieTicketAction: CheckMovieTicketActionRepo;
11
+ actions: {
12
+ checkMovieTicket: CheckMovieTicketActionRepo;
13
+ };
12
14
  credentials: CredentialsRepo;
13
15
  event: EventRepo;
14
16
  paymentAccepted: SellerPaymentAcceptedRepo;
@@ -19,8 +19,8 @@ export interface IProcessAuthorizeOperationRepos {
19
19
  actions: {
20
20
  pay: PayActionRepo;
21
21
  refund: RefundActionRepo;
22
+ checkMovieTicket: CheckMovieTicketActionRepo;
22
23
  };
23
- checkMovieTicketAction: CheckMovieTicketActionRepo;
24
24
  authorizeInvoiceAction: AuthorizeInvoiceActionRepo;
25
25
  credentials: CredentialsRepo;
26
26
  event: EventRepo;
@@ -36,8 +36,8 @@ export declare function processAuthorizeMovieTicket(params: factory.assetTransac
36
36
  actions: {
37
37
  pay: PayActionRepo;
38
38
  refund: RefundActionRepo;
39
+ checkMovieTicket: CheckMovieTicketActionRepo;
39
40
  };
40
- checkMovieTicketAction: CheckMovieTicketActionRepo;
41
41
  credentials: CredentialsRepo;
42
42
  event: EventRepo;
43
43
  paymentAccepted: SellerPaymentAcceptedRepo;
@@ -22,8 +22,8 @@ export interface IStartOperationRepos {
22
22
  actions: {
23
23
  pay: PayActionRepo;
24
24
  refund: RefundActionRepo;
25
+ checkMovieTicket: CheckMovieTicketActionRepo;
25
26
  };
26
- checkMovieTicketAction: CheckMovieTicketActionRepo;
27
27
  authorizeInvoiceAction: AuthorizeInvoiceActionRepo;
28
28
  credentials: CredentialsRepo;
29
29
  event: EventRepo;
@@ -43,12 +43,11 @@ function findAcceptAction(params) {
43
43
  break;
44
44
  default: {
45
45
  // タスクがReadyでなければアクション検索
46
- const acceptAction = (await repos.action.searchBySameAs({
47
- sameAs: { id: { $eq: task.id } },
48
- typeOf: { $eq: factory_1.factory.actionType.AcceptAction }
46
+ const acceptAction = (await repos.action.findActionBySameAs({
47
+ sameAs: { id: task.id }
49
48
  // purpose: { id: { $eq: String(params.purpose.id) } }
50
- })).shift();
51
- if (acceptAction !== undefined) {
49
+ }));
50
+ if (typeof acceptAction?.id === 'string') {
52
51
  // purpose検証
53
52
  if (acceptAction.purpose?.id !== params.purpose.id) {
54
53
  throw new factory_1.factory.errors.NotFound('Action');
@@ -31,8 +31,8 @@ interface IAuthorizeRepos {
31
31
  actions: {
32
32
  pay: PayActionRepo;
33
33
  refund: RefundActionRepo;
34
+ checkMovieTicket: CheckMovieTicketActionRepo;
34
35
  };
35
- checkMovieTicketAction: CheckMovieTicketActionRepo;
36
36
  acceptPayAction: AcceptPayActionRepo;
37
37
  authorizeInvoiceAction: AuthorizeInvoiceActionRepo;
38
38
  authorizePaymentMethodAction: AuthorizePaymentMethodActionRepo;
@@ -43,12 +43,11 @@ function findAcceptAction(params) {
43
43
  break;
44
44
  default: {
45
45
  // タスクがReadyでなければアクション検索
46
- const acceptAction = (await repos.acceptPayAction.searchBySameAs({
47
- sameAs: { id: { $eq: task.id } },
48
- typeOf: { $eq: factory_1.factory.actionType.AcceptAction }
46
+ const acceptAction = (await repos.acceptPayAction.findActionBySameAs({
47
+ sameAs: { id: task.id }
49
48
  // purpose: { id: { $eq: String(params.purpose.id) } }
50
- })).shift();
51
- if (acceptAction !== undefined) {
49
+ }));
50
+ if (typeof acceptAction?.id === 'string') {
52
51
  // purpose検証
53
52
  if (acceptAction.purpose?.id !== params.purpose.id) {
54
53
  throw new factory_1.factory.errors.NotFound('Action');
@@ -43,12 +43,11 @@ function findAuthorizeAction(params) {
43
43
  break;
44
44
  default: {
45
45
  // タスクがReadyでなければアクション検索
46
- const authorizeAction = (await repos.authorizePaymentMethodAction.searchBySameAs({
47
- sameAs: { id: { $eq: task.id } },
48
- typeOf: { $eq: factory_1.factory.actionType.AuthorizeAction }
46
+ const authorizeAction = (await repos.authorizePaymentMethodAction.findActionBySameAs({
47
+ sameAs: { id: task.id }
49
48
  // purpose: { id: { $eq: String(params.purpose.id) } }
50
- })).shift();
51
- if (authorizeAction !== undefined) {
49
+ }));
50
+ if (typeof authorizeAction?.id === 'string') {
52
51
  // purpose検証
53
52
  if (authorizeAction.purpose?.id !== params.purpose.id) {
54
53
  throw new factory_1.factory.errors.NotFound('Action');
@@ -2,7 +2,9 @@ import { factory } from '../../../factory';
2
2
  import type { CheckMovieTicketActionRepo, IMinimizedPurchaseNumberAuthResult } from '../../../repo/action/checkMovieTicket';
3
3
  import type { AsyncActionRepo } from '../../../repo/asyncAction';
4
4
  interface IFindCheckActionRepos {
5
- checkMovieTicketAction: CheckMovieTicketActionRepo;
5
+ actions: {
6
+ checkMovieTicket: CheckMovieTicketActionRepo;
7
+ };
6
8
  asyncAction: AsyncActionRepo;
7
9
  }
8
10
  interface IFindCheckActionResult {
@@ -43,18 +43,17 @@ function findCheckAction(params) {
43
43
  break;
44
44
  default: {
45
45
  // タスクがReadyでなければアクション検索
46
- const authorizeAction = (await repos.checkMovieTicketAction.searchBySameAs({
47
- sameAs: { id: { $eq: task.id } },
48
- typeOf: { $eq: factory_1.factory.actionType.CheckAction }
46
+ const authorizeAction = (await repos.actions.checkMovieTicket.findActionBySameAs({
47
+ sameAs: { id: task.id }
49
48
  // purpose: { id: { $eq: String(params.purpose.id) } }
50
- })).shift();
51
- if (authorizeAction !== undefined) {
49
+ }));
50
+ if (typeof authorizeAction?.id === 'string') {
52
51
  // purpose検証
53
52
  if (authorizeAction.purpose?.id !== params.purpose.id) {
54
53
  throw new factory_1.factory.errors.NotFound('Action');
55
54
  }
56
55
  // result from recipe(2024-06-10~)
57
- const purchaseNumberAuthResult = await repos.checkMovieTicketAction.findIMinimizedPurchaseNumberAuthResultByCheckMovieTicketRecipe({
56
+ const purchaseNumberAuthResult = await repos.actions.checkMovieTicket.findIMinimizedPurchaseNumberAuthResultByCheckMovieTicketRecipe({
58
57
  project: { id: params.project.id },
59
58
  recipeFor: { id: authorizeAction.id }
60
59
  });
@@ -42,8 +42,8 @@ declare function authorize(params: factory.assetTransaction.pay.IStartParamsWith
42
42
  actions: {
43
43
  pay: PayActionRepo;
44
44
  refund: RefundActionRepo;
45
+ checkMovieTicket: CheckMovieTicketActionRepo;
45
46
  };
46
- checkMovieTicketAction: CheckMovieTicketActionRepo;
47
47
  accountingReport: AccountingReportRepo;
48
48
  credentials: CredentialsRepo;
49
49
  event: EventRepo;
@@ -8,7 +8,9 @@ import { factory } from '../../../factory';
8
8
  import type { IntegrationSettingRepo as Settings } from '../../../repo/setting/integration';
9
9
  import { ICheckResult } from './processPurchaseNumberAuth';
10
10
  interface ICheckOperationRepos {
11
- checkMovieTicketAction: CheckMovieTicketActionRepo;
11
+ actions: {
12
+ checkMovieTicket: CheckMovieTicketActionRepo;
13
+ };
12
14
  credentials: CredentialsRepo;
13
15
  event: EventRepo;
14
16
  paymentAccepted: SellerPaymentAcceptedRepo;
@@ -42,7 +42,7 @@ function checkMovieTicket(params) {
42
42
  ? { sameAs: { id: params.sameAs.id, typeOf: 'Task' } } // タスク関連付け(2024-05-21~)
43
43
  : undefined
44
44
  };
45
- const action = await repos.checkMovieTicketAction.start(actionAttributes);
45
+ const action = await repos.actions.checkMovieTicket.startCheckMovieTicketAction(actionAttributes);
46
46
  let processPurchaseNumberAuthResult;
47
47
  let recipe;
48
48
  try {
@@ -76,7 +76,7 @@ function checkMovieTicket(params) {
76
76
  // アクション保管用のエラーと両方保管(2024-05-22~)
77
77
  const errors = [(0, errorHandler_1.handleMvtkReserveError)(error), error];
78
78
  try {
79
- await repos.checkMovieTicketAction.giveUp({ typeOf: actionAttributes.typeOf, id: action.id, error: errors });
79
+ await repos.actions.checkMovieTicket.giveUpCheckMovieTicketAction({ typeOf: actionAttributes.typeOf, id: action.id, error: errors });
80
80
  }
81
81
  catch (__) {
82
82
  // 失敗したら仕方ない
@@ -84,7 +84,7 @@ function checkMovieTicket(params) {
84
84
  throw errors[0];
85
85
  }
86
86
  const result = {};
87
- await repos.checkMovieTicketAction.completeWithVoid({ typeOf: actionAttributes.typeOf, id: action.id, result, recipe });
87
+ await repos.actions.checkMovieTicket.completeCheckMovieTicketAction({ typeOf: actionAttributes.typeOf, id: action.id, result, recipe });
88
88
  return { result: processPurchaseNumberAuthResult };
89
89
  };
90
90
  }
@@ -7,7 +7,9 @@ import type { SellerPaymentAcceptedRepo } from '../../../repo/sellerPaymentAccep
7
7
  import type { TaskRepo } from '../../../repo/task';
8
8
  import { factory } from '../../../factory';
9
9
  export interface IValidateMovieTicketRepos {
10
- checkMovieTicketAction: CheckMovieTicketActionRepo;
10
+ actions: {
11
+ checkMovieTicket: CheckMovieTicketActionRepo;
12
+ };
11
13
  credentials: CredentialsRepo;
12
14
  event: EventRepo;
13
15
  paymentAccepted: SellerPaymentAcceptedRepo;
@@ -121,58 +121,28 @@ function checkByIdentifierIfNotYet(params) {
121
121
  }
122
122
  const specifiedCheckedActionId = params.checkedAction?.id;
123
123
  if (typeof specifiedCheckedActionId === 'string' && specifiedCheckedActionId !== '') {
124
- alreadyCheckedAction = (await repos.checkMovieTicketAction.findCompletedCheckActions({
125
- // limit: 1,
126
- // page: 1,
127
- // id: { $in: [specifiedCheckedActionId] },
124
+ alreadyCheckedAction = await repos.actions.checkMovieTicket.findCompletedCheckMovieTicketAction({
128
125
  id: specifiedCheckedActionId,
129
- // actionStatus: { $in: [factory.actionStatusType.CompletedActionStatus] },
130
- // ...(typeof placeOrderId === 'string') ? { purpose: { id: { $in: [placeOrderId] } } } : undefined
131
- ...(typeof placeOrderId === 'string') ? { purpose: { id: placeOrderId } } : undefined
132
- })).shift();
133
- if (alreadyCheckedAction === undefined) {
126
+ purpose: { id: placeOrderId }
127
+ });
128
+ if (typeof alreadyCheckedAction?.id !== 'string') {
134
129
  throw new factory_1.factory.errors.NotFound(factory_1.factory.actionType.CheckAction);
135
130
  }
136
131
  }
137
132
  else {
138
133
  // 認証IDの未指定ケースは廃止(2026-03-21~)
139
134
  throw new factory_1.factory.errors.ArgumentNull('checkedAction.id');
140
- // // 認証IDの未指定ケースがあるかどうか確認するためにlog
141
- // console.log('checkByIdentifierIfNotYet: specifiedCheckedActionId undefined. params:', JSON.stringify(params));
142
- // alreadyCheckedAction = (await repos.checkMovieTicketAction.findCompletedCheckActions(
143
- // {
144
- // // limit: 1,
145
- // // page: 1,
146
- // sort: { startDate: factory.sortType.Descending },
147
- // // typeOf: { $eq: factory.actionType.CheckAction },
148
- // // actionStatus: { $in: [factory.actionStatusType.CompletedActionStatus] },
149
- // object: {
150
- // typeOf: { $eq: factory.service.paymentService.PaymentServiceType.MovieTicket },
151
- // id: { $eq: params.paymentServiceId }, // 指定の決済サービスにおいて
152
- // movieTickets: {
153
- // identifier: { $eq: params.movieTicketIdentifier }, // 指定の決済カードコードを
154
- // serviceOutput: {
155
- // reservationFor: { id: { $eq: params.screeningEvent.id } } // 指定のイベントにおいて
156
- // }
157
- // }
158
- // },
159
- // // ...(typeof placeOrderId === 'string') ? { purpose: { id: { $in: [placeOrderId] } } } : undefined
160
- // ...(typeof placeOrderId === 'string') ? { purpose: { id: placeOrderId } } : undefined
161
- // }
162
- // )).shift();
163
135
  }
164
136
  debug('checkByIdentifierIfNotYet: alreadyCheckedAction:', JSON.stringify(alreadyCheckedAction), 'params:', JSON.stringify(params));
165
- if (alreadyCheckedAction !== undefined) {
166
- const recipe = await repos.checkMovieTicketAction.findRecipeByAction({
167
- project: { id: params.screeningEvent.project.id },
168
- recipeFor: { id: alreadyCheckedAction.id }
169
- });
170
- const directionPurchaseNumberAuth = recipe?.step[0]?.itemListElement[0]?.itemListElement[0];
171
- if (directionPurchaseNumberAuth !== undefined) {
172
- const { beforeMedia, afterMedia } = directionPurchaseNumberAuth;
173
- if (beforeMedia !== undefined && afterMedia !== undefined) {
174
- checkResult = { purchaseNumberAuthIn: beforeMedia, purchaseNumberAuthResult: afterMedia };
175
- }
137
+ const recipe = await repos.actions.checkMovieTicket.findRecipeByAction({
138
+ project: { id: params.screeningEvent.project.id },
139
+ recipeFor: { id: alreadyCheckedAction.id }
140
+ });
141
+ const directionPurchaseNumberAuth = recipe?.step[0]?.itemListElement[0]?.itemListElement[0];
142
+ if (directionPurchaseNumberAuth !== undefined) {
143
+ const { beforeMedia, afterMedia } = directionPurchaseNumberAuth;
144
+ if (beforeMedia !== undefined && afterMedia !== undefined) {
145
+ checkResult = { purchaseNumberAuthIn: beforeMedia, purchaseNumberAuthResult: afterMedia };
176
146
  }
177
147
  }
178
148
  if (checkResult === undefined) {
@@ -103,11 +103,10 @@ function call(params) {
103
103
  catch (error) {
104
104
  let throwsError = true;
105
105
  // アクションが存在すればタスクを実行済扱いにする
106
- const action = (await actionRepo.searchBySameAs({
107
- sameAs: { id: { $eq: params.id } },
108
- purpose: { id: { $eq: params.data.purpose.id } },
109
- typeOf: { $eq: factory_1.factory.actionType.AcceptAction }
110
- })).shift();
106
+ const action = (await actionRepo.findActionBySameAs({
107
+ sameAs: { id: params.id },
108
+ purpose: { id: params.data.purpose.id }
109
+ }));
111
110
  if (typeof action?.id === 'string') {
112
111
  throwsError = false;
113
112
  }
@@ -57,8 +57,8 @@ function call(params) {
57
57
  actions: {
58
58
  pay: new pay_1.PayActionRepo(connection),
59
59
  refund: new refund_1.RefundActionRepo(connection),
60
+ checkMovieTicket: new checkMovieTicket_1.CheckMovieTicketActionRepo(connection),
60
61
  },
61
- checkMovieTicketAction: new checkMovieTicket_1.CheckMovieTicketActionRepo(connection),
62
62
  acceptPayAction: new acceptPay_1.AcceptPayActionRepo(connection),
63
63
  authorizeInvoiceAction: new authorizeInvoice_1.AuthorizeInvoiceActionRepo(connection),
64
64
  authorizePaymentMethodAction: authorizePaymentMethodActionRepo,
@@ -89,11 +89,10 @@ function call(params) {
89
89
  catch (error) {
90
90
  let throwsError = true;
91
91
  // アクションが存在すればタスクを実行済扱いにする
92
- const action = (await authorizePaymentMethodActionRepo.searchBySameAs({
93
- sameAs: { id: { $eq: params.id } },
94
- purpose: { id: { $eq: params.data.purpose.id } },
95
- typeOf: { $eq: factory_1.factory.actionType.AuthorizeAction }
96
- })).shift();
92
+ const action = (await authorizePaymentMethodActionRepo.findActionBySameAs({
93
+ sameAs: { id: params.id },
94
+ purpose: { id: params.data.purpose.id }
95
+ }));
97
96
  if (typeof action?.id === 'string') {
98
97
  throwsError = false;
99
98
  }
@@ -29,7 +29,9 @@ function call(params) {
29
29
  ...params.data,
30
30
  sameAs: { id: params.id, typeOf: 'Task' }
31
31
  })({
32
- checkMovieTicketAction: actionRepo,
32
+ actions: {
33
+ checkMovieTicket: actionRepo,
34
+ },
33
35
  credentials: new credentials_1.CredentialsRepo(redisClient, {
34
36
  scope: `${factory_1.factory.service.paymentService.PaymentServiceType.MovieTicket}:${paymentServiceId}`,
35
37
  expireInSeconds: (useCredentialsRepo) ? credentialsExpireInSeconds : 0
@@ -43,13 +45,12 @@ function call(params) {
43
45
  catch (error) {
44
46
  let throwsError = true;
45
47
  // アクションが存在すればタスクを実行済扱いにする
46
- const action = (await actionRepo.searchBySameAs({
47
- sameAs: { id: { $eq: params.id } },
48
- typeOf: { $eq: factory_1.factory.actionType.CheckAction },
48
+ const action = (await actionRepo.findActionBySameAs({
49
+ sameAs: { id: params.id },
49
50
  ...(typeof params.data.purpose?.id === 'string')
50
- ? { purpose: { id: { $eq: params.data.purpose.id } } }
51
+ ? { purpose: { id: params.data.purpose.id } }
51
52
  : undefined
52
- })).shift();
53
+ }));
53
54
  if (typeof action?.id === 'string') {
54
55
  throwsError = false;
55
56
  }
@@ -32,8 +32,9 @@ function call(params) {
32
32
  ...params.data,
33
33
  sameAs: { id: params.id, typeOf: 'Task' } // タスクIDを関連付け(2024-04-20~)
34
34
  })({
35
- // action: new ActionRepo(connection),
36
- checkMovieTicketAction: new checkMovieTicket_1.CheckMovieTicketActionRepo(connection),
35
+ actions: {
36
+ checkMovieTicket: new checkMovieTicket_1.CheckMovieTicketActionRepo(connection),
37
+ },
37
38
  acceptedOffer: new acceptedOffer_1.AcceptedOfferRepo(connection),
38
39
  assetTransaction: new assetTransaction_1.AssetTransactionRepo(connection),
39
40
  order: new order_1.OrderRepo(connection)
@@ -16,7 +16,9 @@ import type { TaskRepo } from '../../../repo/task';
16
16
  import { factory } from '../../../factory';
17
17
  import type { IntegrationSettingRepo as Settings } from '../../../repo/setting/integration';
18
18
  interface IPayTask2payActionAttributesRepos {
19
- checkMovieTicketAction: CheckMovieTicketActionRepo;
19
+ actions: {
20
+ checkMovieTicket: CheckMovieTicketActionRepo;
21
+ };
20
22
  acceptedOffer: AcceptedOfferRepo;
21
23
  assetTransaction: AssetTransactionRepo;
22
24
  order: OrderRepo;
@@ -133,7 +133,7 @@ function payTask2payActionAttributes(params) {
133
133
  let checkResult;
134
134
  const checkedActionId = transaction.object.checkedAction?.id;
135
135
  if (typeof checkedActionId === 'string' && checkedActionId !== '') {
136
- const recipe = await repos.checkMovieTicketAction.findRecipeByAction({
136
+ const recipe = await repos.actions.checkMovieTicket.findRecipeByAction({
137
137
  project: { id: transaction.project.id },
138
138
  recipeFor: { id: checkedActionId }
139
139
  });
@@ -55,11 +55,10 @@ function call(params) {
55
55
  catch (error) {
56
56
  let throwsError = true;
57
57
  // アクションが存在すればタスクを実行済扱いにする
58
- const action = (await actionRepo.searchBySameAs({
59
- sameAs: { id: { $eq: params.id } },
60
- purpose: { id: { $eq: params.data.purpose.id } },
61
- typeOf: { $eq: factory_1.factory.actionType.AcceptAction }
62
- })).shift();
58
+ const action = (await actionRepo.findActionBySameAs({
59
+ sameAs: { id: params.id },
60
+ purpose: { id: params.data.purpose.id }
61
+ }));
63
62
  if (typeof action?.id === 'string') {
64
63
  throwsError = false;
65
64
  }
package/package.json CHANGED
@@ -88,5 +88,5 @@
88
88
  "postversion": "git push origin --tags",
89
89
  "prepublishOnly": "npm run clean && npm run build"
90
90
  },
91
- "version": "26.0.0"
91
+ "version": "26.1.0-alpha.1"
92
92
  }