@chevre/domain 21.2.0-alpha.53 → 21.2.0-alpha.55

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.
@@ -21,11 +21,10 @@ async function main() {
21
21
  id: project.id,
22
22
  typeOf: chevre.factory.organizationType.Project
23
23
  },
24
- locationBranchCode: '120',
25
- importFrom: moment()
24
+ locationBranchCode: '018',
25
+ importFrom: moment('2023-05-17T02:45:00.214Z')
26
26
  .toDate(),
27
- importThrough: moment()
28
- .add(1, 'day')
27
+ importThrough: moment('2023-05-20T02:45:00.214Z')
29
28
  .toDate(),
30
29
  saveMovieTheater: false,
31
30
  saveScreeningEventSeries: false
@@ -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')
@@ -127,7 +127,7 @@ function importFromCOA(params) {
127
127
  })(repos);
128
128
  savedScreeningEventSeriesCount = savedEventsCount;
129
129
  try {
130
- // イベントごとに永続化トライ
130
+ // イベント永続化
131
131
  const screeningEvents = yield saveScreeningEvents({
132
132
  locationBranchCode: params.locationBranchCode,
133
133
  movieTheater: movieTheater,
@@ -154,6 +154,8 @@ function importFromCOA(params) {
154
154
  // "message": "ESOCKETTIMEDOUT",
155
155
  if (error.name === 'COAServiceError') {
156
156
  if (error.message === 'ESOCKETTIMEDOUT') {
157
+ // tslint:disable-next-line:no-console
158
+ console.error('saveScreeningEvents throwed an error', error.name, error.message);
157
159
  throwsError = false;
158
160
  }
159
161
  }
@@ -174,7 +174,13 @@ function createDeleteTasks(order) {
174
174
  numberOfTried: 0,
175
175
  executionResults: [],
176
176
  data: {
177
- object: order
177
+ object: {
178
+ confirmationNumber: order.confirmationNumber,
179
+ orderDate: order.orderDate,
180
+ orderNumber: order.orderNumber,
181
+ project: order.project,
182
+ typeOf: order.typeOf
183
+ }
178
184
  }
179
185
  }];
180
186
  }
@@ -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,7 +35,13 @@ function createTasks(params) {
35
35
  numberOfTried: 0,
36
36
  executionResults: [],
37
37
  data: {
38
- object: transaction
38
+ object: {
39
+ endDate: transaction.endDate,
40
+ id: transaction.id,
41
+ project: transaction.project,
42
+ startDate: transaction.startDate,
43
+ typeOf: transaction.typeOf
44
+ }
39
45
  }
40
46
  };
41
47
  taskAttributes.push(deleteTransactionTask);
@@ -75,7 +75,13 @@ function createTasks(params) {
75
75
  numberOfTried: 0,
76
76
  executionResults: [],
77
77
  data: {
78
- object: transaction
78
+ object: {
79
+ endDate: transaction.endDate,
80
+ id: transaction.id,
81
+ project: transaction.project,
82
+ startDate: transaction.startDate,
83
+ typeOf: transaction.typeOf
84
+ }
79
85
  }
80
86
  };
81
87
  // 確定取引にも決済承認中止タスクを追加(2023-05-03~)
@@ -36,7 +36,13 @@ function createTasks(params) {
36
36
  numberOfTried: 0,
37
37
  executionResults: [],
38
38
  data: {
39
- object: transaction
39
+ object: {
40
+ endDate: transaction.endDate,
41
+ id: transaction.id,
42
+ project: transaction.project,
43
+ startDate: transaction.startDate,
44
+ typeOf: transaction.typeOf
45
+ }
40
46
  }
41
47
  };
42
48
  taskAttributes.push(deleteTransactionTask);
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.53"
120
+ "version": "21.2.0-alpha.55"
121
121
  }