@chevre/domain 25.2.0-alpha.20 → 25.2.0-alpha.22
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/chevre/repo/orderInTransaction.js +13 -4
- package/lib/chevre/service/offer/event/authorize/factory.d.ts +0 -4
- package/lib/chevre/service/offer/event/authorize/factory.js +8 -8
- package/lib/chevre/service/offer/event/authorize.d.ts +0 -4
- package/lib/chevre/service/offer/event/authorize.js +2 -2
- 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 +15 -12
- package/lib/chevre/service/offer/eventServiceByCOA/authorizeByAcceptAction.d.ts +0 -5
- package/lib/chevre/service/offer/eventServiceByCOA/authorizeByAcceptAction.js +2 -2
- package/package.json +2 -2
|
@@ -323,7 +323,10 @@ class OrderInTransactionRepo extends acceptedOfferInReserve_1.AcceptedOfferInRes
|
|
|
323
323
|
_id: { $eq: params.id },
|
|
324
324
|
typeOf: { $eq: factory_1.factory.transactionType.PlaceOrder },
|
|
325
325
|
status: { $eq: factory_1.factory.transactionStatusType.InProgress }
|
|
326
|
-
}, {
|
|
326
|
+
}, {
|
|
327
|
+
'object.paymentMethods': 1,
|
|
328
|
+
_id: 0
|
|
329
|
+
})
|
|
327
330
|
.lean()
|
|
328
331
|
.exec();
|
|
329
332
|
if (doc === null) {
|
|
@@ -338,7 +341,10 @@ class OrderInTransactionRepo extends acceptedOfferInReserve_1.AcceptedOfferInRes
|
|
|
338
341
|
const doc = await this.transactionModel.findOne({
|
|
339
342
|
_id: { $eq: params.id },
|
|
340
343
|
typeOf: { $eq: factory_1.factory.transactionType.PlaceOrder }
|
|
341
|
-
}, {
|
|
344
|
+
}, {
|
|
345
|
+
'object.paymentMethods': 1,
|
|
346
|
+
_id: 0
|
|
347
|
+
})
|
|
342
348
|
.lean()
|
|
343
349
|
.exec();
|
|
344
350
|
if (doc === null) {
|
|
@@ -347,7 +353,10 @@ class OrderInTransactionRepo extends acceptedOfferInReserve_1.AcceptedOfferInRes
|
|
|
347
353
|
const paymentMethodId = doc.object.paymentMethods?.paymentMethodId;
|
|
348
354
|
if (typeof paymentMethodId === 'string') {
|
|
349
355
|
// 注文ドキュメントにも発行済の場合、同一性を検証(2026-07-12~)
|
|
350
|
-
const orderDoc = await this.orderModel.findOne({ identifier: { $eq: params.id } }, {
|
|
356
|
+
const orderDoc = await this.orderModel.findOne({ identifier: { $eq: params.id } }, {
|
|
357
|
+
paymentMethodId: 1,
|
|
358
|
+
_id: 0
|
|
359
|
+
})
|
|
351
360
|
.lean()
|
|
352
361
|
.exec();
|
|
353
362
|
if (orderDoc === null) {
|
|
@@ -355,7 +364,7 @@ class OrderInTransactionRepo extends acceptedOfferInReserve_1.AcceptedOfferInRes
|
|
|
355
364
|
}
|
|
356
365
|
const paymentMethodIdByOrder = orderDoc.paymentMethodId;
|
|
357
366
|
if (typeof paymentMethodIdByOrder === 'string') {
|
|
358
|
-
console.log('paymentMethodId matched?', JSON.stringify(doc), JSON.stringify(orderDoc));
|
|
367
|
+
// console.log('paymentMethodId matched?', JSON.stringify(doc), JSON.stringify(orderDoc));
|
|
359
368
|
if (paymentMethodId !== paymentMethodIdByOrder) {
|
|
360
369
|
throw new factory_1.factory.errors.Internal('paymentMethodId not matched unexpectedly');
|
|
361
370
|
}
|
|
@@ -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'>[];
|
|
@@ -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~)
|
|
@@ -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)({
|
|
@@ -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
|
// 座席仮予約からオファー情報を生成する
|
|
@@ -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
|
};
|
package/package.json
CHANGED
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
"dependencies": {
|
|
12
12
|
"@aws-sdk/client-cognito-identity-provider": "3.600.0",
|
|
13
13
|
"@aws-sdk/credential-providers": "3.600.0",
|
|
14
|
-
"@chevre/factory": "9.5.0-alpha.
|
|
14
|
+
"@chevre/factory": "9.5.0-alpha.7",
|
|
15
15
|
"@motionpicture/coa-service": "10.0.0",
|
|
16
16
|
"@motionpicture/gmo-service": "6.1.0-alpha.0",
|
|
17
17
|
"@sendgrid/client": "8.1.4",
|
|
@@ -91,5 +91,5 @@
|
|
|
91
91
|
"postversion": "git push origin --tags",
|
|
92
92
|
"prepublishOnly": "npm run clean && npm run build"
|
|
93
93
|
},
|
|
94
|
-
"version": "25.2.0-alpha.
|
|
94
|
+
"version": "25.2.0-alpha.22"
|
|
95
95
|
}
|