@chevre/domain 26.0.0-alpha.0 → 26.0.0-alpha.10
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/adminAsyncAction.d.ts +19 -0
- package/lib/chevre/repo/adminAsyncAction.js +86 -0
- package/lib/chevre/repo/adminScheduledTask.d.ts +20 -0
- package/lib/chevre/repo/adminScheduledTask.js +95 -0
- package/lib/chevre/repo/aggregateScheduledTask.d.ts +32 -0
- package/lib/chevre/repo/aggregateScheduledTask.js +136 -0
- package/lib/chevre/repo/asyncAction.d.ts +3 -8
- package/lib/chevre/repo/asyncAction.js +0 -108
- package/lib/chevre/repo/asyncActionLegacy.d.ts +23 -0
- package/lib/chevre/repo/asyncActionLegacy.js +59 -0
- package/lib/chevre/repo/mongoose/schemas/setting.d.ts +2 -4
- package/lib/chevre/repo/scheduledTask.d.ts +1 -1
- package/lib/chevre/repo/scheduledTaskLegacy.d.ts +39 -0
- package/lib/chevre/repo/scheduledTaskLegacy.js +96 -0
- package/lib/chevre/repo/scheduledTaskMigration.d.ts +21 -0
- package/lib/chevre/repo/scheduledTaskMigration.js +70 -0
- package/lib/chevre/repo/task.d.ts +35 -68
- package/lib/chevre/repo/task.js +257 -177
- package/lib/chevre/repository.d.ts +25 -0
- package/lib/chevre/repository.js +57 -2
- package/lib/chevre/service/aggregation/system.d.ts +10 -2
- package/lib/chevre/service/aggregation/system.js +42 -0
- package/lib/chevre/service/assetTransaction/reserve/start/factory/createStartParams.js +5 -25
- package/lib/chevre/service/offer/eventServiceByCOA/authorize/factory.js +1 -1
- 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/order/onOrderStatusChanged/onOrderInTransit.js +2 -2
- package/lib/chevre/service/order/onOrderStatusChanged/onOrderPaymentDue.js +1 -1
- package/lib/chevre/service/order/onOrderStatusChanged/onOrderProcessing/createSendEmailMessageTaskIfNotExist.js +1 -1
- package/lib/chevre/service/order/onOrderStatusChanged/onOrderProcessing/processOrder.js +1 -1
- package/lib/chevre/service/order/onOrderStatusChanged/onOrderProcessing.js +1 -1
- 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/reserve/confirmReservation.js +19 -26
- package/lib/chevre/service/reserve/factory.d.ts +0 -3
- package/lib/chevre/service/reserve/factory.js +0 -4
- package/lib/chevre/service/reserve/potentialActions/onReservationConfirmed.d.ts +4 -13
- package/lib/chevre/service/reserve/potentialActions/onReservationConfirmed.js +21 -61
- package/lib/chevre/service/task/importEventCapacitiesFromCOA.js +4 -1
- package/lib/chevre/service/task/importEventsFromCOA.js +4 -1
- package/lib/chevre/service/task/importOffersFromCOA.js +5 -5
- package/lib/chevre/service/task.d.ts +1 -20
- package/lib/chevre/service/task.js +0 -28
- package/lib/chevre/service/taskHandler.js +0 -34
- 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 +20 -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 +21 -13
- package/lib/chevre/service/transaction.d.ts +2 -0
- package/lib/chevre/service/transaction.js +0 -2
- package/package.json +2 -2
package/lib/chevre/repository.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
4
|
-
exports.WebSite = exports.rateLimit = exports.TransactionProcess = exports.TransactionNumber = exports.transaction = exports.Transaction = exports.Ticket = exports.AsyncAction = exports.Task = exports.ScheduledTask = exports.StockHolder = exports.setting = exports.Setting = exports.ServiceAvailableHour = exports.SellerReturnPolicy = exports.SellerPaymentAccepted = exports.SellerMakesOffer = exports.Seller = exports.Schedule = exports.Role = exports.ReserveInterface = exports.Reservation = exports.ProjectMakesOffer = exports.Project = exports.ProductHasOfferCatalog = exports.Product = exports.PriceSpecification = exports.PotentialAction = exports.place = exports.Person = void 0;
|
|
3
|
+
exports.PaymentService = exports.Passport = exports.OwnershipInfo = exports.OrderNumber = exports.OrderInTransaction = exports.Order = exports.Offer = exports.OfferItemCondition = exports.OfferCatalogItem = exports.OfferCatalog = exports.NoteAboutOrder = exports.Note = exports.MovieTicketType = exports.Message = exports.MerchantReturnPolicy = exports.MemberProgram = exports.Member = exports.Issuer = exports.IdentityProvider = exports.Identity = exports.EventSeries = exports.EventSellerMakesOffer = exports.EventOffer = exports.Event = exports.EmailMessage = exports.CustomerType = exports.Customer = exports.Credentials = exports.CreativeWork = exports.ConfirmationNumber = exports.Authorization = exports.CategoryCode = exports.assetTransaction = exports.AssetTransaction = exports.Aggregation = exports.AggregateReservation = exports.AggregateOrder = exports.AggregateOffer = exports.AggregateTask = exports.AggregateScheduledTask = exports.AggregateAction = exports.AdminTask = exports.AdminScheduledTask = exports.AdminAsyncAction = exports.AdditionalProperty = exports.action = exports.Action = exports.AccountTitle = exports.AccountingReport = exports.AcceptedOffer = void 0;
|
|
4
|
+
exports.WebSite = exports.rateLimit = exports.TransactionProcess = exports.TransactionNumber = exports.transaction = exports.Transaction = exports.Ticket = exports.AsyncActionLegacy = exports.AsyncAction = exports.Task = exports.ScheduledTaskLegacy = exports.ScheduledTask = exports.StockHolder = exports.setting = exports.Setting = exports.ServiceAvailableHour = exports.SellerReturnPolicy = exports.SellerPaymentAccepted = exports.SellerMakesOffer = exports.Seller = exports.Schedule = exports.Role = exports.ReserveInterface = exports.Reservation = exports.ProjectMakesOffer = exports.Project = exports.ProductHasOfferCatalog = exports.Product = exports.PriceSpecification = exports.PotentialAction = exports.place = exports.Person = exports.PendingReservation = exports.PaymentServiceProvider = exports.PaymentServiceChannel = void 0;
|
|
5
5
|
var AcceptedOffer;
|
|
6
6
|
(function (AcceptedOffer) {
|
|
7
7
|
let repo;
|
|
@@ -170,6 +170,28 @@ var AdditionalProperty;
|
|
|
170
170
|
}
|
|
171
171
|
AdditionalProperty.createInstance = createInstance;
|
|
172
172
|
})(AdditionalProperty || (exports.AdditionalProperty = AdditionalProperty = {}));
|
|
173
|
+
var AdminAsyncAction;
|
|
174
|
+
(function (AdminAsyncAction) {
|
|
175
|
+
let repo;
|
|
176
|
+
async function createInstance(...params) {
|
|
177
|
+
if (repo === undefined) {
|
|
178
|
+
repo = (await import('./repo/adminAsyncAction.js')).AdminAsyncActionRepo;
|
|
179
|
+
}
|
|
180
|
+
return new repo(...params);
|
|
181
|
+
}
|
|
182
|
+
AdminAsyncAction.createInstance = createInstance;
|
|
183
|
+
})(AdminAsyncAction || (exports.AdminAsyncAction = AdminAsyncAction = {}));
|
|
184
|
+
var AdminScheduledTask;
|
|
185
|
+
(function (AdminScheduledTask) {
|
|
186
|
+
let repo;
|
|
187
|
+
async function createInstance(...params) {
|
|
188
|
+
if (repo === undefined) {
|
|
189
|
+
repo = (await import('./repo/adminScheduledTask.js')).AdminScheduledTaskRepo;
|
|
190
|
+
}
|
|
191
|
+
return new repo(...params);
|
|
192
|
+
}
|
|
193
|
+
AdminScheduledTask.createInstance = createInstance;
|
|
194
|
+
})(AdminScheduledTask || (exports.AdminScheduledTask = AdminScheduledTask = {}));
|
|
173
195
|
var AdminTask;
|
|
174
196
|
(function (AdminTask) {
|
|
175
197
|
let repo;
|
|
@@ -192,6 +214,17 @@ var AggregateAction;
|
|
|
192
214
|
}
|
|
193
215
|
AggregateAction.createInstance = createInstance;
|
|
194
216
|
})(AggregateAction || (exports.AggregateAction = AggregateAction = {}));
|
|
217
|
+
var AggregateScheduledTask;
|
|
218
|
+
(function (AggregateScheduledTask) {
|
|
219
|
+
let repo;
|
|
220
|
+
async function createInstance(...params) {
|
|
221
|
+
if (repo === undefined) {
|
|
222
|
+
repo = (await import('./repo/aggregateScheduledTask.js')).AggregateScheduledTaskRepo;
|
|
223
|
+
}
|
|
224
|
+
return new repo(...params);
|
|
225
|
+
}
|
|
226
|
+
AggregateScheduledTask.createInstance = createInstance;
|
|
227
|
+
})(AggregateScheduledTask || (exports.AggregateScheduledTask = AggregateScheduledTask = {}));
|
|
195
228
|
var AggregateTask;
|
|
196
229
|
(function (AggregateTask) {
|
|
197
230
|
let repo;
|
|
@@ -1011,6 +1044,17 @@ var ScheduledTask;
|
|
|
1011
1044
|
}
|
|
1012
1045
|
ScheduledTask.createInstance = createInstance;
|
|
1013
1046
|
})(ScheduledTask || (exports.ScheduledTask = ScheduledTask = {}));
|
|
1047
|
+
var ScheduledTaskLegacy;
|
|
1048
|
+
(function (ScheduledTaskLegacy) {
|
|
1049
|
+
let repo;
|
|
1050
|
+
async function createInstance(...params) {
|
|
1051
|
+
if (repo === undefined) {
|
|
1052
|
+
repo = (await import('./repo/scheduledTaskLegacy.js')).ScheduledTaskLegacyRepo;
|
|
1053
|
+
}
|
|
1054
|
+
return new repo(...params);
|
|
1055
|
+
}
|
|
1056
|
+
ScheduledTaskLegacy.createInstance = createInstance;
|
|
1057
|
+
})(ScheduledTaskLegacy || (exports.ScheduledTaskLegacy = ScheduledTaskLegacy = {}));
|
|
1014
1058
|
var Task;
|
|
1015
1059
|
(function (Task) {
|
|
1016
1060
|
let repo;
|
|
@@ -1033,6 +1077,17 @@ var AsyncAction;
|
|
|
1033
1077
|
}
|
|
1034
1078
|
AsyncAction.createInstance = createInstance;
|
|
1035
1079
|
})(AsyncAction || (exports.AsyncAction = AsyncAction = {}));
|
|
1080
|
+
var AsyncActionLegacy;
|
|
1081
|
+
(function (AsyncActionLegacy) {
|
|
1082
|
+
let repo;
|
|
1083
|
+
async function createInstance(...params) {
|
|
1084
|
+
if (repo === undefined) {
|
|
1085
|
+
repo = (await import('./repo/asyncActionLegacy.js')).AsyncActionLegacyRepo;
|
|
1086
|
+
}
|
|
1087
|
+
return new repo(...params);
|
|
1088
|
+
}
|
|
1089
|
+
AsyncActionLegacy.createInstance = createInstance;
|
|
1090
|
+
})(AsyncActionLegacy || (exports.AsyncActionLegacy = AsyncActionLegacy = {}));
|
|
1036
1091
|
var Ticket;
|
|
1037
1092
|
(function (Ticket) {
|
|
1038
1093
|
let repo;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { AggregateActionRepo } from '../../repo/aggregateAction';
|
|
2
|
+
import type { AggregateScheduledTaskRepo } from '../../repo/aggregateScheduledTask';
|
|
2
3
|
import type { AggregateTaskRepo } from '../../repo/aggregateTask';
|
|
3
4
|
import { AggregationRepo } from '../../repo/aggregation';
|
|
4
5
|
import type { AssetTransactionRepo } from '../../repo/assetTransaction';
|
|
@@ -10,7 +11,7 @@ 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;
|
|
@@ -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"));
|
|
@@ -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
|
+
}
|
|
@@ -9,7 +9,7 @@ function createStartParams(params) {
|
|
|
9
9
|
typeOf: factory_1.factory.organizationType.Corporation
|
|
10
10
|
};
|
|
11
11
|
// reservationFor,issuedThrough保管をaddReservationsから移行(2024-07-01~)
|
|
12
|
-
const reservationFor = createReservationFor(params.event
|
|
12
|
+
const reservationFor = createReservationFor(params.event);
|
|
13
13
|
const { issuedThrough } = createIssuedThrough({ reservationFor: params.event });
|
|
14
14
|
const reservationPackage = {
|
|
15
15
|
issuedThrough, // addReservationsから移行(2024-07-01~)
|
|
@@ -33,7 +33,7 @@ function createStartParams(params) {
|
|
|
33
33
|
instrument
|
|
34
34
|
};
|
|
35
35
|
}
|
|
36
|
-
function createReservationFor(params
|
|
36
|
+
function createReservationFor(params) {
|
|
37
37
|
if (params.typeOf === factory_1.factory.eventType.ScreeningEvent) {
|
|
38
38
|
return {
|
|
39
39
|
endDate: params.endDate,
|
|
@@ -41,7 +41,7 @@ function createReservationFor(params, useOptimizeReservation) {
|
|
|
41
41
|
location: params.location,
|
|
42
42
|
name: params.name,
|
|
43
43
|
startDate: params.startDate,
|
|
44
|
-
superEvent: optimizeReservationSuperEvent(params
|
|
44
|
+
superEvent: optimizeReservationSuperEvent(params),
|
|
45
45
|
typeOf: params.typeOf,
|
|
46
46
|
...(params.doorTime instanceof Date)
|
|
47
47
|
? { doorTime: params.doorTime }
|
|
@@ -52,38 +52,18 @@ function createReservationFor(params, useOptimizeReservation) {
|
|
|
52
52
|
throw new factory_1.factory.errors.NotImplemented(`typeOf: ${params.typeOf}`);
|
|
53
53
|
}
|
|
54
54
|
}
|
|
55
|
-
function optimizeReservationSuperEvent(params
|
|
55
|
+
function optimizeReservationSuperEvent(params) {
|
|
56
56
|
const superEvent = params.superEvent;
|
|
57
57
|
return {
|
|
58
58
|
id: superEvent.id,
|
|
59
|
-
// kanaName: superEvent.kanaName, // 廃止(2024-01-26~)
|
|
60
59
|
location: superEvent.location,
|
|
61
60
|
name: superEvent.name,
|
|
62
|
-
soundFormat: superEvent.soundFormat,
|
|
61
|
+
// soundFormat: superEvent.soundFormat, // discontinue(2026-08-01~)
|
|
63
62
|
typeOf: superEvent.typeOf,
|
|
64
63
|
workPerformed: superEvent.workPerformed,
|
|
65
|
-
// 廃止(2024-01-26~)
|
|
66
|
-
// ...(superEvent.description !== undefined)
|
|
67
|
-
// ? { description: superEvent.description }
|
|
68
|
-
// : undefined,
|
|
69
64
|
...(superEvent.headline !== undefined)
|
|
70
65
|
? { headline: superEvent.headline }
|
|
71
66
|
: undefined,
|
|
72
|
-
// 最適化対応(2024-03-16~)
|
|
73
|
-
...(useOptimizeReservation)
|
|
74
|
-
? {}
|
|
75
|
-
: {
|
|
76
|
-
additionalProperty: (Array.isArray(superEvent.additionalProperty))
|
|
77
|
-
? superEvent.additionalProperty
|
|
78
|
-
: []
|
|
79
|
-
}
|
|
80
|
-
// videoFormatをデータとしても廃止(万が一に備えてUSE_DEPRECATED_VIDEO_FORMATで再設定可能)(2026-02-03~)
|
|
81
|
-
// ...(USE_DEPRECATED_VIDEO_FORMAT)
|
|
82
|
-
// ? {
|
|
83
|
-
// // 現時点で型廃止済だがデータとしては互換性維持(2026-01-15~)
|
|
84
|
-
// videoFormat: (<any>superEvent).videoFormat
|
|
85
|
-
// }
|
|
86
|
-
// : undefined
|
|
87
67
|
};
|
|
88
68
|
}
|
|
89
69
|
function createIssuedThrough(params) {
|
|
@@ -100,7 +100,7 @@ function responseBody2acceptedOffers4result(params) {
|
|
|
100
100
|
name: event.superEvent.name,
|
|
101
101
|
alternativeHeadline: event.superEvent.alternativeHeadline,
|
|
102
102
|
location: event.superEvent.location,
|
|
103
|
-
soundFormat: event.superEvent.soundFormat,
|
|
103
|
+
// soundFormat: event.superEvent.soundFormat, // discontinue(2026-08-01~)
|
|
104
104
|
workPerformed: workPerformed,
|
|
105
105
|
duration: event.superEvent.duration,
|
|
106
106
|
coaInfo: event.superEvent.coaInfo
|
|
@@ -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
|
}
|
|
@@ -75,7 +75,7 @@ function createSendOrderTaskIfNotExist(params) {
|
|
|
75
75
|
};
|
|
76
76
|
debug('processing createSendOrderTaskIfNotExist...', sendOrderTask);
|
|
77
77
|
// await repos.task.createSendOrderTaskIfNotExist(sendOrderTask);
|
|
78
|
-
await repos.task.
|
|
78
|
+
await repos.task.runTaskByIdentifier(sendOrderTask);
|
|
79
79
|
};
|
|
80
80
|
}
|
|
81
81
|
function createOnAuthorizationCreatedTask(order) {
|
|
@@ -107,7 +107,7 @@ function createOnAuthorizationCreatedTask(order) {
|
|
|
107
107
|
},
|
|
108
108
|
project: { id: order.project.id, typeOf: factory_1.factory.organizationType.Project }
|
|
109
109
|
};
|
|
110
|
-
await repos.task.
|
|
110
|
+
await repos.task.runTaskByIdentifier(task);
|
|
111
111
|
}
|
|
112
112
|
};
|
|
113
113
|
}
|
|
@@ -64,7 +64,7 @@ function createConfirmPayTransactionTasks(order, simpleOrder) {
|
|
|
64
64
|
executionResults: [],
|
|
65
65
|
data
|
|
66
66
|
};
|
|
67
|
-
await repos.task.
|
|
67
|
+
await repos.task.runTaskByIdentifier(confirmPayTransactionTask);
|
|
68
68
|
// 冗長なタスク作成を回避
|
|
69
69
|
// const existingTasks = await repos.task.projectFields(
|
|
70
70
|
// {
|
|
@@ -59,7 +59,7 @@ function createSendEmailMessageTaskIfNotExist(params) {
|
|
|
59
59
|
executionResults: [],
|
|
60
60
|
data: { actionAttributes }
|
|
61
61
|
};
|
|
62
|
-
await repos.task.
|
|
62
|
+
await repos.task.runTaskByIdentifier(sendEmailMessageTask);
|
|
63
63
|
}
|
|
64
64
|
};
|
|
65
65
|
}
|
|
@@ -61,7 +61,7 @@ function createConfirmReserveTransactionTasksIfNotExist(order, simpleOrder, opti
|
|
|
61
61
|
executionResults: [],
|
|
62
62
|
data
|
|
63
63
|
};
|
|
64
|
-
await repos.task.
|
|
64
|
+
await repos.task.runTaskByIdentifier(confirmReserveTransactionTask);
|
|
65
65
|
if (options.force === true) {
|
|
66
66
|
const existingTask = await repos.task.findByIdentifier({
|
|
67
67
|
identifier: taskIdentifier,
|
|
@@ -37,7 +37,7 @@ function onOrderProcessing(params) {
|
|
|
37
37
|
await repos.task.saveMany(tasks);
|
|
38
38
|
// uniqueness of CheckResource task(2025-03-29~)
|
|
39
39
|
if (creatingCheckResourceTask !== undefined) {
|
|
40
|
-
await repos.task.
|
|
40
|
+
await repos.task.runTaskByIdentifier(creatingCheckResourceTask);
|
|
41
41
|
}
|
|
42
42
|
switch (params.order.orderStatus) {
|
|
43
43
|
case factory_1.factory.orderStatus.OrderProcessing:
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { factory } from '../../../factory';
|
|
2
2
|
import type { AcceptPayActionRepo } from '../../../repo/action/acceptPay';
|
|
3
3
|
import type { AsyncActionRepo } from '../../../repo/asyncAction';
|
|
4
|
-
import type { TaskRepo } from '../../../repo/task';
|
|
5
4
|
interface IFindAcceptActionResult {
|
|
6
5
|
/**
|
|
7
6
|
* アクションID
|
|
@@ -39,11 +38,8 @@ declare function findAcceptAction(params: {
|
|
|
39
38
|
*/
|
|
40
39
|
id: string;
|
|
41
40
|
};
|
|
42
|
-
}, options: {
|
|
43
|
-
useAsyncAction: boolean;
|
|
44
41
|
}): (repos: {
|
|
45
42
|
acceptPayAction: AcceptPayActionRepo;
|
|
46
43
|
asyncAction: AsyncActionRepo;
|
|
47
|
-
task: TaskRepo;
|
|
48
44
|
}) => Promise<IFindAcceptActionResult>;
|
|
49
45
|
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-28~)
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
//
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
}
|
|
8
|
+
// let task: Pick<factory.task.publishPaymentUrl.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.PublishPaymentUrl
|
|
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.PublishPaymentUrl
|
|
22
|
+
// },
|
|
23
|
+
// ['status', 'executionResults']
|
|
24
|
+
// );
|
|
25
|
+
// }
|
|
26
26
|
if (task === undefined) {
|
|
27
27
|
throw new factory_1.factory.errors.NotFound(factory_1.factory.taskName.PublishPaymentUrl);
|
|
28
28
|
}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { factory } from '../../../factory';
|
|
2
2
|
import type { AuthorizePaymentMethodActionRepo } from '../../../repo/action/authorizePaymentMethod';
|
|
3
3
|
import type { AsyncActionRepo } from '../../../repo/asyncAction';
|
|
4
|
-
import type { TaskRepo } from '../../../repo/task';
|
|
5
4
|
interface IFindAuthorizeActionResult {
|
|
6
5
|
/**
|
|
7
6
|
* アクションID
|
|
@@ -22,7 +21,6 @@ interface IFindAuthorizeActionResult {
|
|
|
22
21
|
interface IFindAuthorizeActionRepos {
|
|
23
22
|
authorizePaymentMethodAction: AuthorizePaymentMethodActionRepo;
|
|
24
23
|
asyncAction: AsyncActionRepo;
|
|
25
|
-
task: TaskRepo;
|
|
26
24
|
}
|
|
27
25
|
declare function findAuthorizeAction(params: {
|
|
28
26
|
project: {
|
|
@@ -40,7 +38,5 @@ declare function findAuthorizeAction(params: {
|
|
|
40
38
|
*/
|
|
41
39
|
id: string;
|
|
42
40
|
};
|
|
43
|
-
}, options: {
|
|
44
|
-
useAsyncAction: boolean;
|
|
45
41
|
}): (repos: IFindAuthorizeActionRepos) => Promise<IFindAuthorizeActionResult>;
|
|
46
42
|
export { IFindAuthorizeActionRepos, findAuthorizeAction, };
|
|
@@ -2,27 +2,27 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.findAuthorizeAction = findAuthorizeAction;
|
|
4
4
|
const factory_1 = require("../../../factory");
|
|
5
|
-
function findAuthorizeAction(params
|
|
5
|
+
function findAuthorizeAction(params) {
|
|
6
6
|
return async (repos) => {
|
|
7
7
|
// 非同期アクションに対応(2026-07-28~)
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
//
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
}
|
|
8
|
+
// let task: Pick<factory.task.authorizePayment.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.AuthorizePayment
|
|
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.AuthorizePayment
|
|
22
|
+
// },
|
|
23
|
+
// ['status', 'executionResults']
|
|
24
|
+
// );
|
|
25
|
+
// }
|
|
26
26
|
if (task === undefined) {
|
|
27
27
|
throw new factory_1.factory.errors.NotFound(factory_1.factory.taskName.AuthorizePayment);
|
|
28
28
|
}
|
|
@@ -1,11 +1,9 @@
|
|
|
1
1
|
import { factory } from '../../../factory';
|
|
2
2
|
import type { CheckMovieTicketActionRepo, IMinimizedPurchaseNumberAuthResult } from '../../../repo/action/checkMovieTicket';
|
|
3
3
|
import type { AsyncActionRepo } from '../../../repo/asyncAction';
|
|
4
|
-
import type { TaskRepo } from '../../../repo/task';
|
|
5
4
|
interface IFindCheckActionRepos {
|
|
6
5
|
checkMovieTicketAction: CheckMovieTicketActionRepo;
|
|
7
6
|
asyncAction: AsyncActionRepo;
|
|
8
|
-
task: TaskRepo;
|
|
9
7
|
}
|
|
10
8
|
interface IFindCheckActionResult {
|
|
11
9
|
/**
|
|
@@ -43,7 +41,5 @@ declare function findCheckAction(params: {
|
|
|
43
41
|
*/
|
|
44
42
|
id: string;
|
|
45
43
|
};
|
|
46
|
-
}, options: {
|
|
47
|
-
useAsyncAction: boolean;
|
|
48
44
|
}): (repos: IFindCheckActionRepos) => Promise<IFindCheckActionResult>;
|
|
49
45
|
export { IFindCheckActionRepos, findCheckAction, };
|
|
@@ -2,27 +2,27 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.findCheckAction = findCheckAction;
|
|
4
4
|
const factory_1 = require("../../../factory");
|
|
5
|
-
function findCheckAction(params
|
|
5
|
+
function findCheckAction(params) {
|
|
6
6
|
return async (repos) => {
|
|
7
7
|
// 非同期アクションに対応(2026-07-28~)
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
//
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
}
|
|
8
|
+
// let task: Pick<factory.task.checkMovieTicket.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.CheckMovieTicket
|
|
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.CheckMovieTicket
|
|
22
|
+
// },
|
|
23
|
+
// ['status', 'executionResults']
|
|
24
|
+
// );
|
|
25
|
+
// }
|
|
26
26
|
if (task === undefined) {
|
|
27
27
|
throw new factory_1.factory.errors.NotFound(factory_1.factory.taskName.CheckMovieTicket);
|
|
28
28
|
}
|