@chevre/domain 21.34.0-alpha.3 → 21.34.0-alpha.5

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.
@@ -44,7 +44,7 @@ async function main() {
44
44
  'actionRecipe already exists. step:',
45
45
  actionRecipe.step.length, payAction.project.id, payAction.id, payAction.startDate, i);
46
46
  } else {
47
- const alterTranResultByPayAction = payAction.result?.creditCardSales?.[0];
47
+ const alterTranResultByPayAction = (<any>payAction.result)?.creditCardSales?.[0];
48
48
  console.log(
49
49
  'creating recipe by alterTranResultByPayAction',
50
50
  alterTranResultByPayAction?.tranId,
@@ -10,12 +10,16 @@ async function main() {
10
10
  const actionRepo = await chevre.repository.Action.createInstance(mongoose.connection);
11
11
  const cursor = actionRepo.getCursor(
12
12
  {
13
+ // _id: { $eq: '665c886886e0ee8ff5f7b3c5' },
13
14
  typeOf: { $eq: chevre.factory.actionType.PayAction },
14
15
  actionStatus: { $eq: chevre.factory.actionStatusType.CompletedActionStatus },
15
16
  startDate: {
17
+ $lte: moment()
18
+ // tslint:disable-next-line:no-magic-numbers
19
+ .add(-29, 'days'),
16
20
  $gte: moment()
17
21
  // tslint:disable-next-line:no-magic-numbers
18
- .add(-30, 'days')
22
+ .add(-180, 'days')
19
23
  },
20
24
  'object.typeOf': { $exists: true, $eq: chevre.factory.service.paymentService.PaymentServiceType.MovieTicket }
21
25
  },
@@ -44,8 +48,8 @@ async function main() {
44
48
  'actionRecipe already exists. step:',
45
49
  actionRecipe.step.length, payAction.project.id, payAction.id, payAction.startDate, i);
46
50
  } else {
47
- const seatInfoSyncInByPayAction = payAction.instrument?.seatInfoSyncIn;
48
- const seatInfoSyncResultByPayAction = payAction.result?.seatInfoSyncResult;
51
+ const seatInfoSyncInByPayAction = (<any>payAction.instrument)?.seatInfoSyncIn;
52
+ const seatInfoSyncResultByPayAction = (<any>payAction.result)?.seatInfoSyncResult;
49
53
  console.log(
50
54
  'creating recipe by alterTranResultByPayAction',
51
55
  seatInfoSyncInByPayAction?.stCd,
@@ -10,7 +10,17 @@ async function main() {
10
10
 
11
11
  const actionRepo = await chevre.repository.Action.createInstance(mongoose.connection);
12
12
 
13
- let mkknInfos = await actionRepo.searchMkknInfoByCheckMovieTicketResult({
13
+ // let mkknInfos = await actionRepo.searchMkknInfoByCheckMovieTicketResult({
14
+ // limit: 10,
15
+ // page: 1,
16
+ // id: '666171386c7acb70fd9a44ec',
17
+ // project: { id: project.id },
18
+ // purpose: { id: '6661712a6c7acb70fd9a44a8' }
19
+ // });
20
+ // console.log('mkknInfos found', mkknInfos);
21
+ // console.log(mkknInfos.length, 'infos found');
22
+
23
+ const mkknInfos = await actionRepo.searchMkknInfoByCheckRecipe({
14
24
  limit: 10,
15
25
  page: 1,
16
26
  id: '666171386c7acb70fd9a44ec',
@@ -20,27 +30,17 @@ async function main() {
20
30
  console.log('mkknInfos found', mkknInfos);
21
31
  console.log(mkknInfos.length, 'infos found');
22
32
 
23
- mkknInfos = await actionRepo.searchMkknInfoByCheckRecipe({
24
- limit: 10,
25
- page: 1,
26
- id: '666171386c7acb70fd9a44ec',
27
- project: { id: project.id },
28
- purpose: { id: '6661712a6c7acb70fd9a44a8' }
29
- });
30
- console.log('mkknInfos found', mkknInfos);
31
- console.log(mkknInfos.length, 'infos found');
32
-
33
- let ykknInfos = await actionRepo.searchYkknInfoByCheckMovieTicketResult({
34
- limit: 10,
35
- page: 1,
36
- id: '666171386c7acb70fd9a44ec',
37
- project: { id: project.id },
38
- purpose: { id: '6661712a6c7acb70fd9a44a8' }
39
- });
40
- console.log('ykknInfos found', ykknInfos);
41
- console.log(ykknInfos.length, 'infos found');
42
-
43
- ykknInfos = await actionRepo.searchYkknInfoByCheckRecipe({
33
+ // let ykknInfos = await actionRepo.searchYkknInfoByCheckMovieTicketResult({
34
+ // limit: 10,
35
+ // page: 1,
36
+ // id: '666171386c7acb70fd9a44ec',
37
+ // project: { id: project.id },
38
+ // purpose: { id: '6661712a6c7acb70fd9a44a8' }
39
+ // });
40
+ // console.log('ykknInfos found', ykknInfos);
41
+ // console.log(ykknInfos.length, 'infos found');
42
+
43
+ const ykknInfos = await actionRepo.searchYkknInfoByCheckRecipe({
44
44
  limit: 10,
45
45
  page: 1,
46
46
  id: '666171386c7acb70fd9a44ec',
@@ -239,38 +239,6 @@ export declare class MongoRepository {
239
239
  };
240
240
  entranceGateIdentifier: string;
241
241
  }): Promise<IUseActionCountByOffer[]>;
242
- searchYkknInfoByCheckMovieTicketResult(filter: {
243
- limit: number;
244
- page: number;
245
- /**
246
- * 認証アクションID
247
- */
248
- id: string;
249
- project: {
250
- id: string;
251
- };
252
- purpose: {
253
- id: string;
254
- };
255
- }): Promise<(surfrockFactory.service.auth.purchaseNumberAuth.IValidTicket & {
256
- knyknrNo: string;
257
- })[]>;
258
- searchMkknInfoByCheckMovieTicketResult(filter: {
259
- limit: number;
260
- page: number;
261
- /**
262
- * 認証アクションID
263
- */
264
- id: string;
265
- project: {
266
- id: string;
267
- };
268
- purpose: {
269
- id: string;
270
- };
271
- }): Promise<(surfrockFactory.service.auth.purchaseNumberAuth.INvalidTicket & {
272
- knyknrNo: string;
273
- })[]>;
274
242
  searchYkknInfoByCheckRecipe(filter: {
275
243
  limit: number;
276
244
  page: number;
@@ -10,7 +10,6 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
10
10
  };
11
11
  Object.defineProperty(exports, "__esModule", { value: true });
12
12
  exports.MongoRepository = void 0;
13
- const mongoose_1 = require("mongoose");
14
13
  const factory = require("../factory");
15
14
  const settings_1 = require("../settings");
16
15
  const action_1 = require("./mongoose/schemas/action");
@@ -853,78 +852,104 @@ class MongoRepository {
853
852
  .exec();
854
853
  });
855
854
  }
856
- searchYkknInfoByCheckMovieTicketResult(filter) {
857
- return __awaiter(this, void 0, void 0, function* () {
858
- const filterQuery = {
859
- _id: { $eq: new mongoose_1.Types.ObjectId(filter.id) },
860
- 'project.id': { $eq: filter.project.id },
861
- 'purpose.id': { $exists: true, $eq: filter.purpose.id },
862
- typeOf: { $eq: factory.actionType.CheckAction },
863
- actionStatus: { $eq: factory.actionStatusType.CompletedActionStatus }
864
- };
865
- const projectStage = {
866
- _id: 0,
867
- knyknrNo: '$result.purchaseNumberAuthResult.knyknrNoInfoOut.knyknrNo',
868
- ykknshTyp: '$result.purchaseNumberAuthResult.knyknrNoInfoOut.ykknInfo.ykknshTyp',
869
- eishhshkTyp: '$result.purchaseNumberAuthResult.knyknrNoInfoOut.ykknInfo.eishhshkTyp',
870
- ykknKnshbtsmiNum: '$result.purchaseNumberAuthResult.knyknrNoInfoOut.ykknInfo.ykknKnshbtsmiNum',
871
- knshknhmbiUnip: '$result.purchaseNumberAuthResult.knyknrNoInfoOut.ykknInfo.knshknhmbiUnip',
872
- kijUnip: '$result.purchaseNumberAuthResult.knyknrNoInfoOut.ykknInfo.kijUnip'
873
- };
874
- const aggregate = this.actionModel.aggregate([
875
- { $unwind: '$result.purchaseNumberAuthResult.knyknrNoInfoOut' },
876
- { $unwind: '$result.purchaseNumberAuthResult.knyknrNoInfoOut.ykknInfo' },
877
- { $match: filterQuery },
878
- { $project: projectStage }
879
- ]);
880
- if (typeof filter.limit === 'number' && filter.limit > 0) {
881
- const page = (typeof filter.page === 'number' && filter.page > 0) ? filter.page : 1;
882
- aggregate.limit(filter.limit * page)
883
- .skip(filter.limit * (page - 1));
884
- }
885
- return aggregate
886
- .option({ maxTimeMS: settings_1.MONGO_MAX_TIME_MS })
887
- .exec();
888
- });
889
- }
890
- searchMkknInfoByCheckMovieTicketResult(filter) {
891
- return __awaiter(this, void 0, void 0, function* () {
892
- const filterQuery = {
893
- _id: { $eq: new mongoose_1.Types.ObjectId(filter.id) },
894
- 'project.id': { $eq: filter.project.id },
895
- 'purpose.id': { $exists: true, $eq: filter.purpose.id },
896
- typeOf: { $eq: factory.actionType.CheckAction },
897
- actionStatus: { $eq: factory.actionStatusType.CompletedActionStatus }
898
- };
899
- const projectStage = {
900
- _id: 0,
901
- knyknrNo: '$result.purchaseNumberAuthResult.knyknrNoInfoOut.knyknrNo',
902
- mkknshTyp: '$result.purchaseNumberAuthResult.knyknrNoInfoOut.mkknInfo.mkknshTyp',
903
- mkknKnshbtsmiNum: '$result.purchaseNumberAuthResult.knyknrNoInfoOut.mkknInfo.mkknKnshbtsmiNum',
904
- mkjyTyp: '$result.purchaseNumberAuthResult.knyknrNoInfoOut.mkknInfo.mkjyTyp',
905
- yykDt: '$result.purchaseNumberAuthResult.knyknrNoInfoOut.mkknInfo.yykDt',
906
- shyJeiDt: '$result.purchaseNumberAuthResult.knyknrNoInfoOut.mkknInfo.shyJeiDt',
907
- shyStCd: '$result.purchaseNumberAuthResult.knyknrNoInfoOut.mkknInfo.shyStCd',
908
- shyScrnCd: '$result.purchaseNumberAuthResult.knyknrNoInfoOut.mkknInfo.shyScrnCd',
909
- shySkhnCd: '$result.purchaseNumberAuthResult.knyknrNoInfoOut.mkknInfo.shySkhnCd',
910
- shySkhnNm: '$result.purchaseNumberAuthResult.knyknrNoInfoOut.mkknInfo.shySkhnNm'
911
- };
912
- const aggregate = this.actionModel.aggregate([
913
- { $unwind: '$result.purchaseNumberAuthResult.knyknrNoInfoOut' },
914
- { $unwind: '$result.purchaseNumberAuthResult.knyknrNoInfoOut.mkknInfo' },
915
- { $match: filterQuery },
916
- { $project: projectStage }
917
- ]);
918
- if (typeof filter.limit === 'number' && filter.limit > 0) {
919
- const page = (typeof filter.page === 'number' && filter.page > 0) ? filter.page : 1;
920
- aggregate.limit(filter.limit * page)
921
- .skip(filter.limit * (page - 1));
922
- }
923
- return aggregate
924
- .option({ maxTimeMS: settings_1.MONGO_MAX_TIME_MS })
925
- .exec();
926
- });
927
- }
855
+ // public async searchYkknInfoByCheckMovieTicketResult(
856
+ // filter: {
857
+ // limit: number;
858
+ // page: number;
859
+ // /**
860
+ // * 認証アクションID
861
+ // */
862
+ // id: string;
863
+ // project: { id: string };
864
+ // purpose: { id: string };
865
+ // }
866
+ // ): Promise<(surfrockFactory.service.auth.purchaseNumberAuth.IValidTicket & {
867
+ // knyknrNo: string;
868
+ // })[]> {
869
+ // const filterQuery: FilterQuery<factory.action.IAction<factory.action.IAttributes<factory.actionType, any, any>>> = {
870
+ // _id: { $eq: new Types.ObjectId(filter.id) },
871
+ // 'project.id': { $eq: filter.project.id },
872
+ // 'purpose.id': { $exists: true, $eq: filter.purpose.id },
873
+ // typeOf: { $eq: factory.actionType.CheckAction },
874
+ // actionStatus: { $eq: factory.actionStatusType.CompletedActionStatus }
875
+ // };
876
+ // const projectStage: { [field: string]: AnyExpression } = {
877
+ // _id: 0,
878
+ // knyknrNo: '$result.purchaseNumberAuthResult.knyknrNoInfoOut.knyknrNo',
879
+ // ykknshTyp: '$result.purchaseNumberAuthResult.knyknrNoInfoOut.ykknInfo.ykknshTyp',
880
+ // eishhshkTyp: '$result.purchaseNumberAuthResult.knyknrNoInfoOut.ykknInfo.eishhshkTyp',
881
+ // ykknKnshbtsmiNum: '$result.purchaseNumberAuthResult.knyknrNoInfoOut.ykknInfo.ykknKnshbtsmiNum',
882
+ // knshknhmbiUnip: '$result.purchaseNumberAuthResult.knyknrNoInfoOut.ykknInfo.knshknhmbiUnip',
883
+ // kijUnip: '$result.purchaseNumberAuthResult.knyknrNoInfoOut.ykknInfo.kijUnip'
884
+ // };
885
+ // const aggregate = this.actionModel.aggregate<surfrockFactory.service.auth.purchaseNumberAuth.IValidTicket & {
886
+ // knyknrNo: string;
887
+ // }>([
888
+ // { $unwind: '$result.purchaseNumberAuthResult.knyknrNoInfoOut' },
889
+ // { $unwind: '$result.purchaseNumberAuthResult.knyknrNoInfoOut.ykknInfo' },
890
+ // { $match: filterQuery },
891
+ // { $project: projectStage }
892
+ // ]);
893
+ // if (typeof filter.limit === 'number' && filter.limit > 0) {
894
+ // const page: number = (typeof filter.page === 'number' && filter.page > 0) ? filter.page : 1;
895
+ // aggregate.limit(filter.limit * page)
896
+ // .skip(filter.limit * (page - 1));
897
+ // }
898
+ // return aggregate
899
+ // .option({ maxTimeMS: MONGO_MAX_TIME_MS })
900
+ // .exec();
901
+ // }
902
+ // public async searchMkknInfoByCheckMovieTicketResult(
903
+ // filter: {
904
+ // limit: number;
905
+ // page: number;
906
+ // /**
907
+ // * 認証アクションID
908
+ // */
909
+ // id: string;
910
+ // project: { id: string };
911
+ // purpose: { id: string };
912
+ // }
913
+ // ): Promise<(surfrockFactory.service.auth.purchaseNumberAuth.INvalidTicket & {
914
+ // knyknrNo: string;
915
+ // })[]> {
916
+ // const filterQuery: FilterQuery<factory.action.IAction<factory.action.IAttributes<factory.actionType, any, any>>> = {
917
+ // _id: { $eq: new Types.ObjectId(filter.id) },
918
+ // 'project.id': { $eq: filter.project.id },
919
+ // 'purpose.id': { $exists: true, $eq: filter.purpose.id },
920
+ // typeOf: { $eq: factory.actionType.CheckAction },
921
+ // actionStatus: { $eq: factory.actionStatusType.CompletedActionStatus }
922
+ // };
923
+ // const projectStage: { [field: string]: AnyExpression } = {
924
+ // _id: 0,
925
+ // knyknrNo: '$result.purchaseNumberAuthResult.knyknrNoInfoOut.knyknrNo',
926
+ // mkknshTyp: '$result.purchaseNumberAuthResult.knyknrNoInfoOut.mkknInfo.mkknshTyp',
927
+ // mkknKnshbtsmiNum: '$result.purchaseNumberAuthResult.knyknrNoInfoOut.mkknInfo.mkknKnshbtsmiNum',
928
+ // mkjyTyp: '$result.purchaseNumberAuthResult.knyknrNoInfoOut.mkknInfo.mkjyTyp',
929
+ // yykDt: '$result.purchaseNumberAuthResult.knyknrNoInfoOut.mkknInfo.yykDt',
930
+ // shyJeiDt: '$result.purchaseNumberAuthResult.knyknrNoInfoOut.mkknInfo.shyJeiDt',
931
+ // shyStCd: '$result.purchaseNumberAuthResult.knyknrNoInfoOut.mkknInfo.shyStCd',
932
+ // shyScrnCd: '$result.purchaseNumberAuthResult.knyknrNoInfoOut.mkknInfo.shyScrnCd',
933
+ // shySkhnCd: '$result.purchaseNumberAuthResult.knyknrNoInfoOut.mkknInfo.shySkhnCd',
934
+ // shySkhnNm: '$result.purchaseNumberAuthResult.knyknrNoInfoOut.mkknInfo.shySkhnNm'
935
+ // };
936
+ // const aggregate = this.actionModel.aggregate<surfrockFactory.service.auth.purchaseNumberAuth.INvalidTicket & {
937
+ // knyknrNo: string;
938
+ // }>([
939
+ // { $unwind: '$result.purchaseNumberAuthResult.knyknrNoInfoOut' },
940
+ // { $unwind: '$result.purchaseNumberAuthResult.knyknrNoInfoOut.mkknInfo' },
941
+ // { $match: filterQuery },
942
+ // { $project: projectStage }
943
+ // ]);
944
+ // if (typeof filter.limit === 'number' && filter.limit > 0) {
945
+ // const page: number = (typeof filter.page === 'number' && filter.page > 0) ? filter.page : 1;
946
+ // aggregate.limit(filter.limit * page)
947
+ // .skip(filter.limit * (page - 1));
948
+ // }
949
+ // return aggregate
950
+ // .option({ maxTimeMS: MONGO_MAX_TIME_MS })
951
+ // .exec();
952
+ // }
928
953
  searchYkknInfoByCheckRecipe(filter) {
929
954
  return __awaiter(this, void 0, void 0, function* () {
930
955
  const filterQuery = {
@@ -79,7 +79,9 @@ function payCreditCard(params) {
79
79
  }
80
80
  throw error;
81
81
  }
82
- const actionResult = { creditCardSales: alterTranResults };
82
+ const actionResult = {
83
+ // creditCardSales: alterTranResults // discontinue(2024-06-10~)
84
+ };
83
85
  action = (yield repos.action.complete({ typeOf: action.typeOf, id: action.id, result: actionResult, recipe }));
84
86
  yield (0, onPaid_1.onPaid)(action)(repos);
85
87
  return action;
@@ -105,7 +105,7 @@ function refundCreditCard(params, options) {
105
105
  }
106
106
  throw error;
107
107
  }
108
- const actionResult = { alterTranResult };
108
+ const actionResult = {}; // optimize(2024-06-10~)
109
109
  action = (yield repos.action.complete({ typeOf: action.typeOf, id: action.id, result: actionResult, recipe }));
110
110
  yield (0, onRefund_1.onRefund)(action)(repos);
111
111
  return action;
@@ -18,7 +18,6 @@ const processPurchaseNumberAuth_1 = require("./processPurchaseNumberAuth");
18
18
  * 決済カード認証
19
19
  */
20
20
  function checkMovieTicket(params) {
21
- // tslint:disable-next-line:max-func-body-length
22
21
  return (repos) => __awaiter(this, void 0, void 0, function* () {
23
22
  var _a, _b, _c, _d, _e, _f;
24
23
  // 不要な属性がリクエストに含まれているのでmovieTicketsを最適化(2024-03-15~)
@@ -28,26 +27,20 @@ function checkMovieTicket(params) {
28
27
  }
29
28
  movieTickets = movieTickets.map(({ accessCode, category, identifier, serviceOutput }) => {
30
29
  return {
31
- accessCode,
32
- category,
33
- identifier,
30
+ accessCode, category, identifier,
34
31
  serviceOutput: { reservationFor: serviceOutput.reservationFor } // 最適化(2024-03-15~)
35
32
  };
36
33
  });
37
34
  const optimizedCheckObject = params.object.map(({ id, typeOf, paymentMethod, seller }) => {
38
35
  return {
39
- id,
40
- typeOf,
41
- paymentMethod: { typeOf: paymentMethod.typeOf },
42
- seller,
43
- movieTickets
36
+ id, typeOf, seller, movieTickets,
37
+ paymentMethod: { typeOf: paymentMethod.typeOf } // 最適化(2024-03-15~)
44
38
  };
45
39
  });
46
40
  const paymentMethodType = (_b = optimizedCheckObject[0]) === null || _b === void 0 ? void 0 : _b.paymentMethod.typeOf; // 決済方法区分
47
41
  const paymentServiceId = (_c = optimizedCheckObject[0]) === null || _c === void 0 ? void 0 : _c.id;
48
- const taskId = (_d = params.sameAs) === null || _d === void 0 ? void 0 : _d.id;
49
- const actionAttributes = Object.assign(Object.assign({ project: params.project, typeOf: factory.actionType.CheckAction, agent: params.agent, object: optimizedCheckObject }, (typeof ((_e = params.purpose) === null || _e === void 0 ? void 0 : _e.typeOf) === 'string') ? { purpose: params.purpose } : undefined), (typeof taskId === 'string')
50
- ? { sameAs: { id: taskId, typeOf: 'Task' } } // タスク関連付け(2024-05-21~)
42
+ const actionAttributes = Object.assign(Object.assign({ project: params.project, typeOf: factory.actionType.CheckAction, agent: params.agent, object: optimizedCheckObject }, (typeof ((_d = params.purpose) === null || _d === void 0 ? void 0 : _d.typeOf) === 'string') ? { purpose: params.purpose } : undefined), (typeof ((_e = params.sameAs) === null || _e === void 0 ? void 0 : _e.id) === 'string')
43
+ ? { sameAs: { id: params.sameAs.id, typeOf: 'Task' } } // タスク関連付け(2024-05-21~)
51
44
  : undefined);
52
45
  const action = yield repos.action.start(actionAttributes);
53
46
  let processPurchaseNumberAuthResult;
@@ -60,9 +53,8 @@ function checkMovieTicket(params) {
60
53
  if (eventIds.length !== 1) {
61
54
  throw new factory.errors.Argument('movieTickets', 'Number of events must be 1');
62
55
  }
63
- // イベント情報取得
64
- let screeningEvent;
65
56
  // イベント取得属性最適化(2023-01-23~)
57
+ let screeningEvent;
66
58
  screeningEvent = yield repos.event.findMinimizedIndividualEventById({ id: eventIds[0] });
67
59
  const sellerId = (_f = optimizedCheckObject[0]) === null || _f === void 0 ? void 0 : _f.seller.id;
68
60
  const paymentAccepted = yield repos.paymentAccepted.isAcceptedBySeller({
@@ -96,12 +88,10 @@ function checkMovieTicket(params) {
96
88
  throw errors[0];
97
89
  }
98
90
  const result = {
99
- purchaseNumberAuthIn: processPurchaseNumberAuthResult.purchaseNumberAuthIn,
100
- purchaseNumberAuthResult: processPurchaseNumberAuthResult.purchaseNumberAuthResult
91
+ // purchaseNumberAuthIn: processPurchaseNumberAuthResult.purchaseNumberAuthIn, // discontinue(2024-06-10~)
92
+ // purchaseNumberAuthResult: processPurchaseNumberAuthResult.purchaseNumberAuthResult // discontinue(2024-06-10~)
101
93
  };
102
- yield repos.action.completeWithVoid({
103
- typeOf: actionAttributes.typeOf, id: action.id, result, recipe
104
- });
94
+ yield repos.action.completeWithVoid({ typeOf: actionAttributes.typeOf, id: action.id, result, recipe });
105
95
  return { result: processPurchaseNumberAuthResult };
106
96
  });
107
97
  }
@@ -12,7 +12,7 @@ declare function createSeatInfoSyncIn(params: {
12
12
  stCd: string;
13
13
  };
14
14
  }): surfrock.factory.service.seat.seatInfoSync.ISeatInfoSyncIn;
15
- declare function createStartingPayAction(params: factory.task.pay.IPayActionData, seatInfoSyncIn: surfrock.factory.service.seat.seatInfoSync.ISeatInfoSyncIn): factory.action.trade.pay.IAttributes;
15
+ declare function createStartingPayAction(params: factory.task.pay.IPayActionData): factory.action.trade.pay.IAttributes;
16
16
  interface IProcessPurchaseNumberAuthResult {
17
17
  purchaseNumberAuthIn?: factory.action.check.paymentMethod.movieTicket.IPurchaseNumberAuthIn;
18
18
  purchaseNumberAuthResult?: factory.action.check.paymentMethod.movieTicket.IPurchaseNumberAuthResult;
@@ -73,10 +73,12 @@ function createSeatInfoSyncIn(params) {
73
73
  };
74
74
  }
75
75
  exports.createSeatInfoSyncIn = createSeatInfoSyncIn;
76
- function createStartingPayAction(params, seatInfoSyncIn) {
76
+ function createStartingPayAction(params
77
+ // seatInfoSyncIn: surfrock.factory.service.seat.seatInfoSync.ISeatInfoSyncIn
78
+ ) {
77
79
  const instrument = {
78
- typeOf: factory.service.paymentService.PaymentServiceType.MovieTicket,
79
- seatInfoSyncIn
80
+ typeOf: factory.service.paymentService.PaymentServiceType.MovieTicket
81
+ // seatInfoSyncIn // discontinue(2024-06-10~)
80
82
  };
81
83
  return Object.assign(Object.assign({}, params), { object: params.object.map((o) => {
82
84
  const movieTicketsWithMaskedAccessCode = (Array.isArray(o.movieTickets))
@@ -86,9 +88,7 @@ function createStartingPayAction(params, seatInfoSyncIn) {
86
88
  })
87
89
  : [];
88
90
  return Object.assign(Object.assign({}, o), { movieTickets: movieTicketsWithMaskedAccessCode });
89
- }),
90
- // アクション開始前にseatInfoSyncInを生成してアクションに保管する
91
- instrument });
91
+ }), instrument });
92
92
  }
93
93
  exports.createStartingPayAction = createStartingPayAction;
94
94
  function processPurchaseNumberAuthResult2checkRecipe(params) {
@@ -27,7 +27,7 @@ function payMovieTicket(params) {
27
27
  const paymentMethodId = (_a = params.object[0]) === null || _a === void 0 ? void 0 : _a.paymentMethod.paymentMethodId;
28
28
  const paymentServiceId = (_b = params.object[0]) === null || _b === void 0 ? void 0 : _b.id;
29
29
  const seatInfoSyncIn = yield payActionParams2seatInfoSyncIn(params)(repos);
30
- const startingAction = (0, factory_1.createStartingPayAction)(params, seatInfoSyncIn);
30
+ const startingAction = (0, factory_1.createStartingPayAction)(params);
31
31
  let recipe = (0, factory_1.processSeatInfoSyncResult2payRecipe)({
32
32
  processSeatInfoSyncResult: { seatInfoSyncIn },
33
33
  project: { id: params.project.id }
@@ -84,11 +84,14 @@ function payMovieTicket(params) {
84
84
  }
85
85
  throw errors;
86
86
  }
87
- const seatInfoSyncResult = processSeatInfoSyncResult.seatInfoSyncResult;
88
- const result = Object.assign({}, (seatInfoSyncResult !== undefined
89
- && seatInfoSyncResult.zskyykResult !== undefined)
90
- ? { seatInfoSyncResult: seatInfoSyncResult }
91
- : undefined);
87
+ // const seatInfoSyncResult = processSeatInfoSyncResult.seatInfoSyncResult;
88
+ const result = {
89
+ // discontinue(2024-06-10~)
90
+ // ...(seatInfoSyncResult !== undefined
91
+ // && (<factory.action.trade.pay.ISeatInfoSyncResult>seatInfoSyncResult).zskyykResult !== undefined)
92
+ // ? { seatInfoSyncResult: <factory.action.trade.pay.ISeatInfoSyncResult>seatInfoSyncResult }
93
+ // : undefined
94
+ };
92
95
  action = (yield repos.action.complete({ typeOf: action.typeOf, id: action.id, result, recipe }));
93
96
  yield (0, onPaid_1.onPaid)(action)(repos);
94
97
  return action;
@@ -97,11 +97,15 @@ function refundMovieTicket(params) {
97
97
  else {
98
98
  // add recipe(2024-06-04~)
99
99
  recipe = (0, factory_1.processSeatInfoSyncResult2refundRecipe)(Object.assign(Object.assign({ project: { id: params.project.id } }, (processSeatInfoSyncResult !== undefined) ? { processSeatInfoSyncResult } : undefined), (processSeatInfoSyncCancelResult !== undefined) ? { processSeatInfoSyncCancelResult } : undefined));
100
- const actionResult = Object.assign(Object.assign({}, ((processSeatInfoSyncResult === null || processSeatInfoSyncResult === void 0 ? void 0 : processSeatInfoSyncResult.seatInfoSyncResult) !== undefined)
101
- ? { seatInfoSyncResult: processSeatInfoSyncResult.seatInfoSyncResult }
102
- : undefined), ((processSeatInfoSyncCancelResult === null || processSeatInfoSyncCancelResult === void 0 ? void 0 : processSeatInfoSyncCancelResult.seatInfoSyncCancelResult) !== undefined)
103
- ? { seatInfoSyncCancelResult: processSeatInfoSyncCancelResult.seatInfoSyncCancelResult }
104
- : undefined);
100
+ const actionResult = {
101
+ // ...(seatInfoSyncIn !== undefined) ? { seatInfoSyncIn } : undefined, // instrumentへ移行(2024-04-30~)
102
+ // ...(processSeatInfoSyncResult?.seatInfoSyncResult !== undefined) // discontinue(2024-06-10~)
103
+ // ? { seatInfoSyncResult: processSeatInfoSyncResult.seatInfoSyncResult }
104
+ // : undefined,
105
+ // ...(processSeatInfoSyncCancelResult?.seatInfoSyncCancelResult !== undefined) // discontinue(2024-06-10~)
106
+ // ? { seatInfoSyncCancelResult: processSeatInfoSyncCancelResult.seatInfoSyncCancelResult }
107
+ // : undefined
108
+ };
105
109
  action = (yield repos.action.complete({ typeOf: action.typeOf, id: action.id, result: actionResult, recipe }));
106
110
  }
107
111
  yield (0, onRefund_1.onRefund)(action)(repos);
@@ -110,7 +114,7 @@ function refundMovieTicket(params) {
110
114
  exports.refundMovieTicket = refundMovieTicket;
111
115
  function createSeatInfoSyncInOnRefund(params) {
112
116
  return (repos) => __awaiter(this, void 0, void 0, function* () {
113
- var _a, _b, _c, _d;
117
+ var _a, _b, _c;
114
118
  // 本アクションに対応するPayActionを取り出す
115
119
  // 例えばtimeoutが原因でCompletedActionStatusでない場合、外部サービス側では着券済の可能性もあるので、そこを考慮する
116
120
  const payAction = yield repos.action.findPayAction({
@@ -133,10 +137,10 @@ function createSeatInfoSyncInOnRefund(params) {
133
137
  });
134
138
  // const seatInfoSyncInOnPay: surfrock.factory.service.seat.seatInfoSync.ISeatInfoSyncIn | undefined =
135
139
  // payAction.instrument?.seatInfoSyncIn;
136
- let seatInfoSyncInOnPay = (_c = (_b = (_a = recipe === null || recipe === void 0 ? void 0 : recipe.step[0]) === null || _a === void 0 ? void 0 : _a.itemListElement[0]) === null || _b === void 0 ? void 0 : _b.itemListElement[0]) === null || _c === void 0 ? void 0 : _c.beforeMedia;
137
- if (seatInfoSyncInOnPay === undefined && ((_d = payAction.instrument) === null || _d === void 0 ? void 0 : _d.seatInfoSyncIn) !== undefined) {
138
- seatInfoSyncInOnPay = payAction.instrument.seatInfoSyncIn; // compatibility
139
- }
140
+ const seatInfoSyncInOnPay = (_c = (_b = (_a = recipe === null || recipe === void 0 ? void 0 : recipe.step[0]) === null || _a === void 0 ? void 0 : _a.itemListElement[0]) === null || _b === void 0 ? void 0 : _b.itemListElement[0]) === null || _c === void 0 ? void 0 : _c.beforeMedia;
141
+ // if (seatInfoSyncInOnPay === undefined && payAction.instrument?.seatInfoSyncIn !== undefined) {
142
+ // seatInfoSyncInOnPay = payAction.instrument.seatInfoSyncIn; // compatibility
143
+ // }
140
144
  if (seatInfoSyncInOnPay === undefined) {
141
145
  // throw new factory.errors.NotFound('PayAction.instrument?.seatInfoSyncIn');
142
146
  throw new factory.errors.NotFound('PayAction.recipe.step.itemListElement.itemListElement.beforeMedia');
@@ -150,7 +154,7 @@ function createSeatInfoSyncInOnRefund(params) {
150
154
  }
151
155
  function createSeatInfoSyncCancelInOnRefund(params) {
152
156
  return (repos) => __awaiter(this, void 0, void 0, function* () {
153
- var _a, _b, _c, _d;
157
+ var _a, _b, _c;
154
158
  // 本アクションに対応するPayActionを取り出す
155
159
  // 例えばtimeoutが原因でCompletedActionStatusでない場合、外部サービス側では着券済の可能性もあるので、そこを考慮する
156
160
  const payAction = yield repos.action.findPayAction({
@@ -173,10 +177,10 @@ function createSeatInfoSyncCancelInOnRefund(params) {
173
177
  });
174
178
  // const seatInfoSyncInOnPay: surfrock.factory.service.seat.seatInfoSync.ISeatInfoSyncIn | undefined =
175
179
  // payAction.instrument?.seatInfoSyncIn;
176
- let seatInfoSyncInOnPay = (_c = (_b = (_a = recipe === null || recipe === void 0 ? void 0 : recipe.step[0]) === null || _a === void 0 ? void 0 : _a.itemListElement[0]) === null || _b === void 0 ? void 0 : _b.itemListElement[0]) === null || _c === void 0 ? void 0 : _c.beforeMedia;
177
- if (seatInfoSyncInOnPay === undefined && ((_d = payAction.instrument) === null || _d === void 0 ? void 0 : _d.seatInfoSyncIn) !== undefined) {
178
- seatInfoSyncInOnPay = payAction.instrument.seatInfoSyncIn; // compatibility
179
- }
180
+ const seatInfoSyncInOnPay = (_c = (_b = (_a = recipe === null || recipe === void 0 ? void 0 : recipe.step[0]) === null || _a === void 0 ? void 0 : _a.itemListElement[0]) === null || _b === void 0 ? void 0 : _b.itemListElement[0]) === null || _c === void 0 ? void 0 : _c.beforeMedia;
181
+ // if (seatInfoSyncInOnPay === undefined && payAction.instrument?.seatInfoSyncIn !== undefined) {
182
+ // seatInfoSyncInOnPay = payAction.instrument.seatInfoSyncIn; // compatibility
183
+ // }
180
184
  if (seatInfoSyncInOnPay === undefined) {
181
185
  // throw new factory.errors.NotFound('PayAction.instrument?.seatInfoSyncIn');
182
186
  throw new factory.errors.NotFound('PayAction.recipe.step.itemListElement.itemListElement.beforeMedia');
@@ -1,4 +1,4 @@
1
- import type { IOperationExecute } from '../task';
1
+ import type { ICallResult, IExecutableTaskKeys, IOperationExecute } from '../task';
2
2
  import * as factory from '../../factory';
3
3
  import { MongoRepository as AcceptedOfferRepo } from '../../repo/acceptedOffer';
4
4
  import { MongoRepository as ActionRepo } from '../../repo/action';
@@ -9,11 +9,15 @@ import { MongoRepository as TaskRepo } from '../../repo/task';
9
9
  /**
10
10
  * タスク実行関数
11
11
  */
12
- export declare function call(data: factory.task.IData<factory.taskName.ConfirmReserveTransaction>): IOperationExecute<void>;
12
+ export declare function call(params: Pick<factory.task.ITask<factory.taskName.ConfirmReserveTransaction>, IExecutableTaskKeys>): IOperationExecute<ICallResult>;
13
13
  /**
14
14
  * 予約を確定する
15
15
  */
16
- export declare function confirmReserveTransaction(params: factory.task.IData<factory.taskName.ConfirmReserveTransaction>, options: {
16
+ export declare function confirmReserveTransaction(params: factory.task.IData<factory.taskName.ConfirmReserveTransaction> & {
17
+ sameAs?: {
18
+ id: string;
19
+ };
20
+ }, options: {
17
21
  sendOrder: boolean;
18
22
  useOnOrderStatusChanged: boolean;
19
23
  }): (repos: {
@@ -28,9 +28,9 @@ const debug = createDebug('chevre-domain:service:task');
28
28
  /**
29
29
  * タスク実行関数
30
30
  */
31
- function call(data) {
31
+ function call(params) {
32
32
  return (settings) => __awaiter(this, void 0, void 0, function* () {
33
- yield confirmReserveTransaction(data, {
33
+ yield confirmReserveTransaction(Object.assign(Object.assign({}, params.data), { sameAs: { id: params.id } }), {
34
34
  sendOrder: true,
35
35
  useOnOrderStatusChanged: true
36
36
  })({
@@ -149,7 +149,10 @@ function confirmReserveTransaction(params, options) {
149
149
  default:
150
150
  confirmActionObject = params.object;
151
151
  }
152
- const confirmActionAttributes = Object.assign(Object.assign({}, params), { object: confirmActionObject });
152
+ const { agent, project, purpose, typeOf, sameAs } = params;
153
+ const confirmActionAttributes = Object.assign({ agent, project, purpose, typeOf, object: confirmActionObject }, (typeof (sameAs === null || sameAs === void 0 ? void 0 : sameAs.id) === 'string') // link confirmReserveAction.sameAs(2024-06-10~)
154
+ ? { sameAs: { id: sameAs.id, typeOf: 'Task' } }
155
+ : undefined);
153
156
  const action = yield repos.action.start(confirmActionAttributes);
154
157
  let updReserveResult;
155
158
  let recipe;
@@ -186,7 +189,7 @@ function confirmReserveTransaction(params, options) {
186
189
  }
187
190
  throw error;
188
191
  }
189
- const result = { updReserveResult };
192
+ const result = Object.assign({}, (!settings_1.USE_EXPERIMENTAL_FEATURE && updReserveResult !== undefined) ? { updReserveResult } : {});
190
193
  yield repos.action.completeWithVoid(Object.assign({ typeOf: confirmActionAttributes.typeOf, id: action.id, result: result }, (settings_1.USE_EXPERIMENTAL_FEATURE && recipe !== undefined) ? { recipe } : undefined // add recipe(2024-06-08~)
191
194
  ));
192
195
  // sendOrder連携(2024-01-11~)
@@ -112,6 +112,7 @@ function execute(task) {
112
112
  case factory.taskName.Refund:
113
113
  case factory.taskName.VoidPayTransaction:
114
114
  case factory.taskName.VoidReserveTransaction:
115
+ case factory.taskName.ConfirmReserveTransaction:
115
116
  callResult = yield call(task)(settings, options);
116
117
  break;
117
118
  default:
package/package.json CHANGED
@@ -10,7 +10,7 @@
10
10
  ],
11
11
  "dependencies": {
12
12
  "@aws-sdk/credential-providers": "3.433.0",
13
- "@chevre/factory": "4.374.0-alpha.10",
13
+ "@chevre/factory": "4.374.0-alpha.13",
14
14
  "@cinerino/sdk": "7.1.0",
15
15
  "@motionpicture/coa-service": "9.4.0",
16
16
  "@motionpicture/gmo-service": "5.3.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": "21.34.0-alpha.3"
113
+ "version": "21.34.0-alpha.5"
114
114
  }