@chevre/domain 23.0.0-alpha.2 → 23.0.0-alpha.4

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.
@@ -3,11 +3,11 @@ import * as factory from '../../../factory';
3
3
  type IDocTypeAsEventSeries = factory.eventSeries.IAttributes & {
4
4
  _id: string;
5
5
  };
6
- export type IDocType = IDocTypeAsEventSeries;
6
+ type IDocType = IDocTypeAsEventSeries;
7
7
  type IModel = Model<IDocType>;
8
8
  type ISchemaDefinition = SchemaDefinition<IDocType>;
9
9
  type ISchema = Schema<IDocType, IModel, {}, {}, {}, {}, ISchemaDefinition, IDocType>;
10
10
  declare const modelName = "EventSeries";
11
11
  declare const indexes: [d: IndexDefinition, o: IndexOptions][];
12
12
  declare function createSchema(): ISchema;
13
- export { createSchema, IModel, indexes, modelName };
13
+ export { createSchema, IDocType, IModel, indexes, modelName };
@@ -9,30 +9,21 @@ const settings_1 = require("../../../settings");
9
9
  const modelName = 'EventSeries';
10
10
  exports.modelName = modelName;
11
11
  const schemaDefinition = {
12
- project: {
13
- type: mongoose_1.SchemaTypes.Mixed,
14
- required: true
15
- },
16
- organizer: {
17
- type: mongoose_1.SchemaTypes.Mixed,
18
- required: true
19
- },
12
+ project: { type: mongoose_1.SchemaTypes.Mixed, required: true },
13
+ organizer: { type: mongoose_1.SchemaTypes.Mixed, required: true },
20
14
  _id: String,
21
- typeOf: {
22
- type: String,
23
- required: true
24
- },
15
+ typeOf: { type: String, required: true },
25
16
  identifier: String,
26
17
  name: mongoose_1.SchemaTypes.Mixed,
27
18
  additionalProperty: mongoose_1.SchemaTypes.Mixed,
28
19
  alternativeHeadline: mongoose_1.SchemaTypes.Mixed,
29
20
  description: mongoose_1.SchemaTypes.Mixed,
30
21
  duration: String,
31
- endDate: Date,
22
+ endDate: { type: Date, required: true }, // required(2025-10-08~)
32
23
  eventStatus: String,
33
24
  headline: mongoose_1.SchemaTypes.Mixed,
34
25
  location: mongoose_1.SchemaTypes.Mixed,
35
- startDate: Date,
26
+ startDate: { type: Date, required: true }, // required(2025-10-08~)
36
27
  workPerformed: mongoose_1.SchemaTypes.Mixed,
37
28
  videoFormat: mongoose_1.SchemaTypes.Mixed,
38
29
  soundFormat: mongoose_1.SchemaTypes.Mixed,
@@ -160,7 +160,8 @@ function createInformTasks(params, setting) {
160
160
  );
161
161
  // 最適化(2024-03-25~)
162
162
  events4inform = screeningEventSeries4inform.map(({ project, organizer, typeOf, name, location, id, videoFormat, soundFormat, workPerformed, kanaName, eventStatus, endDate, startDate, additionalProperty, subtitleLanguage, dubLanguage, alternativeHeadline, description, duration, headline }) => {
163
- return Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({ project, organizer, typeOf, name, location, id, videoFormat, soundFormat, workPerformed, kanaName, eventStatus }, (endDate !== undefined) ? { endDate } : undefined), (startDate !== undefined) ? { startDate } : undefined), (Array.isArray(additionalProperty)) ? { additionalProperty } : undefined), (subtitleLanguage !== undefined) ? {} : undefined), (dubLanguage !== undefined) ? { dubLanguage } : undefined), (alternativeHeadline !== undefined) ? { alternativeHeadline } : undefined), (description !== undefined) ? { description } : undefined), (typeof duration === 'string') ? { duration } : undefined), (headline !== undefined) ? { headline } : undefined);
163
+ return Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({ project, organizer, typeOf, name, location, id, videoFormat, soundFormat, workPerformed, kanaName, eventStatus,
164
+ endDate, startDate }, (Array.isArray(additionalProperty)) ? { additionalProperty } : undefined), (subtitleLanguage !== undefined) ? {} : undefined), (dubLanguage !== undefined) ? { dubLanguage } : undefined), (alternativeHeadline !== undefined) ? { alternativeHeadline } : undefined), (description !== undefined) ? { description } : undefined), (typeof duration === 'string') ? { duration } : undefined), (headline !== undefined) ? { headline } : undefined);
164
165
  });
165
166
  }
166
167
  if (events4inform.length > 0) {
@@ -4,105 +4,7 @@ exports.tour2creatingEvent = tour2creatingEvent;
4
4
  exports.schedule2tours = schedule2tours;
5
5
  const moment = require("moment-timezone");
6
6
  const factory = require("../../../../factory");
7
- // tslint:disable-next-line:max-func-body-length
8
- // function schedule2createEventParams(
9
- // schedule: factory.schedule.IEventWithSchedule,
10
- // createDate: Date
11
- // ): factory.event.screeningEvent.ICreateParams[] {
12
- // const eventServiceId = schedule.offers?.itemOffered?.id;
13
- // const makesOffer = schedule.offers?.seller?.makesOffer;
14
- // const applicationIds: string[] = (Array.isArray(makesOffer))
15
- // ? makesOffer.map(({ availableAtOrFrom }) => availableAtOrFrom.id)
16
- // : [];
17
- // const eventSeriesId = schedule.superEvent?.id;
18
- // if (typeof eventServiceId !== 'string' || eventServiceId === '') {
19
- // throw new factory.errors.NotFound('schedule.offers.itemOffered.id');
20
- // }
21
- // if (typeof eventSeriesId !== 'string' || eventSeriesId === '') {
22
- // throw new factory.errors.NotFound('schedule.superEvent.id');
23
- // }
24
- // // 引数情報取得
25
- // if (schedule.eventSchedule === undefined) {
26
- // throw new factory.errors.NotFound('eventSchedule');
27
- // }
28
- // const targetInfo = getTargetInfoByEventWithSchedule(schedule, createDate);
29
- // debug(targetInfo.length, 'targetInfos ->', targetInfo);
30
- // const createParams: factory.event.screeningEvent.ICreateParams[] = [];
31
- // for (const performanceInfo of targetInfo) {
32
- // const oldEventId = [
33
- // // tslint:disable-next-line:no-magic-numbers
34
- // performanceInfo.day.slice(-6),
35
- // workPerformedIdentifier,
36
- // movieTheater.branchCode,
37
- // screeningRoom.branchCode,
38
- // performanceInfo.start_time
39
- // ].join('');
40
- // const maxValue = movieTheater.offers?.eligibleQuantity?.maxValue;
41
- // const availabilityEnds: Date = moment(performanceInfo.end_date)
42
- // .tz('Asia/Tokyo')
43
- // .endOf('date')
44
- // .toDate();
45
- // const availabilityStarts: Date = moment(performanceInfo.start_date)
46
- // .tz('Asia/Tokyo')
47
- // .startOf('date')
48
- // // tslint:disable-next-line:no-magic-numbers
49
- // .add(-3, 'months')
50
- // .toDate();
51
- // const validThrough: Date = moment(performanceInfo.end_date)
52
- // .tz('Asia/Tokyo')
53
- // .endOf('date')
54
- // .toDate();
55
- // const validFrom: Date = moment(performanceInfo.start_date)
56
- // .tz('Asia/Tokyo')
57
- // .startOf('date')
58
- // // tslint:disable-next-line:no-magic-numbers
59
- // .add(-3, 'months')
60
- // .toDate();
61
- // // イベント作成
62
- // createParams.push({
63
- // eventStatus: factory.eventStatusType.EventScheduled,
64
- // doorTime: performanceInfo.door_time,
65
- // startDate: performanceInfo.start_date,
66
- // endDate: performanceInfo.end_date,
67
- // offers: {
68
- // eligibleQuantity: {
69
- // ...(typeof maxValue === 'number') ? { maxValue } : undefined // ひとまず全座席予約可能なように
70
- // },
71
- // itemOffered: {
72
- // // 興行ID追加(2022-09-01~)
73
- // id: eventServiceId,
74
- // serviceOutput: {
75
- // typeOf: factory.reservationType.EventReservation,
76
- // reservedTicket: {
77
- // typeOf: 'Ticket',
78
- // ticketedSeat: { typeOf: factory.placeType.Seat }
79
- // }
80
- // },
81
- // },
82
- // seller: {
83
- // // event.offersにseller.makesOfferを追加(2022-11-18~)
84
- // makesOffer: applicationIds.map((applicationId) => {
85
- // return {
86
- // typeOf: factory.offerType.Offer,
87
- // availableAtOrFrom: { id: applicationId }, // support no-array(2024-10-13~),
88
- // availabilityEnds,
89
- // availabilityStarts,
90
- // validFrom,
91
- // validThrough
92
- // };
93
- // })
94
- // }
95
- // },
96
- // // 旧フォーマットIDを追加特性に追加(2022-09-08~)
97
- // additionalProperty: [
98
- // { name: 'tourNumber', value: String(performanceInfo.tour_number) },
99
- // { name: 'oldEventId', value: oldEventId }
100
- // ],
101
- // identifier: oldEventId
102
- // });
103
- // }
104
- // return createParams;
105
- // }
7
+ const TIMEZONE = 'Asia/Tokyo';
106
8
  // tslint:disable-next-line:max-func-body-length
107
9
  function tour2creatingEvent(tour, movieTheater, screeningRoom, existingApplicationMembers, maxValue, eventService, screeningEventSeries, project) {
108
10
  var _a;
@@ -115,22 +17,34 @@ function tour2creatingEvent(tour, movieTheater, screeningRoom, existingApplicati
115
17
  screeningRoom.branchCode,
116
18
  tour.start_time
117
19
  ].join('');
20
+ // 00:00:00で再実装(2025-10-09~)
21
+ // const availabilityEnds: Date = moment(tour.end_date)
22
+ // .tz(TIMEZONE)
23
+ // .endOf('date')
24
+ // .toDate();
118
25
  const availabilityEnds = moment(tour.end_date)
119
- .tz('Asia/Tokyo')
120
- .endOf('date')
26
+ .tz(TIMEZONE)
27
+ .startOf('date')
28
+ .add(1, 'day')
121
29
  .toDate();
122
30
  const availabilityStarts = moment(tour.start_date)
123
- .tz('Asia/Tokyo')
31
+ .tz(TIMEZONE)
124
32
  .startOf('date')
125
33
  // tslint:disable-next-line:no-magic-numbers
126
34
  .add(-3, 'months')
127
35
  .toDate();
36
+ // 00:00:00で再実装(2025-10-09~)
37
+ // const validThrough: Date = moment(tour.end_date)
38
+ // .tz(TIMEZONE)
39
+ // .endOf('date')
40
+ // .toDate();
128
41
  const validThrough = moment(tour.end_date)
129
- .tz('Asia/Tokyo')
130
- .endOf('date')
42
+ .tz(TIMEZONE)
43
+ .startOf('date')
44
+ .add(1, 'day')
131
45
  .toDate();
132
46
  const validFrom = moment(tour.start_date)
133
- .tz('Asia/Tokyo')
47
+ .tz(TIMEZONE)
134
48
  .startOf('date')
135
49
  // tslint:disable-next-line:no-magic-numbers
136
50
  .add(-3, 'months')
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.0.0-alpha.2",
15
- "@cinerino/sdk": "12.5.0-alpha.2",
14
+ "@chevre/factory": "5.0.0",
15
+ "@cinerino/sdk": "12.5.0-alpha.5",
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",
@@ -115,5 +115,5 @@
115
115
  "postversion": "git push origin --tags",
116
116
  "prepublishOnly": "npm run clean && npm run build && npm test && npm run doc"
117
117
  },
118
- "version": "23.0.0-alpha.2"
118
+ "version": "23.0.0-alpha.4"
119
119
  }