@chevre/domain 21.2.0-alpha.54 → 21.2.0-alpha.56

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.
@@ -126,8 +126,9 @@ function createPayObjectServiceOutput(params) {
126
126
  if (Array.isArray(movieTickets)) {
127
127
  paymentServiceOutput = movieTickets.map((movieTicket) => {
128
128
  var _a;
129
+ const amount = movieTicket2amount(transaction, movieTicket);
129
130
  const reservation4invoice = movieTicket2reservation4invoice(movieTicket, order, String(paymentMethodType));
130
- return Object.assign({ identifier: movieTicket.identifier }, (typeof ((_a = reservation4invoice.priceSpecification) === null || _a === void 0 ? void 0 : _a.typeOf) === 'string')
131
+ return Object.assign(Object.assign({ identifier: movieTicket.identifier }, (typeof (amount === null || amount === void 0 ? void 0 : amount.value) === 'number') ? { amount } : undefined), (typeof ((_a = reservation4invoice.priceSpecification) === null || _a === void 0 ? void 0 : _a.typeOf) === 'string')
131
132
  ? {
132
133
  serviceOutput: reservation4invoice
133
134
  }
@@ -140,6 +141,21 @@ function createPayObjectServiceOutput(params) {
140
141
  }
141
142
  return paymentServiceOutput;
142
143
  }
144
+ function movieTicket2amount(transaction, movieTicket) {
145
+ var _a;
146
+ let amount;
147
+ const accountsReceivables = transaction.object.accountsReceivablesByServiceType;
148
+ if (Array.isArray(accountsReceivables)) {
149
+ const accountsReceivable = (_a = accountsReceivables.find((a) => a.serviceType === movieTicket.serviceType)) === null || _a === void 0 ? void 0 : _a.accountsReceivable;
150
+ if (typeof accountsReceivable === 'number') {
151
+ amount = {
152
+ typeOf: 'MonetaryAmount',
153
+ value: accountsReceivable
154
+ };
155
+ }
156
+ }
157
+ return amount;
158
+ }
143
159
  function reservationPriceComponent2invoicePriceComponent(component) {
144
160
  var _a;
145
161
  const accounting = (typeof ((_a = component.accounting) === null || _a === void 0 ? void 0 : _a.accountsReceivable) === 'number')
@@ -12,8 +12,5 @@ export declare function validateMovieTicket(params: factory.assetTransaction.pay
12
12
  project: ProjectRepo;
13
13
  seller: SellerRepo;
14
14
  }) => Promise<{
15
- accountsReceivablesByServiceType: {
16
- serviceType: string;
17
- accountsReceivable?: number;
18
- }[];
15
+ accountsReceivablesByServiceType: factory.assetTransaction.pay.IAccountsReceivableByServiceType[];
19
16
  }>;
@@ -42,10 +42,7 @@ declare function checkMovieTicket(params: factory.action.check.paymentMethod.mov
42
42
  }>;
43
43
  interface IAuthorizeResult {
44
44
  accountId: string;
45
- accountsReceivablesByServiceType: {
46
- serviceType: string;
47
- accountsReceivable?: number;
48
- }[];
45
+ accountsReceivablesByServiceType: factory.assetTransaction.pay.IAccountsReceivableByServiceType[];
49
46
  payAction: factory.action.trade.pay.IAction;
50
47
  }
51
48
  /**
@@ -35,6 +35,10 @@ function call(data) {
35
35
  offer: offerRepo,
36
36
  masterService
37
37
  });
38
+ yield OfferService.event.importCategoryCodesFromCOA(data)({
39
+ categoryCode: categoryCodeRepo,
40
+ masterService
41
+ });
38
42
  });
39
43
  }
40
44
  exports.call = call;
package/package.json CHANGED
@@ -9,7 +9,7 @@
9
9
  }
10
10
  ],
11
11
  "dependencies": {
12
- "@chevre/factory": "4.313.0-alpha.1",
12
+ "@chevre/factory": "4.313.0-alpha.2",
13
13
  "@cinerino/sdk": "3.156.0",
14
14
  "@motionpicture/coa-service": "9.2.0",
15
15
  "@motionpicture/gmo-service": "5.2.0",
@@ -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.2.0-alpha.54"
120
+ "version": "21.2.0-alpha.56"
121
121
  }