@chevre/domain 24.1.0-alpha.8 → 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 +134 -131
- 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
|
@@ -5,7 +5,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.paymentDue2Processing = paymentDue2Processing;
|
|
7
7
|
const debug_1 = __importDefault(require("debug"));
|
|
8
|
-
const
|
|
8
|
+
const findConfirmedPlaceOrder_1 = require("../findConfirmedPlaceOrder");
|
|
9
9
|
const onOrderStatusChanged_1 = require("../onOrderStatusChanged");
|
|
10
10
|
const factory_1 = require("../../../factory");
|
|
11
11
|
const debug = (0, debug_1.default)('chevre-domain:service:order');
|
|
@@ -14,16 +14,11 @@ const debug = (0, debug_1.default)('chevre-domain:service:order');
|
|
|
14
14
|
*/
|
|
15
15
|
function paymentDue2Processing(params) {
|
|
16
16
|
return async (repos, settings) => {
|
|
17
|
-
const placeOrderTransaction = await (0,
|
|
17
|
+
const placeOrderTransaction = await (0, findConfirmedPlaceOrder_1.findConfirmedPlaceOrder)({
|
|
18
18
|
project: { id: params.project.id },
|
|
19
19
|
confirmationNumber: params.confirmationNumber,
|
|
20
20
|
orderNumber: params.orderNumber
|
|
21
21
|
})(repos);
|
|
22
|
-
// const existingOrder: Pick<factory.order.IOrder, 'project'> = await repos.order.projectFieldsByOrderNumber({
|
|
23
|
-
// orderNumber: params.orderNumber,
|
|
24
|
-
// project: { id: params.project.id },
|
|
25
|
-
// inclusion: ['project']
|
|
26
|
-
// });
|
|
27
22
|
let order;
|
|
28
23
|
try {
|
|
29
24
|
order = await repos.order.changeStatus({
|
|
@@ -55,28 +50,26 @@ function paymentDue2Processing(params) {
|
|
|
55
50
|
}
|
|
56
51
|
}
|
|
57
52
|
if (params.useOnOrderStatusChanged) {
|
|
58
|
-
// 全acceptedOffersを検索(2023-12-08~)
|
|
59
|
-
// const acceptedOffers = await repos.acceptedOffer.searchAcceptedOffersByOrderNumber(
|
|
60
|
-
// {
|
|
61
|
-
// orderNumber: { $eq: order.orderNumber },
|
|
62
|
-
// project: { id: { $eq: params.project.id } }
|
|
63
|
-
// },
|
|
64
|
-
// ['itemOffered', 'offeredThrough']
|
|
65
|
-
// );
|
|
66
53
|
const { numAcceptedOffers } = await repos.acceptedOffer.countByOrderNumber({
|
|
67
54
|
orderNumber: { $eq: order.orderNumber },
|
|
68
55
|
project: { id: { $eq: params.project.id } }
|
|
69
56
|
});
|
|
70
|
-
const itemOfferedTypeOfs = await repos.acceptedOffer.distinctValues(
|
|
57
|
+
// const itemOfferedTypeOfs = await repos.acceptedOffer.distinctValues(
|
|
58
|
+
// { orderNumber: { $in: [params.orderNumber] } },
|
|
59
|
+
// 'acceptedOffers.itemOffered.typeOf'
|
|
60
|
+
// ) as factory.order.IItemOffered['typeOf'][];
|
|
71
61
|
const serialNumbers = await repos.acceptedOffer.distinctValues({ orderNumber: { $in: [params.orderNumber] } }, 'acceptedOffers.serialNumber');
|
|
72
62
|
const offeredThroughIdentifier = (await repos.acceptedOffer.distinctValues({ orderNumber: { $in: [params.orderNumber] } }, 'acceptedOffers.offeredThrough.identifier')).shift();
|
|
73
|
-
debug('onAssetTransactionStatusChanged paymentDue2Processing: calling onOrderProcessing...', 'numAcceptedOffers:', numAcceptedOffers,
|
|
63
|
+
debug('onAssetTransactionStatusChanged paymentDue2Processing: calling onOrderProcessing...', 'numAcceptedOffers:', numAcceptedOffers,
|
|
64
|
+
// 'itemOfferedTypeOfs:', itemOfferedTypeOfs,
|
|
65
|
+
'serialNumbers:', serialNumbers, 'offeredThroughIdentifier:', offeredThroughIdentifier);
|
|
74
66
|
await (0, onOrderStatusChanged_1.onOrderProcessing)({
|
|
75
67
|
order: {
|
|
76
68
|
...order,
|
|
77
69
|
// acceptedOffers,
|
|
78
70
|
numAcceptedOffers,
|
|
79
|
-
itemOfferedTypeOf: itemOfferedTypeOfs[0], // 1つしかない前提
|
|
71
|
+
// itemOfferedTypeOf: itemOfferedTypeOfs[0], // 1つしかない前提
|
|
72
|
+
itemOfferedTypeOf: factory_1.factory.reservationType.EventReservation, // EventReservationしか存在しないので固定でよし
|
|
80
73
|
serialNumbers,
|
|
81
74
|
offeredThroughIdentifier,
|
|
82
75
|
orderStatus: factory_1.factory.orderStatus.OrderProcessing // 強制的にOrderProcessingとして処理する
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { OrderRepo } from '../../../repo/order';
|
|
2
2
|
import type { TaskRepo } from '../../../repo/task';
|
|
3
3
|
import type { PlaceOrderRepo } from '../../../repo/transaction/placeOrder';
|
|
4
|
-
import { Settings } from '../../../
|
|
4
|
+
import type { IntegrationSettingRepo as Settings } from '../../../repo/setting/integration';
|
|
5
5
|
declare function processing2inTransit(params: {
|
|
6
6
|
project: {
|
|
7
7
|
id: string;
|
|
@@ -7,7 +7,7 @@ import type { PlaceOrderRepo } from '../../repo/transaction/placeOrder';
|
|
|
7
7
|
import { paymentDue2Processing } from './onAssetTransactionStatusChanged/paymentDue2Processing';
|
|
8
8
|
import { processing2inTransit } from './onAssetTransactionStatusChanged/processing2inTransit';
|
|
9
9
|
import { factory } from '../../factory';
|
|
10
|
-
import { Settings } from '../../
|
|
10
|
+
import type { IntegrationSettingRepo as Settings } from '../../repo/setting/integration';
|
|
11
11
|
interface IOnAssetTransactionStatusChangedRepos {
|
|
12
12
|
acceptedOffer: AcceptedOfferRepo;
|
|
13
13
|
assetTransaction: AssetTransactionRepo;
|
|
@@ -9,7 +9,6 @@ exports.onOrderDelivered = onOrderDelivered;
|
|
|
9
9
|
*/
|
|
10
10
|
const debug_1 = __importDefault(require("debug"));
|
|
11
11
|
const factory_1 = require("../../../factory");
|
|
12
|
-
// import { Settings } from '../../../settings';
|
|
13
12
|
const factory_2 = require("./onOrderDelivered/factory");
|
|
14
13
|
const debug = (0, debug_1.default)('chevre-domain:service:order');
|
|
15
14
|
function onOrderDelivered(params) {
|
package/lib/chevre/service/order/onOrderStatusChanged/onOrderDeliveredPartially/factory.d.ts
CHANGED
|
@@ -5,7 +5,12 @@ type IInTransitOrder = Pick<factory.order.IOrder, 'confirmationNumber' | 'projec
|
|
|
5
5
|
limit: number;
|
|
6
6
|
page: number;
|
|
7
7
|
};
|
|
8
|
-
deliveredAcceptedOffers: factory.order.IAcceptedOffer
|
|
8
|
+
deliveredAcceptedOffers: (Omit<factory.order.IAcceptedOffer, 'priceSpecification' | 'name'> & {
|
|
9
|
+
/**
|
|
10
|
+
* COA以外では注文ドキュメントにpriceSpecificationが存在しないのでIFを補完
|
|
11
|
+
*/
|
|
12
|
+
priceSpecification?: factory.order.ITicketPriceSpecification;
|
|
13
|
+
})[];
|
|
9
14
|
orderStatus: factory.orderStatus.OrderInTransit;
|
|
10
15
|
};
|
|
11
16
|
declare function createInformTasks(params: {
|
|
@@ -9,7 +9,6 @@ exports.onOrderDeliveredPartially = onOrderDeliveredPartially;
|
|
|
9
9
|
*/
|
|
10
10
|
const debug_1 = __importDefault(require("debug"));
|
|
11
11
|
const factory_1 = require("../../../factory");
|
|
12
|
-
// import { Settings } from '../../../settings';
|
|
13
12
|
const factory_2 = require("./onOrderDeliveredPartially/factory");
|
|
14
13
|
const debug = (0, debug_1.default)('chevre-domain:service:order');
|
|
15
14
|
function onOrderDeliveredPartially(params) {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { TaskRepo } from '../../../repo/task';
|
|
2
2
|
import type { PlaceOrderRepo } from '../../../repo/transaction/placeOrder';
|
|
3
3
|
import { factory } from '../../../factory';
|
|
4
|
-
import { Settings } from '../../../
|
|
4
|
+
import type { IntegrationSettingRepo as Settings } from '../../../repo/setting/integration';
|
|
5
5
|
interface IOnOrderInTransitRepos {
|
|
6
6
|
task: TaskRepo;
|
|
7
7
|
placeOrder: PlaceOrderRepo;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { SettingRepo } from '../../../repo/setting';
|
|
2
2
|
import type { TaskRepo } from '../../../repo/task';
|
|
3
3
|
import { factory } from '../../../factory';
|
|
4
|
-
import { Settings } from '../../../
|
|
4
|
+
import type { IntegrationSettingRepo as Settings } from '../../../repo/setting/integration';
|
|
5
5
|
import { IExternalOrder, IProcessingOrder } from './onOrderProcessing/factory';
|
|
6
6
|
import { processOrder } from './onOrderProcessing/processOrder';
|
|
7
7
|
type IPlaceOrderTransaction = Pick<factory.transaction.placeOrder.ITransaction, 'id' | 'typeOf' | 'potentialActions'>;
|
|
@@ -18,7 +18,8 @@ const debug = (0, debug_1.default)('chevre-domain:service:order');
|
|
|
18
18
|
function onOrderProcessing(params) {
|
|
19
19
|
return async (repos, settings) => {
|
|
20
20
|
const setting = await repos.setting.findOne({ project: { id: { $eq: '*' } } }, ['onOrderStatusChanged']);
|
|
21
|
-
const { numTryConfirmReserveTransaction } = settings;
|
|
21
|
+
// const { numTryConfirmReserveTransaction } = settings;
|
|
22
|
+
const numTryConfirmReserveTransaction = await settings.getByKey('numTryConfirmReserveTransaction');
|
|
22
23
|
debug('onOrderStatusChanged called.', params.order.orderNumber, params.order.orderStatus, params.order.orderDate);
|
|
23
24
|
let tasks;
|
|
24
25
|
let creatingCheckResourceTask;
|
|
@@ -10,7 +10,6 @@ exports.onOrderReturned = onOrderReturned;
|
|
|
10
10
|
const debug_1 = __importDefault(require("debug"));
|
|
11
11
|
const google_libphonenumber_1 = require("google-libphonenumber");
|
|
12
12
|
const factory_1 = require("../../../factory");
|
|
13
|
-
// import { Settings } from '../../../settings';
|
|
14
13
|
// import { createMaskedCustomer } from '../../../factory/order';
|
|
15
14
|
const factory_2 = require("./onOrderReturned/factory");
|
|
16
15
|
const debug = (0, debug_1.default)('chevre-domain:service:order');
|
|
@@ -2,7 +2,6 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.onOrderUpdated = onOrderUpdated;
|
|
4
4
|
const factory_1 = require("../../factory");
|
|
5
|
-
// import { Settings } from '../../settings';
|
|
6
5
|
const factory_2 = require("./onOrderUpdated/factory");
|
|
7
6
|
function onOrderUpdated(params) {
|
|
8
7
|
return async (repos
|
|
@@ -4,7 +4,7 @@ import type { SettingRepo } from '../../repo/setting';
|
|
|
4
4
|
import type { TaskRepo } from '../../repo/task';
|
|
5
5
|
import type { PlaceOrderRepo } from '../../repo/transaction/placeOrder';
|
|
6
6
|
import { factory } from '../../factory';
|
|
7
|
-
import { Settings } from '../../
|
|
7
|
+
import type { IntegrationSettingRepo as Settings } from '../../repo/setting/integration';
|
|
8
8
|
/**
|
|
9
9
|
* 注文を決済する
|
|
10
10
|
*/
|
|
@@ -22,4 +22,4 @@ declare function createPlacingOrderFromExistingTransaction(params: {
|
|
|
22
22
|
placeOrderTransaction: IPlaceOrderTransaction;
|
|
23
23
|
serialNumbers: string[];
|
|
24
24
|
}>;
|
|
25
|
-
export { ICreatePlacingOrderFromExistingTransactionRepos, createPlacingOrderFromExistingTransaction };
|
|
25
|
+
export { ICreatePlacingOrderFromExistingTransactionRepos, IPlacingOrder, createPlacingOrderFromExistingTransaction };
|
|
@@ -13,18 +13,27 @@ function createPlacingOrderFromExistingTransaction(params) {
|
|
|
13
13
|
project: { id: { $eq: params.project.id } },
|
|
14
14
|
typeOf: factory_1.factory.transactionType.PlaceOrder,
|
|
15
15
|
statuses: [factory_1.factory.transactionStatusType.Confirmed],
|
|
16
|
-
result
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
orderNumbers: [orderNumber]
|
|
20
|
-
}
|
|
16
|
+
// resultではなくobjectで参照するように変更(2026-06-16~)
|
|
17
|
+
object: {
|
|
18
|
+
orderNumber: { $eq: orderNumber },
|
|
21
19
|
},
|
|
22
|
-
|
|
20
|
+
// result: {
|
|
21
|
+
// order: {
|
|
22
|
+
// confirmationNumber: { $eq: confirmationNumber },
|
|
23
|
+
// orderNumbers: [orderNumber]
|
|
24
|
+
// }
|
|
25
|
+
// },
|
|
26
|
+
inclusion: ['project', 'typeOf', 'result', 'object', 'seller']
|
|
23
27
|
});
|
|
24
28
|
const placeOrderTransactionWithResult = placeOrderTransactions.shift();
|
|
25
29
|
if (placeOrderTransactionWithResult === undefined) {
|
|
26
30
|
throw new factory_1.factory.errors.NotFound(factory_1.factory.transactionType.PlaceOrder);
|
|
27
31
|
}
|
|
32
|
+
// 参照時の条件に含まれないので、確認番号はここで検証(2026-06-16~)
|
|
33
|
+
if (typeof placeOrderTransactionWithResult.object.confirmationNumber !== 'string'
|
|
34
|
+
|| placeOrderTransactionWithResult.object.confirmationNumber !== confirmationNumber) {
|
|
35
|
+
throw new factory_1.factory.errors.NotFound(factory_1.factory.transactionType.PlaceOrder, `${factory_1.factory.transactionType.PlaceOrder} not found with the confirmationNumber`);
|
|
36
|
+
}
|
|
28
37
|
let authorizePaymentActions = [];
|
|
29
38
|
let authorizeOfferActionsWithInstrument = [];
|
|
30
39
|
const authorizeActionsAsResult = placeOrderTransactionWithResult.result?.authorizeActions;
|
|
@@ -80,7 +89,10 @@ function createPlacingOrderFromExistingTransaction(params) {
|
|
|
80
89
|
.map(({ instrument }) => String(instrument.transactionNumber));
|
|
81
90
|
try {
|
|
82
91
|
// すでにtypeOf: Orderに変更済の場合acceptedOffersは空になるが、そもそもorderedItemはその後上書きされないので、空のまま処理して問題なし
|
|
83
|
-
acceptedOffers = (await repos.orderInTransaction.
|
|
92
|
+
acceptedOffers = (await repos.orderInTransaction.findAcceptedOffersWithPriceByOrderNumber({
|
|
93
|
+
orderNumber,
|
|
94
|
+
project: { id: params.project.id }
|
|
95
|
+
}))
|
|
84
96
|
.filter(({ serialNumber }) => typeof serialNumber === 'string' && serialNumbers.includes(serialNumber));
|
|
85
97
|
}
|
|
86
98
|
catch (error) {
|
|
@@ -3,6 +3,6 @@ import { factory } from '../../../../factory';
|
|
|
3
3
|
* 受入オファーを注文アイテムに変換する
|
|
4
4
|
*/
|
|
5
5
|
declare function acceptedOffers2orderedItem(params: {
|
|
6
|
-
eventReservationAcceptedOffers: factory.order.IAcceptedOffer[];
|
|
6
|
+
eventReservationAcceptedOffers: Pick<factory.order.IAcceptedOffer, 'itemOffered'>[];
|
|
7
7
|
}): factory.order.IOrderedItem[];
|
|
8
8
|
export { acceptedOffers2orderedItem };
|
|
@@ -9,11 +9,6 @@ function acceptedOffers2orderedItem(params) {
|
|
|
9
9
|
// 予約がある場合
|
|
10
10
|
const { reservationOrderItems } = createReservationAcceptedOffers(params);
|
|
11
11
|
// 通貨転送がある場合
|
|
12
|
-
// const { moneyTransferOrderItems } = createMoneyTransferAcceptedOffers(params);
|
|
13
|
-
// プロダクトがある場合
|
|
14
|
-
// const { productOrderItems } = createProductItems(params);
|
|
15
|
-
// return [...reservationOrderItems, ...moneyTransferOrderItems, ...productOrderItems];
|
|
16
|
-
// return [...reservationOrderItems, ...productOrderItems];
|
|
17
12
|
return reservationOrderItems;
|
|
18
13
|
}
|
|
19
14
|
function createReservationAcceptedOffers(params) {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { IPlacingOrder } from '../../../repo/orderInTransaction';
|
|
2
2
|
import { factory } from '../../../factory';
|
|
3
3
|
type IPlaceOrderTransaction = Pick<factory.transaction.placeOrder.ITransaction, 'id' | 'project' | 'typeOf' | 'result' | 'object' | 'seller'>;
|
|
4
|
-
type IOrderAcceptedOffer = factory.order.IAcceptedOffer
|
|
4
|
+
type IOrderAcceptedOffer = Pick<factory.order.IAcceptedOffer, 'itemOffered' | 'serialNumber'>;
|
|
5
5
|
declare function createPaymentMethods(params: {
|
|
6
6
|
authorizePaymentActions: Pick<factory.action.authorize.paymentMethod.any.IAction, 'result'>[];
|
|
7
7
|
}): {
|
|
@@ -15,7 +15,6 @@ function createPaymentMethods(params) {
|
|
|
15
15
|
// 決済方法をセット
|
|
16
16
|
params.authorizePaymentActions.forEach((a) => {
|
|
17
17
|
const resultAsInvoice = (Array.isArray(a.result))
|
|
18
|
-
// ? a.result?.find(({ typeOf }) => typeOf === factory.action.authorize.paymentMethod.any.ResultType.Payment)
|
|
19
18
|
? a.result[0]
|
|
20
19
|
: undefined;
|
|
21
20
|
if (resultAsInvoice === undefined) {
|
|
@@ -42,16 +41,12 @@ function createPaymentMethods(params) {
|
|
|
42
41
|
paymentStatus: resultAsInvoice.paymentStatus,
|
|
43
42
|
paymentMethod: paymentMethodOfInvoice,
|
|
44
43
|
...(resultAsInvoice.totalPaymentDue !== undefined) ? { totalPaymentDue: resultAsInvoice.totalPaymentDue } : undefined
|
|
45
|
-
// ...(USE_ORDER_PAYMENT_METHOD_TYPE_OF) // 完全廃止(2024-01-17~)
|
|
46
|
-
// ? { typeOf: paymentMethodType }
|
|
47
|
-
// : undefined
|
|
48
44
|
});
|
|
49
45
|
});
|
|
50
46
|
// 決済方法から注文金額の計算
|
|
51
47
|
price += params.authorizePaymentActions
|
|
52
48
|
.reduce((a, b) => {
|
|
53
49
|
const resultAsInvoice = (Array.isArray(b.result))
|
|
54
|
-
// ? b.result?.find(({ typeOf }) => typeOf === factory.action.authorize.paymentMethod.any.ResultType.Payment)
|
|
55
50
|
? b.result[0]
|
|
56
51
|
: undefined;
|
|
57
52
|
const jpyAmount = (resultAsInvoice?.totalPaymentDue?.currency === factory_1.factory.priceCurrency.JPY)
|
|
@@ -73,47 +68,63 @@ function createSeller(params) {
|
|
|
73
68
|
}
|
|
74
69
|
function createPlacingOrder(params) {
|
|
75
70
|
const { transaction, authorizePaymentActions } = params;
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
71
|
+
let orderDateByTransaction;
|
|
72
|
+
const { confirmationNumber, orderDate, orderNumber } = transaction.object;
|
|
73
|
+
if (typeof confirmationNumber !== 'string') {
|
|
74
|
+
// 事前に発行済なはずなので、ありえないフロー
|
|
75
|
+
throw new factory_1.factory.errors.Internal('object.confirmationNumber undefined');
|
|
79
76
|
}
|
|
77
|
+
if (typeof orderNumber !== 'string') {
|
|
78
|
+
// 事前に発行済なはずなので、ありえないフロー
|
|
79
|
+
throw new factory_1.factory.errors.Internal('object.orderNumber undefined');
|
|
80
|
+
}
|
|
81
|
+
if (orderDate === undefined) {
|
|
82
|
+
orderDateByTransaction = transaction.result?.order?.orderDate;
|
|
83
|
+
}
|
|
84
|
+
else {
|
|
85
|
+
orderDateByTransaction = orderDate;
|
|
86
|
+
}
|
|
87
|
+
if (orderDateByTransaction === undefined) {
|
|
88
|
+
throw new factory_1.factory.errors.NotFound('orderDate in the transaction');
|
|
89
|
+
}
|
|
90
|
+
// const orderByTransaction = transaction.result?.order;
|
|
91
|
+
// if (orderByTransaction === undefined) {
|
|
92
|
+
// throw new factory.errors.NotFound('transaction.result.order');
|
|
93
|
+
// }
|
|
80
94
|
const seller = createSeller({ transaction });
|
|
81
|
-
|
|
95
|
+
// discontinue(2026-06-11~)
|
|
96
|
+
// const name: string | undefined =
|
|
97
|
+
// (typeof transaction.object.name === 'string') ? transaction.object.name : undefined;
|
|
82
98
|
const broker = (typeof transaction.object.broker?.typeOf === 'string') ? transaction.object.broker : undefined;
|
|
83
99
|
const { paymentMethods, price } = createPaymentMethods({ authorizePaymentActions });
|
|
84
100
|
const eventReservationAcceptedOffers = [];
|
|
85
|
-
// const productAcceptedOffers: factory.order.IAcceptedOffer<factory.order.IPermit>[] = [];
|
|
86
|
-
// const moneyTransferAcceptedOffers: factory.order.IAcceptedOffer<factory.order.IMoneyTransfer>[] = [];
|
|
87
101
|
params.acceptedOffers.forEach((acceptedOffer) => {
|
|
88
102
|
const itemOfferedTypeOf = acceptedOffer.itemOffered.typeOf;
|
|
89
103
|
switch (itemOfferedTypeOf) {
|
|
90
104
|
case factory_1.factory.reservationType.EventReservation:
|
|
91
105
|
eventReservationAcceptedOffers.push(acceptedOffer);
|
|
92
106
|
break;
|
|
93
|
-
// case factory.permit.PermitType.Permit:
|
|
94
|
-
// productAcceptedOffers.push((acceptedOffer as factory.order.IAcceptedOffer<factory.order.IPermit>));
|
|
95
|
-
// break;
|
|
96
|
-
// case factory.actionType.MoneyTransfer:
|
|
97
|
-
// moneyTransferAcceptedOffers.push(<factory.order.IAcceptedOffer<factory.order.IMoneyTransfer>>acceptedOffer);
|
|
98
|
-
// break;
|
|
99
107
|
default:
|
|
100
108
|
throw new factory_1.factory.errors.NotImplemented(`${itemOfferedTypeOf} not implemented`);
|
|
101
109
|
}
|
|
102
110
|
});
|
|
103
111
|
const orderedItem = (0, orderedItem_1.acceptedOffers2orderedItem)({
|
|
104
112
|
eventReservationAcceptedOffers,
|
|
105
|
-
// productAcceptedOffers,
|
|
106
|
-
// moneyTransferAcceptedOffers
|
|
107
113
|
});
|
|
108
114
|
return {
|
|
109
|
-
...orderByTransaction,
|
|
115
|
+
// ...orderByTransaction, // transaction.result.orderへの依存廃止(2026-06-15~)
|
|
116
|
+
confirmationNumber,
|
|
117
|
+
orderNumber,
|
|
118
|
+
typeOf: factory_1.factory.order.OrderType.Order, // 取引保管を廃止するためにここで指定(2026-06-14~)
|
|
119
|
+
orderStatus: factory_1.factory.orderStatus.OrderPaymentDue, // 取引保管を廃止するためにここで指定(2026-06-14~)
|
|
110
120
|
seller, // 2024-06-17~
|
|
111
121
|
paymentMethods, // 2024-06-17~
|
|
112
122
|
price, // 2024-06-17~
|
|
113
|
-
|
|
123
|
+
priceCurrency: factory_1.factory.priceCurrency.JPY, // 取引保管を廃止するためにここで指定(2026-06-14~)
|
|
124
|
+
orderDate: (0, moment_1.default)(orderDateByTransaction)
|
|
114
125
|
.toDate(),
|
|
115
126
|
orderedItem, // 2024-06-18~
|
|
116
|
-
...(typeof name === 'string') ? { name } : undefined, //
|
|
127
|
+
// ...(typeof name === 'string') ? { name } : undefined, // discontinue(2026-06-11~)
|
|
117
128
|
...(typeof broker?.typeOf === 'string') ? { broker } : undefined // 2024-06-17~
|
|
118
129
|
};
|
|
119
130
|
}
|
|
@@ -9,7 +9,8 @@ import type { SettingRepo } from '../../repo/setting';
|
|
|
9
9
|
import type { TaskRepo } from '../../repo/task';
|
|
10
10
|
import type { PlaceOrderRepo } from '../../repo/transaction/placeOrder';
|
|
11
11
|
import { factory } from '../../factory';
|
|
12
|
-
import { Settings } from '../../
|
|
12
|
+
import type { IntegrationSettingRepo as Settings } from '../../repo/setting/integration';
|
|
13
|
+
import { IPlacingOrder } from './placeOrder/createPlacingOrderFromExistingTransaction';
|
|
13
14
|
interface IPlaceOrderRepos {
|
|
14
15
|
acceptedOffer: AcceptedOfferRepo;
|
|
15
16
|
accountingReport: AccountingReportRepo;
|
|
@@ -36,6 +37,6 @@ declare function placeOrder(params: {
|
|
|
36
37
|
};
|
|
37
38
|
useOnOrderStatusChanged: boolean;
|
|
38
39
|
}): (repos: IPlaceOrderRepos, settings: Settings) => Promise<{
|
|
39
|
-
order:
|
|
40
|
+
order: IPlacingOrder;
|
|
40
41
|
}>;
|
|
41
42
|
export { IPlaceOrderRepos, placeOrder };
|
|
@@ -31,15 +31,7 @@ function placeOrder(params) {
|
|
|
31
31
|
}
|
|
32
32
|
const simpleOrder = {
|
|
33
33
|
typeOf: order.typeOf,
|
|
34
|
-
// seller: {
|
|
35
|
-
// id: order.seller.id,
|
|
36
|
-
// typeOf: order.seller.typeOf,
|
|
37
|
-
// name: order.seller.name
|
|
38
|
-
// }, // 廃止(2024-03-06~)
|
|
39
|
-
// customer: { typeOf: maskedCustomer.typeOf, id: maskedCustomer.id }, // 廃止(2024-03-06~)
|
|
40
34
|
orderNumber: order.orderNumber,
|
|
41
|
-
// price: order.price,
|
|
42
|
-
// priceCurrency: order.priceCurrency,
|
|
43
35
|
orderDate: order.orderDate
|
|
44
36
|
};
|
|
45
37
|
const orderActionPurpose = {
|
|
@@ -48,7 +40,6 @@ function placeOrder(params) {
|
|
|
48
40
|
const orderActionAttributes = {
|
|
49
41
|
agent: (typeof params.agent?.typeOf === 'string') ? params.agent : placeOrderTransaction.project,
|
|
50
42
|
object: simpleOrder,
|
|
51
|
-
// potentialActions: {}, // discontinue(2024-06-28~)
|
|
52
43
|
project: placeOrderTransaction.project,
|
|
53
44
|
purpose: orderActionPurpose,
|
|
54
45
|
typeOf: factory_1.factory.actionType.OrderAction
|
|
@@ -8,7 +8,6 @@ const debug_1 = __importDefault(require("debug"));
|
|
|
8
8
|
// import { createMaskedCustomer } from '../../factory/order';
|
|
9
9
|
const onOrderStatusChanged_1 = require("./onOrderStatusChanged");
|
|
10
10
|
const factory_1 = require("../../factory");
|
|
11
|
-
// import { Settings } from '../../settings';
|
|
12
11
|
const debug = (0, debug_1.default)('chevre-domain:service:order');
|
|
13
12
|
function createReturnPolicy(params) {
|
|
14
13
|
const { identifier, returnFees, restockingFee, typeOf } = params.returnOrderTransaction.object.returnPolicy;
|
|
@@ -10,7 +10,6 @@ const factory_1 = require("../delivery/factory");
|
|
|
10
10
|
// import { findPlaceOrderTransaction } from './findPlaceOrderTransaction';
|
|
11
11
|
const onOrderStatusChanged_1 = require("./onOrderStatusChanged");
|
|
12
12
|
const factory_2 = require("../../factory");
|
|
13
|
-
// import { Settings } from '../../settings';
|
|
14
13
|
const debug = (0, debug_1.default)('chevre-domain:service:order');
|
|
15
14
|
/**
|
|
16
15
|
* 注文を配送する
|
|
@@ -94,10 +93,7 @@ function sendOrder(params) {
|
|
|
94
93
|
case factory_2.factory.personType.Person:
|
|
95
94
|
createOwnerships = true; // Personのみに限定(2026-03-15~)
|
|
96
95
|
break;
|
|
97
|
-
// case factory.creativeWorkType.WebApplication:
|
|
98
|
-
// break;
|
|
99
96
|
default:
|
|
100
|
-
// createOwnerships = true;
|
|
101
97
|
}
|
|
102
98
|
try {
|
|
103
99
|
const offerIndexBase = (limit * (page - 1));
|
|
@@ -107,8 +103,7 @@ function sendOrder(params) {
|
|
|
107
103
|
project: { id: { $eq: order.project.id } }
|
|
108
104
|
});
|
|
109
105
|
acceptedOffers = searchSlicedAcceptedOffersResult.acceptedOffers;
|
|
110
|
-
debug('delivering...', order.orderNumber,
|
|
111
|
-
params.object.acceptedOffers, 'offerIndexBase:', offerIndexBase);
|
|
106
|
+
debug('delivering...', order.orderNumber, params.object.acceptedOffers, 'offerIndexBase:', offerIndexBase);
|
|
112
107
|
// 所有権作成
|
|
113
108
|
if (createOwnerships) {
|
|
114
109
|
creatingOwnershipInfos = (0, factory_1.createOwnershipInfosFromOrder)({
|
|
@@ -163,7 +158,6 @@ function sendOrder(params) {
|
|
|
163
158
|
price: order.price,
|
|
164
159
|
priceCurrency: order.priceCurrency
|
|
165
160
|
}
|
|
166
|
-
// placeOrderTransaction
|
|
167
161
|
})(repos);
|
|
168
162
|
}
|
|
169
163
|
else {
|
|
@@ -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';
|
|
@@ -162,12 +162,13 @@ function creatPayTransactionStartParams(params) {
|
|
|
162
162
|
};
|
|
163
163
|
}
|
|
164
164
|
function createMovieTicket(params) {
|
|
165
|
-
|
|
166
|
-
//
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
165
|
+
const ticketIdentifier = (0, util_1.format)('%s:%s:%s', params.serviceOutput.reservationFor.id, params.serviceOutput.reservedTicket.ticketedSeat.seatSection, params.serviceOutput.reservedTicket.ticketedSeat.seatNumber);
|
|
166
|
+
// カスタム指定は廃止(2026-06-08~)
|
|
167
|
+
// // 指定があれば採用(2024-04-16~)
|
|
168
|
+
// const ticketIdentifierByRequest = params.serviceOutput.reservedTicket.identifier;
|
|
169
|
+
// if (typeof ticketIdentifierByRequest === 'string' && ticketIdentifierByRequest.length > 0) {
|
|
170
|
+
// ticketIdentifier = ticketIdentifierByRequest;
|
|
171
|
+
// }
|
|
171
172
|
const serviceOutput = {
|
|
172
173
|
reservationFor: {
|
|
173
174
|
typeOf: params.serviceOutput.reservationFor.typeOf,
|
|
@@ -2,7 +2,6 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.person2username = person2username;
|
|
4
4
|
const factory_1 = require("../../../factory");
|
|
5
|
-
// import { Settings } from '../../../settings';
|
|
6
5
|
const person_1 = require("../../../repo/person");
|
|
7
6
|
const SSKTS_PROVIDER_NAME = 'SSKTS';
|
|
8
7
|
async function person2username(person, cognitoIdentityServiceProvider, setting
|
|
@@ -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 { AcceptPayActionRepo } from '../../../repo/action/acceptPay';
|
|
4
4
|
import type { AuthorizeInvoiceActionRepo } from '../../../repo/action/authorizeInvoice';
|
|
5
5
|
import type { AssetTransactionRepo } from '../../../repo/assetTransaction';
|
|
@@ -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 { AuthorizeInvoiceActionRepo } from '../../../repo/action/authorizeInvoice';
|
|
4
4
|
import type { PaymentServiceRepo } from '../../../repo/paymentService';
|
|
5
5
|
import type { PaymentServiceProviderRepo } from '../../../repo/paymentServiceProvider';
|
|
@@ -47,10 +47,11 @@ payTransaction, paymentServiceId, options) {
|
|
|
47
47
|
try {
|
|
48
48
|
// タスクによって実行されているかどうか
|
|
49
49
|
const executedByTask = typeof options.executor?.id === 'string' && options.executor.id !== '';
|
|
50
|
+
const gmoIntegrationSettings = await settings.getByKey('gmo');
|
|
50
51
|
// 非同期承認時に長時間対応(2024-05-18~)
|
|
51
|
-
const timeout = (executedByTask && typeof
|
|
52
|
-
?
|
|
53
|
-
:
|
|
52
|
+
const timeout = (executedByTask && typeof gmoIntegrationSettings.timeoutBackground === 'number')
|
|
53
|
+
? gmoIntegrationSettings.timeoutBackground
|
|
54
|
+
: gmoIntegrationSettings.timeout;
|
|
54
55
|
debug('processAuthorizeCreditCard processing... executor:', options.executor?.id, 'timeout:', timeout);
|
|
55
56
|
const creditCardService = new gmo_service_1.GMO.service.Credit({
|
|
56
57
|
endpoint: String(availableChannel.serviceUrl)
|
|
@@ -6,7 +6,7 @@ import type { PaymentServiceProviderRepo } from '../../../repo/paymentServicePro
|
|
|
6
6
|
import type { SellerPaymentAcceptedRepo } from '../../../repo/sellerPaymentAccepted';
|
|
7
7
|
import type { TaskRepo } from '../../../repo/task';
|
|
8
8
|
import { factory } from '../../../factory';
|
|
9
|
-
import { Settings } from '../../../
|
|
9
|
+
import type { IntegrationSettingRepo as Settings } from '../../../repo/setting/integration';
|
|
10
10
|
/**
|
|
11
11
|
* クレジットカード決済
|
|
12
12
|
*/
|
|
@@ -39,7 +39,7 @@ function payCreditCard(params) {
|
|
|
39
39
|
try {
|
|
40
40
|
const creditService = new gmo_service_1.GMO.service.Credit({
|
|
41
41
|
endpoint: String(availableChannel.serviceUrl)
|
|
42
|
-
}, { timeout: settings.gmo.timeout });
|
|
42
|
+
}, { timeout: (await settings.getByKey('gmo')).timeout });
|
|
43
43
|
await Promise.all(payObject.map(async (paymentMethod) => {
|
|
44
44
|
const processAlterTranResult = await processAlterTran({
|
|
45
45
|
shopId, shopPass, availableChannel, paymentMethod
|
|
@@ -6,7 +6,7 @@ import type { PaymentServiceProviderRepo } from '../../../repo/paymentServicePro
|
|
|
6
6
|
import type { SellerPaymentAcceptedRepo } from '../../../repo/sellerPaymentAccepted';
|
|
7
7
|
import type { TaskRepo } from '../../../repo/task';
|
|
8
8
|
import { factory } from '../../../factory';
|
|
9
|
-
import { Settings } from '../../../
|
|
9
|
+
import type { IntegrationSettingRepo as Settings } from '../../../repo/setting/integration';
|
|
10
10
|
/**
|
|
11
11
|
* refund CreditCard IF payment
|
|
12
12
|
*/
|
|
@@ -59,7 +59,7 @@ function refundCreditCard(params
|
|
|
59
59
|
try {
|
|
60
60
|
const creditService = new gmo_service_1.GMO.service.Credit({
|
|
61
61
|
endpoint: String(availableChannel.serviceUrl)
|
|
62
|
-
}, { timeout: settings.gmo.timeout });
|
|
62
|
+
}, { timeout: (await settings.getByKey('gmo')).timeout });
|
|
63
63
|
processAlterTranResult = await processAlterTran({
|
|
64
64
|
availableChannel,
|
|
65
65
|
alterTranResultByPayAction,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { GMO } from '@motionpicture/gmo-service';
|
|
2
2
|
import { factory } from '../../../factory';
|
|
3
|
-
import { Settings } from '../../../
|
|
3
|
+
import type { IntegrationSettingRepo as Settings } from '../../../repo/setting/integration';
|
|
4
4
|
/**
|
|
5
5
|
* 決済代行側の取引状態参照
|
|
6
6
|
* 存在しない場合NotFoundエラー
|
|
@@ -11,7 +11,7 @@ const gmoError_1 = require("./gmoError");
|
|
|
11
11
|
async function searchGMOTrade(params, settings) {
|
|
12
12
|
const creditCardService = new gmo_service_1.GMO.service.Credit({
|
|
13
13
|
endpoint: String(params.availableChannel.serviceUrl)
|
|
14
|
-
}, { timeout: settings.gmo.timeout });
|
|
14
|
+
}, { timeout: (await settings.getByKey('gmo')).timeout });
|
|
15
15
|
// 取引状態参照
|
|
16
16
|
let searchTradeResult;
|
|
17
17
|
try {
|
|
@@ -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 { AuthorizeInvoiceActionRepo } from '../../../repo/action/authorizeInvoice';
|
|
4
4
|
import type { PaymentServiceRepo } from '../../../repo/paymentService';
|
|
5
5
|
import type { PaymentServiceProviderRepo } from '../../../repo/paymentServiceProvider';
|