@chevre/domain 22.0.0-alpha.21 → 22.0.0-alpha.23

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.
@@ -1,77 +1,82 @@
1
1
  // tslint:disable:no-console
2
2
  import * as mongoose from 'mongoose';
3
- import * as redis from 'redis';
3
+ // import * as redis from 'redis';
4
4
 
5
5
  import { chevre } from '../../../../lib/index';
6
6
 
7
7
  const project = { id: <string>process.env.PROJECT_ID };
8
- const EVENT_ID = String(process.env.EVENT_ID);
8
+ // const EVENT_ID = String(process.env.EVENT_ID);
9
9
 
10
10
  // tslint:disable-next-line:max-func-body-length
11
11
  async function main() {
12
12
  await mongoose.connect(<string>process.env.MONGOLAB_URI, { autoIndex: false });
13
- const client = redis.createClient<redis.RedisDefaultModules, Record<string, never>, Record<string, never>>({
14
- socket: {
15
- port: Number(<string>process.env.REDIS_PORT),
16
- host: <string>process.env.REDIS_HOST
17
- },
18
- password: <string>process.env.REDIS_KEY
19
- });
20
- await client.connect();
13
+ // const client = redis.createClient<redis.RedisDefaultModules, Record<string, never>, Record<string, never>>({
14
+ // socket: {
15
+ // port: Number(<string>process.env.REDIS_PORT),
16
+ // host: <string>process.env.REDIS_HOST
17
+ // },
18
+ // password: <string>process.env.REDIS_KEY
19
+ // });
20
+ // await client.connect();
21
21
 
22
22
  const aggregateReservationRepo = await chevre.repository.AggregateReservation.createInstance(mongoose.connection);
23
- let aggregateReservations = await aggregateReservationRepo.searchWithReservationForId(
23
+ const aggregateReservations = await aggregateReservationRepo.searchWithReservationForId(
24
24
  {
25
- limit: 100,
25
+ limit: 10,
26
26
  page: 1,
27
27
  project: { id: { $eq: project.id } },
28
28
  reservationFor: {
29
- id: { $eq: EVENT_ID },
29
+ id: {
30
+ $in: [
31
+ 'blvcj2vfl', 'blvcj2w48',
32
+ 'blvcj2wqj', 'blvcj2y1n',
33
+ 'blvcj2ylh', 'blvcj2z7k',
34
+ 'blvcj2zqz', 'blvcj30d3',
35
+ 'blvcj30wo', 'blvcj32as'
36
+ ]
37
+ },
30
38
  typeOf: chevre.factory.eventType.ScreeningEvent
31
- }
39
+ },
40
+ sort: { 'reservationFor.startDate': 1 }
32
41
  },
33
42
  ['aggregateEntranceGate', 'aggregateOffer']
34
43
  );
35
44
  console.log('aggregateReservations:', aggregateReservations);
45
+ console.log('aggregateReservations:', aggregateReservations.map(({ id }) => id));
36
46
 
37
- await (await chevre.service.aggregation.createService()).event.aggregateOffers({
38
- id: EVENT_ID,
39
- typeOf: chevre.factory.eventType.ScreeningEvent
40
- })({
41
- aggregateReservation: aggregateReservationRepo,
42
- event: await chevre.repository.Event.createInstance(mongoose.connection),
43
- stockHolder: await chevre.repository.StockHolder.createInstance(client, mongoose.connection),
44
- offer: await chevre.repository.Offer.createInstance(mongoose.connection),
45
- offerCatalog: await chevre.repository.OfferCatalog.createInstance(mongoose.connection),
46
- offerRateLimit: await chevre.repository.rateLimit.Offer.createInstance(client),
47
- screeningRoom: await chevre.repository.place.ScreeningRoom.createInstance(mongoose.connection),
48
- product: await chevre.repository.Product.createInstance(mongoose.connection),
49
- reservation: await chevre.repository.Reservation.createInstance(mongoose.connection)
50
- });
51
- console.log('aggregateReserveAction processed.');
47
+ // await (await chevre.service.aggregation.createService()).event.aggregateOffers({
48
+ // id: EVENT_ID,
49
+ // typeOf: chevre.factory.eventType.ScreeningEvent
50
+ // })({
51
+ // aggregateReservation: aggregateReservationRepo,
52
+ // event: await chevre.repository.Event.createInstance(mongoose.connection),
53
+ // stockHolder: await chevre.repository.StockHolder.createInstance(client, mongoose.connection),
54
+ // offer: await chevre.repository.Offer.createInstance(mongoose.connection),
55
+ // offerCatalog: await chevre.repository.OfferCatalog.createInstance(mongoose.connection),
56
+ // offerRateLimit: await chevre.repository.rateLimit.Offer.createInstance(client),
57
+ // screeningRoom: await chevre.repository.place.ScreeningRoom.createInstance(mongoose.connection),
58
+ // product: await chevre.repository.Product.createInstance(mongoose.connection),
59
+ // reservation: await chevre.repository.Reservation.createInstance(mongoose.connection)
60
+ // });
61
+ // console.log('aggregateReserveAction processed.');
52
62
 
53
- aggregateReservations = await aggregateReservationRepo.searchWithReservationForId(
54
- {
55
- limit: 1,
56
- page: 1,
57
- sort: { 'reservationFor.startDate': 1 },
58
- project: { id: { $eq: project.id } },
59
- reservationFor: {
60
- id: {
61
- $eq: EVENT_ID,
62
- $in: [EVENT_ID]
63
- },
64
- typeOf: chevre.factory.eventType.ScreeningEvent
65
- // startFrom: moment()
66
- // .toDate(),
67
- // startThrough: moment()
68
- // .add(1, 'minutes')
69
- // .toDate()
70
- }
71
- },
72
- []
73
- );
74
- console.log('aggregateReservations:', aggregateReservations);
63
+ // aggregateReservations = await aggregateReservationRepo.searchWithReservationForId(
64
+ // {
65
+ // limit: 1,
66
+ // page: 1,
67
+ // sort: { 'reservationFor.startDate': 1 },
68
+ // project: { id: { $eq: project.id } },
69
+ // reservationFor: {
70
+ // id: {
71
+ // $eq: EVENT_ID,
72
+ // $in: [EVENT_ID]
73
+ // },
74
+ // typeOf: chevre.factory.eventType.ScreeningEvent
75
+ // }
76
+ // },
77
+ // []
78
+ // );
79
+ // console.log('aggregateReservations:', aggregateReservations);
75
80
  }
76
81
 
77
82
  main()
@@ -13,12 +13,18 @@ async function main() {
13
13
 
14
14
  const eventRepo: chevre.repository.Event = await chevre.repository.Event.createInstance(mongoose.connection);
15
15
 
16
- const event = await eventRepo.findMinimizedIndividualEventById(
16
+ const event = await eventRepo.projectFieldsById(
17
17
  {
18
18
  // id: '120162210202407171202250'
19
19
  id: 'blxonxv1m'
20
20
  },
21
- ['location', 'project', 'startDate', 'typeOf', 'superEvent.location.id', 'offers.itemOffered']
21
+ // [
22
+ // 'project', 'organizer', 'typeOf',
23
+ // 'name', 'doorTime', 'endDate', 'eventStatus',
24
+ // 'location', 'startDate', 'superEvent',
25
+ // 'offers'
26
+ // ]
27
+ ['project', 'startDate', 'typeOf', 'superEvent.location.id']
22
28
  );
23
29
  // tslint:disable-next-line:no-null-keyword
24
30
  console.dir(event, { depth: null });
@@ -68,17 +68,18 @@ class AggregateReservationRepo {
68
68
  var _a;
69
69
  return __awaiter(this, void 0, void 0, function* () {
70
70
  const matchStages = AggregateReservationRepo.CREATE_MONGO_CONDITIONS(params);
71
- let projection = {
71
+ let projectStage = {
72
72
  _id: 0,
73
73
  id: '$reservationFor.id'
74
74
  };
75
75
  if (Array.isArray(inclusion) && inclusion.length > 0) {
76
76
  inclusion.forEach((field) => {
77
- projection[field] = 1;
77
+ projectStage[field] = { $ifNull: [`$${field}`, '$false'] };
78
+ // projectStage[field] = 1;
78
79
  });
79
80
  }
80
81
  else {
81
- projection = {
82
+ projectStage = {
82
83
  _id: 0,
83
84
  id: '$reservationFor.id',
84
85
  aggregateEntranceGate: 1,
@@ -91,7 +92,16 @@ class AggregateReservationRepo {
91
92
  ...(typeof sortByStartDate === 'number')
92
93
  ? [{ $sort: { 'reservationFor.startDate': sortByStartDate } }]
93
94
  : [],
94
- { $project: projection }
95
+ // 現時点でreservationFor.idへのunique indexがないので、重複ドキュメント対応として、$group
96
+ {
97
+ $group: {
98
+ _id: '$reservationFor.id',
99
+ reservationFor: { $first: '$reservationFor' },
100
+ aggregateEntranceGate: { $first: '$aggregateEntranceGate' },
101
+ aggregateOffer: { $first: '$aggregateOffer' }
102
+ }
103
+ },
104
+ { $project: projectStage }
95
105
  ]);
96
106
  if (typeof params.limit === 'number' && params.limit > 0) {
97
107
  const page = (typeof params.page === 'number' && params.page > 0) ? params.page : 1;
@@ -74,7 +74,7 @@ type IKeyOfProjection<T extends factory.eventType> = keyof factory.event.IEvent<
74
74
  * minimizedEvent検索時のprojection候補
75
75
  * add(2024-07-18~)
76
76
  */
77
- type IKeyOfProjection4minimizedEvent<T extends factory.eventType> = T extends factory.eventType.ScreeningEvent ? Exclude<keyof IMinimizedIndividualEvent<T>, 'additionalProperty'> | 'superEvent.id' | 'location.branchCode' | 'superEvent.workPerformed.identifier' | 'superEvent.location.id' | 'offers.itemOffered' | 'offers.itemOffered.id' | 'offers.offeredThrough' | 'offers.unacceptedPaymentMethod' | 'offers.eligibleQuantity' : T extends factory.eventType.Event ? Exclude<keyof IMinimizedIndividualEvent<T>, 'additionalProperty'> | 'superEvent.id' | 'location.branchCode' | 'superEvent.workPerformed.identifier' | 'superEvent.location.id' | 'offers.itemOffered' | 'offers.itemOffered.id' | 'offers.offeredThrough' | 'offers.unacceptedPaymentMethod' | 'offers.eligibleQuantity' : never;
77
+ type IKeyOfProjection4minimizedEvent<T extends factory.eventType> = T extends factory.eventType.ScreeningEvent ? Exclude<keyof IMinimizedIndividualEvent<T>, 'additionalProperty' | 'id'> | 'superEvent.id' | 'location.branchCode' | 'superEvent.workPerformed.identifier' | 'superEvent.location.id' | 'offers.itemOffered' | 'offers.itemOffered.id' | 'offers.offeredThrough' | 'offers.unacceptedPaymentMethod' | 'offers.eligibleQuantity' : T extends factory.eventType.Event ? Exclude<keyof IMinimizedIndividualEvent<T>, 'additionalProperty' | 'id'> | 'superEvent.id' | 'location.branchCode' | 'superEvent.workPerformed.identifier' | 'superEvent.location.id' | 'offers.itemOffered' | 'offers.itemOffered.id' | 'offers.offeredThrough' | 'offers.unacceptedPaymentMethod' | 'offers.eligibleQuantity' : never;
78
78
  type IUnset<T extends factory.eventType> = {
79
79
  [key in keyof factory.event.IEvent<T>]?: 1;
80
80
  };
@@ -162,7 +162,11 @@ export declare class EventRepo {
162
162
  */
163
163
  search<T extends factory.eventType>(params: ISearchConditions<T>, inclusion: IKeyOfProjection<T>[], exclusion: IKeyOfProjection<T>[]): Promise<Omit<factory.event.IEvent<T>, 'aggregateEntranceGate' | 'aggregateOffer'>[]>;
164
164
  searchIds<T extends factory.eventType>(params: ISearchConditions<T>): Promise<string[]>;
165
- findMinimizedIndividualEventById<T extends factory.eventType.ScreeningEvent | factory.eventType.Event>(params: {
165
+ /**
166
+ * 特定イベントから指定フィールドのみ取得する
167
+ * イベント IDは必ず返ります
168
+ */
169
+ projectFieldsById<T extends factory.eventType.ScreeningEvent | factory.eventType.Event>(params: {
166
170
  id: string;
167
171
  }, inclusion: IKeyOfProjection4minimizedEvent<T>[]): Promise<IMinimizedIndividualEvent<T>>;
168
172
  /**
@@ -38,23 +38,25 @@ const settings_1 = require("../settings");
38
38
  // 'name',
39
39
  // 'doorTime', 'endDate', 'eventStatus', 'location', 'startDate', 'offers', 'identifier'
40
40
  // ];
41
- const PROJECTION_MINIMIZED_EVENT = {
42
- project: 1,
43
- organizer: 1,
44
- _id: 1,
45
- typeOf: 1,
46
- // additionalProperty: 1, // discontinue(2024-07-20~)
47
- name: 1,
48
- doorTime: 1,
49
- endDate: 1,
50
- eventStatus: 1,
51
- location: 1,
52
- startDate: 1,
53
- superEvent: 1,
54
- offers: 1,
55
- coaInfo: 1,
56
- identifier: 1
57
- };
41
+ // const PROJECTION_MINIMIZED_EVENT: {
42
+ // [key in (IKeyOfProjection<factory.eventType.ScreeningEvent> | IKeyOfProjection<factory.eventType.Event>)]?: 1
43
+ // } = {
44
+ // project: 1,
45
+ // organizer: 1,
46
+ // _id: 1,
47
+ // typeOf: 1,
48
+ // // additionalProperty: 1, // discontinue(2024-07-20~)
49
+ // name: 1,
50
+ // doorTime: 1,
51
+ // endDate: 1,
52
+ // eventStatus: 1,
53
+ // location: 1,
54
+ // startDate: 1,
55
+ // superEvent: 1,
56
+ // offers: 1,
57
+ // coaInfo: 1,
58
+ // identifier: 1
59
+ // };
58
60
  /**
59
61
  * イベントリポジトリ
60
62
  */
@@ -863,45 +865,6 @@ class EventRepo {
863
865
  .then((docs) => docs.map((doc) => doc.toObject()));
864
866
  });
865
867
  }
866
- // イベント集計検索廃止(2024-03-28~)
867
- // public async searchAggregations(
868
- // params: Pick<
869
- // ISearchConditions<factory.eventType.ScreeningEvent>,
870
- // 'page' | 'limit' | 'sort' | 'project' | 'typeOf' | 'id' | 'startFrom' | 'startThrough' | 'organizer'
871
- // >,
872
- // inclusion: ('aggregateEntranceGate' | 'aggregateOffer' | 'aggregateReservation')[]
873
- // ): Promise<Pick<
874
- // factory.event.IEvent<factory.eventType.ScreeningEvent>,
875
- // 'aggregateEntranceGate' | 'aggregateOffer' | 'aggregateReservation' | 'id'
876
- // >[]> {
877
- // const conditions = MongoRepository.CREATE_MONGO_CONDITIONS<factory.eventType.ScreeningEvent>(params);
878
- // let projection: IProjection<factory.eventType.ScreeningEvent> = {};
879
- // if (Array.isArray(inclusion) && inclusion.length > 0) {
880
- // inclusion.forEach((field) => {
881
- // projection[field] = 1;
882
- // });
883
- // } else {
884
- // projection = {
885
- // aggregateEntranceGate: 1,
886
- // aggregateOffer: 1,
887
- // aggregateReservation: 1
888
- // };
889
- // }
890
- // const query = this.eventModel.find({ $and: conditions }, projection);
891
- // if (typeof params.limit === 'number' && params.limit > 0) {
892
- // const page: number = (typeof params.page === 'number' && params.page > 0) ? params.page : 1;
893
- // query.limit(params.limit)
894
- // .skip(params.limit * (page - 1));
895
- // }
896
- // // tslint:disable-next-line:no-single-line-block-comment
897
- // /* istanbul ignore else */
898
- // if (params.sort?.startDate !== undefined) {
899
- // query.sort({ startDate: params.sort.startDate });
900
- // }
901
- // return query.setOptions({ maxTimeMS: MONGO_MAX_TIME_MS })
902
- // .exec()
903
- // .then((docs) => docs.map((doc) => doc.toObject()));
904
- // }
905
868
  searchIds(params) {
906
869
  return __awaiter(this, void 0, void 0, function* () {
907
870
  const conditions = EventRepo.CREATE_MONGO_CONDITIONS(params);
@@ -910,24 +873,37 @@ class EventRepo {
910
873
  .exec();
911
874
  });
912
875
  }
913
- findMinimizedIndividualEventById(params, inclusion // add projection(2024-07-18~)
876
+ /**
877
+ * 特定イベントから指定フィールドのみ取得する
878
+ * イベント IDは必ず返ります
879
+ */
880
+ projectFieldsById(params, inclusion // add projection(2024-07-18~)
914
881
  ) {
915
882
  return __awaiter(this, void 0, void 0, function* () {
916
- let projection = {};
883
+ const projection = {
884
+ _id: 0,
885
+ id: { $toString: '$_id' }
886
+ };
917
887
  if (Array.isArray(inclusion) && inclusion.length > 0) {
918
888
  inclusion.forEach((field) => {
919
- projection[field] = 1;
889
+ if (field !== '_id' && field !== 'id') {
890
+ projection[field] = 1;
891
+ }
920
892
  });
921
893
  }
922
894
  else {
923
- projection = PROJECTION_MINIMIZED_EVENT;
895
+ // discontinue(2024-07-24~)
896
+ throw new factory.errors.Argument('inclusion', 'inclusion must be specified');
897
+ // projection = PROJECTION_MINIMIZED_EVENT;
924
898
  }
925
899
  const doc = yield this.eventModel.findOne({ _id: { $eq: params.id } }, projection)
900
+ .lean() // lean(2024-07-24~)
926
901
  .exec();
927
902
  if (doc === null) {
928
903
  throw new factory.errors.NotFound(this.eventModel.modelName);
929
904
  }
930
- return doc.toObject();
905
+ return doc;
906
+ // return doc.toObject();
931
907
  });
932
908
  }
933
909
  /**
@@ -21,7 +21,7 @@ const debug = createDebug('chevre-domain:service:aggregation');
21
21
  function aggregateOffers(params) {
22
22
  return (repos) => __awaiter(this, void 0, void 0, function* () {
23
23
  // 集計対象イベント検索
24
- const event = yield repos.event.findMinimizedIndividualEventById({ id: params.id }, [
24
+ const event = yield repos.event.projectFieldsById({ id: params.id }, [
25
25
  'location', 'project', 'startDate', 'typeOf', 'superEvent.location.id', 'offers.itemOffered'
26
26
  ] // projection(2024-07-21~)
27
27
  );
@@ -24,7 +24,7 @@ const debug = createDebug('chevre-domain:service:aggregation');
24
24
  function aggregateScreeningEvent(params) {
25
25
  return (repos, settings) => __awaiter(this, void 0, void 0, function* () {
26
26
  // 集計対象イベント検索
27
- const event = yield repos.event.findMinimizedIndividualEventById({ id: params.id }, ['location', 'project', 'startDate', 'typeOf', 'superEvent.location.id', 'offers.itemOffered']);
27
+ const event = yield repos.event.projectFieldsById({ id: params.id }, ['location', 'project', 'startDate', 'typeOf', 'superEvent.location.id', 'offers.itemOffered']);
28
28
  let aggregatingEvents = [event];
29
29
  // プロジェクト限定(2023-02-22~)
30
30
  if (settings.useOfferRateLimitProjects.includes(event.project.id)) {
@@ -22,7 +22,7 @@ function aggregateUseActionsOnEvent(params) {
22
22
  return (repos) => __awaiter(this, void 0, void 0, function* () {
23
23
  const now = new Date();
24
24
  // 集計対象イベント検索
25
- const event = yield repos.event.findMinimizedIndividualEventById(params, ['offers.itemOffered.id', 'project', 'startDate', 'superEvent', 'typeOf'] // optimize projection(2024-07-19~)
25
+ const event = yield repos.event.projectFieldsById(params, ['offers.itemOffered.id', 'project', 'startDate', 'superEvent', 'typeOf'] // optimize projection(2024-07-19~)
26
26
  );
27
27
  // 入場ゲート検索
28
28
  const entranceGates = yield findEntranceGates({ event })(repos);
@@ -84,20 +84,18 @@ function fixEvent(params) {
84
84
  if (typeof reservationForId !== 'string' || reservationForId.length === 0) {
85
85
  throw new factory.errors.ArgumentNull('object.reservationFor.id');
86
86
  }
87
- let event;
88
- // discontinue preSearchedEvent(2024-07-17~)
89
- // if (typeof params.preSearchedEvent?.typeOf === 'string') {
90
- // event = params.preSearchedEvent;
91
- // } else {
92
- // event = await repos.event.findMinimizedIndividualEventById({ id: reservationForId });
93
- // }
94
- event = yield repos.event.findMinimizedIndividualEventById({ id: reservationForId }, []);
95
- let offeredThrough = (_b = event.offers) === null || _b === void 0 ? void 0 : _b.offeredThrough;
96
- if (offeredThrough === undefined) {
97
- offeredThrough = { typeOf: 'WebAPI', identifier: factory.service.webAPI.Identifier.Chevre };
98
- }
99
- if (offeredThrough.identifier === factory.service.webAPI.Identifier.COA) {
100
- throw new factory.errors.NotImplemented(`${offeredThrough.identifier} not implemented`);
87
+ const event = yield repos.event.projectFieldsById({ id: reservationForId }, [
88
+ 'project', 'organizer', 'typeOf',
89
+ // additionalProperty, // discontinue(2024-07-20~)
90
+ 'name', 'doorTime', 'endDate', 'eventStatus',
91
+ 'location', 'startDate', 'superEvent',
92
+ 'offers'
93
+ // 'coaInfo', // discontinue(2024-07-24~)
94
+ // 'identifier' // discontinue(2024-07-24~)
95
+ ]);
96
+ const offeredThroughIdentifier = (_b = event.offers.offeredThrough) === null || _b === void 0 ? void 0 : _b.identifier;
97
+ if (offeredThroughIdentifier === factory.service.webAPI.Identifier.COA) {
98
+ throw new factory.errors.NotImplemented(`${offeredThroughIdentifier} not implemented`);
101
99
  }
102
100
  return event;
103
101
  });
@@ -2,7 +2,7 @@ import * as factory from '../../../factory';
2
2
  import { IMinimizedIndividualEvent } from '../../../factory/event';
3
3
  declare function validateStartRequest(params: {
4
4
  object: factory.assetTransaction.reserve.IObjectWithoutDetail;
5
- event: IMinimizedIndividualEvent<factory.eventType.Event | factory.eventType.ScreeningEvent>;
5
+ event: Pick<IMinimizedIndividualEvent<factory.eventType.Event | factory.eventType.ScreeningEvent>, 'offers' | 'id'>;
6
6
  validateEventOfferPeriod?: boolean;
7
7
  validateEvent?: boolean;
8
8
  now: Date;
@@ -313,7 +313,7 @@ function searchEventTicketOffers(params) {
313
313
  return (repos) => __awaiter(this, void 0, void 0, function* () {
314
314
  const eventType = params.event.typeOf;
315
315
  // optimize projection(2024-07-17~)
316
- const event = yield repos.event.findMinimizedIndividualEventById({ id: params.event.id }, [
316
+ const event = yield repos.event.projectFieldsById({ id: params.event.id }, [
317
317
  'project', 'typeOf', 'startDate',
318
318
  'superEvent.id',
319
319
  'offers.itemOffered.id', 'offers.offeredThrough', 'offers.unacceptedPaymentMethod', 'offers.eligibleQuantity'
@@ -358,7 +358,7 @@ function searchOfferAppliesToMovieTicket(params) {
358
358
  return (repos) => __awaiter(this, void 0, void 0, function* () {
359
359
  var _a, _b, _c;
360
360
  // optimize(2024-07-18~)
361
- const event = yield repos.event.findMinimizedIndividualEventById({ id: params.event.id }, ['project', 'startDate', 'typeOf', 'superEvent.id', 'offers.itemOffered.id', 'offers.unacceptedPaymentMethod']);
361
+ const event = yield repos.event.projectFieldsById({ id: params.event.id }, ['project', 'startDate', 'typeOf', 'superEvent.id', 'offers.itemOffered.id', 'offers.unacceptedPaymentMethod']);
362
362
  // let soundFormatTypes: string[] = [];
363
363
  let videoFormatTypes = [];
364
364
  if (event.typeOf === factory.eventType.ScreeningEvent) {
@@ -437,7 +437,7 @@ function searchOfferCatalogItems(params) {
437
437
  }
438
438
  let offerCatalogItems = [];
439
439
  // optimize(2024-07-18~)
440
- const event = yield repos.event.findMinimizedIndividualEventById({ id: params.event.id }, ['offers.itemOffered.id']);
440
+ const event = yield repos.event.projectFieldsById({ id: params.event.id }, ['offers.itemOffered.id']);
441
441
  // 興行設定があれば興行のカタログを参照する
442
442
  const eventOffers = event.offers;
443
443
  let catalogId;
@@ -507,7 +507,7 @@ function searchOfferCatalogItemAvailability(params) {
507
507
  }
508
508
  let availabilities = [];
509
509
  // optimize(2024-07-18~)
510
- const event = yield repos.event.findMinimizedIndividualEventById({ id: params.event.id }, ['project', 'offers.itemOffered.id']);
510
+ const event = yield repos.event.projectFieldsById({ id: params.event.id }, ['project', 'offers.itemOffered.id']);
511
511
  // 興行設定があれば興行のカタログを参照する
512
512
  const eventOffers = event.offers;
513
513
  let catalogId;
@@ -48,7 +48,7 @@ function authorize(params) {
48
48
  typeOf: factory.assetTransactionType.COAReserveTransaction
49
49
  };
50
50
  try {
51
- screeningEvent = yield repos.event.findMinimizedIndividualEventById({ id: params.object.event.id }, [
51
+ screeningEvent = yield repos.event.projectFieldsById({ id: params.object.event.id }, [
52
52
  'coaInfo', 'doorTime', 'endDate', 'location', 'startDate',
53
53
  'superEvent', 'typeOf', 'identifier', 'name'
54
54
  ] // optimize(2024-07-18~)
@@ -72,7 +72,7 @@ function changeOffers(params) {
72
72
  return Object.assign(Object.assign({}, offer), { ticketInfo: Object.assign(Object.assign({}, offer.ticketInfo), { spseatAdd1: originalAcceptedOfferBySeatNumber.ticketInfo.spseatAdd1, spseatAdd2: originalAcceptedOfferBySeatNumber.ticketInfo.spseatAdd2, spseatKbn: originalAcceptedOfferBySeatNumber.ticketInfo.spseatKbn }) });
73
73
  });
74
74
  // イベント取得属性最適化(2023-01-23~)
75
- const screeningEvent = yield repos.event.findMinimizedIndividualEventById({ id: params.object.event.id }, [
75
+ const screeningEvent = yield repos.event.projectFieldsById({ id: params.object.event.id }, [
76
76
  'coaInfo', 'doorTime', 'endDate', 'location', 'startDate',
77
77
  'superEvent', 'typeOf', 'identifier', 'name'
78
78
  ] // optimize(2024-07-18~)
@@ -66,7 +66,7 @@ function searchEventSeatOffersWithPaging(params) {
66
66
  var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
67
67
  let offers = [];
68
68
  // optimize(2024-07-18~)
69
- const event = yield repos.event.findMinimizedIndividualEventById({ id: params.event.id }, ['project', 'startDate', 'offers.itemOffered']);
69
+ const event = yield repos.event.projectFieldsById({ id: params.event.id }, ['project', 'startDate', 'offers.itemOffered']);
70
70
  // 座席指定利用可能かどうか
71
71
  const eventOffers = event.offers;
72
72
  const reservedSeatsAvailable = ((_b = (_a = eventOffers === null || eventOffers === void 0 ? void 0 : eventOffers.itemOffered.serviceOutput) === null || _a === void 0 ? void 0 : _a.reservedTicket) === null || _b === void 0 ? void 0 : _b.ticketedSeat) !== undefined;
@@ -53,7 +53,7 @@ function checkMovieTicket(params) {
53
53
  if (eventIds.length !== 1) {
54
54
  throw new factory.errors.Argument('movieTickets', 'Number of events must be 1');
55
55
  }
56
- const screeningEvent = yield repos.event.findMinimizedIndividualEventById({ id: eventIds[0] }, [
56
+ const screeningEvent = yield repos.event.projectFieldsById({ id: eventIds[0] }, [
57
57
  'typeOf', 'project', 'coaInfo', 'startDate', 'offers.offeredThrough', 'superEvent.workPerformed.identifier'
58
58
  ] // optimize projection(2024-07-19~)
59
59
  );
@@ -111,7 +111,7 @@ function payActionParams2seatInfoSyncIn(params) {
111
111
  if (eventIds.length !== 1) {
112
112
  throw new factory.errors.Argument('movieTickets', 'Number of events must be 1');
113
113
  }
114
- const event = yield repos.event.findMinimizedIndividualEventById({ id: eventIds[0] },
114
+ const event = yield repos.event.projectFieldsById({ id: eventIds[0] },
115
115
  // optimize projection(2024-07-19~)
116
116
  [
117
117
  'coaInfo', 'startDate', 'project',
@@ -45,7 +45,7 @@ function validateMovieTicket(params, paymentServiceId, useCheckByIdentifierIfNot
45
45
  throw new factory.errors.ArgumentNull('object.paymentMethod.identifier');
46
46
  }
47
47
  // イベント取得属性最適化(2023-01-23~)
48
- const screeningEvent = yield repos.event.findMinimizedIndividualEventById({ id: eventIds[0] }, [
48
+ const screeningEvent = yield repos.event.projectFieldsById({ id: eventIds[0] }, [
49
49
  'typeOf', 'project', 'coaInfo', 'startDate', 'offers.offeredThrough', 'superEvent.workPerformed.identifier'
50
50
  ] // optimize(2024-07-18~)
51
51
  );
package/package.json CHANGED
@@ -110,5 +110,5 @@
110
110
  "postversion": "git push origin --tags",
111
111
  "prepublishOnly": "npm run clean && npm run build && npm test && npm run doc"
112
112
  },
113
- "version": "22.0.0-alpha.21"
113
+ "version": "22.0.0-alpha.23"
114
114
  }