@chevre/domain 23.2.0-alpha.24 → 23.2.0-alpha.26

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.
@@ -50,6 +50,11 @@ export declare function searchEventSeatOffersWithPaging(params: {
50
50
  };
51
51
  $projection?: factory.place.seat.IProjection;
52
52
  options: {
53
+ /**
54
+ * レスポンスにセクションコードを含める要素をひとつめのみにするかどうか
55
+ * 2026-01-14~
56
+ */
57
+ includeSectionCodeOnlyFirstElement: boolean;
53
58
  /**
54
59
  * 自動的にひとつめのセクションに絞るかどうか
55
60
  */
@@ -58,9 +58,10 @@ function addOffers2Seat(params) {
58
58
  * イベントに対する座席オファーを検索する
59
59
  */
60
60
  function searchEventSeatOffersWithPaging(params) {
61
+ // tslint:disable-next-line:max-func-body-length
61
62
  return (repos) => __awaiter(this, void 0, void 0, function* () {
62
63
  var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
63
- const { useDefaultSection } = params.options;
64
+ const { includeSectionCodeOnlyFirstElement, useDefaultSection } = params.options;
64
65
  let offers = [];
65
66
  // optimize(2024-07-18~)
66
67
  const event = yield repos.event.projectEventFieldsById({ id: params.event.id }, ['project', 'startDate', 'offers.itemOffered', 'organizer']);
@@ -115,14 +116,38 @@ function searchEventSeatOffersWithPaging(params) {
115
116
  };
116
117
  })
117
118
  });
118
- offers = seats.map((seat, index) => {
119
- return addOffers2Seat({
120
- seat,
121
- availability: (typeof availabilities[index] === 'string')
122
- ? factory.itemAvailability.OutOfStock // ホルダーが存在すればOutOfStock
123
- : factory.itemAvailability.InStock,
124
- priceSpecs: [] // priceSpecsをレスポンスから廃止(2024-12-22~)
125
- });
119
+ offers = seats.map(({ branchCode, name, containedInPlace, seatingType }, index) => {
120
+ let includeSectionCode = false;
121
+ if (includeSectionCodeOnlyFirstElement) {
122
+ if (useDefaultSection) {
123
+ // デフォルトセクション指定の場合、first elementのみセクションコードを含める
124
+ if (index === 0) {
125
+ includeSectionCode = true;
126
+ }
127
+ }
128
+ else {
129
+ includeSectionCode = true;
130
+ }
131
+ }
132
+ else {
133
+ includeSectionCode = true;
134
+ }
135
+ return Object.assign({ branchCode,
136
+ name,
137
+ seatingType,
138
+ // ...seat,
139
+ offers: [{
140
+ availability: (typeof availabilities[index] === 'string')
141
+ ? factory.itemAvailability.OutOfStock // ホルダーが存在すればOutOfStock
142
+ : factory.itemAvailability.InStock
143
+ }] }, (includeSectionCode) ? { containedInPlace } : undefined);
144
+ // return addOffers2Seat({
145
+ // seat,
146
+ // availability: (typeof availabilities[index] === 'string')
147
+ // ? factory.itemAvailability.OutOfStock // ホルダーが存在すればOutOfStock
148
+ // : factory.itemAvailability.InStock,
149
+ // priceSpecs: [] // priceSpecsをレスポンスから廃止(2024-12-22~)
150
+ // });
126
151
  });
127
152
  }
128
153
  }
package/package.json CHANGED
@@ -116,5 +116,5 @@
116
116
  "postversion": "git push origin --tags",
117
117
  "prepublishOnly": "npm run clean && npm run build && npm test && npm run doc"
118
118
  },
119
- "version": "23.2.0-alpha.24"
119
+ "version": "23.2.0-alpha.26"
120
120
  }