@chevre/domain 28.0.0-alpha.5 → 28.0.0-alpha.7
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/adminTransaction.d.ts +5 -15
- package/lib/chevre/repo/mongoose/schemas/transaction.d.ts +1 -1
- package/lib/chevre/repo/mongoose/schemas/transaction.js +27 -27
- package/lib/chevre/repo/place/screeningRoom.d.ts +17 -1
- package/lib/chevre/repo/place/screeningRoom.js +17 -11
- package/lib/chevre/repo/transaction/placeOrder.d.ts +1 -2
- package/lib/chevre/repo/transaction/placeOrder.js +6 -28
- package/package.json +2 -2
|
@@ -52,7 +52,6 @@ export declare class AdminTransactionRepo {
|
|
|
52
52
|
}): Promise<import("mongoose").UpdateWriteOpResult>;
|
|
53
53
|
getCursor(conditions: any, projection: any, sort?: factory.sortType): import("mongoose").Cursor<import("mongoose").Document<unknown, Record<string, never>, {
|
|
54
54
|
object: import("@chevre/factory/lib/chevre/transaction/placeOrder").IObject;
|
|
55
|
-
error?: any;
|
|
56
55
|
project: import("@chevre/factory/lib/chevre/transaction").IProject;
|
|
57
56
|
seller: import("@chevre/factory/lib/chevre/transaction/placeOrder").ISeller;
|
|
58
57
|
typeOf: factory.transactionType.PlaceOrder;
|
|
@@ -63,11 +62,9 @@ export declare class AdminTransactionRepo {
|
|
|
63
62
|
instrument?: import("@chevre/factory/lib/chevre/transaction/placeOrder").IInstrument | undefined;
|
|
64
63
|
agent: import("@chevre/factory/lib/chevre/transaction/placeOrder").IAgent;
|
|
65
64
|
status: factory.transactionStatusType;
|
|
66
|
-
tasksExportAction?: import("@chevre/factory/lib/chevre/transaction").ITasksExportAction | undefined;
|
|
67
|
-
potentialActions?: undefined;
|
|
65
|
+
tasksExportAction?: import("@chevre/factory/lib/chevre/transaction/placeOrder").ITasksExportAction | undefined;
|
|
68
66
|
}, import("./mongoose/virtuals").IVirtuals, {}> & {
|
|
69
67
|
object: import("@chevre/factory/lib/chevre/transaction/placeOrder").IObject;
|
|
70
|
-
error?: any;
|
|
71
68
|
project: import("@chevre/factory/lib/chevre/transaction").IProject;
|
|
72
69
|
seller: import("@chevre/factory/lib/chevre/transaction/placeOrder").ISeller;
|
|
73
70
|
typeOf: factory.transactionType.PlaceOrder;
|
|
@@ -78,15 +75,13 @@ export declare class AdminTransactionRepo {
|
|
|
78
75
|
instrument?: import("@chevre/factory/lib/chevre/transaction/placeOrder").IInstrument | undefined;
|
|
79
76
|
agent: import("@chevre/factory/lib/chevre/transaction/placeOrder").IAgent;
|
|
80
77
|
status: factory.transactionStatusType;
|
|
81
|
-
tasksExportAction?: import("@chevre/factory/lib/chevre/transaction").ITasksExportAction | undefined;
|
|
82
|
-
potentialActions?: undefined;
|
|
78
|
+
tasksExportAction?: import("@chevre/factory/lib/chevre/transaction/placeOrder").ITasksExportAction | undefined;
|
|
83
79
|
} & {
|
|
84
80
|
_id: import("mongoose").Types.ObjectId;
|
|
85
81
|
} & {
|
|
86
82
|
__v: number;
|
|
87
83
|
}, import("mongoose").QueryOptions<{
|
|
88
84
|
object: import("@chevre/factory/lib/chevre/transaction/placeOrder").IObject;
|
|
89
|
-
error?: any;
|
|
90
85
|
project: import("@chevre/factory/lib/chevre/transaction").IProject;
|
|
91
86
|
seller: import("@chevre/factory/lib/chevre/transaction/placeOrder").ISeller;
|
|
92
87
|
typeOf: factory.transactionType.PlaceOrder;
|
|
@@ -97,11 +92,9 @@ export declare class AdminTransactionRepo {
|
|
|
97
92
|
instrument?: import("@chevre/factory/lib/chevre/transaction/placeOrder").IInstrument | undefined;
|
|
98
93
|
agent: import("@chevre/factory/lib/chevre/transaction/placeOrder").IAgent;
|
|
99
94
|
status: factory.transactionStatusType;
|
|
100
|
-
tasksExportAction?: import("@chevre/factory/lib/chevre/transaction").ITasksExportAction | undefined;
|
|
101
|
-
potentialActions?: undefined;
|
|
95
|
+
tasksExportAction?: import("@chevre/factory/lib/chevre/transaction/placeOrder").ITasksExportAction | undefined;
|
|
102
96
|
}>, (import("mongoose").Document<unknown, Record<string, never>, {
|
|
103
97
|
object: import("@chevre/factory/lib/chevre/transaction/placeOrder").IObject;
|
|
104
|
-
error?: any;
|
|
105
98
|
project: import("@chevre/factory/lib/chevre/transaction").IProject;
|
|
106
99
|
seller: import("@chevre/factory/lib/chevre/transaction/placeOrder").ISeller;
|
|
107
100
|
typeOf: factory.transactionType.PlaceOrder;
|
|
@@ -112,11 +105,9 @@ export declare class AdminTransactionRepo {
|
|
|
112
105
|
instrument?: import("@chevre/factory/lib/chevre/transaction/placeOrder").IInstrument | undefined;
|
|
113
106
|
agent: import("@chevre/factory/lib/chevre/transaction/placeOrder").IAgent;
|
|
114
107
|
status: factory.transactionStatusType;
|
|
115
|
-
tasksExportAction?: import("@chevre/factory/lib/chevre/transaction").ITasksExportAction | undefined;
|
|
116
|
-
potentialActions?: undefined;
|
|
108
|
+
tasksExportAction?: import("@chevre/factory/lib/chevre/transaction/placeOrder").ITasksExportAction | undefined;
|
|
117
109
|
}, import("./mongoose/virtuals").IVirtuals, {}> & {
|
|
118
110
|
object: import("@chevre/factory/lib/chevre/transaction/placeOrder").IObject;
|
|
119
|
-
error?: any;
|
|
120
111
|
project: import("@chevre/factory/lib/chevre/transaction").IProject;
|
|
121
112
|
seller: import("@chevre/factory/lib/chevre/transaction/placeOrder").ISeller;
|
|
122
113
|
typeOf: factory.transactionType.PlaceOrder;
|
|
@@ -127,8 +118,7 @@ export declare class AdminTransactionRepo {
|
|
|
127
118
|
instrument?: import("@chevre/factory/lib/chevre/transaction/placeOrder").IInstrument | undefined;
|
|
128
119
|
agent: import("@chevre/factory/lib/chevre/transaction/placeOrder").IAgent;
|
|
129
120
|
status: factory.transactionStatusType;
|
|
130
|
-
tasksExportAction?: import("@chevre/factory/lib/chevre/transaction").ITasksExportAction | undefined;
|
|
131
|
-
potentialActions?: undefined;
|
|
121
|
+
tasksExportAction?: import("@chevre/factory/lib/chevre/transaction/placeOrder").ITasksExportAction | undefined;
|
|
132
122
|
} & {
|
|
133
123
|
_id: import("mongoose").Types.ObjectId;
|
|
134
124
|
} & {
|
|
@@ -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 IPlaceOrder = Pick<factory.transaction.placeOrder.ITransaction, 'agent' | 'endDate' | '
|
|
4
|
+
type IPlaceOrder = Pick<factory.transaction.placeOrder.ITransaction, 'agent' | 'endDate' | 'expires' | 'instrument' | 'object' | 'project' | 'result' | 'seller' | 'startDate' | 'status' | 'tasksExportAction' | 'typeOf'>;
|
|
5
5
|
type IDocType = IPlaceOrder;
|
|
6
6
|
type IModel = Model<IDocType, Record<string, never>, Record<string, never>, IVirtuals>;
|
|
7
7
|
type ISchemaDefinition = SchemaDefinition<IDocType>;
|
|
@@ -11,18 +11,18 @@ const schemaDefinition = {
|
|
|
11
11
|
project: { type: mongoose_1.SchemaTypes.Mixed, required: true },
|
|
12
12
|
status: { type: String, required: true },
|
|
13
13
|
typeOf: { type: String, required: true },
|
|
14
|
-
agent: mongoose_1.SchemaTypes.Mixed,
|
|
14
|
+
agent: { type: mongoose_1.SchemaTypes.Mixed, required: true },
|
|
15
15
|
expires: { type: Date, required: true },
|
|
16
16
|
startDate: { type: Date, required: true },
|
|
17
|
-
// recipient: SchemaTypes.Mixed, // discontinue(2026-09-09~)
|
|
18
17
|
seller: mongoose_1.SchemaTypes.Mixed,
|
|
19
|
-
error: mongoose_1.SchemaTypes.Mixed,
|
|
20
18
|
result: mongoose_1.SchemaTypes.Mixed,
|
|
21
19
|
object: mongoose_1.SchemaTypes.Mixed,
|
|
22
20
|
endDate: Date,
|
|
23
21
|
tasksExportAction: mongoose_1.SchemaTypes.Mixed,
|
|
24
|
-
|
|
25
|
-
|
|
22
|
+
instrument: mongoose_1.SchemaTypes.Mixed,
|
|
23
|
+
// recipient: SchemaTypes.Mixed, // discontinue(2026-09-09~)
|
|
24
|
+
// error: SchemaTypes.Mixed, // discontinue(2026-09-14~)
|
|
25
|
+
// potentialActions: SchemaTypes.Mixed, // discontinue(2026-09-14~)
|
|
26
26
|
};
|
|
27
27
|
const schemaOptions = {
|
|
28
28
|
autoIndex: settings_1.MONGO_AUTO_INDEX,
|
|
@@ -53,10 +53,6 @@ const indexes = [
|
|
|
53
53
|
{ 'project.id': 1, startDate: -1 },
|
|
54
54
|
{ name: 'searchByProjectId-v20220721' }
|
|
55
55
|
],
|
|
56
|
-
[
|
|
57
|
-
{ typeOf: 1, startDate: -1 },
|
|
58
|
-
{ name: 'searchByTypeOfAndStartDate' }
|
|
59
|
-
],
|
|
60
56
|
[
|
|
61
57
|
{ status: 1, startDate: -1 },
|
|
62
58
|
{ name: 'searchByStatusAndStartDate' }
|
|
@@ -110,24 +106,6 @@ const indexes = [
|
|
|
110
106
|
// }
|
|
111
107
|
// }
|
|
112
108
|
// ],
|
|
113
|
-
[
|
|
114
|
-
{ 'agent.typeOf': 1, startDate: -1 },
|
|
115
|
-
{
|
|
116
|
-
name: 'searchByAgentTypeOfAndStartDate',
|
|
117
|
-
partialFilterExpression: {
|
|
118
|
-
'agent.typeOf': { $exists: true }
|
|
119
|
-
}
|
|
120
|
-
}
|
|
121
|
-
],
|
|
122
|
-
[
|
|
123
|
-
{ 'agent.id': 1, startDate: -1 },
|
|
124
|
-
{
|
|
125
|
-
name: 'searchByAgentIdAndStartDate',
|
|
126
|
-
partialFilterExpression: {
|
|
127
|
-
'agent.id': { $exists: true }
|
|
128
|
-
}
|
|
129
|
-
}
|
|
130
|
-
],
|
|
131
109
|
[
|
|
132
110
|
{ 'agent.identifier': 1, startDate: -1 },
|
|
133
111
|
{
|
|
@@ -223,6 +201,28 @@ const indexes = [
|
|
|
223
201
|
// }
|
|
224
202
|
// }
|
|
225
203
|
// ],
|
|
204
|
+
// [
|
|
205
|
+
// { typeOf: 1, startDate: -1 },
|
|
206
|
+
// { name: 'searchByTypeOfAndStartDate' }
|
|
207
|
+
// ],
|
|
208
|
+
// [
|
|
209
|
+
// { 'agent.typeOf': 1, startDate: -1 },
|
|
210
|
+
// {
|
|
211
|
+
// name: 'searchByAgentTypeOfAndStartDate',
|
|
212
|
+
// partialFilterExpression: {
|
|
213
|
+
// 'agent.typeOf': { $exists: true }
|
|
214
|
+
// }
|
|
215
|
+
// }
|
|
216
|
+
// ],
|
|
217
|
+
// [
|
|
218
|
+
// { 'agent.id': 1, startDate: -1 },
|
|
219
|
+
// {
|
|
220
|
+
// name: 'searchByAgentIdAndStartDate',
|
|
221
|
+
// partialFilterExpression: {
|
|
222
|
+
// 'agent.id': { $exists: true }
|
|
223
|
+
// }
|
|
224
|
+
// }
|
|
225
|
+
// ],
|
|
226
226
|
];
|
|
227
227
|
exports.indexes = indexes;
|
|
228
228
|
/**
|
|
@@ -84,7 +84,23 @@ export declare class ScreeningRoomRepo {
|
|
|
84
84
|
id: string;
|
|
85
85
|
};
|
|
86
86
|
}): Promise<mongo.DeleteResult>;
|
|
87
|
-
|
|
87
|
+
/**
|
|
88
|
+
* ルーム検索
|
|
89
|
+
* sectionCount,seatCountのprojectが可能
|
|
90
|
+
* sortはbranchCode: factory.sortType.Ascendingで固定
|
|
91
|
+
*/
|
|
92
|
+
projectRoomFields(params: Pick<factory.place.screeningRoom.ISearchConditions, '$projection' | 'branchCode' | 'containedInPlace' | 'parentOrganization'> & {
|
|
93
|
+
/**
|
|
94
|
+
* プロジェクト指定は必須
|
|
95
|
+
*/
|
|
96
|
+
project: {
|
|
97
|
+
id: {
|
|
98
|
+
$eq: string;
|
|
99
|
+
};
|
|
100
|
+
};
|
|
101
|
+
limit: number;
|
|
102
|
+
page: number;
|
|
103
|
+
}): Promise<Pick<factory.place.screeningRoom.IPlace, 'additionalProperty' | 'address' | 'branchCode' | 'containedInPlace' | 'maximumAttendeeCapacity' | 'name' | 'openSeatingAllowed' | 'typeOf' | 'seatCount' | 'sectionCount'>[]>;
|
|
88
104
|
findRooms(params: Omit<factory.place.screeningRoom.ISearchConditions, '$projection'>): Promise<Pick<factory.place.screeningRoom.IPlace, 'additionalProperty' | 'address' | 'branchCode' | 'name' | 'openSeatingAllowed' | 'maximumAttendeeCapacity'>[]>;
|
|
89
105
|
/**
|
|
90
106
|
* セクションと座席も含めたひとつのルームを取得する
|
|
@@ -379,10 +379,14 @@ class ScreeningRoomRepo {
|
|
|
379
379
|
})
|
|
380
380
|
.exec();
|
|
381
381
|
}
|
|
382
|
-
|
|
382
|
+
/**
|
|
383
|
+
* ルーム検索
|
|
384
|
+
* sectionCount,seatCountのprojectが可能
|
|
385
|
+
* sortはbranchCode: factory.sortType.Ascendingで固定
|
|
386
|
+
*/
|
|
387
|
+
async projectRoomFields(params) {
|
|
383
388
|
const aggregate = this.placeModel.aggregate([
|
|
384
|
-
|
|
385
|
-
...ScreeningRoomRepo.CREATE_ROOM_MONGO_CONDITIONS(searchConditions),
|
|
389
|
+
...ScreeningRoomRepo.CREATE_ROOM_MONGO_CONDITIONS(params),
|
|
386
390
|
{
|
|
387
391
|
$project: {
|
|
388
392
|
_id: 0,
|
|
@@ -399,7 +403,7 @@ class ScreeningRoomRepo {
|
|
|
399
403
|
openSeatingAllowed: '$openSeatingAllowed',
|
|
400
404
|
additionalProperty: '$additionalProperty',
|
|
401
405
|
maximumAttendeeCapacity: '$maximumAttendeeCapacity',
|
|
402
|
-
...(
|
|
406
|
+
...(params.$projection?.sectionCount === 1)
|
|
403
407
|
? {
|
|
404
408
|
sectionCount: {
|
|
405
409
|
$cond: {
|
|
@@ -410,7 +414,7 @@ class ScreeningRoomRepo {
|
|
|
410
414
|
}
|
|
411
415
|
}
|
|
412
416
|
: undefined,
|
|
413
|
-
...(
|
|
417
|
+
...(params.$projection?.seatCount === 1)
|
|
414
418
|
? {
|
|
415
419
|
seatCount: {
|
|
416
420
|
$sum: {
|
|
@@ -429,14 +433,16 @@ class ScreeningRoomRepo {
|
|
|
429
433
|
}
|
|
430
434
|
: undefined
|
|
431
435
|
}
|
|
432
|
-
}
|
|
436
|
+
},
|
|
437
|
+
{ $sort: { branchCode: factory_1.factory.sortType.Ascending } }
|
|
433
438
|
]);
|
|
434
|
-
|
|
435
|
-
if (typeof
|
|
436
|
-
|
|
437
|
-
aggregate.limit(searchConditions.limit * page)
|
|
438
|
-
.skip(searchConditions.limit * (page - 1));
|
|
439
|
+
const { limit, page } = params;
|
|
440
|
+
if (typeof limit !== 'number' || limit === 0) {
|
|
441
|
+
throw new factory_1.factory.errors.ArgumentNull('limit', 'must be number > 0');
|
|
439
442
|
}
|
|
443
|
+
const pageMustBePositive = (typeof page === 'number' && page > 0) ? page : 1;
|
|
444
|
+
aggregate.skip(limit * (pageMustBePositive - 1))
|
|
445
|
+
.limit(limit);
|
|
440
446
|
return aggregate
|
|
441
447
|
.option({ maxTimeMS: settings_1.MONGO_MAX_TIME_MS })
|
|
442
448
|
.exec();
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { Connection, FilterQuery } from 'mongoose';
|
|
2
2
|
import { factory } from '../../factory';
|
|
3
|
-
type IKeyOfProjection = 'agent' | 'endDate' | 'expires' | 'project' | 'startDate' | 'status' | 'typeOf' | 'instrument' | 'object' | 'seller' | 'result' | '
|
|
3
|
+
type IKeyOfProjection = 'agent' | 'endDate' | 'expires' | 'project' | 'startDate' | 'status' | 'typeOf' | 'instrument' | 'object' | 'seller' | 'result' | 'tasksExportAction';
|
|
4
4
|
export type ITransactionInProgress = Pick<factory.transaction.placeOrder.ITransaction, IKeyOfProjection> & {
|
|
5
5
|
/**
|
|
6
6
|
* 取引ID
|
|
@@ -80,7 +80,6 @@ export declare class PlaceOrderRepo {
|
|
|
80
80
|
confirmationNumber: string;
|
|
81
81
|
};
|
|
82
82
|
result: factory.transaction.placeOrder.IResult;
|
|
83
|
-
potentialActions?: factory.transaction.placeOrder.IPotentialActions;
|
|
84
83
|
}): Promise<void>;
|
|
85
84
|
/**
|
|
86
85
|
* 取引を中止する
|
|
@@ -21,9 +21,9 @@ const AVAILABLE_PROJECT_FIELDS = [
|
|
|
21
21
|
'endDate',
|
|
22
22
|
'instrument',
|
|
23
23
|
'result',
|
|
24
|
-
'potentialActions',
|
|
24
|
+
// 'potentialActions', // discontinue(2026-09-14~)
|
|
25
25
|
// 'recipient',
|
|
26
|
-
'error',
|
|
26
|
+
// 'error', // discontinue(2026-09-14~)
|
|
27
27
|
'tasksExportAction',
|
|
28
28
|
];
|
|
29
29
|
/**
|
|
@@ -84,31 +84,9 @@ class PlaceOrderRepo {
|
|
|
84
84
|
if (Array.isArray(statusIn)) {
|
|
85
85
|
andConditions.push({ status: { $in: statusIn } });
|
|
86
86
|
}
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
'agent.typeOf': {
|
|
91
|
-
$exists: true,
|
|
92
|
-
$eq: params.agent.typeOf
|
|
93
|
-
}
|
|
94
|
-
});
|
|
95
|
-
}
|
|
96
|
-
if (Array.isArray(params.agent.ids)) {
|
|
97
|
-
andConditions.push({
|
|
98
|
-
'agent.id': {
|
|
99
|
-
$exists: true,
|
|
100
|
-
$in: params.agent.ids
|
|
101
|
-
}
|
|
102
|
-
});
|
|
103
|
-
}
|
|
104
|
-
if (Array.isArray(params.agent.identifiers)) {
|
|
105
|
-
andConditions.push({
|
|
106
|
-
'agent.identifier': {
|
|
107
|
-
$exists: true,
|
|
108
|
-
$in: params.agent.identifiers
|
|
109
|
-
}
|
|
110
|
-
});
|
|
111
|
-
}
|
|
87
|
+
const agentIdentifierIn = params.agent?.identifiers;
|
|
88
|
+
if (Array.isArray(agentIdentifierIn)) {
|
|
89
|
+
andConditions.push({ 'agent.identifier': { $exists: true, $in: agentIdentifierIn } });
|
|
112
90
|
}
|
|
113
91
|
// discontinue(2026-09-11~)
|
|
114
92
|
// const tasksExportActionStatusIn = params.tasksExportAction?.actionStatus?.$in;
|
|
@@ -332,7 +310,7 @@ class PlaceOrderRepo {
|
|
|
332
310
|
'object.orderNumber': params.object.orderNumber, // add(2026-06-27~)
|
|
333
311
|
'object.confirmationNumber': params.object.confirmationNumber, // add(2026-07-08~)
|
|
334
312
|
result: params.result, // resultを更新
|
|
335
|
-
...((params.potentialActions !== undefined) && { potentialActions: params.potentialActions }) // support undefined(2026-07-17~)
|
|
313
|
+
// ...((params.potentialActions !== undefined) && { potentialActions: params.potentialActions }) // support undefined(2026-07-17~)
|
|
336
314
|
}, {
|
|
337
315
|
new: true,
|
|
338
316
|
projection: { _id: 1 }
|
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": "11.0.0-alpha.
|
|
14
|
+
"@chevre/factory": "11.0.0-alpha.3",
|
|
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": "28.0.0-alpha.
|
|
91
|
+
"version": "28.0.0-alpha.7"
|
|
92
92
|
}
|