@chevre/domain 21.6.0-alpha.5 → 21.6.0-alpha.6

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.
@@ -7,7 +7,7 @@ exports.createStartParams = void 0;
7
7
  const factory = require("../../../factory");
8
8
  // tslint:disable-next-line:cyclomatic-complexity max-func-body-length
9
9
  function createStartParams(params) {
10
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y;
10
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x;
11
11
  const paymentServiceId = (params.paymentService !== undefined)
12
12
  ? String(params.paymentService.id)
13
13
  : '';
@@ -36,15 +36,14 @@ function createStartParams(params) {
36
36
  };
37
37
  break;
38
38
  case factory.service.paymentService.PaymentServiceType.MovieTicket:
39
+ const specifiedMovieTickets = (_c = params.object.paymentMethod) === null || _c === void 0 ? void 0 : _c.movieTickets;
39
40
  totalPaymentDue = {
40
41
  typeOf: 'MonetaryAmount',
41
42
  currency: factory.unitCode.C62,
42
- value: (Array.isArray((_c = params.object.paymentMethod) === null || _c === void 0 ? void 0 : _c.movieTickets))
43
- ? (_d = params.object.paymentMethod) === null || _d === void 0 ? void 0 : _d.movieTickets.length
44
- : 0
43
+ value: (Array.isArray(specifiedMovieTickets)) ? specifiedMovieTickets.length : 0
45
44
  };
46
45
  // MovieTicketIFの決済取引において最大同時着券数を設定可能にする(2023-03-27~)
47
- const totalPaymentDueMaxValue = (_g = (_f = (_e = params.paymentService) === null || _e === void 0 ? void 0 : _e.availableChannel) === null || _f === void 0 ? void 0 : _f.totalPaymentDue) === null || _g === void 0 ? void 0 : _g.maxValue;
46
+ const totalPaymentDueMaxValue = (_f = (_e = (_d = params.paymentService) === null || _d === void 0 ? void 0 : _d.availableChannel) === null || _e === void 0 ? void 0 : _e.totalPaymentDue) === null || _f === void 0 ? void 0 : _f.maxValue;
48
47
  const totalPaymentDueValue = totalPaymentDue.value;
49
48
  if (typeof totalPaymentDueValue === 'number' && typeof totalPaymentDueMaxValue === 'number') {
50
49
  if (totalPaymentDueValue > totalPaymentDueMaxValue) {
@@ -56,34 +55,29 @@ function createStartParams(params) {
56
55
  // no op
57
56
  }
58
57
  const informPaymentParams = createInformPaymentParams({ paymentService: params.paymentService });
59
- const accountId = (_h = params.object.paymentMethod) === null || _h === void 0 ? void 0 : _h.accountId;
60
- const creditCardAsPaymentServiceOutputCurrency = (_l = (_k = (_j = params.paymentService) === null || _j === void 0 ? void 0 : _j.serviceOutput) === null || _k === void 0 ? void 0 : _k.amount) === null || _l === void 0 ? void 0 : _l.currency;
61
- const object = {
58
+ const accountId = (_g = params.object.paymentMethod) === null || _g === void 0 ? void 0 : _g.accountId;
59
+ const creditCardAsPaymentServiceOutputCurrency = (_k = (_j = (_h = params.paymentService) === null || _h === void 0 ? void 0 : _h.serviceOutput) === null || _j === void 0 ? void 0 : _j.amount) === null || _k === void 0 ? void 0 : _k.currency;
60
+ const paymentMethod = Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({ additionalProperty: (Array.isArray((_l = params.object.paymentMethod) === null || _l === void 0 ? void 0 : _l.additionalProperty))
61
+ ? (_m = params.object.paymentMethod) === null || _m === void 0 ? void 0 : _m.additionalProperty
62
+ : [], name: (typeof ((_o = params.object.paymentMethod) === null || _o === void 0 ? void 0 : _o.name) === 'string')
63
+ ? params.object.paymentMethod.name
64
+ : paymentMethodType, amount: params.amount, paymentMethodId: params.transactionNumber, typeOf: paymentMethodType }, (typeof ((_p = params.object.paymentMethod) === null || _p === void 0 ? void 0 : _p.description) === 'string')
65
+ ? { description: (_q = params.object.paymentMethod) === null || _q === void 0 ? void 0 : _q.description }
66
+ : undefined), (totalPaymentDue !== undefined)
67
+ ? { totalPaymentDue: totalPaymentDue }
68
+ : undefined), (typeof accountId === 'string') ? { accountId: accountId } : undefined), (typeof ((_r = params.object.paymentMethod) === null || _r === void 0 ? void 0 : _r.method) === 'string')
69
+ ? { method: (_s = params.object.paymentMethod) === null || _s === void 0 ? void 0 : _s.method }
70
+ : undefined), (((_t = params.object.paymentMethod) === null || _t === void 0 ? void 0 : _t.creditCard) !== undefined)
71
+ ? { creditCard: (_u = params.object.paymentMethod) === null || _u === void 0 ? void 0 : _u.creditCard }
72
+ : undefined), (Array.isArray((_v = params.object.paymentMethod) === null || _v === void 0 ? void 0 : _v.movieTickets))
73
+ ? { movieTickets: (_w = params.object.paymentMethod) === null || _w === void 0 ? void 0 : _w.movieTickets }
74
+ : undefined);
75
+ const object = Object.assign({
62
76
  // パラメータから必要なもののみ取り込む
63
- accountId: (typeof accountId === 'string') ? accountId : '',
64
- paymentMethodId: params.transactionNumber,
65
- typeOf: params.paymentServiceType,
66
- id: paymentServiceId,
67
- onPaymentStatusChanged: { informPayment: informPaymentParams },
68
- paymentMethod: Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({ additionalProperty: (Array.isArray((_m = params.object.paymentMethod) === null || _m === void 0 ? void 0 : _m.additionalProperty))
69
- ? (_o = params.object.paymentMethod) === null || _o === void 0 ? void 0 : _o.additionalProperty
70
- : [], name: (typeof ((_p = params.object.paymentMethod) === null || _p === void 0 ? void 0 : _p.name) === 'string')
71
- ? params.object.paymentMethod.name
72
- : paymentMethodType, amount: params.amount, paymentMethodId: params.transactionNumber, typeOf: paymentMethodType }, (typeof ((_q = params.object.paymentMethod) === null || _q === void 0 ? void 0 : _q.description) === 'string')
73
- ? { description: (_r = params.object.paymentMethod) === null || _r === void 0 ? void 0 : _r.description }
74
- : undefined), (totalPaymentDue !== undefined)
75
- ? { totalPaymentDue: totalPaymentDue }
76
- : undefined), (typeof accountId === 'string') ? { accountId: accountId } : undefined), (typeof ((_s = params.object.paymentMethod) === null || _s === void 0 ? void 0 : _s.method) === 'string')
77
- ? { method: (_t = params.object.paymentMethod) === null || _t === void 0 ? void 0 : _t.method }
78
- : undefined), (((_u = params.object.paymentMethod) === null || _u === void 0 ? void 0 : _u.creditCard) !== undefined)
79
- ? { creditCard: (_v = params.object.paymentMethod) === null || _v === void 0 ? void 0 : _v.creditCard }
80
- : undefined), (Array.isArray((_w = params.object.paymentMethod) === null || _w === void 0 ? void 0 : _w.movieTickets))
81
- ? { movieTickets: (_x = params.object.paymentMethod) === null || _x === void 0 ? void 0 : _x.movieTickets }
82
- : undefined), (typeof creditCardAsPaymentServiceOutputCurrency === 'string')
83
- ? { serviceOutput: { amount: { currency: creditCardAsPaymentServiceOutputCurrency } } }
84
- : undefined)
85
- };
86
- return Object.assign({ project: { typeOf: factory.organizationType.Project, id: params.project.id }, transactionNumber: params.transactionNumber, typeOf: factory.assetTransactionType.Pay, agent: params.agent, recipient: params.recipient, object, expires: params.expires }, (typeof ((_y = params.location) === null || _y === void 0 ? void 0 : _y.typeOf) === 'string')
77
+ accountId: (typeof accountId === 'string') ? accountId : '', paymentMethodId: params.transactionNumber, typeOf: params.paymentServiceType, id: paymentServiceId, onPaymentStatusChanged: { informPayment: informPaymentParams }, paymentMethod }, (typeof creditCardAsPaymentServiceOutputCurrency === 'string')
78
+ ? { serviceOutput: { amount: { currency: creditCardAsPaymentServiceOutputCurrency } } }
79
+ : undefined);
80
+ return Object.assign({ project: { typeOf: factory.organizationType.Project, id: params.project.id }, transactionNumber: params.transactionNumber, typeOf: factory.assetTransactionType.Pay, agent: params.agent, recipient: params.recipient, object, expires: params.expires }, (typeof ((_x = params.location) === null || _x === void 0 ? void 0 : _x.typeOf) === 'string')
87
81
  ? { location: params.location }
88
82
  : undefined);
89
83
  }
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.6.0-alpha.5"
120
+ "version": "21.6.0-alpha.6"
121
121
  }