@chevre/domain 22.2.0-alpha.24 → 22.2.0-alpha.26

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.
@@ -96,8 +96,9 @@ export declare class ActionRepo {
96
96
  }): Promise<IAction<T>>;
97
97
  /**
98
98
  * アクション完了
99
+ * @deprecated use completeWithVoid
99
100
  */
100
- complete<T extends factory.actionType>(params: {
101
+ completeDeprecated<T extends factory.actionType>(params: {
101
102
  typeOf: T;
102
103
  id: string;
103
104
  result: any;
@@ -119,8 +120,9 @@ export declare class ActionRepo {
119
120
  }): Promise<void>;
120
121
  /**
121
122
  * アクション失敗
123
+ * @deprecated use giveUp
122
124
  */
123
- giveUpWithObject(params: {
125
+ giveUpWithObjectDeprecated(params: {
124
126
  typeOf: factory.actionType;
125
127
  id: string;
126
128
  error: Error | Error[];
@@ -222,11 +224,11 @@ export declare class ActionRepo {
222
224
  id: string;
223
225
  };
224
226
  }): Promise<void>;
225
- updateAuthorizeEventOfferAction(params: {
227
+ reCompleteAuthorizeEventOfferAction(params: {
226
228
  id: string;
227
229
  object: factory.action.authorize.offer.eventService.IObject;
228
230
  result: factory.action.authorize.offer.eventService.IResult;
229
- }): Promise<factory.action.authorize.offer.eventService.IAction<factory.service.webAPI.Identifier.COA>>;
231
+ }): Promise<void>;
230
232
  updateById(params: {
231
233
  id: string;
232
234
  update: any;
@@ -518,8 +518,9 @@ class ActionRepo {
518
518
  }
519
519
  /**
520
520
  * アクション完了
521
+ * @deprecated use completeWithVoid
521
522
  */
522
- complete(params) {
523
+ completeDeprecated(params) {
523
524
  var _a;
524
525
  return __awaiter(this, void 0, void 0, function* () {
525
526
  if (((_a = params.recipe) === null || _a === void 0 ? void 0 : _a.typeOf) === 'Recipe') {
@@ -599,8 +600,9 @@ class ActionRepo {
599
600
  }
600
601
  /**
601
602
  * アクション失敗
603
+ * @deprecated use giveUp
602
604
  */
603
- giveUpWithObject(params) {
605
+ giveUpWithObjectDeprecated(params) {
604
606
  return __awaiter(this, void 0, void 0, function* () {
605
607
  const actionError = (Array.isArray(params.error))
606
608
  ? params.error.map((e) => (Object.assign(Object.assign({}, e), { message: e.message, name: e.name })))
@@ -821,7 +823,7 @@ class ActionRepo {
821
823
  .exec();
822
824
  });
823
825
  }
824
- updateAuthorizeEventOfferAction(params) {
826
+ reCompleteAuthorizeEventOfferAction(params) {
825
827
  return __awaiter(this, void 0, void 0, function* () {
826
828
  return this.actionModel.findOneAndUpdate({
827
829
  // typeOf: factory.actionType.AuthorizeAction,
@@ -836,13 +838,13 @@ class ActionRepo {
836
838
  result: params.result,
837
839
  endDate: new Date()
838
840
  }
839
- }, { new: true })
841
+ }, { new: true, projection: { _id: 1 } })
842
+ .lean()
840
843
  .exec()
841
844
  .then((doc) => {
842
845
  if (doc === null) {
843
846
  throw new factory.errors.NotFound(this.actionModel.modelName);
844
847
  }
845
- return doc.toObject();
846
848
  });
847
849
  });
848
850
  }
@@ -608,7 +608,7 @@ function createScreeningEventSeriesFromCOA(params) {
608
608
  };
609
609
  }
610
610
  function createScreeningEventSeriesAdditionalPropertyFromCOA(params) {
611
- const coaInfo = Object.assign(Object.assign({ titleBranchNum: params.filmFromCOA.titleBranchNum, kbnEirin: params.eirinKubuns.filter((k) => k.kubunCode === params.filmFromCOA.kbnEirin)[0], kbnEizou: params.eizouKubuns.filter((k) => k.kubunCode === params.filmFromCOA.kbnEizou)[0], kbnJoueihousiki: params.joueihousikiKubuns.filter((k) => k.kubunCode === params.filmFromCOA.kbnJoueihousiki)[0], kbnJimakufukikae: params.jimakufukikaeKubuns.filter((k) => k.kubunCode === params.filmFromCOA.kbnJimakufukikae)[0], flgMvtkUse: params.filmFromCOA.flgMvtkUse, dateMvtkBegin: params.filmFromCOA.dateMvtkBegin }, (typeof params.filmFromCOA.flgMgtkUse === 'string') ? { flgMgtkUse: params.filmFromCOA.flgMgtkUse } : undefined), (typeof params.filmFromCOA.dateMgtkBegin === 'string') ? { dateMgtkBegin: params.filmFromCOA.dateMgtkBegin } : undefined);
611
+ const coaInfo = Object.assign(Object.assign(Object.assign({ titleBranchNum: params.filmFromCOA.titleBranchNum, kbnEirin: params.eirinKubuns.filter((k) => k.kubunCode === params.filmFromCOA.kbnEirin)[0], kbnEizou: params.eizouKubuns.filter((k) => k.kubunCode === params.filmFromCOA.kbnEizou)[0], kbnJoueihousiki: params.joueihousikiKubuns.filter((k) => k.kubunCode === params.filmFromCOA.kbnJoueihousiki)[0], kbnJimakufukikae: params.jimakufukikaeKubuns.filter((k) => k.kubunCode === params.filmFromCOA.kbnJimakufukikae)[0], flgMvtkUse: params.filmFromCOA.flgMvtkUse, dateMvtkBegin: params.filmFromCOA.dateMvtkBegin }, (typeof params.filmFromCOA.flgMgtkUse === 'string') ? { flgMgtkUse: params.filmFromCOA.flgMgtkUse } : undefined), (typeof params.filmFromCOA.dateMgtkBegin === 'string') ? { dateMgtkBegin: params.filmFromCOA.dateMgtkBegin } : undefined), (typeof params.filmFromCOA.flgNotDiscount === 'string') ? { flgNotDiscount: params.filmFromCOA.flgNotDiscount } : undefined);
612
612
  return {
613
613
  coaInfo,
614
614
  additionalProperty: [
@@ -86,5 +86,7 @@ declare function authorize(params: {
86
86
  */
87
87
  id: string;
88
88
  };
89
- }, options: IAuthorizeOptions): IAuthorizeOperation<IAuthorizeOfferAction>;
89
+ }, options: IAuthorizeOptions): IAuthorizeOperation<Pick<IAuthorizeOfferAction, 'id'> & {
90
+ result: IAuthorizeOfferAction['result'];
91
+ }>;
90
92
  export { authorize };
@@ -67,7 +67,8 @@ function authorize(params, options) {
67
67
  throw error;
68
68
  }
69
69
  const result = (0, factory_1.acceptedOffers2authorizeResult)({ acceptedOffers, acceptedOffers4result, noOfferSpecified, ticketOffers });
70
- return yield repos.action.complete({ typeOf: action.typeOf, id: action.id, result: result });
70
+ yield repos.action.completeWithVoid({ typeOf: action.typeOf, id: action.id, result: result });
71
+ return { id: action.id, result };
71
72
  });
72
73
  }
73
74
  exports.authorize = authorize;
@@ -57,4 +57,6 @@ export declare function authorize(params: {
57
57
  responseBody: IResponseBody;
58
58
  };
59
59
  options: {};
60
- }): IAuthorizeOperation<IAuthorizeOfferAction>;
60
+ }): IAuthorizeOperation<Pick<IAuthorizeOfferAction, 'id' | 'instrument'> & {
61
+ result: IAuthorizeOfferAction['result'];
62
+ }>;
@@ -139,7 +139,12 @@ function authorize(params) {
139
139
  }
140
140
  throw error;
141
141
  }
142
- return yield repos.action.complete({ typeOf: action.typeOf, id: action.id, result });
142
+ yield repos.action.completeWithVoid({ typeOf: action.typeOf, id: action.id, result });
143
+ return {
144
+ id: action.id,
145
+ instrument: actionAttributes.instrument,
146
+ result
147
+ };
143
148
  });
144
149
  }
145
150
  exports.authorize = authorize;
@@ -26,5 +26,7 @@ export declare function authorizeByAcceptAction(params: {
26
26
  */
27
27
  id: string;
28
28
  };
29
- }): IAuthorizeOperation<IAuthorizeOfferAction>;
29
+ }): IAuthorizeOperation<Pick<IAuthorizeOfferAction, 'id' | 'instrument'> & {
30
+ result: IAuthorizeOfferAction['result'];
31
+ }>;
30
32
  export {};
@@ -20,4 +20,6 @@ export declare function changeOffers(params: {
20
20
  id: string;
21
21
  };
22
22
  options: {};
23
- }): IAuthorizeOperation<IAuthorizeOfferAction>;
23
+ }): IAuthorizeOperation<Pick<IAuthorizeOfferAction, 'id' | 'instrument'> & {
24
+ result: IAuthorizeOfferAction['result'];
25
+ }>;
@@ -40,6 +40,9 @@ function changeOffers(params) {
40
40
  if (authorizeAction.purpose.typeOf !== transaction.typeOf || authorizeAction.purpose.id !== transaction.id) {
41
41
  throw new factory.errors.Argument('Transaction', 'Action not found in the transaction');
42
42
  }
43
+ if (authorizeAction.result === undefined) {
44
+ throw new factory.errors.NotFound('authorizeAction.result');
45
+ }
43
46
  const originalAcceptActionId = authorizeAction.object.id;
44
47
  if (typeof originalAcceptActionId !== 'string' || originalAcceptActionId === '') {
45
48
  throw new factory.errors.NotFound('authorizeAction.object.id');
@@ -153,12 +156,17 @@ function changeOffers(params) {
153
156
  }
154
157
  throw error;
155
158
  }
156
- // 座席予約承認アクションの供給情報を変更する
157
- return repos.action.updateAuthorizeEventOfferAction({
159
+ // 承認アクションを再完了
160
+ yield repos.action.reCompleteAuthorizeEventOfferAction({
158
161
  id: params.id,
159
162
  object: authorizeAction.object,
160
163
  result: actionResult
161
164
  });
165
+ return {
166
+ id: params.id,
167
+ instrument: authorizeAction.instrument,
168
+ result: actionResult
169
+ };
162
170
  });
163
171
  }
164
172
  exports.changeOffers = changeOffers;
@@ -93,7 +93,9 @@ export declare function authorize(params: {
93
93
  transaction: {
94
94
  id: string;
95
95
  };
96
- }): IAuthorizeOperation<IAuthorizeOfferAction>;
96
+ }): IAuthorizeOperation<Pick<IAuthorizeOfferAction, 'id'> & {
97
+ result: IAuthorizeOfferAction['result'];
98
+ }>;
97
99
  export declare function voidTransaction(params: factory.task.IData<factory.taskName.VoidRegisterServiceTransaction>): (repos: {
98
100
  action: ActionRepo;
99
101
  assetTransaction: AssetTransactionRepo;
@@ -127,7 +127,6 @@ function authorize(params) {
127
127
  const { transactionNumber } = yield repos.transactionNumber.publishByTimestamp({
128
128
  startDate: new Date()
129
129
  });
130
- // 承認アクション開始
131
130
  const actionAttributes = (0, factory_1.createActionAttributes)({
132
131
  acceptedOffer: acceptedOffer,
133
132
  transaction: transaction,
@@ -164,7 +163,8 @@ function authorize(params) {
164
163
  }
165
164
  throw error;
166
165
  }
167
- return yield repos.action.complete({ typeOf: action.typeOf, id: action.id, result: result });
166
+ yield repos.action.completeWithVoid({ typeOf: action.typeOf, id: action.id, result: result });
167
+ return { id: action.id, result };
168
168
  });
169
169
  }
170
170
  exports.authorize = authorize;
@@ -33,4 +33,4 @@ export declare function createAuthorizeResult(params: {
33
33
  /**
34
34
  * 通知対象としてのアクションを最適化
35
35
  */
36
- export declare function optimizeAction4inform(action: factory.action.trade.pay.IAction | factory.action.trade.refund.IAction): IOnPaymentStatusChangedParams;
36
+ export declare function optimizeAction4inform(action: Pick<factory.action.trade.pay.IAction, 'id' | 'object' | 'project' | 'typeOf'> | Pick<factory.action.trade.refund.IAction, 'id' | 'object' | 'project' | 'typeOf'>): IOnPaymentStatusChangedParams;
@@ -8,7 +8,7 @@ import type { TaskRepo } from '../../../repo/task';
8
8
  /**
9
9
  * 決済後のアクション
10
10
  */
11
- declare function onPaid(payAction: factory.action.trade.pay.IAction): (repos: {
11
+ declare function onPaid(payAction: Pick<factory.action.trade.pay.IAction, 'actionStatus' | 'id' | 'object' | 'potentialActions' | 'project' | 'purpose' | 'typeOf'>): (repos: {
12
12
  action: ActionRepo;
13
13
  accountingReport: AccountingReportRepo;
14
14
  task: TaskRepo;
@@ -8,7 +8,7 @@ import type { TaskRepo } from '../../../repo/task';
8
8
  /**
9
9
  * 返金後のアクション
10
10
  */
11
- declare function onRefund(refundAction: factory.action.trade.refund.IAction): (repos: {
11
+ declare function onRefund(refundAction: Pick<factory.action.trade.refund.IAction, 'actionStatus' | 'id' | 'object' | 'potentialActions' | 'project' | 'purpose' | 'typeOf'>): (repos: {
12
12
  action: ActionRepo;
13
13
  accountingReport: AccountingReportRepo;
14
14
  task: TaskRepo;
@@ -38,8 +38,7 @@ function payCreditCard(params) {
38
38
  throw new factory.errors.ArgumentNull('recipient.id');
39
39
  }
40
40
  const { shopId, shopPass } = yield (0, getGMOInfoFromSeller_1.getGMOInfoFromSeller)({ paymentMethodType, seller: { id: sellerId }, paymentServiceId })(repos);
41
- // アクション開始
42
- let action = yield repos.action.start(params);
41
+ const action = yield repos.action.start(params);
43
42
  const alterTranResults = [];
44
43
  const processAlterTranResults = [];
45
44
  let recipe;
@@ -80,8 +79,16 @@ function payCreditCard(params) {
80
79
  const actionResult = {
81
80
  // creditCardSales: alterTranResults // discontinue(2024-06-10~)
82
81
  };
83
- action = (yield repos.action.complete({ typeOf: action.typeOf, id: action.id, result: actionResult, recipe }));
84
- yield (0, onPaid_1.onPaid)(action)(repos);
82
+ yield repos.action.completeWithVoid({ typeOf: action.typeOf, id: action.id, result: actionResult, recipe });
83
+ yield (0, onPaid_1.onPaid)({
84
+ actionStatus: factory.actionStatusType.CompletedActionStatus,
85
+ id: action.id,
86
+ object: action.object,
87
+ potentialActions: action.potentialActions,
88
+ project: action.project,
89
+ purpose: action.purpose,
90
+ typeOf: action.typeOf
91
+ })(repos);
85
92
  return action;
86
93
  });
87
94
  }
@@ -29,6 +29,7 @@ const getGMOInfoFromSeller_1 = require("./getGMOInfoFromSeller");
29
29
  /**
30
30
  * クレジットカード返金
31
31
  */
32
+ // tslint:disable-next-line:max-func-body-length
32
33
  function refundCreditCard(params, options) {
33
34
  return (repos, settings) => __awaiter(this, void 0, void 0, function* () {
34
35
  var _a, _b, _c, _d, _e, _f, _g, _h;
@@ -59,7 +60,7 @@ function refundCreditCard(params, options) {
59
60
  id: paymentServiceId
60
61
  });
61
62
  const { sameAs } = params, startingActionParams = __rest(params, ["sameAs"]);
62
- let action = yield repos.action.start(Object.assign(Object.assign({}, startingActionParams), (typeof ((_g = params.sameAs) === null || _g === void 0 ? void 0 : _g.id) === 'string') ? { sameAs: { id: params.sameAs.id, typeOf: 'Task' } } : undefined));
63
+ const action = yield repos.action.start(Object.assign(Object.assign({}, startingActionParams), (typeof ((_g = params.sameAs) === null || _g === void 0 ? void 0 : _g.id) === 'string') ? { sameAs: { id: params.sameAs.id, typeOf: 'Task' } } : undefined));
63
64
  const alterTranResult = [];
64
65
  let processAlterTranResult;
65
66
  let recipe;
@@ -97,8 +98,17 @@ function refundCreditCard(params, options) {
97
98
  throw error;
98
99
  }
99
100
  const actionResult = {}; // optimize(2024-06-10~)
100
- action = (yield repos.action.complete({ typeOf: action.typeOf, id: action.id, result: actionResult, recipe })); // add recipe(2024-06-04~)
101
- yield (0, onRefund_1.onRefund)(action)(repos);
101
+ // add recipe(2024-06-04~)
102
+ yield repos.action.completeWithVoid({ typeOf: action.typeOf, id: action.id, result: actionResult, recipe });
103
+ yield (0, onRefund_1.onRefund)({
104
+ actionStatus: factory.actionStatusType.CompletedActionStatus,
105
+ id: action.id,
106
+ object: action.object,
107
+ potentialActions: action.potentialActions,
108
+ project: action.project,
109
+ purpose: action.purpose,
110
+ typeOf: action.typeOf
111
+ })(repos);
102
112
  // return action;
103
113
  });
104
114
  }
@@ -10,6 +10,10 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
10
10
  };
11
11
  Object.defineProperty(exports, "__esModule", { value: true });
12
12
  exports.voidTransaction = exports.refundFaceToFace = exports.payFaceToFace = void 0;
13
+ /**
14
+ * 対面決済サービス
15
+ */
16
+ const factory = require("../../factory");
13
17
  const onPaid_1 = require("./any/onPaid");
14
18
  const onRefund_1 = require("./any/onRefund");
15
19
  function voidTransaction(__) {
@@ -20,8 +24,7 @@ function voidTransaction(__) {
20
24
  exports.voidTransaction = voidTransaction;
21
25
  function payFaceToFace(params) {
22
26
  return (repos) => __awaiter(this, void 0, void 0, function* () {
23
- // アクション開始
24
- let action = yield repos.action.start(params);
27
+ const action = yield repos.action.start(params);
25
28
  try {
26
29
  // no op
27
30
  }
@@ -34,17 +37,24 @@ function payFaceToFace(params) {
34
37
  }
35
38
  throw error;
36
39
  }
37
- // アクション完了
38
40
  const actionResult = {};
39
- action = (yield repos.action.complete({ typeOf: action.typeOf, id: action.id, result: actionResult }));
40
- yield (0, onPaid_1.onPaid)(action)(repos);
41
+ yield repos.action.completeWithVoid({ typeOf: action.typeOf, id: action.id, result: actionResult });
42
+ yield (0, onPaid_1.onPaid)({
43
+ actionStatus: factory.actionStatusType.CompletedActionStatus,
44
+ id: action.id,
45
+ object: action.object,
46
+ potentialActions: action.potentialActions,
47
+ project: action.project,
48
+ purpose: action.purpose,
49
+ typeOf: action.typeOf
50
+ })(repos);
41
51
  return action;
42
52
  });
43
53
  }
44
54
  exports.payFaceToFace = payFaceToFace;
45
55
  function refundFaceToFace(params) {
46
56
  return (repos) => __awaiter(this, void 0, void 0, function* () {
47
- let action = yield repos.action.start(params);
57
+ const action = yield repos.action.start(params);
48
58
  try {
49
59
  // no op
50
60
  }
@@ -58,8 +68,16 @@ function refundFaceToFace(params) {
58
68
  throw error;
59
69
  }
60
70
  const actionResult = {};
61
- action = (yield repos.action.complete({ typeOf: action.typeOf, id: action.id, result: actionResult }));
62
- yield (0, onRefund_1.onRefund)(action)(repos);
71
+ yield repos.action.completeWithVoid({ typeOf: action.typeOf, id: action.id, result: actionResult });
72
+ yield (0, onRefund_1.onRefund)({
73
+ actionStatus: factory.actionStatusType.CompletedActionStatus,
74
+ id: action.id,
75
+ object: action.object,
76
+ potentialActions: action.potentialActions,
77
+ project: action.project,
78
+ purpose: action.purpose,
79
+ typeOf: action.typeOf
80
+ })(repos);
63
81
  return action;
64
82
  });
65
83
  }
@@ -31,7 +31,7 @@ function payMovieTicket(params) {
31
31
  processSeatInfoSyncResult: { seatInfoSyncIn },
32
32
  project: { id: params.project.id }
33
33
  });
34
- let action = yield repos.action.start(startingAction, { recipe });
34
+ const action = yield repos.action.start(startingAction, { recipe });
35
35
  let processSeatInfoSyncResult;
36
36
  try {
37
37
  // 着券済に対する冪等性を確保する必要はあるが、
@@ -91,8 +91,16 @@ function payMovieTicket(params) {
91
91
  // ? { seatInfoSyncResult: <factory.action.trade.pay.ISeatInfoSyncResult>seatInfoSyncResult }
92
92
  // : undefined
93
93
  };
94
- action = (yield repos.action.complete({ typeOf: action.typeOf, id: action.id, result, recipe }));
95
- yield (0, onPaid_1.onPaid)(action)(repos);
94
+ yield repos.action.completeWithVoid({ typeOf: action.typeOf, id: action.id, result, recipe });
95
+ yield (0, onPaid_1.onPaid)({
96
+ actionStatus: factory.actionStatusType.CompletedActionStatus,
97
+ id: action.id,
98
+ object: action.object,
99
+ potentialActions: action.potentialActions,
100
+ project: action.project,
101
+ purpose: action.purpose,
102
+ typeOf: action.typeOf
103
+ })(repos);
96
104
  return action;
97
105
  });
98
106
  }
@@ -58,7 +58,7 @@ function refundMovieTicket(params) {
58
58
  const refundActionAttributes = Object.assign({ agent, object, potentialActions, project, purpose, recipient, typeOf }, (typeof (sameAs === null || sameAs === void 0 ? void 0 : sameAs.id) === 'string') ? { sameAs: { id: sameAs.id, typeOf: 'Task' } } : undefined
59
59
  // instrument // discontinue(2024-06-10~)
60
60
  );
61
- let action = yield repos.action.start(refundActionAttributes, { recipe });
61
+ const action = yield repos.action.start(refundActionAttributes, { recipe });
62
62
  let processSeatInfoSyncCancelResult;
63
63
  let processSeatInfoSyncResult;
64
64
  try {
@@ -92,8 +92,10 @@ function refundMovieTicket(params) {
92
92
  }
93
93
  // アクションとしてはFailedだが後続処理を実行するケースに対応(2024-03-21~)
94
94
  const seatInfoSyncResultAsError = processSeatInfoSyncResult === null || processSeatInfoSyncResult === void 0 ? void 0 : processSeatInfoSyncResult.seatInfoSyncResultAsError;
95
+ let actionStatus;
95
96
  if (seatInfoSyncResultAsError !== undefined) {
96
- action = (yield repos.action.giveUpWithObject({ typeOf: action.typeOf, id: action.id, error: seatInfoSyncResultAsError }));
97
+ yield repos.action.giveUp({ typeOf: action.typeOf, id: action.id, error: seatInfoSyncResultAsError });
98
+ actionStatus = factory.actionStatusType.FailedActionStatus;
97
99
  }
98
100
  else {
99
101
  // add recipe(2024-06-04~)
@@ -107,9 +109,18 @@ function refundMovieTicket(params) {
107
109
  // ? { seatInfoSyncCancelResult: processSeatInfoSyncCancelResult.seatInfoSyncCancelResult }
108
110
  // : undefined
109
111
  };
110
- action = (yield repos.action.complete({ typeOf: action.typeOf, id: action.id, result: actionResult, recipe }));
112
+ yield repos.action.completeWithVoid({ typeOf: action.typeOf, id: action.id, result: actionResult, recipe });
113
+ actionStatus = factory.actionStatusType.CompletedActionStatus;
111
114
  }
112
- yield (0, onRefund_1.onRefund)(action)(repos);
115
+ yield (0, onRefund_1.onRefund)({
116
+ actionStatus,
117
+ id: action.id,
118
+ object: action.object,
119
+ potentialActions: action.potentialActions,
120
+ project: action.project,
121
+ purpose: action.purpose,
122
+ typeOf: action.typeOf
123
+ })(repos);
113
124
  });
114
125
  }
115
126
  exports.refundMovieTicket = refundMovieTicket;
@@ -233,8 +233,7 @@ function payPaymentCard(params) {
233
233
  var _a, _b, _c;
234
234
  const payObject = params.object;
235
235
  const paymentServiceId = payObject[0].id;
236
- // アクション開始
237
- let action = yield repos.action.start(params);
236
+ const action = yield repos.action.start(params);
238
237
  try {
239
238
  const transactionNumber = payObject[0].paymentMethod.paymentMethodId;
240
239
  const availableChannel = yield repos.product.findAvailableChannel({
@@ -265,8 +264,16 @@ function payPaymentCard(params) {
265
264
  }
266
265
  // アクション完了
267
266
  const actionResult = {};
268
- action = (yield repos.action.complete({ typeOf: action.typeOf, id: action.id, result: actionResult }));
269
- yield (0, onPaid_1.onPaid)(action)(repos);
267
+ yield repos.action.completeWithVoid({ typeOf: action.typeOf, id: action.id, result: actionResult });
268
+ yield (0, onPaid_1.onPaid)({
269
+ actionStatus: factory.actionStatusType.CompletedActionStatus,
270
+ id: action.id,
271
+ object: action.object,
272
+ potentialActions: action.potentialActions,
273
+ project: action.project,
274
+ purpose: action.purpose,
275
+ typeOf: action.typeOf
276
+ })(repos);
270
277
  return action;
271
278
  });
272
279
  }
@@ -287,7 +294,7 @@ function refundPaymentCard(params) {
287
294
  if (typeof accountNumber !== 'string') {
288
295
  throw new factory.errors.ArgumentNull('serviceOutput.paymentAccount.accountNumber');
289
296
  }
290
- let action = yield repos.action.start(params);
297
+ const action = yield repos.action.start(params);
291
298
  let accountTransactionNumber4refund;
292
299
  try {
293
300
  const availableChannel = yield repos.product.findAvailableChannel({
@@ -379,8 +386,16 @@ function refundPaymentCard(params) {
379
386
  const result = {
380
387
  accountTransaction: { transactionNumber: accountTransactionNumber4refund }
381
388
  };
382
- action = (yield repos.action.complete({ typeOf: action.typeOf, id: action.id, result }));
383
- yield (0, onRefund_1.onRefund)(action)(repos);
389
+ yield repos.action.completeWithVoid({ typeOf: action.typeOf, id: action.id, result });
390
+ yield (0, onRefund_1.onRefund)({
391
+ actionStatus: factory.actionStatusType.CompletedActionStatus,
392
+ id: action.id,
393
+ object: action.object,
394
+ potentialActions: action.potentialActions,
395
+ project: action.project,
396
+ purpose: action.purpose,
397
+ typeOf: action.typeOf
398
+ })(repos);
384
399
  return action;
385
400
  });
386
401
  }
package/package.json CHANGED
@@ -9,8 +9,8 @@
9
9
  }
10
10
  ],
11
11
  "dependencies": {
12
- "@chevre/factory": "4.382.0-alpha.0",
13
- "@cinerino/sdk": "10.8.0-alpha.0",
12
+ "@chevre/factory": "4.382.0-alpha.1",
13
+ "@cinerino/sdk": "10.8.0-alpha.1",
14
14
  "@motionpicture/coa-service": "9.5.0-alpha.0",
15
15
  "@motionpicture/gmo-service": "5.3.0",
16
16
  "@sendgrid/mail": "6.4.0",
@@ -110,5 +110,5 @@
110
110
  "postversion": "git push origin --tags",
111
111
  "prepublishOnly": "npm run clean && npm run build && npm test && npm run doc"
112
112
  },
113
- "version": "22.2.0-alpha.24"
113
+ "version": "22.2.0-alpha.26"
114
114
  }