@chevre/domain 24.0.0-alpha.52 → 24.0.0-alpha.54
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.
|
@@ -7,6 +7,9 @@ export interface IUpdatePartiallyParams {
|
|
|
7
7
|
}
|
|
8
8
|
export type ICancelResult = UpdateWriteOpResult;
|
|
9
9
|
export type ICheckedInResult = UpdateWriteOpResult;
|
|
10
|
+
/**
|
|
11
|
+
* ドキュメントとして保管する予約
|
|
12
|
+
*/
|
|
10
13
|
export type ICreatingReservation = Omit<factory.reservation.eventReservation.IReservation, 'id' | 'price' | 'reservedTicket'> & {
|
|
11
14
|
_id: string;
|
|
12
15
|
/**
|
|
@@ -28,6 +28,7 @@ const reservation_1 = require("./mongoose/schemas/reservation");
|
|
|
28
28
|
const factory = __importStar(require("../factory"));
|
|
29
29
|
const createMongoConditions_1 = require("./factory/reservation/createMongoConditions");
|
|
30
30
|
const settings_1 = require("../settings");
|
|
31
|
+
const USE_DISCONTINUED_RESERVATION_PRICE = process.env.USE_DISCONTINUED_RESERVATION_PRICE === '1';
|
|
31
32
|
/**
|
|
32
33
|
* 予約リポジトリ
|
|
33
34
|
*/
|
|
@@ -136,30 +137,27 @@ class ReservationRepo {
|
|
|
136
137
|
const bulkWriteOps = [];
|
|
137
138
|
if (Array.isArray(params.subReservation)) {
|
|
138
139
|
params.subReservation.forEach((subReservation) => {
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
default:
|
|
161
|
-
throw new factory.errors.NotImplemented(`${subReservation.typeOf} not implemented`);
|
|
162
|
-
}
|
|
140
|
+
const { price, reservedTicket, ...subReservationWithoutPrice } = subReservation;
|
|
141
|
+
// const { ticketType, ...reservedTicketWithoutTicketType } = reservedTicket;
|
|
142
|
+
const setOnInsert = {
|
|
143
|
+
...subReservationWithoutPrice,
|
|
144
|
+
typeOf: factory.reservationType.EventReservation,
|
|
145
|
+
_id: subReservation.id,
|
|
146
|
+
bookingTime: params.bookingTime,
|
|
147
|
+
checkedIn: false,
|
|
148
|
+
attended: false,
|
|
149
|
+
issuedThrough: params.issuedThrough,
|
|
150
|
+
project: { id: params.project.id, typeOf: factory.organizationType.Project },
|
|
151
|
+
reservationFor: params.reservationFor,
|
|
152
|
+
reservationNumber: params.reservationNumber,
|
|
153
|
+
reservationStatus: factory.reservationStatusType.ReservationConfirmed,
|
|
154
|
+
modifiedTime,
|
|
155
|
+
provider: params.provider,
|
|
156
|
+
reservedTicket,
|
|
157
|
+
...(params.underName !== undefined) ? { underName: params.underName } : undefined,
|
|
158
|
+
...(typeof params.broker?.typeOf === 'string') ? { broker: params.broker } : undefined,
|
|
159
|
+
...((USE_DISCONTINUED_RESERVATION_PRICE) && { price }) // discontinue price(2026-03-31~)
|
|
160
|
+
};
|
|
163
161
|
bulkWriteOps.push({
|
|
164
162
|
updateOne: {
|
|
165
163
|
filter: { _id: { $eq: subReservation.id } },
|
|
@@ -95,7 +95,7 @@ function validateAcceptedPaymentMethodIfNeeded(params
|
|
|
95
95
|
// 対面決済ではひとまず対応決済方法検証なし
|
|
96
96
|
}
|
|
97
97
|
debug('validateAcceptedPaymentMethodIfNeeded: checkingEventIds:', checkingEventIds, paymentServiceType);
|
|
98
|
-
if (Array.isArray(checkingEventIds)
|
|
98
|
+
if (Array.isArray(checkingEventIds)) {
|
|
99
99
|
// 検証対象のイベントIDが存在する場合、その数が0ということはありえない
|
|
100
100
|
if (checkingEventIds.length === 0) {
|
|
101
101
|
throw new factory.errors.ArgumentNull('object.serviceOutput.referencesOrder.orderedItem');
|
|
@@ -113,15 +113,17 @@ function validateAcceptedPaymentMethodIfNeeded(params
|
|
|
113
113
|
const uniqueEventSeriesIds = [...new Set(eventSeriesIds)];
|
|
114
114
|
debug('validateAcceptedPaymentMethodIfNeeded: eventSeries with AggregateOffer?', uniqueEventSeriesIds);
|
|
115
115
|
// 決済方法に設定されたカスタム検証URLに依存する場合はこちら↓
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
116
|
+
if (paymentService !== undefined) {
|
|
117
|
+
const customValidationUrl = paymentService.availableChannel?.customValidationUrl;
|
|
118
|
+
if (typeof customValidationUrl === 'string' && customValidationUrl !== '') {
|
|
119
|
+
await validateByCustomUrl({
|
|
120
|
+
customValidationUrl,
|
|
121
|
+
eventSeriesIds: uniqueEventSeriesIds,
|
|
122
|
+
paymentMethodType: paymentService.serviceType.codeValue,
|
|
123
|
+
// amount: number,
|
|
124
|
+
now
|
|
125
|
+
});
|
|
126
|
+
}
|
|
125
127
|
}
|
|
126
128
|
// トークンで検証する場合はこち↓
|
|
127
129
|
// // 指定された全トークンを抽出
|
package/package.json
CHANGED
|
@@ -31,17 +31,15 @@
|
|
|
31
31
|
},
|
|
32
32
|
"description": "Chevre Domain Library for Node.js",
|
|
33
33
|
"devDependencies": {
|
|
34
|
-
"@eslint/js": "
|
|
34
|
+
"@eslint/js": "9.39.4",
|
|
35
35
|
"@json2csv/plainjs": "7.0.6",
|
|
36
36
|
"@sendgrid/helpers": "8.0.0",
|
|
37
37
|
"@size-limit/preset-big-lib": "12.0.0",
|
|
38
38
|
"@types/debug": "0.0.30",
|
|
39
39
|
"@types/google-libphonenumber": "^7.4.19",
|
|
40
40
|
"@types/http-status": "^0.2.30",
|
|
41
|
-
"@types/json2csv": "^4.5.1",
|
|
42
41
|
"@types/jsonwebtoken": "9.0.1",
|
|
43
42
|
"@types/lodash.difference": "^4.5.6",
|
|
44
|
-
"@types/moment-timezone": "^0.5.30",
|
|
45
43
|
"@types/node": "22.19.7",
|
|
46
44
|
"@types/pug": "2.0.10",
|
|
47
45
|
"@types/uniqid": "^4.1.3",
|
|
@@ -53,10 +51,10 @@
|
|
|
53
51
|
"eslint": "9.39.2",
|
|
54
52
|
"googleapis": "^85.0.0",
|
|
55
53
|
"jose": "6.0.12",
|
|
56
|
-
"
|
|
54
|
+
"mongodb": "6.20.0",
|
|
57
55
|
"mongoose": "8.23.0",
|
|
58
56
|
"redis": "4.6.5",
|
|
59
|
-
"rimraf": "
|
|
57
|
+
"rimraf": "2.7.1",
|
|
60
58
|
"size-limit": "12.0.0",
|
|
61
59
|
"typescript": "5.6.3",
|
|
62
60
|
"typescript-eslint": "8.55.0",
|
|
@@ -99,5 +97,5 @@
|
|
|
99
97
|
"postversion": "git push origin --tags",
|
|
100
98
|
"prepublishOnly": "npm run clean && npm run build"
|
|
101
99
|
},
|
|
102
|
-
"version": "24.0.0-alpha.
|
|
100
|
+
"version": "24.0.0-alpha.54"
|
|
103
101
|
}
|