@chevre/domain 20.7.0-alpha.8 → 20.7.0-alpha.9

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.
@@ -11,7 +11,6 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
11
11
  Object.defineProperty(exports, "__esModule", { value: true });
12
12
  exports.validateAcceptedOffers = void 0;
13
13
  const factory = require("../../../factory");
14
- const MENBERSHIP_COUPON_PAYMENT_METHOD_TYPE = 'MembershipCoupon'; // ひとまず固定
15
14
  function createAppliesToMovieTicket(params) {
16
15
  const isMvtkOrMG = typeof params.ticketInfo.mvtkNum === 'string' && params.ticketInfo.mvtkNum.length > 0;
17
16
  let movieTicketTypeChargePriceSpec;
@@ -69,7 +68,7 @@ function validateAcceptedOffers(params) {
69
68
  }
70
69
  // tslint:disable-next-line:max-func-body-length
71
70
  const acceptedOffers = params.object.acceptedOffer.map((acceptedOffer) => {
72
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
71
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o;
73
72
  const availableUnitPriceOffer = availableUnitPriceOffers.find((unitPriceOffer) => unitPriceOffer.id === acceptedOffer.id);
74
73
  if (availableUnitPriceOffer === undefined) {
75
74
  throw new factory.errors.NotFound(factory.offerType.Offer, `${acceptedOffer.identifier} not found`);
@@ -93,16 +92,18 @@ function validateAcceptedOffers(params) {
93
92
  // appliesToSurfrockの指定があれば強制的にMovieTicket決済
94
93
  let eligibleMonetaryAmount;
95
94
  const surfrockIdentifier = (_b = (_a = acceptedOffer.priceSpecification) === null || _a === void 0 ? void 0 : _a.appliesToSurfrock) === null || _b === void 0 ? void 0 : _b.identifier;
96
- if (typeof surfrockIdentifier === 'string') {
95
+ const surfrockPaymentMethodType = (_e = (_d = (_c = acceptedOffer.priceSpecification) === null || _c === void 0 ? void 0 : _c.appliesToSurfrock) === null || _d === void 0 ? void 0 : _d.serviceOutput) === null || _e === void 0 ? void 0 : _e.typeOf;
96
+ if (typeof surfrockIdentifier === 'string' && surfrockIdentifier.length > 0
97
+ && typeof surfrockPaymentMethodType === 'string' && surfrockPaymentMethodType.length > 0) {
97
98
  // serviceTypeはticketCode
98
- const serviceType = (_d = (_c = availableUnitPriceOffer.additionalProperty) === null || _c === void 0 ? void 0 : _c.find((p) => p.name === 'ticketCode')) === null || _d === void 0 ? void 0 : _d.value;
99
+ const serviceType = (_g = (_f = availableUnitPriceOffer.additionalProperty) === null || _f === void 0 ? void 0 : _f.find((p) => p.name === 'ticketCode')) === null || _g === void 0 ? void 0 : _g.value;
99
100
  if (typeof serviceType !== 'string') {
100
101
  throw new factory.errors.NotFound('ticketCode of unitPriceOffer');
101
102
  }
102
103
  surfrockChargePriceSpec = {
103
104
  appliesToMovieTicket: {
104
105
  typeOf: factory.service.paymentService.PaymentServiceType.MovieTicket,
105
- serviceOutput: { typeOf: MENBERSHIP_COUPON_PAYMENT_METHOD_TYPE },
106
+ serviceOutput: { typeOf: surfrockPaymentMethodType },
106
107
  serviceType
107
108
  },
108
109
  appliesToVideoFormat: 'Default',
@@ -115,7 +116,7 @@ function validateAcceptedOffers(params) {
115
116
  appliesToMovieTicket4surfrock = {
116
117
  typeOf: factory.service.paymentService.PaymentServiceType.MovieTicket,
117
118
  identifier: surfrockIdentifier,
118
- serviceOutput: { typeOf: MENBERSHIP_COUPON_PAYMENT_METHOD_TYPE },
119
+ serviceOutput: { typeOf: surfrockPaymentMethodType },
119
120
  serviceType
120
121
  };
121
122
  }
@@ -150,10 +151,10 @@ function validateAcceptedOffers(params) {
150
151
  priceCurrency: availableUnitPriceOffer.priceCurrency, id: String(availableUnitPriceOffer.id), identifier: String(availableUnitPriceOffer.identifier), typeOf: availableUnitPriceOffer.typeOf }, (Array.isArray(eligibleMonetaryAmount)) ? { eligibleMonetaryAmount } : undefined), {
151
152
  // tslint:disable-next-line:no-suspicious-comment
152
153
  // TODO itemOfferedに完全置き換え
153
- seatNumber: (_g = (_f = (_e = itemOffered.serviceOutput) === null || _e === void 0 ? void 0 : _e.reservedTicket) === null || _f === void 0 ? void 0 : _f.ticketedSeat) === null || _g === void 0 ? void 0 : _g.seatNumber,
154
+ seatNumber: (_k = (_j = (_h = itemOffered.serviceOutput) === null || _h === void 0 ? void 0 : _h.reservedTicket) === null || _j === void 0 ? void 0 : _j.ticketedSeat) === null || _k === void 0 ? void 0 : _k.seatNumber,
154
155
  // tslint:disable-next-line:no-suspicious-comment
155
156
  // TODO itemOfferedに完全置き換え
156
- seatSection: (_k = (_j = (_h = itemOffered.serviceOutput) === null || _h === void 0 ? void 0 : _h.reservedTicket) === null || _j === void 0 ? void 0 : _j.ticketedSeat) === null || _k === void 0 ? void 0 : _k.seatSection
157
+ seatSection: (_o = (_m = (_l = itemOffered.serviceOutput) === null || _l === void 0 ? void 0 : _l.reservedTicket) === null || _m === void 0 ? void 0 : _m.ticketedSeat) === null || _o === void 0 ? void 0 : _o.seatSection
157
158
  });
158
159
  });
159
160
  return { acceptedOffers };
package/package.json CHANGED
@@ -9,8 +9,8 @@
9
9
  }
10
10
  ],
11
11
  "dependencies": {
12
- "@chevre/factory": "4.301.0-alpha.1",
13
- "@cinerino/sdk": "3.149.0-alpha.2",
12
+ "@chevre/factory": "4.301.0-alpha.2",
13
+ "@cinerino/sdk": "3.149.0-alpha.4",
14
14
  "@motionpicture/coa-service": "9.2.0",
15
15
  "@motionpicture/gmo-service": "5.2.0",
16
16
  "@sendgrid/mail": "6.4.0",
@@ -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.7.0-alpha.8"
123
+ "version": "20.7.0-alpha.9"
124
124
  }