@chevre/domain 28.1.0-alpha.4 → 28.1.0-alpha.6
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/repo/mongoose/schemas/offerCatalog.js +1 -1
- package/lib/chevre/repo/mongoose/schemas/setting.d.ts +28 -36
- package/lib/chevre/repo/mongoose/schemas/setting.js +9 -6
- package/lib/chevre/repo/mongoose/schemas/transactionNumber.d.ts +1 -2
- package/lib/chevre/repo/mongoose/schemas/transactionNumber.js +1 -1
- package/lib/chevre/repo/setting/integration.d.ts +2 -0
- package/lib/chevre/repo/setting/integration.js +53 -0
- package/lib/chevre/repo/setting.d.ts +1 -1
- package/lib/chevre/service/assetTransaction/reserve/cancel.d.ts +3 -4
- package/lib/chevre/service/assetTransaction/reserve/cancel.js +1 -3
- package/lib/chevre/service/assetTransaction/reserve/confirm.d.ts +3 -4
- package/lib/chevre/service/assetTransaction/reserve/confirm.js +1 -3
- package/lib/chevre/service/assetTransaction/reserve/start.d.ts +3 -2
- package/lib/chevre/service/notification/triggerWebhook/processInformAction.d.ts +1 -3
- package/lib/chevre/service/notification/triggerWebhook/processInformAction.js +3 -3
- package/lib/chevre/service/notification/triggerWebhook.js +4 -4
- package/lib/chevre/service/offer/event/authorize/processStartReserve4chevre.d.ts +3 -2
- package/lib/chevre/service/offer/event/authorize/processStartReserve4chevre.js +2 -6
- package/lib/chevre/service/offer/event/authorize.d.ts +3 -2
- package/lib/chevre/service/offer/event/authorize.js +2 -2
- package/lib/chevre/service/offer/event/voidTransaction/processVoidTransaction4chevre.d.ts +3 -4
- package/lib/chevre/service/offer/event/voidTransaction/processVoidTransaction4chevre.js +2 -2
- package/lib/chevre/service/offer/event/voidTransaction.d.ts +3 -4
- package/lib/chevre/service/offer/event/voidTransaction.js +3 -3
- package/lib/chevre/service/offer/event/voidTransactionByActionId.d.ts +3 -4
- package/lib/chevre/service/offer/event/voidTransactionByActionId.js +2 -2
- package/lib/chevre/service/offer/onEventChanged.js +4 -4
- package/lib/chevre/service/order/onAssetTransactionStatusChanged/onPayTransactionCanceled.d.ts +0 -2
- package/lib/chevre/service/order/onAssetTransactionStatusChanged/onPayTransactionConfirmed.d.ts +3 -4
- package/lib/chevre/service/order/onAssetTransactionStatusChanged/onPayTransactionConfirmed.js +2 -2
- package/lib/chevre/service/order/onAssetTransactionStatusChanged/onReserveTransactionConfirmed.d.ts +0 -2
- package/lib/chevre/service/order/onAssetTransactionStatusChanged/paymentDue2Processing.d.ts +3 -4
- package/lib/chevre/service/order/onAssetTransactionStatusChanged/paymentDue2Processing.js +2 -2
- package/lib/chevre/service/order/onAssetTransactionStatusChanged.d.ts +2 -2
- package/lib/chevre/service/order/onAssetTransactionStatusChanged.js +1 -1
- package/lib/chevre/service/order/onOrderStatusChanged/onOrderDelivered/factory.d.ts +2 -2
- package/lib/chevre/service/order/onOrderStatusChanged/onOrderDelivered/factory.js +1 -1
- package/lib/chevre/service/order/onOrderStatusChanged/onOrderDelivered.d.ts +2 -2
- package/lib/chevre/service/order/onOrderStatusChanged/onOrderDelivered.js +1 -1
- package/lib/chevre/service/order/onOrderStatusChanged/onOrderDeliveredPartially/factory.d.ts +2 -2
- package/lib/chevre/service/order/onOrderStatusChanged/onOrderDeliveredPartially/factory.js +1 -1
- package/lib/chevre/service/order/onOrderStatusChanged/onOrderDeliveredPartially.d.ts +2 -2
- package/lib/chevre/service/order/onOrderStatusChanged/onOrderDeliveredPartially.js +2 -4
- package/lib/chevre/service/order/onOrderStatusChanged/onOrderProcessing/factory.d.ts +2 -2
- package/lib/chevre/service/order/onOrderStatusChanged/onOrderProcessing/factory.js +1 -1
- package/lib/chevre/service/order/onOrderStatusChanged/onOrderProcessing.d.ts +3 -4
- package/lib/chevre/service/order/onOrderStatusChanged/onOrderProcessing.js +3 -3
- package/lib/chevre/service/order/onOrderStatusChanged/onOrderReturned/factory.d.ts +2 -2
- package/lib/chevre/service/order/onOrderStatusChanged/onOrderReturned/factory.js +1 -1
- package/lib/chevre/service/order/onOrderStatusChanged/onOrderReturned.d.ts +2 -2
- package/lib/chevre/service/order/onOrderStatusChanged/onOrderReturned.js +1 -1
- package/lib/chevre/service/order/onOrderUpdated/factory.d.ts +2 -2
- package/lib/chevre/service/order/onOrderUpdated/factory.js +1 -1
- package/lib/chevre/service/order/onOrderUpdated.d.ts +2 -2
- package/lib/chevre/service/order/onOrderUpdated.js +1 -1
- package/lib/chevre/service/order/payOrder.d.ts +3 -4
- package/lib/chevre/service/order/payOrder.js +2 -2
- package/lib/chevre/service/order/placeOrder.d.ts +3 -4
- package/lib/chevre/service/order/placeOrder.js +2 -2
- package/lib/chevre/service/order/returnOrder.d.ts +2 -2
- package/lib/chevre/service/order/sendOrder.d.ts +2 -2
- package/lib/chevre/service/reserve/cancelReservation.d.ts +3 -3
- package/lib/chevre/service/reserve/checkInReservation.d.ts +2 -2
- package/lib/chevre/service/reserve/confirmReservation.d.ts +2 -2
- package/lib/chevre/service/reserve/potentialActions/onPendingReservationCanceled.d.ts +2 -2
- package/lib/chevre/service/reserve/potentialActions/onPendingReservationCanceled.js +2 -3
- package/lib/chevre/service/reserve/potentialActions/onReservationCanceled.d.ts +2 -2
- package/lib/chevre/service/reserve/potentialActions/onReservationCanceled.js +2 -3
- package/lib/chevre/service/reserve/potentialActions/onReservationCheckedIn.d.ts +2 -2
- package/lib/chevre/service/reserve/potentialActions/onReservationCheckedIn.js +2 -2
- package/lib/chevre/service/reserve/potentialActions/onReservationConfirmed.d.ts +2 -2
- package/lib/chevre/service/reserve/potentialActions/onReservationConfirmed.js +2 -2
- package/lib/chevre/service/reserve/potentialActions/onReservationUsed.d.ts +2 -2
- package/lib/chevre/service/reserve/potentialActions/onReservationUsed.js +2 -3
- package/lib/chevre/service/reserve/potentialActions/onReservationsCreated.d.ts +2 -2
- package/lib/chevre/service/reserve/potentialActions/onReservationsCreated.js +2 -3
- package/lib/chevre/service/reserve/useReservation.d.ts +2 -2
- package/lib/chevre/service/task/cancelPendingReservation.js +3 -4
- package/lib/chevre/service/task/cancelReservation.js +2 -2
- package/lib/chevre/service/task/confirmReserveTransaction.d.ts +3 -4
- package/lib/chevre/service/task/confirmReserveTransaction.js +6 -7
- package/lib/chevre/service/task/informHub.js +0 -2
- package/lib/chevre/service/task/onAssetTransactionStatusChanged.js +3 -4
- package/lib/chevre/service/task/onAuthorizationCreated.js +2 -2
- package/lib/chevre/service/task/onOrderPaymentCompleted.js +2 -4
- package/lib/chevre/service/task/placeOrder.js +2 -4
- package/lib/chevre/service/task/reserve.js +2 -2
- package/lib/chevre/service/task/returnOrder.js +2 -2
- package/lib/chevre/service/task/sendOrder.js +2 -2
- package/lib/chevre/service/task/triggerWebhook.js +0 -2
- package/lib/chevre/service/task/useReservation.js +2 -2
- package/lib/chevre/service/task/voidReserveTransaction.js +4 -5
- package/lib/chevre/service/taskHandler/onOperationFailed/informTaskIfNeeded.d.ts +2 -2
- package/lib/chevre/service/taskHandler/onOperationFailed/informTaskIfNeeded.js +4 -4
- package/lib/chevre/service/taskHandler/onOperationFailed.d.ts +2 -2
- package/lib/chevre/service/taskHandler.js +2 -2
- package/package.json +1 -1
|
@@ -7,7 +7,7 @@ const assetTransaction_1 = require("../../repo/assetTransaction");
|
|
|
7
7
|
const authorization_1 = require("../../repo/authorization");
|
|
8
8
|
const order_1 = require("../../repo/order");
|
|
9
9
|
const reservation_1 = require("../../repo/reservation");
|
|
10
|
-
const
|
|
10
|
+
const integration_1 = require("../../repo/setting/integration");
|
|
11
11
|
const task_1 = require("../../repo/task");
|
|
12
12
|
const useReservation_1 = require("../reserve/useReservation");
|
|
13
13
|
/**
|
|
@@ -31,7 +31,7 @@ function call(params) {
|
|
|
31
31
|
code: new authorization_1.AuthorizationRepo(connection),
|
|
32
32
|
order: new order_1.OrderRepo(connection),
|
|
33
33
|
reservation: new reservation_1.ReservationRepo(connection),
|
|
34
|
-
|
|
34
|
+
integrationSetting: new integration_1.IntegrationSettingRepo({ connection }),
|
|
35
35
|
task: new task_1.TaskRepo(connection)
|
|
36
36
|
});
|
|
37
37
|
};
|
|
@@ -12,7 +12,6 @@ const orderInTransaction_1 = require("../../repo/orderInTransaction");
|
|
|
12
12
|
const offer_1 = require("../../repo/rateLimit/offer");
|
|
13
13
|
const reservation_1 = require("../../repo/reservation");
|
|
14
14
|
const reserveInterface_1 = require("../../repo/reserveInterface");
|
|
15
|
-
const setting_1 = require("../../repo/setting");
|
|
16
15
|
const integration_1 = require("../../repo/setting/integration");
|
|
17
16
|
const stockHolder_1 = require("../../repo/stockHolder");
|
|
18
17
|
const task_1 = require("../../repo/task");
|
|
@@ -46,11 +45,11 @@ function call(params) {
|
|
|
46
45
|
coaAuthClientCreated = true;
|
|
47
46
|
}
|
|
48
47
|
}
|
|
49
|
-
const
|
|
48
|
+
const integrationSettingRepo = new integration_1.IntegrationSettingRepo({ connection });
|
|
50
49
|
const reserveService = new coa_service_1.COA.service.Reserve({
|
|
51
50
|
endpoint: coaAuthClient.options.endpoint, // same as authClient(2024-07-17~)
|
|
52
51
|
auth: coaAuthClient
|
|
53
|
-
}, { timeout: (await
|
|
52
|
+
}, { timeout: (await integrationSettingRepo.getByKey('coa')).timeoutReserve });
|
|
54
53
|
try {
|
|
55
54
|
await (0, voidTransaction_1.voidTransaction)({
|
|
56
55
|
...params.data,
|
|
@@ -67,11 +66,11 @@ function call(params) {
|
|
|
67
66
|
offerRateLimit: new offer_1.OfferRateLimitRepo(redisClient),
|
|
68
67
|
orderInTransaction: new orderInTransaction_1.OrderInTransactionRepo(connection),
|
|
69
68
|
reservation: new reservation_1.ReservationRepo(connection),
|
|
70
|
-
|
|
69
|
+
integrationSetting: integrationSettingRepo,
|
|
71
70
|
task: new task_1.TaskRepo(connection),
|
|
72
71
|
placeOrder: new placeOrder_1.PlaceOrderRepo(connection),
|
|
73
72
|
reserveService
|
|
74
|
-
}
|
|
73
|
+
});
|
|
75
74
|
}
|
|
76
75
|
catch (error) { // eslint-disable-line no-useless-catch
|
|
77
76
|
throw error;
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { factory } from '../../../factory';
|
|
2
|
-
import type {
|
|
2
|
+
import type { IntegrationSettingRepo } from '../../../repo/setting/integration';
|
|
3
3
|
import type { TaskRepo } from '../../../repo/task';
|
|
4
4
|
import type { IExecutableTask } from '../../../taskSettings';
|
|
5
5
|
declare function informTaskIfNeeded(params: {
|
|
6
6
|
task: IExecutableTask<factory.taskName>;
|
|
7
7
|
executionEndDate: Date;
|
|
8
8
|
}): (repos: {
|
|
9
|
-
|
|
9
|
+
integrationSetting: IntegrationSettingRepo;
|
|
10
10
|
task: TaskRepo;
|
|
11
11
|
}) => Promise<void>;
|
|
12
12
|
export { informTaskIfNeeded };
|
|
@@ -9,9 +9,9 @@ const factory_1 = require("../../../factory");
|
|
|
9
9
|
const debug = (0, debug_1.default)('chevre-domain:service:taskHandler:onOperationFailed');
|
|
10
10
|
function createInformTasks(params) {
|
|
11
11
|
const { task, setting, executionEndDate } = params;
|
|
12
|
-
const informTask = setting?.
|
|
13
|
-
const informTaskNames = setting?.
|
|
14
|
-
const informTaskStatuses = setting?.
|
|
12
|
+
const informTask = setting?.informActions;
|
|
13
|
+
const informTaskNames = setting?.informTaskNames;
|
|
14
|
+
const informTaskStatuses = setting?.informTaskStatuses;
|
|
15
15
|
const informTasks = [];
|
|
16
16
|
if (Array.isArray(informTaskNames) && informTaskNames.includes(task.name)) {
|
|
17
17
|
if (Array.isArray(informTaskStatuses)) {
|
|
@@ -85,7 +85,7 @@ function informTaskIfNeeded(params) {
|
|
|
85
85
|
&& task.name !== factory_1.factory.taskName.HandleNotification // nameで絞る
|
|
86
86
|
&& task.name !== factory_1.factory.taskName.TriggerWebhook;
|
|
87
87
|
if (useInform) {
|
|
88
|
-
const setting = await repos.
|
|
88
|
+
const setting = await repos.integrationSetting.getByKey('agg');
|
|
89
89
|
const informTasks = createInformTasks({ task, setting, executionEndDate });
|
|
90
90
|
debug('informTaskIfNeeded: creating inform tasks...', JSON.stringify(informTasks));
|
|
91
91
|
if (informTasks.length > 0) {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { factory } from '../../factory';
|
|
2
|
-
import type {
|
|
2
|
+
import type { IntegrationSettingRepo } from '../../repo/setting/integration';
|
|
3
3
|
import type { TaskRepo } from '../../repo/task';
|
|
4
4
|
import type { TaskRunningRepo } from '../../repo/taskRunning';
|
|
5
5
|
import type { IExecutableTask } from '../../taskSettings';
|
|
@@ -12,7 +12,7 @@ declare function onOperationFailed(params: {
|
|
|
12
12
|
error: any;
|
|
13
13
|
next?: never;
|
|
14
14
|
}): (repos: {
|
|
15
|
-
|
|
15
|
+
integrationSetting: IntegrationSettingRepo;
|
|
16
16
|
task: TaskRepo;
|
|
17
17
|
taskRunning: TaskRunningRepo;
|
|
18
18
|
}) => Promise<void>;
|
|
@@ -21,7 +21,7 @@ function executeTask(task) {
|
|
|
21
21
|
const now = new Date();
|
|
22
22
|
debug('executing an executableTask...', task, now);
|
|
23
23
|
return async (settings, options) => {
|
|
24
|
-
const
|
|
24
|
+
const integrationSettingRepo = new (await import('../repo/setting/integration.js')).IntegrationSettingRepo({ connection: settings.connection });
|
|
25
25
|
const taskRepo = new (await import('../repo/task.js')).TaskRepo(settings.connection);
|
|
26
26
|
const taskRunningRepo = new (await import('../repo/taskRunning.js')).TaskRunningRepo(settings.connection);
|
|
27
27
|
try {
|
|
@@ -56,7 +56,7 @@ function executeTask(task) {
|
|
|
56
56
|
catch (error) {
|
|
57
57
|
await (0, onOperationFailed_1.onOperationFailed)({
|
|
58
58
|
task, now, error
|
|
59
|
-
})({
|
|
59
|
+
})({ integrationSetting: integrationSettingRepo, task: taskRepo, taskRunning: taskRunningRepo });
|
|
60
60
|
}
|
|
61
61
|
};
|
|
62
62
|
}
|
package/package.json
CHANGED