@chevre/domain 25.2.0-alpha.3 → 25.2.0-alpha.31
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/factory/customerTelephone2COATelNum.d.ts +3 -0
- package/lib/chevre/factory/customerTelephone2COATelNum.js +23 -0
- package/lib/chevre/repo/action/acceptPay.d.ts +15 -0
- package/lib/chevre/repo/action/acceptPay.js +47 -19
- package/lib/chevre/repo/action/actionProcess.js +57 -57
- package/lib/chevre/repo/action.d.ts +16 -9
- package/lib/chevre/repo/action.js +99 -180
- package/lib/chevre/repo/message.d.ts +1 -1
- package/lib/chevre/repo/message.js +1 -1
- package/lib/chevre/repo/mongoose/schemas/action.js +67 -66
- package/lib/chevre/repo/mongoose/schemas/order.d.ts +4 -0
- package/lib/chevre/repo/mongoose/schemas/order.js +10 -0
- package/lib/chevre/repo/mongoose/schemas/setting.d.ts +4 -0
- package/lib/chevre/repo/mongoose/schemas/task.js +12 -12
- package/lib/chevre/repo/order.d.ts +735 -0
- package/lib/chevre/repo/order.js +13 -20
- package/lib/chevre/repo/orderInTransaction.d.ts +45 -0
- package/lib/chevre/repo/orderInTransaction.js +175 -0
- package/lib/chevre/repo/person.d.ts +0 -15
- package/lib/chevre/repo/person.js +122 -108
- package/lib/chevre/repo/transaction/placeOrder.d.ts +2 -45
- package/lib/chevre/repo/transaction/placeOrder.js +43 -83
- package/lib/chevre/service/assetTransaction/pay/publishPaymentUrl.js +1 -1
- package/lib/chevre/service/assetTransaction/pay/start/factory.js +3 -4
- package/lib/chevre/service/offer/event/authorize/factory.d.ts +5 -5
- package/lib/chevre/service/offer/event/authorize/factory.js +30 -20
- package/lib/chevre/service/offer/event/authorize.d.ts +2 -2
- package/lib/chevre/service/offer/event/authorize.js +3 -3
- package/lib/chevre/service/offer/eventServiceByCOA/authorize/factory.d.ts +6 -7
- package/lib/chevre/service/offer/eventServiceByCOA/authorize/factory.js +10 -10
- package/lib/chevre/service/offer/eventServiceByCOA/authorize.d.ts +0 -5
- package/lib/chevre/service/offer/eventServiceByCOA/authorize.js +17 -14
- package/lib/chevre/service/offer/eventServiceByCOA/authorizeByAcceptAction.d.ts +0 -5
- package/lib/chevre/service/offer/eventServiceByCOA/authorizeByAcceptAction.js +2 -2
- package/lib/chevre/service/offer/eventServiceByCOA/changeOffers.js +1 -1
- package/lib/chevre/service/order/deleteOrder.d.ts +5 -1
- package/lib/chevre/service/order/deleteOrder.js +8 -1
- package/lib/chevre/service/order/onAssetTransactionStatusChanged/onPayTransactionConfirmed.d.ts +2 -0
- package/lib/chevre/service/order/onAssetTransactionStatusChanged/paymentDue2Processing.d.ts +2 -0
- package/lib/chevre/service/order/onAssetTransactionStatusChanged.d.ts +2 -0
- package/lib/chevre/service/order/onOrderStatusChanged/onOrderProcessing/createSendEmailMessageTaskIfNotExist.d.ts +5 -1
- package/lib/chevre/service/order/onOrderStatusChanged/onOrderProcessing/createSendEmailMessageTaskIfNotExist.js +95 -33
- package/lib/chevre/service/order/onOrderStatusChanged/onOrderProcessing.d.ts +2 -0
- package/lib/chevre/service/order/onOrderStatusChanged/onOrderReturned.js +2 -6
- package/lib/chevre/service/order/payOrder.d.ts +2 -0
- package/lib/chevre/service/order/placeOrder.d.ts +2 -0
- package/lib/chevre/service/payment/any/authorize/fixOrderAsNeeded.js +1 -2
- package/lib/chevre/service/payment/any/authorize/fixTransactionNumber.d.ts +3 -2
- package/lib/chevre/service/payment/any/authorize/handlePrePublishedPaymentMethodIdOnAuthorizing.d.ts +4 -3
- package/lib/chevre/service/payment/any/authorize/handlePrePublishedPaymentMethodIdOnAuthorizing.js +3 -31
- package/lib/chevre/service/payment/any/authorize.js +13 -37
- package/lib/chevre/service/payment/any/factory.d.ts +6 -6
- package/lib/chevre/service/payment/any/factory.js +19 -22
- package/lib/chevre/service/payment/any/findAcceptAction.d.ts +3 -1
- package/lib/chevre/service/payment/any/findAcceptAction.js +14 -6
- package/lib/chevre/service/payment/any/invalidatePaymentUrl.d.ts +2 -0
- package/lib/chevre/service/payment/any/invalidatePaymentUrl.js +4 -66
- package/lib/chevre/service/payment/any/publishPaymentUrl.d.ts +4 -0
- package/lib/chevre/service/payment/any/publishPaymentUrl.js +4 -18
- package/lib/chevre/service/payment/any/voidPayTransaction.d.ts +2 -0
- package/lib/chevre/service/payment/any/voidPayTransaction.js +1 -23
- package/lib/chevre/service/payment/creditCard/authorize/processAuthorizeCreditCard.d.ts +1 -1
- package/lib/chevre/service/payment/creditCard/authorize/processAuthorizeCreditCard.js +5 -9
- package/lib/chevre/service/reserve/potentialActions/onReservationConfirmed.js +17 -8
- package/lib/chevre/service/reserve/searchByOrder.js +2 -6
- package/lib/chevre/service/task/confirmReserveTransaction.js +2 -7
- package/lib/chevre/service/task/onAssetTransactionStatusChanged.js +2 -2
- package/lib/chevre/service/task/onOrderPaymentCompleted.js +2 -0
- package/lib/chevre/service/task/placeOrder.js +2 -2
- package/lib/chevre/service/task/publishPaymentUrl.js +7 -3
- package/lib/chevre/service/task/voidPayTransaction.js +3 -7
- package/lib/chevre/service/transaction/deleteTransaction/deletePayTransactionsByPlaceOrder.d.ts +15 -0
- package/lib/chevre/service/transaction/deleteTransaction/deletePayTransactionsByPlaceOrder.js +51 -0
- package/lib/chevre/service/transaction/deleteTransaction/deleteReservationsByPlaceOrder.d.ts +23 -0
- package/lib/chevre/service/transaction/deleteTransaction/deleteReservationsByPlaceOrder.js +64 -0
- package/lib/chevre/service/transaction/deleteTransaction.js +15 -152
- package/lib/chevre/service/transaction/placeOrder/confirm/potentialActions.js +0 -1
- package/lib/chevre/service/transaction/placeOrder/confirm/prepareUnitPriceOfferConditions.d.ts +7 -2
- package/lib/chevre/service/transaction/placeOrder/confirm/prepareUnitPriceOfferConditions.js +16 -12
- package/lib/chevre/service/transaction/placeOrder/confirm/validation/factory.d.ts +5 -1
- package/lib/chevre/service/transaction/placeOrder/confirm/validation.d.ts +11 -2
- package/lib/chevre/service/transaction/placeOrder/confirm/validation.js +112 -91
- package/lib/chevre/service/transaction/placeOrder/confirm.d.ts +4 -0
- package/lib/chevre/service/transaction/placeOrder/confirm.js +31 -74
- package/lib/chevre/service/transaction/placeOrder/publishConfirmationNumberIfNotExist.d.ts +4 -7
- package/lib/chevre/service/transaction/placeOrder/publishConfirmationNumberIfNotExist.js +33 -15
- package/lib/chevre/service/transaction/placeOrder/updateAgent.d.ts +2 -0
- package/lib/chevre/service/transaction/placeOrder/updateAgent.js +19 -9
- package/package.json +5 -4
|
@@ -37,21 +37,6 @@ export declare class PlaceOrderRepo {
|
|
|
37
37
|
}): Promise<(Pick<factory.transaction.ITransaction<factory.transactionType.PlaceOrder>, IKeyOfProjection> & {
|
|
38
38
|
id: string;
|
|
39
39
|
})[]>;
|
|
40
|
-
/**
|
|
41
|
-
* 進行中取引に保管された採用済決済方法を検索する
|
|
42
|
-
*/
|
|
43
|
-
findInProgressPaymentMethodId(params: {
|
|
44
|
-
id: string;
|
|
45
|
-
}): Promise<factory.transaction.placeOrder.IPaymentMethodByPaymentUrl | undefined>;
|
|
46
|
-
/**
|
|
47
|
-
* 取引の確認番号を検索する
|
|
48
|
-
*/
|
|
49
|
-
findInProgressConfirmationNumberById(params: {
|
|
50
|
-
id: string;
|
|
51
|
-
status: {
|
|
52
|
-
$in: factory.transactionStatusType[];
|
|
53
|
-
};
|
|
54
|
-
}): Promise<string | undefined>;
|
|
55
40
|
/**
|
|
56
41
|
* 取引期限変更
|
|
57
42
|
*/
|
|
@@ -60,28 +45,6 @@ export declare class PlaceOrderRepo {
|
|
|
60
45
|
id: string;
|
|
61
46
|
expires: Date;
|
|
62
47
|
}): Promise<void>;
|
|
63
|
-
/**
|
|
64
|
-
* 取引オブジェクトを更新
|
|
65
|
-
* 注文名称など
|
|
66
|
-
*/
|
|
67
|
-
updateObject(params: {
|
|
68
|
-
typeOf: factory.transactionType.PlaceOrder;
|
|
69
|
-
id: string;
|
|
70
|
-
object?: {
|
|
71
|
-
name?: string;
|
|
72
|
-
};
|
|
73
|
-
}): Promise<void>;
|
|
74
|
-
/**
|
|
75
|
-
* 特定の進行中取引を更新する(汎用)
|
|
76
|
-
*/
|
|
77
|
-
findByIdAndUpdateInProgress(params: {
|
|
78
|
-
id: string;
|
|
79
|
-
update: {
|
|
80
|
-
$set?: {
|
|
81
|
-
'object.paymentMethods'?: factory.transaction.placeOrder.IPaymentMethodByPaymentUrl;
|
|
82
|
-
};
|
|
83
|
-
};
|
|
84
|
-
}): Promise<void>;
|
|
85
48
|
/**
|
|
86
49
|
* 進行中取引のobjectに注文番号を保管する
|
|
87
50
|
*/
|
|
@@ -91,13 +54,6 @@ export declare class PlaceOrderRepo {
|
|
|
91
54
|
}): Promise<{
|
|
92
55
|
modifiedCount: number;
|
|
93
56
|
}>;
|
|
94
|
-
saveConfirmationNumberIfNotExist(params: {
|
|
95
|
-
id: string;
|
|
96
|
-
status: {
|
|
97
|
-
$in: factory.transactionStatusType[];
|
|
98
|
-
};
|
|
99
|
-
confirmationNumber: string;
|
|
100
|
-
}): Promise<void>;
|
|
101
57
|
/**
|
|
102
58
|
* 進行中の注文取引を取得する
|
|
103
59
|
*/
|
|
@@ -125,9 +81,10 @@ export declare class PlaceOrderRepo {
|
|
|
125
81
|
object: {
|
|
126
82
|
orderDate: Date;
|
|
127
83
|
orderNumber: string;
|
|
84
|
+
confirmationNumber: string;
|
|
128
85
|
};
|
|
129
86
|
result: factory.transaction.IResult<factory.transactionType.PlaceOrder>;
|
|
130
|
-
potentialActions
|
|
87
|
+
potentialActions?: factory.transaction.IPotentialActions<factory.transactionType.PlaceOrder>;
|
|
131
88
|
}): Promise<void>;
|
|
132
89
|
/**
|
|
133
90
|
* 取引を中止する
|
|
@@ -186,22 +186,6 @@ class PlaceOrderRepo {
|
|
|
186
186
|
.lean()
|
|
187
187
|
.exec();
|
|
188
188
|
}
|
|
189
|
-
/**
|
|
190
|
-
* 進行中取引に保管された採用済決済方法を検索する
|
|
191
|
-
*/
|
|
192
|
-
async findInProgressPaymentMethodId(params) {
|
|
193
|
-
const doc = await this.transactionModel.findOne({
|
|
194
|
-
_id: { $eq: params.id },
|
|
195
|
-
typeOf: { $eq: factory_1.factory.transactionType.PlaceOrder },
|
|
196
|
-
status: { $eq: factory_1.factory.transactionStatusType.InProgress }
|
|
197
|
-
}, { 'object.paymentMethods': 1 })
|
|
198
|
-
.lean() // 2024-08-26~
|
|
199
|
-
.exec();
|
|
200
|
-
if (doc === null) {
|
|
201
|
-
throw new factory_1.factory.errors.NotFound(this.transactionModel.modelName, `${factory_1.factory.transactionType.PlaceOrder} ${factory_1.factory.transactionStatusType.InProgress} not found`);
|
|
202
|
-
}
|
|
203
|
-
return doc.object.paymentMethods;
|
|
204
|
-
}
|
|
205
189
|
// /**
|
|
206
190
|
// * 取引の注文番号を検索する
|
|
207
191
|
// */
|
|
@@ -226,22 +210,31 @@ class PlaceOrderRepo {
|
|
|
226
210
|
// }
|
|
227
211
|
// return doc.object.orderNumber;
|
|
228
212
|
// }
|
|
229
|
-
/**
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
async findInProgressConfirmationNumberById(params
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
}
|
|
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
|
+
// }
|
|
245
238
|
/**
|
|
246
239
|
* 取引期限変更
|
|
247
240
|
*/
|
|
@@ -263,47 +256,6 @@ class PlaceOrderRepo {
|
|
|
263
256
|
throw new factory_1.factory.errors.NotFound(this.transactionModel.modelName, `${params.typeOf} ${factory_1.factory.transactionStatusType.InProgress} not found`);
|
|
264
257
|
}
|
|
265
258
|
}
|
|
266
|
-
/**
|
|
267
|
-
* 取引オブジェクトを更新
|
|
268
|
-
* 注文名称など
|
|
269
|
-
*/
|
|
270
|
-
async updateObject(params) {
|
|
271
|
-
const doc = await this.transactionModel.findOneAndUpdate({
|
|
272
|
-
_id: { $eq: params.id },
|
|
273
|
-
typeOf: { $eq: params.typeOf },
|
|
274
|
-
status: { $eq: factory_1.factory.transactionStatusType.InProgress }
|
|
275
|
-
}, {
|
|
276
|
-
$set: {
|
|
277
|
-
...(typeof params.object?.name === 'string') ? { 'object.name': params.object.name } : undefined
|
|
278
|
-
}
|
|
279
|
-
}, {
|
|
280
|
-
projection: { _id: 1 }
|
|
281
|
-
})
|
|
282
|
-
.lean()
|
|
283
|
-
.exec();
|
|
284
|
-
if (doc === null) {
|
|
285
|
-
throw new factory_1.factory.errors.NotFound(this.transactionModel.modelName, `${params.typeOf} ${factory_1.factory.transactionStatusType.InProgress} not found`);
|
|
286
|
-
}
|
|
287
|
-
}
|
|
288
|
-
/**
|
|
289
|
-
* 特定の進行中取引を更新する(汎用)
|
|
290
|
-
*/
|
|
291
|
-
async findByIdAndUpdateInProgress(params) {
|
|
292
|
-
await this.transactionModel.findOneAndUpdate({
|
|
293
|
-
_id: { $eq: params.id },
|
|
294
|
-
status: { $eq: factory_1.factory.transactionStatusType.InProgress }
|
|
295
|
-
}, params.update, {
|
|
296
|
-
// new: true,
|
|
297
|
-
projection: { _id: 1 }
|
|
298
|
-
})
|
|
299
|
-
.lean()
|
|
300
|
-
.exec()
|
|
301
|
-
.then((doc) => {
|
|
302
|
-
if (doc === null) {
|
|
303
|
-
throw new factory_1.factory.errors.ArgumentNull(this.transactionModel.modelName);
|
|
304
|
-
}
|
|
305
|
-
});
|
|
306
|
-
}
|
|
307
259
|
/**
|
|
308
260
|
* 進行中取引のobjectに注文番号を保管する
|
|
309
261
|
*/
|
|
@@ -316,15 +268,22 @@ class PlaceOrderRepo {
|
|
|
316
268
|
.exec();
|
|
317
269
|
return { modifiedCount: result.modifiedCount };
|
|
318
270
|
}
|
|
319
|
-
async saveConfirmationNumberIfNotExist(params
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
}
|
|
271
|
+
// public async saveConfirmationNumberIfNotExist(params: {
|
|
272
|
+
// id: string;
|
|
273
|
+
// status: { $in: factory.transactionStatusType[] };
|
|
274
|
+
// confirmationNumber: string;
|
|
275
|
+
// }): Promise<void> {
|
|
276
|
+
// await this.transactionModel.updateOne(
|
|
277
|
+
// {
|
|
278
|
+
// _id: { $eq: params.id },
|
|
279
|
+
// // status: { $eq: factory.transactionStatusType.InProgress },
|
|
280
|
+
// status: { $in: params.status.$in },
|
|
281
|
+
// 'object.confirmationNumber': { $exists: false }
|
|
282
|
+
// },
|
|
283
|
+
// { $set: { 'object.confirmationNumber': params.confirmationNumber } }
|
|
284
|
+
// )
|
|
285
|
+
// .exec();
|
|
286
|
+
// }
|
|
328
287
|
/**
|
|
329
288
|
* 進行中の注文取引を取得する
|
|
330
289
|
*/
|
|
@@ -441,8 +400,9 @@ class PlaceOrderRepo {
|
|
|
441
400
|
endDate,
|
|
442
401
|
'object.orderDate': params.object.orderDate, // add(2026-06-15~)
|
|
443
402
|
'object.orderNumber': params.object.orderNumber, // add(2026-06-27~)
|
|
403
|
+
'object.confirmationNumber': params.object.confirmationNumber, // add(2026-07-08~)
|
|
444
404
|
result: params.result, // resultを更新
|
|
445
|
-
potentialActions: params.potentialActions //
|
|
405
|
+
...((params.potentialActions !== undefined) && { potentialActions: params.potentialActions }) // support undefined(2026-07-17~)
|
|
446
406
|
}, {
|
|
447
407
|
new: true,
|
|
448
408
|
projection: { _id: 1 }
|
|
@@ -167,7 +167,7 @@ function publishPaymentUrl(params, options) {
|
|
|
167
167
|
}
|
|
168
168
|
const actionResult = {
|
|
169
169
|
paymentMethodId: result.paymentMethodId,
|
|
170
|
-
paymentUrl: result.paymentUrl
|
|
170
|
+
// paymentUrl: result.paymentUrl // result.paymentUrlは廃止(2026-07-14~)
|
|
171
171
|
};
|
|
172
172
|
await repos.acceptPayAction.completeWithVoid({ typeOf: actionAttributes.typeOf, id: action.id, result: actionResult, recipe });
|
|
173
173
|
return result;
|
|
@@ -82,7 +82,8 @@ function createStartParams(params, options) {
|
|
|
82
82
|
break;
|
|
83
83
|
}
|
|
84
84
|
default:
|
|
85
|
-
|
|
85
|
+
// no op
|
|
86
|
+
throw new factory_1.factory.errors.NotImplemented(`paymentServiceType: ${params.paymentServiceType} not implemented`);
|
|
86
87
|
}
|
|
87
88
|
// const informPaymentParams = createInformPaymentParams({
|
|
88
89
|
// paymentService: <factory.service.paymentService.IService | undefined>params.paymentService
|
|
@@ -122,12 +123,10 @@ function createStartParams(params, options) {
|
|
|
122
123
|
: paymentMethodType,
|
|
123
124
|
amount: paymentMethodAmount, // MonetaryAmount対応(2023-08-14~)
|
|
124
125
|
identifier: paymentMethodType, // 追加(2023-08-29~)
|
|
126
|
+
totalPaymentDue,
|
|
125
127
|
...(typeof params.object.paymentMethod?.description === 'string')
|
|
126
128
|
? { description: params.object.paymentMethod?.description }
|
|
127
129
|
: undefined,
|
|
128
|
-
...(totalPaymentDue !== undefined)
|
|
129
|
-
? { totalPaymentDue: totalPaymentDue }
|
|
130
|
-
: undefined,
|
|
131
130
|
...(typeof accountId === 'string') ? { accountId: accountId } : undefined,
|
|
132
131
|
...(typeof params.object.paymentMethod?.method === 'string')
|
|
133
132
|
? { method: params.object.paymentMethod?.method }
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { factory } from '../../../../factory';
|
|
2
|
-
import { IMinimizedIndividualEvent } from '../../../../factory/event';
|
|
3
2
|
declare function createReserveTransactionStartParams(params: {
|
|
4
3
|
project: {
|
|
5
4
|
id: string;
|
|
@@ -13,7 +12,6 @@ declare function createReserveTransactionStartParams(params: {
|
|
|
13
12
|
transactionNumber: string;
|
|
14
13
|
}): factory.assetTransaction.reserve.IStartParamsWithoutDetail;
|
|
15
14
|
declare function createAuthorizeSeatReservationActionAttributes(params: {
|
|
16
|
-
event: Pick<IMinimizedIndividualEvent, 'id'>;
|
|
17
15
|
instrument: {
|
|
18
16
|
/**
|
|
19
17
|
* 予約取引番号
|
|
@@ -21,8 +19,6 @@ declare function createAuthorizeSeatReservationActionAttributes(params: {
|
|
|
21
19
|
transactionNumber: string;
|
|
22
20
|
};
|
|
23
21
|
transaction: Pick<factory.transaction.ITransaction<factory.transactionType.PlaceOrder>, 'agent' | 'id' | 'project' | 'seller' | 'typeOf'>;
|
|
24
|
-
}, options: {
|
|
25
|
-
useLegacyAuthorizeOfferObject: boolean;
|
|
26
22
|
}): factory.action.authorize.offer.eventService.IAttributes;
|
|
27
23
|
declare function acceptedOffers2amount(params: {
|
|
28
24
|
acceptedOffers: Pick<IResultAcceptedOffer, 'priceSpecification' | 'id'>[];
|
|
@@ -31,7 +27,11 @@ declare function acceptedOffers2authorizeResult(params: {
|
|
|
31
27
|
acceptedOffers4result: IResultAcceptedOffer[];
|
|
32
28
|
noOfferSpecified: boolean;
|
|
33
29
|
ticketOffers: factory.product.ITicketOffer[];
|
|
34
|
-
}
|
|
30
|
+
}, options: {
|
|
31
|
+
useLegacyAuthorizeOfferResult: boolean;
|
|
32
|
+
}): factory.action.authorize.offer.eventService.IResult & {
|
|
33
|
+
onlyPrice?: boolean;
|
|
34
|
+
};
|
|
35
35
|
type IObjectSubReservation = factory.assetTransaction.reserve.IObjectSubReservation;
|
|
36
36
|
export type IResultAcceptedOffer = Omit<factory.order.IOptimizedAcceptedOffer, 'priceSpecification'> & {
|
|
37
37
|
itemOffered: factory.order.IEventReservation;
|
|
@@ -80,16 +80,16 @@ function createReserveTransactionStartParams(params) {
|
|
|
80
80
|
.toDate() // 余裕を持って
|
|
81
81
|
};
|
|
82
82
|
}
|
|
83
|
-
function createAuthorizeSeatReservationActionAttributes(params
|
|
84
|
-
const { useLegacyAuthorizeOfferObject } = options;
|
|
85
|
-
const {
|
|
86
|
-
const authorizeObjectEvent = {
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
};
|
|
83
|
+
function createAuthorizeSeatReservationActionAttributes(params) {
|
|
84
|
+
// const { useLegacyAuthorizeOfferObject } = options;
|
|
85
|
+
const { transaction } = params;
|
|
86
|
+
// const authorizeObjectEvent: factory.action.authorize.offer.eventService.IEventInObject = {
|
|
87
|
+
// id: event.id,
|
|
88
|
+
// typeOf: factory.eventType.ScreeningEvent // fix(2024-07-17~)
|
|
89
|
+
// };
|
|
90
90
|
const object = {
|
|
91
91
|
typeOf: factory_1.factory.action.authorize.offer.eventService.ObjectType.SeatReservation,
|
|
92
|
-
...((useLegacyAuthorizeOfferObject) && { event: authorizeObjectEvent })
|
|
92
|
+
// ...((useLegacyAuthorizeOfferObject) && { event: authorizeObjectEvent })
|
|
93
93
|
};
|
|
94
94
|
const instrument = {
|
|
95
95
|
typeOf: factory_1.factory.assetTransactionType.Reserve, // 変更(2024-03-08~)
|
|
@@ -172,9 +172,10 @@ function acceptedOffers2programMembershipUsed(params) {
|
|
|
172
172
|
});
|
|
173
173
|
return programMembershipUsed;
|
|
174
174
|
}
|
|
175
|
-
function acceptedOffers2authorizeResult(params) {
|
|
175
|
+
function acceptedOffers2authorizeResult(params, options) {
|
|
176
|
+
const { useLegacyAuthorizeOfferResult } = options;
|
|
176
177
|
const { acceptedOffers4result, noOfferSpecified, ticketOffers } = params;
|
|
177
|
-
const priceCurrency =
|
|
178
|
+
// const priceCurrency = factory.priceCurrency.JPY; // fix(2024-07-03~)
|
|
178
179
|
let offers;
|
|
179
180
|
let price;
|
|
180
181
|
let programMembershipUsed = [];
|
|
@@ -211,16 +212,25 @@ function acceptedOffers2authorizeResult(params) {
|
|
|
211
212
|
};
|
|
212
213
|
});
|
|
213
214
|
}
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
215
|
+
if (useLegacyAuthorizeOfferResult) {
|
|
216
|
+
return {
|
|
217
|
+
typeOf: factory_1.factory.offerType.AggregateOffer,
|
|
218
|
+
// priceCurrency, // discontinue(2026-07-06~)
|
|
219
|
+
// amount: [], // discontinue(2026-07-06~)
|
|
220
|
+
itemOffered: {
|
|
221
|
+
serviceOutput: { programMembershipUsed } // add programMembershipUsed required(2024-08-15~)
|
|
222
|
+
},
|
|
223
|
+
...(typeof price === 'number') ? { price } : undefined,
|
|
224
|
+
...(Array.isArray(offers)) ? { offers } : undefined
|
|
225
|
+
};
|
|
226
|
+
}
|
|
227
|
+
else {
|
|
228
|
+
return {
|
|
229
|
+
typeOf: factory_1.factory.offerType.AggregateOffer,
|
|
230
|
+
onlyPrice: true,
|
|
231
|
+
...(typeof price === 'number') ? { price } : undefined,
|
|
232
|
+
};
|
|
233
|
+
}
|
|
224
234
|
}
|
|
225
235
|
function responseBody2acceptedOffers4result(params) {
|
|
226
236
|
let acceptedOffers4result = [];
|
|
@@ -32,9 +32,9 @@ function authorize(params, options) {
|
|
|
32
32
|
// まず取引番号発行
|
|
33
33
|
const { transactionNumber } = await repos.transactionNumber.publishByTimestamp({ startDate: now });
|
|
34
34
|
const actionAttributes = (0, factory_2.createAuthorizeSeatReservationActionAttributes)({
|
|
35
|
-
|
|
35
|
+
transaction,
|
|
36
36
|
instrument: { transactionNumber }
|
|
37
|
-
}
|
|
37
|
+
});
|
|
38
38
|
const action = await repos.authorizeOfferAction.start(actionAttributes);
|
|
39
39
|
try {
|
|
40
40
|
const processStartReserveResult = await (0, processStartReserve4chevre_1.processStartReserve4chevre)({
|
|
@@ -78,7 +78,7 @@ function authorize(params, options) {
|
|
|
78
78
|
}
|
|
79
79
|
throw error;
|
|
80
80
|
}
|
|
81
|
-
const result = (0, factory_2.acceptedOffers2authorizeResult)({ acceptedOffers4result, noOfferSpecified, ticketOffers });
|
|
81
|
+
const result = (0, factory_2.acceptedOffers2authorizeResult)({ acceptedOffers4result, noOfferSpecified, ticketOffers }, options);
|
|
82
82
|
await repos.authorizeOfferAction.completeWithVoid({ typeOf: action.typeOf, id: action.id, result: result });
|
|
83
83
|
return { id: action.id, result };
|
|
84
84
|
};
|
|
@@ -8,14 +8,13 @@ export declare function createAuthorizeSeatReservationActionAttributes(params: {
|
|
|
8
8
|
acceptAction: {
|
|
9
9
|
id: string;
|
|
10
10
|
};
|
|
11
|
-
event: {
|
|
12
|
-
id: string;
|
|
13
|
-
typeOf: factory.eventType.ScreeningEvent;
|
|
14
|
-
};
|
|
15
11
|
transaction: Pick<factory.transaction.ITransaction<factory.transactionType.PlaceOrder>, 'agent' | 'id' | 'project' | 'seller' | 'typeOf'>;
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
12
|
+
/**
|
|
13
|
+
* 仮予約済のCOA予約取引
|
|
14
|
+
*/
|
|
15
|
+
pendingTransaction: {
|
|
16
|
+
transactionNumber: string;
|
|
17
|
+
};
|
|
19
18
|
}): factory.action.authorize.offer.eventService.IAttributes;
|
|
20
19
|
/**
|
|
21
20
|
* 供給情報から承認アクションの価格を導き出す
|
|
@@ -9,20 +9,20 @@ exports.responseBody2acceptedOffers4result = responseBody2acceptedOffers4result;
|
|
|
9
9
|
const moment_1 = __importDefault(require("moment"));
|
|
10
10
|
const util_1 = require("util");
|
|
11
11
|
const factory_1 = require("../../../../factory");
|
|
12
|
-
function createAuthorizeSeatReservationActionAttributes(params
|
|
13
|
-
const { useLegacyAuthorizeOfferObject } = options;
|
|
12
|
+
function createAuthorizeSeatReservationActionAttributes(params) {
|
|
13
|
+
// const { useLegacyAuthorizeOfferObject } = options;
|
|
14
14
|
const transaction = params.transaction;
|
|
15
|
-
const authorizeObjectEvent = {
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
};
|
|
15
|
+
// const authorizeObjectEvent: factory.action.authorize.offer.eventService.IEventInObject = {
|
|
16
|
+
// id: params.event.id,
|
|
17
|
+
// typeOf: params.event.typeOf
|
|
18
|
+
// };
|
|
19
19
|
const authorizeObject = {
|
|
20
20
|
typeOf: factory_1.factory.action.authorize.offer.eventService.ObjectType.SeatReservation,
|
|
21
21
|
id: params.acceptAction.id,
|
|
22
|
-
...((useLegacyAuthorizeOfferObject) && {
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
})
|
|
22
|
+
// ...((useLegacyAuthorizeOfferObject) && {
|
|
23
|
+
// event: authorizeObjectEvent,
|
|
24
|
+
// pendingTransaction: params.pendingTransaction
|
|
25
|
+
// })
|
|
26
26
|
};
|
|
27
27
|
const instrument = {
|
|
28
28
|
typeOf: factory_1.factory.assetTransactionType.COAReserveTransaction, // 変更(2024-03-08~)
|
|
@@ -53,11 +53,6 @@ export declare function authorize(params: {
|
|
|
53
53
|
requestBody: IRequestBody;
|
|
54
54
|
responseBody: IResponseBody;
|
|
55
55
|
};
|
|
56
|
-
}, options: {
|
|
57
|
-
/**
|
|
58
|
-
* 2026-07-04~
|
|
59
|
-
*/
|
|
60
|
-
useLegacyAuthorizeOfferObject: boolean;
|
|
61
56
|
}): IAuthorizeOperation<Pick<IAuthorizeOfferAction, 'id' | 'instrument'> & {
|
|
62
57
|
result: IAuthorizeOfferAction['result'];
|
|
63
58
|
}>;
|
|
@@ -12,7 +12,7 @@ const factory_2 = require("../../../factory");
|
|
|
12
12
|
/**
|
|
13
13
|
* COA興行オファー承認
|
|
14
14
|
*/
|
|
15
|
-
function authorize(params
|
|
15
|
+
function authorize(params) {
|
|
16
16
|
return async (repos) => {
|
|
17
17
|
const transaction = await repos.placeOrder.findPlaceOrderInProgressById({
|
|
18
18
|
typeOf: factory_2.factory.transactionType.PlaceOrder,
|
|
@@ -28,15 +28,18 @@ function authorize(params, options) {
|
|
|
28
28
|
}
|
|
29
29
|
let screeningEvent;
|
|
30
30
|
let acceptedOffers;
|
|
31
|
+
// const pendingTransaction: factory.action.authorize.offer.eventService.ICOAPendingTransaction = {
|
|
32
|
+
// theaterCode: params.result.requestBody.theaterCode,
|
|
33
|
+
// dateJouei: params.result.requestBody.dateJouei,
|
|
34
|
+
// titleCode: params.result.requestBody.titleCode,
|
|
35
|
+
// titleBranchNum: params.result.requestBody.titleBranchNum,
|
|
36
|
+
// timeBegin: params.result.requestBody.timeBegin,
|
|
37
|
+
// tmpReserveNum: params.result.responseBody.tmpReserveNum,
|
|
38
|
+
// transactionNumber: params.result.responseBody.tmpReserveNum,
|
|
39
|
+
// typeOf: factory.assetTransactionType.COAReserveTransaction
|
|
40
|
+
// };
|
|
31
41
|
const pendingTransaction = {
|
|
32
|
-
theaterCode: params.result.requestBody.theaterCode,
|
|
33
|
-
dateJouei: params.result.requestBody.dateJouei,
|
|
34
|
-
titleCode: params.result.requestBody.titleCode,
|
|
35
|
-
titleBranchNum: params.result.requestBody.titleBranchNum,
|
|
36
|
-
timeBegin: params.result.requestBody.timeBegin,
|
|
37
|
-
tmpReserveNum: params.result.responseBody.tmpReserveNum,
|
|
38
42
|
transactionNumber: params.result.responseBody.tmpReserveNum,
|
|
39
|
-
typeOf: factory_2.factory.assetTransactionType.COAReserveTransaction
|
|
40
43
|
};
|
|
41
44
|
try {
|
|
42
45
|
screeningEvent = await repos.event.projectEventFieldsById({ id: params.object.event.id }, [
|
|
@@ -71,10 +74,10 @@ function authorize(params, options) {
|
|
|
71
74
|
// アクション開始前に例外がthrowされてもCOA仮予約を取り消す機会をつくるためにFailedアクションを作成する(2023-09-12~)
|
|
72
75
|
const failedActionAttributes = (0, factory_1.createAuthorizeSeatReservationActionAttributes)({
|
|
73
76
|
acceptAction: params.object.acceptAction,
|
|
74
|
-
event: { id: params.object.event.id, typeOf:
|
|
77
|
+
// event: { id: params.object.event.id, typeOf: factory.eventType.ScreeningEvent },
|
|
75
78
|
transaction,
|
|
76
79
|
pendingTransaction
|
|
77
|
-
}
|
|
80
|
+
});
|
|
78
81
|
const failedAction = await repos.action.start(failedActionAttributes);
|
|
79
82
|
await repos.action.giveUp({ typeOf: failedAction.typeOf, id: failedAction.id, error });
|
|
80
83
|
throw error;
|
|
@@ -88,10 +91,10 @@ function authorize(params, options) {
|
|
|
88
91
|
// 承認アクションを開始
|
|
89
92
|
const actionAttributes = (0, factory_1.createAuthorizeSeatReservationActionAttributes)({
|
|
90
93
|
acceptAction: params.object.acceptAction,
|
|
91
|
-
event: { id: screeningEvent.id, typeOf: screeningEvent.typeOf },
|
|
94
|
+
// event: { id: screeningEvent.id, typeOf: screeningEvent.typeOf },
|
|
92
95
|
transaction,
|
|
93
96
|
pendingTransaction
|
|
94
|
-
}
|
|
97
|
+
});
|
|
95
98
|
const action = await repos.action.start(actionAttributes);
|
|
96
99
|
try {
|
|
97
100
|
// 座席仮予約からオファー情報を生成する
|
|
@@ -109,8 +112,8 @@ function authorize(params, options) {
|
|
|
109
112
|
result = {
|
|
110
113
|
typeOf: factory_2.factory.offerType.AggregateOffer, // add(2024-06-18~)
|
|
111
114
|
price: price,
|
|
112
|
-
priceCurrency:
|
|
113
|
-
amount: []
|
|
115
|
+
// priceCurrency: factory.priceCurrency.JPY, // discontinue(2026-07-06~)
|
|
116
|
+
// amount: [] // discontinue(2026-07-06~)
|
|
114
117
|
};
|
|
115
118
|
await (0, any_1.acceptOffer)({
|
|
116
119
|
project: transaction.project,
|
|
@@ -26,11 +26,6 @@ export declare function authorizeByAcceptAction(params: {
|
|
|
26
26
|
*/
|
|
27
27
|
id: string;
|
|
28
28
|
};
|
|
29
|
-
}, options: {
|
|
30
|
-
/**
|
|
31
|
-
* 2026-07-04~
|
|
32
|
-
*/
|
|
33
|
-
useLegacyAuthorizeOfferObject: boolean;
|
|
34
29
|
}): IAuthorizeOperation<Pick<IAuthorizeOfferAction, 'id' | 'instrument'> & {
|
|
35
30
|
result: IAuthorizeOfferAction['result'];
|
|
36
31
|
}>;
|
|
@@ -7,7 +7,7 @@ const factory_1 = require("../../../factory");
|
|
|
7
7
|
/**
|
|
8
8
|
* 採用アクションからCOA興行オファー承認
|
|
9
9
|
*/
|
|
10
|
-
function authorizeByAcceptAction(params
|
|
10
|
+
function authorizeByAcceptAction(params) {
|
|
11
11
|
return async (repos) => {
|
|
12
12
|
const acceptAction = await repos.accpetCOAOfferAction.findCompletedById({
|
|
13
13
|
project: { id: params.project.id },
|
|
@@ -57,7 +57,7 @@ function authorizeByAcceptAction(params, options) {
|
|
|
57
57
|
store: { id: params.store.id },
|
|
58
58
|
result: { requestBody, responseBody }
|
|
59
59
|
};
|
|
60
|
-
action = await (0, authorize_1.authorize)(authorizeParams
|
|
60
|
+
action = await (0, authorize_1.authorize)(authorizeParams)(repos);
|
|
61
61
|
}
|
|
62
62
|
return action;
|
|
63
63
|
};
|
|
@@ -133,7 +133,7 @@ function changeOffers(params) {
|
|
|
133
133
|
const actionResult = {
|
|
134
134
|
...authorizeAction.result,
|
|
135
135
|
price: price,
|
|
136
|
-
amount: []
|
|
136
|
+
// amount: [] // discontinue(2026-07-06~)
|
|
137
137
|
};
|
|
138
138
|
// ActiveActionStatus->CompletedActionStatusで再実装(2024-01-15~)
|
|
139
139
|
await repos.action.reStart({ id: authorizeAction.id, typeOf: authorizeAction.typeOf });
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { AcceptedOfferRepo } from '../../repo/acceptedOffer';
|
|
2
2
|
import type { AccountingReportRepo } from '../../repo/accountingReport';
|
|
3
|
+
import type { IDeleteActionResult, ActionRepo } from '../../repo/action';
|
|
3
4
|
import type { NoteRepo } from '../../repo/note';
|
|
4
5
|
import type { OrderRepo } from '../../repo/order';
|
|
5
6
|
import type { ReservationRepo } from '../../repo/reservation';
|
|
@@ -17,8 +18,11 @@ declare function deleteOrder(params: {
|
|
|
17
18
|
}): (repos: {
|
|
18
19
|
acceptedOffer: AcceptedOfferRepo;
|
|
19
20
|
accountingReport: AccountingReportRepo;
|
|
21
|
+
action: ActionRepo;
|
|
20
22
|
note: NoteRepo;
|
|
21
23
|
order: OrderRepo;
|
|
22
24
|
reservation: ReservationRepo;
|
|
23
|
-
}) => Promise<
|
|
25
|
+
}) => Promise<{
|
|
26
|
+
deleteActionsResult: IDeleteActionResult[];
|
|
27
|
+
}>;
|
|
24
28
|
export { deleteOrder };
|
|
@@ -12,6 +12,7 @@ function deleteOrder(params) {
|
|
|
12
12
|
if (typeof params.object.identifier !== 'string' || params.object.identifier === '') {
|
|
13
13
|
throw new factory_1.factory.errors.ArgumentNull('object.identifier');
|
|
14
14
|
}
|
|
15
|
+
let deleteActionsResult = [];
|
|
15
16
|
const orders = await repos.order.projectFields({
|
|
16
17
|
limit: 1,
|
|
17
18
|
page: 1,
|
|
@@ -21,7 +22,7 @@ function deleteOrder(params) {
|
|
|
21
22
|
const order = orders.shift();
|
|
22
23
|
if (order === undefined) {
|
|
23
24
|
// すでに削除済
|
|
24
|
-
return;
|
|
25
|
+
return { deleteActionsResult: [] };
|
|
25
26
|
}
|
|
26
27
|
if (typeof order.id !== 'string') {
|
|
27
28
|
throw new factory_1.factory.errors.Internal(`order.id undefined. orderNumber: ${order.orderNumber}`);
|
|
@@ -43,8 +44,14 @@ function deleteOrder(params) {
|
|
|
43
44
|
typeOf: factory_1.factory.order.OrderType.Order
|
|
44
45
|
}
|
|
45
46
|
});
|
|
47
|
+
// アクション削除(2026-07-10~)
|
|
48
|
+
deleteActionsResult = await repos.action.deleteActionsByOrderNumber({
|
|
49
|
+
orderNumber: order.orderNumber,
|
|
50
|
+
project: { id: order.project.id },
|
|
51
|
+
});
|
|
46
52
|
// 注文削除
|
|
47
53
|
await repos.order.deleteByOrderNumber({ orderNumber: order.orderNumber });
|
|
54
|
+
return { deleteActionsResult };
|
|
48
55
|
};
|
|
49
56
|
}
|
|
50
57
|
function deleteReservationsByOrder(order) {
|