@chevre/domain 24.1.0-alpha.9 → 25.0.0-alpha.0
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/lib/chevre/emailMessageBuilder.d.ts +1 -1
- package/lib/chevre/emailMessageBuilder.js +4 -12
- package/lib/chevre/factory/transaction/placeOrder.d.ts +2 -10
- package/lib/chevre/factory/transaction/placeOrder.js +1 -0
- package/lib/chevre/index.d.ts +1 -2
- package/lib/chevre/index.js +1 -3
- package/lib/chevre/repo/acceptedOffer.d.ts +25 -27
- package/lib/chevre/repo/acceptedOffer.js +102 -67
- package/lib/chevre/repo/acceptedOfferInReserve.d.ts +34 -0
- package/lib/chevre/repo/acceptedOfferInReserve.js +86 -0
- package/lib/chevre/repo/accountingReport.js +2 -30
- package/lib/chevre/repo/action/actionProcess.d.ts +1 -1
- package/lib/chevre/repo/assetTransaction/reserve.d.ts +1 -2
- package/lib/chevre/repo/assetTransaction/reserve.js +4 -50
- package/lib/chevre/repo/event.js +12 -8
- package/lib/chevre/repo/factory/acceptedOffer/reserveTransaction2itemOffered.d.ts +9 -0
- package/lib/chevre/repo/factory/acceptedOffer/reserveTransaction2itemOffered.js +76 -0
- package/lib/chevre/repo/factory/reservation/createMongoConditions.d.ts +1 -1
- package/lib/chevre/repo/factory/reservation/createMongoConditions.js +171 -363
- package/lib/chevre/repo/mongoose/schemas/accountingReport.js +42 -42
- package/lib/chevre/repo/mongoose/schemas/order.js +35 -32
- package/lib/chevre/repo/mongoose/schemas/reservation.d.ts +3 -2
- package/lib/chevre/repo/mongoose/schemas/reservation.js +6 -57
- package/lib/chevre/repo/mongoose/schemas/setting.d.ts +84 -0
- package/lib/chevre/repo/mongoose/schemas/setting.js +2 -1
- package/lib/chevre/repo/order.d.ts +1 -82
- package/lib/chevre/repo/order.js +11 -372
- package/lib/chevre/repo/orderInTransaction.d.ts +58 -7
- package/lib/chevre/repo/orderInTransaction.js +58 -4
- package/lib/chevre/repo/place/hasPOS.js +2 -1
- package/lib/chevre/repo/reservation.d.ts +20 -9
- package/lib/chevre/repo/reservation.js +16 -12
- package/lib/chevre/repo/role.d.ts +1 -15
- package/lib/chevre/repo/role.js +7 -14
- package/lib/chevre/repo/setting/integration.d.ts +27 -0
- package/lib/chevre/repo/setting/integration.js +102 -0
- package/lib/chevre/repo/transaction/placeOrder.d.ts +8 -3
- package/lib/chevre/repo/transaction/placeOrder.js +5 -1
- package/lib/chevre/repo/transaction.d.ts +6 -6
- package/lib/chevre/repo/transaction.js +0 -776
- package/lib/chevre/repository.d.ts +5 -0
- package/lib/chevre/repository.js +11 -0
- package/lib/chevre/service/aggregation/event/aggregateOffers.js +6 -1
- package/lib/chevre/service/aggregation/event/aggregateScreeningEvent.js +0 -1
- package/lib/chevre/service/assetTransaction/cancelReservation/factory.js +14 -11
- package/lib/chevre/service/assetTransaction/cancelReservation/start.d.ts +1 -1
- package/lib/chevre/service/assetTransaction/cancelReservation/start.js +1 -1
- package/lib/chevre/service/assetTransaction/pay/check.d.ts +1 -1
- package/lib/chevre/service/assetTransaction/pay/publishPaymentUrl.d.ts +1 -1
- package/lib/chevre/service/assetTransaction/pay/searchGMOTrade.d.ts +1 -1
- package/lib/chevre/service/assetTransaction/pay/start/processAuthorize.d.ts +1 -1
- package/lib/chevre/service/assetTransaction/pay/start/processAuthorizeCreditCard.d.ts +1 -1
- package/lib/chevre/service/assetTransaction/pay/start/processAuthorizeMovieTicket.d.ts +1 -1
- package/lib/chevre/service/assetTransaction/pay/start.d.ts +1 -1
- package/lib/chevre/service/assetTransaction/reserve/cancel.d.ts +1 -1
- package/lib/chevre/service/assetTransaction/reserve/confirm.d.ts +1 -1
- package/lib/chevre/service/assetTransaction/reserve/start/createSubReservations.js +2 -2
- package/lib/chevre/service/assetTransaction/reserve/start/factory/createReservation.d.ts +1 -8
- package/lib/chevre/service/assetTransaction/reserve/start/factory/createReservation.js +20 -32
- package/lib/chevre/service/assetTransaction/reserve/start/factory/price.d.ts +1 -1
- package/lib/chevre/service/assetTransaction/reserve/start.d.ts +1 -1
- package/lib/chevre/service/delivery/factory.d.ts +6 -1
- package/lib/chevre/service/delivery/factory.js +1 -1
- package/lib/chevre/service/delivery/reservation/factory.d.ts +1 -3
- package/lib/chevre/service/delivery/reservation/factory.js +0 -17
- package/lib/chevre/service/notification/notifyAbortedTasksByEmail.d.ts +2 -4
- package/lib/chevre/service/notification/notifyAbortedTasksByEmail.js +3 -3
- package/lib/chevre/service/notification/notifyByEmail.d.ts +3 -3
- package/lib/chevre/service/notification/notifyByEmail.js +7 -12
- package/lib/chevre/service/notification/sendEmailMessage.d.ts +2 -3
- package/lib/chevre/service/notification/sendEmailMessage.js +5 -4
- package/lib/chevre/service/offer/any.d.ts +7 -2
- package/lib/chevre/service/offer/event/authorize/factory.d.ts +6 -3
- package/lib/chevre/service/offer/event/authorize/factory.js +17 -18
- package/lib/chevre/service/offer/event/authorize/processStartReserve4chevre.d.ts +1 -1
- package/lib/chevre/service/offer/event/authorize.d.ts +2 -2
- package/lib/chevre/service/offer/event/authorize.js +55 -107
- package/lib/chevre/service/offer/event/voidTransaction/processVoidTransaction4chevre.d.ts +1 -1
- package/lib/chevre/service/offer/event/voidTransaction.d.ts +1 -1
- package/lib/chevre/service/offer/event/voidTransactionByActionId.d.ts +1 -1
- package/lib/chevre/service/offer/eventServiceByCOA/authorize/factory.d.ts +1 -3
- package/lib/chevre/service/order/deleteOrder.d.ts +1 -1
- package/lib/chevre/service/order/deleteOrder.js +19 -46
- package/lib/chevre/service/order/{findPlaceOrderTransaction.d.ts → findConfirmedPlaceOrder.d.ts} +1 -1
- package/lib/chevre/service/order/{findPlaceOrderTransaction.js → findConfirmedPlaceOrder.js} +12 -7
- package/lib/chevre/service/order/onAssetTransactionStatusChanged/onPayTransactionCanceled.js +2 -2
- package/lib/chevre/service/order/onAssetTransactionStatusChanged/onPayTransactionConfirmed.d.ts +1 -1
- package/lib/chevre/service/order/onAssetTransactionStatusChanged/onReserveTransactionConfirmed.d.ts +1 -1
- package/lib/chevre/service/order/onAssetTransactionStatusChanged/paymentDue2Processing.d.ts +1 -1
- package/lib/chevre/service/order/onAssetTransactionStatusChanged/paymentDue2Processing.js +11 -18
- package/lib/chevre/service/order/onAssetTransactionStatusChanged/processing2inTransit.d.ts +1 -1
- package/lib/chevre/service/order/onAssetTransactionStatusChanged.d.ts +1 -1
- package/lib/chevre/service/order/onOrderStatusChanged/onOrderDelivered.js +0 -1
- package/lib/chevre/service/order/onOrderStatusChanged/onOrderDeliveredPartially/factory.d.ts +6 -1
- package/lib/chevre/service/order/onOrderStatusChanged/onOrderDeliveredPartially.js +0 -1
- package/lib/chevre/service/order/onOrderStatusChanged/onOrderInTransit.d.ts +1 -1
- package/lib/chevre/service/order/onOrderStatusChanged/onOrderInTransit.js +1 -1
- package/lib/chevre/service/order/onOrderStatusChanged/onOrderProcessing.d.ts +1 -1
- package/lib/chevre/service/order/onOrderStatusChanged/onOrderProcessing.js +2 -1
- package/lib/chevre/service/order/onOrderStatusChanged/onOrderReturned.js +0 -1
- package/lib/chevre/service/order/onOrderUpdated.js +0 -1
- package/lib/chevre/service/order/payOrder.d.ts +1 -1
- package/lib/chevre/service/order/placeOrder/createPlacingOrderFromExistingTransaction.d.ts +1 -1
- package/lib/chevre/service/order/placeOrder/createPlacingOrderFromExistingTransaction.js +19 -7
- package/lib/chevre/service/order/placeOrder/factory/orderedItem.d.ts +1 -1
- package/lib/chevre/service/order/placeOrder/factory/orderedItem.js +0 -5
- package/lib/chevre/service/order/placeOrder/factory.d.ts +1 -1
- package/lib/chevre/service/order/placeOrder/factory.js +33 -22
- package/lib/chevre/service/order/placeOrder.d.ts +3 -2
- package/lib/chevre/service/order/placeOrder.js +0 -9
- package/lib/chevre/service/order/returnOrder.js +0 -1
- package/lib/chevre/service/order/sendOrder.js +1 -7
- package/lib/chevre/service/payment/any/authorize.d.ts +1 -1
- package/lib/chevre/service/payment/any/factory.js +7 -6
- package/lib/chevre/service/payment/any/person2username.js +0 -1
- package/lib/chevre/service/payment/any/publishPaymentUrl.d.ts +1 -1
- package/lib/chevre/service/payment/creditCard/authorize.d.ts +1 -1
- package/lib/chevre/service/payment/creditCard/authorize.js +4 -3
- package/lib/chevre/service/payment/creditCard/payCreditCard.d.ts +1 -1
- package/lib/chevre/service/payment/creditCard/payCreditCard.js +1 -1
- package/lib/chevre/service/payment/creditCard/refundCreditCard.d.ts +1 -1
- package/lib/chevre/service/payment/creditCard/refundCreditCard.js +1 -1
- package/lib/chevre/service/payment/creditCard/searchGMOTrade.d.ts +1 -1
- package/lib/chevre/service/payment/creditCard/searchGMOTrade.js +1 -1
- package/lib/chevre/service/payment/creditCard/voidTransaction.d.ts +1 -1
- package/lib/chevre/service/payment/creditCard/voidTransaction.js +1 -1
- package/lib/chevre/service/payment/factory/createPayObjectServiceOutput.d.ts +8 -1
- package/lib/chevre/service/payment/factory/createPayObjectServiceOutput.js +1 -1
- package/lib/chevre/service/payment/movieTicket/authorize.d.ts +1 -1
- package/lib/chevre/service/payment/movieTicket/checkMovieTicket.d.ts +1 -1
- package/lib/chevre/service/payment/movieTicket/payMovieTicket.d.ts +1 -1
- package/lib/chevre/service/payment/movieTicket/payMovieTicket.js +1 -1
- package/lib/chevre/service/payment/movieTicket/processPurchaseNumberAuth.d.ts +1 -1
- package/lib/chevre/service/payment/movieTicket/processPurchaseNumberAuth.js +1 -1
- package/lib/chevre/service/payment/movieTicket/refundMovieTicket.d.ts +1 -1
- package/lib/chevre/service/payment/movieTicket/refundMovieTicket.js +2 -2
- package/lib/chevre/service/payment/movieTicket/voidTransaction.d.ts +1 -1
- package/lib/chevre/service/reserve/confirmReservation.js +7 -7
- package/lib/chevre/service/reserve/factory.js +2 -1
- package/lib/chevre/service/reserve/findByCode.d.ts +1 -1
- package/lib/chevre/service/reserve/findByCode.js +1 -1
- package/lib/chevre/service/reserve/findReservations.d.ts +14 -6
- package/lib/chevre/service/reserve/findReservations.js +26 -36
- package/lib/chevre/service/reserve/potentialActions/onPendingReservationCanceled.js +0 -1
- package/lib/chevre/service/reserve/potentialActions/onReservationCanceled.js +0 -1
- package/lib/chevre/service/reserve/potentialActions/onReservationConfirmed.d.ts +4 -3
- package/lib/chevre/service/reserve/potentialActions/onReservationConfirmed.js +1 -10
- package/lib/chevre/service/reserve/potentialActions/onReservationUsed.js +0 -1
- package/lib/chevre/service/reserve/potentialActions/onReservationsCreated.js +0 -1
- package/lib/chevre/service/reserve/searchByOrder.js +7 -3
- package/lib/chevre/service/task/acceptCOAOffer.js +6 -3
- package/lib/chevre/service/task/authorizePayment.js +4 -2
- package/lib/chevre/service/task/cancelPendingReservation.js +4 -2
- package/lib/chevre/service/task/checkMovieTicket.js +4 -2
- package/lib/chevre/service/task/confirmReserveTransaction.d.ts +1 -1
- package/lib/chevre/service/task/confirmReserveTransaction.js +5 -3
- package/lib/chevre/service/task/createAccountingReport.js +0 -4
- package/lib/chevre/service/task/importEventCapacitiesFromCOA.js +4 -2
- package/lib/chevre/service/task/importEventsFromCOA.js +4 -2
- package/lib/chevre/service/task/importOffersFromCOA.js +4 -2
- package/lib/chevre/service/task/invalidatePaymentUrl.js +3 -1
- package/lib/chevre/service/task/onAssetTransactionStatusChanged.js +3 -1
- package/lib/chevre/service/task/onOrderPaymentCompleted.js +3 -1
- package/lib/chevre/service/task/onResourceUpdated/onHasPOSUpdated.js +0 -1
- package/lib/chevre/service/task/pay.js +4 -2
- package/lib/chevre/service/task/payment/invalidatePaymentUrlByTask.d.ts +1 -1
- package/lib/chevre/service/task/payment/payByTask.d.ts +1 -1
- package/lib/chevre/service/task/payment/payByTask.js +6 -7
- package/lib/chevre/service/task/payment/refundByTask.d.ts +1 -1
- package/lib/chevre/service/task/payment/voidPaymentByTask.d.ts +1 -1
- package/lib/chevre/service/task/placeOrder.js +3 -1
- package/lib/chevre/service/task/publishPaymentUrl.js +3 -1
- package/lib/chevre/service/task/refund.js +4 -2
- package/lib/chevre/service/task/returnReserveTransaction.js +4 -2
- package/lib/chevre/service/task/sendEmailMessage.js +5 -3
- package/lib/chevre/service/task/syncResourcesFromCOA.js +4 -2
- package/lib/chevre/service/task/voidPayment.js +4 -2
- package/lib/chevre/service/task/voidReserveTransaction.js +4 -2
- package/lib/chevre/service/task.d.ts +0 -7
- package/lib/chevre/service/transaction/deleteTransaction.js +13 -7
- package/lib/chevre/service/transaction/placeOrder/confirm/factory/result.d.ts +0 -1
- package/lib/chevre/service/transaction/placeOrder/confirm/factory/result.js +7 -17
- package/lib/chevre/service/transaction/placeOrder/confirm/potentialActions/sendEmailMessage.d.ts +7 -1
- package/lib/chevre/service/transaction/placeOrder/confirm/potentialActions/sendEmailMessage.js +0 -1
- package/lib/chevre/service/transaction/placeOrder/confirm/potentialActions.d.ts +7 -1
- package/lib/chevre/service/transaction/placeOrder/confirm/potentialActions.js +0 -1
- package/lib/chevre/service/transaction/placeOrder/confirm/validation/validateInvoiceReferencesOrder.d.ts +1 -1
- package/lib/chevre/service/transaction/placeOrder/confirm/validation/validateMovieTicket.d.ts +1 -1
- package/lib/chevre/service/transaction/placeOrder/confirm/validation.d.ts +5 -4
- package/lib/chevre/service/transaction/placeOrder/confirm.d.ts +5 -4
- package/lib/chevre/service/transaction/placeOrder/confirm.js +55 -58
- package/lib/chevre/service/transaction/placeOrder/exportTasksById.js +0 -1
- package/lib/chevre/service/transaction/placeOrder/start/factory.d.ts +11 -2
- package/lib/chevre/service/transaction/placeOrder/start/factory.js +12 -10
- package/lib/chevre/service/transaction/placeOrder/start/validateStartRequest.d.ts +1 -2
- package/lib/chevre/service/transaction/placeOrder/start/validateStartRequest.js +5 -16
- package/lib/chevre/service/transaction/placeOrder/start.d.ts +3 -4
- package/lib/chevre/service/transaction/placeOrder/start.js +2 -2
- package/lib/chevre/service/transaction/placeOrder/updateAgent.js +0 -1
- package/lib/chevre/service/transaction/placeOrder.d.ts +2 -2
- package/lib/chevre/service/transaction/returnOrder/exportTasks/factory.js +0 -1
- package/lib/chevre/service/transaction/returnOrder/potentialActions/returnPaymentMethod.d.ts +1 -1
- package/lib/chevre/service/transaction/returnOrder/potentialActions/returnPaymentMethod.js +0 -1
- package/lib/chevre/service/transaction/returnOrder/potentialActions/sendEmailMessage.d.ts +1 -1
- package/lib/chevre/service/transaction/returnOrder/potentialActions.d.ts +1 -1
- package/lib/chevre/service/transaction/returnOrder/potentialActions.js +0 -1
- package/lib/chevre/service/transaction/returnOrder/preStart.js +1 -4
- package/lib/chevre/service/transaction/returnOrder.js +1 -1
- package/lib/chevre/service/transaction.js +3 -5
- package/lib/chevre/service/validation/validateOrder.js +4 -79
- package/lib/chevre/settings.d.ts +0 -55
- package/lib/chevre/settings.js +1 -29
- package/lib/chevre/taskSettings.d.ts +0 -22
- package/lib/chevre/taskSettings.js +1 -7
- package/package.json +2 -2
- package/lib/chevre/credentials/customSearch.d.ts +0 -13
- package/lib/chevre/credentials/customSearch.js +0 -16
- package/lib/chevre/credentials/lineNotify.d.ts +0 -17
- package/lib/chevre/credentials/lineNotify.js +0 -20
- package/lib/chevre/credentials/sendGrid.d.ts +0 -24
- package/lib/chevre/credentials/sendGrid.js +0 -18
- package/lib/chevre/credentials.d.ts +0 -20
- package/lib/chevre/credentials.js +0 -42
|
@@ -17,6 +17,7 @@ const order_1 = require("../../repo/order");
|
|
|
17
17
|
const reservation_1 = require("../../repo/reservation");
|
|
18
18
|
const reserveInterface_1 = require("../../repo/reserveInterface");
|
|
19
19
|
const setting_1 = require("../../repo/setting");
|
|
20
|
+
const integration_1 = require("../../repo/setting/integration");
|
|
20
21
|
const task_1 = require("../../repo/task");
|
|
21
22
|
let coaAuthClientCreated = false;
|
|
22
23
|
let coaAuthClient = new coa_service_1.COA.auth.RefreshToken({
|
|
@@ -28,7 +29,8 @@ let coaAuthClient = new coa_service_1.COA.auth.RefreshToken({
|
|
|
28
29
|
* タスク実行関数
|
|
29
30
|
*/
|
|
30
31
|
function call(params) {
|
|
31
|
-
return async ({ connection
|
|
32
|
+
return async ({ connection }) => {
|
|
33
|
+
const settings = new integration_1.IntegrationSettingRepo({ connection });
|
|
32
34
|
if (!coaAuthClientCreated) {
|
|
33
35
|
const reserveInterfaceRepo = new reserveInterface_1.ReserveInterfaceRepo(connection);
|
|
34
36
|
const coaAPI = await reserveInterfaceRepo.findOne({ project: { id: { $eq: params.project.id } } });
|
|
@@ -41,7 +43,7 @@ function call(params) {
|
|
|
41
43
|
const reserveService = new coa_service_1.COA.service.Reserve({
|
|
42
44
|
endpoint: coaAuthClient.options.endpoint, // same as authClient(2024-07-17~)
|
|
43
45
|
auth: coaAuthClient
|
|
44
|
-
}, { timeout: settings.coa.
|
|
46
|
+
}, { timeout: (await settings.getByKey('coa')).timeoutReserve });
|
|
45
47
|
await confirmReserveTransaction({
|
|
46
48
|
...params.data,
|
|
47
49
|
project: params.project,
|
|
@@ -137,7 +139,7 @@ function fixOrderAsPurpose(params) {
|
|
|
137
139
|
const acceptedOffers = await repos.acceptedOffer.searchAcceptedOffersByOrderNumber({
|
|
138
140
|
orderNumber: { $eq: order.orderNumber },
|
|
139
141
|
project: { id: { $eq: params.project.id } }
|
|
140
|
-
},
|
|
142
|
+
}, { noName: true });
|
|
141
143
|
return {
|
|
142
144
|
...order,
|
|
143
145
|
acceptedOffers
|
|
@@ -53,10 +53,6 @@ function createAccountingReport(params) {
|
|
|
53
53
|
};
|
|
54
54
|
const action = await repos.action.start(actionAttributes);
|
|
55
55
|
try {
|
|
56
|
-
// const acceptedOffers = await repos.acceptedOffer.searchAcceptedOffersByOrderNumber({
|
|
57
|
-
// orderNumber: { $eq: data.object.mainEntity.orderNumber },
|
|
58
|
-
// project: { id: { $eq: params.project.id } }
|
|
59
|
-
// });
|
|
60
56
|
await (0, createAccountingReportIfNotExist_1.createAccountingReportIfNotExist)({
|
|
61
57
|
...order,
|
|
62
58
|
// acceptedOffers
|
|
@@ -37,6 +37,7 @@ exports.call = call;
|
|
|
37
37
|
const coa_service_1 = require("@motionpicture/coa-service");
|
|
38
38
|
const event_1 = require("../../repo/event");
|
|
39
39
|
const reserveInterface_1 = require("../../repo/reserveInterface");
|
|
40
|
+
const integration_1 = require("../../repo/setting/integration");
|
|
40
41
|
const factory_1 = require("../../factory");
|
|
41
42
|
const EventAggregationService = __importStar(require("../aggregation/event"));
|
|
42
43
|
let coaAuthClient;
|
|
@@ -44,7 +45,7 @@ let coaAuthClient;
|
|
|
44
45
|
* タスク実行関数
|
|
45
46
|
*/
|
|
46
47
|
function call(params) {
|
|
47
|
-
return async ({ connection
|
|
48
|
+
return async ({ connection }) => {
|
|
48
49
|
if (coaAuthClient === undefined) {
|
|
49
50
|
const reserveInterfaceRepo = new reserveInterface_1.ReserveInterfaceRepo(connection);
|
|
50
51
|
const coaAPI = await reserveInterfaceRepo.findOne({ project: { id: { $eq: params.project.id } } });
|
|
@@ -54,10 +55,11 @@ function call(params) {
|
|
|
54
55
|
}
|
|
55
56
|
coaAuthClient = new coa_service_1.COA.auth.RefreshToken(credentials);
|
|
56
57
|
}
|
|
58
|
+
const settings = new integration_1.IntegrationSettingRepo({ connection });
|
|
57
59
|
const reserveService = new coa_service_1.COA.service.Reserve({
|
|
58
60
|
endpoint: coaAuthClient.options.endpoint, // same as authClient(2024-07-17~)
|
|
59
61
|
auth: coaAuthClient
|
|
60
|
-
}, { timeout: settings.coa.
|
|
62
|
+
}, { timeout: (await settings.getByKey('coa')).timeoutReserve });
|
|
61
63
|
await EventAggregationService.importFromCOA(params.data)({
|
|
62
64
|
event: new event_1.EventRepo(connection),
|
|
63
65
|
reserveService
|
|
@@ -44,6 +44,7 @@ const movieTheater_1 = require("../../repo/place/movieTheater");
|
|
|
44
44
|
const screeningRoom_1 = require("../../repo/place/screeningRoom");
|
|
45
45
|
const reserveInterface_1 = require("../../repo/reserveInterface");
|
|
46
46
|
const seller_1 = require("../../repo/seller");
|
|
47
|
+
const integration_1 = require("../../repo/setting/integration");
|
|
47
48
|
const factory_1 = require("../../factory");
|
|
48
49
|
const EventService = __importStar(require("../event"));
|
|
49
50
|
let coaAuthClient;
|
|
@@ -51,7 +52,7 @@ let coaAuthClient;
|
|
|
51
52
|
* タスク実行関数
|
|
52
53
|
*/
|
|
53
54
|
function call(params) {
|
|
54
|
-
return async ({ connection
|
|
55
|
+
return async ({ connection }) => {
|
|
55
56
|
if (coaAuthClient === undefined) {
|
|
56
57
|
const reserveInterfaceRepo = new reserveInterface_1.ReserveInterfaceRepo(connection);
|
|
57
58
|
const coaAPI = await reserveInterfaceRepo.findOne({ project: { id: { $eq: params.project.id } } });
|
|
@@ -61,10 +62,11 @@ function call(params) {
|
|
|
61
62
|
}
|
|
62
63
|
coaAuthClient = new coa_service_1.COA.auth.RefreshToken(credentials);
|
|
63
64
|
}
|
|
65
|
+
const settings = new integration_1.IntegrationSettingRepo({ connection });
|
|
64
66
|
const masterService = new coa_service_1.COA.service.Master({
|
|
65
67
|
endpoint: coaAuthClient.options.endpoint, // same as authClient(2024-07-17~)
|
|
66
68
|
auth: coaAuthClient
|
|
67
|
-
}, { timeout: settings.coa.
|
|
69
|
+
}, { timeout: (await settings.getByKey('coa')).timeoutMaster });
|
|
68
70
|
await EventService.importFromCOA(params.data)({
|
|
69
71
|
action: new action_1.ActionRepo(connection),
|
|
70
72
|
categoryCode: new categoryCode_1.CategoryCodeRepo(connection),
|
|
@@ -38,6 +38,7 @@ const coa_service_1 = require("@motionpicture/coa-service");
|
|
|
38
38
|
const aggregateOffer_1 = require("../../repo/aggregateOffer");
|
|
39
39
|
const categoryCode_1 = require("../../repo/categoryCode");
|
|
40
40
|
const reserveInterface_1 = require("../../repo/reserveInterface");
|
|
41
|
+
const integration_1 = require("../../repo/setting/integration");
|
|
41
42
|
const factory_1 = require("../../factory");
|
|
42
43
|
const OfferService = __importStar(require("../offer"));
|
|
43
44
|
let coaAuthClient;
|
|
@@ -46,7 +47,7 @@ let paymentMethodType4membershipCoupon;
|
|
|
46
47
|
* タスク実行関数
|
|
47
48
|
*/
|
|
48
49
|
function call(params) {
|
|
49
|
-
return async ({ connection
|
|
50
|
+
return async ({ connection }) => {
|
|
50
51
|
if (coaAuthClient === undefined || paymentMethodType4membershipCoupon === undefined) {
|
|
51
52
|
const reserveInterfaceRepo = new reserveInterface_1.ReserveInterfaceRepo(connection);
|
|
52
53
|
const coaAPI = await reserveInterfaceRepo.findOne({ project: { id: { $eq: params.project.id } } });
|
|
@@ -61,13 +62,14 @@ function call(params) {
|
|
|
61
62
|
}
|
|
62
63
|
paymentMethodType4membershipCoupon = paymentMethodType4membershipCouponByInterface;
|
|
63
64
|
}
|
|
65
|
+
const settings = new integration_1.IntegrationSettingRepo({ connection });
|
|
64
66
|
const aggregateOfferRepo = new aggregateOffer_1.AggregateOfferRepo(connection);
|
|
65
67
|
const categoryCodeRepo = new categoryCode_1.CategoryCodeRepo(connection);
|
|
66
68
|
// const taskRepo = new TaskRepo(connection);
|
|
67
69
|
const masterService = new coa_service_1.COA.service.Master({
|
|
68
70
|
endpoint: coaAuthClient.options.endpoint, // same as authClient(2024-07-17~)
|
|
69
71
|
auth: coaAuthClient
|
|
70
|
-
}, { timeout: settings.coa.
|
|
72
|
+
}, { timeout: (await settings.getByKey('coa')).timeoutMaster });
|
|
71
73
|
await OfferService.event.importFromCOA({
|
|
72
74
|
project: { id: params.data.project.id },
|
|
73
75
|
theaterCode: params.data.theaterCode,
|
|
@@ -9,10 +9,12 @@ const assetTransaction_1 = require("../../repo/assetTransaction");
|
|
|
9
9
|
const paymentService_1 = require("../../repo/paymentService");
|
|
10
10
|
const paymentServiceProvider_1 = require("../../repo/paymentServiceProvider");
|
|
11
11
|
const sellerPaymentAccepted_1 = require("../../repo/sellerPaymentAccepted");
|
|
12
|
+
const integration_1 = require("../../repo/setting/integration");
|
|
12
13
|
const task_1 = require("../../repo/task");
|
|
13
14
|
const invalidatePaymentUrlByTask_1 = require("./payment/invalidatePaymentUrlByTask");
|
|
14
15
|
function call(params) {
|
|
15
|
-
return async ({ connection
|
|
16
|
+
return async ({ connection }) => {
|
|
17
|
+
const settings = new integration_1.IntegrationSettingRepo({ connection });
|
|
16
18
|
await (0, invalidatePaymentUrlByTask_1.invalidatePaymentUrlByTask)({
|
|
17
19
|
...params.data,
|
|
18
20
|
sameAs: { id: params.id }
|
|
@@ -5,6 +5,7 @@ const acceptedOffer_1 = require("../../repo/acceptedOffer");
|
|
|
5
5
|
const assetTransaction_1 = require("../../repo/assetTransaction");
|
|
6
6
|
const order_1 = require("../../repo/order");
|
|
7
7
|
const setting_1 = require("../../repo/setting");
|
|
8
|
+
const integration_1 = require("../../repo/setting/integration");
|
|
8
9
|
const task_1 = require("../../repo/task");
|
|
9
10
|
// import { TransactionRepo } from '../../repo/transaction';
|
|
10
11
|
const placeOrder_1 = require("../../repo/transaction/placeOrder");
|
|
@@ -13,7 +14,8 @@ const onAssetTransactionStatusChanged_1 = require("../order/onAssetTransactionSt
|
|
|
13
14
|
* タスク実行関数
|
|
14
15
|
*/
|
|
15
16
|
function call(data) {
|
|
16
|
-
return async ({ connection
|
|
17
|
+
return async ({ connection }) => {
|
|
18
|
+
const settings = new integration_1.IntegrationSettingRepo({ connection });
|
|
17
19
|
await (0, onAssetTransactionStatusChanged_1.onAssetTransactionStatusChanged)(data)({
|
|
18
20
|
acceptedOffer: new acceptedOffer_1.AcceptedOfferRepo(connection),
|
|
19
21
|
assetTransaction: new assetTransaction_1.AssetTransactionRepo(connection),
|
|
@@ -4,6 +4,7 @@ exports.call = call;
|
|
|
4
4
|
const acceptedOffer_1 = require("../../repo/acceptedOffer");
|
|
5
5
|
const order_1 = require("../../repo/order");
|
|
6
6
|
const setting_1 = require("../../repo/setting");
|
|
7
|
+
const integration_1 = require("../../repo/setting/integration");
|
|
7
8
|
const task_1 = require("../../repo/task");
|
|
8
9
|
const placeOrder_1 = require("../../repo/transaction/placeOrder");
|
|
9
10
|
const payOrder_1 = require("../order/payOrder");
|
|
@@ -11,7 +12,8 @@ const payOrder_1 = require("../order/payOrder");
|
|
|
11
12
|
* タスク実行関数
|
|
12
13
|
*/
|
|
13
14
|
function call(data) {
|
|
14
|
-
return async ({ connection
|
|
15
|
+
return async ({ connection }) => {
|
|
16
|
+
const settings = new integration_1.IntegrationSettingRepo({ connection });
|
|
15
17
|
await (0, payOrder_1.payOrder)(data)({
|
|
16
18
|
acceptedOffer: new acceptedOffer_1.AcceptedOfferRepo(connection),
|
|
17
19
|
order: new order_1.OrderRepo(connection),
|
|
@@ -2,7 +2,6 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.createInformHasPOSTasks = createInformHasPOSTasks;
|
|
4
4
|
const factory_1 = require("../../../factory");
|
|
5
|
-
// import { Settings } from '../../../settings';
|
|
6
5
|
function createInformHasPOSTasks(params) {
|
|
7
6
|
return async (repos
|
|
8
7
|
// settings: Settings
|
|
@@ -17,16 +17,18 @@ const paymentServiceProvider_1 = require("../../repo/paymentServiceProvider");
|
|
|
17
17
|
const product_1 = require("../../repo/product");
|
|
18
18
|
const project_1 = require("../../repo/project");
|
|
19
19
|
const sellerPaymentAccepted_1 = require("../../repo/sellerPaymentAccepted");
|
|
20
|
+
const integration_1 = require("../../repo/setting/integration");
|
|
20
21
|
const task_1 = require("../../repo/task");
|
|
21
22
|
const payByTask_1 = require("./payment/payByTask");
|
|
22
23
|
/**
|
|
23
24
|
* タスク実行関数
|
|
24
25
|
*/
|
|
25
26
|
function call(params) {
|
|
26
|
-
return async ({ connection, redisClient
|
|
27
|
+
return async ({ connection, redisClient }) => {
|
|
27
28
|
if (redisClient === undefined) {
|
|
28
29
|
throw new factory_1.factory.errors.Argument('settings', 'redisClient required');
|
|
29
30
|
}
|
|
31
|
+
const settings = new integration_1.IntegrationSettingRepo({ connection });
|
|
30
32
|
const payActionAttributes = await (0, payByTask_1.payTask2payActionAttributes)({
|
|
31
33
|
...params.data,
|
|
32
34
|
sameAs: { id: params.id, typeOf: 'Task' } // タスクIDを関連付け(2024-04-20~)
|
|
@@ -38,7 +40,7 @@ function call(params) {
|
|
|
38
40
|
order: new order_1.OrderRepo(connection)
|
|
39
41
|
});
|
|
40
42
|
const paymentServiceId = payActionAttributes.object.at(0)?.id;
|
|
41
|
-
const credentialsExpireInSeconds = settings.movieticketReserve.credentialsExpireInSeconds;
|
|
43
|
+
const credentialsExpireInSeconds = (await settings.getByKey('movieticketReserve')).credentialsExpireInSeconds;
|
|
42
44
|
const useCredentialsRepo = typeof paymentServiceId === 'string' && paymentServiceId !== ''
|
|
43
45
|
&& typeof credentialsExpireInSeconds === 'number' && credentialsExpireInSeconds > 0;
|
|
44
46
|
await (0, payByTask_1.payByTask)(
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { factory } from '../../../factory';
|
|
2
|
-
import { Settings } from '../../../
|
|
2
|
+
import type { IntegrationSettingRepo as Settings } from '../../../repo/setting/integration';
|
|
3
3
|
import type { AccountingReportRepo } from '../../../repo/accountingReport';
|
|
4
4
|
import type { PayActionRepo } from '../../../repo/action/pay';
|
|
5
5
|
import type { RefundActionRepo } from '../../../repo/action/refund';
|
|
@@ -14,7 +14,7 @@ import type { ProjectRepo } from '../../../repo/project';
|
|
|
14
14
|
import type { SellerPaymentAcceptedRepo } from '../../../repo/sellerPaymentAccepted';
|
|
15
15
|
import type { TaskRepo } from '../../../repo/task';
|
|
16
16
|
import { factory } from '../../../factory';
|
|
17
|
-
import { Settings } from '../../../
|
|
17
|
+
import type { IntegrationSettingRepo as Settings } from '../../../repo/setting/integration';
|
|
18
18
|
interface IPayTask2payActionAttributesRepos {
|
|
19
19
|
checkMovieTicketAction: CheckMovieTicketActionRepo;
|
|
20
20
|
acceptedOffer: AcceptedOfferRepo;
|
|
@@ -64,20 +64,19 @@ function fixOrderAsPurpose(params, transaction) {
|
|
|
64
64
|
let acceptedOffersMovieTicketUsed = [];
|
|
65
65
|
const movieTickets = transaction.object.paymentMethod.movieTickets;
|
|
66
66
|
if (Array.isArray(movieTickets) && movieTickets.length > 0) {
|
|
67
|
-
const reservationForId = movieTickets[0].serviceOutput.reservationFor.id; // イベントIDは決済取引ごとにひとつのみ許可なので、これで問題ない
|
|
68
|
-
const seatNumbers = movieTickets.map(({ serviceOutput }) => serviceOutput.reservedTicket.ticketedSeat.seatNumber);
|
|
67
|
+
// const reservationForId = movieTickets[0].serviceOutput.reservationFor.id; // イベントIDは決済取引ごとにひとつのみ許可なので、これで問題ない
|
|
68
|
+
// const seatNumbers = movieTickets.map(({ serviceOutput }) => serviceOutput.reservedTicket.ticketedSeat.seatNumber);
|
|
69
69
|
acceptedOffersMovieTicketUsed = await repos.acceptedOffer.searchAcceptedOffersByOrderNumber({
|
|
70
70
|
orderNumber: { $eq: orderWithoutAcceptedOffers.orderNumber },
|
|
71
71
|
project: { id: { $eq: transaction.project.id } },
|
|
72
72
|
acceptedOffers: {
|
|
73
73
|
itemOffered: {
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
reservedTicket: { ticketedSeat: { seatNumber: { $in: seatNumbers } } }
|
|
74
|
+
// movieTicketsに結合されたイベントID,座席コードで絞る
|
|
75
|
+
// reservationFor: { id: { $in: [reservationForId] } }, // reservationForによる絞りは廃止(2026-06-04~)
|
|
76
|
+
// reservedTicket: { ticketedSeat: { seatNumber: { $in: seatNumbers } } } // 座席番号による絞りは廃止(2026-06-01~)
|
|
78
77
|
}
|
|
79
78
|
}
|
|
80
|
-
},
|
|
79
|
+
}, { noName: true });
|
|
81
80
|
}
|
|
82
81
|
return {
|
|
83
82
|
...orderWithoutAcceptedOffers,
|
|
@@ -11,7 +11,7 @@ import type { SellerPaymentAcceptedRepo } from '../../../repo/sellerPaymentAccep
|
|
|
11
11
|
import type { TaskRepo } from '../../../repo/task';
|
|
12
12
|
import type { TransactionNumberRepo } from '../../../repo/transactionNumber';
|
|
13
13
|
import { factory } from '../../../factory';
|
|
14
|
-
import { Settings } from '../../../
|
|
14
|
+
import type { IntegrationSettingRepo as Settings } from '../../../repo/setting/integration';
|
|
15
15
|
declare function refundByTask(params: factory.task.refund.IData & {
|
|
16
16
|
sameAs?: {
|
|
17
17
|
id: string;
|
|
@@ -11,7 +11,7 @@ import type { ProjectRepo } from '../../../repo/project';
|
|
|
11
11
|
import type { SellerPaymentAcceptedRepo } from '../../../repo/sellerPaymentAccepted';
|
|
12
12
|
import type { TaskRepo } from '../../../repo/task';
|
|
13
13
|
import { factory } from '../../../factory';
|
|
14
|
-
import { Settings } from '../../../
|
|
14
|
+
import type { IntegrationSettingRepo as Settings } from '../../../repo/setting/integration';
|
|
15
15
|
declare function voidPaymentByTask(params: factory.task.voidPayment.IData): (repos: {
|
|
16
16
|
action: ActionRepo;
|
|
17
17
|
actions: {
|
|
@@ -9,6 +9,7 @@ const authorizePaymentMethod_1 = require("../../repo/action/authorizePaymentMeth
|
|
|
9
9
|
const order_1 = require("../../repo/order");
|
|
10
10
|
const orderInTransaction_1 = require("../../repo/orderInTransaction");
|
|
11
11
|
const setting_1 = require("../../repo/setting");
|
|
12
|
+
const integration_1 = require("../../repo/setting/integration");
|
|
12
13
|
const task_1 = require("../../repo/task");
|
|
13
14
|
// import { TransactionRepo } from '../../repo/transaction';
|
|
14
15
|
const placeOrder_1 = require("../../repo/transaction/placeOrder");
|
|
@@ -17,7 +18,8 @@ const placeOrder_2 = require("../order/placeOrder");
|
|
|
17
18
|
* タスク実行関数
|
|
18
19
|
*/
|
|
19
20
|
function call(data) {
|
|
20
|
-
return async ({ connection
|
|
21
|
+
return async ({ connection }) => {
|
|
22
|
+
const settings = new integration_1.IntegrationSettingRepo({ connection });
|
|
21
23
|
await (0, placeOrder_2.placeOrder)({
|
|
22
24
|
...data,
|
|
23
25
|
useOnOrderStatusChanged: true
|
|
@@ -15,6 +15,7 @@ const paymentService_1 = require("../../repo/paymentService");
|
|
|
15
15
|
const paymentServiceProvider_1 = require("../../repo/paymentServiceProvider");
|
|
16
16
|
const project_1 = require("../../repo/project");
|
|
17
17
|
const sellerPaymentAccepted_1 = require("../../repo/sellerPaymentAccepted");
|
|
18
|
+
const integration_1 = require("../../repo/setting/integration");
|
|
18
19
|
const ticket_1 = require("../../repo/ticket");
|
|
19
20
|
// import { TransactionRepo } from '../../repo/transaction';
|
|
20
21
|
const placeOrder_1 = require("../../repo/transaction/placeOrder");
|
|
@@ -25,7 +26,7 @@ const any_1 = require("../payment/any");
|
|
|
25
26
|
* タスク実行関数
|
|
26
27
|
*/
|
|
27
28
|
function call(params) {
|
|
28
|
-
return async ({ connection, redisClient
|
|
29
|
+
return async ({ connection, redisClient }, options) => {
|
|
29
30
|
if (redisClient === undefined) {
|
|
30
31
|
throw new factory_1.factory.errors.Argument('settings', 'redisClient required');
|
|
31
32
|
}
|
|
@@ -33,6 +34,7 @@ function call(params) {
|
|
|
33
34
|
if (!options.executeById) {
|
|
34
35
|
return;
|
|
35
36
|
}
|
|
37
|
+
const settings = new integration_1.IntegrationSettingRepo({ connection });
|
|
36
38
|
const actionRepo = new acceptPay_1.AcceptPayActionRepo(connection);
|
|
37
39
|
// const transactionProcessRepo = new TransactionProcessRepo(redisClient, { lockExpiresInSeconds: 120 });
|
|
38
40
|
try {
|
|
@@ -13,6 +13,7 @@ const paymentServiceProvider_1 = require("../../repo/paymentServiceProvider");
|
|
|
13
13
|
const product_1 = require("../../repo/product");
|
|
14
14
|
const project_1 = require("../../repo/project");
|
|
15
15
|
const sellerPaymentAccepted_1 = require("../../repo/sellerPaymentAccepted");
|
|
16
|
+
const integration_1 = require("../../repo/setting/integration");
|
|
16
17
|
const task_1 = require("../../repo/task");
|
|
17
18
|
const transactionNumber_1 = require("../../repo/transactionNumber");
|
|
18
19
|
const refundByTask_1 = require("./payment/refundByTask");
|
|
@@ -20,10 +21,11 @@ const refundByTask_1 = require("./payment/refundByTask");
|
|
|
20
21
|
* タスク実行関数
|
|
21
22
|
*/
|
|
22
23
|
function call(params) {
|
|
23
|
-
return async ({ connection, redisClient
|
|
24
|
+
return async ({ connection, redisClient }) => {
|
|
24
25
|
if (redisClient === undefined) {
|
|
25
26
|
throw new factory_1.factory.errors.Argument('settings', 'redisClient required');
|
|
26
27
|
}
|
|
28
|
+
const settings = new integration_1.IntegrationSettingRepo({ connection });
|
|
27
29
|
let data;
|
|
28
30
|
if (params.name === factory_1.factory.taskName.Refund) {
|
|
29
31
|
data = {
|
|
@@ -35,7 +37,7 @@ function call(params) {
|
|
|
35
37
|
data = params;
|
|
36
38
|
}
|
|
37
39
|
const paymentServiceId = data.object.at(0)?.id;
|
|
38
|
-
const credentialsExpireInSeconds = settings.movieticketReserve.credentialsExpireInSeconds;
|
|
40
|
+
const credentialsExpireInSeconds = (await settings.getByKey('movieticketReserve')).credentialsExpireInSeconds;
|
|
39
41
|
const useCredentialsRepo = typeof paymentServiceId === 'string' && paymentServiceId !== ''
|
|
40
42
|
&& typeof credentialsExpireInSeconds === 'number' && credentialsExpireInSeconds > 0;
|
|
41
43
|
await (0, refundByTask_1.refundByTask)(data)({
|
|
@@ -48,6 +48,7 @@ const assetTransaction_1 = require("../../repo/assetTransaction");
|
|
|
48
48
|
const project_1 = require("../../repo/project");
|
|
49
49
|
const reservation_1 = require("../../repo/reservation");
|
|
50
50
|
const reserveInterface_1 = require("../../repo/reserveInterface");
|
|
51
|
+
const integration_1 = require("../../repo/setting/integration");
|
|
51
52
|
const transactionNumber_1 = require("../../repo/transactionNumber");
|
|
52
53
|
let coaAuthClientCreated = false;
|
|
53
54
|
let coaAuthClient = new coa_service_1.COA.auth.RefreshToken({
|
|
@@ -59,7 +60,7 @@ let coaAuthClient = new coa_service_1.COA.auth.RefreshToken({
|
|
|
59
60
|
* タスク実行関数
|
|
60
61
|
*/
|
|
61
62
|
function call(params) {
|
|
62
|
-
return async ({ connection, redisClient
|
|
63
|
+
return async ({ connection, redisClient }) => {
|
|
63
64
|
if (redisClient === undefined) {
|
|
64
65
|
throw new factory_1.factory.errors.Argument('settings', 'redisClient required');
|
|
65
66
|
}
|
|
@@ -72,10 +73,11 @@ function call(params) {
|
|
|
72
73
|
coaAuthClientCreated = true;
|
|
73
74
|
}
|
|
74
75
|
}
|
|
76
|
+
const settings = new integration_1.IntegrationSettingRepo({ connection });
|
|
75
77
|
const reserveService = new coa_service_1.COA.service.Reserve({
|
|
76
78
|
endpoint: coaAuthClient.options.endpoint, // same as authClient(2024-07-17~)
|
|
77
79
|
auth: coaAuthClient
|
|
78
|
-
}, { timeout: settings.coa.
|
|
80
|
+
}, { timeout: (await settings.getByKey('coa')).timeoutReserve });
|
|
79
81
|
await returnReserve({
|
|
80
82
|
...params.data,
|
|
81
83
|
sameAs: { id: params.id }
|
|
@@ -4,19 +4,21 @@ exports.call = call;
|
|
|
4
4
|
const action_1 = require("../../repo/action");
|
|
5
5
|
const message_1 = require("../../repo/message");
|
|
6
6
|
const project_1 = require("../../repo/project");
|
|
7
|
+
const integration_1 = require("../../repo/setting/integration");
|
|
7
8
|
const notification_1 = require("../notification");
|
|
8
9
|
/**
|
|
9
10
|
* タスク実行関数
|
|
10
11
|
*/
|
|
11
12
|
function call(params) {
|
|
12
|
-
return async ({ connection
|
|
13
|
+
return async ({ connection }) => {
|
|
13
14
|
await (0, notification_1.sendEmailMessage)({
|
|
14
15
|
...params.data.actionAttributes,
|
|
15
16
|
sameAs: { id: params.id } // タスクIDを関連付け(2024-06-25~)
|
|
16
17
|
})({
|
|
17
18
|
action: new action_1.ActionRepo(connection),
|
|
18
19
|
message: new message_1.MessageRepo(connection),
|
|
19
|
-
project: new project_1.ProjectRepo(connection)
|
|
20
|
-
|
|
20
|
+
project: new project_1.ProjectRepo(connection),
|
|
21
|
+
integrationSetting: new integration_1.IntegrationSettingRepo({ connection })
|
|
22
|
+
});
|
|
21
23
|
};
|
|
22
24
|
}
|
|
@@ -16,6 +16,7 @@ const eventSeries_1 = require("../../repo/eventSeries");
|
|
|
16
16
|
const movieTheater_1 = require("../../repo/place/movieTheater");
|
|
17
17
|
const screeningRoom_1 = require("../../repo/place/screeningRoom");
|
|
18
18
|
const reserveInterface_1 = require("../../repo/reserveInterface");
|
|
19
|
+
const integration_1 = require("../../repo/setting/integration");
|
|
19
20
|
const saveScreeningEvents_1 = require("../event/saveScreeningEvents");
|
|
20
21
|
const saveScreeningEventSeries_1 = require("../event/saveScreeningEventSeries");
|
|
21
22
|
let coaAuthClient;
|
|
@@ -23,7 +24,7 @@ let coaAuthClient;
|
|
|
23
24
|
* タスク実行関数
|
|
24
25
|
*/
|
|
25
26
|
function call(params) {
|
|
26
|
-
return async ({ connection, redisClient
|
|
27
|
+
return async ({ connection, redisClient }, options) => {
|
|
27
28
|
if (redisClient === undefined) {
|
|
28
29
|
throw new factory_1.factory.errors.Argument('settings', 'redisClient required');
|
|
29
30
|
}
|
|
@@ -31,6 +32,7 @@ function call(params) {
|
|
|
31
32
|
if (!options.executeById) {
|
|
32
33
|
return;
|
|
33
34
|
}
|
|
35
|
+
const settings = new integration_1.IntegrationSettingRepo({ connection });
|
|
34
36
|
const reserveInterfaceRepo = new reserveInterface_1.ReserveInterfaceRepo(connection);
|
|
35
37
|
const coaAPI = await reserveInterfaceRepo.findOne({ project: { id: { $eq: params.project.id } } });
|
|
36
38
|
if (typeof coaAPI?.id !== 'string') {
|
|
@@ -60,7 +62,7 @@ function call(params) {
|
|
|
60
62
|
const masterService = new coa_service_1.COA.service.Master({
|
|
61
63
|
endpoint: coaAuthClient.options.endpoint, // same as authClient(2024-07-17~)
|
|
62
64
|
auth: coaAuthClient
|
|
63
|
-
}, { timeout: settings.coa.
|
|
65
|
+
}, { timeout: (await settings.getByKey('coa')).timeoutMaster });
|
|
64
66
|
const { agent, object } = params.data;
|
|
65
67
|
if (object.typeOf === factory_1.factory.eventType.ScreeningEventSeries) {
|
|
66
68
|
await syncEventSeries({
|
|
@@ -13,18 +13,20 @@ const paymentServiceProvider_1 = require("../../repo/paymentServiceProvider");
|
|
|
13
13
|
const product_1 = require("../../repo/product");
|
|
14
14
|
const project_1 = require("../../repo/project");
|
|
15
15
|
const sellerPaymentAccepted_1 = require("../../repo/sellerPaymentAccepted");
|
|
16
|
+
const integration_1 = require("../../repo/setting/integration");
|
|
16
17
|
const task_1 = require("../../repo/task");
|
|
17
18
|
const voidPaymentByTask_1 = require("./payment/voidPaymentByTask");
|
|
18
19
|
/**
|
|
19
20
|
* タスク実行関数
|
|
20
21
|
*/
|
|
21
22
|
function call(data) {
|
|
22
|
-
return async ({ connection, redisClient
|
|
23
|
+
return async ({ connection, redisClient }) => {
|
|
23
24
|
if (redisClient === undefined) {
|
|
24
25
|
throw new factory_1.factory.errors.Argument('settings', 'redisClient required');
|
|
25
26
|
}
|
|
27
|
+
const settings = new integration_1.IntegrationSettingRepo({ connection });
|
|
26
28
|
const paymentServiceId = data.object.object.id;
|
|
27
|
-
const credentialsExpireInSeconds = settings.movieticketReserve.credentialsExpireInSeconds;
|
|
29
|
+
const credentialsExpireInSeconds = (await settings.getByKey('movieticketReserve')).credentialsExpireInSeconds;
|
|
28
30
|
const useCredentialsRepo = typeof paymentServiceId === 'string' && paymentServiceId !== ''
|
|
29
31
|
&& typeof credentialsExpireInSeconds === 'number' && credentialsExpireInSeconds > 0;
|
|
30
32
|
await (0, voidPaymentByTask_1.voidPaymentByTask)(data)({
|
|
@@ -13,6 +13,7 @@ const offer_1 = require("../../repo/rateLimit/offer");
|
|
|
13
13
|
const reservation_1 = require("../../repo/reservation");
|
|
14
14
|
const reserveInterface_1 = require("../../repo/reserveInterface");
|
|
15
15
|
const setting_1 = require("../../repo/setting");
|
|
16
|
+
const integration_1 = require("../../repo/setting/integration");
|
|
16
17
|
const stockHolder_1 = require("../../repo/stockHolder");
|
|
17
18
|
const task_1 = require("../../repo/task");
|
|
18
19
|
// import { TransactionRepo } from '../../repo/transaction';
|
|
@@ -27,7 +28,7 @@ let coaAuthClient = new coa_service_1.COA.auth.RefreshToken({
|
|
|
27
28
|
* タスク実行関数
|
|
28
29
|
*/
|
|
29
30
|
function call(params) {
|
|
30
|
-
return async ({ connection, redisClient
|
|
31
|
+
return async ({ connection, redisClient }, options) => {
|
|
31
32
|
if (redisClient === undefined) {
|
|
32
33
|
throw new factory_1.factory.errors.Argument('settings', 'redisClient required');
|
|
33
34
|
}
|
|
@@ -47,10 +48,11 @@ function call(params) {
|
|
|
47
48
|
coaAuthClientCreated = true;
|
|
48
49
|
}
|
|
49
50
|
}
|
|
51
|
+
const settings = new integration_1.IntegrationSettingRepo({ connection });
|
|
50
52
|
const reserveService = new coa_service_1.COA.service.Reserve({
|
|
51
53
|
endpoint: coaAuthClient.options.endpoint, // same as authClient(2024-07-17~)
|
|
52
54
|
auth: coaAuthClient
|
|
53
|
-
}, { timeout: settings.coa.
|
|
55
|
+
}, { timeout: (await settings.getByKey('coa')).timeoutReserve });
|
|
54
56
|
// const transactionProcessRepo = new TransactionProcessRepo(redisClient, { lockExpiresInSeconds: 120 });
|
|
55
57
|
try {
|
|
56
58
|
await (0, voidTransaction_1.voidTransaction)({
|
|
@@ -1,14 +1,7 @@
|
|
|
1
|
-
import { SendGridCredentials } from '../credentials/sendGrid';
|
|
2
1
|
import type { IExecuteSettings as IMinimumExecuteSettings, INextFunction, IReadyTask, IRunningTask } from '../eventEmitter/task';
|
|
3
2
|
import { factory } from '../factory';
|
|
4
|
-
import { Settings } from '../settings';
|
|
5
3
|
import type { AggregationSettings } from '../taskSettings';
|
|
6
|
-
interface ICredentialSettings {
|
|
7
|
-
sendGrid: SendGridCredentials;
|
|
8
|
-
}
|
|
9
4
|
interface IExecuteSettings extends IMinimumExecuteSettings {
|
|
10
|
-
credentials: ICredentialSettings;
|
|
11
|
-
settings: Settings;
|
|
12
5
|
aggregationSettings?: AggregationSettings;
|
|
13
6
|
}
|
|
14
7
|
type IOperation<T> = (settings: IExecuteSettings) => Promise<T>;
|
|
@@ -133,19 +133,21 @@ function deleteTransactionById(params) {
|
|
|
133
133
|
if (typeof deletingTransactionId !== 'string' || deletingTransactionId.length === 0) {
|
|
134
134
|
throw new factory_1.factory.errors.ArgumentNull('object.id');
|
|
135
135
|
}
|
|
136
|
+
let deletingOrderNumberByTask;
|
|
136
137
|
let transaction;
|
|
137
138
|
if (params.object.typeOf === factory_1.factory.transactionType.PlaceOrder) {
|
|
138
139
|
transaction = (await repos.placeOrder.findPlaceOrderTransactions({
|
|
139
140
|
ids: [deletingTransactionId],
|
|
140
141
|
typeOf: params.object.typeOf,
|
|
141
|
-
inclusion: ['typeOf', 'project', 'status'
|
|
142
|
+
inclusion: ['typeOf', 'project', 'status']
|
|
142
143
|
})).shift();
|
|
144
|
+
deletingOrderNumberByTask = params.object.object.orderNumber;
|
|
143
145
|
}
|
|
144
146
|
else if (params.object.typeOf === factory_1.factory.transactionType.ReturnOrder) {
|
|
145
147
|
transaction = (await repos.returnOrder.findReturnOrderTransactions({
|
|
146
148
|
ids: [deletingTransactionId],
|
|
147
149
|
typeOf: params.object.typeOf,
|
|
148
|
-
inclusion: ['typeOf', 'project', 'status'
|
|
150
|
+
inclusion: ['typeOf', 'project', 'status']
|
|
149
151
|
})).shift();
|
|
150
152
|
}
|
|
151
153
|
else {
|
|
@@ -189,10 +191,16 @@ function deleteTransactionById(params) {
|
|
|
189
191
|
case factory_1.factory.transactionStatusType.Expired:
|
|
190
192
|
break;
|
|
191
193
|
case factory_1.factory.transactionStatusType.Confirmed: {
|
|
192
|
-
|
|
193
|
-
|
|
194
|
+
// 削除対象の注文番号についてはタスクを参照する(2026-06-15~)
|
|
195
|
+
// const deletingOrder = transaction.result?.order;
|
|
196
|
+
// if (typeof deletingOrder?.orderNumber === 'string') {
|
|
197
|
+
// await deleteOrder({
|
|
198
|
+
// object: deletingOrder
|
|
199
|
+
// })(repos);
|
|
200
|
+
// }
|
|
201
|
+
if (typeof deletingOrderNumberByTask === 'string') {
|
|
194
202
|
await (0, deleteOrder_1.deleteOrder)({
|
|
195
|
-
object:
|
|
203
|
+
object: { orderNumber: deletingOrderNumberByTask }
|
|
196
204
|
})(repos);
|
|
197
205
|
}
|
|
198
206
|
break;
|
|
@@ -200,8 +208,6 @@ function deleteTransactionById(params) {
|
|
|
200
208
|
default:
|
|
201
209
|
throw new factory_1.factory.errors.NotImplemented(`${transaction.status} not implemented`);
|
|
202
210
|
}
|
|
203
|
-
// eslint-disable-next-line no-warning-comments
|
|
204
|
-
// TODO サービス登録取引を削除
|
|
205
211
|
// 決済取引を削除
|
|
206
212
|
const deletePayTransactionsByPlaceOrderResult = await deletePayTransactionsByPlaceOrder({ authorizeActions, transaction })(repos);
|
|
207
213
|
deletePayTransactionResult = deletePayTransactionsByPlaceOrderResult.deletePayTransactionResult;
|
|
@@ -5,7 +5,6 @@ import { factory } from '../../../../../factory';
|
|
|
5
5
|
declare function createOrderAsResult(params: {
|
|
6
6
|
orderNumber: string;
|
|
7
7
|
orderDate: Date;
|
|
8
|
-
orderStatus: factory.orderStatus;
|
|
9
8
|
price: number;
|
|
10
9
|
}): factory.transaction.placeOrder.IOrderAsResult;
|
|
11
10
|
export { createOrderAsResult };
|