@chevre/domain 21.37.0-alpha.16 → 21.37.0-alpha.17
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.
|
@@ -4,6 +4,7 @@ type IObject = factory.assetTransaction.reserve.IObject & {
|
|
|
4
4
|
issuedThrough: factory.assetTransaction.reserve.IIssuedThrough;
|
|
5
5
|
reservationFor: factory.assetTransaction.reserve.IReservationFor;
|
|
6
6
|
};
|
|
7
|
+
type IObjectSubReservation = factory.assetTransaction.reserve.IObjectSubReservation;
|
|
7
8
|
declare function createStartParams(params: factory.assetTransaction.reserve.IStartParamsWithoutDetail & {
|
|
8
9
|
provider: {
|
|
9
10
|
/**
|
|
@@ -13,6 +14,8 @@ declare function createStartParams(params: factory.assetTransaction.reserve.ISta
|
|
|
13
14
|
};
|
|
14
15
|
reservationNumber: string;
|
|
15
16
|
event: IMinimizedIndividualEvent<factory.eventType.Event | factory.eventType.ScreeningEvent>;
|
|
17
|
+
acceptedOffers4transactionObject: factory.assetTransaction.reserve.IAcceptedOffer4object[];
|
|
18
|
+
objectSubReservations: IObjectSubReservation[];
|
|
16
19
|
}): factory.assetTransaction.IStartParams<factory.assetTransactionType.Reserve> & {
|
|
17
20
|
object: IObject;
|
|
18
21
|
};
|
|
@@ -4,7 +4,7 @@ exports.createStartParams = void 0;
|
|
|
4
4
|
const factory = require("../../../../../factory");
|
|
5
5
|
function createStartParams(params) {
|
|
6
6
|
var _a;
|
|
7
|
-
const reservationNumber = params
|
|
7
|
+
const { reservationNumber, acceptedOffers4transactionObject, objectSubReservations, agent, expires, project } = params;
|
|
8
8
|
const provider = {
|
|
9
9
|
id: params.provider.id,
|
|
10
10
|
typeOf: factory.organizationType.Corporation
|
|
@@ -14,14 +14,13 @@ function createStartParams(params) {
|
|
|
14
14
|
const { issuedThrough } = createIssuedThrough({ reservationFor: params.event });
|
|
15
15
|
const reservationPackage = Object.assign({ issuedThrough,
|
|
16
16
|
provider,
|
|
17
|
-
reservationFor, reservationNumber: reservationNumber, reservationStatus: factory.reservationStatusType.ReservationPending, disablePendingReservations: true, useHoldStockByTransactionNumber: true, typeOf: factory.reservationType.ReservationPackage }, (typeof ((_a = params.object.broker) === null || _a === void 0 ? void 0 : _a.typeOf) === 'string') ? { broker: params.object.broker } : undefined);
|
|
17
|
+
reservationFor, reservationNumber: reservationNumber, reservationStatus: factory.reservationStatusType.ReservationPending, disablePendingReservations: true, useHoldStockByTransactionNumber: true, typeOf: factory.reservationType.ReservationPackage, acceptedOffer: acceptedOffers4transactionObject, subReservation: objectSubReservations }, (typeof ((_a = params.object.broker) === null || _a === void 0 ? void 0 : _a.typeOf) === 'string') ? { broker: params.object.broker } : undefined);
|
|
18
18
|
return {
|
|
19
|
-
project: { id:
|
|
19
|
+
project: { id: project.id, typeOf: factory.organizationType.Project },
|
|
20
20
|
typeOf: factory.assetTransactionType.Reserve,
|
|
21
21
|
transactionNumber: reservationNumber,
|
|
22
|
-
agent
|
|
23
|
-
object: reservationPackage
|
|
24
|
-
expires: params.expires
|
|
22
|
+
agent, expires,
|
|
23
|
+
object: reservationPackage
|
|
25
24
|
};
|
|
26
25
|
}
|
|
27
26
|
exports.createStartParams = createStartParams;
|
|
@@ -44,11 +44,9 @@ function start(params) {
|
|
|
44
44
|
now,
|
|
45
45
|
store: { id: (_a = params.availableAtOrFrom) === null || _a === void 0 ? void 0 : _a.id }
|
|
46
46
|
});
|
|
47
|
-
const startParams = (0, createStartParams_1.createStartParams)(Object.assign(Object.assign({}, params), { provider: { id: event.organizer.id }, reservationNumber,
|
|
48
|
-
event }));
|
|
49
47
|
// objectに必要な情報をそろえる
|
|
50
48
|
const { acceptedOffers4transactionObject, objectSubReservations } = yield createObjectAttributes({
|
|
51
|
-
reservationFor: startParams.object.reservationFor,
|
|
49
|
+
// reservationFor: startParams.object.reservationFor,
|
|
52
50
|
transaction: { transactionNumber: reservationNumber },
|
|
53
51
|
now,
|
|
54
52
|
object: params.object,
|
|
@@ -59,6 +57,7 @@ function start(params) {
|
|
|
59
57
|
validateAppliesToMovieTicket: params.validateAppliesToMovieTicket,
|
|
60
58
|
stockHoldUntilDaysAfterEventEnd: params.stockHoldUntilDaysAfterEventEnd
|
|
61
59
|
})(repos);
|
|
60
|
+
const startParams = (0, createStartParams_1.createStartParams)(Object.assign(Object.assign({}, params), { provider: { id: event.organizer.id }, reservationNumber, event, acceptedOffers4transactionObject, objectSubReservations }));
|
|
62
61
|
// reimplement using startWithMinimalResponse(2024-07-02~)
|
|
63
62
|
// const transaction = await repos.assetTransaction.start<factory.assetTransactionType.Reserve>(startParams);
|
|
64
63
|
const { id } = yield repos.assetTransaction.startWithMinimalResponse(startParams);
|
|
@@ -169,19 +168,22 @@ function addReservations(params) {
|
|
|
169
168
|
reservationFor,
|
|
170
169
|
reservationNumber
|
|
171
170
|
})(repos);
|
|
172
|
-
//
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
171
|
+
// start時保管へ移行(2024-07-06~)
|
|
172
|
+
if (!settings_1.USE_EXPERIMENTAL_FEATURE) {
|
|
173
|
+
// 上書きの必要なし(2024-07-01~)
|
|
174
|
+
// transaction = await repos.assetTransaction.addReservations({
|
|
175
|
+
yield repos.assetTransaction.addReservations({
|
|
176
|
+
typeOf: factory.assetTransactionType.Reserve,
|
|
177
|
+
id: params.transaction.id,
|
|
178
|
+
object: {
|
|
179
|
+
acceptedOffer: acceptedOffers4transactionObject,
|
|
180
|
+
// issuedThroughを追加(2023-06-05~)
|
|
181
|
+
// issuedThrough, // start時保管へ移行(2024-07-01~)
|
|
182
|
+
// reservationFor, // start時保管へ移行(2024-07-01~)
|
|
183
|
+
subReservation: objectSubReservations
|
|
184
|
+
}
|
|
185
|
+
});
|
|
186
|
+
}
|
|
185
187
|
}
|
|
186
188
|
catch (error) {
|
|
187
189
|
if (lockedOfferRateLimitKeys.length > 0) {
|
package/package.json
CHANGED