@chevre/domain 26.0.0-alpha.33 → 26.0.0-alpha.35
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/action/actionProcess.d.ts +1 -4
- package/lib/chevre/repo/action/actionProcess.js +1 -7
- package/lib/chevre/repo/action.d.ts +2 -84
- package/lib/chevre/repo/action.js +0 -154
- package/lib/chevre/repo/adminAction.d.ts +86 -0
- package/lib/chevre/repo/adminAction.js +164 -0
- package/lib/chevre/repo/mongoose/schemas/action.d.ts +1 -3
- package/lib/chevre/repo/mongoose/schemas/action.js +4 -7
- package/lib/chevre/repository.d.ts +5 -5
- package/lib/chevre/repository.js +13 -13
- package/lib/chevre/service/order/deleteOrder.d.ts +2 -2
- package/lib/chevre/service/order/deleteOrder.js +1 -1
- package/lib/chevre/service/order/onOrderStatusChanged/onOrderProcessing/factory.js +1 -3
- package/lib/chevre/service/project.d.ts +0 -3
- package/lib/chevre/service/project.js +0 -1
- package/lib/chevre/service/task/checkResource.js +14 -57
- package/lib/chevre/service/task/deleteTransaction.js +2 -2
- package/lib/chevre/service/transaction/deleteTransaction.d.ts +2 -2
- package/lib/chevre/service/transaction/deleteTransaction.js +2 -2
- package/lib/chevre/service/validation/validateOrder.d.ts +0 -4
- package/lib/chevre/service/validation/validateOrder.js +1 -1
- package/package.json +2 -2
- package/lib/chevre/repo/action/checkThing.d.ts +0 -8
- package/lib/chevre/repo/action/checkThing.js +0 -13
- package/lib/chevre/repo/mongoose/schemas/pendingReservationAggregate.d.ts +0 -25
- package/lib/chevre/repo/mongoose/schemas/pendingReservationAggregate.js +0 -100
- package/lib/chevre/service/validation/validateEvent.d.ts +0 -11
- package/lib/chevre/service/validation/validateEvent.js +0 -21
|
@@ -3,10 +3,7 @@ import { factory } from '../../factory';
|
|
|
3
3
|
import { IModel as IActionModel } from '../mongoose/schemas/action';
|
|
4
4
|
import { IModel as IActionRecipeModel } from '../mongoose/schemas/actionRecipe';
|
|
5
5
|
export type IAction4transaction<T extends factory.actionType.AcceptAction | factory.actionType.AuthorizeAction> = T extends factory.actionType.AcceptAction ? factory.action.accept.coaOffer.IAction | factory.action.accept.pay.IAction : T extends factory.actionType.AuthorizeAction ? (factory.action.authorize.offer.eventService.IAction | factory.action.authorize.paymentMethod.any.IAction) : never;
|
|
6
|
-
export type IAction<T extends factory.actionType> = T extends factory.actionType.OrderAction ? factory.action.trade.order.IAction : T extends factory.actionType.AcceptAction ? IAction4transaction<factory.actionType.AcceptAction> : T extends factory.actionType.AuthorizeAction ? factory.action.authorize.IAction<factory.action.authorize.IAttributes<any, any>> : T extends factory.actionType.CheckAction ?
|
|
7
|
-
error?: any;
|
|
8
|
-
purpose?: never;
|
|
9
|
-
} : factory.action.IAction<factory.action.IAttributes<T, any, any>>;
|
|
6
|
+
export type IAction<T extends factory.actionType> = T extends factory.actionType.OrderAction ? factory.action.trade.order.IAction : T extends factory.actionType.AcceptAction ? IAction4transaction<factory.actionType.AcceptAction> : T extends factory.actionType.AuthorizeAction ? factory.action.authorize.IAction<factory.action.authorize.IAttributes<any, any>> : T extends factory.actionType.CheckAction ? factory.action.check.paymentMethod.movieTicket.IAction : T extends factory.actionType.CreateAction ? factory.action.create.IAction : factory.action.IAction<factory.action.IAttributes<T, any, any>>;
|
|
10
7
|
export interface ICancelActionAction {
|
|
11
8
|
typeOf: factory.actionType.CancelAction;
|
|
12
9
|
agent: factory.action.IParticipantAsPerson | factory.action.IParticipantAsProject | factory.action.IParticipantAsWebApplication;
|
|
@@ -20,18 +20,12 @@ exports.AVAILABLE_PROJECT_FIELDS = [
|
|
|
20
20
|
'endDate',
|
|
21
21
|
'purpose',
|
|
22
22
|
'potentialActions',
|
|
23
|
-
// 'amount', // discontinue(2026-07-08~)
|
|
24
|
-
// 'fromLocation', // discontinue(2026-07-08~)
|
|
25
|
-
// 'toLocation', // discontinue(2026-07-08~)
|
|
26
23
|
'instrument',
|
|
27
24
|
'location',
|
|
28
|
-
'replacer',
|
|
29
|
-
'targetCollection',
|
|
30
25
|
'sameAs',
|
|
31
26
|
'cancelAction',
|
|
32
27
|
'about',
|
|
33
|
-
'
|
|
34
|
-
'identifier'
|
|
28
|
+
'identifier',
|
|
35
29
|
];
|
|
36
30
|
/**
|
|
37
31
|
* アクション状態管理リポジトリ
|
|
@@ -1,18 +1,11 @@
|
|
|
1
|
-
import { FilterQuery } from 'mongoose';
|
|
2
1
|
import { factory } from '../factory';
|
|
3
|
-
import type { IDocType } from './mongoose/schemas/action';
|
|
4
2
|
import { IAction, IKeyOfProjection, ActionProcessRepo, ICancelActionAction, IActionRecipe } from './action/actionProcess';
|
|
5
|
-
export type IAction4transaction<T extends factory.actionType.AcceptAction | factory.actionType.AuthorizeAction> = T extends factory.actionType.AcceptAction ? factory.action.accept.coaOffer.IAction | factory.action.accept.pay.IAction : T extends factory.actionType.AuthorizeAction ? (factory.action.authorize.offer.eventService.IAction | factory.action.authorize.paymentMethod.any.IAction) : never;
|
|
6
3
|
export { ICancelActionAction };
|
|
7
4
|
/**
|
|
8
5
|
* 汎用アクションリポジトリで開始可能なアクションタイプ
|
|
9
6
|
*/
|
|
10
|
-
type StartableActionType = Exclude<factory.actionType, factory.actionType.AcceptAction | factory.actionType.CheckAction | factory.actionType.AuthorizeAction | factory.actionType.PayAction | factory.actionType.RefundAction | factory.actionType.AddAction | factory.actionType.UpdateAction | factory.actionType.ReplaceAction | factory.actionType.DeleteAction | factory.actionType.InformAction | factory.actionType.UseAction>;
|
|
11
|
-
type IAvailableActionRecipe = IActionRecipe<Exclude<factory.recipe.RecipeCategory, factory.recipe.RecipeCategory.publishPaymentUrl | factory.recipe.RecipeCategory.checkMovieTicket | factory.recipe.RecipeCategory.acceptCOAOffer | factory.recipe.RecipeCategory.authorizeInvoice | factory.recipe.RecipeCategory.authorizeInvoice3ds | factory.recipe.RecipeCategory.payCreditCard | factory.recipe.RecipeCategory.payMovieTicket | factory.recipe.RecipeCategory.refundCreditCard | factory.recipe.RecipeCategory.refundMovieTicket>>;
|
|
12
|
-
export interface IDeleteActionResult {
|
|
13
|
-
identifier: string;
|
|
14
|
-
deletedCount?: number;
|
|
15
|
-
}
|
|
7
|
+
export type StartableActionType = Exclude<factory.actionType, factory.actionType.AcceptAction | factory.actionType.CheckAction | factory.actionType.AuthorizeAction | factory.actionType.PayAction | factory.actionType.RefundAction | factory.actionType.AddAction | factory.actionType.UpdateAction | factory.actionType.ReplaceAction | factory.actionType.DeleteAction | factory.actionType.InformAction | factory.actionType.UseAction>;
|
|
8
|
+
export type IAvailableActionRecipe = IActionRecipe<Exclude<factory.recipe.RecipeCategory, factory.recipe.RecipeCategory.publishPaymentUrl | factory.recipe.RecipeCategory.checkMovieTicket | factory.recipe.RecipeCategory.acceptCOAOffer | factory.recipe.RecipeCategory.authorizeInvoice | factory.recipe.RecipeCategory.authorizeInvoice3ds | factory.recipe.RecipeCategory.payCreditCard | factory.recipe.RecipeCategory.payMovieTicket | factory.recipe.RecipeCategory.refundCreditCard | factory.recipe.RecipeCategory.refundMovieTicket>>;
|
|
16
9
|
/**
|
|
17
10
|
* アクションリポジトリ
|
|
18
11
|
*/
|
|
@@ -25,79 +18,4 @@ export declare class ActionRepo extends ActionProcessRepo<IAction<StartableActio
|
|
|
25
18
|
$eq?: T;
|
|
26
19
|
};
|
|
27
20
|
}, inclusion: IKeyOfProjection[]): Promise<IAction<T>[]>;
|
|
28
|
-
/**
|
|
29
|
-
* 取引に対するアクションを検索する
|
|
30
|
-
*/
|
|
31
|
-
searchByPurpose<T extends factory.actionType.AuthorizeAction>(params: {
|
|
32
|
-
typeOf?: T;
|
|
33
|
-
purpose: {
|
|
34
|
-
typeOf: factory.transactionType;
|
|
35
|
-
id: string;
|
|
36
|
-
};
|
|
37
|
-
object?: {
|
|
38
|
-
typeOf?: {
|
|
39
|
-
$eq?: factory.action.authorize.offer.eventService.ObjectType.SeatReservation | factory.action.authorize.paymentMethod.any.ResultType.Payment;
|
|
40
|
-
};
|
|
41
|
-
paymentMethodId?: {
|
|
42
|
-
$eq?: string;
|
|
43
|
-
};
|
|
44
|
-
};
|
|
45
|
-
actionStatus?: {
|
|
46
|
-
$eq?: factory.actionStatusType.CompletedActionStatus;
|
|
47
|
-
};
|
|
48
|
-
sort?: factory.action.ISortOrder;
|
|
49
|
-
}): Promise<IAction4transaction<T>[]>;
|
|
50
|
-
/**
|
|
51
|
-
* 注文番号から、注文に対するアクションを検索する
|
|
52
|
-
*/
|
|
53
|
-
searchByOrderNumber(params: {
|
|
54
|
-
orderNumber: string;
|
|
55
|
-
sort?: factory.action.ISortOrder;
|
|
56
|
-
}): Promise<IAction<factory.actionType>[]>;
|
|
57
|
-
/**
|
|
58
|
-
* 注文番号から、注文に対するアクションを削除する
|
|
59
|
-
*/
|
|
60
|
-
deleteActionsByOrderNumber(params: {
|
|
61
|
-
project: {
|
|
62
|
-
id: string;
|
|
63
|
-
};
|
|
64
|
-
orderNumber: string;
|
|
65
|
-
}): Promise<IDeleteActionResult[]>;
|
|
66
|
-
deleteByProject(params: {
|
|
67
|
-
project: {
|
|
68
|
-
id: string;
|
|
69
|
-
};
|
|
70
|
-
}): Promise<void>;
|
|
71
|
-
/**
|
|
72
|
-
* 取引からアクションを削除する
|
|
73
|
-
*/
|
|
74
|
-
deleteActionsByTransactionId(params: {
|
|
75
|
-
project: {
|
|
76
|
-
id: string;
|
|
77
|
-
};
|
|
78
|
-
transaction: {
|
|
79
|
-
typeOf: factory.transactionType;
|
|
80
|
-
id: string;
|
|
81
|
-
};
|
|
82
|
-
typeOf: {
|
|
83
|
-
$in: factory.actionType[];
|
|
84
|
-
};
|
|
85
|
-
}): Promise<IDeleteActionResult[]>;
|
|
86
|
-
getCursor(conditions: any, projection: any): import("mongoose").Cursor<import("mongoose").Document<unknown, Record<string, never>, IDocType, import("./mongoose/virtuals").IVirtuals, {}> & Omit<import("@chevre/factory/lib/chevre/action").IAction<import("@chevre/factory/lib/chevre/action").IAttributes<factory.actionType, any, any>>, "id" | "replacer"> & {
|
|
87
|
-
identifier?: string;
|
|
88
|
-
} & {
|
|
89
|
-
_id: import("mongoose").Types.ObjectId;
|
|
90
|
-
} & {
|
|
91
|
-
__v: number;
|
|
92
|
-
}, import("mongoose").QueryOptions<IDocType>, (import("mongoose").Document<unknown, Record<string, never>, IDocType, import("./mongoose/virtuals").IVirtuals, {}> & Omit<import("@chevre/factory/lib/chevre/action").IAction<import("@chevre/factory/lib/chevre/action").IAttributes<factory.actionType, any, any>>, "id" | "replacer"> & {
|
|
93
|
-
identifier?: string;
|
|
94
|
-
} & {
|
|
95
|
-
_id: import("mongoose").Types.ObjectId;
|
|
96
|
-
} & {
|
|
97
|
-
__v: number;
|
|
98
|
-
}) | null>;
|
|
99
|
-
unsetUnnecessaryFields(params: {
|
|
100
|
-
filter: FilterQuery<factory.action.IAction<factory.action.IAttributes<factory.actionType, any, any>>>;
|
|
101
|
-
$unset: any;
|
|
102
|
-
}): Promise<import("mongoose").UpdateWriteOpResult>;
|
|
103
21
|
}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.ActionRepo = void 0;
|
|
4
|
-
const factory_1 = require("../factory");
|
|
5
4
|
const actionProcess_1 = require("./action/actionProcess");
|
|
6
5
|
/**
|
|
7
6
|
* アクションリポジトリ
|
|
@@ -13,158 +12,5 @@ class ActionRepo extends actionProcess_1.ActionProcessRepo {
|
|
|
13
12
|
async findActionsByType(params, inclusion) {
|
|
14
13
|
return (this.findAnyActions(params, inclusion));
|
|
15
14
|
}
|
|
16
|
-
/**
|
|
17
|
-
* 取引に対するアクションを検索する
|
|
18
|
-
*/
|
|
19
|
-
async searchByPurpose(params) {
|
|
20
|
-
return (this.findAnyActionsByPurpose(params));
|
|
21
|
-
}
|
|
22
|
-
/**
|
|
23
|
-
* 注文番号から、注文に対するアクションを検索する
|
|
24
|
-
*/
|
|
25
|
-
async searchByOrderNumber(params) {
|
|
26
|
-
const filter = {
|
|
27
|
-
$or: [
|
|
28
|
-
{ 'object.orderNumber': { $exists: true, $eq: params.orderNumber } },
|
|
29
|
-
{ 'purpose.orderNumber': { $exists: true, $eq: params.orderNumber } },
|
|
30
|
-
// consider inform returnAction(2025-01-22~)
|
|
31
|
-
{ 'about.orderNumber': { $exists: true, $eq: params.orderNumber } },
|
|
32
|
-
// consider reserveAction,cancelReservationAction(2025-02-17~)
|
|
33
|
-
{ 'instrument.orderNumber': { $exists: true, $eq: params.orderNumber } }
|
|
34
|
-
]
|
|
35
|
-
};
|
|
36
|
-
const projection = {
|
|
37
|
-
_id: 0,
|
|
38
|
-
id: { $toString: '$_id' },
|
|
39
|
-
...Object.fromEntries(actionProcess_1.AVAILABLE_PROJECT_FIELDS.map((key) => ([key, 1])))
|
|
40
|
-
};
|
|
41
|
-
const query = this.actionModel.find(filter, projection);
|
|
42
|
-
// .select({ __v: 0, createdAt: 0, updatedAt: 0 });
|
|
43
|
-
/* istanbul ignore else */
|
|
44
|
-
if (params.sort?.startDate !== undefined) {
|
|
45
|
-
query.sort({ startDate: params.sort.startDate });
|
|
46
|
-
}
|
|
47
|
-
return query
|
|
48
|
-
.lean() // 2024-08-26~
|
|
49
|
-
.exec();
|
|
50
|
-
}
|
|
51
|
-
/**
|
|
52
|
-
* 注文番号から、注文に対するアクションを削除する
|
|
53
|
-
*/
|
|
54
|
-
async deleteActionsByOrderNumber(params) {
|
|
55
|
-
const { project, orderNumber } = params;
|
|
56
|
-
if (typeof project.id !== 'string' || project.id === '') {
|
|
57
|
-
throw new factory_1.factory.errors.ArgumentNull('project.id');
|
|
58
|
-
}
|
|
59
|
-
if (typeof orderNumber !== 'string' || orderNumber === '') {
|
|
60
|
-
throw new factory_1.factory.errors.ArgumentNull('orderNumber');
|
|
61
|
-
}
|
|
62
|
-
const filters = [
|
|
63
|
-
{
|
|
64
|
-
identifier: 'byObject',
|
|
65
|
-
filter: {
|
|
66
|
-
'project.id': { $eq: project.id },
|
|
67
|
-
'object.orderNumber': { $exists: true, $eq: orderNumber }
|
|
68
|
-
}
|
|
69
|
-
},
|
|
70
|
-
{
|
|
71
|
-
identifier: 'byPurpose',
|
|
72
|
-
filter: {
|
|
73
|
-
'project.id': { $eq: project.id },
|
|
74
|
-
'purpose.orderNumber': { $exists: true, $eq: orderNumber }
|
|
75
|
-
}
|
|
76
|
-
},
|
|
77
|
-
{
|
|
78
|
-
identifier: 'byAbout',
|
|
79
|
-
filter: {
|
|
80
|
-
'project.id': { $eq: project.id },
|
|
81
|
-
'about.orderNumber': { $exists: true, $eq: orderNumber }
|
|
82
|
-
}
|
|
83
|
-
},
|
|
84
|
-
{
|
|
85
|
-
identifier: 'byInstrument',
|
|
86
|
-
filter: {
|
|
87
|
-
'project.id': { $eq: project.id },
|
|
88
|
-
'instrument.orderNumber': { $exists: true, $eq: orderNumber }
|
|
89
|
-
}
|
|
90
|
-
},
|
|
91
|
-
];
|
|
92
|
-
return Promise.all(filters.map(async ({ identifier, filter }) => {
|
|
93
|
-
return this.actionModel.deleteMany(filter)
|
|
94
|
-
.exec()
|
|
95
|
-
.then((result) => {
|
|
96
|
-
return {
|
|
97
|
-
identifier,
|
|
98
|
-
// n: result?.n,
|
|
99
|
-
// opTime: result.opTime,
|
|
100
|
-
// ok: result?.ok,
|
|
101
|
-
// operationTime,
|
|
102
|
-
deletedCount: result?.deletedCount
|
|
103
|
-
};
|
|
104
|
-
});
|
|
105
|
-
}));
|
|
106
|
-
}
|
|
107
|
-
async deleteByProject(params) {
|
|
108
|
-
await this.actionModel.deleteMany({
|
|
109
|
-
'project.id': { $eq: params.project.id }
|
|
110
|
-
})
|
|
111
|
-
.exec();
|
|
112
|
-
}
|
|
113
|
-
/**
|
|
114
|
-
* 取引からアクションを削除する
|
|
115
|
-
*/
|
|
116
|
-
async deleteActionsByTransactionId(params) {
|
|
117
|
-
const { project, transaction } = params;
|
|
118
|
-
if (typeof project.id !== 'string' || project.id === '') {
|
|
119
|
-
throw new factory_1.factory.errors.ArgumentNull('project.id');
|
|
120
|
-
}
|
|
121
|
-
if (typeof transaction.id !== 'string' || transaction.id === '') {
|
|
122
|
-
throw new factory_1.factory.errors.ArgumentNull('transaction.id ');
|
|
123
|
-
}
|
|
124
|
-
const filters = [
|
|
125
|
-
{
|
|
126
|
-
identifier: 'byPurpose',
|
|
127
|
-
filter: {
|
|
128
|
-
'project.id': { $eq: project.id },
|
|
129
|
-
typeOf: { $in: params.typeOf.$in },
|
|
130
|
-
'purpose.id': { $exists: true, $eq: transaction.id },
|
|
131
|
-
'purpose.typeOf': { $exists: true, $eq: transaction.typeOf }
|
|
132
|
-
}
|
|
133
|
-
},
|
|
134
|
-
// instrumentによるアクション削除にも対応(2026-07-10~)
|
|
135
|
-
{
|
|
136
|
-
identifier: 'byInstrument',
|
|
137
|
-
filter: {
|
|
138
|
-
'project.id': { $eq: project.id },
|
|
139
|
-
// typeOf: { $in: params.typeOf.$in }, // typOfでフィルターしない
|
|
140
|
-
'instrument.id': { $exists: true, $eq: transaction.id },
|
|
141
|
-
'instrument.typeOf': { $exists: true, $eq: transaction.typeOf }
|
|
142
|
-
}
|
|
143
|
-
}
|
|
144
|
-
];
|
|
145
|
-
return Promise.all(filters.map(async ({ identifier, filter }) => {
|
|
146
|
-
return this.actionModel.deleteMany(filter)
|
|
147
|
-
.exec()
|
|
148
|
-
.then((result) => {
|
|
149
|
-
return {
|
|
150
|
-
identifier,
|
|
151
|
-
// n: result?.n,
|
|
152
|
-
// opTime: result.opTime,
|
|
153
|
-
// ok: result?.ok,
|
|
154
|
-
// operationTime,
|
|
155
|
-
deletedCount: result?.deletedCount
|
|
156
|
-
};
|
|
157
|
-
});
|
|
158
|
-
}));
|
|
159
|
-
}
|
|
160
|
-
getCursor(conditions, projection) {
|
|
161
|
-
return this.actionModel.find(conditions, projection)
|
|
162
|
-
.sort({ startDate: factory_1.factory.sortType.Descending })
|
|
163
|
-
.cursor();
|
|
164
|
-
}
|
|
165
|
-
async unsetUnnecessaryFields(params) {
|
|
166
|
-
return this.actionModel.updateMany(params.filter, { $unset: params.$unset }, { timestamps: false })
|
|
167
|
-
.exec();
|
|
168
|
-
}
|
|
169
15
|
}
|
|
170
16
|
exports.ActionRepo = ActionRepo;
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
import { FilterQuery } from 'mongoose';
|
|
2
|
+
import { factory } from '../factory';
|
|
3
|
+
import type { IDocType } from './mongoose/schemas/action';
|
|
4
|
+
import { IAction, ActionProcessRepo } from './action/actionProcess';
|
|
5
|
+
import { StartableActionType, IAvailableActionRecipe } from './action';
|
|
6
|
+
export type IAction4transaction<T extends factory.actionType.AcceptAction | factory.actionType.AuthorizeAction> = T extends factory.actionType.AcceptAction ? factory.action.accept.coaOffer.IAction | factory.action.accept.pay.IAction : T extends factory.actionType.AuthorizeAction ? (factory.action.authorize.offer.eventService.IAction | factory.action.authorize.paymentMethod.any.IAction) : never;
|
|
7
|
+
export interface IDeleteActionResult {
|
|
8
|
+
identifier: string;
|
|
9
|
+
deletedCount?: number;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* アクション管理リポジトリ
|
|
13
|
+
*/
|
|
14
|
+
export declare class AdminActionRepo extends ActionProcessRepo<IAction<StartableActionType>, IAvailableActionRecipe> {
|
|
15
|
+
/**
|
|
16
|
+
* 取引に対するアクションを検索する
|
|
17
|
+
*/
|
|
18
|
+
searchByPurpose<T extends factory.actionType.AuthorizeAction>(params: {
|
|
19
|
+
typeOf?: T;
|
|
20
|
+
purpose: {
|
|
21
|
+
typeOf: factory.transactionType;
|
|
22
|
+
id: string;
|
|
23
|
+
};
|
|
24
|
+
object?: {
|
|
25
|
+
typeOf?: {
|
|
26
|
+
$eq?: factory.action.authorize.offer.eventService.ObjectType.SeatReservation | factory.action.authorize.paymentMethod.any.ResultType.Payment;
|
|
27
|
+
};
|
|
28
|
+
paymentMethodId?: {
|
|
29
|
+
$eq?: string;
|
|
30
|
+
};
|
|
31
|
+
};
|
|
32
|
+
actionStatus?: {
|
|
33
|
+
$eq?: factory.actionStatusType.CompletedActionStatus;
|
|
34
|
+
};
|
|
35
|
+
sort?: factory.action.ISortOrder;
|
|
36
|
+
}): Promise<IAction4transaction<T>[]>;
|
|
37
|
+
/**
|
|
38
|
+
* 注文番号から、注文に対するアクションを検索する
|
|
39
|
+
*/
|
|
40
|
+
searchByOrderNumber(params: {
|
|
41
|
+
orderNumber: string;
|
|
42
|
+
sort?: factory.action.ISortOrder;
|
|
43
|
+
}): Promise<IAction<factory.actionType>[]>;
|
|
44
|
+
/**
|
|
45
|
+
* 注文番号から、注文に対するアクションを削除する
|
|
46
|
+
*/
|
|
47
|
+
deleteActionsByOrderNumber(params: {
|
|
48
|
+
project: {
|
|
49
|
+
id: string;
|
|
50
|
+
};
|
|
51
|
+
orderNumber: string;
|
|
52
|
+
}): Promise<IDeleteActionResult[]>;
|
|
53
|
+
deleteByProject(params: {
|
|
54
|
+
project: {
|
|
55
|
+
id: string;
|
|
56
|
+
};
|
|
57
|
+
}): Promise<void>;
|
|
58
|
+
/**
|
|
59
|
+
* 取引からアクションを削除する
|
|
60
|
+
*/
|
|
61
|
+
deleteActionsByTransactionId(params: {
|
|
62
|
+
project: {
|
|
63
|
+
id: string;
|
|
64
|
+
};
|
|
65
|
+
transaction: {
|
|
66
|
+
typeOf: factory.transactionType;
|
|
67
|
+
id: string;
|
|
68
|
+
};
|
|
69
|
+
typeOf: {
|
|
70
|
+
$in: factory.actionType[];
|
|
71
|
+
};
|
|
72
|
+
}): Promise<IDeleteActionResult[]>;
|
|
73
|
+
getCursor(conditions: any, projection: any): import("mongoose").Cursor<import("mongoose").Document<unknown, Record<string, never>, IDocType, import("./mongoose/virtuals").IVirtuals, {}> & IDocType & {
|
|
74
|
+
_id: import("mongoose").Types.ObjectId;
|
|
75
|
+
} & {
|
|
76
|
+
__v: number;
|
|
77
|
+
}, import("mongoose").QueryOptions<IDocType>, (import("mongoose").Document<unknown, Record<string, never>, IDocType, import("./mongoose/virtuals").IVirtuals, {}> & IDocType & {
|
|
78
|
+
_id: import("mongoose").Types.ObjectId;
|
|
79
|
+
} & {
|
|
80
|
+
__v: number;
|
|
81
|
+
}) | null>;
|
|
82
|
+
unsetUnnecessaryFields(params: {
|
|
83
|
+
filter: FilterQuery<factory.action.IAction<factory.action.IAttributes<factory.actionType, any, any>>>;
|
|
84
|
+
$unset: any;
|
|
85
|
+
}): Promise<import("mongoose").UpdateWriteOpResult>;
|
|
86
|
+
}
|
|
@@ -0,0 +1,164 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.AdminActionRepo = void 0;
|
|
4
|
+
const factory_1 = require("../factory");
|
|
5
|
+
const actionProcess_1 = require("./action/actionProcess");
|
|
6
|
+
/**
|
|
7
|
+
* アクション管理リポジトリ
|
|
8
|
+
*/
|
|
9
|
+
class AdminActionRepo extends actionProcess_1.ActionProcessRepo {
|
|
10
|
+
/**
|
|
11
|
+
* 取引に対するアクションを検索する
|
|
12
|
+
*/
|
|
13
|
+
async searchByPurpose(params) {
|
|
14
|
+
return (this.findAnyActionsByPurpose(params));
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* 注文番号から、注文に対するアクションを検索する
|
|
18
|
+
*/
|
|
19
|
+
async searchByOrderNumber(params) {
|
|
20
|
+
const filter = {
|
|
21
|
+
$or: [
|
|
22
|
+
{ 'object.orderNumber': { $exists: true, $eq: params.orderNumber } },
|
|
23
|
+
{ 'purpose.orderNumber': { $exists: true, $eq: params.orderNumber } },
|
|
24
|
+
// consider inform returnAction(2025-01-22~)
|
|
25
|
+
{ 'about.orderNumber': { $exists: true, $eq: params.orderNumber } },
|
|
26
|
+
// consider reserveAction,cancelReservationAction(2025-02-17~)
|
|
27
|
+
{ 'instrument.orderNumber': { $exists: true, $eq: params.orderNumber } }
|
|
28
|
+
]
|
|
29
|
+
};
|
|
30
|
+
const projection = {
|
|
31
|
+
_id: 0,
|
|
32
|
+
id: { $toString: '$_id' },
|
|
33
|
+
...Object.fromEntries(actionProcess_1.AVAILABLE_PROJECT_FIELDS.map((key) => ([key, 1])))
|
|
34
|
+
};
|
|
35
|
+
const query = this.actionModel.find(filter, projection);
|
|
36
|
+
// .select({ __v: 0, createdAt: 0, updatedAt: 0 });
|
|
37
|
+
/* istanbul ignore else */
|
|
38
|
+
if (params.sort?.startDate !== undefined) {
|
|
39
|
+
query.sort({ startDate: params.sort.startDate });
|
|
40
|
+
}
|
|
41
|
+
return query
|
|
42
|
+
.lean() // 2024-08-26~
|
|
43
|
+
.exec();
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* 注文番号から、注文に対するアクションを削除する
|
|
47
|
+
*/
|
|
48
|
+
async deleteActionsByOrderNumber(params) {
|
|
49
|
+
const { project, orderNumber } = params;
|
|
50
|
+
if (typeof project.id !== 'string' || project.id === '') {
|
|
51
|
+
throw new factory_1.factory.errors.ArgumentNull('project.id');
|
|
52
|
+
}
|
|
53
|
+
if (typeof orderNumber !== 'string' || orderNumber === '') {
|
|
54
|
+
throw new factory_1.factory.errors.ArgumentNull('orderNumber');
|
|
55
|
+
}
|
|
56
|
+
const filters = [
|
|
57
|
+
{
|
|
58
|
+
identifier: 'byObject',
|
|
59
|
+
filter: {
|
|
60
|
+
'project.id': { $eq: project.id },
|
|
61
|
+
'object.orderNumber': { $exists: true, $eq: orderNumber }
|
|
62
|
+
}
|
|
63
|
+
},
|
|
64
|
+
{
|
|
65
|
+
identifier: 'byPurpose',
|
|
66
|
+
filter: {
|
|
67
|
+
'project.id': { $eq: project.id },
|
|
68
|
+
'purpose.orderNumber': { $exists: true, $eq: orderNumber }
|
|
69
|
+
}
|
|
70
|
+
},
|
|
71
|
+
{
|
|
72
|
+
identifier: 'byAbout',
|
|
73
|
+
filter: {
|
|
74
|
+
'project.id': { $eq: project.id },
|
|
75
|
+
'about.orderNumber': { $exists: true, $eq: orderNumber }
|
|
76
|
+
}
|
|
77
|
+
},
|
|
78
|
+
{
|
|
79
|
+
identifier: 'byInstrument',
|
|
80
|
+
filter: {
|
|
81
|
+
'project.id': { $eq: project.id },
|
|
82
|
+
'instrument.orderNumber': { $exists: true, $eq: orderNumber }
|
|
83
|
+
}
|
|
84
|
+
},
|
|
85
|
+
];
|
|
86
|
+
return Promise.all(filters.map(async ({ identifier, filter }) => {
|
|
87
|
+
return this.actionModel.deleteMany(filter)
|
|
88
|
+
.exec()
|
|
89
|
+
.then((result) => {
|
|
90
|
+
return {
|
|
91
|
+
identifier,
|
|
92
|
+
// n: result?.n,
|
|
93
|
+
// opTime: result.opTime,
|
|
94
|
+
// ok: result?.ok,
|
|
95
|
+
// operationTime,
|
|
96
|
+
deletedCount: result?.deletedCount
|
|
97
|
+
};
|
|
98
|
+
});
|
|
99
|
+
}));
|
|
100
|
+
}
|
|
101
|
+
async deleteByProject(params) {
|
|
102
|
+
await this.actionModel.deleteMany({
|
|
103
|
+
'project.id': { $eq: params.project.id }
|
|
104
|
+
})
|
|
105
|
+
.exec();
|
|
106
|
+
}
|
|
107
|
+
/**
|
|
108
|
+
* 取引からアクションを削除する
|
|
109
|
+
*/
|
|
110
|
+
async deleteActionsByTransactionId(params) {
|
|
111
|
+
const { project, transaction } = params;
|
|
112
|
+
if (typeof project.id !== 'string' || project.id === '') {
|
|
113
|
+
throw new factory_1.factory.errors.ArgumentNull('project.id');
|
|
114
|
+
}
|
|
115
|
+
if (typeof transaction.id !== 'string' || transaction.id === '') {
|
|
116
|
+
throw new factory_1.factory.errors.ArgumentNull('transaction.id ');
|
|
117
|
+
}
|
|
118
|
+
const filters = [
|
|
119
|
+
{
|
|
120
|
+
identifier: 'byPurpose',
|
|
121
|
+
filter: {
|
|
122
|
+
'project.id': { $eq: project.id },
|
|
123
|
+
typeOf: { $in: params.typeOf.$in },
|
|
124
|
+
'purpose.id': { $exists: true, $eq: transaction.id },
|
|
125
|
+
'purpose.typeOf': { $exists: true, $eq: transaction.typeOf }
|
|
126
|
+
}
|
|
127
|
+
},
|
|
128
|
+
// instrumentによるアクション削除にも対応(2026-07-10~)
|
|
129
|
+
{
|
|
130
|
+
identifier: 'byInstrument',
|
|
131
|
+
filter: {
|
|
132
|
+
'project.id': { $eq: project.id },
|
|
133
|
+
// typeOf: { $in: params.typeOf.$in }, // typOfでフィルターしない
|
|
134
|
+
'instrument.id': { $exists: true, $eq: transaction.id },
|
|
135
|
+
'instrument.typeOf': { $exists: true, $eq: transaction.typeOf }
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
];
|
|
139
|
+
return Promise.all(filters.map(async ({ identifier, filter }) => {
|
|
140
|
+
return this.actionModel.deleteMany(filter)
|
|
141
|
+
.exec()
|
|
142
|
+
.then((result) => {
|
|
143
|
+
return {
|
|
144
|
+
identifier,
|
|
145
|
+
// n: result?.n,
|
|
146
|
+
// opTime: result.opTime,
|
|
147
|
+
// ok: result?.ok,
|
|
148
|
+
// operationTime,
|
|
149
|
+
deletedCount: result?.deletedCount
|
|
150
|
+
};
|
|
151
|
+
});
|
|
152
|
+
}));
|
|
153
|
+
}
|
|
154
|
+
getCursor(conditions, projection) {
|
|
155
|
+
return this.actionModel.find(conditions, projection)
|
|
156
|
+
.sort({ startDate: factory_1.factory.sortType.Descending })
|
|
157
|
+
.cursor();
|
|
158
|
+
}
|
|
159
|
+
async unsetUnnecessaryFields(params) {
|
|
160
|
+
return this.actionModel.updateMany(params.filter, { $unset: params.$unset }, { timestamps: false })
|
|
161
|
+
.exec();
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
exports.AdminActionRepo = AdminActionRepo;
|
|
@@ -1,9 +1,7 @@
|
|
|
1
1
|
import { IndexDefinition, IndexOptions, Model, Schema, SchemaDefinition } from 'mongoose';
|
|
2
2
|
import { IVirtuals } from '../virtuals';
|
|
3
3
|
import { factory } from '../../../factory';
|
|
4
|
-
type IDocType = Omit<factory.action.IAction<factory.action.IAttributes<factory.actionType, any, any>>, 'id' | 'replacer'
|
|
5
|
-
identifier?: string;
|
|
6
|
-
};
|
|
4
|
+
type IDocType = Omit<factory.action.IAction<factory.action.IAttributes<factory.actionType, any, any>>, 'id' | 'replacer'>;
|
|
7
5
|
type IModel = Model<IDocType, Record<string, never>, Record<string, never>, IVirtuals>;
|
|
8
6
|
type ISchemaDefinition = SchemaDefinition<IDocType>;
|
|
9
7
|
type ISchema = Schema<IDocType, IModel, Record<string, never>, Record<string, never>, IVirtuals, Record<string, never>, ISchemaDefinition, IDocType>;
|
|
@@ -21,18 +21,15 @@ const schemaDefinition = {
|
|
|
21
21
|
endDate: Date,
|
|
22
22
|
purpose: mongoose_1.SchemaTypes.Mixed,
|
|
23
23
|
potentialActions: mongoose_1.SchemaTypes.Mixed,
|
|
24
|
-
// amount: SchemaTypes.Mixed, // discontinue(2026-07-08~)
|
|
25
|
-
// fromLocation: SchemaTypes.Mixed, // discontinue(2026-07-08~)
|
|
26
|
-
// toLocation: SchemaTypes.Mixed, // discontinue(2026-07-08~)
|
|
27
24
|
instrument: mongoose_1.SchemaTypes.Mixed,
|
|
28
25
|
location: mongoose_1.SchemaTypes.Mixed, // add location(2022-11-11~)
|
|
29
|
-
// replacer: SchemaTypes.Mixed, // add replacer(2024-03-19~)
|
|
30
|
-
targetCollection: mongoose_1.SchemaTypes.Mixed, // add targetCollection(2024-03-19~)
|
|
31
26
|
sameAs: mongoose_1.SchemaTypes.Mixed, // タスク関連付けのために追加(2024-04-20~)
|
|
32
27
|
cancelAction: mongoose_1.SchemaTypes.Mixed, // add(2024-05-26~)
|
|
33
28
|
about: mongoose_1.SchemaTypes.Mixed, // add(2025-01-22~)
|
|
34
|
-
|
|
35
|
-
|
|
29
|
+
identifier: mongoose_1.SchemaTypes.Mixed, // add(2025-02-06~)
|
|
30
|
+
// replacer: SchemaTypes.Mixed, // discontinue(2026-08-15~)
|
|
31
|
+
// targetCollection: SchemaTypes.Mixed, // discontinue(2026-08-15~)
|
|
32
|
+
// target: SchemaTypes.Mixed, // discontinue(2026-08-15~)
|
|
36
33
|
};
|
|
37
34
|
const schemaOptions = {
|
|
38
35
|
autoIndex: settings_1.MONGO_AUTO_INDEX,
|
|
@@ -12,7 +12,6 @@ import type { AuthorizeOfferActionRepo } from './repo/action/authorizeOffer';
|
|
|
12
12
|
import type { AuthorizePaymentMethodActionRepo } from './repo/action/authorizePaymentMethod';
|
|
13
13
|
import type { AuthorizeTicketedObjectActionRepo } from './repo/action/authorizeTicketedObject';
|
|
14
14
|
import type { CheckMovieTicketActionRepo } from './repo/action/checkMovieTicket';
|
|
15
|
-
import type { CheckThingActionRepo } from './repo/action/checkThing';
|
|
16
15
|
import type { InformActionRepo } from './repo/action/inform';
|
|
17
16
|
import type { PayActionRepo } from './repo/action/pay';
|
|
18
17
|
import type { RefundActionRepo } from './repo/action/refund';
|
|
@@ -20,6 +19,7 @@ import type { UpdateActionRepo } from './repo/action/update';
|
|
|
20
19
|
import type { UseActionRepo } from './repo/action/use';
|
|
21
20
|
import type { AsyncActionRepo } from './repo/asyncAction';
|
|
22
21
|
import type { AdditionalPropertyRepo } from './repo/additionalProperty';
|
|
22
|
+
import type { AdminActionRepo } from './repo/adminAction';
|
|
23
23
|
import type { AdminAssetTransactionRepo } from './repo/adminAssetTransaction';
|
|
24
24
|
import type { AdminAsyncActionRepo } from './repo/adminAsyncAction';
|
|
25
25
|
import type { AdminScheduledTaskRepo } from './repo/adminScheduledTask';
|
|
@@ -156,10 +156,6 @@ export declare namespace action {
|
|
|
156
156
|
namespace CheckMovieTicket {
|
|
157
157
|
function createInstance(...params: ConstructorParameters<typeof CheckMovieTicketActionRepo>): Promise<CheckMovieTicketActionRepo>;
|
|
158
158
|
}
|
|
159
|
-
type CheckThing = CheckThingActionRepo;
|
|
160
|
-
namespace CheckThing {
|
|
161
|
-
function createInstance(...params: ConstructorParameters<typeof CheckThingActionRepo>): Promise<CheckThingActionRepo>;
|
|
162
|
-
}
|
|
163
159
|
type Pay = PayActionRepo;
|
|
164
160
|
namespace Pay {
|
|
165
161
|
function createInstance(...params: ConstructorParameters<typeof PayActionRepo>): Promise<PayActionRepo>;
|
|
@@ -185,6 +181,10 @@ export type AdditionalProperty = AdditionalPropertyRepo;
|
|
|
185
181
|
export declare namespace AdditionalProperty {
|
|
186
182
|
function createInstance(...params: ConstructorParameters<typeof AdditionalPropertyRepo>): Promise<AdditionalPropertyRepo>;
|
|
187
183
|
}
|
|
184
|
+
export type AdminAction = AdminActionRepo;
|
|
185
|
+
export declare namespace AdminAction {
|
|
186
|
+
function createInstance(...params: ConstructorParameters<typeof AdminActionRepo>): Promise<AdminActionRepo>;
|
|
187
|
+
}
|
|
188
188
|
export type AdminAssetTransaction = AdminAssetTransactionRepo;
|
|
189
189
|
export declare namespace AdminAssetTransaction {
|
|
190
190
|
function createInstance(...params: ConstructorParameters<typeof AdminAssetTransactionRepo>): Promise<AdminAssetTransactionRepo>;
|
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.TaskDelayed = 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 = exports.PendingReservation = exports.PaymentServiceProvider = exports.PaymentServiceChannel = exports.PaymentService = exports.Passport = exports.OrderNumber = exports.OrderInTransaction = void 0;
|
|
3
|
+
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.AggregateAssetTransaction = exports.AggregateTransaction = exports.AggregateTask = exports.AggregateScheduledTask = exports.AggregateUseAction = exports.AggregateAction = exports.AdminTransaction = exports.AdminTask = exports.AdminScheduledTask = exports.AdminAsyncAction = exports.AdminAssetTransaction = exports.AdminAction = 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.AsyncAction = exports.TaskDelayed = 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 = exports.PendingReservation = exports.PaymentServiceProvider = exports.PaymentServiceChannel = exports.PaymentService = exports.Passport = exports.OrderNumber = exports.OrderInTransaction = exports.Order = void 0;
|
|
5
5
|
var AcceptedOffer;
|
|
6
6
|
(function (AcceptedOffer) {
|
|
7
7
|
let repo;
|
|
@@ -125,17 +125,6 @@ var action;
|
|
|
125
125
|
}
|
|
126
126
|
CheckMovieTicket.createInstance = createInstance;
|
|
127
127
|
})(CheckMovieTicket = action.CheckMovieTicket || (action.CheckMovieTicket = {}));
|
|
128
|
-
let CheckThing;
|
|
129
|
-
(function (CheckThing) {
|
|
130
|
-
let repo;
|
|
131
|
-
async function createInstance(...params) {
|
|
132
|
-
if (repo === undefined) {
|
|
133
|
-
repo = (await import('./repo/action/checkThing.js')).CheckThingActionRepo;
|
|
134
|
-
}
|
|
135
|
-
return new repo(...params);
|
|
136
|
-
}
|
|
137
|
-
CheckThing.createInstance = createInstance;
|
|
138
|
-
})(CheckThing = action.CheckThing || (action.CheckThing = {}));
|
|
139
128
|
let Pay;
|
|
140
129
|
(function (Pay) {
|
|
141
130
|
let repo;
|
|
@@ -203,6 +192,17 @@ var AdditionalProperty;
|
|
|
203
192
|
}
|
|
204
193
|
AdditionalProperty.createInstance = createInstance;
|
|
205
194
|
})(AdditionalProperty || (exports.AdditionalProperty = AdditionalProperty = {}));
|
|
195
|
+
var AdminAction;
|
|
196
|
+
(function (AdminAction) {
|
|
197
|
+
let repo;
|
|
198
|
+
async function createInstance(...params) {
|
|
199
|
+
if (repo === undefined) {
|
|
200
|
+
repo = (await import('./repo/adminAction.js')).AdminActionRepo;
|
|
201
|
+
}
|
|
202
|
+
return new repo(...params);
|
|
203
|
+
}
|
|
204
|
+
AdminAction.createInstance = createInstance;
|
|
205
|
+
})(AdminAction || (exports.AdminAction = AdminAction = {}));
|
|
206
206
|
var AdminAssetTransaction;
|
|
207
207
|
(function (AdminAssetTransaction) {
|
|
208
208
|
let repo;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { AcceptedOfferRepo } from '../../repo/acceptedOffer';
|
|
2
2
|
import type { AccountingReportRepo } from '../../repo/accountingReport';
|
|
3
|
-
import type { IDeleteActionResult,
|
|
3
|
+
import type { IDeleteActionResult, AdminActionRepo } from '../../repo/adminAction';
|
|
4
4
|
import type { NoteRepo } from '../../repo/note';
|
|
5
5
|
import type { OrderRepo } from '../../repo/order';
|
|
6
6
|
import type { ReservationRepo } from '../../repo/reservation';
|
|
@@ -18,7 +18,7 @@ declare function deleteOrder(params: {
|
|
|
18
18
|
}): (repos: {
|
|
19
19
|
acceptedOffer: AcceptedOfferRepo;
|
|
20
20
|
accountingReport: AccountingReportRepo;
|
|
21
|
-
|
|
21
|
+
adminAction: AdminActionRepo;
|
|
22
22
|
note: NoteRepo;
|
|
23
23
|
order: OrderRepo;
|
|
24
24
|
reservation: ReservationRepo;
|
|
@@ -44,7 +44,7 @@ function deleteOrder(params) {
|
|
|
44
44
|
}
|
|
45
45
|
});
|
|
46
46
|
// アクション削除(2026-07-10~)
|
|
47
|
-
deleteActionsResult = await repos.
|
|
47
|
+
deleteActionsResult = await repos.adminAction.deleteActionsByOrderNumber({
|
|
48
48
|
orderNumber: order.orderNumber,
|
|
49
49
|
project: { id: order.project.id },
|
|
50
50
|
});
|
|
@@ -134,9 +134,7 @@ function createCheckResourceTask(order) {
|
|
|
134
134
|
object: {
|
|
135
135
|
orderNumber: order.orderNumber,
|
|
136
136
|
typeOf: order.typeOf
|
|
137
|
-
}
|
|
138
|
-
// project: order.project,
|
|
139
|
-
typeOf: factory_1.factory.actionType.CheckAction
|
|
137
|
+
}
|
|
140
138
|
};
|
|
141
139
|
const taskIdentifier = (0, util_1.format)('%s:%s:%s:%s', order.project.id, factory_1.factory.taskName.CheckResource, order.typeOf, order.orderNumber);
|
|
142
140
|
return {
|
|
@@ -2,7 +2,6 @@
|
|
|
2
2
|
* プロジェクトサービス
|
|
3
3
|
*/
|
|
4
4
|
import type { AccountTitleRepo } from '../repo/accountTitle';
|
|
5
|
-
import type { ActionRepo } from '../repo/action';
|
|
6
5
|
import type { AssetTransactionRepo } from '../repo/assetTransaction';
|
|
7
6
|
import type { CategoryCodeRepo } from '../repo/categoryCode';
|
|
8
7
|
import type { CreativeWorkRepo } from '../repo/creativeWork';
|
|
@@ -22,7 +21,6 @@ export declare function deleteProject(params: {
|
|
|
22
21
|
id: string;
|
|
23
22
|
}): (repos: {
|
|
24
23
|
accountTitle: AccountTitleRepo;
|
|
25
|
-
action: ActionRepo;
|
|
26
24
|
categoryCode: CategoryCodeRepo;
|
|
27
25
|
creativeWork: CreativeWorkRepo;
|
|
28
26
|
event: EventRepo;
|
|
@@ -43,7 +41,6 @@ export declare function cleanUpDatabaseByProject(params: {
|
|
|
43
41
|
id: string;
|
|
44
42
|
}): (repos: {
|
|
45
43
|
accountTitle: AccountTitleRepo;
|
|
46
|
-
action: ActionRepo;
|
|
47
44
|
assetTransaction: AssetTransactionRepo;
|
|
48
45
|
categoryCode: CategoryCodeRepo;
|
|
49
46
|
creativeWork: CreativeWorkRepo;
|
|
@@ -13,7 +13,6 @@ function cleanUpDatabaseByProject(params) {
|
|
|
13
13
|
return async (repos) => {
|
|
14
14
|
// プロジェクトに所属する全データをリポジトリから削除する
|
|
15
15
|
await repos.accountTitle.deleteByProject({ project: { id: params.id } });
|
|
16
|
-
await repos.action.deleteByProject({ project: { id: params.id } });
|
|
17
16
|
await repos.assetTransaction.deleteByProject({ project: { id: params.id } });
|
|
18
17
|
await repos.categoryCode.deleteCategoryCodesByProject({ project: { id: params.id } });
|
|
19
18
|
await repos.movieTicketType.deleteMovieTicketTypesByProject({ project: { id: params.id } });
|
|
@@ -3,72 +3,29 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.call = call;
|
|
4
4
|
const factory_1 = require("../../factory");
|
|
5
5
|
const acceptedOffer_1 = require("../../repo/acceptedOffer");
|
|
6
|
-
const checkThing_1 = require("../../repo/action/checkThing");
|
|
7
6
|
const assetTransaction_1 = require("../../repo/assetTransaction");
|
|
8
|
-
const event_1 = require("../../repo/event");
|
|
9
7
|
const order_1 = require("../../repo/order");
|
|
10
|
-
const setting_1 = require("../../repo/setting");
|
|
11
|
-
const stockHolder_1 = require("../../repo/stockHolder");
|
|
12
|
-
const task_1 = require("../../repo/task");
|
|
13
|
-
const validateEvent_1 = require("../validation/validateEvent");
|
|
14
8
|
const validateOrder_1 = require("../validation/validateOrder");
|
|
15
9
|
/**
|
|
16
10
|
* タスク実行関数
|
|
17
11
|
*/
|
|
18
12
|
function call(params) {
|
|
19
|
-
return async ({ connection
|
|
20
|
-
if (redisClient === undefined) {
|
|
21
|
-
throw new factory_1.factory.errors.Argument('settings', 'redisClient required');
|
|
22
|
-
}
|
|
23
|
-
const actionRepo = new checkThing_1.CheckThingActionRepo(connection);
|
|
13
|
+
return async ({ connection }) => {
|
|
24
14
|
const { data } = params;
|
|
25
|
-
const actionAttributes = {
|
|
26
|
-
agent: { id: params.project.id, typeOf: factory_1.factory.organizationType.Project },
|
|
27
|
-
object: data.object,
|
|
28
|
-
project: { id: params.project.id, typeOf: factory_1.factory.organizationType.Project },
|
|
29
|
-
typeOf: factory_1.factory.actionType.CheckAction,
|
|
30
|
-
sameAs: { id: params.id, typeOf: 'Task' } // add sameAs(2025-09-22~)
|
|
31
|
-
};
|
|
32
|
-
const action = await actionRepo.start(actionAttributes);
|
|
33
15
|
const objectTypeOf = data.object.typeOf;
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
break;
|
|
48
|
-
// support ScreeningEvent(2025-05-01~)
|
|
49
|
-
case factory_1.factory.eventType.ScreeningEvent:
|
|
50
|
-
await (0, validateEvent_1.validateEvent)({
|
|
51
|
-
id: data.object.id,
|
|
52
|
-
project: { id: params.project.id }
|
|
53
|
-
})({
|
|
54
|
-
event: new event_1.EventRepo(connection),
|
|
55
|
-
stockHolder: new stockHolder_1.StockHolderRepo({ connection })
|
|
56
|
-
});
|
|
57
|
-
break;
|
|
58
|
-
default:
|
|
59
|
-
throw new factory_1.factory.errors.NotImplemented(`${objectTypeOf} not implemented`);
|
|
60
|
-
}
|
|
61
|
-
}
|
|
62
|
-
catch (error) {
|
|
63
|
-
try {
|
|
64
|
-
await actionRepo.giveUp({ typeOf: action.typeOf, id: action.id, error });
|
|
65
|
-
}
|
|
66
|
-
catch (__) {
|
|
67
|
-
// 失敗したら仕方ない
|
|
68
|
-
}
|
|
69
|
-
throw error;
|
|
16
|
+
switch (objectTypeOf) {
|
|
17
|
+
case factory_1.factory.order.OrderType.Order:
|
|
18
|
+
await (0, validateOrder_1.validateOrder)({
|
|
19
|
+
orderNumber: data.object.orderNumber,
|
|
20
|
+
project: { id: params.project.id }
|
|
21
|
+
})({
|
|
22
|
+
acceptedOffer: new acceptedOffer_1.AcceptedOfferRepo(connection),
|
|
23
|
+
assetTransaction: new assetTransaction_1.AssetTransactionRepo(connection),
|
|
24
|
+
order: new order_1.OrderRepo(connection),
|
|
25
|
+
});
|
|
26
|
+
break;
|
|
27
|
+
default:
|
|
28
|
+
throw new factory_1.factory.errors.NotImplemented(`${objectTypeOf} not implemented`);
|
|
70
29
|
}
|
|
71
|
-
const actionResult = {}; // eslint-disable-line @typescript-eslint/no-explicit-any
|
|
72
|
-
await actionRepo.completeWithVoid({ typeOf: action.typeOf, id: action.id, result: actionResult });
|
|
73
30
|
};
|
|
74
31
|
}
|
|
@@ -3,8 +3,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.call = call;
|
|
4
4
|
const acceptedOffer_1 = require("../../repo/acceptedOffer");
|
|
5
5
|
const accountingReport_1 = require("../../repo/accountingReport");
|
|
6
|
-
const action_1 = require("../../repo/action");
|
|
7
6
|
const update_1 = require("../../repo/action/update");
|
|
7
|
+
const adminAction_1 = require("../../repo/adminAction");
|
|
8
8
|
const adminTransaction_1 = require("../../repo/adminTransaction");
|
|
9
9
|
const assetTransaction_1 = require("../../repo/assetTransaction");
|
|
10
10
|
const note_1 = require("../../repo/note");
|
|
@@ -22,10 +22,10 @@ function call(params) {
|
|
|
22
22
|
await (0, transaction_1.deleteTransaction)(data)({
|
|
23
23
|
acceptedOffer: new acceptedOffer_1.AcceptedOfferRepo(connection),
|
|
24
24
|
accountingReport: new accountingReport_1.AccountingReportRepo(connection),
|
|
25
|
-
action: new action_1.ActionRepo(connection),
|
|
26
25
|
actions: {
|
|
27
26
|
update: new update_1.UpdateActionRepo(connection),
|
|
28
27
|
},
|
|
28
|
+
adminAction: new adminAction_1.AdminActionRepo(connection),
|
|
29
29
|
adminTransaction: new adminTransaction_1.AdminTransactionRepo(connection),
|
|
30
30
|
assetTransaction: new assetTransaction_1.AssetTransactionRepo(connection),
|
|
31
31
|
note: new note_1.NoteRepo(connection),
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { factory } from '../../factory';
|
|
2
2
|
import type { AcceptedOfferRepo } from '../../repo/acceptedOffer';
|
|
3
3
|
import type { AccountingReportRepo } from '../../repo/accountingReport';
|
|
4
|
-
import type { ActionRepo } from '../../repo/action';
|
|
5
4
|
import type { UpdateActionRepo } from '../../repo/action/update';
|
|
5
|
+
import type { AdminActionRepo } from '../../repo/adminAction';
|
|
6
6
|
import type { AdminTransactionRepo } from '../../repo/adminTransaction';
|
|
7
7
|
import type { AssetTransactionRepo } from '../../repo/assetTransaction';
|
|
8
8
|
import type { NoteRepo } from '../../repo/note';
|
|
@@ -13,10 +13,10 @@ import type { ReturnOrderRepo } from '../../repo/transaction/returnOrder';
|
|
|
13
13
|
interface IDeleteTransactionRepos {
|
|
14
14
|
acceptedOffer: AcceptedOfferRepo;
|
|
15
15
|
accountingReport: AccountingReportRepo;
|
|
16
|
-
action: ActionRepo;
|
|
17
16
|
actions: {
|
|
18
17
|
update: UpdateActionRepo;
|
|
19
18
|
};
|
|
19
|
+
adminAction: AdminActionRepo;
|
|
20
20
|
adminTransaction: AdminTransactionRepo;
|
|
21
21
|
assetTransaction: AssetTransactionRepo;
|
|
22
22
|
note: NoteRepo;
|
|
@@ -77,7 +77,7 @@ function deleteTransactionById(params) {
|
|
|
77
77
|
switch (transactionTypeOf) {
|
|
78
78
|
case factory_1.factory.transactionType.PlaceOrder: {
|
|
79
79
|
// 取引に対する全ての承認アクションを検索
|
|
80
|
-
const authorizeActions = await repos.
|
|
80
|
+
const authorizeActions = await repos.adminAction.searchByPurpose({
|
|
81
81
|
typeOf: factory_1.factory.actionType.AuthorizeAction,
|
|
82
82
|
purpose: {
|
|
83
83
|
typeOf: transactionTypeOf,
|
|
@@ -111,7 +111,7 @@ function deleteTransactionById(params) {
|
|
|
111
111
|
deleteReservationsByPlaceOrderResult.deleteCancelReservationTransactionResult;
|
|
112
112
|
deletedReservationNumbers = deleteReservationsByPlaceOrderResult.reserveTransactionNumbers;
|
|
113
113
|
// アクション削除(2023-05-19~)
|
|
114
|
-
deleteActionResult = await repos.
|
|
114
|
+
deleteActionResult = await repos.adminAction.deleteActionsByTransactionId({
|
|
115
115
|
project: { id: transaction.project.id },
|
|
116
116
|
transaction: { id: transaction.id, typeOf: transactionTypeOf },
|
|
117
117
|
typeOf: {
|
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
import type { AcceptedOfferRepo } from '../../repo/acceptedOffer';
|
|
2
2
|
import type { AssetTransactionRepo } from '../../repo/assetTransaction';
|
|
3
3
|
import type { OrderRepo } from '../../repo/order';
|
|
4
|
-
import type { SettingRepo } from '../../repo/setting';
|
|
5
|
-
import type { TaskRepo } from '../../repo/task';
|
|
6
4
|
export declare function validateOrder(params: {
|
|
7
5
|
orderNumber: string;
|
|
8
6
|
project: {
|
|
@@ -12,6 +10,4 @@ export declare function validateOrder(params: {
|
|
|
12
10
|
acceptedOffer: AcceptedOfferRepo;
|
|
13
11
|
assetTransaction: AssetTransactionRepo;
|
|
14
12
|
order: OrderRepo;
|
|
15
|
-
setting: SettingRepo;
|
|
16
|
-
task: TaskRepo;
|
|
17
13
|
}) => Promise<void>;
|
|
@@ -6,9 +6,9 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
6
6
|
exports.validateOrder = validateOrder;
|
|
7
7
|
// import createDebug from 'debug';
|
|
8
8
|
const moment_1 = __importDefault(require("moment"));
|
|
9
|
+
// import type { SettingRepo } from '../../repo/setting';
|
|
9
10
|
const factory_1 = require("../../factory");
|
|
10
11
|
const factory_2 = require("../offer/event/authorize/factory");
|
|
11
|
-
// import { acceptedOffers2amount as acceptedOffers2amount4product } from '../offer/product/factory';
|
|
12
12
|
const validateMovieTicket_1 = require("../transaction/placeOrder/confirm/validation/validateMovieTicket");
|
|
13
13
|
function validateOrder(params) {
|
|
14
14
|
return async (repos) => {
|
package/package.json
CHANGED
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
"dependencies": {
|
|
12
12
|
"@aws-sdk/client-cognito-identity-provider": "3.1090.0",
|
|
13
13
|
"@aws-sdk/credential-providers": "3.1090.0",
|
|
14
|
-
"@chevre/factory": "10.3.0-alpha.
|
|
14
|
+
"@chevre/factory": "10.3.0-alpha.9",
|
|
15
15
|
"@motionpicture/coa-service": "10.0.0",
|
|
16
16
|
"@motionpicture/gmo-service": "6.1.0-alpha.0",
|
|
17
17
|
"@sendgrid/client": "8.1.4",
|
|
@@ -88,5 +88,5 @@
|
|
|
88
88
|
"postversion": "git push origin --tags",
|
|
89
89
|
"prepublishOnly": "npm run clean && npm run build"
|
|
90
90
|
},
|
|
91
|
-
"version": "26.0.0-alpha.
|
|
91
|
+
"version": "26.0.0-alpha.35"
|
|
92
92
|
}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { factory } from '../../factory';
|
|
2
|
-
import { ActionProcessRepo } from './actionProcess';
|
|
3
|
-
export type ICheckThingAction = factory.action.check.thing.IAction;
|
|
4
|
-
/**
|
|
5
|
-
* 汎用リソース検証アクションリポジトリ
|
|
6
|
-
*/
|
|
7
|
-
export declare class CheckThingActionRepo extends ActionProcessRepo<ICheckThingAction, never> {
|
|
8
|
-
}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.CheckThingActionRepo = void 0;
|
|
4
|
-
// import { MONGO_MAX_TIME_MS } from '../settings';
|
|
5
|
-
// import { createSchema, IModel as IActionModel, modelName } from './mongoose/schemas/action';
|
|
6
|
-
// import { createSchema as createRecipeSchema, IModel as IActionRecipeModel, modelName as recipeModelName } from './mongoose/schemas/actionRecipe';
|
|
7
|
-
const actionProcess_1 = require("./actionProcess");
|
|
8
|
-
/**
|
|
9
|
-
* 汎用リソース検証アクションリポジトリ
|
|
10
|
-
*/
|
|
11
|
-
class CheckThingActionRepo extends actionProcess_1.ActionProcessRepo {
|
|
12
|
-
}
|
|
13
|
-
exports.CheckThingActionRepo = CheckThingActionRepo;
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import { IndexDefinition, IndexOptions, Model, Schema, SchemaDefinition } from 'mongoose';
|
|
2
|
-
import { factory } from '../../../factory';
|
|
3
|
-
import { IVirtuals } from '../virtuals';
|
|
4
|
-
interface IAggregateReservation {
|
|
5
|
-
project: {
|
|
6
|
-
id: string;
|
|
7
|
-
typeOf: factory.organizationType.Project;
|
|
8
|
-
};
|
|
9
|
-
typeOf: 'AggregateReservation';
|
|
10
|
-
reservationCount: number;
|
|
11
|
-
reservationFor: {
|
|
12
|
-
id: string;
|
|
13
|
-
startDate: Date;
|
|
14
|
-
};
|
|
15
|
-
reservationIds: string[];
|
|
16
|
-
expires: Date;
|
|
17
|
-
}
|
|
18
|
-
type IDocType = IAggregateReservation;
|
|
19
|
-
type IModel = Model<IDocType, Record<string, never>, Record<string, never>, IVirtuals>;
|
|
20
|
-
type ISchemaDefinition = SchemaDefinition<IDocType>;
|
|
21
|
-
type ISchema = Schema<IDocType, IModel, Record<string, never>, Record<string, never>, IVirtuals, Record<string, never>, ISchemaDefinition, IDocType>;
|
|
22
|
-
declare const modelName = "PendingReservationAggregate";
|
|
23
|
-
declare const indexes: [d: IndexDefinition, o: IndexOptions][];
|
|
24
|
-
declare function createSchema(): ISchema;
|
|
25
|
-
export { createSchema, IDocType, IModel, IAggregateReservation, indexes, modelName };
|
|
@@ -1,100 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.modelName = exports.indexes = void 0;
|
|
4
|
-
exports.createSchema = createSchema;
|
|
5
|
-
const mongoose_1 = require("mongoose");
|
|
6
|
-
const settings_1 = require("../../../settings");
|
|
7
|
-
const writeConcern_1 = require("../writeConcern");
|
|
8
|
-
const modelName = 'PendingReservationAggregate';
|
|
9
|
-
exports.modelName = modelName;
|
|
10
|
-
const schemaDefinition = {
|
|
11
|
-
project: { type: mongoose_1.SchemaTypes.Mixed, required: true },
|
|
12
|
-
typeOf: { type: String, required: true },
|
|
13
|
-
expires: { type: Date, required: true },
|
|
14
|
-
reservationCount: { type: Number, required: true },
|
|
15
|
-
reservationFor: { type: mongoose_1.SchemaTypes.Mixed, required: true },
|
|
16
|
-
reservationIds: [mongoose_1.SchemaTypes.Mixed]
|
|
17
|
-
};
|
|
18
|
-
const schemaOptions = {
|
|
19
|
-
autoIndex: settings_1.MONGO_AUTO_INDEX,
|
|
20
|
-
autoCreate: false,
|
|
21
|
-
collection: 'pendingReservationAggregates',
|
|
22
|
-
id: true,
|
|
23
|
-
read: settings_1.MONGO_READ_PREFERENCE,
|
|
24
|
-
writeConcern: writeConcern_1.writeConcern,
|
|
25
|
-
strict: true,
|
|
26
|
-
strictQuery: false,
|
|
27
|
-
timestamps: false,
|
|
28
|
-
versionKey: false,
|
|
29
|
-
toJSON: {
|
|
30
|
-
getters: false,
|
|
31
|
-
virtuals: false,
|
|
32
|
-
minimize: false,
|
|
33
|
-
versionKey: false
|
|
34
|
-
},
|
|
35
|
-
toObject: {
|
|
36
|
-
getters: false,
|
|
37
|
-
virtuals: true,
|
|
38
|
-
minimize: false,
|
|
39
|
-
versionKey: false
|
|
40
|
-
}
|
|
41
|
-
};
|
|
42
|
-
const indexes = [
|
|
43
|
-
[
|
|
44
|
-
{ expires: -1 },
|
|
45
|
-
{ name: 'expires' }
|
|
46
|
-
],
|
|
47
|
-
// [
|
|
48
|
-
// { 'project.id': 1, expires: -1 },
|
|
49
|
-
// { name: 'projectId' }
|
|
50
|
-
// ],
|
|
51
|
-
// [
|
|
52
|
-
// { 'reservationFor.id': 1, expires: -1 },
|
|
53
|
-
// { name: 'reservationForId' }
|
|
54
|
-
// ],
|
|
55
|
-
// [
|
|
56
|
-
// { reservationIds: 1, expires: -1 },
|
|
57
|
-
// { name: 'reservationIds' }
|
|
58
|
-
// ], // このindexで性能下がる?
|
|
59
|
-
// [
|
|
60
|
-
// { reservationIds: 1 },
|
|
61
|
-
// { name: 'reservationIds' }
|
|
62
|
-
// ], // このindexで性能下がる?
|
|
63
|
-
[
|
|
64
|
-
{ 'reservationFor.id': 1 },
|
|
65
|
-
{
|
|
66
|
-
unique: true,
|
|
67
|
-
name: 'uniqueReservationForId'
|
|
68
|
-
}
|
|
69
|
-
],
|
|
70
|
-
[
|
|
71
|
-
{
|
|
72
|
-
'reservationFor.id': 1,
|
|
73
|
-
reservationCount: 1
|
|
74
|
-
},
|
|
75
|
-
{ name: 'increaseReservationCount' }
|
|
76
|
-
],
|
|
77
|
-
[
|
|
78
|
-
{
|
|
79
|
-
'reservationFor.id': 1,
|
|
80
|
-
reservationIds: 1
|
|
81
|
-
},
|
|
82
|
-
{ name: 'decreaseReservationCount' }
|
|
83
|
-
]
|
|
84
|
-
];
|
|
85
|
-
exports.indexes = indexes;
|
|
86
|
-
/**
|
|
87
|
-
* 保留予約集計スキーマ
|
|
88
|
-
*/
|
|
89
|
-
let schema;
|
|
90
|
-
function createSchema() {
|
|
91
|
-
if (schema === undefined) {
|
|
92
|
-
schema = new mongoose_1.Schema(schemaDefinition, schemaOptions);
|
|
93
|
-
if (settings_1.MONGO_AUTO_INDEX) {
|
|
94
|
-
indexes.forEach((indexParams) => {
|
|
95
|
-
schema?.index(...indexParams);
|
|
96
|
-
});
|
|
97
|
-
}
|
|
98
|
-
}
|
|
99
|
-
return schema;
|
|
100
|
-
}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import type { EventRepo } from '../../repo/event';
|
|
2
|
-
import type { StockHolderRepo } from '../../repo/stockHolder';
|
|
3
|
-
export declare function validateEvent(__: {
|
|
4
|
-
id: string;
|
|
5
|
-
project: {
|
|
6
|
-
id: string;
|
|
7
|
-
};
|
|
8
|
-
}): (__2: {
|
|
9
|
-
event: EventRepo;
|
|
10
|
-
stockHolder: StockHolderRepo;
|
|
11
|
-
}) => Promise<void>;
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
// import createDebug from 'debug';
|
|
3
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
-
exports.validateEvent = validateEvent;
|
|
5
|
-
// import { factory } from '../../factory';
|
|
6
|
-
// const debug = createDebug('chevre-domain:service:validation');
|
|
7
|
-
function validateEvent(__) {
|
|
8
|
-
return async (__2) => {
|
|
9
|
-
// const event: Pick<factory.event.screeningEvent.IEvent, 'id' | 'startDate'> =
|
|
10
|
-
// await repos.event.projectEventFieldsById(
|
|
11
|
-
// { id: params.id },
|
|
12
|
-
// ['startDate']
|
|
13
|
-
// );
|
|
14
|
-
// discontinue redis(2025-08-17~)
|
|
15
|
-
// debug('validateEvent: conflicted?', params.project.id, event.id, event.startDate);
|
|
16
|
-
// await repos.stockHolder.checkIfConflicted({
|
|
17
|
-
// eventId: event.id,
|
|
18
|
-
// startDate: event.startDate
|
|
19
|
-
// });
|
|
20
|
-
};
|
|
21
|
-
}
|