@chevre/domain 21.4.0-alpha.4 → 21.4.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.
@@ -5,6 +5,10 @@ import * as mongoose from 'mongoose';
5
5
  import { chevre } from '../../../lib/index';
6
6
 
7
7
  const PROJECT_ID = String(process.env.PROJECT_ID);
8
+ const ORGANIZER_ID = process.env.ORGANIZER_ID;
9
+ if (typeof ORGANIZER_ID !== 'string' || ORGANIZER_ID.length === 0) {
10
+ throw new Error('ORGANIZER_ID undefined');
11
+ }
8
12
 
9
13
  // tslint:disable-next-line:max-func-body-length
10
14
  async function main() {
@@ -15,6 +19,7 @@ async function main() {
15
19
  const result = await eventRepo.createManyIfNotExist<chevre.factory.eventType.ScreeningEvent>([
16
20
  {
17
21
  attributes: {
22
+ organizer: { id: String(ORGANIZER_ID) },
18
23
  typeOf: chevre.factory.eventType.ScreeningEvent,
19
24
  project: { id: PROJECT_ID, typeOf: chevre.factory.organizationType.Project },
20
25
  name: {
@@ -184,6 +189,7 @@ async function main() {
184
189
  },
185
190
  {
186
191
  attributes: {
192
+ organizer: { id: String(ORGANIZER_ID) },
187
193
  typeOf: chevre.factory.eventType.ScreeningEvent,
188
194
  project: { id: PROJECT_ID, typeOf: chevre.factory.organizationType.Project },
189
195
  name: {
@@ -77,6 +77,7 @@ declare const schema: Schema<any, import("mongoose").Model<any, any, any, any, a
77
77
  aggregateEntranceGate?: any;
78
78
  aggregateReservation?: any;
79
79
  aggregateOffer?: any;
80
+ organizer?: any;
80
81
  maximumAttendeeCapacity?: number | undefined;
81
82
  remainingAttendeeCapacity?: number | undefined;
82
83
  videoFormat?: any;
@@ -110,6 +111,7 @@ declare const schema: Schema<any, import("mongoose").Model<any, any, any, any, a
110
111
  aggregateEntranceGate?: any;
111
112
  aggregateReservation?: any;
112
113
  aggregateOffer?: any;
114
+ organizer?: any;
113
115
  maximumAttendeeCapacity?: number | undefined;
114
116
  remainingAttendeeCapacity?: number | undefined;
115
117
  videoFormat?: any;
@@ -143,6 +145,7 @@ declare const schema: Schema<any, import("mongoose").Model<any, any, any, any, a
143
145
  aggregateEntranceGate?: any;
144
146
  aggregateReservation?: any;
145
147
  aggregateOffer?: any;
148
+ organizer?: any;
146
149
  maximumAttendeeCapacity?: number | undefined;
147
150
  remainingAttendeeCapacity?: number | undefined;
148
151
  videoFormat?: any;
@@ -46,6 +46,7 @@ const schema = new mongoose_1.Schema({
46
46
  aggregateEntranceGate: mongoose_1.SchemaTypes.Mixed,
47
47
  aggregateReservation: mongoose_1.SchemaTypes.Mixed,
48
48
  aggregateOffer: mongoose_1.SchemaTypes.Mixed,
49
+ organizer: mongoose_1.SchemaTypes.Mixed,
49
50
  coaInfo: mongoose_1.SchemaTypes.Mixed
50
51
  }, {
51
52
  collection: 'events',
@@ -1,4 +1,4 @@
1
- import { MongoRepository as EventRepo } from '../../../repo/event';
1
+ import { IMinimizedIndividualEvent, MongoRepository as EventRepo } from '../../../repo/event';
2
2
  import { MongoRepository as OfferRepo } from '../../../repo/offer';
3
3
  import { MongoRepository as OfferCatalogRepo } from '../../../repo/offerCatalog';
4
4
  import { MongoRepository as PlaceRepo } from '../../../repo/place';
@@ -28,5 +28,5 @@ export declare function aggregateScreeningEvent(params: {
28
28
  id: string;
29
29
  }): IAggregateScreeningEventOperation<void>;
30
30
  export declare function aggregateByEvent(params: {
31
- event: factory.event.screeningEvent.IEvent | factory.event.event.IEvent;
31
+ event: IMinimizedIndividualEvent<factory.eventType.ScreeningEvent> | IMinimizedIndividualEvent<factory.eventType.Event>;
32
32
  }): IAggregateScreeningEventOperation<void>;
@@ -1,4 +1,5 @@
1
1
  import * as factory from '../../../factory';
2
+ import { IMinimizedIndividualEvent } from '../../../factory/event';
2
3
  import { IAcceptedAddOn } from './factory/price';
3
4
  type IObjectSubReservation = factory.assetTransaction.reserve.IObjectSubReservation;
4
5
  export { IAcceptedAddOn };
@@ -46,9 +47,9 @@ export declare function createAdditionalTicketText(params: {
46
47
  reservedTicket: factory.reservation.ITicket;
47
48
  }): string | undefined;
48
49
  export type IUnitPriceSpecification = factory.priceSpecification.IPriceSpecification<factory.priceSpecificationType.UnitPriceSpecification>;
49
- export declare function createReservationFor(params: factory.event.screeningEvent.IEvent | factory.event.event.IEvent): factory.assetTransaction.reserve.IReservationFor;
50
+ export declare function createReservationFor(params: IMinimizedIndividualEvent<factory.eventType.ScreeningEvent> | IMinimizedIndividualEvent<factory.eventType.Event>): factory.assetTransaction.reserve.IReservationFor;
50
51
  export declare function createIssuedThrough(params: {
51
- reservationFor: factory.event.screeningEvent.IEvent | factory.event.event.IEvent;
52
+ reservationFor: IMinimizedIndividualEvent<factory.eventType.ScreeningEvent> | IMinimizedIndividualEvent<factory.eventType.Event>;
52
53
  }): {
53
54
  issuedThrough: factory.assetTransaction.reserve.IIssuedThrough;
54
55
  };
@@ -61,7 +62,7 @@ export declare function createReservation(params: {
61
62
  reserveDate: Date;
62
63
  agent: factory.assetTransaction.reserve.IAgent;
63
64
  reservationNumber: string;
64
- reservationFor: factory.event.screeningEvent.IEvent | factory.event.event.IEvent;
65
+ reservationFor: IMinimizedIndividualEvent<factory.eventType.ScreeningEvent> | IMinimizedIndividualEvent<factory.eventType.Event>;
65
66
  reservedTicket: factory.reservation.ITicket;
66
67
  additionalProperty?: factory.propertyValue.IPropertyValue<string>[];
67
68
  additionalTicketText?: string;
@@ -327,7 +327,9 @@ function createAdditionalTicketText(params) {
327
327
  return (_b = (_a = params.acceptedOffer.itemOffered) === null || _a === void 0 ? void 0 : _a.serviceOutput) === null || _b === void 0 ? void 0 : _b.additionalTicketText;
328
328
  }
329
329
  exports.createAdditionalTicketText = createAdditionalTicketText;
330
- function createReservationFor(params) {
330
+ function createReservationFor(
331
+ // params: factory.event.screeningEvent.IEvent | factory.event.event.IEvent
332
+ params) {
331
333
  var _a, _b;
332
334
  if (params.typeOf === factory.eventType.ScreeningEvent) {
333
335
  return Object.assign({ endDate: params.endDate, id: params.id, location: params.location, name: params.name, startDate: params.startDate, superEvent: optimizeReservationSuperEvent(params), typeOf: params.typeOf }, (params.doorTime instanceof Date)
@@ -343,7 +345,9 @@ function createReservationFor(params) {
343
345
  }
344
346
  }
345
347
  exports.createReservationFor = createReservationFor;
346
- function optimizeReservationSuperEvent(params) {
348
+ function optimizeReservationSuperEvent(
349
+ // params: factory.event.screeningEvent.IEvent
350
+ params) {
347
351
  const superEvent = params.superEvent;
348
352
  return Object.assign(Object.assign({ additionalProperty: (Array.isArray(superEvent.additionalProperty))
349
353
  ? superEvent.additionalProperty
@@ -92,6 +92,7 @@ function importFromCOA(params) {
92
92
  const sellersWithSameBranchCode = yield repos.seller.search({
93
93
  limit: 1,
94
94
  page: 1,
95
+ project: { id: { $eq: project.id } },
95
96
  branchCode: { $eq: params.locationBranchCode }
96
97
  }, ['_id'], []);
97
98
  const seller = sellersWithSameBranchCode.shift();
@@ -119,6 +120,7 @@ function importFromCOA(params) {
119
120
  throw new factory.errors.NotFound(factory.placeType.MovieTheater);
120
121
  }
121
122
  const screeningRooms = yield repos.place.searchScreeningRooms({
123
+ project: { id: { $eq: project.id } },
122
124
  containedInPlace: { branchCode: { $eq: movieTheater.branchCode } }
123
125
  });
124
126
  const targetImportFrom = moment(`${moment(params.importFrom)
@@ -133,7 +135,8 @@ function importFromCOA(params) {
133
135
  locationBranchCode: params.locationBranchCode,
134
136
  movieTheater,
135
137
  project: project,
136
- saveScreeningEventSeries: params.saveScreeningEventSeries
138
+ saveScreeningEventSeries: params.saveScreeningEventSeries,
139
+ seller: { id: seller.id }
137
140
  })(repos);
138
141
  savedScreeningEventSeriesCount = savedEventsCount;
139
142
  try {
@@ -145,7 +148,8 @@ function importFromCOA(params) {
145
148
  screeningEventSerieses: screeningEventSerieses,
146
149
  project: project,
147
150
  targetImportFrom: targetImportFrom.toDate(),
148
- targetImportThrough: targetImportThrough.toDate()
151
+ targetImportThrough: targetImportThrough.toDate(),
152
+ seller: { id: seller.id }
149
153
  })(repos);
150
154
  savedScreeningEventsCount = screeningEvents.length;
151
155
  // COAから削除されたイベントをキャンセル済ステータスへ変更
@@ -234,7 +238,8 @@ function saveScreeningEventSeries(params) {
234
238
  eizouKubuns: eizouKubuns,
235
239
  joueihousikiKubuns: joueihousikiKubuns,
236
240
  jimakufukikaeKubuns: jimakufukikaeKubuns,
237
- availablePaymentMethodTypes
241
+ availablePaymentMethodTypes,
242
+ seller: params.seller
238
243
  });
239
244
  });
240
245
  let savedEventsCount = 0;
@@ -362,7 +367,8 @@ function createScreeningEvents(params) {
362
367
  screenRoom: screenRoom,
363
368
  superEvent: screeningEventSeries,
364
369
  serviceKubuns: serviceKubuns,
365
- acousticKubuns: acousticKubuns
370
+ acousticKubuns: acousticKubuns,
371
+ seller: params.seller
366
372
  });
367
373
  screeningEvents.push(screeningEvent);
368
374
  });
@@ -493,7 +499,8 @@ function createScreeningEventFromCOA(params) {
493
499
  attendeeCount: 0,
494
500
  maximumAttendeeCapacity: params.screenRoom.maximumAttendeeCapacity,
495
501
  remainingAttendeeCapacity: params.screenRoom.maximumAttendeeCapacity,
496
- additionalProperty
502
+ additionalProperty,
503
+ organizer: { id: params.seller.id }
497
504
  };
498
505
  }
499
506
  function createScreeningEventAdditionalPropertyFromCOA(params) {
@@ -579,12 +586,8 @@ function createScreeningEventSeriesFromCOA(params) {
579
586
  kanaName: params.movieTheater.kanaName,
580
587
  typeOf: params.movieTheater.typeOf
581
588
  },
582
- // 不要なので廃止(2023-01-12~)
583
- // organizer: {
584
- // typeOf: factory.organizationType.Corporation,
585
- // identifier: params.movieTheater.id,
586
- // name: params.movieTheater.name
587
- // },
589
+ // 必須化(2023-07-12~)
590
+ organizer: { id: params.seller.id },
588
591
  videoFormat: params.eizouKubuns.filter((kubun) => kubun.kubunCode === params.filmFromCOA.kbnEizou)[0],
589
592
  soundFormat: [],
590
593
  workPerformed: {
@@ -4,7 +4,7 @@ export import WebAPIIdentifier = factory.service.webAPI.Identifier;
4
4
  export type IAcceptedOffer4COA = factory.action.authorize.offer.seatReservation.IAcceptedOffer<factory.service.webAPI.Identifier.COA>;
5
5
  export declare function createAuthorizeSeatReservationActionAttributes(params: {
6
6
  acceptedOffers: factory.action.authorize.offer.seatReservation.IAcceptedOffer<factory.service.webAPI.Identifier.COA>[];
7
- event: factory.event.IEvent<factory.eventType.ScreeningEvent>;
7
+ event: IMinimizedIndividualEvent<factory.eventType.ScreeningEvent>;
8
8
  transaction: factory.transaction.ITransaction<factory.transactionType.PlaceOrder>;
9
9
  }): factory.action.authorize.offer.seatReservation.IAttributes<WebAPIIdentifier.COA>;
10
10
  /**
@@ -1,10 +1,11 @@
1
1
  import * as surfrock from '@surfrock/sdk';
2
2
  import * as factory from '../../../factory';
3
+ import { IMinimizedIndividualEvent } from '../../../factory/event';
3
4
  export declare function createSeatInfoSyncIn(params: {
4
5
  paymentMethodType: string;
5
6
  paymentMethodId: string;
6
7
  movieTickets: factory.action.trade.pay.IMovieTicket[];
7
- event: factory.event.screeningEvent.IEvent;
8
+ event: IMinimizedIndividualEvent<factory.eventType.ScreeningEvent>;
8
9
  purpose: factory.action.trade.pay.IPurpose;
9
10
  seller: Pick<factory.seller.ISeller, 'paymentAccepted'>;
10
11
  credentials: {
package/package.json CHANGED
@@ -9,7 +9,7 @@
9
9
  }
10
10
  ],
11
11
  "dependencies": {
12
- "@chevre/factory": "4.314.0",
12
+ "@chevre/factory": "4.315.0-alpha.0",
13
13
  "@cinerino/sdk": "3.160.0-alpha.2",
14
14
  "@motionpicture/coa-service": "9.2.0",
15
15
  "@motionpicture/gmo-service": "5.2.0",
@@ -117,5 +117,5 @@
117
117
  "postversion": "git push origin --tags",
118
118
  "prepublishOnly": "npm run clean && npm run build && npm test && npm run doc"
119
119
  },
120
- "version": "21.4.0-alpha.4"
120
+ "version": "21.4.0-alpha.5"
121
121
  }