@chevre/domain 22.6.0-alpha.25 → 22.6.0-alpha.27
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.
- package/example/src/chevre/findInterface.ts +2 -9
- package/lib/chevre/repo/mongoose/schemas/schedule.d.ts +1 -1
- package/lib/chevre/repo/schedule.d.ts +2 -3
- package/lib/chevre/repo/schedule.js +3 -5
- package/lib/chevre/service/task/createEvent/createEventBySchedule.js +63 -62
- package/package.json +2 -2
|
@@ -20,7 +20,7 @@ async function main() {
|
|
|
20
20
|
if (findOneIdResult === null) {
|
|
21
21
|
if (typeof COA_ENDPOINT === 'string' && typeof COA_REFRESH_TOKEN === 'string') {
|
|
22
22
|
await interfaceRepo.saveOne({
|
|
23
|
-
project: { id: '
|
|
23
|
+
project: { id: 'xxx', typeOf: chevre.factory.organizationType.Project },
|
|
24
24
|
availableChannel: {
|
|
25
25
|
typeOf: 'ServiceChannel',
|
|
26
26
|
credentials: {
|
|
@@ -30,14 +30,7 @@ async function main() {
|
|
|
30
30
|
},
|
|
31
31
|
importEventsInWeeks: 5,
|
|
32
32
|
excludeMovieTheaters: [
|
|
33
|
-
'
|
|
34
|
-
'106',
|
|
35
|
-
'108',
|
|
36
|
-
'113',
|
|
37
|
-
'114',
|
|
38
|
-
'115',
|
|
39
|
-
'116',
|
|
40
|
-
'121'
|
|
33
|
+
'007'
|
|
41
34
|
]
|
|
42
35
|
},
|
|
43
36
|
typeOf: 'WebAPI'
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { IndexDefinition, IndexOptions, Model, Schema, SchemaDefinition } from 'mongoose';
|
|
2
2
|
import * as factory from '../../../factory';
|
|
3
|
-
type IDocType = factory.schedule.
|
|
3
|
+
type IDocType = factory.schedule.IEventWithSchedule;
|
|
4
4
|
type IModel = Model<IDocType>;
|
|
5
5
|
type ISchemaDefinition = SchemaDefinition<IDocType>;
|
|
6
6
|
type ISchema = Schema<IDocType, IModel, {}, {}, {}, {}, ISchemaDefinition, IDocType>;
|
|
@@ -6,7 +6,6 @@ import * as factory from '../factory';
|
|
|
6
6
|
export declare class ScheduleRepo {
|
|
7
7
|
private readonly scheduleModel;
|
|
8
8
|
constructor(connection: Connection);
|
|
9
|
-
saveOne(params: factory.schedule.ISchedule4ttts): Promise<void>;
|
|
10
9
|
findOne(filter: {
|
|
11
10
|
id?: {
|
|
12
11
|
$eq?: string;
|
|
@@ -16,8 +15,8 @@ export declare class ScheduleRepo {
|
|
|
16
15
|
$eq?: string;
|
|
17
16
|
};
|
|
18
17
|
};
|
|
19
|
-
}): Promise<factory.schedule.
|
|
20
|
-
findOneId(): Promise<(Pick<factory.schedule.
|
|
18
|
+
}): Promise<factory.schedule.IEventWithSchedule | null>;
|
|
19
|
+
findOneId(): Promise<(Pick<factory.schedule.IEventWithSchedule, 'project'> & {
|
|
21
20
|
id: string;
|
|
22
21
|
}) | null>;
|
|
23
22
|
}
|
|
@@ -18,11 +18,9 @@ class ScheduleRepo {
|
|
|
18
18
|
constructor(connection) {
|
|
19
19
|
this.scheduleModel = connection.model(schedule_1.modelName, (0, schedule_1.createSchema)());
|
|
20
20
|
}
|
|
21
|
-
saveOne(params) {
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
});
|
|
25
|
-
}
|
|
21
|
+
// public async saveOne(params: factory.schedule.IEventWithSchedule): Promise<void> {
|
|
22
|
+
// await this.scheduleModel.create(params);
|
|
23
|
+
// }
|
|
26
24
|
findOne(filter) {
|
|
27
25
|
var _a, _b, _c;
|
|
28
26
|
return __awaiter(this, void 0, void 0, function* () {
|
|
@@ -16,7 +16,9 @@ const moment = require("moment-timezone");
|
|
|
16
16
|
const factory = require("../../../factory");
|
|
17
17
|
const event_1 = require("../../event");
|
|
18
18
|
const debug = createDebug('chevre-domain:service:task');
|
|
19
|
-
function createEvents(
|
|
19
|
+
function createEvents(
|
|
20
|
+
// schedule: factory.schedule.ISchedule4ttts | factory.schedule.IEventWithSchedule,
|
|
21
|
+
schedule, createDate) {
|
|
20
22
|
// tslint:disable-next-line:cyclomatic-complexity max-func-body-length
|
|
21
23
|
return (repos, settings) => __awaiter(this, void 0, void 0, function* () {
|
|
22
24
|
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
@@ -36,9 +38,10 @@ function createEvents(schedule, createDate) {
|
|
|
36
38
|
}
|
|
37
39
|
const project = schedule.project;
|
|
38
40
|
// 引数情報取得
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
41
|
+
if (schedule.eventSchedule === undefined) {
|
|
42
|
+
throw new factory.errors.NotFound('eventSchedule');
|
|
43
|
+
}
|
|
44
|
+
const targetInfo = getTargetInfoByEventWithSchedule(schedule, createDate);
|
|
42
45
|
debug(targetInfo.length, 'targetInfos ->', targetInfo);
|
|
43
46
|
// fs.writeFileSync(
|
|
44
47
|
// `${__dirname}/../../../../../targetInfo_${schedule.eventSchedule?.typeOf}.json`,
|
|
@@ -230,64 +233,62 @@ function createEvents(schedule, createDate) {
|
|
|
230
233
|
/**
|
|
231
234
|
* パフォーマンス作成・作成対象情報取得
|
|
232
235
|
*/
|
|
233
|
-
function getTargetInfoForCreateFromSetting(
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
return performanceInfos;
|
|
290
|
-
}
|
|
236
|
+
// function getTargetInfoForCreateFromSetting(
|
|
237
|
+
// settings: factory.schedule.ISchedule4ttts,
|
|
238
|
+
// createDate: Date
|
|
239
|
+
// ): ITargetPerformanceInfo[] {
|
|
240
|
+
// const performanceInfos: ITargetPerformanceInfo[] = [];
|
|
241
|
+
// const { days, duration, noPerformanceTimes, hours, minutes, tours } = settings;
|
|
242
|
+
// // 本日日付+開始日までの日数から作成開始日セット
|
|
243
|
+
// // 作成日数分の作成対象日付作成
|
|
244
|
+
// for (let index = 0; index < days; index = index + 1) {
|
|
245
|
+
// const now = (createDate instanceof Date)
|
|
246
|
+
// ? moment(createDate)
|
|
247
|
+
// .add(index, 'days')
|
|
248
|
+
// : moment()
|
|
249
|
+
// .add(index, 'days');
|
|
250
|
+
// hours.forEach((hourStr) => {
|
|
251
|
+
// // 2桁でない時は'0'詰め
|
|
252
|
+
// // tslint:disable-next-line:no-magic-numbers
|
|
253
|
+
// const hour = `0${hourStr}`.slice(-2);
|
|
254
|
+
// minutes.forEach((minute, minuteIndex) => {
|
|
255
|
+
// // ツアー情報作成
|
|
256
|
+
// const tourNumber = `${hour}${tours[minuteIndex]}`;
|
|
257
|
+
// const startDate = moment(
|
|
258
|
+
// `${now.tz('Asia/Tokyo')
|
|
259
|
+
// .format('YYYYMMDD')} ${hour}:${minute}:00+09:00`,
|
|
260
|
+
// 'YYYYMMDD HH:mm:ssZ'
|
|
261
|
+
// );
|
|
262
|
+
// const endDate = moment(startDate)
|
|
263
|
+
// .add(duration, 'minutes');
|
|
264
|
+
// const day = moment(startDate)
|
|
265
|
+
// .tz('Asia/Tokyo')
|
|
266
|
+
// .format('YYYYMMDD');
|
|
267
|
+
// const startTime = moment(startDate)
|
|
268
|
+
// .tz('Asia/Tokyo')
|
|
269
|
+
// .format('HHmm');
|
|
270
|
+
// const endTime = moment(endDate)
|
|
271
|
+
// .tz('Asia/Tokyo')
|
|
272
|
+
// .format('HHmm');
|
|
273
|
+
// // パフォーマンスを作成しない時刻に指定されていなかったら作成
|
|
274
|
+
// if (noPerformanceTimes.indexOf(`${hour}${minute}`) < 0) {
|
|
275
|
+
// performanceInfos.push({
|
|
276
|
+
// day: day,
|
|
277
|
+
// start_time: startTime,
|
|
278
|
+
// end_time: endTime,
|
|
279
|
+
// door_time: startDate.toDate(),
|
|
280
|
+
// start_date: startDate.toDate(),
|
|
281
|
+
// end_date: endDate.toDate(),
|
|
282
|
+
// tour_number: tourNumber,
|
|
283
|
+
// duration: moment.duration(duration, 'minutes')
|
|
284
|
+
// .toISOString()
|
|
285
|
+
// });
|
|
286
|
+
// }
|
|
287
|
+
// });
|
|
288
|
+
// });
|
|
289
|
+
// }
|
|
290
|
+
// return performanceInfos;
|
|
291
|
+
// }
|
|
291
292
|
function getTargetInfoByEventWithSchedule(settings, createDate) {
|
|
292
293
|
const performanceInfos = [];
|
|
293
294
|
const { eventSchedule } = settings;
|
package/package.json
CHANGED
|
@@ -11,7 +11,7 @@
|
|
|
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.
|
|
14
|
+
"@chevre/factory": "4.389.0-alpha.18",
|
|
15
15
|
"@cinerino/sdk": "10.16.0-alpha.9",
|
|
16
16
|
"@motionpicture/coa-service": "9.5.0",
|
|
17
17
|
"@motionpicture/gmo-service": "5.3.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.
|
|
111
|
+
"version": "22.6.0-alpha.27"
|
|
112
112
|
}
|