@chevre/domain 26.0.0-alpha.32 → 26.0.0-alpha.34
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/inform.js +2 -8
- package/lib/chevre/repo/action/update.d.ts +2 -11
- package/lib/chevre/repo/action/use.d.ts +5 -8
- package/lib/chevre/repo/action/use.js +17 -10
- 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/inform.d.ts +1 -3
- package/lib/chevre/repo/mongoose/schemas/action/inform.js +0 -4
- package/lib/chevre/repo/mongoose/schemas/action/use.d.ts +1 -1
- package/lib/chevre/repo/mongoose/schemas/action/use.js +0 -1
- 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 -0
- package/lib/chevre/repository.js +13 -2
- package/lib/chevre/service/order/deleteOrder.d.ts +2 -2
- package/lib/chevre/service/order/deleteOrder.js +1 -1
- package/lib/chevre/service/project.d.ts +0 -3
- package/lib/chevre/service/project.js +0 -1
- package/lib/chevre/service/reserve/useReservation.js +1 -1
- 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/package.json +2 -2
|
@@ -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 ? (factory.action.check.paymentMethod.movieTicket.IAction | factory.action.check.thing.IAction) : T extends factory.actionType.CreateAction ? factory.action.create.IAction :
|
|
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 | factory.action.check.thing.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
|
* アクション状態管理リポジトリ
|
|
@@ -78,10 +78,7 @@ class InformActionRepo {
|
|
|
78
78
|
return { id, startDate, typeOf: creatingAction.typeOf };
|
|
79
79
|
}
|
|
80
80
|
async completeInformAction(params) {
|
|
81
|
-
const doc = await this.informActionModel.findOneAndUpdate({
|
|
82
|
-
_id: { $eq: params.id },
|
|
83
|
-
typeOf: { $eq: params.typeOf }
|
|
84
|
-
}, {
|
|
81
|
+
const doc = await this.informActionModel.findOneAndUpdate({ _id: { $eq: params.id } }, {
|
|
85
82
|
$set: {
|
|
86
83
|
actionStatus: factory_1.factory.actionStatusType.CompletedActionStatus,
|
|
87
84
|
result: params.result,
|
|
@@ -101,10 +98,7 @@ class InformActionRepo {
|
|
|
101
98
|
const actionError = Array.isArray(params.error)
|
|
102
99
|
? params.error.map(unknown2actionError_1.unknown2actionError)
|
|
103
100
|
: (0, unknown2actionError_1.unknown2actionError)(params.error);
|
|
104
|
-
const doc = await this.informActionModel.findOneAndUpdate({
|
|
105
|
-
typeOf: { $eq: params.typeOf },
|
|
106
|
-
_id: { $eq: params.id }
|
|
107
|
-
}, {
|
|
101
|
+
const doc = await this.informActionModel.findOneAndUpdate({ _id: { $eq: params.id } }, {
|
|
108
102
|
$set: {
|
|
109
103
|
actionStatus: factory_1.factory.actionStatusType.FailedActionStatus,
|
|
110
104
|
error: actionError,
|
|
@@ -4,23 +4,14 @@ import { IDocType } from '../mongoose/schemas/action/update';
|
|
|
4
4
|
type StartableActionType = factory.actionType.AddAction | factory.actionType.UpdateAction | factory.actionType.ReplaceAction | factory.actionType.DeleteAction;
|
|
5
5
|
type IAction<T extends StartableActionType> = T extends factory.actionType.AddAction ? factory.action.update.add.IAction : T extends factory.actionType.ReplaceAction ? factory.action.update.replace.IAction : T extends factory.actionType.UpdateAction ? factory.action.update.update.IAction : T extends factory.actionType.DeleteAction ? factory.action.update.deleteAction.IAction : never;
|
|
6
6
|
type IKeyOfProjection = keyof IDocType;
|
|
7
|
-
type IFindParams =
|
|
8
|
-
id?: string;
|
|
9
|
-
typeOf?: StartableActionType;
|
|
10
|
-
object?: {
|
|
11
|
-
id?: string;
|
|
12
|
-
};
|
|
13
|
-
result?: {
|
|
14
|
-
id?: string;
|
|
15
|
-
};
|
|
16
|
-
};
|
|
7
|
+
type IFindParams = factory.action.update.update.IFindParams;
|
|
17
8
|
/**
|
|
18
9
|
* リソース編集アクションリポジトリ
|
|
19
10
|
*/
|
|
20
11
|
export declare class UpdateActionRepo {
|
|
21
12
|
private readonly updateActionModel;
|
|
22
13
|
constructor(connection: Connection);
|
|
23
|
-
static CREATE_MONGO_CONDITIONS(params: IFindParams): FilterQuery<IDocType>[];
|
|
14
|
+
static CREATE_MONGO_CONDITIONS(params: Pick<IFindParams, 'id' | 'object' | 'project' | 'result' | 'startFrom' | 'startThrough' | 'typeOf'>): FilterQuery<IDocType>[];
|
|
24
15
|
/**
|
|
25
16
|
* アクション開始
|
|
26
17
|
*/
|
|
@@ -6,13 +6,7 @@ type IAction = IDocType & {
|
|
|
6
6
|
id: string;
|
|
7
7
|
};
|
|
8
8
|
type IKeyOfProjection = keyof IDocType;
|
|
9
|
-
type IFindParams =
|
|
10
|
-
actionStatus?: factory.actionStatusType;
|
|
11
|
-
id?: string;
|
|
12
|
-
object?: {
|
|
13
|
-
id?: string;
|
|
14
|
-
};
|
|
15
|
-
};
|
|
9
|
+
type IFindParams = factory.action.consume.use.reservation.IFindParams;
|
|
16
10
|
/**
|
|
17
11
|
* 予約使用アクションリポジトリ
|
|
18
12
|
*/
|
|
@@ -27,7 +21,6 @@ export declare class UseActionRepo {
|
|
|
27
21
|
completeUseAction(params: {
|
|
28
22
|
typeOf: StartableActionType;
|
|
29
23
|
id: string;
|
|
30
|
-
result: factory.action.consume.use.reservation.IResult;
|
|
31
24
|
}): Promise<void>;
|
|
32
25
|
/**
|
|
33
26
|
* アクション失敗
|
|
@@ -38,5 +31,9 @@ export declare class UseActionRepo {
|
|
|
38
31
|
error: Error | Error[] | unknown;
|
|
39
32
|
}): Promise<void>;
|
|
40
33
|
findUseActions(params: IFindParams, inclusion: IKeyOfProjection[]): Promise<IAction[]>;
|
|
34
|
+
/**
|
|
35
|
+
* 移行処理
|
|
36
|
+
*/
|
|
37
|
+
migrateUseAction(params: factory.action.consume.use.reservation.IAction): Promise<import("mongoose").UpdateWriteOpResult>;
|
|
41
38
|
}
|
|
42
39
|
export {};
|
|
@@ -10,7 +10,6 @@ const AVAILABLE_PROJECT_FIELDS = [
|
|
|
10
10
|
'actionStatus',
|
|
11
11
|
'typeOf',
|
|
12
12
|
'agent',
|
|
13
|
-
'result',
|
|
14
13
|
'error',
|
|
15
14
|
'object',
|
|
16
15
|
'startDate',
|
|
@@ -72,13 +71,10 @@ class UseActionRepo {
|
|
|
72
71
|
return { id, startDate, typeOf: creatingAction.typeOf };
|
|
73
72
|
}
|
|
74
73
|
async completeUseAction(params) {
|
|
75
|
-
const doc = await this.useActionModel.findOneAndUpdate({
|
|
76
|
-
_id: { $eq: params.id },
|
|
77
|
-
typeOf: { $eq: params.typeOf }
|
|
78
|
-
}, {
|
|
74
|
+
const doc = await this.useActionModel.findOneAndUpdate({ _id: { $eq: params.id } }, {
|
|
79
75
|
$set: {
|
|
80
76
|
actionStatus: factory_1.factory.actionStatusType.CompletedActionStatus,
|
|
81
|
-
result: params.result,
|
|
77
|
+
// result: params.result,
|
|
82
78
|
endDate: new Date()
|
|
83
79
|
}
|
|
84
80
|
}, { new: false, projection: { _id: 1 } })
|
|
@@ -95,10 +91,7 @@ class UseActionRepo {
|
|
|
95
91
|
const actionError = Array.isArray(params.error)
|
|
96
92
|
? params.error.map(unknown2actionError_1.unknown2actionError)
|
|
97
93
|
: (0, unknown2actionError_1.unknown2actionError)(params.error);
|
|
98
|
-
const doc = await this.useActionModel.findOneAndUpdate({
|
|
99
|
-
typeOf: { $eq: params.typeOf },
|
|
100
|
-
_id: { $eq: params.id }
|
|
101
|
-
}, {
|
|
94
|
+
const doc = await this.useActionModel.findOneAndUpdate({ _id: { $eq: params.id } }, {
|
|
102
95
|
$set: {
|
|
103
96
|
actionStatus: factory_1.factory.actionStatusType.FailedActionStatus,
|
|
104
97
|
error: actionError,
|
|
@@ -138,5 +131,19 @@ class UseActionRepo {
|
|
|
138
131
|
.lean() // 2024-08-26~
|
|
139
132
|
.exec();
|
|
140
133
|
}
|
|
134
|
+
/**
|
|
135
|
+
* 移行処理
|
|
136
|
+
*/
|
|
137
|
+
async migrateUseAction(params) {
|
|
138
|
+
const { id, ...upserting } = params;
|
|
139
|
+
return this.useActionModel.updateOne({
|
|
140
|
+
_id: { $eq: id }
|
|
141
|
+
}, {
|
|
142
|
+
$setOnInsert: {
|
|
143
|
+
...upserting,
|
|
144
|
+
_id: id
|
|
145
|
+
}
|
|
146
|
+
}, { upsert: true });
|
|
147
|
+
}
|
|
141
148
|
}
|
|
142
149
|
exports.UseActionRepo = UseActionRepo;
|
|
@@ -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 = Pick<factory.action.interact.inform.IAction, 'about' | 'actionStatus' | 'agent' | 'endDate' | 'object' | 'project' | 'recipient' | 'result' | 'startDate' | 'target' | 'typeOf' | 'purpose'
|
|
5
|
-
error?: any;
|
|
6
|
-
};
|
|
4
|
+
type IDocType = Pick<factory.action.interact.inform.IAction, 'about' | 'actionStatus' | 'agent' | 'endDate' | 'object' | 'project' | 'recipient' | 'result' | 'startDate' | 'target' | 'typeOf' | 'purpose' | 'error'>;
|
|
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>;
|
|
@@ -1,7 +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 = Pick<factory.action.consume.use.reservation.IAction, 'actionStatus' | 'agent' | 'endDate' | 'error' | 'instrument' | 'location' | 'object' | 'project' | '
|
|
4
|
+
type IDocType = Pick<factory.action.consume.use.reservation.IAction, 'actionStatus' | 'agent' | 'endDate' | 'error' | 'instrument' | 'location' | 'object' | 'project' | 'startDate' | 'typeOf'>;
|
|
5
5
|
type IModel = Model<IDocType, Record<string, never>, Record<string, never>, IVirtuals>;
|
|
6
6
|
type ISchemaDefinition = SchemaDefinition<IDocType>;
|
|
7
7
|
type ISchema = Schema<IDocType, IModel, Record<string, never>, Record<string, never>, IVirtuals, Record<string, never>, ISchemaDefinition, IDocType>;
|
|
@@ -16,7 +16,6 @@ const schemaDefinition = {
|
|
|
16
16
|
startDate: { type: Date, required: true },
|
|
17
17
|
instrument: mongoose_1.SchemaTypes.Mixed,
|
|
18
18
|
location: mongoose_1.SchemaTypes.Mixed,
|
|
19
|
-
result: mongoose_1.SchemaTypes.Mixed,
|
|
20
19
|
error: mongoose_1.SchemaTypes.Mixed,
|
|
21
20
|
endDate: Date,
|
|
22
21
|
};
|
|
@@ -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,
|
|
@@ -20,6 +20,7 @@ import type { UpdateActionRepo } from './repo/action/update';
|
|
|
20
20
|
import type { UseActionRepo } from './repo/action/use';
|
|
21
21
|
import type { AsyncActionRepo } from './repo/asyncAction';
|
|
22
22
|
import type { AdditionalPropertyRepo } from './repo/additionalProperty';
|
|
23
|
+
import type { AdminActionRepo } from './repo/adminAction';
|
|
23
24
|
import type { AdminAssetTransactionRepo } from './repo/adminAssetTransaction';
|
|
24
25
|
import type { AdminAsyncActionRepo } from './repo/adminAsyncAction';
|
|
25
26
|
import type { AdminScheduledTaskRepo } from './repo/adminScheduledTask';
|
|
@@ -185,6 +186,10 @@ export type AdditionalProperty = AdditionalPropertyRepo;
|
|
|
185
186
|
export declare namespace AdditionalProperty {
|
|
186
187
|
function createInstance(...params: ConstructorParameters<typeof AdditionalPropertyRepo>): Promise<AdditionalPropertyRepo>;
|
|
187
188
|
}
|
|
189
|
+
export type AdminAction = AdminActionRepo;
|
|
190
|
+
export declare namespace AdminAction {
|
|
191
|
+
function createInstance(...params: ConstructorParameters<typeof AdminActionRepo>): Promise<AdminActionRepo>;
|
|
192
|
+
}
|
|
188
193
|
export type AdminAssetTransaction = AdminAssetTransactionRepo;
|
|
189
194
|
export declare namespace AdminAssetTransaction {
|
|
190
195
|
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;
|
|
@@ -203,6 +203,17 @@ var AdditionalProperty;
|
|
|
203
203
|
}
|
|
204
204
|
AdditionalProperty.createInstance = createInstance;
|
|
205
205
|
})(AdditionalProperty || (exports.AdditionalProperty = AdditionalProperty = {}));
|
|
206
|
+
var AdminAction;
|
|
207
|
+
(function (AdminAction) {
|
|
208
|
+
let repo;
|
|
209
|
+
async function createInstance(...params) {
|
|
210
|
+
if (repo === undefined) {
|
|
211
|
+
repo = (await import('./repo/adminAction.js')).AdminActionRepo;
|
|
212
|
+
}
|
|
213
|
+
return new repo(...params);
|
|
214
|
+
}
|
|
215
|
+
AdminAction.createInstance = createInstance;
|
|
216
|
+
})(AdminAction || (exports.AdminAction = AdminAction = {}));
|
|
206
217
|
var AdminAssetTransaction;
|
|
207
218
|
(function (AdminAssetTransaction) {
|
|
208
219
|
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
|
});
|
|
@@ -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 } });
|
|
@@ -82,7 +82,7 @@ function useReservation(params) {
|
|
|
82
82
|
}
|
|
83
83
|
throw error;
|
|
84
84
|
}
|
|
85
|
-
await repos.actions.use.completeUseAction({ typeOf: action.typeOf, id: action.id
|
|
85
|
+
await repos.actions.use.completeUseAction({ typeOf: action.typeOf, id: action.id });
|
|
86
86
|
await (0, onReservationUsed_1.onReservationUsed)(attendedReservation, {
|
|
87
87
|
...actionAttributes,
|
|
88
88
|
id: action.id,
|
|
@@ -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: {
|
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.8",
|
|
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.34"
|
|
92
92
|
}
|