@chevre/domain 23.2.0-alpha.58 → 23.2.0-alpha.59
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/event/importEventsFromCOAByTitle.ts +1 -1
- package/example/src/chevre/eventSeries/upsertScreeningEventSeriesByVersion.ts +0 -1
- package/example/src/chevre/settings/addOrderNumberSetting.ts +1 -1
- package/lib/chevre/factory/event.d.ts +1 -1
- package/lib/chevre/factory/event.js +11 -8
- package/lib/chevre/repo/event.d.ts +1 -1
- package/lib/chevre/repo/eventSeries.d.ts +5 -22
- package/lib/chevre/repo/eventSeries.js +97 -77
- package/lib/chevre/repo/mongoose/schemas/eventSeries.js +4 -26
- package/lib/chevre/service/event/saveScreeningEventSeries.js +4 -5
- package/lib/chevre/service/event/saveScreeningEvents.d.ts +1 -1
- package/lib/chevre/service/event/saveScreeningEvents.js +18 -10
- package/lib/chevre/service/offer/onEventChanged.js +3 -1
- package/lib/chevre/service/task/createEvent/createEventBySchedule/factory.d.ts +1 -1
- package/lib/chevre/service/task/createEvent/createEventBySchedule/schedule2events.js +3 -1
- package/lib/chevre/service/task/syncResourcesFromCOA.js +3 -1
- package/package.json +3 -3
- package/example/src/chevre/eventSeries/migrateEventSeriesOffers.ts +0 -75
- package/example/src/chevre/eventSeries/migrateEventSeriesUnacceptedPaymentMethod.ts +0 -93
- package/example/src/chevre/eventSeries/migrateEventSeriesVideoFormat.ts +0 -80
|
@@ -87,7 +87,7 @@ async function main() {
|
|
|
87
87
|
[
|
|
88
88
|
'project', 'typeOf', 'eventStatus', 'identifier',
|
|
89
89
|
'name', 'kanaName', 'alternativeHeadline', 'location',
|
|
90
|
-
'organizer', '
|
|
90
|
+
'organizer', 'soundFormat', 'workPerformed',
|
|
91
91
|
'duration', 'endDate', 'startDate', 'coaInfo',
|
|
92
92
|
'offers', 'additionalProperty'
|
|
93
93
|
]
|
|
@@ -4,5 +4,5 @@ export type IMinimizedIndividualEvent = Pick<factory.event.screeningEvent.IEvent
|
|
|
4
4
|
* 興行イベントのsuperEventを作成する
|
|
5
5
|
*/
|
|
6
6
|
export declare function minimizeSuperEvent(params: {
|
|
7
|
-
superEventFromDB: Pick<factory.eventSeries.IEvent, 'additionalProperty' | 'alternativeHeadline' | 'description' | 'dubLanguage' | 'endDate' | 'headline' | 'id' | 'kanaName' | 'location' | 'name' | 'soundFormat' | 'startDate' | 'subtitleLanguage' | 'typeOf' | '
|
|
7
|
+
superEventFromDB: Pick<factory.eventSeries.IEvent, 'additionalProperty' | 'alternativeHeadline' | 'description' | 'dubLanguage' | 'endDate' | 'headline' | 'id' | 'kanaName' | 'location' | 'name' | 'soundFormat' | 'startDate' | 'subtitleLanguage' | 'typeOf' | 'workPerformed'>;
|
|
8
8
|
}): factory.event.screeningEvent.ISuperEvent;
|
|
@@ -2,7 +2,6 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.minimizeSuperEvent = minimizeSuperEvent;
|
|
4
4
|
const factory = require("../factory");
|
|
5
|
-
const USE_DEPRECATED_VIDEO_FORMAT_EVENTS = process.env.USE_DEPRECATED_VIDEO_FORMAT_EVENTS === '1';
|
|
6
5
|
/**
|
|
7
6
|
* 興行イベントのsuperEventを作成する
|
|
8
7
|
*/
|
|
@@ -24,7 +23,7 @@ function minimizeSuperEvent(params) {
|
|
|
24
23
|
// ? { kanaName: params.superEventFromDB.location.kanaName }
|
|
25
24
|
// : undefined
|
|
26
25
|
);
|
|
27
|
-
return Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(
|
|
26
|
+
return Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({ typeOf: factory.eventType.ScreeningEventSeries, id: params.superEventFromDB.id, soundFormat: params.superEventFromDB.soundFormat, workPerformed,
|
|
28
27
|
location, kanaName: params.superEventFromDB.kanaName, name: Object.assign(Object.assign({}, (typeof params.superEventFromDB.name.en === 'string') ? { en: params.superEventFromDB.name.en } : undefined), (typeof params.superEventFromDB.name.ja === 'string') ? { ja: params.superEventFromDB.name.ja } : undefined) }, (Array.isArray(params.superEventFromDB.additionalProperty))
|
|
29
28
|
? { additionalProperty: params.superEventFromDB.additionalProperty }
|
|
30
29
|
: undefined), (params.superEventFromDB.startDate instanceof Date)
|
|
@@ -39,10 +38,14 @@ function minimizeSuperEvent(params) {
|
|
|
39
38
|
? { dubLanguage: params.superEventFromDB.dubLanguage }
|
|
40
39
|
: undefined), (params.superEventFromDB.subtitleLanguage !== undefined)
|
|
41
40
|
? { subtitleLanguage: params.superEventFromDB.subtitleLanguage }
|
|
42
|
-
: undefined
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
41
|
+
: undefined
|
|
42
|
+
// 完全に廃止(2026-02-10~)
|
|
43
|
+
// // videoFormatをデータとしても廃止(万が一に備えてUSE_DEPRECATED_VIDEO_FORMAT_EVENTSで再設定可能)(2026-02-04~)
|
|
44
|
+
// ...(USE_DEPRECATED_VIDEO_FORMAT_EVENTS)
|
|
45
|
+
// ? {
|
|
46
|
+
// // 現時点で型廃止済だがデータとしては互換性維持(2026-01-15~)
|
|
47
|
+
// videoFormat: params.superEventFromDB.videoFormat
|
|
48
|
+
// }
|
|
49
|
+
// : undefined
|
|
50
|
+
);
|
|
48
51
|
}
|
|
@@ -210,7 +210,7 @@ export declare class EventRepo {
|
|
|
210
210
|
project: {
|
|
211
211
|
id: string;
|
|
212
212
|
};
|
|
213
|
-
superEventFromDB: Pick<factory.eventSeries.IEvent, 'additionalProperty' | 'alternativeHeadline' | 'description' | 'dubLanguage' | 'endDate' | 'headline' | 'id' | 'kanaName' | 'location' | 'name' | 'soundFormat' | 'startDate' | 'subtitleLanguage' | 'typeOf' | '
|
|
213
|
+
superEventFromDB: Pick<factory.eventSeries.IEvent, 'additionalProperty' | 'alternativeHeadline' | 'description' | 'dubLanguage' | 'endDate' | 'headline' | 'id' | 'kanaName' | 'location' | 'name' | 'soundFormat' | 'startDate' | 'subtitleLanguage' | 'typeOf' | 'workPerformed'>;
|
|
214
214
|
startDate: {
|
|
215
215
|
$gte: Date;
|
|
216
216
|
};
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import type { BulkWriteResult } from 'mongodb';
|
|
2
|
-
import type { Connection,
|
|
2
|
+
import type { Connection, FilterQuery } from 'mongoose';
|
|
3
3
|
import * as factory from '../factory';
|
|
4
4
|
type ISearchConditions = factory.eventSeries.ISearchConditions;
|
|
5
|
-
type IKeyOfProjection = Exclude<keyof factory.eventSeries.IEvent, 'id'>;
|
|
5
|
+
type IKeyOfProjection = Exclude<keyof factory.eventSeries.IEvent, 'id' | 'videoFormat'>;
|
|
6
6
|
type IUnset = {
|
|
7
7
|
[key in keyof factory.eventSeries.IEvent]?: 1;
|
|
8
8
|
};
|
|
@@ -13,13 +13,6 @@ export declare class EventSeriesRepo {
|
|
|
13
13
|
private readonly eventSeriesModel;
|
|
14
14
|
constructor(connection: Connection);
|
|
15
15
|
static CREATE_MONGO_CONDITIONS(conditions: ISearchConditions): FilterQuery<factory.eventSeries.IEvent>[];
|
|
16
|
-
/**
|
|
17
|
-
* 複数イベントを作成する
|
|
18
|
-
*/
|
|
19
|
-
createManyEventSeries(params: {
|
|
20
|
-
attributes: factory.eventSeries.IAttributes[];
|
|
21
|
-
expectsNoContent: boolean;
|
|
22
|
-
}): Promise<string[] | void>;
|
|
23
16
|
/**
|
|
24
17
|
* コンテンツ+バージョンをキーにして、なければ作成する(複数対応)
|
|
25
18
|
*/
|
|
@@ -44,16 +37,6 @@ export declare class EventSeriesRepo {
|
|
|
44
37
|
id: string;
|
|
45
38
|
}[];
|
|
46
39
|
}>;
|
|
47
|
-
saveEventSeries(params: {
|
|
48
|
-
id?: string;
|
|
49
|
-
attributes: factory.eventSeries.IAttributes;
|
|
50
|
-
/**
|
|
51
|
-
* ドキュメント作成時には無視される
|
|
52
|
-
*/
|
|
53
|
-
$unset?: IUnset;
|
|
54
|
-
}): Promise<{
|
|
55
|
-
id: string;
|
|
56
|
-
}>;
|
|
57
40
|
/**
|
|
58
41
|
* sskts施設コンテンツ保管
|
|
59
42
|
*/
|
|
@@ -64,7 +47,7 @@ export declare class EventSeriesRepo {
|
|
|
64
47
|
/**
|
|
65
48
|
* イベントを検索する(inclusion projection)
|
|
66
49
|
*/
|
|
67
|
-
projectEventSeriesFields(params: ISearchConditions, inclusion: IKeyOfProjection[]): Promise<factory.eventSeries.IEvent[]>;
|
|
50
|
+
projectEventSeriesFields(params: ISearchConditions, inclusion: IKeyOfProjection[]): Promise<Omit<factory.eventSeries.IEvent, 'videoFormat'>[]>;
|
|
68
51
|
deleteEventSeriesById(params: {
|
|
69
52
|
project: {
|
|
70
53
|
id: string;
|
|
@@ -109,13 +92,13 @@ export declare class EventSeriesRepo {
|
|
|
109
92
|
}): Promise<{
|
|
110
93
|
maxVersion: string;
|
|
111
94
|
}>;
|
|
112
|
-
getCursor(conditions: FilterQuery<any>, projection: any): import("mongoose").Cursor<Document<unknown, {}, factory.eventSeries.IAttributes & {
|
|
95
|
+
getCursor(conditions: FilterQuery<any>, projection: any): import("mongoose").Cursor<import("mongoose").Document<unknown, {}, factory.eventSeries.IAttributes & {
|
|
113
96
|
_id: string;
|
|
114
97
|
}> & factory.eventSeries.IAttributes & {
|
|
115
98
|
_id: string;
|
|
116
99
|
} & Required<{
|
|
117
100
|
_id: string;
|
|
118
|
-
}>, import("mongoose").QueryOptions<Document<unknown, {}, factory.eventSeries.IAttributes & {
|
|
101
|
+
}>, import("mongoose").QueryOptions<import("mongoose").Document<unknown, {}, factory.eventSeries.IAttributes & {
|
|
119
102
|
_id: string;
|
|
120
103
|
}> & factory.eventSeries.IAttributes & {
|
|
121
104
|
_id: string;
|
|
@@ -23,7 +23,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
23
23
|
exports.EventSeriesRepo = void 0;
|
|
24
24
|
const factory = require("../factory");
|
|
25
25
|
const eventSeries_1 = require("./mongoose/schemas/eventSeries");
|
|
26
|
-
|
|
26
|
+
// import { isMongoError, MongoErrorCode } from '../errorHandler';
|
|
27
27
|
const settings_1 = require("../settings");
|
|
28
28
|
/**
|
|
29
29
|
* 施設コンテンツリポジトリ
|
|
@@ -224,34 +224,40 @@ class EventSeriesRepo {
|
|
|
224
224
|
}
|
|
225
225
|
return andConditions;
|
|
226
226
|
}
|
|
227
|
-
/**
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
createManyEventSeries(params
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
227
|
+
// /**
|
|
228
|
+
// * 複数イベントを作成する
|
|
229
|
+
// */
|
|
230
|
+
// public async createManyEventSeries(params: {
|
|
231
|
+
// attributes: factory.eventSeries.IAttributes[];
|
|
232
|
+
// expectsNoContent: boolean;
|
|
233
|
+
// }): Promise<string[] | void> { // optimize response(only id)(2024-08-02~)
|
|
234
|
+
// const uniqid = await import('uniqid');
|
|
235
|
+
// const insertingDocs: (factory.eventSeries.IAttributes & { _id: string })[] =
|
|
236
|
+
// params.attributes.map((p) => {
|
|
237
|
+
// return {
|
|
238
|
+
// _id: uniqid(),
|
|
239
|
+
// ...p
|
|
240
|
+
// };
|
|
241
|
+
// });
|
|
242
|
+
// try {
|
|
243
|
+
// await this.eventSeriesModel.insertMany<factory.eventSeries.IAttributes & { _id: string }>(
|
|
244
|
+
// insertingDocs,
|
|
245
|
+
// { rawResult: true } // rawResult(2024-08-02~)
|
|
246
|
+
// );
|
|
247
|
+
// // console.dir(insertResult, { depth: null });
|
|
248
|
+
// } catch (error) {
|
|
249
|
+
// if (await isMongoError(error)) {
|
|
250
|
+
// if (error.code === MongoErrorCode.DuplicateKey) {
|
|
251
|
+
// throw new factory.errors.AlreadyInUse(factory.eventType.ScreeningEventSeries, ['workPerformed.version']);
|
|
252
|
+
// }
|
|
253
|
+
// }
|
|
254
|
+
// throw error;
|
|
255
|
+
// }
|
|
256
|
+
// if (params.expectsNoContent) {
|
|
257
|
+
// return;
|
|
258
|
+
// }
|
|
259
|
+
// return insertingDocs.map(({ _id }) => _id);
|
|
260
|
+
// }
|
|
255
261
|
/**
|
|
256
262
|
* コンテンツ+バージョンをキーにして、なければ作成する(複数対応)
|
|
257
263
|
*/
|
|
@@ -374,54 +380,68 @@ class EventSeriesRepo {
|
|
|
374
380
|
return { modifiedEvents: [] };
|
|
375
381
|
});
|
|
376
382
|
}
|
|
377
|
-
saveEventSeries(params
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
383
|
+
// public async saveEventSeries(params: {
|
|
384
|
+
// id?: string;
|
|
385
|
+
// attributes: factory.eventSeries.IAttributes;
|
|
386
|
+
// /**
|
|
387
|
+
// * ドキュメント作成時には無視される
|
|
388
|
+
// */
|
|
389
|
+
// $unset?: IUnset;
|
|
390
|
+
// // upsert?: boolean;
|
|
391
|
+
// }): Promise<{ id: string }> {
|
|
392
|
+
// let savedEventId: string;
|
|
393
|
+
// let doc: Document | { _id: string } | null;
|
|
394
|
+
// const { identifier, project, typeOf, ...updateFields } = params.attributes;
|
|
395
|
+
// if (typeof typeOf !== 'string' || typeOf.length === 0) {
|
|
396
|
+
// throw new factory.errors.ArgumentNull('attributes.typeOf');
|
|
397
|
+
// }
|
|
398
|
+
// try {
|
|
399
|
+
// if (params.id === undefined) {
|
|
400
|
+
// const uniqid = await import('uniqid');
|
|
401
|
+
// const id = uniqid();
|
|
402
|
+
// doc = await this.eventSeriesModel.create({ ...params.attributes, _id: id });
|
|
403
|
+
// savedEventId = id;
|
|
404
|
+
// } else {
|
|
405
|
+
// // const upsert: boolean = params.upsert === true;
|
|
406
|
+
// const upsert: boolean = false;
|
|
407
|
+
// doc = await this.eventSeriesModel.findOneAndUpdate(
|
|
408
|
+
// {
|
|
409
|
+
// _id: { $eq: params.id },
|
|
410
|
+
// typeOf: { $eq: typeOf }
|
|
411
|
+
// },
|
|
412
|
+
// {
|
|
413
|
+
// // 上書き禁止属性を除外(2022-08-24~)
|
|
414
|
+
// $setOnInsert: {
|
|
415
|
+
// typeOf,
|
|
416
|
+
// project,
|
|
417
|
+
// ...(identifier !== undefined) ? { identifier } : undefined
|
|
418
|
+
// },
|
|
419
|
+
// $set: updateFields,
|
|
420
|
+
// ...(params.$unset !== undefined) ? { $unset: params.$unset } : undefined
|
|
421
|
+
// },
|
|
422
|
+
// {
|
|
423
|
+
// upsert,
|
|
424
|
+
// new: true,
|
|
425
|
+
// projection: { _id: 1 }
|
|
426
|
+
// }
|
|
427
|
+
// )
|
|
428
|
+
// .lean<{ _id: string }>()
|
|
429
|
+
// .exec();
|
|
430
|
+
// savedEventId = params.id;
|
|
431
|
+
// }
|
|
432
|
+
// } catch (error) {
|
|
433
|
+
// if (await isMongoError(error)) {
|
|
434
|
+
// if (error.code === MongoErrorCode.DuplicateKey) {
|
|
435
|
+
// throw new factory.errors.AlreadyInUse(factory.eventType.ScreeningEventSeries, ['workPerformed.version']);
|
|
436
|
+
// }
|
|
437
|
+
// }
|
|
438
|
+
// throw error;
|
|
439
|
+
// }
|
|
440
|
+
// if (doc === null) {
|
|
441
|
+
// throw new factory.errors.NotFound(this.eventSeriesModel.modelName);
|
|
442
|
+
// }
|
|
443
|
+
// return { id: savedEventId }; // optimize(2024-07-31~)
|
|
444
|
+
// }
|
|
425
445
|
/**
|
|
426
446
|
* sskts施設コンテンツ保管
|
|
427
447
|
*/
|
|
@@ -8,32 +8,10 @@ const factory = require("../../../factory");
|
|
|
8
8
|
const settings_1 = require("../../../settings");
|
|
9
9
|
const modelName = 'EventSeries';
|
|
10
10
|
exports.modelName = modelName;
|
|
11
|
-
const schemaDefinition = {
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
typeOf: { type: String, required: true },
|
|
16
|
-
identifier: String,
|
|
17
|
-
name: mongoose_1.SchemaTypes.Mixed,
|
|
18
|
-
additionalProperty: mongoose_1.SchemaTypes.Mixed,
|
|
19
|
-
alternativeHeadline: mongoose_1.SchemaTypes.Mixed,
|
|
20
|
-
description: mongoose_1.SchemaTypes.Mixed,
|
|
21
|
-
duration: String,
|
|
22
|
-
endDate: { type: Date, required: true }, // required(2025-10-08~)
|
|
23
|
-
eventStatus: String,
|
|
24
|
-
headline: mongoose_1.SchemaTypes.Mixed,
|
|
25
|
-
location: mongoose_1.SchemaTypes.Mixed,
|
|
26
|
-
startDate: { type: Date, required: true }, // required(2025-10-08~)
|
|
27
|
-
subEvent: mongoose_1.SchemaTypes.Mixed, // support(2025-12-31~)
|
|
28
|
-
workPerformed: mongoose_1.SchemaTypes.Mixed,
|
|
29
|
-
videoFormat: mongoose_1.SchemaTypes.Mixed,
|
|
30
|
-
soundFormat: mongoose_1.SchemaTypes.Mixed,
|
|
31
|
-
subtitleLanguage: mongoose_1.SchemaTypes.Mixed,
|
|
32
|
-
dubLanguage: mongoose_1.SchemaTypes.Mixed,
|
|
33
|
-
kanaName: String,
|
|
34
|
-
offers: mongoose_1.SchemaTypes.Mixed,
|
|
35
|
-
coaInfo: mongoose_1.SchemaTypes.Mixed
|
|
36
|
-
};
|
|
11
|
+
const schemaDefinition = Object.assign({ project: { type: mongoose_1.SchemaTypes.Mixed, required: true }, organizer: { type: mongoose_1.SchemaTypes.Mixed, required: true }, _id: String, typeOf: { type: String, required: true }, identifier: String, name: mongoose_1.SchemaTypes.Mixed, additionalProperty: mongoose_1.SchemaTypes.Mixed, alternativeHeadline: mongoose_1.SchemaTypes.Mixed, description: mongoose_1.SchemaTypes.Mixed, duration: String, endDate: { type: Date, required: true }, eventStatus: String, headline: mongoose_1.SchemaTypes.Mixed, location: mongoose_1.SchemaTypes.Mixed, startDate: { type: Date, required: true }, subEvent: mongoose_1.SchemaTypes.Mixed, workPerformed: mongoose_1.SchemaTypes.Mixed, soundFormat: mongoose_1.SchemaTypes.Mixed, subtitleLanguage: mongoose_1.SchemaTypes.Mixed, dubLanguage: mongoose_1.SchemaTypes.Mixed, kanaName: String, offers: mongoose_1.SchemaTypes.Mixed, coaInfo: mongoose_1.SchemaTypes.Mixed }, {
|
|
12
|
+
// factory.eventSeries.IEventから廃止したので、ひとまずspread operatorで解決(2026-02-10~)
|
|
13
|
+
videoFormat: mongoose_1.SchemaTypes.Mixed
|
|
14
|
+
});
|
|
37
15
|
const schemaOptions = {
|
|
38
16
|
autoIndex: settings_1.MONGO_AUTO_INDEX,
|
|
39
17
|
autoCreate: false,
|
|
@@ -188,10 +188,9 @@ function createScreeningEventSeriesFromCOA(params) {
|
|
|
188
188
|
? { version: params.filmFromCOA.titleBranchNum } // add version(2024-01-31~)
|
|
189
189
|
: undefined);
|
|
190
190
|
// redefine videoFormat(2024-09-18~)
|
|
191
|
-
// const videoFormat: factory.
|
|
192
|
-
// params.
|
|
193
|
-
|
|
194
|
-
.map(({ kubunCode }) => ({ typeOf: kubunCode, name: kubunCode }));
|
|
191
|
+
// const videoFormat: factory.eventSeries.IVideoFormat[] =
|
|
192
|
+
// params.joueihousikiKubuns.filter(({ kubunCode }) => kubunCode === params.filmFromCOA.kbnJoueihousiki)
|
|
193
|
+
// .map(({ kubunCode }) => ({ typeOf: kubunCode, name: kubunCode }));
|
|
195
194
|
return {
|
|
196
195
|
project: { typeOf: params.project.typeOf, id: params.project.id },
|
|
197
196
|
typeOf: factory.eventType.ScreeningEventSeries,
|
|
@@ -214,7 +213,7 @@ function createScreeningEventSeriesFromCOA(params) {
|
|
|
214
213
|
},
|
|
215
214
|
// 必須化(2023-07-12~)
|
|
216
215
|
organizer: { id: params.seller.id },
|
|
217
|
-
videoFormat,
|
|
216
|
+
// videoFormat, // discontinue(2026-02-10~)
|
|
218
217
|
soundFormat: [],
|
|
219
218
|
workPerformed,
|
|
220
219
|
duration: moment.duration(params.filmFromCOA.showTime, 'm')
|
|
@@ -8,7 +8,7 @@ type IMovieTheater = Pick<factory.place.movieTheater.IPlace, 'id' | 'typeOf' | '
|
|
|
8
8
|
declare function saveScreeningEvents(params: {
|
|
9
9
|
movieTheater: IMovieTheater;
|
|
10
10
|
screeningRooms: Pick<factory.place.screeningRoom.IPlace, 'branchCode' | 'name' | 'maximumAttendeeCapacity'>[];
|
|
11
|
-
screeningEventSerieses?: factory.eventSeries.IEvent[];
|
|
11
|
+
screeningEventSerieses?: Omit<factory.eventSeries.IEvent, 'videoFormat'>[];
|
|
12
12
|
project: {
|
|
13
13
|
id: string;
|
|
14
14
|
typeOf: factory.organizationType.Project;
|
|
@@ -16,7 +16,6 @@ const createDebug = require("debug");
|
|
|
16
16
|
const moment = require("moment-timezone");
|
|
17
17
|
const factory = require("../../factory");
|
|
18
18
|
const saveScreeningEventSeries_1 = require("./saveScreeningEventSeries");
|
|
19
|
-
const USE_DEPRECATED_VIDEO_FORMAT_EVENTS = process.env.USE_DEPRECATED_VIDEO_FORMAT_EVENTS === '1';
|
|
20
19
|
const debug = createDebug('chevre-domain:service:event');
|
|
21
20
|
function saveScreeningEvents(params, options) {
|
|
22
21
|
return (repos) => __awaiter(this, void 0, void 0, function* () {
|
|
@@ -102,7 +101,9 @@ function createScreeningEvents(params, options) {
|
|
|
102
101
|
}, [
|
|
103
102
|
'project', 'typeOf', 'eventStatus', 'identifier',
|
|
104
103
|
'name', 'kanaName', 'alternativeHeadline', 'location',
|
|
105
|
-
'organizer',
|
|
104
|
+
'organizer',
|
|
105
|
+
// 'videoFormat', // 参照廃止(2026-02-10~)
|
|
106
|
+
'soundFormat', 'workPerformed',
|
|
106
107
|
'duration', 'endDate', 'startDate', 'coaInfo',
|
|
107
108
|
'offers', 'additionalProperty'
|
|
108
109
|
]);
|
|
@@ -171,16 +172,23 @@ function createScreeningEvents(params, options) {
|
|
|
171
172
|
});
|
|
172
173
|
}
|
|
173
174
|
function minimizeSuperEvent(params) {
|
|
174
|
-
const { workPerformed,
|
|
175
|
-
|
|
175
|
+
const { workPerformed,
|
|
176
|
+
// videoFormat,
|
|
177
|
+
startDate, soundFormat, name, location, kanaName, identifier, endDate, duration, coaInfo, alternativeHeadline, typeOf, id } = params.superEvent;
|
|
178
|
+
return {
|
|
179
|
+
workPerformed, startDate, soundFormat,
|
|
176
180
|
name, location, kanaName, identifier,
|
|
177
181
|
endDate, duration, coaInfo, alternativeHeadline,
|
|
178
|
-
typeOf, id
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
182
|
+
typeOf, id
|
|
183
|
+
// 完全に廃止(2026-02-10~)
|
|
184
|
+
// // videoFormatをデータとしても廃止(万が一に備えてUSE_DEPRECATED_VIDEO_FORMAT_EVENTSで再設定可能)(2026-02-03~)
|
|
185
|
+
// ...(USE_DEPRECATED_VIDEO_FORMAT_EVENTS)
|
|
186
|
+
// ? {
|
|
187
|
+
// // 現時点で型廃止済だがデータとしては互換性維持(2026-01-15~)
|
|
188
|
+
// videoFormat
|
|
189
|
+
// }
|
|
190
|
+
// : undefined
|
|
191
|
+
};
|
|
184
192
|
}
|
|
185
193
|
/**
|
|
186
194
|
* コアデータからイベントを作成する
|
|
@@ -81,7 +81,9 @@ function syncEventSeries2screeningEvents(params) {
|
|
|
81
81
|
}, [
|
|
82
82
|
'additionalProperty', 'alternativeHeadline', 'description', 'dubLanguage',
|
|
83
83
|
'endDate', 'headline', 'kanaName', 'location', 'name',
|
|
84
|
-
'soundFormat', 'startDate', 'subtitleLanguage', 'typeOf',
|
|
84
|
+
'soundFormat', 'startDate', 'subtitleLanguage', 'typeOf',
|
|
85
|
+
// 'videoFormat', // 参照廃止(2026-02-10~)
|
|
86
|
+
'workPerformed'
|
|
85
87
|
]);
|
|
86
88
|
const superEventFromDB = superEvents.shift();
|
|
87
89
|
if (superEventFromDB === undefined) {
|
|
@@ -5,7 +5,7 @@ declare function tour2creatingEvent(tour: ITourBySchedule, movieTheater: Pick<fa
|
|
|
5
5
|
member: ICustomerMember;
|
|
6
6
|
}[], maxValue: number, eventService: Pick<factory.product.IProduct, 'id' | 'name'> & {
|
|
7
7
|
id: string;
|
|
8
|
-
}, screeningEventSeries: Pick<factory.eventSeries.IEvent, 'location' | 'additionalProperty' | 'description' | 'endDate' | 'headline' | 'id' | 'kanaName' | 'name' | 'soundFormat' | 'startDate' | 'typeOf' | '
|
|
8
|
+
}, screeningEventSeries: Pick<factory.eventSeries.IEvent, 'location' | 'additionalProperty' | 'description' | 'endDate' | 'headline' | 'id' | 'kanaName' | 'name' | 'soundFormat' | 'startDate' | 'typeOf' | 'workPerformed'>, project: {
|
|
9
9
|
id: string;
|
|
10
10
|
}): ICreatingEvent4ttts;
|
|
11
11
|
interface ITourBySchedule {
|
|
@@ -46,7 +46,9 @@ function schedule2relatedResources(schedule) {
|
|
|
46
46
|
id: { $eq: eventSeriesId }
|
|
47
47
|
}, [
|
|
48
48
|
'location', 'additionalProperty', 'description', 'endDate', 'headline', 'kanaName', 'name',
|
|
49
|
-
'soundFormat', 'startDate', 'typeOf',
|
|
49
|
+
'soundFormat', 'startDate', 'typeOf',
|
|
50
|
+
// 'videoFormat', // 参照廃止(2026-02-10~)
|
|
51
|
+
'workPerformed'
|
|
50
52
|
])).shift();
|
|
51
53
|
if (screeningEventSeries === undefined) {
|
|
52
54
|
throw new factory.errors.NotFound(factory.eventType.ScreeningEventSeries);
|
|
@@ -236,7 +236,9 @@ function syncEvents(params) {
|
|
|
236
236
|
}, [
|
|
237
237
|
'project', 'typeOf', 'eventStatus', 'identifier',
|
|
238
238
|
'name', 'kanaName', 'alternativeHeadline', 'location',
|
|
239
|
-
'organizer',
|
|
239
|
+
'organizer',
|
|
240
|
+
// 'videoFormat', // 参照廃止(2026-02-10~)
|
|
241
|
+
'soundFormat', 'workPerformed',
|
|
240
242
|
'duration', 'endDate', 'startDate', 'coaInfo',
|
|
241
243
|
'offers', 'additionalProperty'
|
|
242
244
|
])).shift();
|
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": "5.4.0-alpha.
|
|
15
|
-
"@cinerino/sdk": "13.0.0
|
|
14
|
+
"@chevre/factory": "5.4.0-alpha.29",
|
|
15
|
+
"@cinerino/sdk": "13.0.0",
|
|
16
16
|
"@motionpicture/coa-service": "9.6.0",
|
|
17
17
|
"@motionpicture/gmo-service": "5.4.0-alpha.1",
|
|
18
18
|
"@sendgrid/client": "8.1.4",
|
|
@@ -118,5 +118,5 @@
|
|
|
118
118
|
"postversion": "git push origin --tags",
|
|
119
119
|
"prepublishOnly": "npm run clean && npm run build && npm test && npm run doc"
|
|
120
120
|
},
|
|
121
|
-
"version": "23.2.0-alpha.
|
|
121
|
+
"version": "23.2.0-alpha.59"
|
|
122
122
|
}
|
|
@@ -1,75 +0,0 @@
|
|
|
1
|
-
// tslint:disable:no-console
|
|
2
|
-
// import * as moment from 'moment';
|
|
3
|
-
import * as mongoose from 'mongoose';
|
|
4
|
-
|
|
5
|
-
import { chevre } from '../../../../lib/index';
|
|
6
|
-
|
|
7
|
-
// tslint:disable-next-line:max-func-body-length
|
|
8
|
-
async function main() {
|
|
9
|
-
await mongoose.connect(<string>process.env.MONGOLAB_URI, { autoIndex: false });
|
|
10
|
-
|
|
11
|
-
const eventSeriesRepo = await chevre.repository.EventSeries.createInstance(mongoose.connection);
|
|
12
|
-
|
|
13
|
-
const cursor = eventSeriesRepo.getCursor(
|
|
14
|
-
{
|
|
15
|
-
// _id: { $eq: 'bmd7x21f2' },
|
|
16
|
-
// 'project.id': { $eq: 'xxx' },
|
|
17
|
-
'offers.typeOf': {
|
|
18
|
-
$exists: true,
|
|
19
|
-
$eq: chevre.factory.offerType.AggregateOffer
|
|
20
|
-
}
|
|
21
|
-
},
|
|
22
|
-
{
|
|
23
|
-
// _id: 1,
|
|
24
|
-
// offers: 1,
|
|
25
|
-
// startDate: 1,
|
|
26
|
-
// project: 1,
|
|
27
|
-
// typeOf: 1
|
|
28
|
-
}
|
|
29
|
-
);
|
|
30
|
-
console.log('docs found');
|
|
31
|
-
|
|
32
|
-
let i = 0;
|
|
33
|
-
let updateCount = 0;
|
|
34
|
-
await cursor.eachAsync(async (doc) => {
|
|
35
|
-
i += 1;
|
|
36
|
-
const eventSeries: Pick<
|
|
37
|
-
chevre.factory.eventSeries.IEvent,
|
|
38
|
-
'id' | 'offers' | 'startDate' | 'project' | 'typeOf'
|
|
39
|
-
> = doc.toObject();
|
|
40
|
-
|
|
41
|
-
console.log(
|
|
42
|
-
'alreadyMigrated?', eventSeries.project.id, eventSeries.typeOf, eventSeries.id, eventSeries.startDate, i);
|
|
43
|
-
const alreadyMigrated = eventSeries.offers?.typeOf === chevre.factory.offerType.Offer;
|
|
44
|
-
|
|
45
|
-
if (alreadyMigrated) {
|
|
46
|
-
console.log(
|
|
47
|
-
'already migrated.', eventSeries.project.id, eventSeries.typeOf, eventSeries.id, eventSeries.startDate, i);
|
|
48
|
-
} else {
|
|
49
|
-
console.log(
|
|
50
|
-
'updating...',
|
|
51
|
-
eventSeries.project.id, eventSeries.typeOf, eventSeries.id, eventSeries.startDate, i);
|
|
52
|
-
await eventSeriesRepo.saveEventSeries({
|
|
53
|
-
id: eventSeries.id,
|
|
54
|
-
attributes: <any>{
|
|
55
|
-
...{
|
|
56
|
-
typeOf: eventSeries.typeOf,
|
|
57
|
-
'offers.typeOf': chevre.factory.offerType.Offer
|
|
58
|
-
}
|
|
59
|
-
}
|
|
60
|
-
});
|
|
61
|
-
updateCount += 1;
|
|
62
|
-
console.log(
|
|
63
|
-
'updated.',
|
|
64
|
-
eventSeries.project.id, eventSeries.typeOf, eventSeries.id, eventSeries.startDate, i);
|
|
65
|
-
|
|
66
|
-
}
|
|
67
|
-
});
|
|
68
|
-
|
|
69
|
-
console.log(i, 'docs checked');
|
|
70
|
-
console.log(updateCount, 'docs updated');
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
main()
|
|
74
|
-
.then()
|
|
75
|
-
.catch(console.error);
|
|
@@ -1,93 +0,0 @@
|
|
|
1
|
-
// tslint:disable:no-console
|
|
2
|
-
import * as moment from 'moment';
|
|
3
|
-
import * as mongoose from 'mongoose';
|
|
4
|
-
|
|
5
|
-
import { chevre } from '../../../../lib/index';
|
|
6
|
-
|
|
7
|
-
// const project = { id: String(process.env.PROJECT_ID) };
|
|
8
|
-
const DEFAULT_PAYMENT_METHOD_TYPE_FOR_MOVIE_TICKET = 'MovieTicket';
|
|
9
|
-
|
|
10
|
-
// tslint:disable-next-line:max-func-body-length
|
|
11
|
-
async function main() {
|
|
12
|
-
await mongoose.connect(<string>process.env.MONGOLAB_URI, { autoIndex: false });
|
|
13
|
-
|
|
14
|
-
const eventSeriesRepo = await chevre.repository.EventSeries.createInstance(mongoose.connection);
|
|
15
|
-
|
|
16
|
-
const cursor = eventSeriesRepo.getCursor(
|
|
17
|
-
{
|
|
18
|
-
'project.id': { $eq: 'xxx' },
|
|
19
|
-
'offers.unacceptedPaymentMethod': {
|
|
20
|
-
$exists: true,
|
|
21
|
-
$ne: DEFAULT_PAYMENT_METHOD_TYPE_FOR_MOVIE_TICKET
|
|
22
|
-
},
|
|
23
|
-
startDate: {
|
|
24
|
-
$lte: moment()
|
|
25
|
-
.add(-1, 'year')
|
|
26
|
-
.toDate()
|
|
27
|
-
}
|
|
28
|
-
// _id: { $eq: 'bliy11ffa' }
|
|
29
|
-
},
|
|
30
|
-
{
|
|
31
|
-
// _id: 1,
|
|
32
|
-
// offers: 1,
|
|
33
|
-
// startDate: 1,
|
|
34
|
-
// project: 1,
|
|
35
|
-
// typeOf: 1
|
|
36
|
-
}
|
|
37
|
-
);
|
|
38
|
-
console.log('docs found');
|
|
39
|
-
|
|
40
|
-
let i = 0;
|
|
41
|
-
let updateCount = 0;
|
|
42
|
-
await cursor.eachAsync(async (doc) => {
|
|
43
|
-
i += 1;
|
|
44
|
-
const eventSeries: Pick<
|
|
45
|
-
chevre.factory.eventSeries.IEvent,
|
|
46
|
-
'id' | 'offers' | 'startDate' | 'project' | 'typeOf'
|
|
47
|
-
> = doc.toObject();
|
|
48
|
-
|
|
49
|
-
console.log(
|
|
50
|
-
'alreadyMigrated?', eventSeries.project.id, eventSeries.typeOf, eventSeries.id, eventSeries.startDate, i);
|
|
51
|
-
const unacceptedPaymentMethod = eventSeries.offers?.unacceptedPaymentMethod;
|
|
52
|
-
const alreadyMigrated = !Array.isArray(unacceptedPaymentMethod)
|
|
53
|
-
|| (Array.isArray(unacceptedPaymentMethod)
|
|
54
|
-
&& unacceptedPaymentMethod.every(
|
|
55
|
-
(paymentMethodType) => paymentMethodType === DEFAULT_PAYMENT_METHOD_TYPE_FOR_MOVIE_TICKET
|
|
56
|
-
));
|
|
57
|
-
|
|
58
|
-
if (alreadyMigrated) {
|
|
59
|
-
console.log(
|
|
60
|
-
'already migrated.', eventSeries.project.id, eventSeries.typeOf, eventSeries.id, eventSeries.startDate, i);
|
|
61
|
-
} else {
|
|
62
|
-
if (Array.isArray(unacceptedPaymentMethod)) {
|
|
63
|
-
const newUnacceptedPaymentMethod = unacceptedPaymentMethod.filter(
|
|
64
|
-
(paymentMethod) => paymentMethod === DEFAULT_PAYMENT_METHOD_TYPE_FOR_MOVIE_TICKET
|
|
65
|
-
);
|
|
66
|
-
console.log(
|
|
67
|
-
'updating project...',
|
|
68
|
-
newUnacceptedPaymentMethod,
|
|
69
|
-
eventSeries.project.id, eventSeries.typeOf, eventSeries.id, eventSeries.startDate, i);
|
|
70
|
-
await eventSeriesRepo.saveEventSeries({
|
|
71
|
-
id: eventSeries.id,
|
|
72
|
-
attributes: <any>{
|
|
73
|
-
...{
|
|
74
|
-
typeOf: eventSeries.typeOf,
|
|
75
|
-
'offers.unacceptedPaymentMethod': newUnacceptedPaymentMethod
|
|
76
|
-
}
|
|
77
|
-
}
|
|
78
|
-
});
|
|
79
|
-
updateCount += 1;
|
|
80
|
-
console.log(
|
|
81
|
-
'updated.',
|
|
82
|
-
eventSeries.project.id, eventSeries.typeOf, eventSeries.id, eventSeries.startDate, i);
|
|
83
|
-
}
|
|
84
|
-
}
|
|
85
|
-
});
|
|
86
|
-
|
|
87
|
-
console.log(i, 'docs checked');
|
|
88
|
-
console.log(updateCount, 'docs updated');
|
|
89
|
-
}
|
|
90
|
-
|
|
91
|
-
main()
|
|
92
|
-
.then()
|
|
93
|
-
.catch(console.error);
|
|
@@ -1,80 +0,0 @@
|
|
|
1
|
-
// tslint:disable:no-console
|
|
2
|
-
// import * as moment from 'moment';
|
|
3
|
-
import * as mongoose from 'mongoose';
|
|
4
|
-
|
|
5
|
-
import { chevre } from '../../../../lib/index';
|
|
6
|
-
|
|
7
|
-
// tslint:disable-next-line:max-func-body-length
|
|
8
|
-
async function main() {
|
|
9
|
-
await mongoose.connect(<string>process.env.MONGOLAB_URI, { autoIndex: false });
|
|
10
|
-
|
|
11
|
-
const eventSeriesRepo = await chevre.repository.EventSeries.createInstance(mongoose.connection);
|
|
12
|
-
|
|
13
|
-
const cursor = eventSeriesRepo.getCursor(
|
|
14
|
-
{
|
|
15
|
-
// _id: { $eq: 'al9s38bj6' },
|
|
16
|
-
'project.id': { $nin: ['sskts-development', 'sskts-test', 'sskts-production'] }
|
|
17
|
-
},
|
|
18
|
-
{
|
|
19
|
-
// _id: 1,
|
|
20
|
-
// offers: 1,
|
|
21
|
-
// startDate: 1,
|
|
22
|
-
// project: 1,
|
|
23
|
-
// typeOf: 1
|
|
24
|
-
}
|
|
25
|
-
);
|
|
26
|
-
console.log('docs found');
|
|
27
|
-
|
|
28
|
-
let i = 0;
|
|
29
|
-
let updateCount = 0;
|
|
30
|
-
await cursor.eachAsync(async (doc) => {
|
|
31
|
-
i += 1;
|
|
32
|
-
const eventSeries: Pick<
|
|
33
|
-
chevre.factory.eventSeries.IEvent,
|
|
34
|
-
'id' | 'videoFormat' | 'subEvent' | 'project' | 'startDate' | 'typeOf'
|
|
35
|
-
> = doc.toObject();
|
|
36
|
-
|
|
37
|
-
const videoFormatByOldAttribute: string[] =
|
|
38
|
-
(Array.isArray(eventSeries.videoFormat)) ? eventSeries.videoFormat.map(({ typeOf }) => typeOf) : [];
|
|
39
|
-
const videoFormatByNewAttribute: string[] =
|
|
40
|
-
(Array.isArray(eventSeries.subEvent?.videoFormat)) ? eventSeries.subEvent.videoFormat : [];
|
|
41
|
-
const alreadyMigrated = videoFormatByOldAttribute.length === videoFormatByNewAttribute.length
|
|
42
|
-
&& videoFormatByOldAttribute.every((codeValue) => videoFormatByNewAttribute.includes(codeValue))
|
|
43
|
-
&& eventSeries.subEvent?.typeOf === chevre.factory.eventType.ScreeningEvent;
|
|
44
|
-
|
|
45
|
-
if (alreadyMigrated) {
|
|
46
|
-
console.log(
|
|
47
|
-
'already migrated.', eventSeries.project.id, eventSeries.id, eventSeries.startDate, i);
|
|
48
|
-
} else {
|
|
49
|
-
const subEvent: chevre.factory.eventSeries.ISubEvent = {
|
|
50
|
-
typeOf: chevre.factory.eventType.ScreeningEvent,
|
|
51
|
-
...(videoFormatByOldAttribute.length > 0) ? { videoFormat: videoFormatByOldAttribute } : undefined
|
|
52
|
-
};
|
|
53
|
-
console.log(
|
|
54
|
-
'updating...',
|
|
55
|
-
eventSeries.project.id, eventSeries.id, eventSeries.startDate, i, videoFormatByOldAttribute, subEvent
|
|
56
|
-
);
|
|
57
|
-
await eventSeriesRepo.saveEventSeries({
|
|
58
|
-
id: eventSeries.id,
|
|
59
|
-
attributes: <any>{
|
|
60
|
-
...{
|
|
61
|
-
typeOf: eventSeries.typeOf,
|
|
62
|
-
subEvent
|
|
63
|
-
}
|
|
64
|
-
}
|
|
65
|
-
});
|
|
66
|
-
updateCount += 1;
|
|
67
|
-
console.log(
|
|
68
|
-
'updated.',
|
|
69
|
-
eventSeries.project.id, eventSeries.id, eventSeries.startDate, i);
|
|
70
|
-
|
|
71
|
-
}
|
|
72
|
-
});
|
|
73
|
-
|
|
74
|
-
console.log(i, 'docs checked');
|
|
75
|
-
console.log(updateCount, 'docs updated');
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
main()
|
|
79
|
-
.then()
|
|
80
|
-
.catch(console.error);
|