@chevre/domain 22.6.0-alpha.3 → 22.6.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.
@@ -22,9 +22,11 @@ async function main() {
22
22
  const actionRepo = await chevre.repository.Action.createInstance(mongoose.connection);
23
23
  const taskRepo = await chevre.repository.Task.createInstance(mongoose.connection);
24
24
 
25
+ const aggregateDate = new Date();
25
26
  let result: { aggregationCount: number; aggregateDuration: string };
26
27
 
27
28
  result = await (await chevre.service.aggregation.createService()).system.aggregateOrder({
29
+ aggregateDate,
28
30
  aggregateDurationUnit: AGGREGATE_DURATION_UNIT,
29
31
  aggregationCount: (AGGREGATE_DURATION_UNIT === 'hours') ? AGGREGATE_DAYS * ONE_DAY_IN_HOURS : AGGREGATE_DAYS,
30
32
  excludedProjectId: EXCLUDED_PROJECT_ID
@@ -36,6 +38,7 @@ async function main() {
36
38
  // return;
37
39
 
38
40
  result = await (await chevre.service.aggregation.createService()).system.aggregatePlaceOrder({
41
+ aggregateDate,
39
42
  aggregateDurationUnit: AGGREGATE_DURATION_UNIT,
40
43
  aggregationCount: (AGGREGATE_DURATION_UNIT === 'hours') ? AGGREGATE_DAYS * ONE_DAY_IN_HOURS : AGGREGATE_DAYS,
41
44
  excludedProjectId: EXCLUDED_PROJECT_ID,
@@ -48,6 +51,7 @@ async function main() {
48
51
  // return;
49
52
 
50
53
  result = await (await chevre.service.aggregation.createService()).system.aggregateReserveAction({
54
+ aggregateDate,
51
55
  aggregateDurationUnit: AGGREGATE_DURATION_UNIT,
52
56
  aggregationCount: (AGGREGATE_DURATION_UNIT === 'hours') ? AGGREGATE_DAYS * ONE_DAY_IN_HOURS : AGGREGATE_DAYS,
53
57
  excludedProjectId: EXCLUDED_PROJECT_ID
@@ -58,6 +62,7 @@ async function main() {
58
62
  console.log('aggregateReserveAction processed.', result);
59
63
 
60
64
  result = await (await chevre.service.aggregation.createService()).system.aggregateOrderAction({
65
+ aggregateDate,
61
66
  aggregateDurationUnit: AGGREGATE_DURATION_UNIT,
62
67
  aggregationCount: (AGGREGATE_DURATION_UNIT === 'hours') ? AGGREGATE_DAYS * ONE_DAY_IN_HOURS : AGGREGATE_DAYS,
63
68
  excludedProjectId: EXCLUDED_PROJECT_ID
@@ -68,6 +73,7 @@ async function main() {
68
73
  console.log('aggregateReserveAction processed.', result);
69
74
 
70
75
  result = await (await chevre.service.aggregation.createService()).system.aggregateCancelReservationAction({
76
+ aggregateDate,
71
77
  aggregateDurationUnit: AGGREGATE_DURATION_UNIT,
72
78
  aggregationCount: (AGGREGATE_DURATION_UNIT === 'hours') ? AGGREGATE_DAYS * ONE_DAY_IN_HOURS : AGGREGATE_DAYS,
73
79
  excludedProjectId: EXCLUDED_PROJECT_ID
@@ -78,6 +84,7 @@ async function main() {
78
84
  console.log('aggregateCancelReservationAction processed.', result);
79
85
 
80
86
  result = await (await chevre.service.aggregation.createService()).system.aggregateTask({
87
+ aggregateDate,
81
88
  aggregateDurationUnit: AGGREGATE_DURATION_UNIT,
82
89
  aggregationCount: (AGGREGATE_DURATION_UNIT === 'hours') ? AGGREGATE_DAYS * ONE_DAY_IN_HOURS : AGGREGATE_DAYS,
83
90
  excludedProjectId: EXCLUDED_PROJECT_ID
@@ -88,6 +95,7 @@ async function main() {
88
95
  console.log('aggregateTask processed.', result);
89
96
 
90
97
  result = await (await chevre.service.aggregation.createService()).system.aggregatePayMovieTicketAction({
98
+ aggregateDate,
91
99
  aggregateDurationUnit: AGGREGATE_DURATION_UNIT,
92
100
  aggregationCount: (AGGREGATE_DURATION_UNIT === 'hours') ? AGGREGATE_DAYS * ONE_DAY_IN_HOURS : AGGREGATE_DAYS,
93
101
  excludedProjectId: EXCLUDED_PROJECT_ID
@@ -98,6 +106,7 @@ async function main() {
98
106
  console.log('aggregatePayMovieTicketAction processed.', result);
99
107
 
100
108
  result = await (await chevre.service.aggregation.createService()).system.aggregatePayTransaction({
109
+ aggregateDate,
101
110
  aggregateDurationUnit: AGGREGATE_DURATION_UNIT,
102
111
  aggregationCount: (AGGREGATE_DURATION_UNIT === 'hours') ? AGGREGATE_DAYS * ONE_DAY_IN_HOURS : AGGREGATE_DAYS,
103
112
  excludedProjectId: EXCLUDED_PROJECT_ID
@@ -108,6 +117,7 @@ async function main() {
108
117
  console.log('aggregatePayTransaction processed.', result);
109
118
 
110
119
  result = await (await chevre.service.aggregation.createService()).system.aggregateEvent({
120
+ aggregateDate,
111
121
  aggregateDurationUnit: AGGREGATE_DURATION_UNIT,
112
122
  aggregationCount: (AGGREGATE_DURATION_UNIT === 'hours') ? AGGREGATE_DAYS * ONE_DAY_IN_HOURS : AGGREGATE_DAYS,
113
123
  excludedProjectId: EXCLUDED_PROJECT_ID
@@ -118,6 +128,7 @@ async function main() {
118
128
  console.log('aggregateEvent processed.', result);
119
129
 
120
130
  result = await (await chevre.service.aggregation.createService()).system.aggregateReserveTransaction({
131
+ aggregateDate,
121
132
  aggregateDurationUnit: AGGREGATE_DURATION_UNIT,
122
133
  aggregationCount: (AGGREGATE_DURATION_UNIT === 'hours') ? AGGREGATE_DAYS * ONE_DAY_IN_HOURS : AGGREGATE_DAYS,
123
134
  excludedProjectId: EXCLUDED_PROJECT_ID
@@ -128,6 +139,7 @@ async function main() {
128
139
  console.log('aggregateReserveTransaction processed.', result);
129
140
 
130
141
  result = await (await chevre.service.aggregation.createService()).system.aggregateAuthorizeOrderAction({
142
+ aggregateDate,
131
143
  aggregateDurationUnit: AGGREGATE_DURATION_UNIT,
132
144
  aggregationCount: (AGGREGATE_DURATION_UNIT === 'hours') ? AGGREGATE_DAYS * ONE_DAY_IN_HOURS : AGGREGATE_DAYS,
133
145
  excludedProjectId: EXCLUDED_PROJECT_ID
@@ -138,6 +150,7 @@ async function main() {
138
150
  console.log('aggregateAuthorizeOrderAction processed.', result);
139
151
 
140
152
  result = await (await chevre.service.aggregation.createService()).system.aggregateAuthorizeEventServiceOfferAction({
153
+ aggregateDate,
141
154
  aggregateDurationUnit: AGGREGATE_DURATION_UNIT,
142
155
  aggregationCount: (AGGREGATE_DURATION_UNIT === 'hours') ? AGGREGATE_DAYS * ONE_DAY_IN_HOURS : AGGREGATE_DAYS,
143
156
  excludedProjectId: EXCLUDED_PROJECT_ID
@@ -148,6 +161,7 @@ async function main() {
148
161
  console.log('aggregateAuthorizeEventServiceOfferAction processed.', result);
149
162
 
150
163
  result = await (await chevre.service.aggregation.createService()).system.aggregateAuthorizePaymentAction({
164
+ aggregateDate,
151
165
  aggregateDurationUnit: AGGREGATE_DURATION_UNIT,
152
166
  aggregationCount: (AGGREGATE_DURATION_UNIT === 'hours') ? AGGREGATE_DAYS * ONE_DAY_IN_HOURS : AGGREGATE_DAYS,
153
167
  excludedProjectId: EXCLUDED_PROJECT_ID
@@ -158,6 +172,7 @@ async function main() {
158
172
  console.log('aggregateAuthorizePaymentAction processed.', result);
159
173
 
160
174
  result = await (await chevre.service.aggregation.createService()).system.aggregateUseAction({
175
+ aggregateDate,
161
176
  aggregateDurationUnit: AGGREGATE_DURATION_UNIT,
162
177
  aggregationCount: (AGGREGATE_DURATION_UNIT === 'hours') ? AGGREGATE_DAYS * ONE_DAY_IN_HOURS : AGGREGATE_DAYS,
163
178
  excludedProjectId: EXCLUDED_PROJECT_ID
@@ -168,6 +183,7 @@ async function main() {
168
183
  console.log('aggregateUseAction processed.', result);
169
184
 
170
185
  result = await (await chevre.service.aggregation.createService()).system.aggregateCheckMovieTicketAction({
186
+ aggregateDate,
171
187
  aggregateDurationUnit: AGGREGATE_DURATION_UNIT,
172
188
  aggregationCount: (AGGREGATE_DURATION_UNIT === 'hours') ? AGGREGATE_DAYS * ONE_DAY_IN_HOURS : AGGREGATE_DAYS,
173
189
  excludedProjectId: EXCLUDED_PROJECT_ID
@@ -6,11 +6,13 @@ import { OrderRepo } from '../../repo/order';
6
6
  import type { TaskRepo } from '../../repo/task';
7
7
  import type { TransactionRepo } from '../../repo/transaction';
8
8
  type AggregateDurationUnit = 'days' | 'hours';
9
- declare function aggregateEvent(params: {
9
+ interface IAggregateParams {
10
+ aggregateDate: Date;
10
11
  aggregateDurationUnit: AggregateDurationUnit;
11
12
  aggregationCount: number;
12
13
  excludedProjectId?: string;
13
- }): (repos: {
14
+ }
15
+ declare function aggregateEvent(params: IAggregateParams): (repos: {
14
16
  agregation: AggregationRepo;
15
17
  event: EventRepo;
16
18
  }) => Promise<{
@@ -20,11 +22,7 @@ declare function aggregateEvent(params: {
20
22
  /**
21
23
  * 注文集計
22
24
  */
23
- declare function aggregateOrder(params: {
24
- aggregateDurationUnit: AggregateDurationUnit;
25
- aggregationCount: number;
26
- excludedProjectId?: string;
27
- }): (repos: {
25
+ declare function aggregateOrder(params: IAggregateParams): (repos: {
28
26
  agregation: AggregationRepo;
29
27
  order: OrderRepo;
30
28
  }) => Promise<{
@@ -34,10 +32,7 @@ declare function aggregateOrder(params: {
34
32
  /**
35
33
  * 注文取引集計
36
34
  */
37
- declare function aggregatePlaceOrder(params: {
38
- aggregateDurationUnit: AggregateDurationUnit;
39
- aggregationCount: number;
40
- excludedProjectId?: string;
35
+ declare function aggregatePlaceOrder(params: IAggregateParams & {
41
36
  clientIds?: string[];
42
37
  }): (repos: {
43
38
  agregation: AggregationRepo;
@@ -49,11 +44,7 @@ declare function aggregatePlaceOrder(params: {
49
44
  /**
50
45
  * 興行オファー承認アクション集計
51
46
  */
52
- declare function aggregateAuthorizeEventServiceOfferAction(params: {
53
- aggregateDurationUnit: AggregateDurationUnit;
54
- aggregationCount: number;
55
- excludedProjectId?: string;
56
- }): (repos: {
47
+ declare function aggregateAuthorizeEventServiceOfferAction(params: IAggregateParams): (repos: {
57
48
  agregation: AggregationRepo;
58
49
  action: ActionRepo;
59
50
  }) => Promise<{
@@ -63,22 +54,14 @@ declare function aggregateAuthorizeEventServiceOfferAction(params: {
63
54
  /**
64
55
  * 決済承認アクション集計
65
56
  */
66
- declare function aggregateAuthorizePaymentAction(params: {
67
- aggregateDurationUnit: AggregateDurationUnit;
68
- aggregationCount: number;
69
- excludedProjectId?: string;
70
- }): (repos: {
57
+ declare function aggregateAuthorizePaymentAction(params: IAggregateParams): (repos: {
71
58
  agregation: AggregationRepo;
72
59
  action: ActionRepo;
73
60
  }) => Promise<{
74
61
  aggregationCount: number;
75
62
  aggregateDuration: string;
76
63
  }>;
77
- declare function aggregateAuthorizeOrderAction(params: {
78
- aggregateDurationUnit: AggregateDurationUnit;
79
- aggregationCount: number;
80
- excludedProjectId?: string;
81
- }): (repos: {
64
+ declare function aggregateAuthorizeOrderAction(params: IAggregateParams): (repos: {
82
65
  agregation: AggregationRepo;
83
66
  action: ActionRepo;
84
67
  }) => Promise<{
@@ -88,11 +71,7 @@ declare function aggregateAuthorizeOrderAction(params: {
88
71
  /**
89
72
  * 使用アクション集計
90
73
  */
91
- declare function aggregateUseAction(params: {
92
- aggregateDurationUnit: AggregateDurationUnit;
93
- aggregationCount: number;
94
- excludedProjectId?: string;
95
- }): (repos: {
74
+ declare function aggregateUseAction(params: IAggregateParams): (repos: {
96
75
  agregation: AggregationRepo;
97
76
  action: ActionRepo;
98
77
  }) => Promise<{
@@ -102,11 +81,7 @@ declare function aggregateUseAction(params: {
102
81
  /**
103
82
  * 予約アクション集計
104
83
  */
105
- declare function aggregateReserveAction(params: {
106
- aggregateDurationUnit: AggregateDurationUnit;
107
- aggregationCount: number;
108
- excludedProjectId?: string;
109
- }): (repos: {
84
+ declare function aggregateReserveAction(params: IAggregateParams): (repos: {
110
85
  agregation: AggregationRepo;
111
86
  action: ActionRepo;
112
87
  }) => Promise<{
@@ -116,11 +91,7 @@ declare function aggregateReserveAction(params: {
116
91
  /**
117
92
  * 注文アクション集計
118
93
  */
119
- declare function aggregateOrderAction(params: {
120
- aggregateDurationUnit: AggregateDurationUnit;
121
- aggregationCount: number;
122
- excludedProjectId?: string;
123
- }): (repos: {
94
+ declare function aggregateOrderAction(params: IAggregateParams): (repos: {
124
95
  agregation: AggregationRepo;
125
96
  action: ActionRepo;
126
97
  }) => Promise<{
@@ -130,44 +101,28 @@ declare function aggregateOrderAction(params: {
130
101
  /**
131
102
  * 予約取消アクション集計
132
103
  */
133
- declare function aggregateCancelReservationAction(params: {
134
- aggregateDurationUnit: AggregateDurationUnit;
135
- aggregationCount: number;
136
- excludedProjectId?: string;
137
- }): (repos: {
104
+ declare function aggregateCancelReservationAction(params: IAggregateParams): (repos: {
138
105
  agregation: AggregationRepo;
139
106
  action: ActionRepo;
140
107
  }) => Promise<{
141
108
  aggregationCount: number;
142
109
  aggregateDuration: string;
143
110
  }>;
144
- declare function aggregateCheckMovieTicketAction(params: {
145
- aggregateDurationUnit: AggregateDurationUnit;
146
- aggregationCount: number;
147
- excludedProjectId?: string;
148
- }): (repos: {
111
+ declare function aggregateCheckMovieTicketAction(params: IAggregateParams): (repos: {
149
112
  agregation: AggregationRepo;
150
113
  action: ActionRepo;
151
114
  }) => Promise<{
152
115
  aggregationCount: number;
153
116
  aggregateDuration: string;
154
117
  }>;
155
- declare function aggregatePayMovieTicketAction(params: {
156
- aggregateDurationUnit: AggregateDurationUnit;
157
- aggregationCount: number;
158
- excludedProjectId?: string;
159
- }): (repos: {
118
+ declare function aggregatePayMovieTicketAction(params: IAggregateParams): (repos: {
160
119
  agregation: AggregationRepo;
161
120
  action: ActionRepo;
162
121
  }) => Promise<{
163
122
  aggregationCount: number;
164
123
  aggregateDuration: string;
165
124
  }>;
166
- declare function aggregatePayTransaction(params: {
167
- aggregateDurationUnit: AggregateDurationUnit;
168
- aggregationCount: number;
169
- excludedProjectId?: string;
170
- }): (repos: {
125
+ declare function aggregatePayTransaction(params: IAggregateParams): (repos: {
171
126
  agregation: AggregationRepo;
172
127
  assetTransaction: AssetTransactionRepo;
173
128
  }) => Promise<{
@@ -177,22 +132,14 @@ declare function aggregatePayTransaction(params: {
177
132
  /**
178
133
  * 予約集計
179
134
  */
180
- declare function aggregateReserveTransaction(params: {
181
- aggregateDurationUnit: AggregateDurationUnit;
182
- aggregationCount: number;
183
- excludedProjectId?: string;
184
- }): (repos: {
135
+ declare function aggregateReserveTransaction(params: IAggregateParams): (repos: {
185
136
  agregation: AggregationRepo;
186
137
  assetTransaction: AssetTransactionRepo;
187
138
  }) => Promise<{
188
139
  aggregationCount: number;
189
140
  aggregateDuration: string;
190
141
  }>;
191
- declare function aggregateTask(params: {
192
- aggregateDurationUnit: AggregateDurationUnit;
193
- aggregationCount: number;
194
- excludedProjectId?: string;
195
- }): (repos: {
142
+ declare function aggregateTask(params: IAggregateParams): (repos: {
196
143
  agregation: AggregationRepo;
197
144
  task: TaskRepo;
198
145
  }) => Promise<{
@@ -17,7 +17,10 @@ const debug = createDebug('chevre-domain:service:aggregation:system');
17
17
  function aggregateEvent(params) {
18
18
  return (repos) => __awaiter(this, void 0, void 0, function* () {
19
19
  var _a;
20
- const aggregateDate = new Date();
20
+ const { aggregateDate } = params;
21
+ if (!(aggregateDate instanceof Date)) {
22
+ throw new factory.errors.Argument('aggregateDate', 'must be Date');
23
+ }
21
24
  const aggregateDuration = moment.duration(1, params.aggregateDurationUnit)
22
25
  .toISOString();
23
26
  let i = -1;
@@ -53,7 +56,10 @@ exports.aggregateEvent = aggregateEvent;
53
56
  */
54
57
  function aggregateOrder(params) {
55
58
  return (repos) => __awaiter(this, void 0, void 0, function* () {
56
- const aggregateDate = new Date();
59
+ const { aggregateDate } = params;
60
+ if (!(aggregateDate instanceof Date)) {
61
+ throw new factory.errors.Argument('aggregateDate', 'must be Date');
62
+ }
57
63
  const aggregateDuration = moment.duration(1, params.aggregateDurationUnit)
58
64
  .toISOString();
59
65
  let i = -1;
@@ -88,7 +94,10 @@ exports.aggregateOrder = aggregateOrder;
88
94
  function aggregatePlaceOrder(params) {
89
95
  return (repos) => __awaiter(this, void 0, void 0, function* () {
90
96
  var _a, _b;
91
- const aggregateDate = new Date();
97
+ const { aggregateDate } = params;
98
+ if (!(aggregateDate instanceof Date)) {
99
+ throw new factory.errors.Argument('aggregateDate', 'must be Date');
100
+ }
92
101
  const aggregateDuration = moment.duration(1, params.aggregateDurationUnit)
93
102
  .toISOString();
94
103
  let i = -1;
@@ -142,7 +151,10 @@ exports.aggregatePlaceOrder = aggregatePlaceOrder;
142
151
  function aggregateAuthorizeEventServiceOfferAction(params) {
143
152
  return (repos) => __awaiter(this, void 0, void 0, function* () {
144
153
  var _a;
145
- const aggregateDate = new Date();
154
+ const { aggregateDate } = params;
155
+ if (!(aggregateDate instanceof Date)) {
156
+ throw new factory.errors.Argument('aggregateDate', 'must be Date');
157
+ }
146
158
  const aggregateDuration = moment.duration(1, params.aggregateDurationUnit)
147
159
  .toISOString();
148
160
  let i = -1;
@@ -179,7 +191,10 @@ exports.aggregateAuthorizeEventServiceOfferAction = aggregateAuthorizeEventServi
179
191
  function aggregateAuthorizePaymentAction(params) {
180
192
  return (repos) => __awaiter(this, void 0, void 0, function* () {
181
193
  var _a;
182
- const aggregateDate = new Date();
194
+ const { aggregateDate } = params;
195
+ if (!(aggregateDate instanceof Date)) {
196
+ throw new factory.errors.Argument('aggregateDate', 'must be Date');
197
+ }
183
198
  const aggregateDuration = moment.duration(1, params.aggregateDurationUnit)
184
199
  .toISOString();
185
200
  let i = -1;
@@ -213,7 +228,10 @@ exports.aggregateAuthorizePaymentAction = aggregateAuthorizePaymentAction;
213
228
  function aggregateAuthorizeOrderAction(params) {
214
229
  return (repos) => __awaiter(this, void 0, void 0, function* () {
215
230
  var _a;
216
- const aggregateDate = new Date();
231
+ const { aggregateDate } = params;
232
+ if (!(aggregateDate instanceof Date)) {
233
+ throw new factory.errors.Argument('aggregateDate', 'must be Date');
234
+ }
217
235
  const aggregateDuration = moment.duration(1, params.aggregateDurationUnit)
218
236
  .toISOString();
219
237
  let i = -1;
@@ -250,7 +268,10 @@ exports.aggregateAuthorizeOrderAction = aggregateAuthorizeOrderAction;
250
268
  function aggregateUseAction(params) {
251
269
  return (repos) => __awaiter(this, void 0, void 0, function* () {
252
270
  var _a;
253
- const aggregateDate = new Date();
271
+ const { aggregateDate } = params;
272
+ if (!(aggregateDate instanceof Date)) {
273
+ throw new factory.errors.Argument('aggregateDate', 'must be Date');
274
+ }
254
275
  const aggregateDuration = moment.duration(1, params.aggregateDurationUnit)
255
276
  .toISOString();
256
277
  let i = -1;
@@ -287,7 +308,10 @@ exports.aggregateUseAction = aggregateUseAction;
287
308
  function aggregateReserveAction(params) {
288
309
  return (repos) => __awaiter(this, void 0, void 0, function* () {
289
310
  var _a;
290
- const aggregateDate = new Date();
311
+ const { aggregateDate } = params;
312
+ if (!(aggregateDate instanceof Date)) {
313
+ throw new factory.errors.Argument('aggregateDate', 'must be Date');
314
+ }
291
315
  const aggregateDuration = moment.duration(1, params.aggregateDurationUnit)
292
316
  .toISOString();
293
317
  let i = -1;
@@ -324,7 +348,10 @@ exports.aggregateReserveAction = aggregateReserveAction;
324
348
  function aggregateOrderAction(params) {
325
349
  return (repos) => __awaiter(this, void 0, void 0, function* () {
326
350
  var _a;
327
- const aggregateDate = new Date();
351
+ const { aggregateDate } = params;
352
+ if (!(aggregateDate instanceof Date)) {
353
+ throw new factory.errors.Argument('aggregateDate', 'must be Date');
354
+ }
328
355
  const aggregateDuration = moment.duration(1, params.aggregateDurationUnit)
329
356
  .toISOString();
330
357
  let i = -1;
@@ -361,7 +388,10 @@ exports.aggregateOrderAction = aggregateOrderAction;
361
388
  function aggregateCancelReservationAction(params) {
362
389
  return (repos) => __awaiter(this, void 0, void 0, function* () {
363
390
  var _a;
364
- const aggregateDate = new Date();
391
+ const { aggregateDate } = params;
392
+ if (!(aggregateDate instanceof Date)) {
393
+ throw new factory.errors.Argument('aggregateDate', 'must be Date');
394
+ }
365
395
  const aggregateDuration = moment.duration(1, params.aggregateDurationUnit)
366
396
  .toISOString();
367
397
  let i = -1;
@@ -394,7 +424,10 @@ exports.aggregateCancelReservationAction = aggregateCancelReservationAction;
394
424
  function aggregateCheckMovieTicketAction(params) {
395
425
  return (repos) => __awaiter(this, void 0, void 0, function* () {
396
426
  var _a;
397
- const aggregateDate = new Date();
427
+ const { aggregateDate } = params;
428
+ if (!(aggregateDate instanceof Date)) {
429
+ throw new factory.errors.Argument('aggregateDate', 'must be Date');
430
+ }
398
431
  const aggregateDuration = moment.duration(1, params.aggregateDurationUnit)
399
432
  .toISOString();
400
433
  let i = -1;
@@ -427,7 +460,10 @@ exports.aggregateCheckMovieTicketAction = aggregateCheckMovieTicketAction;
427
460
  function aggregatePayMovieTicketAction(params) {
428
461
  return (repos) => __awaiter(this, void 0, void 0, function* () {
429
462
  var _a;
430
- const aggregateDate = new Date();
463
+ const { aggregateDate } = params;
464
+ if (!(aggregateDate instanceof Date)) {
465
+ throw new factory.errors.Argument('aggregateDate', 'must be Date');
466
+ }
431
467
  const aggregateDuration = moment.duration(1, params.aggregateDurationUnit)
432
468
  .toISOString();
433
469
  let i = -1;
@@ -460,7 +496,10 @@ exports.aggregatePayMovieTicketAction = aggregatePayMovieTicketAction;
460
496
  function aggregatePayTransaction(params) {
461
497
  return (repos) => __awaiter(this, void 0, void 0, function* () {
462
498
  var _a;
463
- const aggregateDate = new Date();
499
+ const { aggregateDate } = params;
500
+ if (!(aggregateDate instanceof Date)) {
501
+ throw new factory.errors.Argument('aggregateDate', 'must be Date');
502
+ }
464
503
  const aggregateDuration = moment.duration(1, params.aggregateDurationUnit)
465
504
  .toISOString();
466
505
  let i = -1;
@@ -497,7 +536,10 @@ exports.aggregatePayTransaction = aggregatePayTransaction;
497
536
  function aggregateReserveTransaction(params) {
498
537
  return (repos) => __awaiter(this, void 0, void 0, function* () {
499
538
  var _a;
500
- const aggregateDate = new Date();
539
+ const { aggregateDate } = params;
540
+ if (!(aggregateDate instanceof Date)) {
541
+ throw new factory.errors.Argument('aggregateDate', 'must be Date');
542
+ }
501
543
  const aggregateDuration = moment.duration(1, params.aggregateDurationUnit)
502
544
  .toISOString();
503
545
  let i = -1;
@@ -531,7 +573,10 @@ exports.aggregateReserveTransaction = aggregateReserveTransaction;
531
573
  function aggregateTask(params) {
532
574
  return (repos) => __awaiter(this, void 0, void 0, function* () {
533
575
  var _a;
534
- const aggregateDate = new Date();
576
+ const { aggregateDate } = params;
577
+ if (!(aggregateDate instanceof Date)) {
578
+ throw new factory.errors.Argument('aggregateDate', 'must be Date');
579
+ }
535
580
  const aggregateDuration = moment.duration(1, params.aggregateDurationUnit)
536
581
  .toISOString();
537
582
  let i = -1;
@@ -11,11 +11,11 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
11
11
  Object.defineProperty(exports, "__esModule", { value: true });
12
12
  exports.call = void 0;
13
13
  function call(params) {
14
- return ({ connection, credentials, settings, aggregationSettings }, options) => __awaiter(this, void 0, void 0, function* () {
15
- var _a;
16
- const aggregateOnSystem = (_a = aggregationSettings === null || aggregationSettings === void 0 ? void 0 : aggregationSettings.callableTask) === null || _a === void 0 ? void 0 : _a.aggregateOnSystem;
14
+ return (executeSettings, options) => __awaiter(this, void 0, void 0, function* () {
15
+ var _a, _b;
16
+ const aggregateOnSystem = (_b = (_a = executeSettings.aggregationSettings) === null || _a === void 0 ? void 0 : _a.callableTask) === null || _b === void 0 ? void 0 : _b.aggregateOnSystem;
17
17
  if (typeof aggregateOnSystem === 'function') {
18
- yield aggregateOnSystem(params)({ connection, credentials, settings, aggregationSettings }, options);
18
+ yield aggregateOnSystem(params)(executeSettings, options);
19
19
  }
20
20
  });
21
21
  }
@@ -11,10 +11,11 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
11
11
  Object.defineProperty(exports, "__esModule", { value: true });
12
12
  exports.call = void 0;
13
13
  function call(params) {
14
- return ({ connection, credentials, settings, aggregationSettings }, options) => __awaiter(this, void 0, void 0, function* () {
15
- const handleNotification = aggregationSettings === null || aggregationSettings === void 0 ? void 0 : aggregationSettings.handleNotification;
14
+ return (executeSettings, options) => __awaiter(this, void 0, void 0, function* () {
15
+ var _a, _b;
16
+ const handleNotification = (_b = (_a = executeSettings.aggregationSettings) === null || _a === void 0 ? void 0 : _a.callableTask) === null || _b === void 0 ? void 0 : _b.handleNotification;
16
17
  if (typeof handleNotification === 'function') {
17
- yield handleNotification(params)({ connection, credentials, settings, aggregationSettings }, options);
18
+ yield handleNotification(params)(executeSettings, options);
18
19
  }
19
20
  });
20
21
  }
@@ -8,10 +8,13 @@ interface IOnReservationStatusChanged {
8
8
  }
9
9
  interface ICallableTask {
10
10
  aggregateOnSystem?: ICallableTaskOperation;
11
+ handleNotification?: ICallableTaskOperation;
11
12
  }
12
13
  interface IOptions {
14
+ /**
15
+ * タスク実行処理の実装
16
+ */
13
17
  callableTask?: ICallableTask;
14
- handleNotification?: ICallableTaskOperation;
15
18
  onOrderStatusChanged: IOnOrderStatusChanged;
16
19
  onReservationStatusChanged: IOnReservationStatusChanged;
17
20
  }
@@ -20,7 +23,6 @@ interface IOptions {
20
23
  */
21
24
  declare class AggregationSettings {
22
25
  readonly callableTask?: ICallableTask;
23
- readonly handleNotification?: ICallableTaskOperation;
24
26
  readonly onOrderStatusChanged: IOnOrderStatusChanged;
25
27
  readonly onReservationStatusChanged: IOnReservationStatusChanged;
26
28
  constructor(options: IOptions);
@@ -6,15 +6,12 @@ exports.AggregationSettings = void 0;
6
6
  */
7
7
  class AggregationSettings {
8
8
  constructor(options) {
9
- const { callableTask, handleNotification, onOrderStatusChanged, onReservationStatusChanged } = options;
9
+ const { callableTask, onOrderStatusChanged, onReservationStatusChanged } = options;
10
10
  this.onOrderStatusChanged = onOrderStatusChanged;
11
11
  this.onReservationStatusChanged = onReservationStatusChanged;
12
12
  if (callableTask !== undefined) {
13
13
  this.callableTask = callableTask;
14
14
  }
15
- if (handleNotification !== undefined) {
16
- this.handleNotification = handleNotification;
17
- }
18
15
  }
19
16
  }
20
17
  exports.AggregationSettings = AggregationSettings;
package/package.json CHANGED
@@ -11,8 +11,8 @@
11
11
  "dependencies": {
12
12
  "@aws-sdk/client-cognito-identity-provider": "3.600.0",
13
13
  "@aws-sdk/credential-providers": "3.600.0",
14
- "@chevre/factory": "4.389.0-alpha.2",
15
- "@cinerino/sdk": "10.16.0-alpha.5",
14
+ "@chevre/factory": "4.389.0-alpha.3",
15
+ "@cinerino/sdk": "10.16.0-alpha.6",
16
16
  "@motionpicture/coa-service": "9.5.0",
17
17
  "@motionpicture/gmo-service": "5.3.0",
18
18
  "@sendgrid/mail": "6.4.0",
@@ -108,5 +108,5 @@
108
108
  "postversion": "git push origin --tags",
109
109
  "prepublishOnly": "npm run clean && npm run build && npm test && npm run doc"
110
110
  },
111
- "version": "22.6.0-alpha.3"
111
+ "version": "22.6.0-alpha.5"
112
112
  }