@chevre/domain 20.4.0-alpha.12 → 20.4.0-alpha.13

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.
@@ -28,37 +28,6 @@ function onReservationUsed(action, attendedReservation) {
28
28
  return (repos) => __awaiter(this, void 0, void 0, function* () {
29
29
  const tasks = [];
30
30
  const now = new Date();
31
- // INFORM_USE_RESERVATION_URL廃止(2023-01-30~)
32
- // アクション通知タスク作成
33
- // if (Array.isArray(informUseReservations)) {
34
- // informUseReservations.filter((informUseReservation) => {
35
- // return typeof informUseReservation.recipient?.url === 'string'
36
- // && informUseReservation.recipient.url.length > 0;
37
- // })
38
- // .forEach((informUseReservation) => {
39
- // const triggerWebhookTask: factory.task.triggerWebhook.IAttributes = {
40
- // project: action.project,
41
- // name: factory.taskName.TriggerWebhook,
42
- // status: factory.taskStatus.Ready,
43
- // runsAt: now,
44
- // remainingNumberOfTries: 3,
45
- // numberOfTried: 0,
46
- // executionResults: [],
47
- // data: {
48
- // project: action.project,
49
- // typeOf: factory.actionType.InformAction,
50
- // agent: action.project,
51
- // recipient: {
52
- // typeOf: factory.personType.Person,
53
- // id: String(informUseReservation.recipient?.url),
54
- // url: String(informUseReservation.recipient?.url)
55
- // },
56
- // object: action
57
- // }
58
- // };
59
- // tasks.push(triggerWebhookTask);
60
- // });
61
- // }
62
31
  // inform galobally
63
32
  if (Array.isArray(informReservations)) {
64
33
  // やや遅延させる(確定通知が未達の可能性を考慮して)
@@ -100,29 +69,32 @@ function onReservationUsed(action, attendedReservation) {
100
69
  };
101
70
  }));
102
71
  }
72
+ // projectを限定する(2023-02-21~)
103
73
  // 使用アクション集計タスクを作成する(冗長な作成を避ける)
104
- const readyAggregateUseActionsTaskDoc = yield repos.task.taskModel.findOne({
105
- 'project.id': { $eq: action.project.id },
106
- name: { $eq: factory.taskName.AggregateUseActionsOnEvent },
107
- status: { $eq: factory.taskStatus.Ready },
108
- 'data.id': { $exists: true, $eq: attendedReservation.reservationFor.id }
109
- }, { _id: 1 })
110
- .exec();
111
- if (readyAggregateUseActionsTaskDoc === null) {
112
- const aggregateUseActionsTask = {
113
- project: attendedReservation.project,
114
- name: factory.taskName.AggregateUseActionsOnEvent,
115
- status: factory.taskStatus.Ready,
116
- runsAt: now,
117
- remainingNumberOfTries: 3,
118
- numberOfTried: 0,
119
- executionResults: [],
120
- data: {
121
- typeOf: attendedReservation.reservationFor.typeOf,
122
- id: attendedReservation.reservationFor.id
123
- }
124
- };
125
- tasks.push(aggregateUseActionsTask);
74
+ if (settings_1.settings.useAggregateEntranceGateProjects.includes(action.project.id)) {
75
+ const readyAggregateUseActionsTaskDoc = yield repos.task.taskModel.findOne({
76
+ 'project.id': { $eq: action.project.id },
77
+ name: { $eq: factory.taskName.AggregateUseActionsOnEvent },
78
+ status: { $eq: factory.taskStatus.Ready },
79
+ 'data.id': { $exists: true, $eq: attendedReservation.reservationFor.id }
80
+ }, { _id: 1 })
81
+ .exec();
82
+ if (readyAggregateUseActionsTaskDoc === null) {
83
+ const aggregateUseActionsTask = {
84
+ project: attendedReservation.project,
85
+ name: factory.taskName.AggregateUseActionsOnEvent,
86
+ status: factory.taskStatus.Ready,
87
+ runsAt: now,
88
+ remainingNumberOfTries: 3,
89
+ numberOfTried: 0,
90
+ executionResults: [],
91
+ data: {
92
+ typeOf: attendedReservation.reservationFor.typeOf,
93
+ id: attendedReservation.reservationFor.id
94
+ }
95
+ };
96
+ tasks.push(aggregateUseActionsTask);
97
+ }
126
98
  }
127
99
  if (tasks.length > 0) {
128
100
  yield repos.task.saveMany(tasks);
@@ -23,6 +23,7 @@ export declare type ISettings = factory.project.ISettings & {
23
23
  maxNumCreditCardPaymentMethod?: number;
24
24
  useEventWorkPerformed: boolean;
25
25
  useOffersAppliedToMovieTicketWithoutChargeSpecification: boolean;
26
+ useAggregateEntranceGateProjects: string[];
26
27
  };
27
28
  export declare const DEFAULT_PAYMENT_METHOD_TYPE_FOR_CREDIT_CARD: string;
28
29
  export declare const USE_ASSET_TRANSACTION_SYNC_PROCESSING: boolean;
@@ -94,4 +94,6 @@ exports.settings = Object.assign(Object.assign({ transactionWebhookUrls, onOrder
94
94
  timeout: triggerWebhookTimeout
95
95
  }, maximumReservationGracePeriodInDays: MAXIMUM_RESERVATION_GRACE_PERIOD_IN_DAYS, userPoolIdOld: String(process.env.USERPOOL_ID_OLD), userPoolIdNew: String(process.env.USERPOOL_ID_NEW) }, (typeof MAX_NUM_CREDIT_CARD_PAYMENT_METHOD === 'number')
96
96
  ? { maxNumCreditCardPaymentMethod: MAX_NUM_CREDIT_CARD_PAYMENT_METHOD }
97
- : undefined), { useEventWorkPerformed: process.env.USE_EVENT_WORK_PERFORMED === '1', useOffersAppliedToMovieTicketWithoutChargeSpecification: process.env.USE_OFFERS_APPLIED_TO_MOVIE_TICKET_WITHOUT_PRICE_SPEC === '1' });
97
+ : undefined), { useEventWorkPerformed: process.env.USE_EVENT_WORK_PERFORMED === '1', useOffersAppliedToMovieTicketWithoutChargeSpecification: process.env.USE_OFFERS_APPLIED_TO_MOVIE_TICKET_WITHOUT_PRICE_SPEC === '1', useAggregateEntranceGateProjects: (typeof process.env.USE_AGGREGATE_ENTRANCE_GATE_PROJECTS === 'string')
98
+ ? process.env.USE_AGGREGATE_ENTRANCE_GATE_PROJECTS.split(',')
99
+ : [] });
package/package.json CHANGED
@@ -120,5 +120,5 @@
120
120
  "postversion": "git push origin --tags",
121
121
  "prepublishOnly": "npm run clean && npm run build && npm test && npm run doc"
122
122
  },
123
- "version": "20.4.0-alpha.12"
123
+ "version": "20.4.0-alpha.13"
124
124
  }