@chevre/domain 24.1.0-alpha.3 → 24.1.0-alpha.30
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/repo/acceptedOffer.d.ts +14 -13
- package/lib/chevre/repo/acceptedOffer.js +135 -51
- package/lib/chevre/repo/acceptedOfferInReserve.d.ts +30 -0
- package/lib/chevre/repo/acceptedOfferInReserve.js +78 -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.js +155 -180
- 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/order.d.ts +2 -83
- package/lib/chevre/repo/order.js +171 -364
- package/lib/chevre/repo/orderInTransaction.d.ts +39 -3
- package/lib/chevre/repo/orderInTransaction.js +43 -1
- package/lib/chevre/repo/reservation.d.ts +20 -7
- package/lib/chevre/repo/reservation.js +14 -10
- package/lib/chevre/repo/role.d.ts +1 -15
- package/lib/chevre/repo/role.js +7 -14
- package/lib/chevre/repo/transaction.d.ts +6 -6
- package/lib/chevre/service/aggregation/event/aggregateOffers.js +22 -26
- 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/reserve/start/factory/createReservation.js +0 -12
- package/lib/chevre/service/assetTransaction/reserve/start/factory/price.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 +1 -1
- package/lib/chevre/service/notification/notifyAbortedTasksByEmail.js +1 -1
- package/lib/chevre/service/offer/any.d.ts +6 -1
- package/lib/chevre/service/offer/event/authorize/factory.d.ts +6 -3
- package/lib/chevre/service/offer/event/authorize/factory.js +4 -7
- package/lib/chevre/service/offer/event/authorize.d.ts +6 -0
- package/lib/chevre/service/offer/event/authorize.js +11 -3
- 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 +21 -44
- package/lib/chevre/service/order/onAssetTransactionStatusChanged/paymentDue2Processing.js +9 -11
- package/lib/chevre/service/order/onOrderStatusChanged/onOrderDeliveredPartially/factory.d.ts +6 -1
- package/lib/chevre/service/order/onOrderStatusChanged/onOrderInTransit.js +1 -1
- package/lib/chevre/service/order/onOrderStatusChanged/onOrderProcessing.js +2 -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/sendOrder.js +2 -4
- package/lib/chevre/service/payment/creditCard/authorize.js +3 -3
- package/lib/chevre/service/payment/creditCard/payCreditCard.js +1 -1
- package/lib/chevre/service/payment/creditCard/refundCreditCard.js +1 -1
- package/lib/chevre/service/payment/creditCard/searchGMOTrade.js +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/payMovieTicket.js +1 -1
- package/lib/chevre/service/payment/movieTicket/processPurchaseNumberAuth.js +1 -1
- package/lib/chevre/service/payment/movieTicket/refundMovieTicket.js +2 -2
- 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 +2 -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/onReservationConfirmed.d.ts +4 -3
- package/lib/chevre/service/reserve/potentialActions/onReservationConfirmed.js +1 -9
- package/lib/chevre/service/reserve/searchByOrder.js +8 -3
- package/lib/chevre/service/reserve/useReservation.d.ts +1 -1
- package/lib/chevre/service/reserve/useReservation.js +20 -24
- package/lib/chevre/service/task/acceptCOAOffer.js +2 -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.js +3 -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/pay.js +1 -1
- package/lib/chevre/service/task/payment/payByTask.js +3 -2
- package/lib/chevre/service/task/refund.js +1 -1
- package/lib/chevre/service/task/returnReserveTransaction.js +1 -1
- 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 +6 -18
- package/lib/chevre/service/task/voidPayment.js +1 -1
- package/lib/chevre/service/task/voidReserveTransaction.js +1 -1
- package/lib/chevre/service/taskHandler.js +1 -0
- 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 -2
- package/lib/chevre/service/transaction/returnOrder/preStart.js +2 -4
- package/lib/chevre/service/validation/validateOrder.js +5 -79
- package/lib/chevre/settings.d.ts +15 -16
- package/lib/chevre/settings.js +53 -19
- package/package.json +2 -2
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'>;
|
|
@@ -99,7 +99,10 @@ function confirm(params, options) {
|
|
|
99
99
|
// authorizeProductOfferActions,
|
|
100
100
|
serialNumbers } = dissolveAuthorizeActions(completedAuthorizeActions);
|
|
101
101
|
// orderInTransactionから検索する(2024-03-04~)
|
|
102
|
-
const acceptedOffers = (await repos.orderInTransaction.
|
|
102
|
+
const acceptedOffers = (await repos.orderInTransaction.findAcceptedOffersWithPriceByOrderNumber({
|
|
103
|
+
orderNumber,
|
|
104
|
+
project: { id: transaction.project.id }
|
|
105
|
+
}))
|
|
103
106
|
.filter(({ serialNumber }) => typeof serialNumber === 'string' && serialNumbers.includes(serialNumber));
|
|
104
107
|
// authorizePaymentActionsからpayTransactionsを参照(2024-06-20~)
|
|
105
108
|
let payTransactions = [];
|
|
@@ -288,7 +291,7 @@ function createResult(params, options) {
|
|
|
288
291
|
const itemOfferedTypeOf = acceptedOffer.itemOffered.typeOf;
|
|
289
292
|
switch (itemOfferedTypeOf) {
|
|
290
293
|
case factory_1.factory.reservationType.EventReservation:
|
|
291
|
-
eventReservationAcceptedOffers.push(acceptedOffer);
|
|
294
|
+
eventReservationAcceptedOffers.push((acceptedOffer));
|
|
292
295
|
break;
|
|
293
296
|
// case factory.permit.PermitType.Permit:
|
|
294
297
|
// productAcceptedOffers.push((acceptedOffer as factory.order.IAcceptedOffer<factory.order.IPermit>));
|
|
@@ -141,13 +141,11 @@ 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
|
+
}, { useReserveTransaction: true } // 予約取引参照(2026-05-18~)
|
|
148
|
+
);
|
|
151
149
|
return { acceptedOffers, eventIds, offerIds, orders };
|
|
152
150
|
};
|
|
153
151
|
}
|
|
@@ -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,8 @@ 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
|
+
}, { useReserveTransaction: true } // 予約取引参照(2026-05-18~)
|
|
26
|
+
);
|
|
67
27
|
let payTransactions = [];
|
|
68
28
|
if (order.paymentMethods.length > 0) {
|
|
69
29
|
payTransactions = await repos.assetTransaction.search({
|
|
@@ -101,14 +61,8 @@ function validateOrder(params) {
|
|
|
101
61
|
throw new Error(`invalid acceptedOffer.priceSpecification.priceComponent [${typeof priceSpecification.priceComponent}]`);
|
|
102
62
|
}
|
|
103
63
|
}
|
|
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
|
-
}
|
|
64
|
+
if (typeof serialNumber !== 'string' || serialNumber.length === 0) {
|
|
65
|
+
throw new Error(`invalid acceptedOffer.serialNumber [${typeof serialNumber}]`);
|
|
112
66
|
}
|
|
113
67
|
});
|
|
114
68
|
let reservationForIds = [];
|
|
@@ -176,21 +130,8 @@ function validateOrder(params) {
|
|
|
176
130
|
}
|
|
177
131
|
break;
|
|
178
132
|
}
|
|
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
133
|
default:
|
|
190
|
-
|
|
191
|
-
.isAfter((0, moment_1.default)('2024-02-01T15:00:00Z'))) {
|
|
192
|
-
throw new Error(`invalid itemOfferedTypeOf [${itemOfferedTypeOf}]`);
|
|
193
|
-
}
|
|
134
|
+
throw new Error(`invalid itemOfferedTypeOf [${itemOfferedTypeOf}]`);
|
|
194
135
|
}
|
|
195
136
|
// orderedItem検証
|
|
196
137
|
if (order.orderedItem.length !== numOrderedItemExpected) {
|
|
@@ -225,20 +166,5 @@ function validateOrder(params) {
|
|
|
225
166
|
throw new Error(`invalid ticketIdentifiers.length:${reservationReservedTicketIdentifiers.length} [expected:${acceptedOffers.length}]`);
|
|
226
167
|
}
|
|
227
168
|
}
|
|
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
169
|
};
|
|
244
170
|
}
|
package/lib/chevre/settings.d.ts
CHANGED
|
@@ -1,8 +1,13 @@
|
|
|
1
|
+
import type { Connection } from 'mongoose';
|
|
1
2
|
interface ISurfrockSettings {
|
|
2
3
|
/**
|
|
3
4
|
* 着券時タイムアウト
|
|
4
5
|
*/
|
|
5
|
-
|
|
6
|
+
timeoutPay: number;
|
|
7
|
+
/**
|
|
8
|
+
* 着券取消時タイムアウト
|
|
9
|
+
*/
|
|
10
|
+
timeoutRefund: number;
|
|
6
11
|
/**
|
|
7
12
|
* 認証時タイムアウト
|
|
8
13
|
*/
|
|
@@ -22,7 +27,8 @@ interface IOptions {
|
|
|
22
27
|
numTryConfirmReserveTransaction: number;
|
|
23
28
|
deliverOrderLimit: number;
|
|
24
29
|
coa: {
|
|
25
|
-
|
|
30
|
+
timeoutReserve: number;
|
|
31
|
+
timeoutMaster: number;
|
|
26
32
|
};
|
|
27
33
|
gmo: {
|
|
28
34
|
timeout: number;
|
|
@@ -31,26 +37,19 @@ interface IOptions {
|
|
|
31
37
|
movieticketReserve: ISurfrockSettings;
|
|
32
38
|
useExperimentalFeature: boolean;
|
|
33
39
|
}
|
|
40
|
+
interface IDBOptions {
|
|
41
|
+
connection: Connection;
|
|
42
|
+
}
|
|
34
43
|
/**
|
|
35
44
|
* domain settings
|
|
36
45
|
*/
|
|
37
46
|
declare class Settings {
|
|
38
|
-
readonly
|
|
39
|
-
|
|
40
|
-
readonly deliverOrderLimit: number;
|
|
41
|
-
readonly coa: {
|
|
42
|
-
timeout: number;
|
|
43
|
-
};
|
|
44
|
-
readonly gmo: {
|
|
45
|
-
timeout: number;
|
|
46
|
-
timeoutBackground: number;
|
|
47
|
-
};
|
|
48
|
-
readonly movieticketReserve: ISurfrockSettings;
|
|
49
|
-
readonly useExperimentalFeature: boolean;
|
|
47
|
+
private readonly options;
|
|
48
|
+
constructor(options: IDBOptions);
|
|
50
49
|
/**
|
|
51
|
-
*
|
|
50
|
+
* 設定名称から設定を参照する
|
|
52
51
|
*/
|
|
53
|
-
|
|
52
|
+
getByKey<T extends keyof IOptions>(key: T): Promise<IOptions[T]>;
|
|
54
53
|
}
|
|
55
54
|
export declare const MONGO_MAX_TIME_MS: number;
|
|
56
55
|
export declare const MONGO_READ_PREFERENCE: string;
|
package/lib/chevre/settings.js
CHANGED
|
@@ -1,31 +1,65 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.Settings = exports.MONGO_AUTO_INDEX = exports.MONGO_READ_PREFERENCE = exports.MONGO_MAX_TIME_MS = void 0;
|
|
4
|
+
const factory_1 = require("./factory");
|
|
5
|
+
const defaultOptions = {
|
|
6
|
+
abortedTasksWithoutReport: [
|
|
7
|
+
factory_1.factory.taskName.ImportEventCapacitiesFromCOA,
|
|
8
|
+
factory_1.factory.taskName.ImportEventsFromCOA,
|
|
9
|
+
factory_1.factory.taskName.ImportOffersFromCOA,
|
|
10
|
+
],
|
|
11
|
+
numTryConfirmReserveTransaction: 10,
|
|
12
|
+
deliverOrderLimit: 10,
|
|
13
|
+
coa: {
|
|
14
|
+
timeoutReserve: 20000,
|
|
15
|
+
timeoutMaster: 30000
|
|
16
|
+
},
|
|
17
|
+
gmo: {
|
|
18
|
+
timeout: 4000,
|
|
19
|
+
timeoutBackground: 6000
|
|
20
|
+
},
|
|
21
|
+
movieticketReserve: {
|
|
22
|
+
timeoutPay: 5000,
|
|
23
|
+
timeoutRefund: 5000,
|
|
24
|
+
timeoutCheck: 4000,
|
|
25
|
+
minIntervalBetweenPayAndRefund: 10000,
|
|
26
|
+
credentialsExpireInSeconds: 600
|
|
27
|
+
},
|
|
28
|
+
useExperimentalFeature: false
|
|
29
|
+
};
|
|
4
30
|
/**
|
|
5
31
|
* domain settings
|
|
6
32
|
*/
|
|
7
33
|
class Settings {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
34
|
+
// private readonly settingModel: IModel;
|
|
35
|
+
options;
|
|
36
|
+
constructor(options
|
|
37
|
+
// options: IOptions & IDBOptions
|
|
38
|
+
) {
|
|
39
|
+
const { connection: _connection, // ひとまず使用しない
|
|
40
|
+
// ...restOptions
|
|
41
|
+
} = options;
|
|
42
|
+
// this.settingModel = connection.model<IDocType, IModel>(modelName, createSchema());
|
|
43
|
+
this.options = defaultOptions;
|
|
44
|
+
// this.options = restOptions; // defaultOptionsでひとまず固定化(2026-05-23~)
|
|
45
|
+
}
|
|
15
46
|
/**
|
|
16
|
-
*
|
|
47
|
+
* 設定名称から設定を参照する
|
|
17
48
|
*/
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
this.
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
//
|
|
49
|
+
async getByKey(key) {
|
|
50
|
+
// const projection: Record<string, AnyExpression> = {
|
|
51
|
+
// _id: 0,
|
|
52
|
+
// [key]: 1
|
|
53
|
+
// // id: { $toString: '$_id' },
|
|
54
|
+
// };
|
|
55
|
+
// // とりあえず設定コレクションを参照するが、値を使用しない(2026-05-21~)
|
|
56
|
+
// await this.settingModel.findOne(
|
|
57
|
+
// { 'project.id': { $eq: '*' } },
|
|
58
|
+
// projection
|
|
59
|
+
// )
|
|
60
|
+
// .lean()
|
|
61
|
+
// .exec();
|
|
62
|
+
return this.options[key];
|
|
29
63
|
}
|
|
30
64
|
}
|
|
31
65
|
exports.Settings = Settings;
|
package/package.json
CHANGED
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
"dependencies": {
|
|
12
12
|
"@aws-sdk/client-cognito-identity-provider": "3.600.0",
|
|
13
13
|
"@aws-sdk/credential-providers": "3.600.0",
|
|
14
|
-
"@chevre/factory": "8.
|
|
14
|
+
"@chevre/factory": "8.2.0-alpha.1",
|
|
15
15
|
"@motionpicture/coa-service": "10.0.0",
|
|
16
16
|
"@motionpicture/gmo-service": "6.1.0-alpha.0",
|
|
17
17
|
"@sendgrid/client": "8.1.4",
|
|
@@ -91,5 +91,5 @@
|
|
|
91
91
|
"postversion": "git push origin --tags",
|
|
92
92
|
"prepublishOnly": "npm run clean && npm run build"
|
|
93
93
|
},
|
|
94
|
-
"version": "24.1.0-alpha.
|
|
94
|
+
"version": "24.1.0-alpha.30"
|
|
95
95
|
}
|