@chevre/domain 25.2.0-alpha.23 → 25.2.0-alpha.25
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/mongoose/schemas/setting.d.ts +4 -0
- package/lib/chevre/service/reserve/potentialActions/onReservationConfirmed.js +17 -8
- package/lib/chevre/service/transaction/deleteTransaction/deleteReservationsByPlaceOrder.js +0 -1
- package/lib/chevre/service/transaction/placeOrder/confirm/validation.d.ts +1 -1
- package/lib/chevre/service/transaction/placeOrder/confirm/validation.js +3 -1
- package/lib/chevre/service/transaction/placeOrder/confirm.d.ts +0 -5
- package/lib/chevre/service/transaction/placeOrder/confirm.js +7 -11
- package/package.json +2 -2
|
@@ -46,6 +46,7 @@ function onReservationConfirmed(confirmedReservations, reserveAction) {
|
|
|
46
46
|
const setting = await repos.setting.findOne({ project: { id: { $eq: '*' } } }, ['onReservationStatusChanged']);
|
|
47
47
|
// const informReservations = settings.onReservationStatusChanged.informReservation;
|
|
48
48
|
const informReservations = setting?.onReservationStatusChanged?.informReservation;
|
|
49
|
+
const minimizeReservation = setting?.onReservationStatusChanged?.minimizeReservation === true;
|
|
49
50
|
let orderAsAbout;
|
|
50
51
|
if (Array.isArray(reserveAction.instrument)) {
|
|
51
52
|
for (const eachInstrument of reserveAction.instrument) {
|
|
@@ -98,16 +99,24 @@ function onReservationConfirmed(confirmedReservations, reserveAction) {
|
|
|
98
99
|
}
|
|
99
100
|
const subReservations4inform = confirmedReservations.map((r) => {
|
|
100
101
|
const { additionalProperty, additionalTicketText, id, modifiedTime, price, programMembershipUsed, reservedTicket, subReservation, typeOf } = r;
|
|
102
|
+
let reservedTicket4inform;
|
|
103
|
+
if (minimizeReservation) {
|
|
104
|
+
const { ticketType: _ticketType, ...reservedTicketWithNoTicketType } = reservedTicket;
|
|
105
|
+
reservedTicket4inform = reservedTicketWithNoTicketType;
|
|
106
|
+
}
|
|
107
|
+
else {
|
|
108
|
+
reservedTicket4inform = reservedTicket; // eslint-disable-line @typescript-eslint/no-explicit-any
|
|
109
|
+
}
|
|
101
110
|
return {
|
|
102
111
|
id,
|
|
103
112
|
typeOf,
|
|
104
|
-
reservedTicket,
|
|
105
|
-
...(Array.isArray(additionalProperty)) ? { additionalProperty } : undefined,
|
|
113
|
+
reservedTicket: reservedTicket4inform,
|
|
106
114
|
...(typeof additionalTicketText === 'string') ? { additionalTicketText } : undefined,
|
|
107
115
|
...(modifiedTime instanceof Date) ? { modifiedTime } : undefined,
|
|
108
|
-
...(
|
|
109
|
-
...(
|
|
110
|
-
...(
|
|
116
|
+
...(Array.isArray(subReservation)) ? { subReservation } : undefined,
|
|
117
|
+
...(!minimizeReservation && Array.isArray(additionalProperty)) ? { additionalProperty } : undefined, // eslint-disable-line @typescript-eslint/no-explicit-any
|
|
118
|
+
...(!minimizeReservation && price !== undefined) ? { price } : undefined, // eslint-disable-line @typescript-eslint/no-explicit-any
|
|
119
|
+
...(!minimizeReservation && programMembershipUsed !== undefined) ? { programMembershipUsed } : undefined, // eslint-disable-line @typescript-eslint/no-explicit-any
|
|
111
120
|
};
|
|
112
121
|
});
|
|
113
122
|
if (typeof issuedThrough.id !== 'string') {
|
|
@@ -116,7 +125,6 @@ function onReservationConfirmed(confirmedReservations, reserveAction) {
|
|
|
116
125
|
}
|
|
117
126
|
const informObject = {
|
|
118
127
|
bookingTime,
|
|
119
|
-
issuedThrough, // subReservationから移行(2024-03-20~)
|
|
120
128
|
project,
|
|
121
129
|
provider, // subReservationから移行(2024-03-20~)
|
|
122
130
|
reservationFor,
|
|
@@ -124,8 +132,9 @@ function onReservationConfirmed(confirmedReservations, reserveAction) {
|
|
|
124
132
|
reservationStatus: factory_1.factory.reservationStatusType.ReservationConfirmed,
|
|
125
133
|
subReservation: subReservations4inform,
|
|
126
134
|
typeOf: factory_1.factory.reservationType.ReservationPackage,
|
|
127
|
-
...(
|
|
128
|
-
|
|
135
|
+
...(!minimizeReservation) ? { issuedThrough } : undefined, // eslint-disable-line @typescript-eslint/no-explicit-any
|
|
136
|
+
...(!minimizeReservation && typeof underName?.typeOf === 'string')
|
|
137
|
+
? { underName: (0, factory_2.optimizeUnderName4inform)({ underName }) } // eslint-disable-line @typescript-eslint/no-explicit-any
|
|
129
138
|
: undefined
|
|
130
139
|
};
|
|
131
140
|
const informIdentifier = `${factory_1.factory.reservationType.ReservationPackage}:${informObject.reservationNumber}:${informObject.reservationStatus}`;
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.deleteReservationsByPlaceOrder = deleteReservationsByPlaceOrder;
|
|
4
|
-
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
5
4
|
const factory_1 = require("../../../factory");
|
|
6
5
|
function deleteReservationsByPlaceOrder(params) {
|
|
7
6
|
return async (repos) => {
|
|
@@ -51,5 +51,5 @@ export declare function validateEventOffers(params: {
|
|
|
51
51
|
* 承認アクションのresultに条件が保管されているはず(2026-07-06時点で)
|
|
52
52
|
*/
|
|
53
53
|
authorizeOfferActions: Pick<IAuthorizeEventServiceOffer, 'id' | 'result'>[];
|
|
54
|
-
unitPriceOfferConditions
|
|
54
|
+
unitPriceOfferConditions: IPreparedUnitPriceOfferConditions[];
|
|
55
55
|
}): void;
|
|
@@ -333,7 +333,9 @@ function validateEventOffers(params) {
|
|
|
333
333
|
}
|
|
334
334
|
}
|
|
335
335
|
else {
|
|
336
|
-
|
|
336
|
+
// unitPriceOfferConditionsの準備は必須化(2026-07-13~)
|
|
337
|
+
throw new factory_1.factory.errors.NotImplemented('unitPriceOfferConditions must be an array');
|
|
338
|
+
// validatingAuthorizeOfferActions = [...params.authorizeOfferActions];
|
|
337
339
|
}
|
|
338
340
|
const { paymentMethods } = params;
|
|
339
341
|
const firstCreditCardPaymentMethodIdentifier = paymentMethods.find((referenceInvoice) => {
|
|
@@ -41,11 +41,6 @@ interface IConfirmOptions {
|
|
|
41
41
|
* 注文における最大CreditCardIF決済方法数
|
|
42
42
|
*/
|
|
43
43
|
maxNumCreditCardPaymentMethod: number;
|
|
44
|
-
/**
|
|
45
|
-
* 2026-07-06~
|
|
46
|
-
* 実験的に
|
|
47
|
-
*/
|
|
48
|
-
usePrepareUnitPriceOfferConditions?: boolean;
|
|
49
44
|
}
|
|
50
45
|
type IConfirmParams = PlaceOrderFactory.IConfirmParams;
|
|
51
46
|
interface IConfirmResult {
|
|
@@ -118,15 +118,11 @@ function confirm(params, options) {
|
|
|
118
118
|
}))
|
|
119
119
|
.filter(({ serialNumber }) => typeof serialNumber === 'string' && serialNumbers.includes(serialNumber));
|
|
120
120
|
// 単価オファーの全適用条件を検証するために、単価オファーを参照(2026-07-06~)
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
acceptedOffers,
|
|
127
|
-
authorizeEventServiceOfferActions
|
|
128
|
-
})({ offer: repos.offer });
|
|
129
|
-
}
|
|
121
|
+
const unitPriceOfferConditions = await (0, prepareUnitPriceOfferConditions_1.prepareUnitPriceOfferConditions)({
|
|
122
|
+
project: { id: transaction.project.id, },
|
|
123
|
+
acceptedOffers,
|
|
124
|
+
authorizeEventServiceOfferActions
|
|
125
|
+
})({ offer: repos.offer });
|
|
130
126
|
// authorizePaymentActionsからpayTransactionsを参照(2024-06-20~)
|
|
131
127
|
let payTransactions = [];
|
|
132
128
|
// 決済承認アクションのinstrument依存をobject依存へ変更(2025-12-14~)
|
|
@@ -150,8 +146,8 @@ function confirm(params, options) {
|
|
|
150
146
|
acceptPayActions,
|
|
151
147
|
authorizePaymentActions, authorizeEventServiceOfferActions,
|
|
152
148
|
acceptedOffers, payTransactions, customer,
|
|
149
|
+
unitPriceOfferConditions,
|
|
153
150
|
...(typeof code === 'string') ? { code } : undefined,
|
|
154
|
-
...((Array.isArray(unitPriceOfferConditions)) && { unitPriceOfferConditions }),
|
|
155
151
|
paymentMethodIdByTransaction
|
|
156
152
|
}, options);
|
|
157
153
|
// ポストアクションを作成
|
|
@@ -337,7 +333,7 @@ function createResult(params, options) {
|
|
|
337
333
|
order: { price },
|
|
338
334
|
paymentMethods,
|
|
339
335
|
authorizeOfferActions: params.authorizeEventServiceOfferActions,
|
|
340
|
-
|
|
336
|
+
unitPriceOfferConditions: params.unitPriceOfferConditions
|
|
341
337
|
});
|
|
342
338
|
// 注文オファー検証
|
|
343
339
|
(0, validation_1.validateAcceptedOffers)({
|
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.8",
|
|
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.25"
|
|
95
95
|
}
|