@chevre/domain 28.0.0-alpha.1 → 28.0.0-alpha.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/chevre/eventEmitter/transaction.d.ts +2 -2
- package/lib/chevre/eventEmitter/transaction.js +1 -1
- package/lib/chevre/repo/adminEvent.d.ts +0 -6
- package/lib/chevre/repo/adminEvent.js +3 -9
- package/lib/chevre/repo/adminEventSeries.d.ts +89 -0
- package/lib/chevre/repo/adminEventSeries.js +174 -0
- package/lib/chevre/repo/adminTransaction.d.ts +35 -39
- package/lib/chevre/repo/adminTransaction.js +0 -98
- package/lib/chevre/repo/aggregateEvent.js +0 -1
- package/lib/chevre/repo/aggregateTransaction.d.ts +0 -1
- package/lib/chevre/repo/aggregateTransaction.js +0 -1
- package/lib/chevre/repo/event.d.ts +2 -2
- package/lib/chevre/repo/event.js +71 -110
- package/lib/chevre/repo/eventSeries.d.ts +3 -82
- package/lib/chevre/repo/eventSeries.js +3 -201
- package/lib/chevre/repo/mongoose/schemas/transaction.d.ts +2 -3
- package/lib/chevre/repo/mongoose/schemas/transaction.js +81 -70
- package/lib/chevre/repo/order.js +3 -1
- package/lib/chevre/repo/orderInTransaction.js +0 -6
- package/lib/chevre/repo/place/{hasPOS.d.ts → pos.d.ts} +3 -7
- package/lib/chevre/repo/place/{hasPOS.js → pos.js} +14 -13
- package/lib/chevre/repo/place/screeningRoom.d.ts +22 -1
- package/lib/chevre/repo/place/screeningRoom.js +28 -17
- package/lib/chevre/repo/transaction/placeOrder.d.ts +6 -12
- package/lib/chevre/repo/transaction/placeOrder.js +53 -146
- package/lib/chevre/repo/transaction/returnOrderInProgress.d.ts +1 -1
- package/lib/chevre/repo/transaction.d.ts +1 -1
- package/lib/chevre/repo/transaction.js +0 -1
- package/lib/chevre/repository.d.ts +10 -5
- package/lib/chevre/repository.js +19 -8
- package/lib/chevre/service/aggregation/event/aggregateOffers.js +1 -2
- package/lib/chevre/service/aggregation/event/aggregateScreeningEvent.js +0 -1
- package/lib/chevre/service/aggregation/system.js +1 -3
- package/lib/chevre/service/assetTransaction/pay/start/preStart/validateAcceptedPaymentMethodIfNeeded.js +1 -2
- package/lib/chevre/service/event/saveScreeningEventSeries.d.ts +2 -2
- package/lib/chevre/service/event/saveScreeningEventSeries.js +1 -1
- package/lib/chevre/service/event/saveScreeningEvents.d.ts +2 -0
- package/lib/chevre/service/event.d.ts +2 -0
- package/lib/chevre/service/event.js +0 -1
- package/lib/chevre/service/offer/event/authorize/factory.d.ts +2 -2
- package/lib/chevre/service/offer/event/authorize/processStartReserve4chevre.d.ts +1 -1
- package/lib/chevre/service/offer/event/authorize.js +1 -4
- package/lib/chevre/service/offer/event/issueEventOfferTicket.js +1 -1
- package/lib/chevre/service/offer/event/voidTransaction.js +2 -5
- package/lib/chevre/service/offer/event/voidTransactionByActionId.js +1 -4
- package/lib/chevre/service/offer/eventServiceByCOA/acceptOffer.js +2 -9
- package/lib/chevre/service/offer/eventServiceByCOA/authorize/factory.d.ts +1 -1
- package/lib/chevre/service/offer/eventServiceByCOA/authorize.js +1 -4
- package/lib/chevre/service/offer/eventServiceByCOA/changeOffers.js +1 -4
- package/lib/chevre/service/offer/onEventChanged.js +2 -4
- package/lib/chevre/service/offer.js +1 -2
- package/lib/chevre/service/order/onAssetTransactionStatusChanged/onPayTransactionCanceled.js +1 -1
- package/lib/chevre/service/order/onOrderStatusChanged/onOrderInTransit.js +1 -1
- package/lib/chevre/service/order/placeOrder/createPlacingOrderFromExistingTransaction.js +1 -1
- package/lib/chevre/service/payment/any/authorize.js +1 -1
- package/lib/chevre/service/payment/any/factory.d.ts +2 -2
- package/lib/chevre/service/payment/any/invalidatePaymentUrl.js +1 -4
- package/lib/chevre/service/payment/any/processVoidPayTransaction.js +2 -2
- package/lib/chevre/service/payment/any/publishPaymentUrl.js +1 -1
- package/lib/chevre/service/task/importEventsFromCOA.js +2 -0
- package/lib/chevre/service/task/onResourceDeleted.js +2 -2
- package/lib/chevre/service/task/onResourceUpdated/onHasPOSUpdated.d.ts +2 -2
- package/lib/chevre/service/task/onResourceUpdated/onHasPOSUpdated.js +3 -4
- package/lib/chevre/service/task/onResourceUpdated.js +2 -2
- package/lib/chevre/service/task/syncResourcesFromCOA.js +3 -1
- package/lib/chevre/service/transaction/deleteTransaction.js +1 -1
- package/lib/chevre/service/transaction/placeOrder/confirm.js +1 -2
- package/lib/chevre/service/transaction/placeOrder/exportTasks/factory.d.ts +2 -2
- package/lib/chevre/service/transaction/placeOrder/exportTasksById.js +1 -4
- package/lib/chevre/service/transaction/placeOrder/start.js +1 -1
- package/lib/chevre/service/transaction/placeOrder/updateAgent.js +1 -4
- package/lib/chevre/service/transaction/returnOrder/potentialActions.js +1 -3
- package/lib/chevre/service/transaction/returnOrder/preStart.d.ts +13 -1
- package/lib/chevre/service/transaction/returnOrder/preStart.js +1 -2
- package/lib/chevre/service/transaction/returnOrder.d.ts +14 -3
- package/lib/chevre/service/transaction/returnOrder.js +1 -6
- package/lib/chevre/service/transaction.d.ts +1 -1
- package/package.json +2 -2
|
@@ -4,26 +4,25 @@ exports.modelName = exports.indexes = void 0;
|
|
|
4
4
|
exports.createSchema = createSchema;
|
|
5
5
|
const mongoose_1 = require("mongoose");
|
|
6
6
|
const writeConcern_1 = require("../writeConcern");
|
|
7
|
-
const factory_1 = require("../../../factory");
|
|
8
7
|
const settings_1 = require("../../../settings");
|
|
9
8
|
const modelName = 'Transaction';
|
|
10
9
|
exports.modelName = modelName;
|
|
11
10
|
const schemaDefinition = {
|
|
12
|
-
project: mongoose_1.SchemaTypes.Mixed,
|
|
13
|
-
status: String,
|
|
14
|
-
typeOf: String,
|
|
15
|
-
agent: mongoose_1.SchemaTypes.Mixed,
|
|
16
|
-
|
|
11
|
+
project: { type: mongoose_1.SchemaTypes.Mixed, required: true },
|
|
12
|
+
status: { type: String, required: true },
|
|
13
|
+
typeOf: { type: String, required: true },
|
|
14
|
+
agent: { type: mongoose_1.SchemaTypes.Mixed, required: true },
|
|
15
|
+
expires: { type: Date, required: true },
|
|
16
|
+
startDate: { type: Date, required: true },
|
|
17
17
|
seller: mongoose_1.SchemaTypes.Mixed,
|
|
18
|
-
error: mongoose_1.SchemaTypes.Mixed,
|
|
19
18
|
result: mongoose_1.SchemaTypes.Mixed,
|
|
20
19
|
object: mongoose_1.SchemaTypes.Mixed,
|
|
21
|
-
expires: Date,
|
|
22
|
-
startDate: Date,
|
|
23
20
|
endDate: Date,
|
|
24
21
|
tasksExportAction: mongoose_1.SchemaTypes.Mixed,
|
|
25
|
-
|
|
26
|
-
|
|
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~)
|
|
27
26
|
};
|
|
28
27
|
const schemaOptions = {
|
|
29
28
|
autoIndex: settings_1.MONGO_AUTO_INDEX,
|
|
@@ -54,10 +53,6 @@ const indexes = [
|
|
|
54
53
|
{ 'project.id': 1, startDate: -1 },
|
|
55
54
|
{ name: 'searchByProjectId-v20220721' }
|
|
56
55
|
],
|
|
57
|
-
[
|
|
58
|
-
{ typeOf: 1, startDate: -1 },
|
|
59
|
-
{ name: 'searchByTypeOfAndStartDate' }
|
|
60
|
-
],
|
|
61
56
|
[
|
|
62
57
|
{ status: 1, startDate: -1 },
|
|
63
58
|
{ name: 'searchByStatusAndStartDate' }
|
|
@@ -66,19 +61,6 @@ const indexes = [
|
|
|
66
61
|
{ startDate: -1 },
|
|
67
62
|
{ name: 'searchByStartDateDescending' }
|
|
68
63
|
],
|
|
69
|
-
[
|
|
70
|
-
{ endDate: 1, startDate: -1 },
|
|
71
|
-
{
|
|
72
|
-
name: 'searchByEndDateAndStartDate',
|
|
73
|
-
partialFilterExpression: {
|
|
74
|
-
endDate: { $exists: true }
|
|
75
|
-
}
|
|
76
|
-
}
|
|
77
|
-
],
|
|
78
|
-
[
|
|
79
|
-
{ expires: 1, startDate: -1 },
|
|
80
|
-
{ name: 'searchByExpiresAndStartDate' }
|
|
81
|
-
],
|
|
82
64
|
[
|
|
83
65
|
{ 'object.confirmationNumber': 1, startDate: -1 },
|
|
84
66
|
{
|
|
@@ -99,37 +81,31 @@ const indexes = [
|
|
|
99
81
|
],
|
|
100
82
|
[
|
|
101
83
|
// 注文取引のobject.orderNumberも発行されている場合ユニークなはず(2026-02-21~)
|
|
84
|
+
// 返品取引廃止につきuniquePlacingOrderNumberをreIndex
|
|
85
|
+
{ 'object.orderNumber': 1 },
|
|
102
86
|
{
|
|
103
|
-
|
|
104
|
-
'object.orderNumber': 1
|
|
105
|
-
},
|
|
106
|
-
{
|
|
107
|
-
name: 'uniquePlacingOrderNumber',
|
|
87
|
+
name: 'uniqueOrderNumber',
|
|
108
88
|
unique: true,
|
|
109
89
|
partialFilterExpression: {
|
|
110
|
-
typeOf: factory_1.factory.transactionType.PlaceOrder,
|
|
111
90
|
'object.orderNumber': { $exists: true }
|
|
112
91
|
}
|
|
113
92
|
}
|
|
114
93
|
],
|
|
115
|
-
[
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
}
|
|
131
|
-
}
|
|
132
|
-
],
|
|
94
|
+
// [
|
|
95
|
+
// // 注文取引のobject.orderNumberも発行されている場合ユニークなはず(2026-02-21~)
|
|
96
|
+
// {
|
|
97
|
+
// typeOf: 1,
|
|
98
|
+
// 'object.orderNumber': 1
|
|
99
|
+
// },
|
|
100
|
+
// {
|
|
101
|
+
// name: 'uniquePlacingOrderNumber',
|
|
102
|
+
// unique: true,
|
|
103
|
+
// partialFilterExpression: {
|
|
104
|
+
// typeOf: factory.transactionType.PlaceOrder,
|
|
105
|
+
// 'object.orderNumber': { $exists: true }
|
|
106
|
+
// }
|
|
107
|
+
// }
|
|
108
|
+
// ],
|
|
133
109
|
[
|
|
134
110
|
{ 'agent.identifier': 1, startDate: -1 },
|
|
135
111
|
{
|
|
@@ -171,24 +147,6 @@ const indexes = [
|
|
|
171
147
|
}
|
|
172
148
|
}
|
|
173
149
|
],
|
|
174
|
-
[
|
|
175
|
-
{ 'tasksExportAction.actionStatus': 1, startDate: -1 },
|
|
176
|
-
{
|
|
177
|
-
name: 'searchByTasksExportActionActionStatus',
|
|
178
|
-
partialFilterExpression: {
|
|
179
|
-
'tasksExportAction.actionStatus': { $exists: true }
|
|
180
|
-
}
|
|
181
|
-
}
|
|
182
|
-
],
|
|
183
|
-
[
|
|
184
|
-
{ 'tasksExportAction.startDate': 1, startDate: -1 },
|
|
185
|
-
{
|
|
186
|
-
name: 'searchByTasksExportActionActionStartDate',
|
|
187
|
-
partialFilterExpression: {
|
|
188
|
-
'tasksExportAction.startDate': { $exists: true }
|
|
189
|
-
}
|
|
190
|
-
}
|
|
191
|
-
],
|
|
192
150
|
// typeOf: ReturnOrder廃止につき以下廃止(2026-09-08~)
|
|
193
151
|
// [
|
|
194
152
|
// { 'object.order.orderNumber': 1, startDate: -1 },
|
|
@@ -212,6 +170,59 @@ const indexes = [
|
|
|
212
170
|
// }
|
|
213
171
|
// }
|
|
214
172
|
// ],
|
|
173
|
+
// [
|
|
174
|
+
// { endDate: 1, startDate: -1 },
|
|
175
|
+
// {
|
|
176
|
+
// name: 'searchByEndDateAndStartDate',
|
|
177
|
+
// partialFilterExpression: {
|
|
178
|
+
// endDate: { $exists: true }
|
|
179
|
+
// }
|
|
180
|
+
// }
|
|
181
|
+
// ],
|
|
182
|
+
// [
|
|
183
|
+
// { expires: 1, startDate: -1 },
|
|
184
|
+
// { name: 'searchByExpiresAndStartDate' }
|
|
185
|
+
// ],
|
|
186
|
+
// [
|
|
187
|
+
// { 'tasksExportAction.startDate': 1, startDate: -1 },
|
|
188
|
+
// {
|
|
189
|
+
// name: 'searchByTasksExportActionActionStartDate',
|
|
190
|
+
// partialFilterExpression: {
|
|
191
|
+
// 'tasksExportAction.startDate': { $exists: true }
|
|
192
|
+
// }
|
|
193
|
+
// }
|
|
194
|
+
// ],
|
|
195
|
+
// [
|
|
196
|
+
// { 'tasksExportAction.actionStatus': 1, startDate: -1 },
|
|
197
|
+
// {
|
|
198
|
+
// name: 'searchByTasksExportActionActionStatus',
|
|
199
|
+
// partialFilterExpression: {
|
|
200
|
+
// 'tasksExportAction.actionStatus': { $exists: true }
|
|
201
|
+
// }
|
|
202
|
+
// }
|
|
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
|
+
// ],
|
|
215
226
|
];
|
|
216
227
|
exports.indexes = indexes;
|
|
217
228
|
/**
|
package/lib/chevre/repo/order.js
CHANGED
|
@@ -613,7 +613,9 @@ class OrderRepo {
|
|
|
613
613
|
orderNumber: params.orderNumber,
|
|
614
614
|
project: { id: params.project.id },
|
|
615
615
|
inclusion: [
|
|
616
|
-
'project', 'typeOf', 'orderNumber',
|
|
616
|
+
'project', 'typeOf', 'orderNumber',
|
|
617
|
+
'orderStatus', // すでに変更済かどうか検証するので必要
|
|
618
|
+
'dateReturned',
|
|
617
619
|
'customer', 'returner', 'seller', 'price', 'priceCurrency', 'orderDate'
|
|
618
620
|
]
|
|
619
621
|
});
|
|
@@ -5,11 +5,6 @@ exports.OrderInTransactionRepo = void 0;
|
|
|
5
5
|
const errorHandler_1 = require("../errorHandler");
|
|
6
6
|
const factory_1 = require("../factory");
|
|
7
7
|
const order_1 = require("./mongoose/schemas/order");
|
|
8
|
-
// import {
|
|
9
|
-
// createSchema as createTransactionSchema,
|
|
10
|
-
// IModel as ITransactionModel, modelName as transactionModelName,
|
|
11
|
-
// IDocType as ITransactionDocType
|
|
12
|
-
// } from './mongoose/schemas/transaction';
|
|
13
8
|
const acceptedOfferInReserve_1 = require("./acceptedOfferInReserve");
|
|
14
9
|
// const debug = createDebug('chevre-domain:repo:orderInTransaction');
|
|
15
10
|
/**
|
|
@@ -17,7 +12,6 @@ const acceptedOfferInReserve_1 = require("./acceptedOfferInReserve");
|
|
|
17
12
|
*/
|
|
18
13
|
class OrderInTransactionRepo extends acceptedOfferInReserve_1.AcceptedOfferInReserveRepo {
|
|
19
14
|
orderModel;
|
|
20
|
-
// private readonly transactionModel: ITransactionModel;
|
|
21
15
|
constructor(connection) {
|
|
22
16
|
super(connection);
|
|
23
17
|
this.orderModel = connection.model(order_1.modelName, (0, order_1.createSchema)());
|
|
@@ -12,22 +12,18 @@ interface IOperator {
|
|
|
12
12
|
/**
|
|
13
13
|
* 施設のPOSリポジトリ
|
|
14
14
|
*/
|
|
15
|
-
export declare class
|
|
15
|
+
export declare class POSRepo {
|
|
16
16
|
readonly operator: IOperator;
|
|
17
17
|
private readonly civicStructureModel;
|
|
18
18
|
constructor(connection: Connection, operater: IOperator);
|
|
19
|
-
|
|
19
|
+
findPOS(params: {
|
|
20
|
+
projectId: string;
|
|
20
21
|
limit?: number;
|
|
21
22
|
page?: number;
|
|
22
23
|
branchCode?: {
|
|
23
24
|
$eq?: string;
|
|
24
25
|
$regex?: string;
|
|
25
26
|
};
|
|
26
|
-
project?: {
|
|
27
|
-
id?: {
|
|
28
|
-
$eq?: string;
|
|
29
|
-
};
|
|
30
|
-
};
|
|
31
27
|
}): Promise<Pick<factory.place.movieTheater.IPOS, 'branchCode' | 'name' | 'id'>[]>;
|
|
32
28
|
createByBranchCode(params: Pick<factory.place.movieTheater.IPOS, 'branchCode' | 'name'> & {
|
|
33
29
|
project: {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.POSRepo = void 0;
|
|
4
4
|
const mongoose_1 = require("mongoose");
|
|
5
5
|
const factory_1 = require("../../factory");
|
|
6
6
|
const settings_1 = require("../../settings");
|
|
@@ -8,21 +8,15 @@ const civicStructure_1 = require("../mongoose/schemas/civicStructure");
|
|
|
8
8
|
/**
|
|
9
9
|
* 施設のPOSリポジトリ
|
|
10
10
|
*/
|
|
11
|
-
class
|
|
11
|
+
class POSRepo {
|
|
12
12
|
operator;
|
|
13
13
|
civicStructureModel;
|
|
14
14
|
constructor(connection, operater) {
|
|
15
15
|
this.civicStructureModel = connection.model(civicStructure_1.modelName, (0, civicStructure_1.createSchema)());
|
|
16
16
|
this.operator = operater;
|
|
17
17
|
}
|
|
18
|
-
async
|
|
19
|
-
const matchStages = [
|
|
20
|
-
{ $match: { _id: { $eq: new mongoose_1.Types.ObjectId(this.operator.id) } } }
|
|
21
|
-
];
|
|
22
|
-
const projectIdEq = params.project?.id?.$eq;
|
|
23
|
-
if (typeof projectIdEq === 'string') {
|
|
24
|
-
matchStages.push({ $match: { 'project.id': { $eq: projectIdEq } } });
|
|
25
|
-
}
|
|
18
|
+
async findPOS(params) {
|
|
19
|
+
const matchStages = [];
|
|
26
20
|
const branchCodeEq = params.branchCode?.$eq;
|
|
27
21
|
if (typeof branchCodeEq === 'string') {
|
|
28
22
|
matchStages.push({ $match: { 'hasPOS.branchCode': { $eq: branchCodeEq } } });
|
|
@@ -32,6 +26,13 @@ class HasPOSRepo {
|
|
|
32
26
|
matchStages.push({ $match: { 'hasPOS.branchCode': { $regex: new RegExp(branchCodeRegex) } } });
|
|
33
27
|
}
|
|
34
28
|
const aggregate = this.civicStructureModel.aggregate([
|
|
29
|
+
// まず施設ドキュメントで絞る
|
|
30
|
+
{
|
|
31
|
+
$match: {
|
|
32
|
+
_id: { $eq: new mongoose_1.Types.ObjectId(this.operator.id) },
|
|
33
|
+
'project.id': { $eq: params.projectId }
|
|
34
|
+
}
|
|
35
|
+
},
|
|
35
36
|
{
|
|
36
37
|
$unwind: {
|
|
37
38
|
path: '$hasPOS'
|
|
@@ -50,8 +51,8 @@ class HasPOSRepo {
|
|
|
50
51
|
]);
|
|
51
52
|
if (typeof params.limit === 'number' && params.limit > 0) {
|
|
52
53
|
const page = (typeof params.page === 'number' && params.page > 0) ? params.page : 1;
|
|
53
|
-
aggregate.
|
|
54
|
-
.
|
|
54
|
+
aggregate.skip(params.limit * (page - 1))
|
|
55
|
+
.limit(params.limit);
|
|
55
56
|
}
|
|
56
57
|
return aggregate.option({ maxTimeMS: settings_1.MONGO_MAX_TIME_MS })
|
|
57
58
|
.exec();
|
|
@@ -130,4 +131,4 @@ class HasPOSRepo {
|
|
|
130
131
|
return doc.toObject({ virtuals: true });
|
|
131
132
|
}
|
|
132
133
|
}
|
|
133
|
-
exports.
|
|
134
|
+
exports.POSRepo = POSRepo;
|
|
@@ -84,7 +84,28 @@ 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
|
+
}, options: {
|
|
104
|
+
/**
|
|
105
|
+
* 将来的にcontainedInPlace最小化のためオプション採用(2026-09-17~)
|
|
106
|
+
*/
|
|
107
|
+
minimizeContainedInPlace: boolean;
|
|
108
|
+
}): Promise<Pick<factory.place.screeningRoom.IPlace, 'additionalProperty' | 'address' | 'branchCode' | 'containedInPlace' | 'maximumAttendeeCapacity' | 'name' | 'openSeatingAllowed' | 'typeOf' | 'seatCount' | 'sectionCount'>[]>;
|
|
88
109
|
findRooms(params: Omit<factory.place.screeningRoom.ISearchConditions, '$projection'>): Promise<Pick<factory.place.screeningRoom.IPlace, 'additionalProperty' | 'address' | 'branchCode' | 'name' | 'openSeatingAllowed' | 'maximumAttendeeCapacity'>[]>;
|
|
89
110
|
/**
|
|
90
111
|
* セクションと座席も含めたひとつのルームを取得する
|
|
@@ -379,10 +379,15 @@ 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, options) {
|
|
388
|
+
const { minimizeContainedInPlace } = options;
|
|
383
389
|
const aggregate = this.placeModel.aggregate([
|
|
384
|
-
|
|
385
|
-
...ScreeningRoomRepo.CREATE_ROOM_MONGO_CONDITIONS(searchConditions),
|
|
390
|
+
...ScreeningRoomRepo.CREATE_ROOM_MONGO_CONDITIONS(params),
|
|
386
391
|
{
|
|
387
392
|
$project: {
|
|
388
393
|
_id: 0,
|
|
@@ -390,16 +395,20 @@ class ScreeningRoomRepo {
|
|
|
390
395
|
branchCode: '$branchCode',
|
|
391
396
|
name: '$name',
|
|
392
397
|
address: '$address',
|
|
393
|
-
containedInPlace:
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
398
|
+
containedInPlace: (minimizeContainedInPlace)
|
|
399
|
+
? {
|
|
400
|
+
branchCode: '$containedInPlace.branchCode',
|
|
401
|
+
}
|
|
402
|
+
: {
|
|
403
|
+
id: '$containedInPlace.id',
|
|
404
|
+
typeOf: '$containedInPlace.typeOf',
|
|
405
|
+
branchCode: '$containedInPlace.branchCode',
|
|
406
|
+
name: '$containedInPlace.name'
|
|
407
|
+
},
|
|
399
408
|
openSeatingAllowed: '$openSeatingAllowed',
|
|
400
409
|
additionalProperty: '$additionalProperty',
|
|
401
410
|
maximumAttendeeCapacity: '$maximumAttendeeCapacity',
|
|
402
|
-
...(
|
|
411
|
+
...(params.$projection?.sectionCount === 1)
|
|
403
412
|
? {
|
|
404
413
|
sectionCount: {
|
|
405
414
|
$cond: {
|
|
@@ -410,7 +419,7 @@ class ScreeningRoomRepo {
|
|
|
410
419
|
}
|
|
411
420
|
}
|
|
412
421
|
: undefined,
|
|
413
|
-
...(
|
|
422
|
+
...(params.$projection?.seatCount === 1)
|
|
414
423
|
? {
|
|
415
424
|
seatCount: {
|
|
416
425
|
$sum: {
|
|
@@ -429,14 +438,16 @@ class ScreeningRoomRepo {
|
|
|
429
438
|
}
|
|
430
439
|
: undefined
|
|
431
440
|
}
|
|
432
|
-
}
|
|
441
|
+
},
|
|
442
|
+
{ $sort: { branchCode: factory_1.factory.sortType.Ascending } }
|
|
433
443
|
]);
|
|
434
|
-
|
|
435
|
-
if (typeof
|
|
436
|
-
|
|
437
|
-
aggregate.limit(searchConditions.limit * page)
|
|
438
|
-
.skip(searchConditions.limit * (page - 1));
|
|
444
|
+
const { limit, page } = params;
|
|
445
|
+
if (typeof limit !== 'number' || limit === 0) {
|
|
446
|
+
throw new factory_1.factory.errors.ArgumentNull('limit', 'must be number > 0');
|
|
439
447
|
}
|
|
448
|
+
const pageMustBePositive = (typeof page === 'number' && page > 0) ? page : 1;
|
|
449
|
+
aggregate.skip(limit * (pageMustBePositive - 1))
|
|
450
|
+
.limit(limit);
|
|
440
451
|
return aggregate
|
|
441
452
|
.option({ maxTimeMS: settings_1.MONGO_MAX_TIME_MS })
|
|
442
453
|
.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
|
|
@@ -16,8 +16,8 @@ export type IPlaceOrder = Pick<factory.transaction.placeOrder.ITransaction, IKey
|
|
|
16
16
|
id: string;
|
|
17
17
|
};
|
|
18
18
|
type IStartedPlaceOrderFields = 'expires' | 'id' | 'startDate' | 'status';
|
|
19
|
-
export type IStartedPlaceOrder = Pick<factory.transaction.ITransaction
|
|
20
|
-
type IFindParams = factory.transaction.ISearchConditions
|
|
19
|
+
export type IStartedPlaceOrder = Pick<factory.transaction.placeOrder.ITransaction, IStartedPlaceOrderFields>;
|
|
20
|
+
type IFindParams = Pick<factory.transaction.placeOrder.ISearchConditions, 'agent' | 'ids' | 'limit' | 'object' | 'page' | 'project' | 'seller' | 'sort' | 'startFrom' | 'startThrough' | 'status' | 'statuses'> & {};
|
|
21
21
|
/**
|
|
22
22
|
* 注文取引リポジトリ
|
|
23
23
|
*/
|
|
@@ -34,14 +34,13 @@ export declare class PlaceOrderRepo {
|
|
|
34
34
|
findPlaceOrderTransactions(params: Omit<IFindParams, 'result'> & {
|
|
35
35
|
result?: never;
|
|
36
36
|
inclusion: IKeyOfProjection[];
|
|
37
|
-
}): Promise<(Pick<factory.transaction.ITransaction
|
|
37
|
+
}): Promise<(Pick<factory.transaction.placeOrder.ITransaction, IKeyOfProjection> & {
|
|
38
38
|
id: string;
|
|
39
39
|
})[]>;
|
|
40
40
|
/**
|
|
41
41
|
* 取引期限変更
|
|
42
42
|
*/
|
|
43
43
|
updateExpires(params: {
|
|
44
|
-
typeOf: factory.transactionType.PlaceOrder;
|
|
45
44
|
id: string;
|
|
46
45
|
expires: Date;
|
|
47
46
|
}): Promise<void>;
|
|
@@ -58,39 +57,34 @@ export declare class PlaceOrderRepo {
|
|
|
58
57
|
* 進行中の注文取引を取得する
|
|
59
58
|
*/
|
|
60
59
|
findPlaceOrderInProgressById(params: {
|
|
61
|
-
typeOf: factory.transactionType.PlaceOrder;
|
|
62
60
|
id: string;
|
|
63
61
|
}, inclusion: IKeyOfProjection[]): Promise<ITransactionInProgress>;
|
|
64
62
|
/**
|
|
65
63
|
* 特定注文取引参照
|
|
66
64
|
*/
|
|
67
65
|
findPlaceOrderById(params: {
|
|
68
|
-
typeOf: factory.transactionType.PlaceOrder;
|
|
69
66
|
id: string;
|
|
70
67
|
}, inclusion: IKeyOfProjection[]): Promise<IPlaceOrder>;
|
|
71
68
|
/**
|
|
72
69
|
* 取引を開始する
|
|
73
70
|
*/
|
|
74
|
-
startPlaceOrder(params: factory.transaction.IStartParams
|
|
71
|
+
startPlaceOrder(params: factory.transaction.placeOrder.IStartParams): Promise<IStartedPlaceOrder>;
|
|
75
72
|
/**
|
|
76
73
|
* 取引を確定する
|
|
77
74
|
*/
|
|
78
75
|
confirmPlaceOrder(params: {
|
|
79
|
-
typeOf: factory.transactionType.PlaceOrder;
|
|
80
76
|
id: string;
|
|
81
77
|
object: {
|
|
82
78
|
orderDate: Date;
|
|
83
79
|
orderNumber: string;
|
|
84
80
|
confirmationNumber: string;
|
|
85
81
|
};
|
|
86
|
-
result: factory.transaction.IResult
|
|
87
|
-
potentialActions?: factory.transaction.IPotentialActions<factory.transactionType.PlaceOrder>;
|
|
82
|
+
result: factory.transaction.placeOrder.IResult;
|
|
88
83
|
}): Promise<void>;
|
|
89
84
|
/**
|
|
90
85
|
* 取引を中止する
|
|
91
86
|
*/
|
|
92
87
|
cancelPlaceOrder(params: {
|
|
93
|
-
typeOf: factory.transactionType.PlaceOrder;
|
|
94
88
|
id: string;
|
|
95
89
|
}): Promise<void>;
|
|
96
90
|
}
|