@chevre/domain 24.1.0-alpha.6 → 24.1.0-alpha.60
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 +0 -3
- 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 -362
- package/lib/chevre/repo/mongoose/schemas/accountingReport.js +42 -42
- package/lib/chevre/repo/mongoose/schemas/order.js +134 -131
- package/lib/chevre/repo/mongoose/schemas/reservation.d.ts +3 -1
- package/lib/chevre/repo/mongoose/schemas/reservation.js +96 -147
- 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 +3 -83
- package/lib/chevre/repo/order.js +16 -376
- 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 -7
- 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.d.ts +6 -6
- 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/createAccountingReportIfNotExist.d.ts +1 -1
- package/lib/chevre/service/order/createAccountingReportIfNotExist.js +15 -15
- package/lib/chevre/service/order/deleteOrder.d.ts +1 -1
- package/lib/chevre/service/order/deleteOrder.js +19 -46
- 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 +9 -11
- 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 +4 -1
- 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 +13 -17
- 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 +4 -8
- 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/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 -3
- package/lib/chevre/service/transaction/placeOrder/confirm.js +28 -40
- 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/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,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>;
|
|
@@ -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 };
|
|
@@ -2,30 +2,20 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.createOrderAsResult = createOrderAsResult;
|
|
4
4
|
const factory_1 = require("../../../../../factory");
|
|
5
|
-
// import { acceptedOffers2orderedItem } from './result/orderedItem';
|
|
6
5
|
/**
|
|
7
6
|
* 注文取引結果としての注文を生成する
|
|
8
7
|
*/
|
|
9
8
|
function createOrderAsResult(params) {
|
|
10
|
-
const { orderDate, orderNumber,
|
|
9
|
+
const { orderDate, orderNumber, price } = params;
|
|
11
10
|
return {
|
|
12
|
-
typeOf: factory_1.factory.order.OrderType.Order,
|
|
13
|
-
price,
|
|
14
|
-
priceCurrency: factory_1.factory.priceCurrency.JPY,
|
|
15
|
-
// discounts: discounts, // 廃止(2024-04-16~)
|
|
16
11
|
confirmationNumber: '',
|
|
17
12
|
orderNumber,
|
|
18
|
-
url: '',
|
|
19
|
-
orderStatus,
|
|
20
13
|
orderDate,
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
//
|
|
26
|
-
//
|
|
27
|
-
// isGift: params.isGift, // discontinue(2024-06-20~)
|
|
28
|
-
// ...(typeof name === 'string') ? { name } : undefined, // discontinue(2024-06-20~)
|
|
29
|
-
// ...(typeof broker?.typeOf === 'string') ? { broker } : undefined // discontinue(2024-06-20~)
|
|
14
|
+
typeOf: factory_1.factory.order.OrderType.Order,
|
|
15
|
+
price,
|
|
16
|
+
priceCurrency: factory_1.factory.priceCurrency.JPY,
|
|
17
|
+
orderStatus: factory_1.factory.orderStatus.OrderPaymentDue // 注文作成時のステータスとなる
|
|
18
|
+
// url: '', // discontinue(2026-06-11~)
|
|
19
|
+
// identifier: [] // discontinue(2026-06-11~)
|
|
30
20
|
};
|
|
31
21
|
}
|
package/lib/chevre/service/transaction/placeOrder/confirm/potentialActions/sendEmailMessage.d.ts
CHANGED
|
@@ -1,7 +1,13 @@
|
|
|
1
1
|
import { factory } from '../../../../../factory';
|
|
2
2
|
import type { ISetting } from '../../../../../repo/setting';
|
|
3
3
|
export declare function createSendEmailMessageActions(params: {
|
|
4
|
-
order: factory.transaction.placeOrder.IOrderAsResult
|
|
4
|
+
order: factory.transaction.placeOrder.IOrderAsResult & {
|
|
5
|
+
confirmationNumber: string;
|
|
6
|
+
orderStatus: factory.orderStatus;
|
|
7
|
+
price: number;
|
|
8
|
+
priceCurrency: factory.priceCurrency;
|
|
9
|
+
typeOf: factory.order.OrderType;
|
|
10
|
+
};
|
|
5
11
|
customer: factory.order.ICustomer;
|
|
6
12
|
seller: factory.order.ISeller;
|
|
7
13
|
paymentMethods: factory.order.IReferencedInvoice[];
|
package/lib/chevre/service/transaction/placeOrder/confirm/potentialActions/sendEmailMessage.js
CHANGED
|
@@ -3,7 +3,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.createSendEmailMessageActions = createSendEmailMessageActions;
|
|
4
4
|
const emailMessageBuilder_1 = require("../../../../../emailMessageBuilder");
|
|
5
5
|
const factory_1 = require("../../../../../factory");
|
|
6
|
-
// import { Settings } from '../../../../../settings';
|
|
7
6
|
async function createSendEmailMessageActions(params,
|
|
8
7
|
// settings: Settings
|
|
9
8
|
setting) {
|
|
@@ -4,7 +4,13 @@ import type { ISetting } from '../../../../repo/setting';
|
|
|
4
4
|
* 取引のポストアクションを作成する
|
|
5
5
|
*/
|
|
6
6
|
export declare function createPotentialActions(params: {
|
|
7
|
-
order: factory.transaction.placeOrder.IOrderAsResult
|
|
7
|
+
order: factory.transaction.placeOrder.IOrderAsResult & {
|
|
8
|
+
confirmationNumber: string;
|
|
9
|
+
orderStatus: factory.orderStatus.OrderPaymentDue;
|
|
10
|
+
price: number;
|
|
11
|
+
priceCurrency: factory.priceCurrency;
|
|
12
|
+
typeOf: factory.order.OrderType;
|
|
13
|
+
};
|
|
8
14
|
customer: factory.order.ICustomer;
|
|
9
15
|
seller: factory.order.ISeller;
|
|
10
16
|
paymentMethods: factory.order.IReferencedInvoice[];
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.createPotentialActions = createPotentialActions;
|
|
4
|
-
// import { Settings } from '../../../../settings';
|
|
5
4
|
const sendEmailMessage_1 = require("./potentialActions/sendEmailMessage");
|
|
6
5
|
/**
|
|
7
6
|
* 取引のポストアクションを作成する
|
|
@@ -4,5 +4,5 @@ declare function validateInvoiceReferencesOrder(authorizePaymentActions: IAuthor
|
|
|
4
4
|
/**
|
|
5
5
|
* 受け入れられた興行オファー
|
|
6
6
|
*/
|
|
7
|
-
eventReservationAcceptedOffers: factory.order.IAcceptedOffer[]): void;
|
|
7
|
+
eventReservationAcceptedOffers: Pick<factory.order.IAcceptedOffer, 'itemOffered'>[]): void;
|
|
8
8
|
export { validateInvoiceReferencesOrder };
|
package/lib/chevre/service/transaction/placeOrder/confirm/validation/validateMovieTicket.d.ts
CHANGED
|
@@ -18,4 +18,4 @@ authorizedMovieTickets: IMovieTicket4validate[],
|
|
|
18
18
|
/**
|
|
19
19
|
* 受け入れられた興行オファー
|
|
20
20
|
*/
|
|
21
|
-
eventReservationAcceptedOffers: factory.order.IAcceptedOffer[]): void;
|
|
21
|
+
eventReservationAcceptedOffers: Pick<factory.order.IAcceptedOffer, 'itemOffered' | 'priceSpecification'>[]): void;
|
|
@@ -5,7 +5,7 @@ export { IAcceptPayAction, IAuthorizeEventServiceOffer, IAuthorizePaymentAction,
|
|
|
5
5
|
/**
|
|
6
6
|
* 取引が確定可能な状態かどうかをチェックする
|
|
7
7
|
*/
|
|
8
|
-
export declare function validateTransaction(transaction: Pick<factory.transaction.placeOrder.ITransaction, 'id' | 'object'>, acceptPayActions: IAcceptPayAction[], authorizePaymentActions: IAuthorizePaymentAction[], authorizeEventServiceOfferActions: Pick<IAuthorizeEventServiceOffer, 'id' | 'result'>[], eventReservationAcceptedOffers: factory.order.IAcceptedOffer[], payTransactions: IPayTransaction[], customer: factory.order.ICustomer): void;
|
|
8
|
+
export declare function validateTransaction(transaction: Pick<factory.transaction.placeOrder.ITransaction, 'id' | 'object'>, acceptPayActions: IAcceptPayAction[], authorizePaymentActions: IAuthorizePaymentAction[], authorizeEventServiceOfferActions: Pick<IAuthorizeEventServiceOffer, 'id' | 'result'>[], eventReservationAcceptedOffers: Pick<factory.order.IAcceptedOffer, 'itemOffered' | 'priceSpecification'>[], payTransactions: IPayTransaction[], customer: factory.order.ICustomer): void;
|
|
9
9
|
export type IOrderURLGenerator = (order: factory.order.IOrder) => string;
|
|
10
10
|
/**
|
|
11
11
|
* 注文オファー数検証
|
|
@@ -14,7 +14,7 @@ export declare function validateAcceptedOffers(params: {
|
|
|
14
14
|
result: {
|
|
15
15
|
order: PlaceOrderFactory.IResultOrderParams;
|
|
16
16
|
};
|
|
17
|
-
acceptedOffers: factory.order.IAcceptedOffer[];
|
|
17
|
+
acceptedOffers: (Pick<factory.order.IAcceptedOffer, 'itemOffered' | 'offeredThrough' | 'serialNumber'>)[];
|
|
18
18
|
}): void;
|
|
19
19
|
export declare function validateOrderedItem(params: {
|
|
20
20
|
order: Pick<factory.order.IOrder, 'orderedItem'>;
|
|
@@ -36,7 +36,9 @@ export declare function validatePaymentMethods(params: {
|
|
|
36
36
|
* 興行オファー適用条件確認
|
|
37
37
|
*/
|
|
38
38
|
export declare function validateEventOffers(params: {
|
|
39
|
-
order:
|
|
39
|
+
order: {
|
|
40
|
+
price: number;
|
|
41
|
+
};
|
|
40
42
|
paymentMethods: factory.order.IReferencedInvoice[];
|
|
41
43
|
authorizeEventServiceOfferActions: Pick<IAuthorizeEventServiceOffer, 'id' | 'instrument' | 'object' | 'result'>[];
|
|
42
44
|
}): void;
|
|
@@ -8,7 +8,6 @@ const debug_1 = __importDefault(require("debug"));
|
|
|
8
8
|
const moment_1 = __importDefault(require("moment"));
|
|
9
9
|
const errorHandler_1 = require("../../../errorHandler");
|
|
10
10
|
const factory_1 = require("../../../factory");
|
|
11
|
-
// import { Settings } from '../../../settings';
|
|
12
11
|
const factory_2 = require("../../order/placeOrder/factory");
|
|
13
12
|
const orderedItem_1 = require("../../order/placeOrder/factory/orderedItem");
|
|
14
13
|
const result_1 = require("./confirm/factory/result");
|
|
@@ -99,7 +98,10 @@ function confirm(params, options) {
|
|
|
99
98
|
// authorizeProductOfferActions,
|
|
100
99
|
serialNumbers } = dissolveAuthorizeActions(completedAuthorizeActions);
|
|
101
100
|
// orderInTransactionから検索する(2024-03-04~)
|
|
102
|
-
const acceptedOffers = (await repos.orderInTransaction.
|
|
101
|
+
const acceptedOffers = (await repos.orderInTransaction.findAcceptedOffersWithPriceByOrderNumber({
|
|
102
|
+
orderNumber,
|
|
103
|
+
project: { id: transaction.project.id }
|
|
104
|
+
}))
|
|
103
105
|
.filter(({ serialNumber }) => typeof serialNumber === 'string' && serialNumbers.includes(serialNumber));
|
|
104
106
|
// authorizePaymentActionsからpayTransactionsを参照(2024-06-20~)
|
|
105
107
|
let payTransactions = [];
|
|
@@ -116,7 +118,7 @@ function confirm(params, options) {
|
|
|
116
118
|
// let customer: factory.order.ICustomer = createCustomer({ transaction });
|
|
117
119
|
const customer = await repos.orderInTransaction.findCustomerByOrderNumber({ orderNumber: { $eq: orderNumber } });
|
|
118
120
|
const seller = (0, factory_2.createSeller)({ transaction });
|
|
119
|
-
const { paymentMethods, result, eventId, reservationIds } = createResult({
|
|
121
|
+
const { paymentMethods, placingOrder, result, eventId, reservationIds } = createResult({
|
|
120
122
|
...params,
|
|
121
123
|
orderNumber, transaction,
|
|
122
124
|
acceptPayActions,
|
|
@@ -142,7 +144,7 @@ function confirm(params, options) {
|
|
|
142
144
|
throw new factory_1.factory.errors.NotFound('setting.defaultSenderEmail');
|
|
143
145
|
}
|
|
144
146
|
const { emailMessages, potentialActions } = await (0, potentialActions_1.createPotentialActions)({
|
|
145
|
-
order:
|
|
147
|
+
order: placingOrder, // createEmailMessageでのorder.acceptedOffersへの依存性を排除したのでこちらでよいはず(2024-02-21~)
|
|
146
148
|
customer,
|
|
147
149
|
seller,
|
|
148
150
|
paymentMethods,
|
|
@@ -288,7 +290,7 @@ function createResult(params, options) {
|
|
|
288
290
|
const itemOfferedTypeOf = acceptedOffer.itemOffered.typeOf;
|
|
289
291
|
switch (itemOfferedTypeOf) {
|
|
290
292
|
case factory_1.factory.reservationType.EventReservation:
|
|
291
|
-
eventReservationAcceptedOffers.push(acceptedOffer);
|
|
293
|
+
eventReservationAcceptedOffers.push((acceptedOffer));
|
|
292
294
|
break;
|
|
293
295
|
// case factory.permit.PermitType.Permit:
|
|
294
296
|
// productAcceptedOffers.push((acceptedOffer as factory.order.IAcceptedOffer<factory.order.IPermit>));
|
|
@@ -303,18 +305,7 @@ function createResult(params, options) {
|
|
|
303
305
|
eventReservationAcceptedOffers, params.payTransactions, params.customer);
|
|
304
306
|
const { paymentMethods, price } = (0, factory_2.createPaymentMethods)({ authorizePaymentActions: params.authorizePaymentActions });
|
|
305
307
|
const orderedItem = (0, orderedItem_1.acceptedOffers2orderedItem)({
|
|
306
|
-
eventReservationAcceptedOffers
|
|
307
|
-
// productAcceptedOffers,
|
|
308
|
-
// moneyTransferAcceptedOffers
|
|
309
|
-
});
|
|
310
|
-
// 注文作成
|
|
311
|
-
const orderAsResult = (0, result_1.createOrderAsResult)({
|
|
312
|
-
orderNumber: params.orderNumber,
|
|
313
|
-
orderDate: params.result.order.orderDate,
|
|
314
|
-
orderStatus: factory_1.factory.orderStatus.OrderPaymentDue, // 注文作成時のステータスとなる
|
|
315
|
-
// orderedItem,
|
|
316
|
-
// paymentMethods,
|
|
317
|
-
price
|
|
308
|
+
eventReservationAcceptedOffers
|
|
318
309
|
});
|
|
319
310
|
(0, validation_1.validateEventOffers)({
|
|
320
311
|
order: { price },
|
|
@@ -333,14 +324,24 @@ function createResult(params, options) {
|
|
|
333
324
|
});
|
|
334
325
|
(0, validation_1.validatePaymentMethods)({ order: { paymentMethods } }, options);
|
|
335
326
|
// 確認番号を発行
|
|
336
|
-
const { confirmationNumber
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
327
|
+
const { confirmationNumber } = createConfirmationNumber({ transaction });
|
|
328
|
+
// 注文作成
|
|
329
|
+
const orderAsResult = (0, result_1.createOrderAsResult)({
|
|
330
|
+
orderNumber: params.orderNumber,
|
|
331
|
+
orderDate: params.result.order.orderDate,
|
|
332
|
+
price
|
|
340
333
|
});
|
|
341
334
|
orderAsResult.confirmationNumber = confirmationNumber;
|
|
342
|
-
orderAsResult.identifier = identifier;
|
|
343
|
-
orderAsResult.url = url;
|
|
335
|
+
// orderAsResult.identifier = identifier; // discontinue(2026-06-11~)
|
|
336
|
+
// orderAsResult.url = url; // discontinue(2026-06-11~)
|
|
337
|
+
const placingOrder = {
|
|
338
|
+
...orderAsResult,
|
|
339
|
+
confirmationNumber,
|
|
340
|
+
typeOf: factory_1.factory.order.OrderType.Order,
|
|
341
|
+
price,
|
|
342
|
+
priceCurrency: factory_1.factory.priceCurrency.JPY,
|
|
343
|
+
orderStatus: factory_1.factory.orderStatus.OrderPaymentDue
|
|
344
|
+
};
|
|
344
345
|
const authorizeActions = [
|
|
345
346
|
...params.authorizePaymentActions.map(({ id }) => ({ id })),
|
|
346
347
|
...params.authorizeEventServiceOfferActions.map(({ id }) => ({ id })),
|
|
@@ -356,6 +357,7 @@ function createResult(params, options) {
|
|
|
356
357
|
}
|
|
357
358
|
return {
|
|
358
359
|
paymentMethods,
|
|
360
|
+
placingOrder,
|
|
359
361
|
result: {
|
|
360
362
|
order: orderAsResult,
|
|
361
363
|
authorizeActions, // 追加(2024-01-17~)
|
|
@@ -441,26 +443,12 @@ function searchAuthorizeActions(params) {
|
|
|
441
443
|
}
|
|
442
444
|
function createConfirmationNumber(params) {
|
|
443
445
|
const confirmationNumber = params.transaction.object.confirmationNumber;
|
|
444
|
-
let url = '';
|
|
445
446
|
// 取引に確認番号が保管されていなければ、確認番号を発行
|
|
446
447
|
if (typeof confirmationNumber !== 'string') {
|
|
447
448
|
// 事前に発行済なはずなので、ありえないフロー
|
|
448
449
|
throw new factory_1.factory.errors.Internal('object.confirmationNumber undefined');
|
|
449
450
|
}
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
url = params.result.order.url;
|
|
454
|
-
}
|
|
455
|
-
else /* istanbul ignore next */ if (typeof params.result.order.url === 'function') {
|
|
456
|
-
/* istanbul ignore next */
|
|
457
|
-
url = params.result.order.url(params.order);
|
|
458
|
-
}
|
|
459
|
-
// 識別子の指定があれば上書き
|
|
460
|
-
const identifier = [
|
|
461
|
-
...(Array.isArray(params.result.order.identifier)) ? params.result.order.identifier : [],
|
|
462
|
-
// 取引に指定があれば追加
|
|
463
|
-
...(Array.isArray(params.transaction.object.identifier)) ? params.transaction.object.identifier : []
|
|
464
|
-
];
|
|
465
|
-
return { confirmationNumber, url, identifier };
|
|
451
|
+
return {
|
|
452
|
+
confirmationNumber,
|
|
453
|
+
};
|
|
466
454
|
}
|
|
@@ -6,7 +6,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
6
6
|
exports.exportTasksById = exportTasksById;
|
|
7
7
|
const moment_1 = __importDefault(require("moment"));
|
|
8
8
|
const factory_1 = require("../../../factory");
|
|
9
|
-
// import { Settings } from '../../../settings';
|
|
10
9
|
const factory_2 = require("./exportTasks/factory");
|
|
11
10
|
/**
|
|
12
11
|
* 取引のタスクを出力します
|