@chevre/domain 26.0.0-alpha.3 → 26.0.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/lib/chevre/eventEmitter/task.d.ts +8 -23
- package/lib/chevre/eventEmitter/task.js +2 -2
- package/lib/chevre/repo/acceptedOffer.d.ts +0 -7
- package/lib/chevre/repo/acceptedOffer.js +27 -27
- package/lib/chevre/repo/action/actionProcess.d.ts +1 -1
- package/lib/chevre/repo/action/inform.d.ts +45 -0
- package/lib/chevre/repo/action/inform.js +159 -0
- package/lib/chevre/repo/action/update.d.ts +56 -0
- package/lib/chevre/repo/action/update.js +173 -0
- package/lib/chevre/repo/action.d.ts +3 -19
- package/lib/chevre/repo/action.js +0 -298
- package/lib/chevre/repo/adminAssetTransaction.d.ts +126 -0
- package/lib/chevre/repo/adminAssetTransaction.js +491 -0
- package/lib/chevre/repo/adminAsyncAction.d.ts +2 -2
- package/lib/chevre/repo/adminScheduledTask.d.ts +1 -1
- package/lib/chevre/repo/adminTask.d.ts +25 -8
- package/lib/chevre/repo/adminTask.js +31 -32
- package/lib/chevre/repo/adminTransaction.d.ts +131 -0
- package/lib/chevre/repo/adminTransaction.js +237 -0
- package/lib/chevre/repo/aggregateAssetTransaction.d.ts +43 -0
- package/lib/chevre/repo/aggregateAssetTransaction.js +166 -0
- package/lib/chevre/repo/aggregateScheduledTask.d.ts +32 -0
- package/lib/chevre/repo/aggregateScheduledTask.js +136 -0
- package/lib/chevre/repo/aggregateTransaction.d.ts +39 -0
- package/lib/chevre/repo/aggregateTransaction.js +166 -0
- package/lib/chevre/repo/aggregation.d.ts +0 -8
- package/lib/chevre/repo/aggregation.js +0 -10
- package/lib/chevre/repo/assetTransaction.d.ts +10 -235
- package/lib/chevre/repo/assetTransaction.js +48 -636
- package/lib/chevre/repo/asyncAction.d.ts +2 -2
- package/lib/chevre/repo/authorization.d.ts +0 -6
- package/lib/chevre/repo/authorization.js +15 -27
- package/lib/chevre/repo/message.d.ts +0 -7
- package/lib/chevre/repo/message.js +0 -38
- package/lib/chevre/repo/mongoose/schemas/{ownershipInfo.d.ts → action/inform.d.ts} +5 -5
- package/lib/chevre/repo/mongoose/schemas/action/inform.js +81 -0
- package/lib/chevre/repo/mongoose/schemas/action/update.d.ts +12 -0
- package/lib/chevre/repo/mongoose/schemas/action/update.js +107 -0
- package/lib/chevre/repo/mongoose/schemas/action.d.ts +1 -1
- package/lib/chevre/repo/mongoose/schemas/action.js +8 -1
- package/lib/chevre/repo/mongoose/schemas/actionRecipe.js +7 -0
- package/lib/chevre/repo/mongoose/schemas/aggregateReservation.js +8 -9
- package/lib/chevre/repo/mongoose/schemas/aggregation.js +8 -1
- package/lib/chevre/repo/mongoose/schemas/assetTransaction.js +95 -76
- package/lib/chevre/repo/mongoose/schemas/authorization.js +25 -18
- package/lib/chevre/repo/mongoose/schemas/event.js +7 -0
- package/lib/chevre/repo/mongoose/schemas/eventOffer.js +7 -0
- package/lib/chevre/repo/mongoose/schemas/message.js +8 -1
- package/lib/chevre/repo/mongoose/schemas/pendingReservation.js +11 -4
- package/lib/chevre/repo/mongoose/schemas/setting.d.ts +1 -0
- package/lib/chevre/repo/mongoose/schemas/task.d.ts +2 -5
- package/lib/chevre/repo/mongoose/schemas/task.js +134 -118
- package/lib/chevre/repo/mongoose/schemas/ticket.js +8 -1
- package/lib/chevre/repo/orderInTransaction.d.ts +0 -3
- package/lib/chevre/repo/orderInTransaction.js +30 -22
- package/lib/chevre/repo/scheduledTask.d.ts +5 -2
- package/lib/chevre/repo/scheduledTask.js +3 -25
- package/lib/chevre/repo/task.d.ts +45 -171
- package/lib/chevre/repo/task.js +20 -475
- package/lib/chevre/repo/taskDelayed.d.ts +74 -0
- package/lib/chevre/repo/taskDelayed.js +195 -0
- package/lib/chevre/repo/taskRunning.d.ts +35 -0
- package/lib/chevre/repo/taskRunning.js +89 -0
- package/lib/chevre/repo/ticket.d.ts +0 -6
- package/lib/chevre/repo/ticket.js +0 -11
- package/lib/chevre/repo/transaction.d.ts +1 -187
- package/lib/chevre/repo/transaction.js +2 -383
- package/lib/chevre/repository.d.ts +35 -5
- package/lib/chevre/repository.js +79 -13
- package/lib/chevre/service/aggregation/system.d.ts +17 -9
- package/lib/chevre/service/aggregation/system.js +46 -4
- package/lib/chevre/service/assetTransaction/cancelReservation/start.js +10 -17
- package/lib/chevre/service/assetTransaction/refund.js +2 -2
- package/lib/chevre/service/asyncAction.d.ts +2 -2
- package/lib/chevre/service/asyncAction.js +1 -4
- package/lib/chevre/service/asyncActionHandler/onOperationFailed.d.ts +2 -2
- package/lib/chevre/service/asyncActionHandler/onOperationFailed.js +0 -2
- package/lib/chevre/service/asyncActionHandler.d.ts +4 -4
- package/lib/chevre/service/asyncActionHandler.js +11 -13
- package/lib/chevre/service/event/processUpdateMovieTheater.d.ts +4 -2
- package/lib/chevre/service/event/processUpdateMovieTheater.js +3 -3
- package/lib/chevre/service/event.d.ts +4 -2
- package/lib/chevre/service/event.js +3 -3
- package/lib/chevre/service/notification/triggerWebhook.d.ts +4 -2
- package/lib/chevre/service/notification/triggerWebhook.js +5 -16
- package/lib/chevre/service/offer/event/voidTransaction/processVoidTransaction4chevre.js +1 -3
- package/lib/chevre/service/offer/eventServiceByCOA/findAcceptAction.d.ts +0 -4
- package/lib/chevre/service/offer/eventServiceByCOA/findAcceptAction.js +19 -19
- package/lib/chevre/service/offer/onEventChanged.js +0 -2
- package/lib/chevre/service/order/confirmPayTransaction.js +4 -1
- package/lib/chevre/service/order/deleteOrder.js +0 -1
- package/lib/chevre/service/order/onAssetTransactionStatusChanged/isDeliverable.js +1 -49
- package/lib/chevre/service/order/onAssetTransactionStatusChanged/onPayTransactionConfirmed.js +2 -2
- package/lib/chevre/service/order/onOrderStatusChanged/onOrderDelivered/factory.js +2 -4
- package/lib/chevre/service/order/onOrderStatusChanged/onOrderDeliveredPartially/factory.js +2 -4
- package/lib/chevre/service/order/onOrderStatusChanged/onOrderInTransit.js +4 -4
- package/lib/chevre/service/order/onOrderStatusChanged/onOrderPaymentDue.js +2 -2
- package/lib/chevre/service/order/onOrderStatusChanged/onOrderProcessing/createSendEmailMessageTaskIfNotExist.js +2 -2
- package/lib/chevre/service/order/onOrderStatusChanged/onOrderProcessing/factory.d.ts +2 -2
- package/lib/chevre/service/order/onOrderStatusChanged/onOrderProcessing/factory.js +3 -5
- package/lib/chevre/service/order/onOrderStatusChanged/onOrderProcessing/processOrder.js +2 -2
- package/lib/chevre/service/order/onOrderStatusChanged/onOrderProcessing.js +1 -1
- package/lib/chevre/service/order/onOrderStatusChanged/onOrderReturned/factory.js +5 -7
- package/lib/chevre/service/order/onOrderUpdated/factory.js +0 -3
- package/lib/chevre/service/order/returnOrder.d.ts +0 -2
- package/lib/chevre/service/order/returnOrder.js +8 -40
- package/lib/chevre/service/order/sendOrder.d.ts +0 -2
- package/lib/chevre/service/order/sendOrder.js +41 -55
- package/lib/chevre/service/payment/any/findAcceptAction.d.ts +0 -4
- package/lib/chevre/service/payment/any/findAcceptAction.js +19 -19
- package/lib/chevre/service/payment/any/findAuthorizeAction.d.ts +0 -4
- package/lib/chevre/service/payment/any/findAuthorizeAction.js +19 -19
- package/lib/chevre/service/payment/any/findCheckAction.d.ts +0 -4
- package/lib/chevre/service/payment/any/findCheckAction.js +19 -19
- package/lib/chevre/service/payment/any/processVoidPayTransaction.js +1 -1
- package/lib/chevre/service/payment/any/publishPaymentUrl.d.ts +0 -2
- package/lib/chevre/service/payment/any/publishPaymentUrl.js +2 -2
- package/lib/chevre/service/project.d.ts +0 -3
- package/lib/chevre/service/project.js +0 -1
- package/lib/chevre/service/reserve/cancelReservation.js +3 -3
- package/lib/chevre/service/reserve/checkInReservation.js +2 -2
- package/lib/chevre/service/reserve/confirmReservation.js +1 -1
- package/lib/chevre/service/reserve/potentialActions/onReservationConfirmed.js +2 -2
- package/lib/chevre/service/reserve/useReservation.js +1 -1
- package/lib/chevre/service/scheduledTask.d.ts +1 -4
- package/lib/chevre/service/scheduledTask.js +3 -10
- package/lib/chevre/service/scheduledTaskHandler/onOperationFailed.js +1 -2
- package/lib/chevre/service/scheduledTaskHandler.js +0 -13
- package/lib/chevre/service/task/acceptCOAOffer.js +1 -14
- package/lib/chevre/service/task/authorizePayment.js +1 -7
- package/lib/chevre/service/task/checkMovieTicket.js +1 -7
- package/lib/chevre/service/task/confirmReserveTransaction.js +3 -1
- package/lib/chevre/service/task/deleteTransaction.js +8 -39
- package/lib/chevre/service/task/importEventsFromCOA.js +4 -2
- package/lib/chevre/service/task/onAuthorizationCreated.js +2 -2
- package/lib/chevre/service/task/onResourceDeleted/deleteResourcesByAggregateOffer.d.ts +4 -2
- package/lib/chevre/service/task/onResourceDeleted/deleteResourcesByAggregateOffer.js +4 -4
- package/lib/chevre/service/task/onResourceDeleted/deleteResourcesByEventSeries.d.ts +4 -2
- package/lib/chevre/service/task/onResourceDeleted/deleteResourcesByEventSeries.js +4 -4
- package/lib/chevre/service/task/onResourceDeleted/deleteResourcesByMovieTheater.d.ts +4 -2
- package/lib/chevre/service/task/onResourceDeleted/deleteResourcesByMovieTheater.js +4 -4
- package/lib/chevre/service/task/onResourceDeleted/deleteResourcesByOfferCatalog.d.ts +4 -2
- package/lib/chevre/service/task/onResourceDeleted/deleteResourcesByOfferCatalog.js +4 -4
- package/lib/chevre/service/task/onResourceDeleted/deleteResourcesByProduct.d.ts +4 -2
- package/lib/chevre/service/task/onResourceDeleted/deleteResourcesByProduct.js +4 -4
- package/lib/chevre/service/task/onResourceDeleted/deleteResourcesByRoom.d.ts +4 -2
- package/lib/chevre/service/task/onResourceDeleted/deleteResourcesByRoom.js +4 -4
- package/lib/chevre/service/task/onResourceDeleted/deleteResourcesBySeller.d.ts +4 -2
- package/lib/chevre/service/task/onResourceDeleted/deleteResourcesBySeller.js +4 -4
- package/lib/chevre/service/task/onResourceDeleted.js +4 -3
- package/lib/chevre/service/task/onResourceUpdated/onAggregateOfferUpdated.js +0 -1
- package/lib/chevre/service/task/onResourceUpdated/onHasPOSUpdated.js +0 -1
- package/lib/chevre/service/task/onResourceUpdated/onOfferCatalogUpdated.js +0 -1
- package/lib/chevre/service/task/onResourceUpdated.js +0 -8
- package/lib/chevre/service/task/publishPaymentUrl.js +2 -13
- package/lib/chevre/service/task/returnOrder.js +2 -5
- package/lib/chevre/service/task/returnPayTransaction.js +2 -2
- package/lib/chevre/service/task/sendOrder.js +2 -2
- package/lib/chevre/service/task/syncResourcesFromCOA.js +31 -23
- package/lib/chevre/service/task/triggerWebhook.js +4 -2
- package/lib/chevre/service/task/voidReserveTransaction.js +5 -8
- package/lib/chevre/service/task.d.ts +3 -22
- package/lib/chevre/service/task.js +8 -40
- package/lib/chevre/service/taskHandler/onOperationFailed/informTaskIfNeeded.js +0 -1
- package/lib/chevre/service/taskHandler/onOperationFailed.d.ts +3 -2
- package/lib/chevre/service/taskHandler/onOperationFailed.js +5 -16
- package/lib/chevre/service/taskHandler.d.ts +1 -2
- package/lib/chevre/service/taskHandler.js +7 -19
- package/lib/chevre/service/transaction/deleteTransaction/deletePayTransactionsByPlaceOrder.js +2 -2
- package/lib/chevre/service/transaction/deleteTransaction/deleteReservationsByPlaceOrder.js +2 -2
- package/lib/chevre/service/transaction/deleteTransaction.d.ts +6 -2
- package/lib/chevre/service/transaction/deleteTransaction.js +5 -5
- package/lib/chevre/service/transaction/placeOrder/confirm.js +1 -1
- package/lib/chevre/service/transaction/placeOrder/exportTasks/factory.d.ts +8 -4
- package/lib/chevre/service/transaction/placeOrder/exportTasks/factory.js +55 -103
- package/lib/chevre/service/transaction/placeOrder/exportTasksById.d.ts +2 -0
- package/lib/chevre/service/transaction/placeOrder/exportTasksById.js +14 -10
- package/lib/chevre/service/transaction/returnOrder/exportTasks/factory.d.ts +13 -3
- package/lib/chevre/service/transaction/returnOrder/exportTasks/factory.js +48 -51
- package/lib/chevre/service/transaction/returnOrder.d.ts +2 -0
- package/lib/chevre/service/transaction/returnOrder.js +15 -13
- package/lib/chevre/service/transaction.d.ts +2 -0
- package/lib/chevre/service/transaction.js +0 -2
- package/lib/chevre/service/validation/validateOrder.js +2 -2
- package/lib/chevre/taskSettings.d.ts +4 -4
- package/package.json +2 -2
- package/lib/chevre/repo/mongoose/schemas/ownershipInfo.js +0 -227
- package/lib/chevre/repo/ownershipInfo.d.ts +0 -122
- package/lib/chevre/repo/ownershipInfo.js +0 -466
|
@@ -1,16 +1,17 @@
|
|
|
1
1
|
import type { AggregateActionRepo } from '../../repo/aggregateAction';
|
|
2
|
+
import type { AggregateAssetTransactionRepo } from '../../repo/aggregateAssetTransaction';
|
|
3
|
+
import type { AggregateScheduledTaskRepo } from '../../repo/aggregateScheduledTask';
|
|
2
4
|
import type { AggregateTaskRepo } from '../../repo/aggregateTask';
|
|
3
|
-
import {
|
|
4
|
-
import type {
|
|
5
|
+
import type { AggregateTransactionRepo } from '../../repo/aggregateTransaction';
|
|
6
|
+
import type { AggregationRepo } from '../../repo/aggregation';
|
|
5
7
|
import type { EventRepo } from '../../repo/event';
|
|
6
|
-
import { OrderRepo } from '../../repo/order';
|
|
7
|
-
import type { TransactionRepo } from '../../repo/transaction';
|
|
8
|
+
import type { OrderRepo } from '../../repo/order';
|
|
8
9
|
type AggregateDurationUnit = 'days' | 'hours';
|
|
9
10
|
interface IAggregateParams {
|
|
10
11
|
aggregateDate: Date;
|
|
11
12
|
aggregateDurationUnit: AggregateDurationUnit;
|
|
12
13
|
aggregationCount: number;
|
|
13
|
-
excludedProjectId?:
|
|
14
|
+
excludedProjectId?: never;
|
|
14
15
|
}
|
|
15
16
|
declare function aggregateEvent(params: IAggregateParams): (repos: {
|
|
16
17
|
agregation: AggregationRepo;
|
|
@@ -36,7 +37,7 @@ declare function aggregatePlaceOrder(params: IAggregateParams & {
|
|
|
36
37
|
clientIds?: string[];
|
|
37
38
|
}): (repos: {
|
|
38
39
|
agregation: AggregationRepo;
|
|
39
|
-
|
|
40
|
+
aggregateTransaction: AggregateTransactionRepo;
|
|
40
41
|
}) => Promise<{
|
|
41
42
|
aggregationCount: number;
|
|
42
43
|
aggregateDuration: string;
|
|
@@ -124,7 +125,7 @@ declare function aggregatePayMovieTicketAction(params: IAggregateParams): (repos
|
|
|
124
125
|
}>;
|
|
125
126
|
declare function aggregatePayTransaction(params: IAggregateParams): (repos: {
|
|
126
127
|
agregation: AggregationRepo;
|
|
127
|
-
|
|
128
|
+
aggregateAssetTransaction: AggregateAssetTransactionRepo;
|
|
128
129
|
}) => Promise<{
|
|
129
130
|
aggregationCount: number;
|
|
130
131
|
aggregateDuration: string;
|
|
@@ -134,7 +135,7 @@ declare function aggregatePayTransaction(params: IAggregateParams): (repos: {
|
|
|
134
135
|
*/
|
|
135
136
|
declare function aggregateReserveTransaction(params: IAggregateParams): (repos: {
|
|
136
137
|
agregation: AggregationRepo;
|
|
137
|
-
|
|
138
|
+
aggregateAssetTransaction: AggregateAssetTransactionRepo;
|
|
138
139
|
}) => Promise<{
|
|
139
140
|
aggregationCount: number;
|
|
140
141
|
aggregateDuration: string;
|
|
@@ -146,4 +147,11 @@ declare function aggregateTask(params: IAggregateParams): (repos: {
|
|
|
146
147
|
aggregationCount: number;
|
|
147
148
|
aggregateDuration: string;
|
|
148
149
|
}>;
|
|
149
|
-
|
|
150
|
+
declare function aggregateScheduledTask(params: IAggregateParams): (repos: {
|
|
151
|
+
agregation: AggregationRepo;
|
|
152
|
+
aggregateScheduledTask: AggregateScheduledTaskRepo;
|
|
153
|
+
}) => Promise<{
|
|
154
|
+
aggregationCount: number;
|
|
155
|
+
aggregateDuration: string;
|
|
156
|
+
}>;
|
|
157
|
+
export { aggregateAuthorizeEventServiceOfferAction, aggregateAuthorizeOrderAction, aggregateAuthorizePaymentAction, aggregateCancelReservationAction, aggregateCheckMovieTicketAction, aggregateEvent, aggregateOrder, aggregateOrderAction, aggregatePayMovieTicketAction, aggregatePayTransaction, aggregatePlaceOrder, aggregateReserveAction, aggregateReserveTransaction, aggregateTask, aggregateScheduledTask, aggregateUseAction };
|
|
@@ -17,6 +17,7 @@ exports.aggregatePlaceOrder = aggregatePlaceOrder;
|
|
|
17
17
|
exports.aggregateReserveAction = aggregateReserveAction;
|
|
18
18
|
exports.aggregateReserveTransaction = aggregateReserveTransaction;
|
|
19
19
|
exports.aggregateTask = aggregateTask;
|
|
20
|
+
exports.aggregateScheduledTask = aggregateScheduledTask;
|
|
20
21
|
exports.aggregateUseAction = aggregateUseAction;
|
|
21
22
|
const debug_1 = __importDefault(require("debug"));
|
|
22
23
|
const moment_timezone_1 = __importDefault(require("moment-timezone"));
|
|
@@ -133,7 +134,7 @@ function aggregatePlaceOrder(params) {
|
|
|
133
134
|
.add(-i, params.aggregateDurationUnit)
|
|
134
135
|
.endOf(params.aggregateDurationUnit)
|
|
135
136
|
.toDate();
|
|
136
|
-
const aggregateResult = await repos.
|
|
137
|
+
const aggregateResult = await repos.aggregateTransaction.aggregatePlaceOrder({
|
|
137
138
|
project: { id: { $ne: params.excludedProjectId } },
|
|
138
139
|
startFrom,
|
|
139
140
|
startThrough,
|
|
@@ -143,7 +144,7 @@ function aggregatePlaceOrder(params) {
|
|
|
143
144
|
const aggregateResultsByClientId = [];
|
|
144
145
|
if (Array.isArray(params.clientIds)) {
|
|
145
146
|
for (const clientId of params.clientIds) {
|
|
146
|
-
const aggregateResultByClientId = await repos.
|
|
147
|
+
const aggregateResultByClientId = await repos.aggregateTransaction.aggregatePlaceOrder({
|
|
147
148
|
project: { id: { $ne: params.excludedProjectId } },
|
|
148
149
|
startFrom,
|
|
149
150
|
startThrough,
|
|
@@ -586,7 +587,7 @@ function aggregatePayTransaction(params) {
|
|
|
586
587
|
.add(-i, params.aggregateDurationUnit)
|
|
587
588
|
.endOf(params.aggregateDurationUnit)
|
|
588
589
|
.toDate();
|
|
589
|
-
const aggregateResult = await repos.
|
|
590
|
+
const aggregateResult = await repos.aggregateAssetTransaction.aggregateAssetTransaction({
|
|
590
591
|
project: { id: { $ne: params.excludedProjectId } },
|
|
591
592
|
startFrom,
|
|
592
593
|
startThrough,
|
|
@@ -631,7 +632,7 @@ function aggregateReserveTransaction(params) {
|
|
|
631
632
|
.add(-i, params.aggregateDurationUnit)
|
|
632
633
|
.endOf(params.aggregateDurationUnit)
|
|
633
634
|
.toDate();
|
|
634
|
-
const aggregateResult = await repos.
|
|
635
|
+
const aggregateResult = await repos.aggregateAssetTransaction.aggregateAssetTransaction({
|
|
635
636
|
project: { id: { $ne: params.excludedProjectId } },
|
|
636
637
|
startFrom,
|
|
637
638
|
startThrough,
|
|
@@ -692,3 +693,44 @@ function aggregateTask(params) {
|
|
|
692
693
|
return { aggregationCount: i, aggregateDuration };
|
|
693
694
|
};
|
|
694
695
|
}
|
|
696
|
+
function aggregateScheduledTask(params) {
|
|
697
|
+
return async (repos) => {
|
|
698
|
+
const { aggregateDate } = params;
|
|
699
|
+
if (!(aggregateDate instanceof Date)) {
|
|
700
|
+
throw new factory_1.factory.errors.Argument('aggregateDate', 'must be Date');
|
|
701
|
+
}
|
|
702
|
+
const aggregateDuration = moment_timezone_1.default.duration(1, params.aggregateDurationUnit)
|
|
703
|
+
.toISOString();
|
|
704
|
+
let i = -1;
|
|
705
|
+
while (i < params.aggregationCount) {
|
|
706
|
+
i += 1;
|
|
707
|
+
const runsFrom = (0, moment_timezone_1.default)(aggregateDate)
|
|
708
|
+
.utc()
|
|
709
|
+
// .tz('Asia/Tokyo')
|
|
710
|
+
.add(-i, params.aggregateDurationUnit)
|
|
711
|
+
.startOf(params.aggregateDurationUnit)
|
|
712
|
+
.toDate();
|
|
713
|
+
const runsThrough = (0, moment_timezone_1.default)(aggregateDate)
|
|
714
|
+
.utc()
|
|
715
|
+
// .tz('Asia/Tokyo')
|
|
716
|
+
.add(-i, params.aggregateDurationUnit)
|
|
717
|
+
.endOf(params.aggregateDurationUnit)
|
|
718
|
+
.toDate();
|
|
719
|
+
const aggregateResult = await repos.aggregateScheduledTask.aggregateScheduledTask({
|
|
720
|
+
// project: { id: { $ne: params.excludedProjectId } },
|
|
721
|
+
runsFrom,
|
|
722
|
+
runsThrough
|
|
723
|
+
});
|
|
724
|
+
await repos.agregation.saveAggregation({
|
|
725
|
+
typeOf: factory_1.factory.aggregation.AggregationType.AggregateScheduledTask,
|
|
726
|
+
project: { id: '*', typeOf: factory_1.factory.organizationType.Project },
|
|
727
|
+
aggregateDuration,
|
|
728
|
+
aggregateStart: runsFrom,
|
|
729
|
+
aggregateDate,
|
|
730
|
+
...aggregateResult
|
|
731
|
+
});
|
|
732
|
+
}
|
|
733
|
+
debug(i, 'aggregations saved');
|
|
734
|
+
return { aggregationCount: i, aggregateDuration };
|
|
735
|
+
};
|
|
736
|
+
}
|
|
@@ -11,30 +11,15 @@ function validateStartParams(params) {
|
|
|
11
11
|
const sellerId = params.seller?.id;
|
|
12
12
|
// 予約番号で取引存在確認
|
|
13
13
|
if (typeof params.object.reservation?.reservationNumber === 'string') {
|
|
14
|
-
const transactions = await repos.assetTransaction.
|
|
14
|
+
const transactions = await repos.assetTransaction.findAssetTransactionsByTypeOf({
|
|
15
15
|
limit: 1,
|
|
16
16
|
page: 1,
|
|
17
17
|
typeOf: factory_1.factory.assetTransactionType.Reserve,
|
|
18
18
|
object: {
|
|
19
|
-
reservationNumber: { $eq: params.object.reservation.reservationNumber }
|
|
20
|
-
// 販売者検証(2023-08-01~)
|
|
21
|
-
...(typeof sellerId === 'string') ? { provider: { id: { $eq: sellerId } } } : undefined
|
|
19
|
+
reservationNumber: { $eq: params.object.reservation.reservationNumber }
|
|
22
20
|
}
|
|
23
21
|
});
|
|
24
22
|
reserveTransaction = transactions.shift();
|
|
25
|
-
// ここでReservationConfirmedでない予約をスルーしても、
|
|
26
|
-
// ReservationRepo.cancel()で冪等性を保証しているのでvalidation不要か(2022-05-12~)
|
|
27
|
-
// 予約ステータス確認
|
|
28
|
-
// const unconfirmedReservations = await repos.reservation.search({
|
|
29
|
-
// limit: 1,
|
|
30
|
-
// page: 1,
|
|
31
|
-
// typeOf: factory.reservationType.EventReservation,
|
|
32
|
-
// reservationNumber: { $eq: params.object.reservation.reservationNumber },
|
|
33
|
-
// reservationStatus: { $ne: factory.reservationStatusType.ReservationConfirmed }
|
|
34
|
-
// });
|
|
35
|
-
// if (unconfirmedReservations.length > 0) {
|
|
36
|
-
// throw new factory.errors.Argument('object.reservation.reservationNumber', `Reservation ${unconfirmedReservations[0].id} not confirmed`);
|
|
37
|
-
// }
|
|
38
23
|
}
|
|
39
24
|
// 取引指定が確認できなければ、予約指定を確認
|
|
40
25
|
if (reserveTransaction === undefined) {
|
|
@@ -59,6 +44,14 @@ function validateStartParams(params) {
|
|
|
59
44
|
reservations = [reservation];
|
|
60
45
|
}
|
|
61
46
|
}
|
|
47
|
+
else {
|
|
48
|
+
// 販売者検証(2023-08-01~)
|
|
49
|
+
if (typeof sellerId === 'string') {
|
|
50
|
+
if (reserveTransaction.object.provider?.id !== sellerId) {
|
|
51
|
+
throw new factory_1.factory.errors.NotFound(factory_1.factory.reservationType.EventReservation);
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
}
|
|
62
55
|
if (reserveTransaction === undefined && reservations === undefined) {
|
|
63
56
|
throw new factory_1.factory.errors.Argument('object', 'Transaction or reservation must be specified');
|
|
64
57
|
}
|
|
@@ -135,12 +135,12 @@ function confirm(params) {
|
|
|
135
135
|
else {
|
|
136
136
|
throw new factory_1.factory.errors.ArgumentNull('Transaction ID or Transaction Number');
|
|
137
137
|
}
|
|
138
|
-
const payTransaction = (await repos.assetTransaction.
|
|
138
|
+
const payTransaction = (await repos.assetTransaction.findAssetTransactionsByTypeOf({
|
|
139
139
|
limit: 1,
|
|
140
140
|
page: 1,
|
|
141
141
|
typeOf: factory_1.factory.assetTransactionType.Pay,
|
|
142
142
|
transactionNumber: { $eq: transaction.object.paymentMethodId }
|
|
143
|
-
}, ['recipient']
|
|
143
|
+
}, ['recipient'])).shift();
|
|
144
144
|
if (payTransaction === undefined) {
|
|
145
145
|
throw new factory_1.factory.errors.NotFound(factory_1.factory.assetTransactionType.Pay);
|
|
146
146
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { IExecuteSettings as IMinimumExecuteSettings,
|
|
1
|
+
import type { IExecuteSettings as IMinimumExecuteSettings, IAsyncActionNextFunction } from '../eventEmitter/task';
|
|
2
2
|
type IExecuteSettings = IMinimumExecuteSettings;
|
|
3
3
|
type IOperation<T> = (settings: IExecuteSettings) => Promise<T>;
|
|
4
4
|
declare function executeAsyncActionById(params: {
|
|
@@ -12,5 +12,5 @@ declare function executeAsyncActionById(params: {
|
|
|
12
12
|
*/
|
|
13
13
|
name: string;
|
|
14
14
|
};
|
|
15
|
-
}, next
|
|
15
|
+
}, next: IAsyncActionNextFunction): IOperation<void>;
|
|
16
16
|
export { executeAsyncActionById };
|
|
@@ -27,10 +27,7 @@ function executeAsyncActionById(params, next) {
|
|
|
27
27
|
}
|
|
28
28
|
// タスクがなければ終了
|
|
29
29
|
if (task !== null) {
|
|
30
|
-
await (0, asyncActionHandler_1.executeAsyncAction)(task,
|
|
31
|
-
executeById: true,
|
|
32
|
-
executeByName: false
|
|
33
|
-
});
|
|
30
|
+
await (0, asyncActionHandler_1.executeAsyncAction)(task, next)(settings, {});
|
|
34
31
|
}
|
|
35
32
|
};
|
|
36
33
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { ITaskAsNextFunctionParam } from '../../eventEmitter/task';
|
|
2
2
|
import type { AsyncActionRepo, IExecutableAsyncAction } from '../../repo/asyncAction';
|
|
3
3
|
/**
|
|
4
4
|
* タスク実行失敗時処理
|
|
@@ -10,6 +10,6 @@ declare function onOperationFailed(params: {
|
|
|
10
10
|
}): (repos: {
|
|
11
11
|
asyncAction: AsyncActionRepo;
|
|
12
12
|
}) => Promise<{
|
|
13
|
-
executedTask:
|
|
13
|
+
executedTask: ITaskAsNextFunctionParam;
|
|
14
14
|
}>;
|
|
15
15
|
export { onOperationFailed };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
import type {
|
|
1
|
+
import type { IAsyncActionNextFunction } from '../eventEmitter/task';
|
|
2
|
+
import type { ICallableTaskOperation, IOperationExecute } from '../taskSettings';
|
|
3
3
|
import type { IExecutableAsyncAction } from '../repo/asyncAction';
|
|
4
4
|
export declare const taskLoader: {
|
|
5
5
|
load: (taskName: string) => Promise<{
|
|
@@ -9,5 +9,5 @@ export declare const taskLoader: {
|
|
|
9
9
|
/**
|
|
10
10
|
* 非同期アクションを実行する
|
|
11
11
|
*/
|
|
12
|
-
declare function executeAsyncAction(task: IExecutableAsyncAction, next
|
|
13
|
-
export {
|
|
12
|
+
declare function executeAsyncAction(task: IExecutableAsyncAction, next: IAsyncActionNextFunction): IOperationExecute<void>;
|
|
13
|
+
export { executeAsyncAction };
|
|
@@ -5,11 +5,9 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.taskLoader = void 0;
|
|
7
7
|
exports.executeAsyncAction = executeAsyncAction;
|
|
8
|
-
const debug_1 = __importDefault(require("debug"));
|
|
9
8
|
const moment_1 = __importDefault(require("moment"));
|
|
10
9
|
const factory_1 = require("../factory");
|
|
11
10
|
const onOperationFailed_1 = require("./asyncActionHandler/onOperationFailed");
|
|
12
|
-
const debug = (0, debug_1.default)('chevre-domain:service:asyncActionHandler');
|
|
13
11
|
exports.taskLoader = {
|
|
14
12
|
load: (taskName) => {
|
|
15
13
|
return import(`./task/${taskName}.js`);
|
|
@@ -20,10 +18,9 @@ exports.taskLoader = {
|
|
|
20
18
|
*/
|
|
21
19
|
function executeAsyncAction(task, next) {
|
|
22
20
|
const now = new Date();
|
|
23
|
-
debug('executing an executableTask...', task, now);
|
|
24
21
|
return async (settings, options) => {
|
|
25
22
|
const asyncActionRepo = new (await import('../repo/asyncAction.js')).AsyncActionRepo(settings.connection);
|
|
26
|
-
let
|
|
23
|
+
let taskAsNextFunctionParam;
|
|
27
24
|
try {
|
|
28
25
|
// 期限検証(2024-04-23~)
|
|
29
26
|
if (task.expires instanceof Date) {
|
|
@@ -57,32 +54,33 @@ function executeAsyncAction(task, next) {
|
|
|
57
54
|
status: factory_1.factory.taskStatus.Executed,
|
|
58
55
|
executionResult: result
|
|
59
56
|
});
|
|
60
|
-
|
|
57
|
+
taskAsNextFunctionParam = {
|
|
61
58
|
id: task.id,
|
|
62
|
-
remainingNumberOfTries: 0, // one timeの前提なのでひとまず固定で0
|
|
63
59
|
name: task.name,
|
|
64
60
|
status: factory_1.factory.taskStatus.Executed,
|
|
65
|
-
executionResult: result
|
|
66
61
|
};
|
|
67
62
|
}
|
|
68
63
|
catch (error) {
|
|
69
64
|
const onOperationFailedResult = await (0, onOperationFailed_1.onOperationFailed)({
|
|
70
65
|
task, now, error,
|
|
71
66
|
})({ asyncAction: asyncActionRepo });
|
|
72
|
-
|
|
67
|
+
taskAsNextFunctionParam = {
|
|
68
|
+
id: onOperationFailedResult.executedTask.id,
|
|
69
|
+
name: onOperationFailedResult.executedTask.name,
|
|
70
|
+
status: onOperationFailedResult.executedTask.status
|
|
71
|
+
};
|
|
72
|
+
;
|
|
73
73
|
}
|
|
74
74
|
finally {
|
|
75
75
|
if (typeof next === 'function') {
|
|
76
|
-
if (
|
|
77
|
-
|
|
76
|
+
if (taskAsNextFunctionParam === undefined) {
|
|
77
|
+
taskAsNextFunctionParam = {
|
|
78
78
|
id: task.id,
|
|
79
|
-
remainingNumberOfTries: 0, // one timeの前提なのでひとまず固定で0
|
|
80
79
|
name: task.name,
|
|
81
80
|
status: factory_1.factory.taskStatus.Aborted,
|
|
82
|
-
executionResult: {} // eslint-disable-line @typescript-eslint/no-explicit-any
|
|
83
81
|
};
|
|
84
82
|
}
|
|
85
|
-
await next(
|
|
83
|
+
await next(taskAsNextFunctionParam)(settings);
|
|
86
84
|
}
|
|
87
85
|
}
|
|
88
86
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { COA } from '@motionpicture/coa-service';
|
|
2
|
-
import type {
|
|
2
|
+
import type { UpdateActionRepo } from '../../repo/action/update';
|
|
3
3
|
import type { CategoryCodeRepo } from '../../repo/categoryCode';
|
|
4
4
|
import type { MovieTheaterRepo } from '../../repo/place/movieTheater';
|
|
5
5
|
import type { ScreeningRoomRepo } from '../../repo/place/screeningRoom';
|
|
@@ -9,7 +9,9 @@ import { IImportFromCOAParams } from './factory';
|
|
|
9
9
|
type IMovieTheater = Pick<factory.place.movieTheater.IPlace, 'id' | 'typeOf' | 'branchCode' | 'name' | 'kanaName'>;
|
|
10
10
|
declare function processUpdateMovieTheater(params: IImportFromCOAParams): (repos: {
|
|
11
11
|
masterService: COA.service.Master;
|
|
12
|
-
|
|
12
|
+
actions: {
|
|
13
|
+
update: UpdateActionRepo;
|
|
14
|
+
};
|
|
13
15
|
categoryCode: CategoryCodeRepo;
|
|
14
16
|
movieTheater: MovieTheaterRepo;
|
|
15
17
|
screeningRoom: ScreeningRoomRepo;
|
|
@@ -20,7 +20,7 @@ function processUpdateMovieTheater(params) {
|
|
|
20
20
|
},
|
|
21
21
|
targetCollection: { typeOf: factory_1.factory.placeType.MovieTheater }
|
|
22
22
|
};
|
|
23
|
-
const action = await repos.
|
|
23
|
+
const action = await repos.actions.update.startUpdateAction(actionAttributes);
|
|
24
24
|
let seller;
|
|
25
25
|
let movieTheater;
|
|
26
26
|
let screeningRooms;
|
|
@@ -66,7 +66,7 @@ function processUpdateMovieTheater(params) {
|
|
|
66
66
|
}
|
|
67
67
|
catch (error) {
|
|
68
68
|
try {
|
|
69
|
-
await repos.
|
|
69
|
+
await repos.actions.update.giveUpUpdateAction({ typeOf: action.typeOf, id: action.id, error });
|
|
70
70
|
}
|
|
71
71
|
catch (__) {
|
|
72
72
|
// 失敗したら仕方ない
|
|
@@ -77,7 +77,7 @@ function processUpdateMovieTheater(params) {
|
|
|
77
77
|
screeningRoomsCount: screeningRooms.length,
|
|
78
78
|
...(processTime !== undefined) ? { processTime } : undefined
|
|
79
79
|
};
|
|
80
|
-
await repos.
|
|
80
|
+
await repos.actions.update.completeUpdateAction({ typeOf: action.typeOf, id: action.id, result: actionResult });
|
|
81
81
|
return { seller, movieTheater, screeningRooms };
|
|
82
82
|
};
|
|
83
83
|
}
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* マスターデータ同期サービス
|
|
3
3
|
*/
|
|
4
4
|
import type { COA } from '@motionpicture/coa-service';
|
|
5
|
-
import type {
|
|
5
|
+
import type { UpdateActionRepo } from '../repo/action/update';
|
|
6
6
|
import type { CategoryCodeRepo } from '../repo/categoryCode';
|
|
7
7
|
import type { CreativeWorkRepo } from '../repo/creativeWork';
|
|
8
8
|
import type { EventRepo } from '../repo/event';
|
|
@@ -17,7 +17,9 @@ import { saveScreeningEventSeries } from './event/saveScreeningEventSeries';
|
|
|
17
17
|
* イベントをインポートする
|
|
18
18
|
*/
|
|
19
19
|
declare function importFromCOA(params: IImportFromCOAParams): (repos: {
|
|
20
|
-
|
|
20
|
+
actions: {
|
|
21
|
+
update: UpdateActionRepo;
|
|
22
|
+
};
|
|
21
23
|
categoryCode: CategoryCodeRepo;
|
|
22
24
|
creativeWork: CreativeWorkRepo;
|
|
23
25
|
event: EventRepo;
|
|
@@ -70,7 +70,7 @@ function importFromCOA(params) {
|
|
|
70
70
|
instrument,
|
|
71
71
|
targetCollection: { typeOf: factory_1.factory.eventType.ScreeningEvent }
|
|
72
72
|
};
|
|
73
|
-
const action = await repos.
|
|
73
|
+
const action = await repos.actions.update.startUpdateAction(actionAttributes);
|
|
74
74
|
let savedScreeningEventsCount = 0;
|
|
75
75
|
let savedScreeningEventSeriesCount = 0;
|
|
76
76
|
let cancelledIds = [];
|
|
@@ -131,7 +131,7 @@ function importFromCOA(params) {
|
|
|
131
131
|
}
|
|
132
132
|
catch (error) {
|
|
133
133
|
try {
|
|
134
|
-
await repos.
|
|
134
|
+
await repos.actions.update.giveUpUpdateAction({ typeOf: action.typeOf, id: action.id, error });
|
|
135
135
|
}
|
|
136
136
|
catch (__) {
|
|
137
137
|
// 失敗したら仕方ない
|
|
@@ -144,7 +144,7 @@ function importFromCOA(params) {
|
|
|
144
144
|
savedScreeningEventSeriesCount,
|
|
145
145
|
...(processTime !== undefined) ? { processTime } : undefined
|
|
146
146
|
};
|
|
147
|
-
await repos.
|
|
147
|
+
await repos.actions.update.completeUpdateAction({ typeOf: action.typeOf, id: action.id, result: actionResult });
|
|
148
148
|
};
|
|
149
149
|
}
|
|
150
150
|
function cancelDeletedEvents(params) {
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import { factory } from '../../factory';
|
|
2
|
-
import type {
|
|
2
|
+
import type { InformActionRepo } from '../../repo/action/inform';
|
|
3
3
|
import type { PotentialActionRepo } from '../../repo/potentialAction';
|
|
4
4
|
import type { SettingRepo } from '../../repo/setting';
|
|
5
5
|
interface ITriggerWebhookRepos {
|
|
6
|
-
|
|
6
|
+
actions: {
|
|
7
|
+
inform: InformActionRepo;
|
|
8
|
+
};
|
|
7
9
|
potentialAction: PotentialActionRepo;
|
|
8
10
|
setting: SettingRepo;
|
|
9
11
|
}
|
|
@@ -88,18 +88,7 @@ function createInformActionAttributes(params) {
|
|
|
88
88
|
const { about, object, purpose, recipient, project, id, typeOf } = params;
|
|
89
89
|
// redefine recipient(2025-02-15~)
|
|
90
90
|
let informRecipient;
|
|
91
|
-
|
|
92
|
-
// ...recipient
|
|
93
|
-
// // url: target.urlTemplate // discontinue(2025-02-15~)
|
|
94
|
-
// };
|
|
95
|
-
if (recipient?.typeOf === factory_1.factory.organizationType.Corporation && typeof recipient.id === 'string') {
|
|
96
|
-
informRecipient = {
|
|
97
|
-
id: recipient.id,
|
|
98
|
-
name: recipient.name,
|
|
99
|
-
typeOf: recipient.typeOf
|
|
100
|
-
};
|
|
101
|
-
}
|
|
102
|
-
else if (recipient?.typeOf === factory_1.factory.creativeWorkType.WebApplication) {
|
|
91
|
+
if (recipient?.typeOf === factory_1.factory.creativeWorkType.WebApplication) {
|
|
103
92
|
informRecipient = {
|
|
104
93
|
name: recipient.name,
|
|
105
94
|
typeOf: recipient.typeOf
|
|
@@ -139,9 +128,9 @@ function createInformActionAttributes(params) {
|
|
|
139
128
|
project: { id: project.id, typeOf: factory_1.factory.organizationType.Project },
|
|
140
129
|
recipient: informRecipient,
|
|
141
130
|
typeOf: factory_1.factory.actionType.InformAction,
|
|
131
|
+
target, // add(2025-02-06~)
|
|
142
132
|
...(typeof purpose?.typeOf === 'string') ? { purpose } : undefined,
|
|
143
133
|
...(typeof about?.typeOf === 'string') ? { about } : undefined, // add(2025-01-23~)
|
|
144
|
-
...(typeof target?.typeOf === 'string') ? { target } : undefined // add(2025-02-06~)
|
|
145
134
|
};
|
|
146
135
|
};
|
|
147
136
|
}
|
|
@@ -159,7 +148,7 @@ function processInformAction(params, options) {
|
|
|
159
148
|
const headerIdentifier = options?.triggerWebhook?.headerIdentifier;
|
|
160
149
|
const { identifier } = params;
|
|
161
150
|
const informActionAttributes = await createInformActionAttributes(params)(repos);
|
|
162
|
-
const action = await repos.
|
|
151
|
+
const action = await repos.actions.inform.startInformAction(informActionAttributes);
|
|
163
152
|
let result = {};
|
|
164
153
|
try {
|
|
165
154
|
const urlTemplate = informActionAttributes.target?.urlTemplate;
|
|
@@ -226,13 +215,13 @@ function processInformAction(params, options) {
|
|
|
226
215
|
}
|
|
227
216
|
catch (error) {
|
|
228
217
|
try {
|
|
229
|
-
await repos.
|
|
218
|
+
await repos.actions.inform.giveUpInformAction({ typeOf: action.typeOf, id: action.id, error });
|
|
230
219
|
}
|
|
231
220
|
catch (__) {
|
|
232
221
|
// 失敗したら仕方ない
|
|
233
222
|
}
|
|
234
223
|
throw error;
|
|
235
224
|
}
|
|
236
|
-
await repos.
|
|
225
|
+
await repos.actions.inform.completeInformAction({ typeOf: action.typeOf, id: action.id, result: result });
|
|
237
226
|
};
|
|
238
227
|
}
|
|
@@ -2,15 +2,13 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.processVoidTransaction4chevre = processVoidTransaction4chevre;
|
|
4
4
|
const factory_1 = require("../../../../factory");
|
|
5
|
-
// import type { TransactionRepo } from '../../../../repo/transaction';
|
|
6
5
|
const reserve_1 = require("../../../assetTransaction/reserve");
|
|
7
6
|
function processVoidTransaction4chevre(params) {
|
|
8
7
|
return async (repos, settings) => {
|
|
9
|
-
// const transactionNumber = params.action.object.pendingTransaction?.transactionNumber;
|
|
10
8
|
const transactionNumber = params.action.instrument.transactionNumber;
|
|
11
9
|
if (typeof transactionNumber === 'string') {
|
|
12
10
|
// 取引が存在すれば中止
|
|
13
|
-
const assetTransactions = await repos.assetTransaction.
|
|
11
|
+
const assetTransactions = await repos.assetTransaction.findAssetTransactionsByTypeOf({
|
|
14
12
|
limit: 1,
|
|
15
13
|
page: 1,
|
|
16
14
|
project: { id: { $eq: params.action.project.id } },
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { factory } from '../../../factory';
|
|
2
2
|
import type { AcceptCOAOfferActionRepo } from '../../../repo/action/acceptCOAOffer';
|
|
3
3
|
import type { AsyncActionRepo } from '../../../repo/asyncAction';
|
|
4
|
-
import type { TaskRepo } from '../../../repo/task';
|
|
5
4
|
interface IFindAcceptActionResult {
|
|
6
5
|
/**
|
|
7
6
|
* アクションID
|
|
@@ -35,11 +34,8 @@ declare function findAcceptAction(params: {
|
|
|
35
34
|
*/
|
|
36
35
|
id: string;
|
|
37
36
|
};
|
|
38
|
-
}, options: {
|
|
39
|
-
useAsyncAction: boolean;
|
|
40
37
|
}): (repos: {
|
|
41
38
|
action: AcceptCOAOfferActionRepo;
|
|
42
39
|
asyncAction: AsyncActionRepo;
|
|
43
|
-
task: TaskRepo;
|
|
44
40
|
}) => Promise<IFindAcceptActionResult>;
|
|
45
41
|
export { findAcceptAction };
|
|
@@ -2,27 +2,27 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.findAcceptAction = findAcceptAction;
|
|
4
4
|
const factory_1 = require("../../../factory");
|
|
5
|
-
function findAcceptAction(params
|
|
5
|
+
function findAcceptAction(params) {
|
|
6
6
|
return async (repos) => {
|
|
7
7
|
// 非同期アクションに対応(2026-07-27~)
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
//
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
}
|
|
8
|
+
// let task: Pick<factory.task.acceptCOAOffer.ITask, 'id' | 'status' | 'executionResults'> | undefined;
|
|
9
|
+
// まず非同期アクションを参照
|
|
10
|
+
const task = await repos.asyncAction.findAsyncActionById({
|
|
11
|
+
id: { $eq: params.sameAs.id },
|
|
12
|
+
project: { id: { $eq: params.project.id } },
|
|
13
|
+
name: factory_1.factory.taskName.AcceptCOAOffer
|
|
14
|
+
}, ['status', 'executionResults']);
|
|
15
|
+
// // 非同期アクションが存在しなければタスクを参照
|
|
16
|
+
// if (task === undefined) {
|
|
17
|
+
// task = await repos.task.findTaskById(
|
|
18
|
+
// {
|
|
19
|
+
// id: { $eq: params.sameAs.id },
|
|
20
|
+
// project: { id: { $eq: params.project.id } },
|
|
21
|
+
// name: factory.taskName.AcceptCOAOffer
|
|
22
|
+
// },
|
|
23
|
+
// ['status', 'executionResults']
|
|
24
|
+
// );
|
|
25
|
+
// }
|
|
26
26
|
if (task === undefined) {
|
|
27
27
|
throw new factory_1.factory.errors.NotFound(factory_1.factory.taskName.AcceptCOAOffer);
|
|
28
28
|
}
|
|
@@ -203,7 +203,6 @@ function createInformTasks(params, setting) {
|
|
|
203
203
|
const informActionAttributes = {
|
|
204
204
|
object: event4inform,
|
|
205
205
|
recipient: {
|
|
206
|
-
id: '',
|
|
207
206
|
name: String(informEvent.recipient?.name),
|
|
208
207
|
typeOf: factory_1.factory.creativeWorkType.WebApplication
|
|
209
208
|
// url: informUrl // discontinue(2025-02-13~)
|
|
@@ -257,7 +256,6 @@ function createInform2aggTasks(params, setting) {
|
|
|
257
256
|
const informActionAttributes = {
|
|
258
257
|
object: informObject,
|
|
259
258
|
recipient: {
|
|
260
|
-
id: '',
|
|
261
259
|
name: String(informEvent.recipient?.name),
|
|
262
260
|
typeOf: factory_1.factory.creativeWorkType.WebApplication
|
|
263
261
|
// url: informUrl // discontinue(2025-02-13~)
|