@chevre/domain 21.20.0-alpha.9 → 21.20.1
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.
- package/example/src/chevre/findTransactionById.ts +21 -0
- package/example/src/chevre/importCategoryCodesFromCOA.ts +2 -1
- package/example/src/chevre/importOffersFromCOA.ts +2 -1
- package/example/src/chevre/migrateActionInstrumentTransactionNumber.ts +93 -0
- package/example/src/chevre/migrateDeleteTransactionTasks.ts +119 -0
- package/example/src/chevre/migrateEventMakesOfferAvailableAtOrFrom.ts +87 -0
- package/example/src/chevre/migrateIAMMemberPOSRoles.ts +3 -2
- package/example/src/chevre/migrateOfferAvailableAtOrFrom.ts +63 -0
- package/example/src/chevre/{migrateOrderPaymentMethodIdentifier.ts → migrateOrderAcceptedOfferSerialNumber.ts} +18 -19
- package/example/src/chevre/onAssetTransactionStatusChanged.ts +36 -0
- package/example/src/chevre/retryTasks.ts +39 -0
- package/example/src/chevre/searchActions.ts +13 -7
- package/example/src/chevre/searchOrderAcceptedOffers.ts +13 -3
- package/example/src/chevre/searchOrders.ts +13 -15
- package/example/src/chevre/searchSlicedAcceptedOffersByOrderNumber.ts +28 -0
- package/example/src/chevre/sendOrder.ts +37 -0
- package/example/src/chevre/transaction/processPlaceOrder.ts +2 -3
- package/example/src/verifyToken.ts +44 -0
- package/lib/chevre/credentials.d.ts +2 -0
- package/lib/chevre/credentials.js +4 -2
- package/lib/chevre/errorHandler.js +3 -0
- package/lib/chevre/factory/order.d.ts +1 -0
- package/lib/chevre/factory/order.js +2 -1
- package/lib/chevre/factory/reservedAgentIdentifireNames.js +2 -1
- package/lib/chevre/factory/transaction.d.ts +10 -1
- package/lib/chevre/repo/acceptedOffer.d.ts +58 -2
- package/lib/chevre/repo/acceptedOffer.js +100 -4
- package/lib/chevre/repo/accountingReport.d.ts +33 -7
- package/lib/chevre/repo/accountingReport.js +157 -5
- package/lib/chevre/repo/action.d.ts +32 -8
- package/lib/chevre/repo/action.js +114 -54
- package/lib/chevre/repo/event.d.ts +20 -0
- package/lib/chevre/repo/event.js +22 -0
- package/lib/chevre/repo/member.d.ts +8 -1
- package/lib/chevre/repo/member.js +7 -1
- package/lib/chevre/repo/mongoose/schemas/accountingReport.js +2 -1
- package/lib/chevre/repo/mongoose/schemas/action.d.ts +1 -1
- package/lib/chevre/repo/mongoose/schemas/action.js +25 -11
- package/lib/chevre/repo/mongoose/schemas/order.d.ts +1 -1
- package/lib/chevre/repo/mongoose/schemas/order.js +38 -11
- package/lib/chevre/repo/offer.d.ts +42 -0
- package/lib/chevre/repo/offer.js +35 -0
- package/lib/chevre/repo/order.js +43 -20
- package/lib/chevre/repo/orderInTransaction.d.ts +44 -0
- package/lib/chevre/repo/orderInTransaction.js +164 -0
- package/lib/chevre/repo/paymentServiceProvider.js +2 -1
- package/lib/chevre/repo/person.js +1 -4
- package/lib/chevre/repo/task.d.ts +26 -3
- package/lib/chevre/repo/task.js +61 -46
- package/lib/chevre/repo/transaction.d.ts +2 -2
- package/lib/chevre/repo/transaction.js +13 -36
- package/lib/chevre/repository.d.ts +5 -0
- package/lib/chevre/repository.js +15 -2
- package/lib/chevre/service/aggregation/event/importFromCOA.js +5 -5
- package/lib/chevre/service/assetTransaction/pay/factory.js +1 -6
- package/lib/chevre/service/assetTransaction/pay/potentialActions/createPayObjectServiceOutput.d.ts +9 -0
- package/lib/chevre/service/assetTransaction/pay/potentialActions/createPayObjectServiceOutput.js +143 -0
- package/lib/chevre/service/assetTransaction/pay/potentialActions.d.ts +11 -3
- package/lib/chevre/service/assetTransaction/pay/potentialActions.js +4 -165
- package/lib/chevre/service/assetTransaction/pay.d.ts +21 -4
- package/lib/chevre/service/assetTransaction/pay.js +64 -23
- package/lib/chevre/service/assetTransaction/reserve/factory.js +11 -14
- package/lib/chevre/service/assetTransaction/reserveCOA.d.ts +19 -0
- package/lib/chevre/service/assetTransaction/reserveCOA.js +46 -0
- package/lib/chevre/service/code.js +1 -1
- package/lib/chevre/service/delivery.js +2 -2
- package/lib/chevre/service/event/createEvent.js +1 -1
- package/lib/chevre/service/event.js +16 -24
- package/lib/chevre/service/moneyTransfer.js +1 -1
- package/lib/chevre/service/notification.js +71 -66
- package/lib/chevre/service/offer/any.d.ts +35 -0
- package/lib/chevre/service/offer/any.js +67 -0
- package/lib/chevre/service/offer/event/authorize.d.ts +7 -0
- package/lib/chevre/service/offer/event/authorize.js +27 -17
- package/lib/chevre/service/offer/event/cancel.d.ts +2 -0
- package/lib/chevre/service/offer/event/cancel.js +13 -1
- package/lib/chevre/service/offer/event/factory.d.ts +1 -1
- package/lib/chevre/service/offer/event/factory.js +11 -22
- package/lib/chevre/service/offer/event/importFromCOA.js +6 -8
- package/lib/chevre/service/offer/event/voidTransaction.d.ts +2 -0
- package/lib/chevre/service/offer/event/voidTransaction.js +24 -7
- package/lib/chevre/service/offer/eventServiceByCOA/authorize.d.ts +54 -0
- package/lib/chevre/service/offer/eventServiceByCOA/authorize.js +138 -0
- package/lib/chevre/service/offer/eventServiceByCOA/cancel.d.ts +39 -0
- package/lib/chevre/service/offer/eventServiceByCOA/cancel.js +59 -0
- package/lib/chevre/service/offer/eventServiceByCOA/changeOffers.d.ts +25 -0
- package/lib/chevre/service/offer/eventServiceByCOA/changeOffers.js +165 -0
- package/lib/chevre/service/offer/eventServiceByCOA/factory.js +10 -23
- package/lib/chevre/service/offer/eventServiceByCOA.d.ts +4 -89
- package/lib/chevre/service/offer/eventServiceByCOA.js +7 -292
- package/lib/chevre/service/offer/moneyTransfer/authorize.d.ts +10 -1
- package/lib/chevre/service/offer/moneyTransfer/authorize.js +49 -3
- package/lib/chevre/service/offer/moneyTransfer/returnMoneyTransfer.js +1 -1
- package/lib/chevre/service/offer/moneyTransfer/settleTransaction.d.ts +2 -0
- package/lib/chevre/service/offer/moneyTransfer/settleTransaction.js +47 -2
- package/lib/chevre/service/offer/moneyTransfer/voidTransaction.js +1 -1
- package/lib/chevre/service/offer/product/factory.js +2 -5
- package/lib/chevre/service/offer/product.d.ts +2 -0
- package/lib/chevre/service/offer/product.js +11 -23
- package/lib/chevre/service/order/confirmPayTransaction.d.ts +3 -1
- package/lib/chevre/service/order/confirmPayTransaction.js +4 -4
- package/lib/chevre/service/order/createAccountingReportIfNotExist.js +1 -1
- package/lib/chevre/service/order/onAssetTransactionStatusChanged.d.ts +12 -1
- package/lib/chevre/service/order/onAssetTransactionStatusChanged.js +206 -7
- package/lib/chevre/service/order/onOrderStatusChanged/onOrderCancelled/factory.d.ts +1 -1
- package/lib/chevre/service/order/onOrderStatusChanged/onOrderDelivered/factory.d.ts +1 -1
- package/lib/chevre/service/order/onOrderStatusChanged/onOrderDelivered/factory.js +51 -53
- package/lib/chevre/service/order/onOrderStatusChanged/onOrderDelivered.d.ts +1 -1
- package/lib/chevre/service/order/onOrderStatusChanged/onOrderDelivered.js +10 -25
- package/lib/chevre/service/order/onOrderStatusChanged/onOrderDeliveredPartially/factory.d.ts +16 -0
- package/lib/chevre/service/order/onOrderStatusChanged/onOrderDeliveredPartially/factory.js +91 -0
- package/lib/chevre/service/order/onOrderStatusChanged/onOrderDeliveredPartially.d.ts +8 -0
- package/lib/chevre/service/order/onOrderStatusChanged/onOrderDeliveredPartially.js +37 -0
- package/lib/chevre/service/order/onOrderStatusChanged/onOrderInTransit.d.ts +12 -0
- package/lib/chevre/service/order/onOrderStatusChanged/onOrderInTransit.js +115 -0
- package/lib/chevre/service/order/onOrderStatusChanged/onOrderPaymentDue.js +19 -1
- package/lib/chevre/service/order/onOrderStatusChanged/onOrderProcessing/createSendEmailMessageTaskIfNotExist.d.ts +8 -0
- package/lib/chevre/service/order/onOrderStatusChanged/onOrderProcessing/createSendEmailMessageTaskIfNotExist.js +41 -0
- package/lib/chevre/service/order/onOrderStatusChanged/onOrderProcessing/factory.d.ts +6 -10
- package/lib/chevre/service/order/onOrderStatusChanged/onOrderProcessing/factory.js +116 -92
- package/lib/chevre/service/order/onOrderStatusChanged/onOrderProcessing.d.ts +4 -1
- package/lib/chevre/service/order/onOrderStatusChanged/onOrderProcessing.js +81 -84
- package/lib/chevre/service/order/onOrderStatusChanged/onOrderReturned/factory.d.ts +1 -1
- package/lib/chevre/service/order/onOrderStatusChanged/onOrderReturned/factory.js +18 -15
- package/lib/chevre/service/order/onOrderStatusChanged/onOrderReturned.js +62 -1
- package/lib/chevre/service/order/onOrderStatusChanged.d.ts +3 -1
- package/lib/chevre/service/order/onOrderStatusChanged.js +5 -1
- package/lib/chevre/service/order/placeOrder.d.ts +3 -1
- package/lib/chevre/service/order/placeOrder.js +157 -50
- package/lib/chevre/service/order/returnOrder.js +25 -16
- package/lib/chevre/service/order/sendOrder.d.ts +5 -0
- package/lib/chevre/service/order/sendOrder.js +67 -33
- package/lib/chevre/service/payment/any/onPaid.js +1 -1
- package/lib/chevre/service/payment/any/onPaymentStatusChanged/onPaid.d.ts +3 -1
- package/lib/chevre/service/payment/any/onPaymentStatusChanged/onPaid.js +15 -9
- package/lib/chevre/service/payment/any/onPaymentStatusChanged/onRefunded.d.ts +3 -1
- package/lib/chevre/service/payment/any/onPaymentStatusChanged/onRefunded.js +8 -5
- package/lib/chevre/service/payment/any/onPaymentStatusChanged.js +2 -2
- package/lib/chevre/service/payment/any/onRefund.js +1 -1
- package/lib/chevre/service/payment/any.d.ts +6 -5
- package/lib/chevre/service/payment/any.js +3 -2
- package/lib/chevre/service/payment/creditCard.d.ts +1 -1
- package/lib/chevre/service/payment/creditCard.js +62 -74
- package/lib/chevre/service/payment/faceToFace.d.ts +1 -1
- package/lib/chevre/service/payment/movieTicket.d.ts +1 -1
- package/lib/chevre/service/payment/movieTicket.js +1 -1
- package/lib/chevre/service/payment/paymentCard.d.ts +1 -1
- package/lib/chevre/service/payment.d.ts +5 -0
- package/lib/chevre/service/payment.js +40 -5
- package/lib/chevre/service/product.js +1 -1
- package/lib/chevre/service/reserve/cancelReservation.js +2 -2
- package/lib/chevre/service/reserve/checkInReservation.d.ts +1 -3
- package/lib/chevre/service/reserve/checkInReservation.js +6 -5
- package/lib/chevre/service/reserve/confirmReservation.js +1 -1
- package/lib/chevre/service/reserve/factory.js +0 -8
- package/lib/chevre/service/reserve/potentialActions/onReservationUsed.d.ts +1 -1
- package/lib/chevre/service/reserve/potentialActions/onReservationUsed.js +4 -4
- package/lib/chevre/service/reserve/searchByOrder.js +2 -1
- package/lib/chevre/service/reserve/useReservation.d.ts +1 -3
- package/lib/chevre/service/reserve/useReservation.js +10 -9
- package/lib/chevre/service/reserve/verifyToken4reservation.js +2 -0
- package/lib/chevre/service/task/confirmMoneyTransfer.js +4 -4
- package/lib/chevre/service/task/confirmPayTransaction.js +2 -1
- package/lib/chevre/service/task/confirmRegisterServiceTransaction.d.ts +1 -1
- package/lib/chevre/service/task/confirmRegisterServiceTransaction.js +30 -8
- package/lib/chevre/service/task/confirmReserveTransaction.d.ts +6 -1
- package/lib/chevre/service/task/confirmReserveTransaction.js +176 -29
- package/lib/chevre/service/task/createAccountingReport.d.ts +6 -0
- package/lib/chevre/service/task/createAccountingReport.js +80 -0
- package/lib/chevre/service/task/importOffersFromCOA.js +2 -1
- package/lib/chevre/service/task/onAuthorizationCreated.js +0 -1
- package/lib/chevre/service/task/onResourceUpdated/onResourceDeleted.js +7 -7
- package/lib/chevre/service/task/pay.js +6 -0
- package/lib/chevre/service/task/placeOrder.js +9 -10
- package/lib/chevre/service/task/returnOrder.js +0 -3
- package/lib/chevre/service/task/returnPayTransaction.js +1 -1
- package/lib/chevre/service/task/returnReserveTransaction.js +3 -2
- package/lib/chevre/service/task/sendOrder.js +8 -4
- package/lib/chevre/service/task/useReservation.js +1 -1
- package/lib/chevre/service/task/voidReserveTransaction.js +8 -12
- package/lib/chevre/service/transaction/deleteTransaction.js +1 -1
- package/lib/chevre/service/transaction/moneyTransfer/potentialActions.js +2 -18
- package/lib/chevre/service/transaction/moneyTransfer.js +7 -6
- package/lib/chevre/service/transaction/placeOrder/exportTasks/factory.d.ts +2 -2
- package/lib/chevre/service/transaction/placeOrder/exportTasks/factory.js +17 -20
- package/lib/chevre/service/transaction/placeOrder.js +2 -1
- package/lib/chevre/service/transaction/placeOrderInProgress/confirm.d.ts +51 -0
- package/lib/chevre/service/transaction/placeOrderInProgress/confirm.js +268 -0
- package/lib/chevre/service/transaction/placeOrderInProgress/factory.d.ts +1 -1
- package/lib/chevre/service/transaction/placeOrderInProgress/factory.js +3 -2
- package/lib/chevre/service/transaction/placeOrderInProgress/potentialActions/moneyTransfer.js +1 -1
- package/lib/chevre/service/transaction/placeOrderInProgress/potentialActions.js +22 -44
- package/lib/chevre/service/transaction/placeOrderInProgress/publishCode.d.ts +14 -0
- package/lib/chevre/service/transaction/placeOrderInProgress/publishCode.js +41 -0
- package/lib/chevre/service/transaction/placeOrderInProgress/publishConfirmationNumberIfNotExist.d.ts +18 -0
- package/lib/chevre/service/transaction/placeOrderInProgress/publishConfirmationNumberIfNotExist.js +42 -0
- package/lib/chevre/service/transaction/placeOrderInProgress/publishOrderNumberIfNotExist.d.ts +23 -0
- package/lib/chevre/service/transaction/placeOrderInProgress/publishOrderNumberIfNotExist.js +46 -0
- package/lib/chevre/service/transaction/placeOrderInProgress/result/acceptedOffers.js +34 -37
- package/lib/chevre/service/transaction/placeOrderInProgress/result.d.ts +3 -1
- package/lib/chevre/service/transaction/placeOrderInProgress/result.js +13 -4
- package/lib/chevre/service/transaction/placeOrderInProgress/start.d.ts +19 -0
- package/lib/chevre/service/transaction/placeOrderInProgress/start.js +46 -0
- package/lib/chevre/service/transaction/placeOrderInProgress/validation/validateStartRequest.d.ts +26 -0
- package/lib/chevre/service/transaction/placeOrderInProgress/validation/validateStartRequest.js +109 -0
- package/lib/chevre/service/transaction/placeOrderInProgress/validation.d.ts +10 -23
- package/lib/chevre/service/transaction/placeOrderInProgress/validation.js +20 -1
- package/lib/chevre/service/transaction/placeOrderInProgress.d.ts +11 -73
- package/lib/chevre/service/transaction/placeOrderInProgress.js +13 -286
- package/lib/chevre/service/transaction/returnOrder/potentialActions/returnPointAward.js +1 -2
- package/lib/chevre/service/transaction/returnOrder/potentialActions.d.ts +0 -1
- package/lib/chevre/service/transaction/returnOrder/potentialActions.js +8 -3
- package/lib/chevre/service/transaction/returnOrder/preStart.js +78 -50
- package/lib/chevre/service/transaction/returnOrder.js +3 -10
- package/lib/chevre/service.js +0 -10
- package/lib/chevre/settings.d.ts +7 -3
- package/lib/chevre/settings.js +13 -4
- package/package.json +5 -9
- package/example/src/chevre/cleanAccountingReports.ts +0 -57
- package/example/src/chevre/migratePayTransactionPaymentMethodIdentifier.ts +0 -78
- package/lib/chevre/service/transaction/placeOrderInProgress/validation/validateSeller.d.ts +0 -11
- package/lib/chevre/service/transaction/placeOrderInProgress/validation/validateSeller.js +0 -30
- package/lib/chevre/service/transaction/returnOrder/potentialActions/returnMoneyTransfer.d.ts +0 -7
- package/lib/chevre/service/transaction/returnOrder/potentialActions/returnMoneyTransfer.js +0 -82
- package/lib/chevre/service/util.d.ts +0 -19
- package/lib/chevre/service/util.js +0 -126
|
@@ -11,14 +11,12 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
12
|
exports.triggerWebhook = exports.report2developers = exports.sendEmailMessage = void 0;
|
|
13
13
|
const sgMail = require("@sendgrid/mail");
|
|
14
|
-
const createDebug = require("debug");
|
|
15
14
|
const http_status_1 = require("http-status");
|
|
16
|
-
|
|
15
|
+
// import * as request from 'request';
|
|
17
16
|
const util = require("util");
|
|
18
17
|
const credentials_1 = require("../credentials");
|
|
19
18
|
const settings_1 = require("../settings");
|
|
20
19
|
const factory = require("../factory");
|
|
21
|
-
const debug = createDebug('chevre-domain:service');
|
|
22
20
|
/**
|
|
23
21
|
* Eメールメッセージを送信する
|
|
24
22
|
* https://sendgrid.com/docs/API_Reference/Web_API_v3/Mail/errors.html
|
|
@@ -110,8 +108,7 @@ function sendEmailMessage(params) {
|
|
|
110
108
|
throw error;
|
|
111
109
|
}
|
|
112
110
|
// アクション完了
|
|
113
|
-
|
|
114
|
-
yield repos.action.complete({ typeOf: action.typeOf, id: action.id, result: result });
|
|
111
|
+
yield repos.action.completeWithVoid({ typeOf: action.typeOf, id: action.id, result: result });
|
|
115
112
|
});
|
|
116
113
|
}
|
|
117
114
|
exports.sendEmailMessage = sendEmailMessage;
|
|
@@ -182,31 +179,37 @@ ${content}`;
|
|
|
182
179
|
}
|
|
183
180
|
}
|
|
184
181
|
else {
|
|
182
|
+
throw new factory.errors.NotImplemented('only useFetchAPI implemented');
|
|
185
183
|
// LINE通知APIにPOST
|
|
186
|
-
const formData
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
184
|
+
// const formData: any = {
|
|
185
|
+
// message: message,
|
|
186
|
+
// ...(typeof imageThumbnail === 'string') ? { imageThumbnail } : undefined,
|
|
187
|
+
// ...(typeof imageFullsize === 'string') ? { imageFullsize } : undefined
|
|
188
|
+
// };
|
|
189
|
+
// return new Promise<void>((resolve, reject) => {
|
|
190
|
+
// request.post(
|
|
191
|
+
// {
|
|
192
|
+
// url: LINE_NOTIFY_URL,
|
|
193
|
+
// auth: { bearer: repos.accessToken },
|
|
194
|
+
// form: formData,
|
|
195
|
+
// json: true,
|
|
196
|
+
// timeout: settings.webhook?.timeout
|
|
197
|
+
// },
|
|
198
|
+
// (error, response, body) => {
|
|
199
|
+
// if (error !== null) {
|
|
200
|
+
// reject(error);
|
|
201
|
+
// } else {
|
|
202
|
+
// switch (response.statusCode) {
|
|
203
|
+
// case OK:
|
|
204
|
+
// resolve();
|
|
205
|
+
// break;
|
|
206
|
+
// default:
|
|
207
|
+
// reject(new Error(body.message));
|
|
208
|
+
// }
|
|
209
|
+
// }
|
|
210
|
+
// }
|
|
211
|
+
// );
|
|
212
|
+
// });
|
|
210
213
|
}
|
|
211
214
|
});
|
|
212
215
|
}
|
|
@@ -295,57 +298,59 @@ function processInformAction(params) {
|
|
|
295
298
|
catch (err) {
|
|
296
299
|
if (err.name === 'TimeoutError') {
|
|
297
300
|
// tslint:disable-next-line:no-console
|
|
298
|
-
console.error('
|
|
301
|
+
console.error('processInformAction: Timeout: It took more than 5 seconds to get the result!', err);
|
|
299
302
|
}
|
|
300
303
|
else if (err.name === 'AbortError') {
|
|
301
304
|
// tslint:disable-next-line:no-console
|
|
302
|
-
console.error('
|
|
305
|
+
console.error('processInformAction: Fetch aborted by user action (browser stop button, closing tab, etc.', err);
|
|
303
306
|
}
|
|
304
307
|
else if (err.name === 'TypeError') {
|
|
305
308
|
// tslint:disable-next-line:no-console
|
|
306
|
-
console.error('
|
|
309
|
+
console.error('processInformAction: AbortSignal.timeout() method is not supported', err);
|
|
307
310
|
}
|
|
308
311
|
else {
|
|
309
312
|
// A network error, or some other problem.
|
|
310
313
|
// tslint:disable-next-line:no-console
|
|
311
|
-
console.error(`
|
|
314
|
+
console.error(`processInformAction: Error: type: ${err.name}, message: ${err.message}`, err);
|
|
312
315
|
}
|
|
313
316
|
throw err;
|
|
314
317
|
}
|
|
315
318
|
}
|
|
316
319
|
else {
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
}
|
|
320
|
+
throw new factory.errors.NotImplemented('only useFetchAPI implemented');
|
|
321
|
+
// await new Promise<void>((resolve, reject) => {
|
|
322
|
+
// request.post(
|
|
323
|
+
// {
|
|
324
|
+
// url: url,
|
|
325
|
+
// body: {
|
|
326
|
+
// data: params.object
|
|
327
|
+
// },
|
|
328
|
+
// json: true,
|
|
329
|
+
// timeout: settings.webhook?.timeout
|
|
330
|
+
// },
|
|
331
|
+
// (error, response, body) => {
|
|
332
|
+
// if (error instanceof Error) {
|
|
333
|
+
// reject(error);
|
|
334
|
+
// } else {
|
|
335
|
+
// switch (response.statusCode) {
|
|
336
|
+
// case OK:
|
|
337
|
+
// case CREATED:
|
|
338
|
+
// case ACCEPTED:
|
|
339
|
+
// case NO_CONTENT:
|
|
340
|
+
// result = {
|
|
341
|
+
// statusCode: response.statusCode,
|
|
342
|
+
// useFetchAPI: repos.useFetchAPI
|
|
343
|
+
// // body: body
|
|
344
|
+
// };
|
|
345
|
+
// resolve();
|
|
346
|
+
// break;
|
|
347
|
+
// default:
|
|
348
|
+
// reject(new Error(`statusCode: ${response.statusCode} body: ${body}`));
|
|
349
|
+
// }
|
|
350
|
+
// }
|
|
351
|
+
// }
|
|
352
|
+
// );
|
|
353
|
+
// });
|
|
349
354
|
}
|
|
350
355
|
}
|
|
351
356
|
}
|
|
@@ -365,6 +370,6 @@ function processInformAction(params) {
|
|
|
365
370
|
throw error;
|
|
366
371
|
}
|
|
367
372
|
}
|
|
368
|
-
yield repos.action.
|
|
373
|
+
yield repos.action.completeWithVoid({ typeOf: action.typeOf, id: action.id, result: result });
|
|
369
374
|
});
|
|
370
375
|
}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import * as factory from '../../factory';
|
|
2
|
+
import type { MongoRepository as OrderInTransactionRepo } from '../../repo/orderInTransaction';
|
|
3
|
+
import type { RedisRepository as OrderNumberRepo } from '../../repo/orderNumber';
|
|
4
|
+
import type { MongoRepository as ProjectRepo } from '../../repo/project';
|
|
5
|
+
import type { MongoRepository as TransactionRepo } from '../../repo/transaction';
|
|
6
|
+
interface IAcceptOfferOperationRepos {
|
|
7
|
+
orderInTransaction: OrderInTransactionRepo;
|
|
8
|
+
orderNumber: OrderNumberRepo;
|
|
9
|
+
project: ProjectRepo;
|
|
10
|
+
transaction: TransactionRepo;
|
|
11
|
+
}
|
|
12
|
+
type IAcceptOfferOperation<T> = (repos: IAcceptOfferOperationRepos) => Promise<T>;
|
|
13
|
+
export type IAuthorizeActionWithInstrument = Pick<factory.action.authorize.offer.moneyTransfer.IAction | factory.action.authorize.offer.product.IAction | factory.action.authorize.offer.eventService.IAction<factory.service.webAPI.Identifier>, 'instrument'>;
|
|
14
|
+
export declare function acceptOffer(params: {
|
|
15
|
+
project: {
|
|
16
|
+
id: string;
|
|
17
|
+
};
|
|
18
|
+
purpose: {
|
|
19
|
+
id: string;
|
|
20
|
+
};
|
|
21
|
+
acceptedOffers: factory.order.IAcceptedOffer<factory.order.IItemOffered>[];
|
|
22
|
+
}): IAcceptOfferOperation<void>;
|
|
23
|
+
export declare function voidAcceptedOffer(params: {
|
|
24
|
+
/**
|
|
25
|
+
* 取消対象の興行オファー承認アクション
|
|
26
|
+
*/
|
|
27
|
+
/**
|
|
28
|
+
* instrument.serialNumberからvoidする場合に指定
|
|
29
|
+
*/
|
|
30
|
+
authorizeActionsWithInstrument: IAuthorizeActionWithInstrument[];
|
|
31
|
+
orderNumber: string;
|
|
32
|
+
}): (repos: {
|
|
33
|
+
orderInTransaction: OrderInTransactionRepo;
|
|
34
|
+
}) => Promise<void>;
|
|
35
|
+
export {};
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.voidAcceptedOffer = exports.acceptOffer = void 0;
|
|
13
|
+
const createDebug = require("debug");
|
|
14
|
+
const factory = require("../../factory");
|
|
15
|
+
const placeOrderInProgress_1 = require("../transaction/placeOrderInProgress");
|
|
16
|
+
const debug = createDebug('chevre-domain:service:offer');
|
|
17
|
+
function acceptOffer(params) {
|
|
18
|
+
return (repos) => __awaiter(this, void 0, void 0, function* () {
|
|
19
|
+
const now = new Date();
|
|
20
|
+
const orderNumber = yield (0, placeOrderInProgress_1.publishOrderNumberIfNotExist)({
|
|
21
|
+
project: { id: params.project.id },
|
|
22
|
+
id: params.purpose.id,
|
|
23
|
+
object: { orderDate: now }
|
|
24
|
+
})(repos);
|
|
25
|
+
yield repos.orderInTransaction.acceptOffer({
|
|
26
|
+
orderNumber,
|
|
27
|
+
project: { id: params.project.id, typeOf: factory.organizationType.Project },
|
|
28
|
+
acceptedOffers: params.acceptedOffers
|
|
29
|
+
});
|
|
30
|
+
});
|
|
31
|
+
}
|
|
32
|
+
exports.acceptOffer = acceptOffer;
|
|
33
|
+
function voidAcceptedOffer(params) {
|
|
34
|
+
return (repos) => __awaiter(this, void 0, void 0, function* () {
|
|
35
|
+
const { orderNumber } = params;
|
|
36
|
+
// let reservationNumbers: string[] = [];
|
|
37
|
+
// authorizeActions.forEach((authorizeAction) => {
|
|
38
|
+
// const reserveTransactionNumberByAction = authorizeAction.object.pendingTransaction?.transactionNumber;
|
|
39
|
+
// if (typeof reserveTransactionNumberByAction === 'string') {
|
|
40
|
+
// reservationNumbers.push(reserveTransactionNumberByAction);
|
|
41
|
+
// }
|
|
42
|
+
// });
|
|
43
|
+
// reservationNumbers = [...new Set(reservationNumbers)];
|
|
44
|
+
// debug('removing acceptedOffers from PlaceOrder...', orderNumber, reservationNumbers);
|
|
45
|
+
// if (reservationNumbers.length > 0) {
|
|
46
|
+
// const result = await repos.orderInTransaction.voidAcceptedOfferByReservationNumber({
|
|
47
|
+
// orderNumber,
|
|
48
|
+
// acceptedOffers: { reservationNumber: { $in: reservationNumbers } }
|
|
49
|
+
// });
|
|
50
|
+
// debug('acceptedOffers removed from PlaceOrder.', result);
|
|
51
|
+
// }
|
|
52
|
+
if (Array.isArray(params.authorizeActionsWithInstrument)) {
|
|
53
|
+
const serialNumbers = params.authorizeActionsWithInstrument
|
|
54
|
+
.filter(({ instrument }) => typeof instrument.transactionNumber === 'string')
|
|
55
|
+
.map(({ instrument }) => String(instrument.transactionNumber));
|
|
56
|
+
debug('removing acceptedOffers from PlaceOrder...', orderNumber, 'serialNumbers:', serialNumbers);
|
|
57
|
+
if (serialNumbers.length > 0) {
|
|
58
|
+
const result = yield repos.orderInTransaction.voidAcceptedOfferBySerialNumber({
|
|
59
|
+
orderNumber,
|
|
60
|
+
acceptedOffers: { serialNumber: { $in: serialNumbers } }
|
|
61
|
+
});
|
|
62
|
+
debug('acceptedOffers removed from PlaceOrder by serialNumbers.', result);
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
});
|
|
66
|
+
}
|
|
67
|
+
exports.voidAcceptedOffer = voidAcceptedOffer;
|
|
@@ -5,6 +5,8 @@ import type { MongoRepository as EventRepo } from '../../../repo/event';
|
|
|
5
5
|
import type { MongoRepository as OfferRepo } from '../../../repo/offer';
|
|
6
6
|
import type { MongoRepository as OfferCatalogRepo } from '../../../repo/offerCatalog';
|
|
7
7
|
import type { MongoRepository as OfferCatalogItemRepo } from '../../../repo/offerCatalogItem';
|
|
8
|
+
import type { MongoRepository as OrderInTransactionRepo } from '../../../repo/orderInTransaction';
|
|
9
|
+
import type { RedisRepository as OrderNumberRepo } from '../../../repo/orderNumber';
|
|
8
10
|
import type { MongoRepository as PaymentServiceRepo } from '../../../repo/paymentService';
|
|
9
11
|
import type { MongoRepository as PlaceRepo } from '../../../repo/place';
|
|
10
12
|
import type { MongoRepository as PriceSpecificationRepo } from '../../../repo/priceSpecification';
|
|
@@ -27,6 +29,8 @@ interface IAuthorizeRepos {
|
|
|
27
29
|
offerCatalog: OfferCatalogRepo;
|
|
28
30
|
offerCatalogItem: OfferCatalogItemRepo;
|
|
29
31
|
offerRateLimit: OfferRateLimitRepo;
|
|
32
|
+
orderInTransaction: OrderInTransactionRepo;
|
|
33
|
+
orderNumber: OrderNumberRepo;
|
|
30
34
|
paymentService: PaymentServiceRepo;
|
|
31
35
|
place: PlaceRepo;
|
|
32
36
|
priceSpecification: PriceSpecificationRepo;
|
|
@@ -69,5 +73,8 @@ declare function authorize(params: {
|
|
|
69
73
|
* オファーID指定なしに座席をおさえる場合true
|
|
70
74
|
*/
|
|
71
75
|
noOfferSpecified: boolean;
|
|
76
|
+
options: {
|
|
77
|
+
useCreateOrderOnOfferAccepted: boolean;
|
|
78
|
+
};
|
|
72
79
|
}): IAuthorizeOperation<IAuthorizeOfferAction>;
|
|
73
80
|
export { authorize };
|
|
@@ -11,6 +11,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
12
|
exports.authorize = void 0;
|
|
13
13
|
const factory = require("../../../factory");
|
|
14
|
+
const any_1 = require("../any");
|
|
14
15
|
const defaultOffer_1 = require("./defaultOffer");
|
|
15
16
|
const processStartReserve4chevre_1 = require("./processStartReserve4chevre");
|
|
16
17
|
const searchEventTicketOffers_1 = require("./searchEventTicketOffers");
|
|
@@ -32,21 +33,16 @@ function authorize(params) {
|
|
|
32
33
|
noOfferSpecified
|
|
33
34
|
})(repos);
|
|
34
35
|
let acceptedOffers4result = [];
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
case factory.service.webAPI.Identifier.COA:
|
|
38
|
-
break;
|
|
39
|
-
case factory.service.webAPI.Identifier.Chevre:
|
|
40
|
-
// Chevre予約の場合、まず取引番号発行
|
|
41
|
-
const publishTransactionNumberResult = yield repos.transactionNumber.publishByTimestamp({ startDate: new Date() });
|
|
42
|
-
transactionNumber = publishTransactionNumberResult.transactionNumber;
|
|
43
|
-
break;
|
|
44
|
-
default:
|
|
45
|
-
}
|
|
36
|
+
// Chevre予約の場合、まず取引番号発行
|
|
37
|
+
const { transactionNumber } = yield repos.transactionNumber.publishByTimestamp({ startDate: new Date() });
|
|
46
38
|
// 承認アクションを開始
|
|
47
|
-
const actionAttributes = (0, factory_1.createAuthorizeSeatReservationActionAttributes)(
|
|
48
|
-
|
|
49
|
-
:
|
|
39
|
+
const actionAttributes = (0, factory_1.createAuthorizeSeatReservationActionAttributes)({
|
|
40
|
+
acceptedOffers: acceptedOffers,
|
|
41
|
+
event: event,
|
|
42
|
+
transaction: transaction,
|
|
43
|
+
pendingTransaction: { typeOf: factory.assetTransactionType.Reserve, transactionNumber },
|
|
44
|
+
broker: params.object.broker
|
|
45
|
+
});
|
|
50
46
|
const action = yield repos.action.start(actionAttributes);
|
|
51
47
|
try {
|
|
52
48
|
switch (bookingServiceIdentifire) {
|
|
@@ -73,6 +69,16 @@ function authorize(params) {
|
|
|
73
69
|
stockHoldUntilDaysAfterEventEnd: params.stockHoldUntilDaysAfterEventEnd
|
|
74
70
|
})(repos);
|
|
75
71
|
acceptedOffers4result = processStartReserveResult.acceptedOffers4result;
|
|
72
|
+
// add orderInTransaction(2024-01-15~)
|
|
73
|
+
if (!noOfferSpecified) {
|
|
74
|
+
if (params.options.useCreateOrderOnOfferAccepted) {
|
|
75
|
+
yield (0, any_1.acceptOffer)({
|
|
76
|
+
project: transaction.project,
|
|
77
|
+
purpose: { id: transaction.id },
|
|
78
|
+
acceptedOffers: acceptedOffers4result
|
|
79
|
+
})(repos);
|
|
80
|
+
}
|
|
81
|
+
}
|
|
76
82
|
break;
|
|
77
83
|
default:
|
|
78
84
|
throw new factory.errors.Argument('Event', `Unknown booking service '${bookingServiceIdentifire}'`);
|
|
@@ -108,7 +114,7 @@ function authorize(params) {
|
|
|
108
114
|
exports.authorize = authorize;
|
|
109
115
|
function validateCreateRequest(params) {
|
|
110
116
|
return (repos) => __awaiter(this, void 0, void 0, function* () {
|
|
111
|
-
var _a, _b;
|
|
117
|
+
var _a, _b, _c;
|
|
112
118
|
const transaction = yield repos.transaction.findInProgressById({
|
|
113
119
|
typeOf: factory.transactionType.PlaceOrder,
|
|
114
120
|
id: params.transaction.id
|
|
@@ -116,7 +122,11 @@ function validateCreateRequest(params) {
|
|
|
116
122
|
if (transaction.agent.id !== params.agent.id) {
|
|
117
123
|
throw new factory.errors.Forbidden('Transaction not yours');
|
|
118
124
|
}
|
|
119
|
-
|
|
125
|
+
// クライアント検証(2024-02-07~)
|
|
126
|
+
if (((_a = transaction.object.clientUser) === null || _a === void 0 ? void 0 : _a.client_id) !== params.store.id) {
|
|
127
|
+
throw new factory.errors.Forbidden('client not match that of the transaction');
|
|
128
|
+
}
|
|
129
|
+
if (typeof ((_b = params.object.reservationFor) === null || _b === void 0 ? void 0 : _b.id) !== 'string' || params.object.reservationFor.id.length === 0) {
|
|
120
130
|
throw new factory.errors.ArgumentNull('object.reservationFor.id');
|
|
121
131
|
}
|
|
122
132
|
// イベント取得属性最適化(2023-01-23~)
|
|
@@ -124,7 +134,7 @@ function validateCreateRequest(params) {
|
|
|
124
134
|
const event = yield repos.event.findMinimizedIndividualEventById({
|
|
125
135
|
id: params.object.reservationFor.id
|
|
126
136
|
});
|
|
127
|
-
let offeredThrough = (
|
|
137
|
+
let offeredThrough = (_c = event.offers) === null || _c === void 0 ? void 0 : _c.offeredThrough;
|
|
128
138
|
if (offeredThrough === undefined) {
|
|
129
139
|
offeredThrough = { typeOf: 'WebAPI', identifier: factory.service.webAPI.Identifier.Chevre };
|
|
130
140
|
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import * as factory from '../../../factory';
|
|
2
2
|
import type { MongoRepository as ActionRepo } from '../../../repo/action';
|
|
3
3
|
import type { MongoRepository as AssetTransactionRepo } from '../../../repo/assetTransaction';
|
|
4
|
+
import type { MongoRepository as OrderInTransactionRepo } from '../../../repo/orderInTransaction';
|
|
4
5
|
import type { RedisRepository as OfferRateLimitRepo } from '../../../repo/rateLimit/offer';
|
|
5
6
|
import type { MongoRepository as ReservationRepo } from '../../../repo/reservation';
|
|
6
7
|
import type { StockHolderRepository as StockHolderRepo } from '../../../repo/stockHolder';
|
|
@@ -11,6 +12,7 @@ interface ICancelRepos {
|
|
|
11
12
|
assetTransaction: AssetTransactionRepo;
|
|
12
13
|
stockHolder: StockHolderRepo;
|
|
13
14
|
offerRateLimit: OfferRateLimitRepo;
|
|
15
|
+
orderInTransaction: OrderInTransactionRepo;
|
|
14
16
|
reservation: ReservationRepo;
|
|
15
17
|
task: TaskRepo;
|
|
16
18
|
transaction: TransactionRepo;
|
|
@@ -12,6 +12,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
12
12
|
exports.cancel = void 0;
|
|
13
13
|
const factory = require("../../../factory");
|
|
14
14
|
const ReserveTransactionService = require("../../assetTransaction/reserve");
|
|
15
|
+
const any_1 = require("../any");
|
|
15
16
|
/**
|
|
16
17
|
* イベントオファー承認取消(apiから実行)
|
|
17
18
|
* 特定の承認アクションについて処理する
|
|
@@ -28,12 +29,23 @@ function cancel(params) {
|
|
|
28
29
|
}
|
|
29
30
|
// MongoDBでcompleteステータスであるにも関わらず、Chevreでは削除されている、というのが最悪の状況
|
|
30
31
|
// それだけは回避するためにMongoDBを先に変更
|
|
31
|
-
|
|
32
|
+
yield repos.action.cancelWithVoid({ typeOf: factory.actionType.AuthorizeAction, id: params.id });
|
|
33
|
+
const action = yield repos.action.findById({ typeOf: factory.actionType.AuthorizeAction, id: params.id });
|
|
32
34
|
switch (action.instrument.identifier) {
|
|
33
35
|
case factory.service.webAPI.Identifier.COA:
|
|
34
36
|
// 実質使用する予定なしなので廃止(2022-05-12~)
|
|
35
37
|
throw new factory.errors.NotImplemented(`booking service '${action.instrument.identifier}' not implemented`);
|
|
36
38
|
default:
|
|
39
|
+
// add orderInTransaction(2024-01-15~)
|
|
40
|
+
// USE_CREATE_ORDER_ON_OFFER_ACCEPTEDの場合、orderNumber発行済のはず
|
|
41
|
+
const orderNumberByTransaction = transaction.object.orderNumber;
|
|
42
|
+
if (typeof orderNumberByTransaction === 'string') {
|
|
43
|
+
yield (0, any_1.voidAcceptedOffer)({
|
|
44
|
+
// authorizeActions: [action],
|
|
45
|
+
authorizeActionsWithInstrument: [action],
|
|
46
|
+
orderNumber: orderNumberByTransaction
|
|
47
|
+
})(repos);
|
|
48
|
+
}
|
|
37
49
|
const transactionNumber = (_a = action.object.pendingTransaction) === null || _a === void 0 ? void 0 : _a.transactionNumber;
|
|
38
50
|
if (typeof transactionNumber === 'string') {
|
|
39
51
|
// すでに取消済であったとしても、すべて取消処理(actionStatusに関係なく)
|
|
@@ -16,7 +16,7 @@ export declare function createReserveTransactionStartParams(params: {
|
|
|
16
16
|
export declare function createAuthorizeSeatReservationActionAttributes(params: {
|
|
17
17
|
acceptedOffers: factory.action.authorize.offer.eventService.IAcceptedOffer4chevre[];
|
|
18
18
|
event: IMinimizedIndividualEvent<factory.eventType.ScreeningEvent>;
|
|
19
|
-
pendingTransaction
|
|
19
|
+
pendingTransaction: factory.action.authorize.offer.eventService.IChevrePendingTransaction;
|
|
20
20
|
transaction: factory.transaction.ITransaction<factory.transactionType.PlaceOrder>;
|
|
21
21
|
broker?: factory.reservation.IBroker<factory.reservationType.EventReservation>;
|
|
22
22
|
}): factory.action.authorize.offer.eventService.IAttributes<factory.service.webAPI.Identifier.Chevre>;
|
|
@@ -5,6 +5,7 @@ const COA = require("@motionpicture/coa-service");
|
|
|
5
5
|
const moment = require("moment");
|
|
6
6
|
const util_1 = require("util");
|
|
7
7
|
const factory = require("../../../factory");
|
|
8
|
+
const settings_1 = require("../../../settings");
|
|
8
9
|
function createReserveTransactionStartParams(params) {
|
|
9
10
|
var _a, _b;
|
|
10
11
|
const acceptedTicketOffersWithoutDetail = (Array.isArray(params.object.acceptedOffer))
|
|
@@ -89,17 +90,12 @@ function createAuthorizeSeatReservationActionAttributes(params) {
|
|
|
89
90
|
typeOf: 'WebAPI'
|
|
90
91
|
}
|
|
91
92
|
},
|
|
92
|
-
// ↓不要なので廃止(少なくともapiレスポンスにはsuperEventは含んでいない)(2022-08-19~)
|
|
93
|
-
// superEvent: event.superEvent,
|
|
94
93
|
typeOf: event.typeOf
|
|
95
94
|
};
|
|
96
95
|
return {
|
|
97
96
|
project: transaction.project,
|
|
98
97
|
typeOf: factory.actionType.AuthorizeAction,
|
|
99
|
-
object: Object.assign(
|
|
100
|
-
// ↓不要なので廃止(2022-06-07~)
|
|
101
|
-
// reservationFor: { id: event.id },
|
|
102
|
-
acceptedOffer: acceptedOffers }, (params.pendingTransaction !== undefined) ? { pendingTransaction: params.pendingTransaction } : undefined), (params.broker !== undefined) ? { broker: params.broker } : undefined),
|
|
98
|
+
object: Object.assign({ typeOf: factory.action.authorize.offer.eventService.ObjectType.SeatReservation, event: authorizeObjectEvent, acceptedOffer: acceptedOffers, pendingTransaction: params.pendingTransaction }, (params.broker !== undefined) ? { broker: params.broker } : undefined),
|
|
103
99
|
agent: {
|
|
104
100
|
id: transaction.seller.id,
|
|
105
101
|
typeOf: transaction.seller.typeOf,
|
|
@@ -110,11 +106,13 @@ function createAuthorizeSeatReservationActionAttributes(params) {
|
|
|
110
106
|
recipient: {
|
|
111
107
|
typeOf: transaction.agent.typeOf,
|
|
112
108
|
id: transaction.agent.id
|
|
113
|
-
// ↓不要なので廃止(2022-08-19~)
|
|
114
|
-
// ...(transaction.agent.identifier !== undefined) ? { identifier: transaction.agent.identifier } : undefined
|
|
115
109
|
},
|
|
116
110
|
purpose: { typeOf: transaction.typeOf, id: transaction.id },
|
|
117
|
-
instrument: {
|
|
111
|
+
instrument: {
|
|
112
|
+
typeOf: 'WebAPI',
|
|
113
|
+
identifier: factory.service.webAPI.Identifier.Chevre,
|
|
114
|
+
transactionNumber: params.pendingTransaction.transactionNumber
|
|
115
|
+
}
|
|
118
116
|
};
|
|
119
117
|
}
|
|
120
118
|
exports.createAuthorizeSeatReservationActionAttributes = createAuthorizeSeatReservationActionAttributes;
|
|
@@ -195,18 +193,8 @@ function responseBody2acceptedOffers4result(params) {
|
|
|
195
193
|
priceCurrency: priceSpecification.priceCurrency,
|
|
196
194
|
typeOf: priceSpecification.typeOf,
|
|
197
195
|
valueAddedTaxIncluded: priceSpecification.valueAddedTaxIncluded
|
|
198
|
-
}
|
|
199
|
-
|
|
200
|
-
// priceCurrency: (typeof itemOffered.priceCurrency === 'string')
|
|
201
|
-
// ? itemOffered.priceCurrency
|
|
202
|
-
// : factory.priceCurrency.JPY,
|
|
203
|
-
// 不要なので廃止(2023-07-01~)
|
|
204
|
-
// seller: {
|
|
205
|
-
// typeOf: params.seller.typeOf,
|
|
206
|
-
// name: (typeof params.seller.name === 'string')
|
|
207
|
-
// ? params.seller.name
|
|
208
|
-
// : String(params.seller.name?.ja)
|
|
209
|
-
// }
|
|
196
|
+
},
|
|
197
|
+
serialNumber: params.responseBody.transactionNumber
|
|
210
198
|
};
|
|
211
199
|
return resultAcceptedOffer;
|
|
212
200
|
});
|
|
@@ -250,7 +238,8 @@ function createReservation(params) {
|
|
|
250
238
|
startDate: moment(event.startDate)
|
|
251
239
|
.toDate(),
|
|
252
240
|
// 最適化(2022-05-31~)
|
|
253
|
-
superEvent: Object.assign(Object.assign({ typeOf: event.superEvent.typeOf, id: event.superEvent.id,
|
|
241
|
+
superEvent: Object.assign(Object.assign(Object.assign({ typeOf: event.superEvent.typeOf, id: event.superEvent.id, location: event.superEvent.location, name: event.superEvent.name, soundFormat: event.superEvent.soundFormat, videoFormat: event.superEvent.videoFormat, workPerformed }, (typeof event.superEvent.duration === 'string') ? { duration: event.superEvent.duration } : undefined), (event.superEvent.headline !== undefined) ? { headline: event.superEvent.headline } : undefined), (settings_1.USE_KANA_NAME_IN_ACCEPTED_OFFER) ? { kanaName: event.superEvent.kanaName } : undefined // オプション化
|
|
242
|
+
)
|
|
254
243
|
};
|
|
255
244
|
if (params.issuedThrough.typeOf !== factory.product.ProductType.EventService) {
|
|
256
245
|
throw new factory.errors.Argument('issuedThrough', `issuedThrough.typeOf must be ${factory.product.ProductType.EventService}`);
|
|
@@ -46,10 +46,9 @@ function importFromCOA(params) {
|
|
|
46
46
|
}
|
|
47
47
|
catch (error) {
|
|
48
48
|
let throwsError = true;
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
// "message": "ESOCKETTIMEDOUT",
|
|
49
|
+
if (error.name === 'AbortError') {
|
|
50
|
+
throwsError = false;
|
|
51
|
+
}
|
|
53
52
|
if (error.name === 'COAServiceError') {
|
|
54
53
|
if (error.message === 'ESOCKETTIMEDOUT') {
|
|
55
54
|
throwsError = false;
|
|
@@ -115,10 +114,9 @@ function importCategoryCodesFromCOA(params) {
|
|
|
115
114
|
}
|
|
116
115
|
catch (error) {
|
|
117
116
|
let throwsError = true;
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
// "message": "ESOCKETTIMEDOUT",
|
|
117
|
+
if (error.name === 'AbortError') {
|
|
118
|
+
throwsError = false;
|
|
119
|
+
}
|
|
122
120
|
if (error.name === 'COAServiceError') {
|
|
123
121
|
if (error.message === 'ESOCKETTIMEDOUT') {
|
|
124
122
|
throwsError = false;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import * as factory from '../../../factory';
|
|
2
2
|
import type { MongoRepository as ActionRepo } from '../../../repo/action';
|
|
3
3
|
import type { MongoRepository as AssetTransactionRepo } from '../../../repo/assetTransaction';
|
|
4
|
+
import type { MongoRepository as OrderInTransactionRepo } from '../../../repo/orderInTransaction';
|
|
4
5
|
import type { RedisRepository as OfferRateLimitRepo } from '../../../repo/rateLimit/offer';
|
|
5
6
|
import type { MongoRepository as ReservationRepo } from '../../../repo/reservation';
|
|
6
7
|
import type { StockHolderRepository as StockHolderRepo } from '../../../repo/stockHolder';
|
|
@@ -12,6 +13,7 @@ interface IVoidTransactionRepos {
|
|
|
12
13
|
assetTransaction: AssetTransactionRepo;
|
|
13
14
|
stockHolder: StockHolderRepo;
|
|
14
15
|
offerRateLimit: OfferRateLimitRepo;
|
|
16
|
+
orderInTransaction: OrderInTransactionRepo;
|
|
15
17
|
reservation: ReservationRepo;
|
|
16
18
|
task: TaskRepo;
|
|
17
19
|
transaction: TransactionRepo;
|