@chevre/domain 28.0.0-alpha.1 → 28.0.0-alpha.11
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} +8 -7
- package/lib/chevre/repo/place/{hasPOS.js → pos.js} +17 -15
- 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 +4 -5
- 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
|
@@ -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
|
/**
|
|
@@ -35,17 +35,17 @@ class PlaceOrderRepo {
|
|
|
35
35
|
this.transactionModel = connection.model(transaction_2.modelName, (0, transaction_2.createSchema)());
|
|
36
36
|
}
|
|
37
37
|
static CREATE_MONGO_CONDITIONS(params) {
|
|
38
|
-
if (params.typeOf !==
|
|
39
|
-
|
|
40
|
-
}
|
|
38
|
+
// if (params.typeOf !== factory.transactionType.PlaceOrder) {
|
|
39
|
+
// throw new factory.errors.Argument('typeOf', `must be ${factory.transactionType.PlaceOrder}`);
|
|
40
|
+
// }
|
|
41
41
|
const andConditions = [];
|
|
42
42
|
const projectIdEq = params.project?.id?.$eq;
|
|
43
43
|
if (typeof projectIdEq === 'string') {
|
|
44
44
|
andConditions.push({ 'project.id': { $eq: projectIdEq } });
|
|
45
45
|
}
|
|
46
|
-
if (typeof params.typeOf === 'string') {
|
|
47
|
-
|
|
48
|
-
}
|
|
46
|
+
// if (typeof params.typeOf === 'string') {
|
|
47
|
+
// andConditions.push({ typeOf: { $eq: params.typeOf } });
|
|
48
|
+
// }
|
|
49
49
|
if (params.startFrom !== undefined) {
|
|
50
50
|
andConditions.push({
|
|
51
51
|
startDate: { $gte: params.startFrom }
|
|
@@ -56,22 +56,22 @@ class PlaceOrderRepo {
|
|
|
56
56
|
startDate: { $lte: params.startThrough }
|
|
57
57
|
});
|
|
58
58
|
}
|
|
59
|
-
if (params.endFrom !== undefined) {
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
}
|
|
67
|
-
if (params.endThrough !== undefined) {
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
}
|
|
59
|
+
// if (params.endFrom !== undefined) {
|
|
60
|
+
// andConditions.push({
|
|
61
|
+
// endDate: {
|
|
62
|
+
// $exists: true,
|
|
63
|
+
// $gte: params.endFrom
|
|
64
|
+
// }
|
|
65
|
+
// });
|
|
66
|
+
// }
|
|
67
|
+
// if (params.endThrough !== undefined) {
|
|
68
|
+
// andConditions.push({
|
|
69
|
+
// endDate: {
|
|
70
|
+
// $exists: true,
|
|
71
|
+
// $lt: params.endThrough
|
|
72
|
+
// }
|
|
73
|
+
// });
|
|
74
|
+
// }
|
|
75
75
|
if (Array.isArray(params.ids)) {
|
|
76
76
|
andConditions.push({
|
|
77
77
|
_id: { $in: params.ids }
|
|
@@ -84,56 +84,23 @@ 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
|
-
}
|
|
112
|
-
}
|
|
113
|
-
const tasksExportActionStatusIn = params.tasksExportAction?.actionStatus?.$in;
|
|
114
|
-
if (Array.isArray(tasksExportActionStatusIn)) {
|
|
115
|
-
andConditions.push({ 'tasksExportAction.actionStatus': { $exists: true, $in: tasksExportActionStatusIn } });
|
|
116
|
-
}
|
|
117
|
-
const tasksExportActionStatusEq = params.tasksExportAction?.actionStatus?.$eq;
|
|
118
|
-
if (typeof tasksExportActionStatusEq === 'string') {
|
|
119
|
-
andConditions.push({ 'tasksExportAction.actionStatus': { $exists: true, $eq: tasksExportActionStatusEq } });
|
|
87
|
+
const agentIdentifierIn = params.agent?.identifiers;
|
|
88
|
+
if (Array.isArray(agentIdentifierIn)) {
|
|
89
|
+
andConditions.push({ 'agent.identifier': { $exists: true, $in: agentIdentifierIn } });
|
|
120
90
|
}
|
|
91
|
+
// discontinue(2026-09-11~)
|
|
92
|
+
// const tasksExportActionStatusIn = params.tasksExportAction?.actionStatus?.$in;
|
|
93
|
+
// if (Array.isArray(tasksExportActionStatusIn)) {
|
|
94
|
+
// andConditions.push({ 'tasksExportAction.actionStatus': { $exists: true, $in: tasksExportActionStatusIn } });
|
|
95
|
+
// }
|
|
96
|
+
// const tasksExportActionStatusEq = params.tasksExportAction?.actionStatus?.$eq;
|
|
97
|
+
// if (typeof tasksExportActionStatusEq === 'string') {
|
|
98
|
+
// andConditions.push({ 'tasksExportAction.actionStatus': { $exists: true, $eq: tasksExportActionStatusEq } });
|
|
99
|
+
// }
|
|
121
100
|
const sellerIdIn = params.seller?.ids;
|
|
122
101
|
if (Array.isArray(sellerIdIn)) {
|
|
123
102
|
andConditions.push({ 'seller.id': { $exists: true, $in: sellerIdIn } });
|
|
124
103
|
}
|
|
125
|
-
// result.orderは完全に廃止したので検索条件としても廃止(2026-06-26~)
|
|
126
|
-
// const resultOrderNumberIn = params.result?.order?.orderNumbers;
|
|
127
|
-
// if (Array.isArray(resultOrderNumberIn)) {
|
|
128
|
-
// andConditions.push({ 'result.order.orderNumber': { $exists: true, $in: resultOrderNumberIn } });
|
|
129
|
-
// }
|
|
130
|
-
// result.orderは完全に廃止したので検索条件としても廃止(2026-06-26~)
|
|
131
|
-
// const resultOrderConfirmationNumberEq = params.result?.order?.confirmationNumber?.$eq;
|
|
132
|
-
// if (typeof resultOrderConfirmationNumberEq === 'string') {
|
|
133
|
-
// andConditions.push({
|
|
134
|
-
// 'result.order.confirmationNumber': { $exists: true, $eq: resultOrderConfirmationNumberEq }
|
|
135
|
-
// });
|
|
136
|
-
// }
|
|
137
104
|
const objectOrderNumberEq = params.object?.orderNumber?.$eq;
|
|
138
105
|
if (typeof objectOrderNumberEq === 'string') {
|
|
139
106
|
andConditions.push({ 'object.orderNumber': { $exists: true, $eq: objectOrderNumberEq } });
|
|
@@ -186,62 +153,12 @@ class PlaceOrderRepo {
|
|
|
186
153
|
.lean()
|
|
187
154
|
.exec();
|
|
188
155
|
}
|
|
189
|
-
// /**
|
|
190
|
-
// * 取引の注文番号を検索する
|
|
191
|
-
// */
|
|
192
|
-
// public async findInProgressOrderNumberById(params: {
|
|
193
|
-
// id: string;
|
|
194
|
-
// }): Promise<string | undefined> {
|
|
195
|
-
// const doc = await this.transactionModel.findOne(
|
|
196
|
-
// {
|
|
197
|
-
// _id: { $eq: params.id },
|
|
198
|
-
// typeOf: { $eq: factory.transactionType.PlaceOrder },
|
|
199
|
-
// status: { $eq: factory.transactionStatusType.InProgress }
|
|
200
|
-
// },
|
|
201
|
-
// { 'object.orderNumber': 1 }
|
|
202
|
-
// )
|
|
203
|
-
// .lean<{ object: Pick<factory.transaction.placeOrder.IObject, 'orderNumber'> }>() // 2024-08-26~
|
|
204
|
-
// .exec();
|
|
205
|
-
// if (doc === null) {
|
|
206
|
-
// throw new factory.errors.NotFound(
|
|
207
|
-
// this.transactionModel.modelName,
|
|
208
|
-
// `${factory.transactionType.PlaceOrder} ${factory.transactionStatusType.InProgress} not found`
|
|
209
|
-
// );
|
|
210
|
-
// }
|
|
211
|
-
// return doc.object.orderNumber;
|
|
212
|
-
// }
|
|
213
|
-
// /**
|
|
214
|
-
// * 取引の確認番号を検索する
|
|
215
|
-
// */
|
|
216
|
-
// public async findInProgressConfirmationNumberById(params: {
|
|
217
|
-
// id: string;
|
|
218
|
-
// status: { $in: factory.transactionStatusType[] };
|
|
219
|
-
// }): Promise<string | undefined> {
|
|
220
|
-
// const doc = await this.transactionModel.findOne(
|
|
221
|
-
// {
|
|
222
|
-
// _id: { $eq: params.id },
|
|
223
|
-
// typeOf: { $eq: factory.transactionType.PlaceOrder },
|
|
224
|
-
// status: { $in: params.status.$in }
|
|
225
|
-
// },
|
|
226
|
-
// { 'object.confirmationNumber': 1 }
|
|
227
|
-
// )
|
|
228
|
-
// .lean<{ object: Pick<factory.transaction.placeOrder.IObject, 'confirmationNumber'> }>() // 2024-08-26~
|
|
229
|
-
// .exec();
|
|
230
|
-
// if (doc === null) {
|
|
231
|
-
// throw new factory.errors.NotFound(
|
|
232
|
-
// this.transactionModel.modelName,
|
|
233
|
-
// `${factory.transactionType.PlaceOrder} ${params.status.$in.join(' or ')} not found`
|
|
234
|
-
// );
|
|
235
|
-
// }
|
|
236
|
-
// return doc.object.confirmationNumber;
|
|
237
|
-
// }
|
|
238
156
|
/**
|
|
239
157
|
* 取引期限変更
|
|
240
158
|
*/
|
|
241
159
|
async updateExpires(params) {
|
|
242
160
|
const doc = await this.transactionModel.findOneAndUpdate({
|
|
243
161
|
_id: { $eq: params.id },
|
|
244
|
-
typeOf: { $eq: params.typeOf },
|
|
245
162
|
status: { $eq: factory_1.factory.transactionStatusType.InProgress }
|
|
246
163
|
}, {
|
|
247
164
|
$set: {
|
|
@@ -253,7 +170,7 @@ class PlaceOrderRepo {
|
|
|
253
170
|
.lean()
|
|
254
171
|
.exec();
|
|
255
172
|
if (doc === null) {
|
|
256
|
-
throw new factory_1.factory.errors.NotFound(this.transactionModel.modelName, `${
|
|
173
|
+
throw new factory_1.factory.errors.NotFound(this.transactionModel.modelName, `${factory_1.factory.transactionType.PlaceOrder} ${factory_1.factory.transactionStatusType.InProgress} not found`);
|
|
257
174
|
}
|
|
258
175
|
}
|
|
259
176
|
/**
|
|
@@ -303,7 +220,6 @@ class PlaceOrderRepo {
|
|
|
303
220
|
};
|
|
304
221
|
const filter = {
|
|
305
222
|
_id: { $eq: params.id },
|
|
306
|
-
typeOf: { $eq: params.typeOf },
|
|
307
223
|
status: { $eq: factory_1.factory.transactionStatusType.InProgress },
|
|
308
224
|
// expiresを条件に追加(2023-05-12~),
|
|
309
225
|
expires: { $gt: new Date() }
|
|
@@ -312,7 +228,7 @@ class PlaceOrderRepo {
|
|
|
312
228
|
.lean()
|
|
313
229
|
.exec();
|
|
314
230
|
if (doc === null) {
|
|
315
|
-
throw new factory_1.factory.errors.NotFound(this.transactionModel.modelName, `${
|
|
231
|
+
throw new factory_1.factory.errors.NotFound(this.transactionModel.modelName, `${factory_1.factory.transactionType.PlaceOrder} ${factory_1.factory.transactionStatusType.InProgress} not found`);
|
|
316
232
|
}
|
|
317
233
|
return doc;
|
|
318
234
|
}
|
|
@@ -334,13 +250,12 @@ class PlaceOrderRepo {
|
|
|
334
250
|
...Object.fromEntries(positiveProjectionFields.map((key) => ([key, 1])))
|
|
335
251
|
};
|
|
336
252
|
const doc = await this.transactionModel.findOne({
|
|
337
|
-
_id: { $eq: params.id }
|
|
338
|
-
typeOf: { $eq: params.typeOf }
|
|
253
|
+
_id: { $eq: params.id }
|
|
339
254
|
}, projection)
|
|
340
255
|
.lean() // 2024-08-26~
|
|
341
256
|
.exec();
|
|
342
257
|
if (doc === null) {
|
|
343
|
-
throw new factory_1.factory.errors.NotFound(this.transactionModel.modelName, `${
|
|
258
|
+
throw new factory_1.factory.errors.NotFound(this.transactionModel.modelName, `${factory_1.factory.transactionType.PlaceOrder} not found`);
|
|
344
259
|
}
|
|
345
260
|
return doc;
|
|
346
261
|
}
|
|
@@ -353,7 +268,7 @@ class PlaceOrderRepo {
|
|
|
353
268
|
// const tasksExportationStatus = factory.transactionTasksExportationStatus.Unexported; // discontinue(2024-06-20~)
|
|
354
269
|
const startDate = new Date();
|
|
355
270
|
let expires;
|
|
356
|
-
const
|
|
271
|
+
const typeOf = factory_1.factory.transactionType.PlaceOrder;
|
|
357
272
|
// expiresInSecondsの指定があれば優先して適用する(2022-11-25~)
|
|
358
273
|
if (typeof params.expiresInSeconds === 'number' && params.expiresInSeconds > 0) {
|
|
359
274
|
expires = (0, moment_1.default)(startDate)
|
|
@@ -363,18 +278,12 @@ class PlaceOrderRepo {
|
|
|
363
278
|
else {
|
|
364
279
|
throw new factory_1.factory.errors.ArgumentNull('expiresInSeconds');
|
|
365
280
|
}
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
...(typeof instrument?.id === 'string') ? { instrument } : undefined
|
|
373
|
-
};
|
|
374
|
-
}
|
|
375
|
-
else {
|
|
376
|
-
throw new factory_1.factory.errors.NotImplemented(`${typeOf} not implemented`);
|
|
377
|
-
}
|
|
281
|
+
const { agent, project, object, seller, instrument } = params;
|
|
282
|
+
const creatingTransaction = {
|
|
283
|
+
status, startDate, expires, typeOf, tasksExportAction,
|
|
284
|
+
agent, project, seller, object,
|
|
285
|
+
...(typeof instrument?.id === 'string') ? { instrument } : undefined
|
|
286
|
+
};
|
|
378
287
|
// reimplemnt with insertMany(2024-05-30~)
|
|
379
288
|
const result = await this.transactionModel.insertMany(creatingTransaction, { rawResult: true });
|
|
380
289
|
const id = result.insertedIds?.[0]?.toHexString();
|
|
@@ -392,7 +301,6 @@ class PlaceOrderRepo {
|
|
|
392
301
|
const endDate = new Date();
|
|
393
302
|
const doc = await this.transactionModel.findOneAndUpdate({
|
|
394
303
|
_id: { $eq: params.id },
|
|
395
|
-
typeOf: { $eq: params.typeOf },
|
|
396
304
|
status: { $eq: factory_1.factory.transactionStatusType.InProgress },
|
|
397
305
|
expires: { $gt: endDate } // add expires(2025-02-27~)
|
|
398
306
|
}, {
|
|
@@ -402,7 +310,7 @@ class PlaceOrderRepo {
|
|
|
402
310
|
'object.orderNumber': params.object.orderNumber, // add(2026-06-27~)
|
|
403
311
|
'object.confirmationNumber': params.object.confirmationNumber, // add(2026-07-08~)
|
|
404
312
|
result: params.result, // resultを更新
|
|
405
|
-
...((params.potentialActions !== undefined) && { potentialActions: params.potentialActions }) // support undefined(2026-07-17~)
|
|
313
|
+
// ...((params.potentialActions !== undefined) && { potentialActions: params.potentialActions }) // support undefined(2026-07-17~)
|
|
406
314
|
}, {
|
|
407
315
|
new: true,
|
|
408
316
|
projection: { _id: 1 }
|
|
@@ -411,7 +319,7 @@ class PlaceOrderRepo {
|
|
|
411
319
|
.exec();
|
|
412
320
|
// NotFoundであれば取引状態確認
|
|
413
321
|
if (doc === null) {
|
|
414
|
-
const { expires, status } = await this.findPlaceOrderById({
|
|
322
|
+
const { expires, status } = await this.findPlaceOrderById({ id: params.id }, ['expires', 'status']);
|
|
415
323
|
if (status === factory_1.factory.transactionStatusType.Confirmed) {
|
|
416
324
|
// すでに確定済の場合スルー
|
|
417
325
|
}
|
|
@@ -426,12 +334,12 @@ class PlaceOrderRepo {
|
|
|
426
334
|
.isSameOrBefore((0, moment_1.default)(endDate))) {
|
|
427
335
|
throw new factory_1.factory.errors.Argument('Transaction id', 'potentially expired');
|
|
428
336
|
}
|
|
429
|
-
throw new factory_1.factory.errors.NotFound(this.transactionModel.modelName, `${
|
|
337
|
+
throw new factory_1.factory.errors.NotFound(this.transactionModel.modelName, `${factory_1.factory.transactionType.PlaceOrder} ${factory_1.factory.transactionStatusType.InProgress} not found`);
|
|
430
338
|
}
|
|
431
339
|
}
|
|
432
340
|
transaction_1.transactionEventEmitter.emitTransactionStatusChanged({
|
|
433
341
|
id: params.id,
|
|
434
|
-
typeOf:
|
|
342
|
+
typeOf: factory_1.factory.transactionType.PlaceOrder,
|
|
435
343
|
status: factory_1.factory.transactionStatusType.Confirmed
|
|
436
344
|
});
|
|
437
345
|
}
|
|
@@ -442,7 +350,6 @@ class PlaceOrderRepo {
|
|
|
442
350
|
const endDate = new Date();
|
|
443
351
|
// 進行中ステータスの取引を中止する
|
|
444
352
|
const doc = await this.transactionModel.findOneAndUpdate({
|
|
445
|
-
typeOf: params.typeOf,
|
|
446
353
|
_id: params.id,
|
|
447
354
|
status: factory_1.factory.transactionStatusType.InProgress
|
|
448
355
|
}, {
|
|
@@ -467,12 +374,12 @@ class PlaceOrderRepo {
|
|
|
467
374
|
throw new factory_1.factory.errors.Argument('Transaction id', 'Confirmed transaction unable to cancel');
|
|
468
375
|
}
|
|
469
376
|
else {
|
|
470
|
-
throw new factory_1.factory.errors.NotFound(this.transactionModel.modelName, `${
|
|
377
|
+
throw new factory_1.factory.errors.NotFound(this.transactionModel.modelName, `${factory_1.factory.transactionType.PlaceOrder} ${factory_1.factory.transactionStatusType.InProgress} not found`);
|
|
471
378
|
}
|
|
472
379
|
}
|
|
473
380
|
transaction_1.transactionEventEmitter.emitTransactionStatusChanged({
|
|
474
381
|
id: params.id,
|
|
475
|
-
typeOf:
|
|
382
|
+
typeOf: factory_1.factory.transactionType.PlaceOrder,
|
|
476
383
|
status: factory_1.factory.transactionStatusType.Canceled
|
|
477
384
|
});
|
|
478
385
|
}
|
|
@@ -15,7 +15,7 @@ export declare class ReturnOrderInProgressRepo {
|
|
|
15
15
|
/**
|
|
16
16
|
* 取引を開始する
|
|
17
17
|
*/
|
|
18
|
-
startReturnOrder(params: factory.transaction.returnOrder.IStartParams): Promise<IStartedTransaction>;
|
|
18
|
+
startReturnOrder(params: Pick<factory.transaction.returnOrder.IStartParams, 'agent' | 'expiresInSeconds' | 'object' | 'project' | 'typeOf'>): Promise<IStartedTransaction>;
|
|
19
19
|
findReturnOrderById(params: {
|
|
20
20
|
id: string;
|
|
21
21
|
}): Promise<IReturnOrderAsFindResult>;
|
|
@@ -26,7 +26,7 @@ export declare class TransactionRepo {
|
|
|
26
26
|
endDate?: factory.sortType;
|
|
27
27
|
startDate?: factory.sortType;
|
|
28
28
|
};
|
|
29
|
-
}): Promise<Pick<factory.transaction.ITransaction
|
|
29
|
+
}): Promise<Pick<factory.transaction.placeOrder.ITransaction, 'id' | 'typeOf'> | null>;
|
|
30
30
|
/**
|
|
31
31
|
* set task status exported by transaction id
|
|
32
32
|
* IDでタスクをエクスポート済に変更する
|
|
@@ -30,7 +30,6 @@ class TransactionRepo {
|
|
|
30
30
|
throw new factory_1.factory.errors.Argument('endDate.$lt', 'must be Date');
|
|
31
31
|
}
|
|
32
32
|
const query = this.transactionModel.findOneAndUpdate({
|
|
33
|
-
// ...(Array.isArray(typeOfIn)) ? { typeOf: { $in: typeOfIn } } : undefined,
|
|
34
33
|
status: {
|
|
35
34
|
...(typeof statusEq === 'string')
|
|
36
35
|
? { $eq: statusEq }
|
|
@@ -28,6 +28,7 @@ import type { AdminAssetTransactionRepo } from './repo/adminAssetTransaction';
|
|
|
28
28
|
import type { AdminCheckMovieTicketActionRepo } from './repo/adminCheckMovieTicketAction';
|
|
29
29
|
import type { AdminAsyncActionRepo } from './repo/adminAsyncAction';
|
|
30
30
|
import type { AdminEventRepo } from './repo/adminEvent';
|
|
31
|
+
import type { AdminEventSeriesRepo } from './repo/adminEventSeries';
|
|
31
32
|
import type { AdminPendingReservationRepo } from './repo/adminPendingReservation';
|
|
32
33
|
import type { AdminScheduledTaskRepo } from './repo/adminScheduledTask';
|
|
33
34
|
import type { AdminTaskRepo } from './repo/adminTask';
|
|
@@ -79,7 +80,7 @@ import type { PaymentServiceChannelRepo } from './repo/paymentServiceChannel';
|
|
|
79
80
|
import type { PaymentServiceProviderRepo } from './repo/paymentServiceProvider';
|
|
80
81
|
import type { PendingReservationRepo } from './repo/pendingReservation';
|
|
81
82
|
import type { EntranceGateRepo } from './repo/place/entranceGate';
|
|
82
|
-
import type {
|
|
83
|
+
import type { POSRepo } from './repo/place/pos';
|
|
83
84
|
import type { MovieTheaterRepo } from './repo/place/movieTheater';
|
|
84
85
|
import type { ScreeningRoomRepo } from './repo/place/screeningRoom';
|
|
85
86
|
import type { SeatRepo } from './repo/place/seat';
|
|
@@ -226,6 +227,10 @@ export type AdminEvent = AdminEventRepo;
|
|
|
226
227
|
export declare namespace AdminEvent {
|
|
227
228
|
function createInstance(...params: ConstructorParameters<typeof AdminEventRepo>): Promise<AdminEventRepo>;
|
|
228
229
|
}
|
|
230
|
+
export type AdminEventSeries = AdminEventSeriesRepo;
|
|
231
|
+
export declare namespace AdminEventSeries {
|
|
232
|
+
function createInstance(...params: ConstructorParameters<typeof AdminEventSeriesRepo>): Promise<AdminEventSeriesRepo>;
|
|
233
|
+
}
|
|
229
234
|
export type AdminPendingReservation = AdminPendingReservationRepo;
|
|
230
235
|
export declare namespace AdminPendingReservation {
|
|
231
236
|
function createInstance(...params: ConstructorParameters<typeof AdminPendingReservationRepo>): Promise<AdminPendingReservationRepo>;
|
|
@@ -448,12 +453,12 @@ export declare namespace place {
|
|
|
448
453
|
namespace EntranceGate {
|
|
449
454
|
function createInstance(...params: ConstructorParameters<typeof EntranceGateRepo>): Promise<EntranceGateRepo>;
|
|
450
455
|
}
|
|
451
|
-
type
|
|
456
|
+
type POS = POSRepo;
|
|
452
457
|
/**
|
|
453
|
-
*
|
|
458
|
+
* 施設のPOSリポジトリ
|
|
454
459
|
*/
|
|
455
|
-
namespace
|
|
456
|
-
function createInstance(...params: ConstructorParameters<typeof
|
|
460
|
+
namespace POS {
|
|
461
|
+
function createInstance(...params: ConstructorParameters<typeof POSRepo>): Promise<POSRepo>;
|
|
457
462
|
}
|
|
458
463
|
type MovieTheater = MovieTheaterRepo;
|
|
459
464
|
/**
|
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 = exports.Order = exports.Offer = exports.OfferItemCondition = exports.OfferCatalogItem = exports.OfferCatalog = exports.NoteAboutOrder = exports.Note = void 0;
|
|
3
|
+
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.AggregateEvent = exports.AggregateAssetTransaction = exports.AggregateTransaction = exports.AggregateTask = exports.AggregateScheduledTask = exports.AggregateUseAction = exports.AggregateCheckMovieTicketAction = exports.AggregateAction = exports.AdminTransaction = exports.AdminTask = exports.AdminScheduledTask = exports.AdminPendingReservation = exports.AdminEventSeries = exports.AdminEvent = exports.AdminAsyncAction = exports.AdminAssetTransaction = exports.AdminCheckMovieTicketAction = exports.AdminAction = exports.AdminAcceptedOffer = exports.AdminAccountingReport = exports.AdditionalProperty = 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 = exports.Offer = exports.OfferItemCondition = exports.OfferCatalogItem = exports.OfferCatalog = exports.NoteAboutOrder = exports.Note = exports.MovieTicketType = void 0;
|
|
5
5
|
var AcceptedOffer;
|
|
6
6
|
(function (AcceptedOffer) {
|
|
7
7
|
let repo;
|
|
@@ -291,6 +291,17 @@ var AdminEvent;
|
|
|
291
291
|
}
|
|
292
292
|
AdminEvent.createInstance = createInstance;
|
|
293
293
|
})(AdminEvent || (exports.AdminEvent = AdminEvent = {}));
|
|
294
|
+
var AdminEventSeries;
|
|
295
|
+
(function (AdminEventSeries) {
|
|
296
|
+
let repo;
|
|
297
|
+
async function createInstance(...params) {
|
|
298
|
+
if (repo === undefined) {
|
|
299
|
+
repo = (await import('./repo/adminEventSeries.js')).AdminEventSeriesRepo;
|
|
300
|
+
}
|
|
301
|
+
return new repo(...params);
|
|
302
|
+
}
|
|
303
|
+
AdminEventSeries.createInstance = createInstance;
|
|
304
|
+
})(AdminEventSeries || (exports.AdminEventSeries = AdminEventSeries = {}));
|
|
294
305
|
var AdminPendingReservation;
|
|
295
306
|
(function (AdminPendingReservation) {
|
|
296
307
|
let repo;
|
|
@@ -894,19 +905,19 @@ var place;
|
|
|
894
905
|
EntranceGate.createInstance = createInstance;
|
|
895
906
|
})(EntranceGate = place.EntranceGate || (place.EntranceGate = {}));
|
|
896
907
|
/**
|
|
897
|
-
*
|
|
908
|
+
* 施設のPOSリポジトリ
|
|
898
909
|
*/
|
|
899
|
-
let
|
|
900
|
-
(function (
|
|
910
|
+
let POS;
|
|
911
|
+
(function (POS) {
|
|
901
912
|
let repo;
|
|
902
913
|
async function createInstance(...params) {
|
|
903
914
|
if (repo === undefined) {
|
|
904
|
-
repo = (await import('./repo/place/
|
|
915
|
+
repo = (await import('./repo/place/pos.js')).POSRepo;
|
|
905
916
|
}
|
|
906
917
|
return new repo(...params);
|
|
907
918
|
}
|
|
908
|
-
|
|
909
|
-
})(
|
|
919
|
+
POS.createInstance = createInstance;
|
|
920
|
+
})(POS = place.POS || (place.POS = {}));
|
|
910
921
|
/**
|
|
911
922
|
* 施設リポジトリ
|
|
912
923
|
*/
|
|
@@ -22,8 +22,7 @@ function aggregateOffers(params) {
|
|
|
22
22
|
const eventCapacity = (await repos.event.projectEventFields({
|
|
23
23
|
limit: 1,
|
|
24
24
|
page: 1,
|
|
25
|
-
id: { $eq: params.id }
|
|
26
|
-
typeOf: params.typeOf
|
|
25
|
+
id: { $eq: params.id }
|
|
27
26
|
}, ['maximumAttendeeCapacity', 'remainingAttendeeCapacity'])).shift();
|
|
28
27
|
debug('processing aggregateOffersByEvent...', eventCapacity);
|
|
29
28
|
await aggregateOffersByEvent({
|
|
@@ -53,7 +53,6 @@ function aggregateScreeningEvent(params) {
|
|
|
53
53
|
limit: 100,
|
|
54
54
|
page: 1,
|
|
55
55
|
project: { id: { $eq: event.project.id } },
|
|
56
|
-
typeOf: event.typeOf,
|
|
57
56
|
eventStatuses: [factory_1.factory.eventStatusType.EventScheduled],
|
|
58
57
|
startFrom: startFrom,
|
|
59
58
|
startThrough: startThrough,
|
|
@@ -137,8 +137,7 @@ function aggregatePlaceOrder(params) {
|
|
|
137
137
|
const aggregateResult = await repos.aggregateTransaction.aggregatePlaceOrder({
|
|
138
138
|
project: { id: { $ne: params.excludedProjectId } },
|
|
139
139
|
startFrom,
|
|
140
|
-
startThrough
|
|
141
|
-
typeOf: factory_1.factory.transactionType.PlaceOrder
|
|
140
|
+
startThrough
|
|
142
141
|
});
|
|
143
142
|
debug('aggregatePlaceOrder:result', aggregateResult, aggregateResult.statuses[0]?.aggregation, startFrom);
|
|
144
143
|
const aggregateResultsByClientId = [];
|
|
@@ -148,7 +147,6 @@ function aggregatePlaceOrder(params) {
|
|
|
148
147
|
project: { id: { $ne: params.excludedProjectId } },
|
|
149
148
|
startFrom,
|
|
150
149
|
startThrough,
|
|
151
|
-
typeOf: factory_1.factory.transactionType.PlaceOrder,
|
|
152
150
|
clientId
|
|
153
151
|
});
|
|
154
152
|
debug('aggregateResultByClientId', aggregateResultByClientId, aggregateResultByClientId.statuses[0]?.aggregation, clientId, startFrom);
|
|
@@ -81,8 +81,7 @@ function validateAcceptedPaymentMethodIfNeeded(params
|
|
|
81
81
|
const eventSeriesIds = (await repos.event.projectEventFields({
|
|
82
82
|
limit: checkingEventIds.length,
|
|
83
83
|
page: 1,
|
|
84
|
-
id: { $in: checkingEventIds }
|
|
85
|
-
typeOf: factory_1.factory.eventType.ScreeningEvent
|
|
84
|
+
id: { $in: checkingEventIds }
|
|
86
85
|
}, ['superEvent'])).map((event) => event.superEvent.id);
|
|
87
86
|
if (eventSeriesIds.length !== checkingEventIds.length) {
|
|
88
87
|
throw new factory_1.factory.errors.NotFound(factory_1.factory.eventType.ScreeningEvent);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { COA } from '@motionpicture/coa-service';
|
|
2
2
|
import type { CategoryCodeRepo } from '../../repo/categoryCode';
|
|
3
3
|
import type { CreativeWorkRepo } from '../../repo/creativeWork';
|
|
4
|
-
import type {
|
|
4
|
+
import type { AdminEventSeriesRepo } from '../../repo/adminEventSeries';
|
|
5
5
|
import { factory } from '../../factory';
|
|
6
6
|
type IMovieTheater = Pick<factory.place.movieTheater.IPlace, 'id' | 'typeOf' | 'branchCode' | 'name' | 'kanaName'>;
|
|
7
7
|
/**
|
|
@@ -46,7 +46,7 @@ declare function saveScreeningEventSeries(params: {
|
|
|
46
46
|
}): (repos: {
|
|
47
47
|
categoryCode: CategoryCodeRepo;
|
|
48
48
|
creativeWork: CreativeWorkRepo;
|
|
49
|
-
|
|
49
|
+
adminEventSeries: AdminEventSeriesRepo;
|
|
50
50
|
masterService: COA.service.Master;
|
|
51
51
|
}) => Promise<{
|
|
52
52
|
screeningEventSerieses: factory.eventSeries.IEvent[];
|
|
@@ -121,7 +121,7 @@ function saveScreeningEventSeries(params, options) {
|
|
|
121
121
|
});
|
|
122
122
|
}
|
|
123
123
|
debug('saving', saveParams.length, 'ScreeningEventSeries...');
|
|
124
|
-
await repos.
|
|
124
|
+
await repos.adminEventSeries.upsertManyEventSeriesById4sskts(saveParams);
|
|
125
125
|
debug('saved', saveParams.length, 'ScreeningEventSeries');
|
|
126
126
|
savedEventsCount = saveParams.length;
|
|
127
127
|
// コンテンツ永続化(2023-10-23~)
|
|
@@ -2,6 +2,7 @@ import type { COA } from '@motionpicture/coa-service';
|
|
|
2
2
|
import type { CategoryCodeRepo } from '../../repo/categoryCode';
|
|
3
3
|
import type { CreativeWorkRepo } from '../../repo/creativeWork';
|
|
4
4
|
import type { AdminEventRepo } from '../../repo/adminEvent';
|
|
5
|
+
import type { AdminEventSeriesRepo } from '../../repo/adminEventSeries';
|
|
5
6
|
import type { EventSeriesRepo } from '../../repo/eventSeries';
|
|
6
7
|
import { factory } from '../../factory';
|
|
7
8
|
type IMovieTheater = Pick<factory.place.movieTheater.IPlace, 'id' | 'typeOf' | 'branchCode' | 'name' | 'kanaName'>;
|
|
@@ -29,6 +30,7 @@ declare function saveScreeningEvents(params: {
|
|
|
29
30
|
categoryCode: CategoryCodeRepo;
|
|
30
31
|
creativeWork: CreativeWorkRepo;
|
|
31
32
|
adminEvent: AdminEventRepo;
|
|
33
|
+
adminEventSeries: AdminEventSeriesRepo;
|
|
32
34
|
eventSeries: EventSeriesRepo;
|
|
33
35
|
masterService: COA.service.Master;
|
|
34
36
|
}) => Promise<factory.event.screeningEvent.IEvent[]>;
|
|
@@ -6,6 +6,7 @@ import type { UpdateActionRepo } from '../repo/action/update';
|
|
|
6
6
|
import type { CategoryCodeRepo } from '../repo/categoryCode';
|
|
7
7
|
import type { CreativeWorkRepo } from '../repo/creativeWork';
|
|
8
8
|
import type { AdminEventRepo } from '../repo/adminEvent';
|
|
9
|
+
import type { AdminEventSeriesRepo } from '../repo/adminEventSeries';
|
|
9
10
|
import type { EventRepo } from '../repo/event';
|
|
10
11
|
import type { EventSeriesRepo } from '../repo/eventSeries';
|
|
11
12
|
import type { MovieTheaterRepo } from '../repo/place/movieTheater';
|
|
@@ -24,6 +25,7 @@ declare function importFromCOA(params: IImportFromCOAParams): (repos: {
|
|
|
24
25
|
categoryCode: CategoryCodeRepo;
|
|
25
26
|
creativeWork: CreativeWorkRepo;
|
|
26
27
|
adminEvent: AdminEventRepo;
|
|
28
|
+
adminEventSeries: AdminEventSeriesRepo;
|
|
27
29
|
event: EventRepo;
|
|
28
30
|
eventSeries: EventSeriesRepo;
|
|
29
31
|
movieTheater: MovieTheaterRepo;
|
|
@@ -153,7 +153,6 @@ function cancelDeletedEvents(params) {
|
|
|
153
153
|
// COAから削除されたイベントをキャンセル済ステータスへ変更
|
|
154
154
|
const ids = await repos.event.searchEventIds({
|
|
155
155
|
project: { id: { $eq: params.project.id } },
|
|
156
|
-
typeOf: factory_1.factory.eventType.ScreeningEvent,
|
|
157
156
|
superEvent: {
|
|
158
157
|
locationBranchCodes: [params.locationBranchCode]
|
|
159
158
|
},
|
|
@@ -8,7 +8,7 @@ declare function createReserveTransactionStartParams(params: {
|
|
|
8
8
|
id: string;
|
|
9
9
|
};
|
|
10
10
|
broker?: factory.reservation.IBroker;
|
|
11
|
-
transaction: Pick<factory.transaction.ITransaction
|
|
11
|
+
transaction: Pick<factory.transaction.placeOrder.ITransaction, 'expires' | 'seller'>;
|
|
12
12
|
transactionNumber: string;
|
|
13
13
|
}): factory.assetTransaction.reserve.IStartParamsWithoutDetail;
|
|
14
14
|
declare function createAuthorizeSeatReservationActionAttributes(params: {
|
|
@@ -18,7 +18,7 @@ declare function createAuthorizeSeatReservationActionAttributes(params: {
|
|
|
18
18
|
*/
|
|
19
19
|
transactionNumber: string;
|
|
20
20
|
};
|
|
21
|
-
transaction: Pick<factory.transaction.ITransaction
|
|
21
|
+
transaction: Pick<factory.transaction.placeOrder.ITransaction, 'agent' | 'id' | 'project' | 'seller' | 'typeOf'>;
|
|
22
22
|
}): factory.action.authorize.offer.eventService.IAttributes;
|
|
23
23
|
declare function acceptedOffers2amount(params: {
|
|
24
24
|
acceptedOffers: Pick<IResultAcceptedOffer, 'priceSpecification' | 'id'>[];
|
|
@@ -31,7 +31,7 @@ declare function processStartReserve4chevre(params: {
|
|
|
31
31
|
};
|
|
32
32
|
broker?: factory.reservation.IBroker;
|
|
33
33
|
transactionNumber: string;
|
|
34
|
-
transaction: Pick<factory.transaction.ITransaction
|
|
34
|
+
transaction: Pick<factory.transaction.placeOrder.ITransaction, 'agent' | 'expires' | 'id' | 'project' | 'seller' | 'typeOf'>;
|
|
35
35
|
availableAtOrFrom: {
|
|
36
36
|
id: string;
|
|
37
37
|
};
|
|
@@ -121,10 +121,7 @@ function minimizeItemOffered(itemOffered, options) {
|
|
|
121
121
|
}
|
|
122
122
|
function validateCreateRequest(params) {
|
|
123
123
|
return async (repos) => {
|
|
124
|
-
const transaction = await repos.placeOrder.findPlaceOrderInProgressById({
|
|
125
|
-
typeOf: factory_1.factory.transactionType.PlaceOrder,
|
|
126
|
-
id: params.transaction.id
|
|
127
|
-
}, ['agent', 'expires', 'project', 'seller', 'typeOf', 'instrument']);
|
|
124
|
+
const transaction = await repos.placeOrder.findPlaceOrderInProgressById({ id: params.transaction.id }, ['agent', 'expires', 'project', 'seller', 'typeOf', 'instrument']);
|
|
128
125
|
if (transaction.agent.id !== params.agent.id) {
|
|
129
126
|
throw new factory_1.factory.errors.Forbidden('Transaction not yours');
|
|
130
127
|
}
|