@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
|
@@ -21,6 +21,7 @@ const screeningRoom_1 = require("../../repo/place/screeningRoom");
|
|
|
21
21
|
const product_1 = require("../../repo/product");
|
|
22
22
|
const setting_1 = require("../../repo/setting");
|
|
23
23
|
const task_1 = require("../../repo/task");
|
|
24
|
+
const integration_1 = require("../../repo/setting/integration");
|
|
24
25
|
const onAggregateOfferUpdated_1 = require("./onResourceUpdated/onAggregateOfferUpdated");
|
|
25
26
|
// import { onCategoryCodeUpdated } from './onResourceUpdated/onCategoryCodeUpdated';
|
|
26
27
|
const onHasPOSUpdated_1 = require("./onResourceUpdated/onHasPOSUpdated");
|
|
@@ -39,6 +40,7 @@ function call(params) {
|
|
|
39
40
|
entranceGate: new entranceGate_1.EntranceGateRepo(connection, { id: '' }), // 先の処理で明示的に指定される
|
|
40
41
|
event: new event_1.EventRepo(connection),
|
|
41
42
|
eventSeries: new eventSeries_1.EventSeriesRepo(connection),
|
|
43
|
+
integrationSetting: new integration_1.IntegrationSettingRepo({ connection }),
|
|
42
44
|
pos: new pos_1.POSRepo(connection, { id: '' }), // 先の処理で明示的に指定される
|
|
43
45
|
member: new member_1.MemberRepo(connection),
|
|
44
46
|
movieTheater: new movieTheater_1.MovieTheaterRepo(connection),
|
|
@@ -63,7 +65,8 @@ function onResourceUpdated(params) {
|
|
|
63
65
|
// await onResourceDeleted(params)(repos);
|
|
64
66
|
}
|
|
65
67
|
else {
|
|
66
|
-
const setting = await repos.setting.findOne({ project: { id: { $eq: '*' } } }, ['
|
|
68
|
+
const setting = await repos.setting.findOne({ project: { id: { $eq: '*' } } }, ['useInformResourceTypes']);
|
|
69
|
+
const hubSettings = (await repos.integrationSetting.getByKey('hub'));
|
|
67
70
|
const useInformResourceTypes = setting?.useInformResourceTypes;
|
|
68
71
|
const useInform = params.useInform === true
|
|
69
72
|
&& Array.isArray(useInformResourceTypes) && useInformResourceTypes.includes(params.typeOf);
|
|
@@ -75,50 +78,50 @@ function onResourceUpdated(params) {
|
|
|
75
78
|
project: { id: params.project.id },
|
|
76
79
|
ids: params.id,
|
|
77
80
|
typeOf: params.typeOf
|
|
78
|
-
},
|
|
81
|
+
}, hubSettings)(repos);
|
|
79
82
|
break;
|
|
80
83
|
case factory_1.factory.creativeWorkType.Movie:
|
|
81
84
|
await createInformMovieTasks({
|
|
82
85
|
project: { id: params.project.id },
|
|
83
86
|
ids: params.id,
|
|
84
87
|
typeOf: params.typeOf
|
|
85
|
-
},
|
|
88
|
+
}, hubSettings)(repos);
|
|
86
89
|
break;
|
|
87
90
|
case factory_1.factory.product.ProductType.EventService:
|
|
88
91
|
await createInformProductTasks({
|
|
89
92
|
project: { id: params.project.id },
|
|
90
93
|
ids: params.id,
|
|
91
94
|
typeOf: params.typeOf
|
|
92
|
-
},
|
|
95
|
+
}, hubSettings)(repos);
|
|
93
96
|
break;
|
|
94
97
|
case 'CategoryCode':
|
|
95
98
|
await createInformCategoryCodeTasks({
|
|
96
99
|
project: { id: params.project.id },
|
|
97
100
|
ids: params.id,
|
|
98
101
|
typeOf: params.typeOf
|
|
99
|
-
},
|
|
102
|
+
}, hubSettings)(repos);
|
|
100
103
|
break;
|
|
101
104
|
case factory_1.factory.placeType.MovieTheater:
|
|
102
105
|
await createInformMovieTheaterTasks({
|
|
103
106
|
project: { id: params.project.id },
|
|
104
107
|
ids: params.id,
|
|
105
108
|
typeOf: params.typeOf
|
|
106
|
-
},
|
|
109
|
+
}, hubSettings)(repos);
|
|
107
110
|
break;
|
|
108
111
|
// ルーム通知に対応(2026-01-16~)
|
|
109
112
|
case factory_1.factory.placeType.ScreeningRoom:
|
|
110
|
-
await createInformRoomTasks(params,
|
|
113
|
+
await createInformRoomTasks(params, hubSettings)(repos);
|
|
111
114
|
break;
|
|
112
115
|
// 入場ゲート通知に対応(2026-01-17~)
|
|
113
116
|
case factory_1.factory.placeType.EntranceGate:
|
|
114
|
-
await createInformEntranceGateTasks(params,
|
|
117
|
+
await createInformEntranceGateTasks(params, hubSettings)(repos);
|
|
115
118
|
break;
|
|
116
119
|
case 'AccountTitle':
|
|
117
120
|
await createInformAccountTitleTasks({
|
|
118
121
|
project: { id: params.project.id },
|
|
119
122
|
ids: params.id,
|
|
120
123
|
typeOf: params.typeOf
|
|
121
|
-
},
|
|
124
|
+
}, hubSettings)(repos);
|
|
122
125
|
break;
|
|
123
126
|
case 'POS':
|
|
124
127
|
await (0, onHasPOSUpdated_1.createInformHasPOSTasks)({
|
|
@@ -133,7 +136,7 @@ function onResourceUpdated(params) {
|
|
|
133
136
|
project: { id: params.project.id },
|
|
134
137
|
ids: params.id,
|
|
135
138
|
typeOf: params.typeOf
|
|
136
|
-
},
|
|
139
|
+
}, hubSettings)(repos);
|
|
137
140
|
break;
|
|
138
141
|
case 'OfferCatalog':
|
|
139
142
|
await (0, onOfferCatalogUpdated_1.createInformOfferCatalogTasks)({
|
|
@@ -141,7 +144,7 @@ function onResourceUpdated(params) {
|
|
|
141
144
|
ids: params.id,
|
|
142
145
|
typeOf: params.typeOf,
|
|
143
146
|
isOfferCatalogItem: params.isOfferCatalogItem === true
|
|
144
|
-
},
|
|
147
|
+
}, hubSettings)(repos);
|
|
145
148
|
break;
|
|
146
149
|
default:
|
|
147
150
|
// no op
|
|
@@ -184,8 +187,8 @@ function onResourceUpdated(params) {
|
|
|
184
187
|
function createInformNoteTasks(params, setting) {
|
|
185
188
|
return async (repos) => {
|
|
186
189
|
const notes4inform = await repos.note.findNotes({ id: { $in: params.ids } }, ['about', 'identifier', 'project', 'text', 'typeOf', 'version']);
|
|
187
|
-
// const informResources =
|
|
188
|
-
const informResources = setting?.
|
|
190
|
+
// const informResources = setting?.onResourceUpdated?.informResource;
|
|
191
|
+
const informResources = setting?.onTaskStatusChanged.informTask2hub;
|
|
189
192
|
if (notes4inform.length > 0) {
|
|
190
193
|
const taskRunsAt = new Date();
|
|
191
194
|
const informTasks = [];
|
|
@@ -234,8 +237,8 @@ function createInformMovieTasks(params, setting) {
|
|
|
234
237
|
'additionalProperty', 'datePublished', 'duration', 'identifier', 'name', 'project',
|
|
235
238
|
'typeOf', 'distributor', 'contentRating', 'headline', 'thumbnailUrl'
|
|
236
239
|
]);
|
|
237
|
-
// const informResources =
|
|
238
|
-
const informResources = setting?.
|
|
240
|
+
// const informResources = setting?.onResourceUpdated?.informResource;
|
|
241
|
+
const informResources = setting?.onTaskStatusChanged.informTask2hub;
|
|
239
242
|
if (movies4inform.length > 0) {
|
|
240
243
|
const taskRunsAt = new Date();
|
|
241
244
|
const informTasks = [];
|
|
@@ -284,8 +287,8 @@ function createInformProductTasks(params, setting) {
|
|
|
284
287
|
}, ['additionalProperty', 'description', 'name', 'productID', 'project', 'typeOf', 'serviceType']
|
|
285
288
|
// []
|
|
286
289
|
);
|
|
287
|
-
// const informResources =
|
|
288
|
-
const informResources = setting?.
|
|
290
|
+
// const informResources = setting?.onResourceUpdated?.informResource;
|
|
291
|
+
const informResources = setting?.onTaskStatusChanged.informTask2hub;
|
|
289
292
|
if (products4inform.length > 0) {
|
|
290
293
|
const taskRunsAt = new Date();
|
|
291
294
|
const informTasks = [];
|
|
@@ -333,7 +336,8 @@ function createInformCategoryCodeTasks(params, setting) {
|
|
|
333
336
|
// ひとまずDistributorTypeのみ
|
|
334
337
|
inCodeSet: { identifier: { $eq: factory_1.factory.categoryCode.CategorySetIdentifier.DistributorType } }
|
|
335
338
|
}, ['name', 'additionalProperty', 'project', 'typeOf', 'codeValue', 'inCodeSet']);
|
|
336
|
-
const informResources = setting?.onResourceUpdated?.informResource;
|
|
339
|
+
// const informResources = setting?.onResourceUpdated?.informResource;
|
|
340
|
+
const informResources = setting?.onTaskStatusChanged.informTask2hub;
|
|
337
341
|
if (categoryCodes4inform.length > 0) {
|
|
338
342
|
const taskRunsAt = new Date();
|
|
339
343
|
const informTasks = [];
|
|
@@ -381,7 +385,8 @@ function createInformMovieTheaterTasks(params, setting) {
|
|
|
381
385
|
if (params.ids.length === 0) {
|
|
382
386
|
return;
|
|
383
387
|
}
|
|
384
|
-
const informResources = setting?.onResourceUpdated?.informResource;
|
|
388
|
+
// const informResources = setting?.onResourceUpdated?.informResource;
|
|
389
|
+
const informResources = setting?.onTaskStatusChanged.informTask2hub;
|
|
385
390
|
const movieTheaters = await repos.movieTheater.projectFields({
|
|
386
391
|
// limit: 1,
|
|
387
392
|
// page: 1,
|
|
@@ -453,8 +458,8 @@ function createInformRoomTasks(params, setting) {
|
|
|
453
458
|
return async (repos
|
|
454
459
|
// settings: Settings
|
|
455
460
|
) => {
|
|
456
|
-
// const informResources =
|
|
457
|
-
const informResources = setting?.
|
|
461
|
+
// const informResources = setting?.onResourceUpdated?.informResource;
|
|
462
|
+
const informResources = setting?.onTaskStatusChanged.informTask2hub;
|
|
458
463
|
if (Array.isArray(params.branchCode) && params.branchCode.length > 0) {
|
|
459
464
|
// ルームを検索
|
|
460
465
|
const rooms = (await repos.screeningRoom.findRooms({
|
|
@@ -513,7 +518,8 @@ function createInformRoomTasks(params, setting) {
|
|
|
513
518
|
}
|
|
514
519
|
function createInformEntranceGateTasks(params, setting) {
|
|
515
520
|
return async (repos) => {
|
|
516
|
-
const informResources = setting?.onResourceUpdated?.informResource;
|
|
521
|
+
// const informResources = setting?.onResourceUpdated?.informResource;
|
|
522
|
+
const informResources = setting?.onTaskStatusChanged.informTask2hub;
|
|
517
523
|
if (Array.isArray(params.identifier) && params.identifier.length > 0) {
|
|
518
524
|
// 入場ゲートを検索
|
|
519
525
|
repos.entranceGate.setOperatorId({ id: params.containedInPlace.id });
|
|
@@ -574,8 +580,8 @@ function createInformAccountTitleTasks(params, setting) {
|
|
|
574
580
|
if (params.ids.length !== 1) {
|
|
575
581
|
throw new factory_1.factory.errors.Argument('id', 'id.length must be 1');
|
|
576
582
|
}
|
|
577
|
-
// const informResources =
|
|
578
|
-
const informResources = setting?.
|
|
583
|
+
// const informResources = setting?.onResourceUpdated?.informResource;
|
|
584
|
+
const informResources = setting?.onTaskStatusChanged.informTask2hub;
|
|
579
585
|
const accountTitle = await repos.adminAccountTitleCategory.findAccountTitleCategorAsNotification({
|
|
580
586
|
id: params.ids[0],
|
|
581
587
|
projectId: params.project.id
|
|
@@ -10,7 +10,6 @@ const authorizePaymentMethod_1 = require("../../repo/action/authorizePaymentMeth
|
|
|
10
10
|
const message_1 = require("../../repo/message");
|
|
11
11
|
const order_2 = require("../../repo/order");
|
|
12
12
|
const orderInTransaction_1 = require("../../repo/orderInTransaction");
|
|
13
|
-
const setting_1 = require("../../repo/setting");
|
|
14
13
|
const integration_1 = require("../../repo/setting/integration");
|
|
15
14
|
const task_1 = require("../../repo/task");
|
|
16
15
|
const placeOrder_1 = require("../../repo/transaction/placeOrder");
|
|
@@ -21,7 +20,6 @@ const placeOrder_2 = require("../order/placeOrder");
|
|
|
21
20
|
function call(params) {
|
|
22
21
|
return async ({ connection }) => {
|
|
23
22
|
const { data } = params;
|
|
24
|
-
const settings = new integration_1.IntegrationSettingRepo({ connection });
|
|
25
23
|
await (0, placeOrder_2.placeOrder)({
|
|
26
24
|
...data,
|
|
27
25
|
agent: { id: data.project.id, typeOf: factory_1.factory.organizationType.Project },
|
|
@@ -37,9 +35,9 @@ function call(params) {
|
|
|
37
35
|
message: new message_1.MessageRepo(connection),
|
|
38
36
|
order: new order_2.OrderRepo(connection),
|
|
39
37
|
orderInTransaction: new orderInTransaction_1.OrderInTransactionRepo(connection),
|
|
40
|
-
|
|
38
|
+
integrationSetting: new integration_1.IntegrationSettingRepo({ connection }),
|
|
41
39
|
task: new task_1.TaskRepo(connection),
|
|
42
40
|
placeOrder: new placeOrder_1.PlaceOrderRepo(connection)
|
|
43
|
-
}
|
|
41
|
+
});
|
|
44
42
|
};
|
|
45
43
|
}
|
|
@@ -5,7 +5,7 @@ const reserve_1 = require("../../repo/action/reserve");
|
|
|
5
5
|
const assetTransaction_1 = require("../../repo/assetTransaction");
|
|
6
6
|
const authorization_1 = require("../../repo/authorization");
|
|
7
7
|
const reservation_1 = require("../../repo/reservation");
|
|
8
|
-
const
|
|
8
|
+
const integration_1 = require("../../repo/setting/integration");
|
|
9
9
|
const task_1 = require("../../repo/task");
|
|
10
10
|
const confirmReservation_1 = require("../reserve/confirmReservation");
|
|
11
11
|
/**
|
|
@@ -23,7 +23,7 @@ function call(params) {
|
|
|
23
23
|
assetTransaction: new assetTransaction_1.AssetTransactionRepo(connection),
|
|
24
24
|
code: new authorization_1.AuthorizationRepo(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
|
};
|
|
@@ -4,7 +4,7 @@ exports.call = call;
|
|
|
4
4
|
const acceptedOffer_1 = require("../../repo/acceptedOffer");
|
|
5
5
|
const returnAction_1 = require("../../repo/action/returnAction");
|
|
6
6
|
const order_1 = require("../../repo/order");
|
|
7
|
-
const
|
|
7
|
+
const integration_1 = require("../../repo/setting/integration");
|
|
8
8
|
const task_1 = require("../../repo/task");
|
|
9
9
|
// import { ReturnOrderRepo } from '../../repo/transaction/returnOrder';
|
|
10
10
|
const returnOrder_1 = require("../order/returnOrder");
|
|
@@ -21,7 +21,7 @@ function call(params) {
|
|
|
21
21
|
acceptedOffer: new acceptedOffer_1.AcceptedOfferRepo(connection),
|
|
22
22
|
actions: { returnAction: new returnAction_1.ReturnActionRepo(connection) },
|
|
23
23
|
order: new order_1.OrderRepo(connection),
|
|
24
|
-
|
|
24
|
+
integrationSetting: new integration_1.IntegrationSettingRepo({ connection }),
|
|
25
25
|
task: new task_1.TaskRepo(connection),
|
|
26
26
|
// returnOrder: new ReturnOrderRepo(connection)
|
|
27
27
|
});
|
|
@@ -5,7 +5,7 @@ const factory_1 = require("../../factory");
|
|
|
5
5
|
const acceptedOffer_1 = require("../../repo/acceptedOffer");
|
|
6
6
|
const sendOrder_1 = require("../../repo/action/sendOrder");
|
|
7
7
|
const order_1 = require("../../repo/order");
|
|
8
|
-
const
|
|
8
|
+
const integration_1 = require("../../repo/setting/integration");
|
|
9
9
|
const task_1 = require("../../repo/task");
|
|
10
10
|
const sendOrder_2 = require("../order/sendOrder");
|
|
11
11
|
/**
|
|
@@ -30,7 +30,7 @@ function call(params) {
|
|
|
30
30
|
acceptedOffer: new acceptedOffer_1.AcceptedOfferRepo(connection),
|
|
31
31
|
actions: { sendOrder: new sendOrder_1.SendOrderActionRepo(connection) },
|
|
32
32
|
order: new order_1.OrderRepo(connection),
|
|
33
|
-
|
|
33
|
+
integrationSetting: new integration_1.IntegrationSettingRepo({ connection }),
|
|
34
34
|
task: new task_1.TaskRepo(connection),
|
|
35
35
|
});
|
|
36
36
|
};
|
|
@@ -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
|
}
|
|
@@ -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