@chevre/domain 21.8.0-alpha.43 → 21.8.0-alpha.44

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.
@@ -18,8 +18,8 @@ async function main() {
18
18
  id: '0001'
19
19
  // id: 'xxx'
20
20
  },
21
- excludeAppliesToMovieTicket: false
22
- // useOffersAsPrimary: true
21
+ excludeAppliesToMovieTicket: false,
22
+ useOffersAsPrimaryForcible: false
23
23
  });
24
24
  console.log(offers.map((offer) => {
25
25
  return `${offer.project?.id} ${offer.identifier} ${offer.priceSpecification?.price} ${offer.name?.ja} ${offer.id} ${(<any>offer).offerIndex}`;
@@ -71,7 +71,7 @@ export declare class MongoRepository {
71
71
  /**
72
72
  * 強制的にoffersコレクションを使用する
73
73
  */
74
- useOffersAsPrimary?: boolean;
74
+ useOffersAsPrimaryForcible: boolean;
75
75
  }): Promise<{
76
76
  offers: IUnitPriceOfferFromAggregateOffer[];
77
77
  sortedOfferIds: string[];
@@ -833,10 +833,7 @@ class MongoRepository {
833
833
  // 明示的なソート指定を調整(決して重複しない属性が相応)(2023-09-07~)
834
834
  ? { sort: { identifier: factory.sortType.Ascending } }
835
835
  : undefined), (typeof params.limit === 'number') ? { limit: params.limit } : undefined), (typeof params.page === 'number') ? { page: params.page } : undefined);
836
- // USE_AGGREGATE_OFFERS_AS_PRIMARY_ON_SEARCH_BY_CATALOG対応(2023-09-06~)
837
- const useOffersAsPrimary = (params.useOffersAsPrimary === true)
838
- ? true
839
- : !settings_1.USE_AGGREGATE_OFFERS_AS_PRIMARY_ON_SEARCH_BY_CATALOG;
836
+ const useOffersAsPrimary = (params.useOffersAsPrimaryForcible === true);
840
837
  offers = yield this.search(searchOffersConditions, params.projection, useOffersAsPrimary);
841
838
  // 完全廃止(基本的にsortedOfferIdsと合わせて利用する想定)(2023-09-04~)
842
839
  // if (params.sort) {
@@ -179,7 +179,8 @@ function findOffers(params) {
179
179
  if (typeof ((_b = eventService.hasOfferCatalog) === null || _b === void 0 ? void 0 : _b.id) === 'string') {
180
180
  const findOffersByOfferCatalogIdResult = yield repos.offer.findOffersByOfferCatalogId({
181
181
  offerCatalog: { id: eventService.hasOfferCatalog.id },
182
- excludeAppliesToMovieTicket: false
182
+ excludeAppliesToMovieTicket: false,
183
+ useOffersAsPrimaryForcible: false
183
184
  // sort: false // ソート不要(2023-01-27~) // 完全廃止(2023-09-04~)
184
185
  });
185
186
  availableOffers = findOffersByOfferCatalogIdResult.offers;
@@ -104,7 +104,8 @@ function findOffers(params) {
104
104
  if (typeof ((_b = eventService.hasOfferCatalog) === null || _b === void 0 ? void 0 : _b.id) === 'string') {
105
105
  const findOffersByOfferCatalogIdResult = yield repos.offer.findOffersByOfferCatalogId({
106
106
  offerCatalog: { id: eventService.hasOfferCatalog.id },
107
- excludeAppliesToMovieTicket: false
107
+ excludeAppliesToMovieTicket: false,
108
+ useOffersAsPrimaryForcible: false
108
109
  // sort: false // ソート不要(2023-01-27~) // 完全廃止(2023-09-04~)
109
110
  });
110
111
  availableOffers = findOffersByOfferCatalogIdResult.offers;
@@ -94,7 +94,8 @@ function createTransactionObject(params) {
94
94
  ids: params.acceptedOffers.map((o) => o.id),
95
95
  itemOffered: { id: String(params.product.id) },
96
96
  onlyValid: true,
97
- addSortIndex: false
97
+ addSortIndex: false,
98
+ useOffersAsPrimaryForcible: false
98
99
  })(repos);
99
100
  const transactionObject = [];
100
101
  for (const acceptedOffer of params.acceptedOffers) {
@@ -120,7 +120,8 @@ function addReservations(params) {
120
120
  store: { id: (_a = params.availableAtOrFrom) === null || _a === void 0 ? void 0 : _a.id },
121
121
  onlyValid: true,
122
122
  addSortIndex: false,
123
- validateOfferRateLimit: true
123
+ validateOfferRateLimit: true,
124
+ useOffersAsPrimaryForcible: false
124
125
  })(repos);
125
126
  ticketOffers = searchEventTicketOffersResult.ticketOffers;
126
127
  availableOffers = searchEventTicketOffersResult.unitPriceOffers;
@@ -476,7 +477,7 @@ function searchAvailableAddOns(params) {
476
477
  if (Array.isArray(params.ticketOffer.addOn)) {
477
478
  const addOnProductIds = [...new Set(params.ticketOffer.addOn.map((o) => String(o.itemOffered.id)))];
478
479
  for (const addOnProductId of addOnProductIds) {
479
- const { offers, product } = yield OfferService.product.search(Object.assign({ ids: params.ids, project: { id: params.project.id }, itemOffered: { id: addOnProductId }, onlyValid: true, addSortIndex: false }, (typeof ((_a = params.availableAtOrFrom) === null || _a === void 0 ? void 0 : _a.id) === 'string')
480
+ const { offers, product } = yield OfferService.product.search(Object.assign({ ids: params.ids, project: { id: params.project.id }, itemOffered: { id: addOnProductId }, onlyValid: true, addSortIndex: false, useOffersAsPrimaryForcible: false }, (typeof ((_a = params.availableAtOrFrom) === null || _a === void 0 ? void 0 : _a.id) === 'string')
480
481
  ? { availableAt: { id: params.availableAtOrFrom.id } }
481
482
  : undefined))(repos);
482
483
  availableAddOns.push(...offers.map((o) => {
@@ -239,7 +239,8 @@ function validateAcceptedOffers(params) {
239
239
  store: params.store,
240
240
  onlyValid: true,
241
241
  addSortIndex: false,
242
- validateOfferRateLimit: true
242
+ validateOfferRateLimit: true,
243
+ useOffersAsPrimaryForcible: false
243
244
  })(repos);
244
245
  // 利用可能なチケットオファーであれば受け入れる
245
246
  const acceptedOffers = (Array.isArray(acceptedOffersWithoutDetail))
@@ -47,6 +47,7 @@ declare function searchEventTicketOffers(params: {
47
47
  page?: number;
48
48
  addSortIndex: boolean;
49
49
  validateOfferRateLimit: boolean;
50
+ useOffersAsPrimaryForcible: boolean;
50
51
  }): ISearchEventTicketOffersOperation<{
51
52
  ticketOffers: ITicketOfferWithSortIndex[];
52
53
  unitPriceOffers: factory.unitPriceOffer.IUnitPriceOffer[];
@@ -35,7 +35,8 @@ function searchTicketOffersByItemOffered(params) {
35
35
  onlyValid: params.onlyValid === true,
36
36
  // Mongoのpagingを利用するオプション(2023-02-21~)
37
37
  limit: params.limit,
38
- page: params.page
38
+ page: params.page,
39
+ useOffersAsPrimaryForcible: params.useOffersAsPrimaryForcible
39
40
  // sort: false // 完全廃止(2023-09-04~)
40
41
  });
41
42
  return { availableOffers: offers, sortedOfferIds };
@@ -84,7 +85,8 @@ function searchEventTicketOffersByEvent(params) {
84
85
  page: params.page,
85
86
  onlyValid: params.onlyValid,
86
87
  unacceptedPaymentMethod,
87
- excludeAppliesToMovieTicket
88
+ excludeAppliesToMovieTicket,
89
+ useOffersAsPrimaryForcible: params.useOffersAsPrimaryForcible
88
90
  })(repos);
89
91
  // 冗長な検索について最適化(2023-03-03~)
90
92
  const { soundFormatChargeSpecs, videoFormatChargeSpecs, movieTicketTypeChargeSpecs } = yield searchPriceSpecs4event({
@@ -248,7 +250,8 @@ function searchEventTicketOffers(params) {
248
250
  page: params.page,
249
251
  addSortIndex: params.addSortIndex,
250
252
  validateOfferRateLimit: params.validateOfferRateLimit,
251
- onlyValid: params.onlyValid === true
253
+ onlyValid: params.onlyValid === true,
254
+ useOffersAsPrimaryForcible: params.useOffersAsPrimaryForcible
252
255
  })(repos);
253
256
  offers = searchOffersResult.ticketOffers;
254
257
  unitPriceOffers = searchOffersResult.unitPriceOffers;
@@ -19,6 +19,7 @@ export declare function searchProductOffers(params: {
19
19
  addSortIndex: boolean;
20
20
  limit?: number;
21
21
  page?: number;
22
+ useOffersAsPrimaryForcible: boolean;
22
23
  }): (repos: {
23
24
  offer: OfferRepo;
24
25
  product: ProductRepo;
@@ -31,7 +31,8 @@ function searchProductOffers(params) {
31
31
  page: params.page,
32
32
  // sort: false, // 完全廃止(2023-09-04~)
33
33
  onlyValid: params.onlyValid === true,
34
- availableAtOrFrom: params.availableAt
34
+ availableAtOrFrom: params.availableAt,
35
+ useOffersAsPrimaryForcible: params.useOffersAsPrimaryForcible
35
36
  });
36
37
  return offers.map((o) => {
37
38
  let sortIndex;
@@ -55,6 +55,7 @@ export declare function search(params: {
55
55
  limit?: number;
56
56
  page?: number;
57
57
  addSortIndex: boolean;
58
+ useOffersAsPrimaryForcible: boolean;
58
59
  }): (repos: {
59
60
  offer: OfferRepo;
60
61
  product: ProductRepo;
@@ -66,7 +66,8 @@ function search(params) {
66
66
  itemOffered: { id: params.itemOffered.id },
67
67
  availableAt: params.availableAt,
68
68
  onlyValid: params.onlyValid,
69
- addSortIndex: params.addSortIndex
69
+ addSortIndex: params.addSortIndex,
70
+ useOffersAsPrimaryForcible: params.useOffersAsPrimaryForcible
70
71
  })(repos);
71
72
  return { offers, product };
72
73
  // Mongoへ移行(2023-03-01~)
@@ -211,7 +212,7 @@ function fixProductAndOffers(params) {
211
212
  if (product === undefined) {
212
213
  throw new factory.errors.NotFound('Product');
213
214
  }
214
- const { offers } = yield search(Object.assign({ ids: params.object.map((o) => String(o.id)), project: { id: params.project.id }, itemOffered: { id: String(product.id) }, onlyValid: true, addSortIndex: false }, (typeof ((_c = params.location) === null || _c === void 0 ? void 0 : _c.id) === 'string') ? { availableAt: { id: params.location.id } } : undefined))(repos);
215
+ const { offers } = yield search(Object.assign({ ids: params.object.map((o) => String(o.id)), project: { id: params.project.id }, itemOffered: { id: String(product.id) }, onlyValid: true, addSortIndex: false, useOffersAsPrimaryForcible: false }, (typeof ((_c = params.location) === null || _c === void 0 ? void 0 : _c.id) === 'string') ? { availableAt: { id: params.location.id } } : undefined))(repos);
215
216
  return { product, availableOffers: offers };
216
217
  });
217
218
  }
@@ -43,7 +43,6 @@ export declare const USE_DELETE_EVENT_BY_ORDER: boolean;
43
43
  export declare const USE_ORDER_PAYMENT_DUE_ON_PLACED: boolean;
44
44
  export declare const USE_AUTHORIZE_PAYMENT_RESULT_AS_ARRAY: boolean;
45
45
  export declare const USE_AGGREGATE_OFFERS_AS_PRIMARY: boolean;
46
- export declare const USE_AGGREGATE_OFFERS_AS_PRIMARY_ON_SEARCH_BY_CATALOG: boolean;
47
46
  export declare const MONGO_MAX_TIME_MS: number;
48
47
  /**
49
48
  * グローバル設定
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.settings = exports.MONGO_MAX_TIME_MS = exports.USE_AGGREGATE_OFFERS_AS_PRIMARY_ON_SEARCH_BY_CATALOG = exports.USE_AGGREGATE_OFFERS_AS_PRIMARY = exports.USE_AUTHORIZE_PAYMENT_RESULT_AS_ARRAY = exports.USE_ORDER_PAYMENT_DUE_ON_PLACED = exports.USE_DELETE_EVENT_BY_ORDER = exports.USE_OBJECT_AS_PAY_TRANSACTION_AMOUNT = exports.USE_ADVANCE_BOOKING_REQUIREMENT = exports.USE_NEW_EVENT_AVAILABILITY_KEY_FROM = exports.USE_ASSET_TRANSACTION_SYNC_PROCESSING = exports.DEFAULT_TASKS_EXPORT_AGENT_NAME = exports.DEFAULT_SENDER_EMAIL = exports.TRANSACTION_CANCELED_STORAGE_PERIOD_IN_DAYS = exports.TRANSACTION_CONFIRMED_STORAGE_PERIOD_IN_DAYS = exports.ASSET_TRANSACTION_STORAGE_PERIOD_IN_DAYS = exports.ABORTED_TASKS_WITHOUT_REPORT = exports.TRIGGER_WEBHOOK_RETRY_INTERVAL_IN_MS = exports.TRIGGER_WEBHOOK_MAX_RETRY_COUNT = void 0;
3
+ exports.settings = exports.MONGO_MAX_TIME_MS = exports.USE_AGGREGATE_OFFERS_AS_PRIMARY = exports.USE_AUTHORIZE_PAYMENT_RESULT_AS_ARRAY = exports.USE_ORDER_PAYMENT_DUE_ON_PLACED = exports.USE_DELETE_EVENT_BY_ORDER = exports.USE_OBJECT_AS_PAY_TRANSACTION_AMOUNT = exports.USE_ADVANCE_BOOKING_REQUIREMENT = exports.USE_NEW_EVENT_AVAILABILITY_KEY_FROM = exports.USE_ASSET_TRANSACTION_SYNC_PROCESSING = exports.DEFAULT_TASKS_EXPORT_AGENT_NAME = exports.DEFAULT_SENDER_EMAIL = exports.TRANSACTION_CANCELED_STORAGE_PERIOD_IN_DAYS = exports.TRANSACTION_CONFIRMED_STORAGE_PERIOD_IN_DAYS = exports.ASSET_TRANSACTION_STORAGE_PERIOD_IN_DAYS = exports.ABORTED_TASKS_WITHOUT_REPORT = exports.TRIGGER_WEBHOOK_RETRY_INTERVAL_IN_MS = exports.TRIGGER_WEBHOOK_MAX_RETRY_COUNT = void 0;
4
4
  const moment = require("moment");
5
5
  const factory = require("./factory");
6
6
  const transactionWebhookUrls = (typeof process.env.INFORM_TRANSACTION_URL === 'string')
@@ -75,7 +75,6 @@ exports.USE_DELETE_EVENT_BY_ORDER = process.env.USE_DELETE_EVENT_BY_ORDER === '1
75
75
  exports.USE_ORDER_PAYMENT_DUE_ON_PLACED = process.env.USE_ORDER_PAYMENT_DUE_ON_PLACED === '1';
76
76
  exports.USE_AUTHORIZE_PAYMENT_RESULT_AS_ARRAY = process.env.USE_AUTHORIZE_PAYMENT_RESULT_AS_ARRAY === '1';
77
77
  exports.USE_AGGREGATE_OFFERS_AS_PRIMARY = process.env.USE_AGGREGATE_OFFERS_AS_PRIMARY === '1';
78
- exports.USE_AGGREGATE_OFFERS_AS_PRIMARY_ON_SEARCH_BY_CATALOG = process.env.USE_AGGREGATE_OFFERS_AS_PRIMARY_ON_SEARCH_BY_CATALOG === '1';
79
78
  exports.MONGO_MAX_TIME_MS = (typeof process.env.MONGO_MAX_TIME_MS === 'string')
80
79
  ? Number(process.env.MONGO_MAX_TIME_MS)
81
80
  // tslint:disable-next-line:no-magic-numbers
package/package.json CHANGED
@@ -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.8.0-alpha.43"
120
+ "version": "21.8.0-alpha.44"
121
121
  }