@chevre/domain 20.9.0 → 20.10.0

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.
@@ -15,6 +15,7 @@ declare function validateAcceptedOffers(params: {
15
15
  id: string;
16
16
  };
17
17
  availablePaymentMethodTypes: factory.categoryCode.ICategoryCode[];
18
+ screeningEvent: Pick<factory.event.screeningEvent.IEvent, 'id' | 'superEvent'>;
18
19
  }): (repos: {
19
20
  offer: OfferRepo;
20
21
  }) => Promise<{
@@ -50,7 +50,7 @@ function createAppliesToMovieTicket(params) {
50
50
  }
51
51
  // tslint:disable-next-line:cyclomatic-complexity max-func-body-length
52
52
  function createPriceComponent(params) {
53
- var _a, _b, _c, _d, _e, _f, _g;
53
+ var _a, _b, _c, _d, _e, _f, _g, _h;
54
54
  const acceptedOffer = params.acceptedOffer;
55
55
  const availableUnitPriceOffer = params.availableUnitPriceOffer;
56
56
  const { name, ticketInfo } = acceptedOffer;
@@ -130,15 +130,26 @@ function createPriceComponent(params) {
130
130
  // movieTicketTypeChargePriceSpecにaddPriceが含まれる場合は除く
131
131
  if (movieTicketTypeChargePriceSpec === undefined) {
132
132
  if (ticketInfo.addPrice > 0) {
133
+ const kbnJoueihousiki = (_h = params.screeningEvent.superEvent.coaInfo) === null || _h === void 0 ? void 0 : _h.kbnJoueihousiki;
133
134
  categoryCodeChargeSpecs.push({
134
135
  name: {
135
- en: factory.priceSpecificationType.CategoryCodeChargeSpecification,
136
- ja: '加算単価'
136
+ en: (typeof (kbnJoueihousiki === null || kbnJoueihousiki === void 0 ? void 0 : kbnJoueihousiki.kubunNameEng) === 'string')
137
+ ? kbnJoueihousiki.kubunNameEng
138
+ : factory.priceSpecificationType.CategoryCodeChargeSpecification,
139
+ ja: (typeof (kbnJoueihousiki === null || kbnJoueihousiki === void 0 ? void 0 : kbnJoueihousiki.kubunName) === 'string') ? kbnJoueihousiki.kubunName : '加算単価'
137
140
  },
138
141
  price: ticketInfo.addPrice,
139
142
  priceCurrency: factory.priceCurrency.JPY,
140
143
  typeOf: factory.priceSpecificationType.CategoryCodeChargeSpecification,
141
- appliesToCategoryCode: [],
144
+ appliesToCategoryCode: [{
145
+ project: { id: params.project.id, typeOf: factory.organizationType.Project },
146
+ typeOf: 'CategoryCode',
147
+ codeValue: String(kbnJoueihousiki === null || kbnJoueihousiki === void 0 ? void 0 : kbnJoueihousiki.kubunCode),
148
+ inCodeSet: {
149
+ typeOf: 'CategoryCodeSet',
150
+ identifier: factory.categoryCode.CategorySetIdentifier.VideoFormatType
151
+ }
152
+ }],
142
153
  valueAddedTaxIncluded: true
143
154
  });
144
155
  }
@@ -152,7 +163,15 @@ function createPriceComponent(params) {
152
163
  price: ticketInfo.spseatAdd1,
153
164
  priceCurrency: factory.priceCurrency.JPY,
154
165
  typeOf: factory.priceSpecificationType.CategoryCodeChargeSpecification,
155
- appliesToCategoryCode: [],
166
+ appliesToCategoryCode: [{
167
+ project: { id: params.project.id, typeOf: factory.organizationType.Project },
168
+ typeOf: 'CategoryCode',
169
+ codeValue: ticketInfo.spseatKbn,
170
+ inCodeSet: {
171
+ typeOf: 'CategoryCodeSet',
172
+ identifier: factory.categoryCode.CategorySetIdentifier.SeatingType
173
+ }
174
+ }],
156
175
  valueAddedTaxIncluded: true
157
176
  });
158
177
  }
@@ -245,9 +264,11 @@ function validateAcceptedOffers(params) {
245
264
  }
246
265
  // priceComponentを再生成(2023-03-14~)
247
266
  const { priceComponent, eligibleMonetaryAmount } = createPriceComponent({
267
+ project: { id: params.project.id },
248
268
  availablePaymentMethodTypes: params.availablePaymentMethodTypes,
249
269
  acceptedOffer,
250
- availableUnitPriceOffer
270
+ availableUnitPriceOffer,
271
+ screeningEvent: params.screeningEvent
251
272
  });
252
273
  priceSpecification.priceComponent = priceComponent;
253
274
  return Object.assign(Object.assign({ additionalProperty,
@@ -42,7 +42,8 @@ function authorize(params) {
42
42
  const { acceptedOffers } = yield (0, validateAcceptedOffers_1.validateAcceptedOffers)({
43
43
  object: params.object,
44
44
  project: { id: transaction.project.id },
45
- availablePaymentMethodTypes
45
+ availablePaymentMethodTypes,
46
+ screeningEvent
46
47
  })(repos);
47
48
  const updTmpReserveSeatArgs = params.result.requestBody;
48
49
  const updTmpReserveSeatResult = params.result.responseBody;
@@ -162,7 +163,8 @@ function changeOffers(params) {
162
163
  const { acceptedOffers } = yield (0, validateAcceptedOffers_1.validateAcceptedOffers)({
163
164
  object: params.object,
164
165
  project: { id: transaction.project.id },
165
- availablePaymentMethodTypes
166
+ availablePaymentMethodTypes,
167
+ screeningEvent
166
168
  })(repos);
167
169
  // 供給情報と価格を変更してからDB更新
168
170
  authorizeAction.object.acceptedOffer = acceptedOffers;
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.9.0"
123
+ "version": "20.10.0"
124
124
  }