@chevre/domain 20.4.0-alpha.27 → 20.4.0-alpha.29

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.
@@ -118,27 +118,12 @@ function addReservations(params) {
118
118
  // 対応アプリケーション条件追加(2023-01-27~)
119
119
  store: { id: (_a = params.availableAtOrFrom) === null || _a === void 0 ? void 0 : _a.id },
120
120
  onlyValid: true,
121
- sort: false,
122
121
  addSortIndex: false,
123
122
  validateOfferRateLimit: true
124
123
  })(repos);
125
124
  ticketOffers = searchEventTicketOffersResult.ticketOffers;
126
125
  availableOffers = searchEventTicketOffersResult.unitPriceOffers;
127
126
  }
128
- // 冗長なfindOffersByOfferCatalogId処理を削除(2023-01-26~)
129
- // let availableOffers: factory.unitPriceOffer.IUnitPriceOffer[] = [];
130
- // // 興行設定があれば興行のカタログを参照する(2022-08-31~)
131
- // const eventOffers = <factory.event.screeningEvent.IOffer | undefined>event.offers;
132
- // if (typeof eventOffers?.itemOffered?.id === 'string') {
133
- // const eventService = <factory.product.IProduct>await repos.product.findById({ id: eventOffers.itemOffered.id });
134
- // if (typeof eventService.hasOfferCatalog?.id === 'string') {
135
- // availableOffers = await repos.offer.findOffersByOfferCatalogId({
136
- // offerCatalog: { id: eventService.hasOfferCatalog.id }
137
- // });
138
- // }
139
- // } else {
140
- // throw new factory.errors.NotFound('event.offers.itemOffered.id');
141
- // }
142
127
  const availableSeatOffers = yield searchAvailableSeatOffers({ acceptedOffers, event: { id: event.id } })(repos);
143
128
  // 仮予約作成
144
129
  const { acceptedOffers4transactionObject, objectSubReservations } = yield createAcceptedOffers4transactionObject({
@@ -21,7 +21,6 @@ const difference = require("lodash.difference");
21
21
  const moment = require("moment-timezone");
22
22
  const credentials_1 = require("../credentials");
23
23
  const factory = require("../factory");
24
- const settings_1 = require("../settings");
25
24
  const offer_1 = require("./offer");
26
25
  // const customsearch = google.customsearch('v1');
27
26
  const debug = createDebug('chevre-domain:service:event');
@@ -450,11 +449,29 @@ function createScreeningEventFromCOA(params) {
450
449
  priceCurrency: factory.priceCurrency.JPY
451
450
  };
452
451
  const { additionalProperty, coaInfo } = createScreeningEventAdditionalPropertyFromCOA(params);
453
- return Object.assign({ project: { typeOf: params.project.typeOf, id: params.project.id }, typeOf: factory.eventType.ScreeningEvent, id: id, identifier: id, name: params.superEvent.name, eventStatus: factory.eventStatusType.EventScheduled, location: {
452
+ return {
453
+ project: { typeOf: params.project.typeOf, id: params.project.id },
454
+ typeOf: factory.eventType.ScreeningEvent,
455
+ id: id,
456
+ identifier: id,
457
+ name: params.superEvent.name,
458
+ eventStatus: factory.eventStatusType.EventScheduled,
459
+ location: {
454
460
  typeOf: params.screenRoom.typeOf,
455
461
  branchCode: params.screenRoom.branchCode,
456
462
  name: params.screenRoom.name
457
- }, endDate: endDate, startDate: startDate, superEvent: params.superEvent, coaInfo, offers: offers, checkInCount: 0, attendeeCount: 0, maximumAttendeeCapacity: params.screenRoom.maximumAttendeeCapacity, remainingAttendeeCapacity: params.screenRoom.maximumAttendeeCapacity, additionalProperty }, (settings_1.settings.useEventWorkPerformed) ? { workPerformed: params.superEvent.workPerformed } : undefined);
463
+ },
464
+ endDate: endDate,
465
+ startDate: startDate,
466
+ superEvent: params.superEvent,
467
+ coaInfo,
468
+ offers: offers,
469
+ checkInCount: 0,
470
+ attendeeCount: 0,
471
+ maximumAttendeeCapacity: params.screenRoom.maximumAttendeeCapacity,
472
+ remainingAttendeeCapacity: params.screenRoom.maximumAttendeeCapacity,
473
+ additionalProperty
474
+ };
458
475
  }
459
476
  function createScreeningEventAdditionalPropertyFromCOA(params) {
460
477
  const coaInfo = {
@@ -225,7 +225,6 @@ function validateAcceptedOffers(params) {
225
225
  event: { id: params.event.id },
226
226
  store: params.store,
227
227
  onlyValid: true,
228
- sort: false,
229
228
  addSortIndex: false,
230
229
  validateOfferRateLimit: true
231
230
  })(repos);
@@ -73,7 +73,6 @@ declare function searchEventTicketOffers(params: {
73
73
  };
74
74
  limit?: number;
75
75
  page?: number;
76
- sort: boolean;
77
76
  addSortIndex: boolean;
78
77
  validateOfferRateLimit: boolean;
79
78
  }): ISearchEventTicketOffersOperation<{
@@ -26,12 +26,18 @@ function searchTicketOffersByItemOffered(params) {
26
26
  if (typeof catalogId !== 'string') {
27
27
  throw new factory.errors.NotFound('itemOffered.hasOfferCatalog');
28
28
  }
29
- const findOffersByOfferCatalogIdResult = yield repos.offer.findOffersByOfferCatalogId(Object.assign({ ids: params.ids, offerCatalog: { id: catalogId }, availableAtOrFrom: { id: (_d = params.store) === null || _d === void 0 ? void 0 : _d.id }, unacceptedPaymentMethod: params.unacceptedPaymentMethod, excludeAppliesToMovieTicket: params.excludeAppliesToMovieTicket, onlyValid: params.onlyValid === true, sort: params.sort }, (!params.sort)
30
- ? {
31
- limit: params.limit,
32
- page: params.page
33
- }
34
- : undefined));
29
+ const findOffersByOfferCatalogIdResult = yield repos.offer.findOffersByOfferCatalogId({
30
+ ids: params.ids,
31
+ offerCatalog: { id: catalogId },
32
+ availableAtOrFrom: { id: (_d = params.store) === null || _d === void 0 ? void 0 : _d.id },
33
+ unacceptedPaymentMethod: params.unacceptedPaymentMethod,
34
+ excludeAppliesToMovieTicket: params.excludeAppliesToMovieTicket,
35
+ onlyValid: params.onlyValid === true,
36
+ // Mongoのpagingを利用するオプション(2023-02-21~)
37
+ limit: params.limit,
38
+ page: params.page,
39
+ sort: false
40
+ });
35
41
  const availableOffers = findOffersByOfferCatalogIdResult.offers;
36
42
  const sortedOfferIds = findOffersByOfferCatalogIdResult.sortedOfferIds;
37
43
  return { availableOffers, sortedOfferIds };
@@ -63,7 +69,6 @@ function searchEventTicketOffersByEvent(params) {
63
69
  store: params.store,
64
70
  limit: params.limit,
65
71
  page: params.page,
66
- sort: params.sort,
67
72
  onlyValid: params.onlyValid,
68
73
  unacceptedPaymentMethod,
69
74
  excludeAppliesToMovieTicket
@@ -271,7 +276,6 @@ function searchEventTicketOffers(params) {
271
276
  store: params.store,
272
277
  limit: params.limit,
273
278
  page: params.page,
274
- sort: params.sort,
275
279
  addSortIndex: params.addSortIndex,
276
280
  validateOfferRateLimit: params.validateOfferRateLimit,
277
281
  onlyValid: params.onlyValid === true
@@ -21,7 +21,6 @@ export declare type ISettings = factory.project.ISettings & {
21
21
  userPoolIdOld: string;
22
22
  userPoolIdNew: string;
23
23
  maxNumCreditCardPaymentMethod?: number;
24
- useEventWorkPerformed: boolean;
25
24
  useAggregateEntranceGateProjects: string[];
26
25
  useAggregateOfferProjects: string[];
27
26
  useOfferRateLimitProjects: string[];
@@ -94,7 +94,7 @@ exports.settings = Object.assign(Object.assign({ transactionWebhookUrls, onOrder
94
94
  timeout: triggerWebhookTimeout
95
95
  }, maximumReservationGracePeriodInDays: MAXIMUM_RESERVATION_GRACE_PERIOD_IN_DAYS, userPoolIdOld: String(process.env.USERPOOL_ID_OLD), userPoolIdNew: String(process.env.USERPOOL_ID_NEW) }, (typeof MAX_NUM_CREDIT_CARD_PAYMENT_METHOD === 'number')
96
96
  ? { maxNumCreditCardPaymentMethod: MAX_NUM_CREDIT_CARD_PAYMENT_METHOD }
97
- : undefined), { useEventWorkPerformed: process.env.USE_EVENT_WORK_PERFORMED === '1', useAggregateEntranceGateProjects: (typeof process.env.USE_AGGREGATE_ENTRANCE_GATE_PROJECTS === 'string')
97
+ : undefined), { useAggregateEntranceGateProjects: (typeof process.env.USE_AGGREGATE_ENTRANCE_GATE_PROJECTS === 'string')
98
98
  ? process.env.USE_AGGREGATE_ENTRANCE_GATE_PROJECTS.split(',')
99
99
  : [], useAggregateOfferProjects: (typeof process.env.USE_AGGREGATE_OFFER_PROJECTS === 'string')
100
100
  ? process.env.USE_AGGREGATE_OFFER_PROJECTS.split(',')
package/package.json CHANGED
@@ -120,5 +120,5 @@
120
120
  "postversion": "git push origin --tags",
121
121
  "prepublishOnly": "npm run clean && npm run build && npm test && npm run doc"
122
122
  },
123
- "version": "20.4.0-alpha.27"
123
+ "version": "20.4.0-alpha.29"
124
124
  }