@chevre/domain 20.9.0-alpha.1 → 20.9.0-alpha.2

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.
@@ -29,7 +29,7 @@ function createAppliesToMovieTicket(params) {
29
29
  movieTicketTypeChargePriceSpec = {
30
30
  typeOf: factory.priceSpecificationType.MovieTicketTypeChargeSpecification,
31
31
  name: { ja: params.ticketInfo.ticketName, en: params.ticketInfo.ticketNameEng },
32
- price: Number(params.ticketInfo.addPrice),
32
+ price: params.ticketInfo.addPrice,
33
33
  priceCurrency: factory.priceCurrency.JPY,
34
34
  valueAddedTaxIncluded: true,
35
35
  appliesToMovieTicket: {
@@ -98,7 +98,7 @@ function createPriceComponent(params) {
98
98
  eligibleMonetaryAmount = availableUnitPriceOffer.eligibleMonetaryAmount;
99
99
  }
100
100
  }
101
- const accountsReceivable = (ticketInfo.mvtkSalesPrice > 0) ? ticketInfo.mvtkSalesPrice : ticketInfo.stdPrice;
101
+ const accountsReceivable = (ticketInfo.mvtkAppPrice > 0) ? ticketInfo.mvtkAppPrice : ticketInfo.stdPrice;
102
102
  const unitPriceSpec = Object.assign({ typeOf: factory.priceSpecificationType.UnitPriceSpecification, name: { ja: ticketInfo.ticketName, en: ticketInfo.ticketNameEng }, price: Number(ticketInfo.stdPrice), priceCurrency: factory.priceCurrency.JPY, referenceQuantity: {
103
103
  typeOf: 'QuantitativeValue',
104
104
  unitCode: factory.unitCode.C62,
@@ -127,24 +127,27 @@ function createPriceComponent(params) {
127
127
  }
128
128
  // 区分加算料金
129
129
  const categoryCodeChargeSpecs = [];
130
- if (ticketInfo.addPrice > 0) {
131
- categoryCodeChargeSpecs.push({
132
- name: {
133
- en: factory.priceSpecificationType.CategoryCodeChargeSpecification,
134
- ja: '加算単価'
135
- },
136
- price: ticketInfo.addPrice,
137
- priceCurrency: factory.priceCurrency.JPY,
138
- typeOf: factory.priceSpecificationType.CategoryCodeChargeSpecification,
139
- appliesToCategoryCode: [],
140
- valueAddedTaxIncluded: true
141
- });
130
+ // movieTicketTypeChargePriceSpecにaddPriceが含まれる場合は除く
131
+ if (movieTicketTypeChargePriceSpec === undefined) {
132
+ if (ticketInfo.addPrice > 0) {
133
+ categoryCodeChargeSpecs.push({
134
+ name: {
135
+ en: factory.priceSpecificationType.CategoryCodeChargeSpecification,
136
+ ja: '加算単価'
137
+ },
138
+ price: ticketInfo.addPrice,
139
+ priceCurrency: factory.priceCurrency.JPY,
140
+ typeOf: factory.priceSpecificationType.CategoryCodeChargeSpecification,
141
+ appliesToCategoryCode: [],
142
+ valueAddedTaxIncluded: true
143
+ });
144
+ }
142
145
  }
143
146
  if (ticketInfo.spseatAdd1 > 0) {
144
147
  categoryCodeChargeSpecs.push({
145
148
  name: {
146
149
  en: factory.priceSpecificationType.CategoryCodeChargeSpecification,
147
- ja: '特別席加算額1'
150
+ ja: '特別席加算額'
148
151
  },
149
152
  price: ticketInfo.spseatAdd1,
150
153
  priceCurrency: factory.priceCurrency.JPY,
@@ -153,23 +156,35 @@ function createPriceComponent(params) {
153
156
  valueAddedTaxIncluded: true
154
157
  });
155
158
  }
159
+ // アドオン単価
160
+ const addOnUnitPriceSpecs = [];
156
161
  if (ticketInfo.spseatAdd2 > 0) {
157
- categoryCodeChargeSpecs.push({
158
- name: {
159
- en: factory.priceSpecificationType.CategoryCodeChargeSpecification,
160
- ja: '特別席加算額2'
161
- },
162
+ addOnUnitPriceSpecs.push({
163
+ typeOf: factory.priceSpecificationType.UnitPriceSpecification,
164
+ name: { ja: 'ミールクーポン', en: 'Meal Coupon' },
162
165
  price: ticketInfo.spseatAdd2,
163
166
  priceCurrency: factory.priceCurrency.JPY,
164
- typeOf: factory.priceSpecificationType.CategoryCodeChargeSpecification,
165
- appliesToCategoryCode: [],
166
- valueAddedTaxIncluded: true
167
+ referenceQuantity: {
168
+ typeOf: 'QuantitativeValue',
169
+ unitCode: factory.unitCode.C62,
170
+ value: 1
171
+ },
172
+ valueAddedTaxIncluded: true,
173
+ appliesToAddOn: [{
174
+ typeOf: factory.offerType.Offer,
175
+ // id?: string;
176
+ // identifier?: string;
177
+ itemOffered: {
178
+ // id: '',
179
+ name: { ja: 'ミールクーポン', en: 'Meal Coupon' },
180
+ productID: '',
181
+ typeOf: factory.product.ProductType.Product
182
+ }
183
+ }]
167
184
  });
168
185
  }
169
- // アドオン単価仕様
170
- let addOnUnitPriceSpec;
171
186
  if (ticketInfo.addGlasses > 0) {
172
- addOnUnitPriceSpec = {
187
+ addOnUnitPriceSpecs.push({
173
188
  typeOf: factory.priceSpecificationType.UnitPriceSpecification,
174
189
  name: { ja: 'メガネ', en: 'Glasses' },
175
190
  price: Number(ticketInfo.addGlasses),
@@ -186,19 +201,19 @@ function createPriceComponent(params) {
186
201
  // identifier?: string;
187
202
  itemOffered: {
188
203
  // id: '',
189
- // name :'',
204
+ name: { ja: 'メガネ', en: 'Glasses' },
190
205
  productID: '',
191
206
  typeOf: factory.product.ProductType.Product
192
207
  }
193
208
  }]
194
- };
209
+ });
195
210
  }
196
211
  const priceComponent = [
197
212
  unitPriceSpec,
198
213
  ...(movieTicketTypeChargePriceSpec !== undefined) ? [movieTicketTypeChargePriceSpec] : [],
199
214
  ...(surfrockChargePriceSpec !== undefined) ? [surfrockChargePriceSpec] : [],
200
215
  ...categoryCodeChargeSpecs,
201
- ...(addOnUnitPriceSpec !== undefined) ? [addOnUnitPriceSpec] : []
216
+ ...addOnUnitPriceSpecs
202
217
  ];
203
218
  return { priceComponent, eligibleMonetaryAmount };
204
219
  }
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-alpha.1"
123
+ "version": "20.9.0-alpha.2"
124
124
  }