@chevre/domain 28.1.0-alpha.3 → 28.1.0-alpha.5
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 +30 -27
- package/lib/chevre/repo/mongoose/schemas/setting.js +8 -5
- package/lib/chevre/repo/setting/integration.d.ts +2 -1
- package/lib/chevre/repo/setting/integration.js +31 -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 +3 -0
- package/lib/chevre/service/notification/triggerWebhook/processInformAction.js +4 -3
- package/lib/chevre/service/notification/triggerWebhook.js +2 -1
- 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.d.ts +2 -0
- package/lib/chevre/service/offer/onEventChanged.js +8 -7
- 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 +3 -1
- package/lib/chevre/service/task/onAssetTransactionStatusChanged.js +3 -4
- package/lib/chevre/service/task/onAuthorizationCreated.js +2 -2
- package/lib/chevre/service/task/onEventChanged.js +2 -0
- package/lib/chevre/service/task/onOrderPaymentCompleted.js +2 -4
- package/lib/chevre/service/task/onResourceUpdated/onAggregateOfferUpdated.d.ts +2 -2
- package/lib/chevre/service/task/onResourceUpdated/onAggregateOfferUpdated.js +2 -1
- package/lib/chevre/service/task/onResourceUpdated/onHasPOSUpdated.d.ts +2 -2
- package/lib/chevre/service/task/onResourceUpdated/onHasPOSUpdated.js +3 -2
- package/lib/chevre/service/task/onResourceUpdated/onOfferCatalogUpdated.d.ts +3 -2
- package/lib/chevre/service/task/onResourceUpdated/onOfferCatalogUpdated.js +2 -2
- package/lib/chevre/service/task/onResourceUpdated.js +30 -24
- 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 +3 -1
- 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
|
@@ -2,7 +2,7 @@ import type { ReserveActionRepo } from '../../repo/action/reserve';
|
|
|
2
2
|
import type { AssetTransactionRepo } from '../../repo/assetTransaction';
|
|
3
3
|
import type { AuthorizationRepo } from '../../repo/authorization';
|
|
4
4
|
import type { ReservationRepo } from '../../repo/reservation';
|
|
5
|
-
import type {
|
|
5
|
+
import type { IntegrationSettingRepo } from '../../repo/setting/integration';
|
|
6
6
|
import type { TaskRepo } from '../../repo/task';
|
|
7
7
|
interface ICheckInReservationParams {
|
|
8
8
|
project: {
|
|
@@ -38,7 +38,7 @@ export declare function checkInReservation(params: ICheckInReservationParams): (
|
|
|
38
38
|
assetTransaction: AssetTransactionRepo;
|
|
39
39
|
code: AuthorizationRepo;
|
|
40
40
|
reservation: ReservationRepo;
|
|
41
|
-
|
|
41
|
+
integrationSetting: IntegrationSettingRepo;
|
|
42
42
|
task: TaskRepo;
|
|
43
43
|
}) => Promise<void>;
|
|
44
44
|
export {};
|
|
@@ -3,7 +3,7 @@ import type { ReserveActionRepo } from '../../repo/action/reserve';
|
|
|
3
3
|
import type { AssetTransactionRepo } from '../../repo/assetTransaction';
|
|
4
4
|
import type { AuthorizationRepo } from '../../repo/authorization';
|
|
5
5
|
import type { ReservationRepo } from '../../repo/reservation';
|
|
6
|
-
import type {
|
|
6
|
+
import type { IntegrationSettingRepo } from '../../repo/setting/integration';
|
|
7
7
|
import type { TaskRepo } from '../../repo/task';
|
|
8
8
|
/**
|
|
9
9
|
* 予約を確定する
|
|
@@ -19,6 +19,6 @@ export declare function confirmReservation(params: {
|
|
|
19
19
|
assetTransaction: AssetTransactionRepo;
|
|
20
20
|
code: AuthorizationRepo;
|
|
21
21
|
reservation: ReservationRepo;
|
|
22
|
-
|
|
22
|
+
integrationSetting: IntegrationSettingRepo;
|
|
23
23
|
task: TaskRepo;
|
|
24
24
|
}) => Promise<void>;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* 保留予約取消時アクション
|
|
3
3
|
*/
|
|
4
|
-
import type {
|
|
4
|
+
import type { IntegrationSettingRepo } from '../../../repo/setting/integration';
|
|
5
5
|
import type { TaskRepo } from '../../../repo/task';
|
|
6
6
|
import { factory } from '../../../factory';
|
|
7
7
|
export declare function onPendingReservationCanceled(params: {
|
|
@@ -17,6 +17,6 @@ export declare function onPendingReservationCanceled(params: {
|
|
|
17
17
|
reservationNumber: string;
|
|
18
18
|
cancelAction?: Pick<factory.action.cancel.reservation.IAction, 'id' | 'instrument'>;
|
|
19
19
|
}): (repos: {
|
|
20
|
-
|
|
20
|
+
integrationSetting: IntegrationSettingRepo;
|
|
21
21
|
task: TaskRepo;
|
|
22
22
|
}) => Promise<void>;
|
|
@@ -9,10 +9,9 @@ function onPendingReservationCanceled(params) {
|
|
|
9
9
|
) => {
|
|
10
10
|
const { reservationFor, reservationNumber } = params;
|
|
11
11
|
// create AggregateScreeningEvent task -> migrate to agg(2024-10-29~)
|
|
12
|
-
const setting = await repos.
|
|
12
|
+
const setting = await repos.integrationSetting.getByKey('agg');
|
|
13
13
|
// inform(2024-10-25~)
|
|
14
|
-
|
|
15
|
-
const informReservations = setting?.onReservationStatusChanged?.informReservation;
|
|
14
|
+
const informReservations = setting?.informActions;
|
|
16
15
|
const now = new Date();
|
|
17
16
|
const taskAttributes = [];
|
|
18
17
|
const informObject = {
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* 予約取消時アクション
|
|
3
3
|
*/
|
|
4
4
|
import { factory } from '../../../factory';
|
|
5
|
-
import type {
|
|
5
|
+
import type { IntegrationSettingRepo } from '../../../repo/setting/integration';
|
|
6
6
|
import type { TaskRepo } from '../../../repo/task';
|
|
7
7
|
export type ICanceledEventReservation = Pick<factory.reservation.eventReservation.IReservation, 'project' | 'id' | 'typeOf' | 'modifiedTime' | 'reservationNumber'>;
|
|
8
8
|
export declare function onReservationCanceled(
|
|
@@ -19,6 +19,6 @@ reservationFor: {
|
|
|
19
19
|
};
|
|
20
20
|
id: string;
|
|
21
21
|
}, cancelAction: Pick<factory.action.cancel.reservation.IAction, 'instrument'>): (repos: {
|
|
22
|
-
|
|
22
|
+
integrationSetting: IntegrationSettingRepo;
|
|
23
23
|
task: TaskRepo;
|
|
24
24
|
}) => Promise<void>;
|
|
@@ -20,9 +20,8 @@ reservationFor, cancelAction) {
|
|
|
20
20
|
return async (repos
|
|
21
21
|
// settings: Settings
|
|
22
22
|
) => {
|
|
23
|
-
const setting = await repos.
|
|
24
|
-
|
|
25
|
-
const informReservations = setting?.onReservationStatusChanged?.informReservation;
|
|
23
|
+
const setting = await repos.integrationSetting.getByKey('agg');
|
|
24
|
+
const informReservations = setting?.informActions;
|
|
26
25
|
let orderAsAbout;
|
|
27
26
|
if (Array.isArray(cancelAction.instrument)) {
|
|
28
27
|
for (const eachInstrument of cancelAction.instrument) {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { ReservationRepo } from '../../../repo/reservation';
|
|
2
|
-
import type {
|
|
2
|
+
import type { IntegrationSettingRepo } from '../../../repo/setting/integration';
|
|
3
3
|
import type { TaskRepo } from '../../../repo/task';
|
|
4
4
|
export declare function onReservationCheckedIn(params: {
|
|
5
5
|
project: {
|
|
@@ -29,6 +29,6 @@ export declare function onReservationCheckedIn(params: {
|
|
|
29
29
|
};
|
|
30
30
|
}): (repos: {
|
|
31
31
|
reservation: ReservationRepo;
|
|
32
|
-
|
|
32
|
+
integrationSetting: IntegrationSettingRepo;
|
|
33
33
|
task: TaskRepo;
|
|
34
34
|
}) => Promise<void>;
|
|
@@ -9,10 +9,10 @@ const factory_2 = require("../factory");
|
|
|
9
9
|
function onReservationCheckedIn(params) {
|
|
10
10
|
return async (repos) => {
|
|
11
11
|
const { dateIssued } = params.object.reservedTicket;
|
|
12
|
-
const setting = await repos.
|
|
12
|
+
const setting = await repos.integrationSetting.getByKey('agg');
|
|
13
13
|
const tasks = [];
|
|
14
14
|
const project = { id: params.project.id, typeOf: factory_1.factory.organizationType.Project };
|
|
15
|
-
const informReservations = setting?.
|
|
15
|
+
const informReservations = setting?.informActions;
|
|
16
16
|
let reservations4inform = [];
|
|
17
17
|
const ticketToken = params.purpose?.code;
|
|
18
18
|
if (Array.isArray(params.object.ids) && params.object.ids.length > 0) {
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
*/
|
|
4
4
|
import { factory } from '../../../factory';
|
|
5
5
|
import { AuthorizationRepo } from '../../../repo/authorization';
|
|
6
|
-
import type {
|
|
6
|
+
import type { IntegrationSettingRepo } from '../../../repo/setting/integration';
|
|
7
7
|
import type { TaskRepo } from '../../../repo/task';
|
|
8
8
|
export type IConfirmedReservation = Pick<factory.reservation.eventReservation.IReservation, 'additionalProperty' | 'additionalTicketText' | 'bookingTime' | 'id' | 'modifiedTime' | 'project' | 'provider' | 'reservationNumber' | 'subReservation' | 'typeOf' | 'reservedTicket'> & {
|
|
9
9
|
reservationFor: factory.assetTransaction.reserve.IReservationFor;
|
|
@@ -13,6 +13,6 @@ export type IConfirmedReservation = Pick<factory.reservation.eventReservation.IR
|
|
|
13
13
|
};
|
|
14
14
|
export declare function onReservationConfirmed(confirmedReservations: IConfirmedReservation[], reserveAction: Pick<factory.action.reserve.IAttributes, 'instrument'>): (repos: {
|
|
15
15
|
code: AuthorizationRepo;
|
|
16
|
-
|
|
16
|
+
integrationSetting: IntegrationSettingRepo;
|
|
17
17
|
task: TaskRepo;
|
|
18
18
|
}) => Promise<void>;
|
|
@@ -8,8 +8,8 @@ const factory_1 = require("../../../factory");
|
|
|
8
8
|
const factory_2 = require("../factory");
|
|
9
9
|
function onReservationConfirmed(confirmedReservations, reserveAction) {
|
|
10
10
|
return async (repos) => {
|
|
11
|
-
const setting = await repos.
|
|
12
|
-
const informReservations = setting?.
|
|
11
|
+
const setting = await repos.integrationSetting.getByKey('agg');
|
|
12
|
+
const informReservations = setting?.informActions;
|
|
13
13
|
let orderAsAbout;
|
|
14
14
|
if (Array.isArray(reserveAction.instrument)) {
|
|
15
15
|
for (const eachInstrument of reserveAction.instrument) {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { factory } from '../../../factory';
|
|
2
2
|
import type { IAttendedReservation } from '../../../repo/reservation';
|
|
3
|
-
import type {
|
|
3
|
+
import type { IntegrationSettingRepo } from '../../../repo/setting/integration';
|
|
4
4
|
import type { TaskRepo } from '../../../repo/task';
|
|
5
5
|
export type IUseReservationAction = factory.action.consume.use.reservation.IAction;
|
|
6
6
|
/**
|
|
@@ -10,6 +10,6 @@ export declare function onReservationUsed(attendedReservation: IAttendedReservat
|
|
|
10
10
|
id: string;
|
|
11
11
|
startDate: Date;
|
|
12
12
|
}): (repos: {
|
|
13
|
-
|
|
13
|
+
integrationSetting: IntegrationSettingRepo;
|
|
14
14
|
task: TaskRepo;
|
|
15
15
|
}) => Promise<void>;
|
|
@@ -17,11 +17,10 @@ function onReservationUsed(attendedReservation, action) {
|
|
|
17
17
|
return async (repos
|
|
18
18
|
// settings: Settings
|
|
19
19
|
) => {
|
|
20
|
-
const setting = await repos.
|
|
20
|
+
const setting = await repos.integrationSetting.getByKey('agg');
|
|
21
21
|
const tasks = [];
|
|
22
22
|
const now = new Date();
|
|
23
|
-
|
|
24
|
-
const informReservations = setting?.onReservationStatusChanged?.informReservation;
|
|
23
|
+
const informReservations = setting?.informActions;
|
|
25
24
|
const informTaskRunsAt = now;
|
|
26
25
|
// support notification.reservation.IUseAction(2024-11-11~)
|
|
27
26
|
const useForTheFirstTime = attendedReservation.reservedTicket.dateUsed !== undefined
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { IntegrationSettingRepo } from '../../../repo/setting/integration';
|
|
2
2
|
import type { TaskRepo } from '../../../repo/task';
|
|
3
3
|
import { factory } from '../../../factory';
|
|
4
4
|
/**
|
|
@@ -13,6 +13,6 @@ export declare function onReservationsCreated(params: {
|
|
|
13
13
|
};
|
|
14
14
|
transaction: Pick<factory.assetTransaction.reserve.ITransaction, 'transactionNumber' | 'instrument'>;
|
|
15
15
|
}): (repos: {
|
|
16
|
-
|
|
16
|
+
integrationSetting: IntegrationSettingRepo;
|
|
17
17
|
task: TaskRepo;
|
|
18
18
|
}) => Promise<void>;
|
|
@@ -10,11 +10,10 @@ function onReservationsCreated(params) {
|
|
|
10
10
|
return async (repos
|
|
11
11
|
// settings: Settings
|
|
12
12
|
) => {
|
|
13
|
-
const setting = await repos.
|
|
13
|
+
const setting = await repos.integrationSetting.getByKey('agg');
|
|
14
14
|
// create AggregateScreeningEvent task -> migrate to agg(2024-10-29~)
|
|
15
15
|
// inform(2024-10-25~)
|
|
16
|
-
|
|
17
|
-
const informReservations = setting?.onReservationStatusChanged?.informReservation;
|
|
16
|
+
const informReservations = setting?.informActions;
|
|
18
17
|
const now = new Date();
|
|
19
18
|
const taskAttributes = [];
|
|
20
19
|
const informObject = {
|
|
@@ -5,7 +5,7 @@ import type { AssetTransactionRepo } from '../../repo/assetTransaction';
|
|
|
5
5
|
import type { AuthorizationRepo } from '../../repo/authorization';
|
|
6
6
|
import type { OrderRepo } from '../../repo/order';
|
|
7
7
|
import type { ReservationRepo } from '../../repo/reservation';
|
|
8
|
-
import type {
|
|
8
|
+
import type { IntegrationSettingRepo } from '../../repo/setting/integration';
|
|
9
9
|
import type { TaskRepo } from '../../repo/task';
|
|
10
10
|
/**
|
|
11
11
|
* 予約使用
|
|
@@ -34,6 +34,6 @@ export declare function useReservation(params: {
|
|
|
34
34
|
code: AuthorizationRepo;
|
|
35
35
|
order: OrderRepo;
|
|
36
36
|
reservation: ReservationRepo;
|
|
37
|
-
|
|
37
|
+
integrationSetting: IntegrationSettingRepo;
|
|
38
38
|
task: TaskRepo;
|
|
39
39
|
}) => Promise<void>;
|
|
@@ -8,7 +8,6 @@ const assetTransaction_1 = require("../../repo/assetTransaction");
|
|
|
8
8
|
const offer_1 = require("../../repo/rateLimit/offer");
|
|
9
9
|
const reservation_1 = require("../../repo/reservation");
|
|
10
10
|
const reserveInterface_1 = require("../../repo/reserveInterface");
|
|
11
|
-
const setting_1 = require("../../repo/setting");
|
|
12
11
|
const integration_1 = require("../../repo/setting/integration");
|
|
13
12
|
const stockHolder_1 = require("../../repo/stockHolder");
|
|
14
13
|
const task_1 = require("../../repo/task");
|
|
@@ -27,7 +26,7 @@ function call(params) {
|
|
|
27
26
|
if (redisClient === undefined) {
|
|
28
27
|
throw new factory_1.factory.errors.Argument('settings', 'redisClient required');
|
|
29
28
|
}
|
|
30
|
-
const
|
|
29
|
+
const integrationSettingRepo = new integration_1.IntegrationSettingRepo({ connection });
|
|
31
30
|
const { data } = params;
|
|
32
31
|
// support COAReserve(2025-03-01~)
|
|
33
32
|
if (data.purpose?.typeOf === factory_1.factory.assetTransactionType.Reserve) {
|
|
@@ -37,7 +36,7 @@ function call(params) {
|
|
|
37
36
|
stockHolder: new stockHolder_1.StockHolderRepo({ connection }),
|
|
38
37
|
offerRateLimit: new offer_1.OfferRateLimitRepo(redisClient),
|
|
39
38
|
reservation: new reservation_1.ReservationRepo(connection),
|
|
40
|
-
|
|
39
|
+
integrationSetting: integrationSettingRepo,
|
|
41
40
|
task: new task_1.TaskRepo(connection)
|
|
42
41
|
});
|
|
43
42
|
}
|
|
@@ -55,7 +54,7 @@ function call(params) {
|
|
|
55
54
|
const reserveService = new coa_service_1.COA.service.Reserve({
|
|
56
55
|
endpoint: coaAuthClient.options.endpoint,
|
|
57
56
|
auth: coaAuthClient
|
|
58
|
-
}, { timeout: (await
|
|
57
|
+
}, { timeout: (await integrationSettingRepo.getByKey('coa')).timeoutReserve });
|
|
59
58
|
const { object, instrument } = data;
|
|
60
59
|
await (0, cancelReservation_2.cancelPendingReservation)({
|
|
61
60
|
object,
|
|
@@ -6,7 +6,7 @@ const cancel_1 = require("../../repo/action/cancel");
|
|
|
6
6
|
const assetTransaction_1 = require("../../repo/assetTransaction");
|
|
7
7
|
const offer_1 = require("../../repo/rateLimit/offer");
|
|
8
8
|
const reservation_1 = require("../../repo/reservation");
|
|
9
|
-
const
|
|
9
|
+
const integration_1 = require("../../repo/setting/integration");
|
|
10
10
|
const stockHolder_1 = require("../../repo/stockHolder");
|
|
11
11
|
const task_1 = require("../../repo/task");
|
|
12
12
|
const cancelReservation_1 = require("../reserve/cancelReservation");
|
|
@@ -22,7 +22,7 @@ function call(params) {
|
|
|
22
22
|
await (0, cancelReservation_1.cancelReservation)(data.actionAttributes)({
|
|
23
23
|
actions: { cancel: new cancel_1.CancelActionRepo(connection) },
|
|
24
24
|
reservation: new reservation_1.ReservationRepo(connection),
|
|
25
|
-
|
|
25
|
+
integrationSetting: new integration_1.IntegrationSettingRepo({ connection }),
|
|
26
26
|
task: new task_1.TaskRepo(connection),
|
|
27
27
|
assetTransaction: new assetTransaction_1.AssetTransactionRepo(connection),
|
|
28
28
|
offerRateLimit: new offer_1.OfferRateLimitRepo(redisClient),
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { COA } from '@motionpicture/coa-service';
|
|
2
2
|
import { factory } from '../../factory';
|
|
3
|
-
import type { IntegrationSettingRepo as Settings } from '../../repo/setting/integration';
|
|
4
3
|
import type { ICallResult, IExecutableTaskKeys, IOperationExecute } from '../taskHandler';
|
|
5
4
|
import { AcceptedOfferRepo } from '../../repo/acceptedOffer';
|
|
6
5
|
import { ConfirmActionRepo } from '../../repo/action/confirm';
|
|
@@ -9,7 +8,7 @@ import { AssetTransactionRepo } from '../../repo/assetTransaction';
|
|
|
9
8
|
import { AuthorizationRepo } from '../../repo/authorization';
|
|
10
9
|
import { OrderRepo } from '../../repo/order';
|
|
11
10
|
import { ReservationRepo } from '../../repo/reservation';
|
|
12
|
-
import {
|
|
11
|
+
import { IntegrationSettingRepo } from '../../repo/setting/integration';
|
|
13
12
|
import { TaskRepo } from '../../repo/task';
|
|
14
13
|
/**
|
|
15
14
|
* タスク実行関数
|
|
@@ -39,7 +38,7 @@ export declare function confirmReserveTransaction(params: Omit<factory.task.IDat
|
|
|
39
38
|
code: AuthorizationRepo;
|
|
40
39
|
order: OrderRepo;
|
|
41
40
|
reservation: ReservationRepo;
|
|
42
|
-
|
|
41
|
+
integrationSetting: IntegrationSettingRepo;
|
|
43
42
|
task: TaskRepo;
|
|
44
43
|
reserveService: COA.service.Reserve;
|
|
45
|
-
}
|
|
44
|
+
}) => Promise<void>;
|
|
@@ -17,7 +17,6 @@ const authorization_1 = require("../../repo/authorization");
|
|
|
17
17
|
const order_1 = require("../../repo/order");
|
|
18
18
|
const reservation_1 = require("../../repo/reservation");
|
|
19
19
|
const reserveInterface_1 = require("../../repo/reserveInterface");
|
|
20
|
-
const setting_1 = require("../../repo/setting");
|
|
21
20
|
const integration_1 = require("../../repo/setting/integration");
|
|
22
21
|
const task_1 = require("../../repo/task");
|
|
23
22
|
let coaAuthClientCreated = false;
|
|
@@ -30,7 +29,7 @@ let coaAuthClient = new coa_service_1.COA.auth.RefreshToken({
|
|
|
30
29
|
*/
|
|
31
30
|
function call(params) {
|
|
32
31
|
return async ({ connection }) => {
|
|
33
|
-
const
|
|
32
|
+
const integrationSettingRepo = new integration_1.IntegrationSettingRepo({ connection });
|
|
34
33
|
if (!coaAuthClientCreated) {
|
|
35
34
|
const reserveInterfaceRepo = new reserveInterface_1.ReserveInterfaceRepo(connection);
|
|
36
35
|
const coaAPI = await reserveInterfaceRepo.findOne({ project: { id: { $eq: params.project.id } } });
|
|
@@ -43,7 +42,7 @@ function call(params) {
|
|
|
43
42
|
const reserveService = new coa_service_1.COA.service.Reserve({
|
|
44
43
|
endpoint: coaAuthClient.options.endpoint, // same as authClient(2024-07-17~)
|
|
45
44
|
auth: coaAuthClient
|
|
46
|
-
}, { timeout: (await
|
|
45
|
+
}, { timeout: (await integrationSettingRepo.getByKey('coa')).timeoutReserve });
|
|
47
46
|
await confirmReserveTransaction({
|
|
48
47
|
...params.data,
|
|
49
48
|
project: params.project,
|
|
@@ -61,10 +60,10 @@ function call(params) {
|
|
|
61
60
|
code: new authorization_1.AuthorizationRepo(connection),
|
|
62
61
|
order: new order_1.OrderRepo(connection),
|
|
63
62
|
reservation: new reservation_1.ReservationRepo(connection),
|
|
64
|
-
|
|
63
|
+
integrationSetting: integrationSettingRepo,
|
|
65
64
|
task: new task_1.TaskRepo(connection),
|
|
66
65
|
reserveService
|
|
67
|
-
}
|
|
66
|
+
});
|
|
68
67
|
};
|
|
69
68
|
}
|
|
70
69
|
function createConfirmObject4COAByOrder(params) {
|
|
@@ -148,7 +147,7 @@ function fixOrderAsPurpose(params) {
|
|
|
148
147
|
* 予約を確定する
|
|
149
148
|
*/
|
|
150
149
|
function confirmReserveTransaction(params, options) {
|
|
151
|
-
return async (repos
|
|
150
|
+
return async (repos) => {
|
|
152
151
|
let confirmActionObject;
|
|
153
152
|
// let updReserveResult: COA.factory.reserve.IUpdReserveResult | undefined;
|
|
154
153
|
let recipe;
|
|
@@ -207,7 +206,7 @@ function confirmReserveTransaction(params, options) {
|
|
|
207
206
|
await (0, confirm_1.confirm)({
|
|
208
207
|
transactionNumber: object.transactionNumber,
|
|
209
208
|
potentialActions: object.potentialActions
|
|
210
|
-
})(repos
|
|
209
|
+
})(repos);
|
|
211
210
|
}
|
|
212
211
|
}
|
|
213
212
|
catch (error) {
|
|
@@ -4,6 +4,7 @@ exports.call = call;
|
|
|
4
4
|
const inform_1 = require("../../repo/action/inform");
|
|
5
5
|
const potentialAction_1 = require("../../repo/potentialAction");
|
|
6
6
|
const setting_1 = require("../../repo/setting");
|
|
7
|
+
const integration_1 = require("../../repo/setting/integration");
|
|
7
8
|
const notification_1 = require("../notification");
|
|
8
9
|
/**
|
|
9
10
|
* タスク実行関数
|
|
@@ -18,7 +19,8 @@ function call(params) {
|
|
|
18
19
|
inform: new inform_1.InformActionRepo(connection)
|
|
19
20
|
},
|
|
20
21
|
potentialAction: new potentialAction_1.PotentialActionRepo(connection),
|
|
21
|
-
setting: new setting_1.SettingRepo(connection)
|
|
22
|
+
setting: new setting_1.SettingRepo(connection),
|
|
23
|
+
integrationSetting: new integration_1.IntegrationSettingRepo({ connection })
|
|
22
24
|
});
|
|
23
25
|
};
|
|
24
26
|
}
|
|
@@ -5,7 +5,6 @@ const acceptedOffer_1 = require("../../repo/acceptedOffer");
|
|
|
5
5
|
const assetTransaction_1 = require("../../repo/assetTransaction");
|
|
6
6
|
const message_1 = require("../../repo/message");
|
|
7
7
|
const order_1 = require("../../repo/order");
|
|
8
|
-
const setting_1 = require("../../repo/setting");
|
|
9
8
|
const integration_1 = require("../../repo/setting/integration");
|
|
10
9
|
const task_1 = require("../../repo/task");
|
|
11
10
|
const placeOrder_1 = require("../../repo/transaction/placeOrder");
|
|
@@ -16,15 +15,15 @@ const onAssetTransactionStatusChanged_1 = require("../order/onAssetTransactionSt
|
|
|
16
15
|
function call(params) {
|
|
17
16
|
return async ({ connection }) => {
|
|
18
17
|
const { data } = params;
|
|
19
|
-
const
|
|
18
|
+
const integrationSettingRepo = new integration_1.IntegrationSettingRepo({ connection });
|
|
20
19
|
await (0, onAssetTransactionStatusChanged_1.onAssetTransactionStatusChanged)(data)({
|
|
21
20
|
acceptedOffer: new acceptedOffer_1.AcceptedOfferRepo(connection),
|
|
22
21
|
assetTransaction: new assetTransaction_1.AssetTransactionRepo(connection),
|
|
23
22
|
message: new message_1.MessageRepo(connection),
|
|
24
23
|
order: new order_1.OrderRepo(connection),
|
|
25
|
-
|
|
24
|
+
integrationSetting: integrationSettingRepo,
|
|
26
25
|
task: new task_1.TaskRepo(connection),
|
|
27
26
|
placeOrder: new placeOrder_1.PlaceOrderRepo(connection)
|
|
28
|
-
},
|
|
27
|
+
}, integrationSettingRepo);
|
|
29
28
|
};
|
|
30
29
|
}
|
|
@@ -8,7 +8,7 @@ const assetTransaction_1 = require("../../repo/assetTransaction");
|
|
|
8
8
|
const authorization_1 = require("../../repo/authorization");
|
|
9
9
|
const order_1 = require("../../repo/order");
|
|
10
10
|
const reservation_1 = require("../../repo/reservation");
|
|
11
|
-
const
|
|
11
|
+
const integration_1 = require("../../repo/setting/integration");
|
|
12
12
|
const task_1 = require("../../repo/task");
|
|
13
13
|
const reserve_2 = require("../reserve");
|
|
14
14
|
/**
|
|
@@ -23,7 +23,7 @@ function call(params) {
|
|
|
23
23
|
code: new authorization_1.AuthorizationRepo(connection),
|
|
24
24
|
order: new order_1.OrderRepo(connection),
|
|
25
25
|
reservation: new reservation_1.ReservationRepo(connection),
|
|
26
|
-
|
|
26
|
+
integrationSetting: new integration_1.IntegrationSettingRepo({ connection }),
|
|
27
27
|
task: new task_1.TaskRepo(connection)
|
|
28
28
|
});
|
|
29
29
|
};
|
|
@@ -8,6 +8,7 @@ const pendingReservation_1 = require("../../repo/pendingReservation");
|
|
|
8
8
|
const project_1 = require("../../repo/project");
|
|
9
9
|
const setting_1 = require("../../repo/setting");
|
|
10
10
|
const task_1 = require("../../repo/task");
|
|
11
|
+
const integration_1 = require("../../repo/setting/integration");
|
|
11
12
|
const onEventChanged_1 = require("../offer/onEventChanged");
|
|
12
13
|
/**
|
|
13
14
|
* タスク実行関数
|
|
@@ -19,6 +20,7 @@ function call(params) {
|
|
|
19
20
|
adminEvent: new adminEvent_1.AdminEventRepo(connection),
|
|
20
21
|
event: new event_1.EventRepo(connection),
|
|
21
22
|
eventSeries: new eventSeries_1.EventSeriesRepo(connection),
|
|
23
|
+
integrationSetting: new integration_1.IntegrationSettingRepo({ connection }),
|
|
22
24
|
pendingReservation: new pendingReservation_1.PendingReservationRepo(connection),
|
|
23
25
|
project: new project_1.ProjectRepo(connection),
|
|
24
26
|
setting: new setting_1.SettingRepo(connection),
|
|
@@ -4,7 +4,6 @@ exports.call = call;
|
|
|
4
4
|
const acceptedOffer_1 = require("../../repo/acceptedOffer");
|
|
5
5
|
const message_1 = require("../../repo/message");
|
|
6
6
|
const order_1 = require("../../repo/order");
|
|
7
|
-
const setting_1 = require("../../repo/setting");
|
|
8
7
|
const integration_1 = require("../../repo/setting/integration");
|
|
9
8
|
const task_1 = require("../../repo/task");
|
|
10
9
|
const placeOrder_1 = require("../../repo/transaction/placeOrder");
|
|
@@ -15,14 +14,13 @@ const payOrder_1 = require("../order/payOrder");
|
|
|
15
14
|
function call(params) {
|
|
16
15
|
return async ({ connection }) => {
|
|
17
16
|
const { data } = params;
|
|
18
|
-
const settings = new integration_1.IntegrationSettingRepo({ connection });
|
|
19
17
|
await (0, payOrder_1.payOrder)(data)({
|
|
20
18
|
acceptedOffer: new acceptedOffer_1.AcceptedOfferRepo(connection),
|
|
21
19
|
message: new message_1.MessageRepo(connection),
|
|
22
20
|
order: new order_1.OrderRepo(connection),
|
|
23
|
-
|
|
21
|
+
integrationSetting: new integration_1.IntegrationSettingRepo({ connection }),
|
|
24
22
|
task: new task_1.TaskRepo(connection),
|
|
25
23
|
placeOrder: new placeOrder_1.PlaceOrderRepo(connection)
|
|
26
|
-
}
|
|
24
|
+
});
|
|
27
25
|
};
|
|
28
26
|
}
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { factory } from '../../../factory';
|
|
2
2
|
import type { OfferRepo } from '../../../repo/offer/unitPriceInCatalog';
|
|
3
|
-
import type { ISetting } from '../../../repo/setting';
|
|
4
3
|
import type { TaskRepo } from '../../../repo/task';
|
|
4
|
+
import type { IIntegrationSettings } from '../../../repo/setting/integration';
|
|
5
5
|
export declare function createInformOfferTasks(params: {
|
|
6
6
|
project: {
|
|
7
7
|
id: string;
|
|
8
8
|
};
|
|
9
9
|
ids: string[];
|
|
10
10
|
typeOf: factory.offerType.AggregateOffer;
|
|
11
|
-
}, setting
|
|
11
|
+
}, setting?: IIntegrationSettings['hub']): (repos: {
|
|
12
12
|
offer: OfferRepo;
|
|
13
13
|
task: TaskRepo;
|
|
14
14
|
}) => Promise<void>;
|
|
@@ -7,7 +7,8 @@ function createInformOfferTasks(params, setting) {
|
|
|
7
7
|
if (params.ids.length === 0) {
|
|
8
8
|
return;
|
|
9
9
|
}
|
|
10
|
-
const informResources = setting?.onResourceUpdated?.informResource;
|
|
10
|
+
// const informResources = setting?.onResourceUpdated?.informResource;
|
|
11
|
+
const informResources = setting?.onTaskStatusChanged.informTask2hub;
|
|
11
12
|
const offers = await repos.offer.findUnitPriceOffers({
|
|
12
13
|
id: { $in: params.ids }
|
|
13
14
|
}, {
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { factory } from '../../../factory';
|
|
2
2
|
import type { POSRepo } from '../../../repo/place/pos';
|
|
3
3
|
import type { MovieTheaterRepo } from '../../../repo/place/movieTheater';
|
|
4
|
-
import type { SettingRepo } from '../../../repo/setting';
|
|
5
4
|
import type { TaskRepo } from '../../../repo/task';
|
|
5
|
+
import type { IntegrationSettingRepo } from '../../../repo/setting/integration';
|
|
6
6
|
export declare function createInformHasPOSTasks(params: {
|
|
7
7
|
project: {
|
|
8
8
|
id: string;
|
|
@@ -19,6 +19,6 @@ export declare function createInformHasPOSTasks(params: {
|
|
|
19
19
|
}): (repos: {
|
|
20
20
|
pos: POSRepo;
|
|
21
21
|
movieTheater: MovieTheaterRepo;
|
|
22
|
-
setting: SettingRepo;
|
|
23
22
|
task: TaskRepo;
|
|
23
|
+
integrationSetting: IntegrationSettingRepo;
|
|
24
24
|
}) => Promise<void>;
|
|
@@ -7,8 +7,9 @@ function createInformHasPOSTasks(params) {
|
|
|
7
7
|
// if (params.ids.length !== 1) {
|
|
8
8
|
// throw new factory.errors.Argument('id', 'id.length must be 1');
|
|
9
9
|
// }
|
|
10
|
-
const setting = await repos.setting.findOne({ project: { id: { $eq: '*' } } }, ['onResourceUpdated']);
|
|
11
|
-
const informResources = setting?.onResourceUpdated?.informResource;
|
|
10
|
+
// const setting = await repos.setting.findOne({ project: { id: { $eq: '*' } } }, ['onResourceUpdated']) as Pick<ISetting, 'onResourceUpdated'> | null;
|
|
11
|
+
// const informResources = setting?.onResourceUpdated?.informResource;
|
|
12
|
+
const informResources = (await repos.integrationSetting.getByKey('hub'))?.onTaskStatusChanged.informTask2hub;
|
|
12
13
|
const movieTheaters = await repos.movieTheater.projectFields({
|
|
13
14
|
limit: 1,
|
|
14
15
|
page: 1,
|
|
@@ -2,8 +2,9 @@ import { factory } from '../../../factory';
|
|
|
2
2
|
import type { AggregateOfferRepo } from '../../../repo/aggregateOffer';
|
|
3
3
|
import type { OfferCatalogRepo } from '../../../repo/offerCatalog';
|
|
4
4
|
import type { OfferCatalogItemRepo } from '../../../repo/offerCatalogItem';
|
|
5
|
-
import type {
|
|
5
|
+
import type { SettingRepo } from '../../../repo/setting';
|
|
6
6
|
import type { TaskRepo } from '../../../repo/task';
|
|
7
|
+
import type { IIntegrationSettings } from '../../../repo/setting/integration';
|
|
7
8
|
export declare function createInformOfferCatalogTasks(params: {
|
|
8
9
|
project: {
|
|
9
10
|
id: string;
|
|
@@ -11,7 +12,7 @@ export declare function createInformOfferCatalogTasks(params: {
|
|
|
11
12
|
ids: string[];
|
|
12
13
|
typeOf: factory.offerCatalog.IOfferCatalog['typeOf'];
|
|
13
14
|
isOfferCatalogItem: boolean;
|
|
14
|
-
}, setting
|
|
15
|
+
}, setting?: IIntegrationSettings['hub']): (repos: {
|
|
15
16
|
offerCatalog: OfferCatalogRepo;
|
|
16
17
|
offerCatalogItem: OfferCatalogItemRepo;
|
|
17
18
|
setting: SettingRepo;
|
|
@@ -18,8 +18,8 @@ function createInformOfferCatalogTasks(params, setting) {
|
|
|
18
18
|
else {
|
|
19
19
|
offerCatalogs = await repos.offerCatalog.projectFields({ id: { $in: params.ids } }, ['identifier', 'name', 'numberOfItems', 'project', 'typeOf']);
|
|
20
20
|
}
|
|
21
|
-
// const informResources =
|
|
22
|
-
const informResources = setting?.
|
|
21
|
+
// const informResources = setting?.onResourceUpdated?.informResource;
|
|
22
|
+
const informResources = setting?.onTaskStatusChanged.informTask2hub;
|
|
23
23
|
const offerCatalogs4inform = offerCatalogs.map(({ id, typeOf, name, identifier, project, numberOfItems }) => {
|
|
24
24
|
return { id, typeOf, name, identifier, project, numberOfItems };
|
|
25
25
|
});
|