@chevre/domain 24.1.0-alpha.4 → 24.1.0-alpha.41
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/README.md +0 -2
- package/lib/chevre/emailMessageBuilder.js +4 -12
- package/lib/chevre/index.d.ts +1 -2
- package/lib/chevre/index.js +1 -3
- package/lib/chevre/repo/acceptedOffer.d.ts +14 -13
- package/lib/chevre/repo/acceptedOffer.js +128 -51
- package/lib/chevre/repo/acceptedOfferInReserve.d.ts +32 -0
- package/lib/chevre/repo/acceptedOfferInReserve.js +84 -0
- package/lib/chevre/repo/accountingReport.d.ts +9 -2
- package/lib/chevre/repo/accountingReport.js +6 -34
- package/lib/chevre/repo/action/actionProcess.d.ts +1 -1
- package/lib/chevre/repo/assetTransaction/reserve.d.ts +0 -1
- 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 +7 -0
- package/lib/chevre/repo/factory/acceptedOffer/reserveTransaction2itemOffered.js +74 -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 +108 -108
- package/lib/chevre/repo/mongoose/schemas/reservation.d.ts +3 -1
- package/lib/chevre/repo/mongoose/schemas/reservation.js +128 -146
- package/lib/chevre/repo/mongoose/schemas/setting.d.ts +65 -0
- package/lib/chevre/repo/mongoose/schemas/setting.js +2 -1
- package/lib/chevre/repo/order.d.ts +2 -83
- package/lib/chevre/repo/order.js +171 -364
- package/lib/chevre/repo/orderInTransaction.d.ts +48 -6
- 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 +26 -0
- package/lib/chevre/repo/setting/integration.js +94 -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/factory/createReservation.js +0 -12
- 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 +13 -15
- package/lib/chevre/service/offer/event/authorize/processStartReserve4chevre.d.ts +1 -1
- package/lib/chevre/service/offer/event/authorize.d.ts +6 -1
- package/lib/chevre/service/offer/event/authorize.js +51 -4
- 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 -3
- package/lib/chevre/service/order/createAccountingReportIfNotExist.js +67 -72
- package/lib/chevre/service/order/deleteOrder.js +23 -44
- 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.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.d.ts +1 -1
- package/lib/chevre/service/order/returnOrder.js +0 -1
- package/lib/chevre/service/order/sendOrder.js +4 -5
- package/lib/chevre/service/payment/any/authorize.d.ts +1 -1
- 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 +4 -1
- package/lib/chevre/service/reserve/findReservations.d.ts +4 -4
- package/lib/chevre/service/reserve/findReservations.js +16 -26
- 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 +10 -3
- package/lib/chevre/service/reserve/useReservation.d.ts +1 -1
- package/lib/chevre/service/task/acceptCOAOffer.js +3 -2
- package/lib/chevre/service/task/authorizePayment.js +1 -1
- package/lib/chevre/service/task/cancelPendingReservation.js +1 -1
- package/lib/chevre/service/task/checkMovieTicket.js +1 -1
- package/lib/chevre/service/task/confirmReserveTransaction.d.ts +1 -1
- package/lib/chevre/service/task/confirmReserveTransaction.js +5 -2
- package/lib/chevre/service/task/createAccountingReport.js +7 -9
- package/lib/chevre/service/task/importEventCapacitiesFromCOA.js +1 -1
- package/lib/chevre/service/task/importEventsFromCOA.js +1 -1
- package/lib/chevre/service/task/importOffersFromCOA.js +1 -1
- package/lib/chevre/service/task/onResourceUpdated/onHasPOSUpdated.js +0 -1
- package/lib/chevre/service/task/pay.js +1 -1
- 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 +5 -2
- 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/refund.js +1 -1
- package/lib/chevre/service/task/returnReserveTransaction.js +1 -1
- package/lib/chevre/service/task/sendEmailMessage.js +5 -3
- package/lib/chevre/service/task/syncResourcesFromCOA.js +1 -1
- package/lib/chevre/service/task/useReservation.d.ts +2 -2
- package/lib/chevre/service/task/useReservation.js +5 -16
- package/lib/chevre/service/task/voidPayment.js +1 -1
- package/lib/chevre/service/task/voidReserveTransaction.js +1 -1
- package/lib/chevre/service/task.d.ts +0 -7
- package/lib/chevre/service/task.js +10 -2
- package/lib/chevre/service/taskHandler.js +1 -0
- package/lib/chevre/service/transaction/placeOrder/confirm/potentialActions/sendEmailMessage.js +0 -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 +2 -2
- package/lib/chevre/service/transaction/placeOrder/confirm.js +5 -3
- package/lib/chevre/service/transaction/placeOrder/exportTasksById.js +0 -1
- package/lib/chevre/service/transaction/placeOrder/updateAgent.js +0 -1
- package/lib/chevre/service/transaction/returnOrder/exportTasks/factory.js +0 -1
- package/lib/chevre/service/transaction/returnOrder/potentialActions/returnPaymentMethod.js +0 -1
- package/lib/chevre/service/transaction/returnOrder/potentialActions.js +0 -1
- package/lib/chevre/service/transaction/returnOrder/preStart.js +4 -4
- package/lib/chevre/service/validation/validateOrder.js +7 -79
- package/lib/chevre/settings.d.ts +0 -55
- package/lib/chevre/settings.js +1 -29
- package/lib/chevre/taskSettings.d.ts +5 -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
|
@@ -27,9 +27,12 @@ function createAccountingReport(params) {
|
|
|
27
27
|
orderNumber: data.object.mainEntity.orderNumber,
|
|
28
28
|
project: { id: params.project.id },
|
|
29
29
|
inclusion: [
|
|
30
|
-
'orderNumber', 'project', '
|
|
31
|
-
|
|
32
|
-
|
|
30
|
+
'orderNumber', 'project', 'paymentMethods', 'seller', 'typeOf', 'orderDate'
|
|
31
|
+
// 'customer', 'confirmationNumber',
|
|
32
|
+
// 'orderedItem',
|
|
33
|
+
// 'broker',
|
|
34
|
+
// 'price', 'priceCurrency',
|
|
35
|
+
]
|
|
33
36
|
});
|
|
34
37
|
const simpleOrder = {
|
|
35
38
|
typeOf: order.typeOf,
|
|
@@ -37,7 +40,6 @@ function createAccountingReport(params) {
|
|
|
37
40
|
orderDate: order.orderDate
|
|
38
41
|
};
|
|
39
42
|
const actionObject = {
|
|
40
|
-
// ...params,
|
|
41
43
|
mainEntity: { orderNumber: simpleOrder.orderNumber },
|
|
42
44
|
typeOf: 'Report'
|
|
43
45
|
};
|
|
@@ -51,13 +53,9 @@ function createAccountingReport(params) {
|
|
|
51
53
|
};
|
|
52
54
|
const action = await repos.action.start(actionAttributes);
|
|
53
55
|
try {
|
|
54
|
-
const acceptedOffers = await repos.acceptedOffer.searchAcceptedOffersByOrderNumber({
|
|
55
|
-
orderNumber: { $eq: data.object.mainEntity.orderNumber },
|
|
56
|
-
project: { id: { $eq: params.project.id } }
|
|
57
|
-
});
|
|
58
56
|
await (0, createAccountingReportIfNotExist_1.createAccountingReportIfNotExist)({
|
|
59
57
|
...order,
|
|
60
|
-
acceptedOffers
|
|
58
|
+
// acceptedOffers
|
|
61
59
|
})(repos);
|
|
62
60
|
}
|
|
63
61
|
catch (error) {
|
|
@@ -57,7 +57,7 @@ function call(params) {
|
|
|
57
57
|
const reserveService = new coa_service_1.COA.service.Reserve({
|
|
58
58
|
endpoint: coaAuthClient.options.endpoint, // same as authClient(2024-07-17~)
|
|
59
59
|
auth: coaAuthClient
|
|
60
|
-
}, { timeout: settings.coa.
|
|
60
|
+
}, { timeout: (await settings.getByKey('coa')).timeoutReserve });
|
|
61
61
|
await EventAggregationService.importFromCOA(params.data)({
|
|
62
62
|
event: new event_1.EventRepo(connection),
|
|
63
63
|
reserveService
|
|
@@ -64,7 +64,7 @@ function call(params) {
|
|
|
64
64
|
const masterService = new coa_service_1.COA.service.Master({
|
|
65
65
|
endpoint: coaAuthClient.options.endpoint, // same as authClient(2024-07-17~)
|
|
66
66
|
auth: coaAuthClient
|
|
67
|
-
}, { timeout: settings.coa.
|
|
67
|
+
}, { timeout: (await settings.getByKey('coa')).timeoutMaster });
|
|
68
68
|
await EventService.importFromCOA(params.data)({
|
|
69
69
|
action: new action_1.ActionRepo(connection),
|
|
70
70
|
categoryCode: new categoryCode_1.CategoryCodeRepo(connection),
|
|
@@ -67,7 +67,7 @@ function call(params) {
|
|
|
67
67
|
const masterService = new coa_service_1.COA.service.Master({
|
|
68
68
|
endpoint: coaAuthClient.options.endpoint, // same as authClient(2024-07-17~)
|
|
69
69
|
auth: coaAuthClient
|
|
70
|
-
}, { timeout: settings.coa.
|
|
70
|
+
}, { timeout: (await settings.getByKey('coa')).timeoutMaster });
|
|
71
71
|
await OfferService.event.importFromCOA({
|
|
72
72
|
project: { id: params.data.project.id },
|
|
73
73
|
theaterCode: params.data.theaterCode,
|
|
@@ -2,7 +2,6 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.createInformHasPOSTasks = createInformHasPOSTasks;
|
|
4
4
|
const factory_1 = require("../../../factory");
|
|
5
|
-
// import { Settings } from '../../../settings';
|
|
6
5
|
function createInformHasPOSTasks(params) {
|
|
7
6
|
return async (repos
|
|
8
7
|
// settings: Settings
|
|
@@ -38,7 +38,7 @@ function call(params) {
|
|
|
38
38
|
order: new order_1.OrderRepo(connection)
|
|
39
39
|
});
|
|
40
40
|
const paymentServiceId = payActionAttributes.object.at(0)?.id;
|
|
41
|
-
const credentialsExpireInSeconds = settings.movieticketReserve.credentialsExpireInSeconds;
|
|
41
|
+
const credentialsExpireInSeconds = (await settings.getByKey('movieticketReserve')).credentialsExpireInSeconds;
|
|
42
42
|
const useCredentialsRepo = typeof paymentServiceId === 'string' && paymentServiceId !== ''
|
|
43
43
|
&& typeof credentialsExpireInSeconds === 'number' && credentialsExpireInSeconds > 0;
|
|
44
44
|
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;
|
|
@@ -71,13 +71,16 @@ function fixOrderAsPurpose(params, transaction) {
|
|
|
71
71
|
project: { id: { $eq: transaction.project.id } },
|
|
72
72
|
acceptedOffers: {
|
|
73
73
|
itemOffered: {
|
|
74
|
-
typeOf: { $in: [
|
|
74
|
+
// typeOf: { $in: [factory.reservationType.EventReservation] }, // EventReservationしか存在しないので不要(2026-05-12~)
|
|
75
75
|
// movieTicketsに結合されたイベントID,座席コードで絞る
|
|
76
76
|
reservationFor: { id: { $in: [reservationForId] } },
|
|
77
77
|
reservedTicket: { ticketedSeat: { seatNumber: { $in: seatNumbers } } }
|
|
78
78
|
}
|
|
79
79
|
}
|
|
80
|
-
},
|
|
80
|
+
}, {
|
|
81
|
+
useItemOfferedByReserve: true // 2026-05-25~
|
|
82
|
+
} // 予約取引参照(2026-05-18~)
|
|
83
|
+
);
|
|
81
84
|
}
|
|
82
85
|
return {
|
|
83
86
|
...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: {
|
|
@@ -35,7 +35,7 @@ function call(params) {
|
|
|
35
35
|
data = params;
|
|
36
36
|
}
|
|
37
37
|
const paymentServiceId = data.object.at(0)?.id;
|
|
38
|
-
const credentialsExpireInSeconds = settings.movieticketReserve.credentialsExpireInSeconds;
|
|
38
|
+
const credentialsExpireInSeconds = (await settings.getByKey('movieticketReserve')).credentialsExpireInSeconds;
|
|
39
39
|
const useCredentialsRepo = typeof paymentServiceId === 'string' && paymentServiceId !== ''
|
|
40
40
|
&& typeof credentialsExpireInSeconds === 'number' && credentialsExpireInSeconds > 0;
|
|
41
41
|
await (0, refundByTask_1.refundByTask)(data)({
|
|
@@ -75,7 +75,7 @@ function call(params) {
|
|
|
75
75
|
const reserveService = new coa_service_1.COA.service.Reserve({
|
|
76
76
|
endpoint: coaAuthClient.options.endpoint, // same as authClient(2024-07-17~)
|
|
77
77
|
auth: coaAuthClient
|
|
78
|
-
}, { timeout: settings.coa.
|
|
78
|
+
}, { timeout: (await settings.getByKey('coa')).timeoutReserve });
|
|
79
79
|
await returnReserve({
|
|
80
80
|
...params.data,
|
|
81
81
|
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
|
}
|
|
@@ -60,7 +60,7 @@ function call(params) {
|
|
|
60
60
|
const masterService = new coa_service_1.COA.service.Master({
|
|
61
61
|
endpoint: coaAuthClient.options.endpoint, // same as authClient(2024-07-17~)
|
|
62
62
|
auth: coaAuthClient
|
|
63
|
-
}, { timeout: settings.coa.
|
|
63
|
+
}, { timeout: (await settings.getByKey('coa')).timeoutMaster });
|
|
64
64
|
const { agent, object } = params.data;
|
|
65
65
|
if (object.typeOf === factory_1.factory.eventType.ScreeningEventSeries) {
|
|
66
66
|
await syncEventSeries({
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
+
import type { IExecutableTaskKeys, IOperationExecute } from '../taskHandler';
|
|
1
2
|
import { factory } from '../../factory';
|
|
2
|
-
import type { IOperationExecute } from '../taskHandler';
|
|
3
3
|
/**
|
|
4
4
|
* タスク実行関数
|
|
5
5
|
*/
|
|
6
|
-
export declare function call(
|
|
6
|
+
export declare function call(params: Pick<factory.task.useReservation.ITask, IExecutableTaskKeys>): IOperationExecute<void>;
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.call = call;
|
|
4
|
-
const factory_1 = require("../../factory");
|
|
5
4
|
const action_1 = require("../../repo/action");
|
|
6
5
|
const assetTransaction_1 = require("../../repo/assetTransaction");
|
|
7
6
|
const authorization_1 = require("../../repo/authorization");
|
|
@@ -13,25 +12,15 @@ const useReservation_1 = require("../reserve/useReservation");
|
|
|
13
12
|
/**
|
|
14
13
|
* タスク実行関数
|
|
15
14
|
*/
|
|
16
|
-
function call(
|
|
15
|
+
function call(params) {
|
|
17
16
|
return async ({ connection }) => {
|
|
18
|
-
|
|
19
|
-
// support array(2025-02-17~)
|
|
20
|
-
if (Array.isArray(data.instrument)) {
|
|
21
|
-
instrument = data.instrument;
|
|
22
|
-
}
|
|
23
|
-
else {
|
|
24
|
-
throw new factory_1.factory.errors.NotImplemented('instrument as object discontinued');
|
|
25
|
-
// if (data.instrument?.typeOf === 'Ticket') {
|
|
26
|
-
// instrument = [data.instrument];
|
|
27
|
-
// }
|
|
28
|
-
}
|
|
17
|
+
const { data, project } = params;
|
|
29
18
|
await (0, useReservation_1.useReservation)({
|
|
30
|
-
project
|
|
19
|
+
project,
|
|
31
20
|
agent: data.agent,
|
|
32
21
|
object: data.object,
|
|
33
|
-
instrument,
|
|
34
|
-
...(typeof data.location?.
|
|
22
|
+
instrument: data.instrument,
|
|
23
|
+
...(typeof data.location?.identifier === 'string') ? { location: data.location } : undefined
|
|
35
24
|
})({
|
|
36
25
|
action: new action_1.ActionRepo(connection),
|
|
37
26
|
assetTransaction: new assetTransaction_1.AssetTransactionRepo(connection),
|
|
@@ -24,7 +24,7 @@ function call(data) {
|
|
|
24
24
|
throw new factory_1.factory.errors.Argument('settings', 'redisClient required');
|
|
25
25
|
}
|
|
26
26
|
const paymentServiceId = data.object.object.id;
|
|
27
|
-
const credentialsExpireInSeconds = settings.movieticketReserve.credentialsExpireInSeconds;
|
|
27
|
+
const credentialsExpireInSeconds = (await settings.getByKey('movieticketReserve')).credentialsExpireInSeconds;
|
|
28
28
|
const useCredentialsRepo = typeof paymentServiceId === 'string' && paymentServiceId !== ''
|
|
29
29
|
&& typeof credentialsExpireInSeconds === 'number' && credentialsExpireInSeconds > 0;
|
|
30
30
|
await (0, voidPaymentByTask_1.voidPaymentByTask)(data)({
|
|
@@ -50,7 +50,7 @@ function call(params) {
|
|
|
50
50
|
const reserveService = new coa_service_1.COA.service.Reserve({
|
|
51
51
|
endpoint: coaAuthClient.options.endpoint, // same as authClient(2024-07-17~)
|
|
52
52
|
auth: coaAuthClient
|
|
53
|
-
}, { timeout: settings.coa.
|
|
53
|
+
}, { timeout: (await settings.getByKey('coa')).timeoutReserve });
|
|
54
54
|
// const transactionProcessRepo = new TransactionProcessRepo(redisClient, { lockExpiresInSeconds: 120 });
|
|
55
55
|
try {
|
|
56
56
|
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>;
|
|
@@ -17,6 +17,7 @@ const debug = (0, debug_1.default)('chevre-domain:service:task');
|
|
|
17
17
|
function executeById(params, next) {
|
|
18
18
|
return async (settings) => {
|
|
19
19
|
const taskRepo = new (await import('../repo/task.js')).TaskRepo(settings.connection);
|
|
20
|
+
const integrationSettingRepo = new (await import('../repo/setting/integration.js')).IntegrationSettingRepo({ connection: settings.connection });
|
|
20
21
|
const { id, status, executor, expires } = params;
|
|
21
22
|
let task = null;
|
|
22
23
|
try {
|
|
@@ -34,7 +35,10 @@ function executeById(params, next) {
|
|
|
34
35
|
}
|
|
35
36
|
// タスクがなければ終了
|
|
36
37
|
if (task !== null) {
|
|
37
|
-
await (0, taskHandler_1.executeTask)(task, (typeof next === 'function') ? next : undefined)(
|
|
38
|
+
await (0, taskHandler_1.executeTask)(task, (typeof next === 'function') ? next : undefined)({
|
|
39
|
+
...settings,
|
|
40
|
+
settings: integrationSettingRepo
|
|
41
|
+
}, {
|
|
38
42
|
executeById: true,
|
|
39
43
|
executeByName: false
|
|
40
44
|
});
|
|
@@ -44,6 +48,7 @@ function executeById(params, next) {
|
|
|
44
48
|
function executeOneIfExists(params) {
|
|
45
49
|
return async (settings) => {
|
|
46
50
|
const taskRepo = new (await import('../repo/task.js')).TaskRepo(settings.connection);
|
|
51
|
+
const integrationSettingRepo = new (await import('../repo/setting/integration.js')).IntegrationSettingRepo({ connection: settings.connection });
|
|
47
52
|
// 未実行のタスクを取得
|
|
48
53
|
let task = null;
|
|
49
54
|
try {
|
|
@@ -61,7 +66,10 @@ function executeOneIfExists(params) {
|
|
|
61
66
|
}
|
|
62
67
|
// タスクがなければ終了
|
|
63
68
|
if (task !== null) {
|
|
64
|
-
await (0, taskHandler_1.executeTask)(task)(
|
|
69
|
+
await (0, taskHandler_1.executeTask)(task)({
|
|
70
|
+
...settings,
|
|
71
|
+
settings: integrationSettingRepo
|
|
72
|
+
}, {
|
|
65
73
|
executeById: false,
|
|
66
74
|
executeByName: (typeof params.name?.$eq === 'string')
|
|
67
75
|
});
|
|
@@ -74,6 +74,7 @@ function executeTask(task, next) {
|
|
|
74
74
|
case factory_1.factory.taskName.SendEmailMessage:
|
|
75
75
|
case factory_1.factory.taskName.SyncResourcesFromCOA:
|
|
76
76
|
case factory_1.factory.taskName.TriggerWebhook:
|
|
77
|
+
case factory_1.factory.taskName.UseReservation:
|
|
77
78
|
callResult = await call(task)(settings, options);
|
|
78
79
|
break;
|
|
79
80
|
default:
|
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) {
|
|
@@ -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'>;
|
|
@@ -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 = [];
|
|
@@ -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>));
|
|
@@ -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
|
* 取引のタスクを出力します
|
|
@@ -4,7 +4,6 @@ exports.updateAgent = updateAgent;
|
|
|
4
4
|
const google_libphonenumber_1 = require("google-libphonenumber");
|
|
5
5
|
const factory_1 = require("../../../factory");
|
|
6
6
|
const issueOrderNumberIfNotExist_1 = require("./issueOrderNumberIfNotExist");
|
|
7
|
-
// import { Settings } from '../settings';
|
|
8
7
|
// export type ITransactionOperation<T> = (repos: { transaction: TransactionRepo }) => Promise<T>;
|
|
9
8
|
function fixCustomer(params) {
|
|
10
9
|
return async (repos) => {
|
|
@@ -6,7 +6,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
6
6
|
exports.createTasks = createTasks;
|
|
7
7
|
const moment_1 = __importDefault(require("moment"));
|
|
8
8
|
const factory_1 = require("../../../../factory");
|
|
9
|
-
// import { Settings } from '../../../../settings';
|
|
10
9
|
/**
|
|
11
10
|
* 取引のタスクを作成する
|
|
12
11
|
*/
|
|
@@ -3,7 +3,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.createReturnPaymentMethodActions = createReturnPaymentMethodActions;
|
|
4
4
|
const emailMessageBuilder_1 = require("../../../../emailMessageBuilder");
|
|
5
5
|
const factory_1 = require("../../../../factory");
|
|
6
|
-
// import { Settings } from '../../../../settings';
|
|
7
6
|
async function createReturnInvoicePotentialActions(params,
|
|
8
7
|
// settings: Settings
|
|
9
8
|
setting) {
|
|
@@ -2,7 +2,6 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.createPotentialActions = createPotentialActions;
|
|
4
4
|
const factory_1 = require("../../../factory");
|
|
5
|
-
// import { Settings } from '../../../settings';
|
|
6
5
|
const returnPaymentMethod_1 = require("./potentialActions/returnPaymentMethod");
|
|
7
6
|
const sendEmailMessage_1 = require("./potentialActions/sendEmailMessage");
|
|
8
7
|
async function createPotentialActions(params,
|
|
@@ -141,13 +141,13 @@ function fixOrders(params) {
|
|
|
141
141
|
const eventIds = await repos.acceptedOffer.distinctValues({
|
|
142
142
|
orderNumber: { $in: [params.object.order[0].orderNumber] }
|
|
143
143
|
}, 'acceptedOffers.itemOffered.reservationFor.id');
|
|
144
|
-
// const acceptedOffers = await repos.acceptedOffer.searchAcceptedOffersByOrderNumbers({
|
|
145
|
-
// orderNumber: { $in: [params.object.order[0].orderNumber] }
|
|
146
|
-
// });
|
|
147
144
|
const acceptedOffers = await repos.acceptedOffer.searchAcceptedOffersByOrderNumber({
|
|
148
145
|
orderNumber: { $eq: params.object.order[0].orderNumber },
|
|
149
146
|
project: { id: { $eq: params.project.id } }
|
|
150
|
-
}
|
|
147
|
+
}, {
|
|
148
|
+
useItemOfferedByReserve: true // 2026-05-25~
|
|
149
|
+
} // 予約取引参照(2026-05-18~)
|
|
150
|
+
);
|
|
151
151
|
return { acceptedOffers, eventIds, offerIds, orders };
|
|
152
152
|
};
|
|
153
153
|
}
|
|
@@ -10,47 +10,6 @@ const factory_1 = require("../../factory");
|
|
|
10
10
|
const factory_2 = require("../offer/event/authorize/factory");
|
|
11
11
|
// import { acceptedOffers2amount as acceptedOffers2amount4product } from '../offer/product/factory';
|
|
12
12
|
const validateMovieTicket_1 = require("../transaction/placeOrder/confirm/validation/validateMovieTicket");
|
|
13
|
-
// const debug = createDebug('chevre-domain:service:validation');
|
|
14
|
-
// type ICreatingCheckEventTask = Pick<
|
|
15
|
-
// factory.task.checkResource.IAttributes,
|
|
16
|
-
// 'data' | 'executionResults' | 'name' | 'numberOfTried' | 'project' | 'remainingNumberOfTries' | 'runsAt' | 'status' | 'description'
|
|
17
|
-
// > & {
|
|
18
|
-
// description: string;
|
|
19
|
-
// };
|
|
20
|
-
// function createCheckEventTasks(params: {
|
|
21
|
-
// order: Pick<factory.order.IOrder, 'orderNumber' | 'typeOf'>;
|
|
22
|
-
// project: { id: string };
|
|
23
|
-
// reservationForIds: string[];
|
|
24
|
-
// }): ICreatingCheckEventTask[] {
|
|
25
|
-
// const { order, project, reservationForIds } = params;
|
|
26
|
-
// const runsAt = new Date();
|
|
27
|
-
// return reservationForIds.map((reservationForId) => {
|
|
28
|
-
// const object: factory.task.checkResource.IResourceAsEvent = { id: reservationForId, typeOf: factory.eventType.ScreeningEvent };
|
|
29
|
-
// const data: factory.task.checkResource.IData = {
|
|
30
|
-
// object,
|
|
31
|
-
// project: { id: project.id, typeOf: factory.organizationType.Project },
|
|
32
|
-
// typeOf: factory.actionType.CheckAction
|
|
33
|
-
// };
|
|
34
|
-
// const description: string = util.format(
|
|
35
|
-
// '%s:%s:%s:%s',
|
|
36
|
-
// order.typeOf,
|
|
37
|
-
// order.orderNumber,
|
|
38
|
-
// factory.eventType.ScreeningEvent,
|
|
39
|
-
// reservationForId
|
|
40
|
-
// );
|
|
41
|
-
// return {
|
|
42
|
-
// description,
|
|
43
|
-
// project: { id: project.id, typeOf: factory.organizationType.Project },
|
|
44
|
-
// name: factory.taskName.CheckResource,
|
|
45
|
-
// status: factory.taskStatus.Ready,
|
|
46
|
-
// runsAt,
|
|
47
|
-
// remainingNumberOfTries: 3,
|
|
48
|
-
// numberOfTried: 0,
|
|
49
|
-
// executionResults: [],
|
|
50
|
-
// data
|
|
51
|
-
// };
|
|
52
|
-
// });
|
|
53
|
-
// }
|
|
54
13
|
function validateOrder(params) {
|
|
55
14
|
return async (repos) => {
|
|
56
15
|
const order = await repos.order.projectFieldsByOrderNumber({
|
|
@@ -63,7 +22,10 @@ function validateOrder(params) {
|
|
|
63
22
|
const acceptedOffers = await repos.acceptedOffer.searchAcceptedOffersByOrderNumber({
|
|
64
23
|
orderNumber: { $eq: params.orderNumber },
|
|
65
24
|
project: { id: { $eq: params.project.id } }
|
|
66
|
-
}
|
|
25
|
+
}, {
|
|
26
|
+
useItemOfferedByReserve: true // 2026-05-25~
|
|
27
|
+
} // 予約取引参照(2026-05-18~)
|
|
28
|
+
);
|
|
67
29
|
let payTransactions = [];
|
|
68
30
|
if (order.paymentMethods.length > 0) {
|
|
69
31
|
payTransactions = await repos.assetTransaction.search({
|
|
@@ -101,14 +63,8 @@ function validateOrder(params) {
|
|
|
101
63
|
throw new Error(`invalid acceptedOffer.priceSpecification.priceComponent [${typeof priceSpecification.priceComponent}]`);
|
|
102
64
|
}
|
|
103
65
|
}
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
.isAfter((0, moment_1.default)('2023-09-30T15:00:00Z'))
|
|
107
|
-
// || typeOf !== factory.permit.PermitType.Permit
|
|
108
|
-
) {
|
|
109
|
-
if (typeof serialNumber !== 'string' || serialNumber.length === 0) {
|
|
110
|
-
throw new Error(`invalid acceptedOffer.serialNumber [${typeof serialNumber}]`);
|
|
111
|
-
}
|
|
66
|
+
if (typeof serialNumber !== 'string' || serialNumber.length === 0) {
|
|
67
|
+
throw new Error(`invalid acceptedOffer.serialNumber [${typeof serialNumber}]`);
|
|
112
68
|
}
|
|
113
69
|
});
|
|
114
70
|
let reservationForIds = [];
|
|
@@ -176,21 +132,8 @@ function validateOrder(params) {
|
|
|
176
132
|
}
|
|
177
133
|
break;
|
|
178
134
|
}
|
|
179
|
-
// case factory.permit.PermitType.Permit: {
|
|
180
|
-
// numOrderedItemExpected = acceptedOffers.length;
|
|
181
|
-
// const permitAcceptedOffers = acceptedOffers as factory.order.IAcceptedOffer<factory.order.IPermit>[];
|
|
182
|
-
// priceExpected = acceptedOffers2amount4product({
|
|
183
|
-
// acceptedOffers: permitAcceptedOffers
|
|
184
|
-
// });
|
|
185
|
-
// break;
|
|
186
|
-
// }
|
|
187
|
-
// case factory.actionType.MoneyTransfer:
|
|
188
|
-
// break;
|
|
189
135
|
default:
|
|
190
|
-
|
|
191
|
-
.isAfter((0, moment_1.default)('2024-02-01T15:00:00Z'))) {
|
|
192
|
-
throw new Error(`invalid itemOfferedTypeOf [${itemOfferedTypeOf}]`);
|
|
193
|
-
}
|
|
136
|
+
throw new Error(`invalid itemOfferedTypeOf [${itemOfferedTypeOf}]`);
|
|
194
137
|
}
|
|
195
138
|
// orderedItem検証
|
|
196
139
|
if (order.orderedItem.length !== numOrderedItemExpected) {
|
|
@@ -225,20 +168,5 @@ function validateOrder(params) {
|
|
|
225
168
|
throw new Error(`invalid ticketIdentifiers.length:${reservationReservedTicketIdentifiers.length} [expected:${acceptedOffers.length}]`);
|
|
226
169
|
}
|
|
227
170
|
}
|
|
228
|
-
// useMongoAsStockHolderProjectsの場合のイベント検証タスク作成を廃止(もう十分検証したので)(2025-07-11~)
|
|
229
|
-
// add check event task(2025-05-01~)
|
|
230
|
-
// const setting = <Pick<ISetting, 'useMongoAsStockHolderProjects'> | null>
|
|
231
|
-
// await repos.setting.findOne({ project: { id: { $eq: '*' } } }, ['useMongoAsStockHolderProjects']);
|
|
232
|
-
// const useMongoAsStockHolderProjects = setting?.useMongoAsStockHolderProjects;
|
|
233
|
-
// if (Array.isArray(useMongoAsStockHolderProjects) && useMongoAsStockHolderProjects.includes(params.project.id)) {
|
|
234
|
-
// const creatingCheckResourceTask = createCheckEventTasks({
|
|
235
|
-
// order: { orderNumber: order.orderNumber, typeOf: factory.order.OrderType.Order },
|
|
236
|
-
// project: { id: params.project.id },
|
|
237
|
-
// reservationForIds
|
|
238
|
-
// });
|
|
239
|
-
// if (creatingCheckResourceTask.length > 0) {
|
|
240
|
-
// await repos.task.saveMany(creatingCheckResourceTask, { emitImmediately: true });
|
|
241
|
-
// }
|
|
242
|
-
// }
|
|
243
171
|
};
|
|
244
172
|
}
|