@chevre/domain 21.2.0-alpha.97 → 21.2.0-alpha.98
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/service/assetTransaction/reserve/factory.d.ts +1 -2
- package/lib/chevre/service/assetTransaction/reserve/factory.js +44 -27
- package/lib/chevre/service/assetTransaction/reserve.d.ts +1 -0
- package/lib/chevre/service/assetTransaction/reserve.js +23 -21
- package/lib/chevre/service/offer/event/authorize.js +1 -0
- package/lib/chevre/service/offer/event/factory.d.ts +1 -0
- package/lib/chevre/service/offer/event/factory.js +14 -3
- package/package.json +3 -3
|
@@ -50,7 +50,7 @@ export declare function createReservationFor(params: factory.event.screeningEven
|
|
|
50
50
|
export declare function createIssuedThrough(params: {
|
|
51
51
|
reservationFor: factory.event.screeningEvent.IEvent | factory.event.event.IEvent;
|
|
52
52
|
}): {
|
|
53
|
-
issuedThrough: factory.
|
|
53
|
+
issuedThrough: factory.assetTransaction.reserve.IIssuedThrough;
|
|
54
54
|
};
|
|
55
55
|
export declare function createReservation(params: {
|
|
56
56
|
project: {
|
|
@@ -60,7 +60,6 @@ export declare function createReservation(params: {
|
|
|
60
60
|
id: string;
|
|
61
61
|
reserveDate: Date;
|
|
62
62
|
agent: factory.assetTransaction.reserve.IAgent;
|
|
63
|
-
broker?: factory.reservation.IBroker<factory.reservationType.EventReservation>;
|
|
64
63
|
reservationNumber: string;
|
|
65
64
|
reservationFor: factory.event.screeningEvent.IEvent | factory.event.event.IEvent;
|
|
66
65
|
reservedTicket: factory.reservation.ITicket;
|
|
@@ -394,7 +394,7 @@ function createIssuedThrough(params) {
|
|
|
394
394
|
exports.createIssuedThrough = createIssuedThrough;
|
|
395
395
|
// tslint:disable-next-line:cyclomatic-complexity max-func-body-length
|
|
396
396
|
function createReservation(params) {
|
|
397
|
-
var _a, _b
|
|
397
|
+
var _a, _b;
|
|
398
398
|
// 適用メンバーシップ確認
|
|
399
399
|
validateEligibleMembershipType({
|
|
400
400
|
availableOffer: params.availableOffer,
|
|
@@ -409,27 +409,36 @@ function createReservation(params) {
|
|
|
409
409
|
}
|
|
410
410
|
// priceを最適化
|
|
411
411
|
const price4reservation = (0, price_1.createPrice)(params);
|
|
412
|
-
const eventOffers = params.reservationFor.offers;
|
|
413
|
-
// offersは必ず存在するはず
|
|
414
|
-
if (eventOffers === undefined) {
|
|
415
|
-
|
|
416
|
-
}
|
|
417
|
-
const serviceTypeOfIssuedThrough
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
412
|
+
// const eventOffers = <factory.event.screeningEvent.IOffer | undefined>params.reservationFor.offers;
|
|
413
|
+
// // offersは必ず存在するはず
|
|
414
|
+
// if (eventOffers === undefined) {
|
|
415
|
+
// throw new factory.errors.NotFound('reservationFor.offers');
|
|
416
|
+
// }
|
|
417
|
+
// const serviceTypeOfIssuedThrough: factory.reservation.eventReservation.IServiceTypeOfIssuedThrough | undefined
|
|
418
|
+
// = (typeof eventOffers.itemOffered.serviceType?.codeValue === 'string')
|
|
419
|
+
// ? {
|
|
420
|
+
// codeValue: eventOffers.itemOffered.serviceType.codeValue,
|
|
421
|
+
// inCodeSet: {
|
|
422
|
+
// typeOf: 'CategoryCodeSet',
|
|
423
|
+
// identifier: factory.categoryCode.CategorySetIdentifier.ServiceType
|
|
424
|
+
// },
|
|
425
|
+
// typeOf: 'CategoryCode'
|
|
426
|
+
// }
|
|
427
|
+
// : undefined;
|
|
428
|
+
// const availableChannel: factory.reservation.IServiceChannel = eventOffers.itemOffered.availableChannel;
|
|
428
429
|
if (params.reservationFor.typeOf === factory.eventType.ScreeningEvent) {
|
|
429
|
-
const issuedThrough
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
430
|
+
// const issuedThrough: factory.reservation.eventReservation.IIssuedThrough = {
|
|
431
|
+
// typeOf: factory.product.ProductType.EventService,
|
|
432
|
+
// // 興行IDを追加(2022-09-08~)
|
|
433
|
+
// id: eventOffers.itemOffered.id,
|
|
434
|
+
// availableChannel,
|
|
435
|
+
// // issuedThrough.serviceTypeを連携
|
|
436
|
+
// ...(typeof serviceTypeOfIssuedThrough?.typeOf === 'string') ? { serviceType: serviceTypeOfIssuedThrough } : undefined
|
|
437
|
+
// };
|
|
438
|
+
return Object.assign(Object.assign(Object.assign({ project: params.project, typeOf: factory.reservationType.EventReservation, id: params.id,
|
|
439
|
+
// reservationPackage保管に移行(2023-06-06~)
|
|
440
|
+
// issuedThrough,
|
|
441
|
+
additionalProperty: params.additionalProperty, bookingTime: params.reserveDate, modifiedTime: params.reserveDate, numSeats: 1, price: price4reservation, priceCurrency: factory.priceCurrency.JPY, reservationNumber: params.reservationNumber, reservationStatus: factory.reservationStatusType.ReservationPending, reservedTicket: params.reservedTicket,
|
|
433
442
|
// 最適化(2022-12-19~)
|
|
434
443
|
underName: {
|
|
435
444
|
typeOf: params.agent.typeOf,
|
|
@@ -445,15 +454,23 @@ function createReservation(params) {
|
|
|
445
454
|
};
|
|
446
455
|
})
|
|
447
456
|
}
|
|
448
|
-
: undefined), (typeof ((
|
|
457
|
+
: undefined), (typeof ((_a = params.programMembershipUsed) === null || _a === void 0 ? void 0 : _a.identifier) === 'string')
|
|
449
458
|
? { programMembershipUsed: params.programMembershipUsed }
|
|
450
459
|
: undefined);
|
|
451
460
|
}
|
|
452
461
|
else {
|
|
453
|
-
const issuedThrough
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
462
|
+
// const issuedThrough: factory.reservation.busReservation.IIssuedThrough = {
|
|
463
|
+
// typeOf: factory.product.ProductType.Transportation,
|
|
464
|
+
// // 興行IDを追加(2022-09-08~)
|
|
465
|
+
// id: eventOffers.itemOffered.id,
|
|
466
|
+
// availableChannel,
|
|
467
|
+
// // issuedThrough.serviceTypeを連携
|
|
468
|
+
// ...(typeof serviceTypeOfIssuedThrough?.typeOf === 'string') ? { serviceType: serviceTypeOfIssuedThrough } : undefined
|
|
469
|
+
// };
|
|
470
|
+
return Object.assign(Object.assign(Object.assign({ project: params.project, typeOf: factory.reservationType.BusReservation, id: params.id,
|
|
471
|
+
// reservationPackage保管に移行(2023-06-06~)
|
|
472
|
+
// issuedThrough,
|
|
473
|
+
additionalProperty: params.additionalProperty, bookingTime: params.reserveDate, modifiedTime: params.reserveDate, numSeats: 1, price: price4reservation, priceCurrency: factory.priceCurrency.JPY, reservationNumber: params.reservationNumber, reservationStatus: factory.reservationStatusType.ReservationPending, reservedTicket: params.reservedTicket, underName: {
|
|
457
474
|
typeOf: params.agent.typeOf,
|
|
458
475
|
name: params.agent.name
|
|
459
476
|
}, checkedIn: false, attended: false }, (typeof params.additionalTicketText === 'string') ? { additionalTicketText: params.additionalTicketText } : undefined), (Array.isArray(params.subReservation))
|
|
@@ -467,7 +484,7 @@ function createReservation(params) {
|
|
|
467
484
|
};
|
|
468
485
|
})
|
|
469
486
|
}
|
|
470
|
-
: undefined), (typeof ((
|
|
487
|
+
: undefined), (typeof ((_b = params.programMembershipUsed) === null || _b === void 0 ? void 0 : _b.identifier) === 'string')
|
|
471
488
|
? { programMembershipUsed: params.programMembershipUsed }
|
|
472
489
|
: undefined);
|
|
473
490
|
}
|
|
@@ -102,6 +102,7 @@ export declare function start(params: IStartParams & {
|
|
|
102
102
|
}): IStartOperation<{
|
|
103
103
|
transaction: factory.assetTransaction.ITransaction<factory.assetTransactionType.Reserve>;
|
|
104
104
|
objectSubReservations: IObjectSubReservation[];
|
|
105
|
+
issuedThrough: factory.assetTransaction.reserve.IIssuedThrough;
|
|
105
106
|
}>;
|
|
106
107
|
/**
|
|
107
108
|
* 取引確定
|
|
@@ -27,7 +27,7 @@ const validateStartRequest_1 = require("./reserve/validateStartRequest");
|
|
|
27
27
|
*/
|
|
28
28
|
function start(params) {
|
|
29
29
|
return (repos) => __awaiter(this, void 0, void 0, function* () {
|
|
30
|
-
var _a, _b, _c, _d
|
|
30
|
+
var _a, _b, _c, _d;
|
|
31
31
|
const now = new Date();
|
|
32
32
|
// 自動発行廃止(2022-05-17~)
|
|
33
33
|
const reservationNumber = params.transactionNumber;
|
|
@@ -35,7 +35,8 @@ function start(params) {
|
|
|
35
35
|
throw new factory.errors.ArgumentNull('transactionNumber');
|
|
36
36
|
}
|
|
37
37
|
// eventをfix
|
|
38
|
-
|
|
38
|
+
const reservationForId = (_a = params.object.reservationFor) === null || _a === void 0 ? void 0 : _a.id;
|
|
39
|
+
if (typeof reservationForId !== 'string' || reservationForId.length === 0) {
|
|
39
40
|
throw new factory.errors.ArgumentNull('object.reservationFor.id');
|
|
40
41
|
}
|
|
41
42
|
let event;
|
|
@@ -43,7 +44,7 @@ function start(params) {
|
|
|
43
44
|
event = params.preSearchedEvent;
|
|
44
45
|
}
|
|
45
46
|
else {
|
|
46
|
-
event = yield repos.event.findMinimizedIndividualEventById({ id:
|
|
47
|
+
event = yield repos.event.findMinimizedIndividualEventById({ id: reservationForId });
|
|
47
48
|
}
|
|
48
49
|
// validationを承認アクション開始前から移行(2023-01-27~)
|
|
49
50
|
(0, validateStartRequest_1.validateStartRequest)({
|
|
@@ -64,22 +65,23 @@ function start(params) {
|
|
|
64
65
|
throw error;
|
|
65
66
|
}
|
|
66
67
|
let objectSubReservations = [];
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
68
|
+
const addReservationsResult = yield addReservations({
|
|
69
|
+
id: transaction.id,
|
|
70
|
+
object: params.object,
|
|
71
|
+
event,
|
|
72
|
+
preSearchedTicketOffers: params.preSearchedTicketOffers,
|
|
73
|
+
preSearchedUnitPriceOffers: params.preSearchedUnitPriceOffers,
|
|
74
|
+
availableAtOrFrom: { id: (_d = params.availableAtOrFrom) === null || _d === void 0 ? void 0 : _d.id },
|
|
75
|
+
validateAppliesToMovieTicket: params.validateAppliesToMovieTicket,
|
|
76
|
+
stockHoldUntilDaysAfterEventEnd: params.stockHoldUntilDaysAfterEventEnd
|
|
77
|
+
})(repos);
|
|
78
|
+
transaction = addReservationsResult.transaction;
|
|
79
|
+
objectSubReservations = addReservationsResult.objectSubReservations;
|
|
80
|
+
return {
|
|
81
|
+
transaction,
|
|
82
|
+
objectSubReservations,
|
|
83
|
+
issuedThrough: addReservationsResult.issuedThrough
|
|
84
|
+
};
|
|
83
85
|
});
|
|
84
86
|
}
|
|
85
87
|
exports.start = start;
|
|
@@ -195,7 +197,7 @@ function addReservations(params) {
|
|
|
195
197
|
}
|
|
196
198
|
// ストックホルダー処理(stockHolderで残席数を集計しているので必要)
|
|
197
199
|
yield onReservationsCreated({ event })(repos);
|
|
198
|
-
return { transaction, objectSubReservations };
|
|
200
|
+
return { transaction, objectSubReservations, issuedThrough };
|
|
199
201
|
});
|
|
200
202
|
}
|
|
201
203
|
/**
|
|
@@ -412,7 +414,7 @@ function createReservations4transactionObject(params) {
|
|
|
412
414
|
id: reservationId,
|
|
413
415
|
reserveDate: params.now,
|
|
414
416
|
agent: params.transaction.agent,
|
|
415
|
-
broker: params.transaction.object.broker,
|
|
417
|
+
// broker: params.transaction.object.broker,
|
|
416
418
|
reservationNumber: reservationNumber,
|
|
417
419
|
reservationFor: params.event,
|
|
418
420
|
reservedTicket: reservedTicket,
|
|
@@ -169,6 +169,7 @@ function processStartReserve4chevre(params) {
|
|
|
169
169
|
responseBody = startReserveTransactionResult.transaction;
|
|
170
170
|
// 予約取引からオファー情報を生成する
|
|
171
171
|
acceptedOffers4result = (0, factory_1.responseBody2acceptedOffers4result)({
|
|
172
|
+
issuedThrough: startReserveTransactionResult.issuedThrough,
|
|
172
173
|
objectSubReservations: startReserveTransactionResult.objectSubReservations,
|
|
173
174
|
responseBody: responseBody,
|
|
174
175
|
event: event,
|
|
@@ -26,6 +26,7 @@ export declare function acceptedOffers2amount(params: {
|
|
|
26
26
|
type IObjectSubReservation = factory.assetTransaction.reserve.IObjectSubReservation;
|
|
27
27
|
type IResultAcceptedOffer = factory.action.authorize.offer.seatReservation.IResultAcceptedOffer;
|
|
28
28
|
export declare function responseBody2acceptedOffers4result(params: {
|
|
29
|
+
issuedThrough: factory.assetTransaction.reserve.IIssuedThrough;
|
|
29
30
|
objectSubReservations: IObjectSubReservation[];
|
|
30
31
|
responseBody: factory.assetTransaction.reserve.ITransaction;
|
|
31
32
|
event: IMinimizedIndividualEvent<factory.eventType.ScreeningEvent>;
|
|
@@ -157,7 +157,12 @@ function responseBody2acceptedOffers4result(params) {
|
|
|
157
157
|
if (Array.isArray(params.objectSubReservations)) {
|
|
158
158
|
acceptedOffers4result = params.objectSubReservations.map((itemOffered) => {
|
|
159
159
|
var _a;
|
|
160
|
-
const reservation = createReservation({
|
|
160
|
+
const reservation = createReservation({
|
|
161
|
+
project: params.project,
|
|
162
|
+
itemOffered,
|
|
163
|
+
event: params.event,
|
|
164
|
+
issuedThrough: params.issuedThrough
|
|
165
|
+
});
|
|
161
166
|
// appliesToMovieTicketがArrayでないケースは廃止(2022-09-12~)
|
|
162
167
|
const priceSpecification = itemOffered.price;
|
|
163
168
|
const priceComponent = priceSpecification.priceComponent.map((c) => {
|
|
@@ -244,7 +249,10 @@ function createReservation(params) {
|
|
|
244
249
|
// 最適化(2022-05-31~)
|
|
245
250
|
superEvent: Object.assign(Object.assign({ typeOf: event.superEvent.typeOf, id: event.superEvent.id, kanaName: event.superEvent.kanaName, location: event.superEvent.location, name: event.superEvent.name, soundFormat: event.superEvent.soundFormat, videoFormat: event.superEvent.videoFormat, workPerformed }, (typeof event.superEvent.duration === 'string') ? { duration: event.superEvent.duration } : undefined), (event.superEvent.headline !== undefined) ? { headline: event.superEvent.headline } : undefined)
|
|
246
251
|
};
|
|
247
|
-
|
|
252
|
+
if (params.issuedThrough.typeOf !== factory.product.ProductType.EventService) {
|
|
253
|
+
throw new factory.errors.Argument('issuedThrough', `issuedThrough.typeOf must be ${factory.product.ProductType.EventService}`);
|
|
254
|
+
}
|
|
255
|
+
reservationItem = Object.assign({ project: itemOffered.project, typeOf: itemOffered.typeOf, additionalProperty: itemOffered.additionalProperty, additionalTicketText: itemOffered.additionalTicketText, id: itemOffered.id, issuedThrough: params.issuedThrough, reservationNumber: itemOffered.reservationNumber, reservationFor,
|
|
248
256
|
reservedTicket }, (typeof ((_a = itemOffered.programMembershipUsed) === null || _a === void 0 ? void 0 : _a.typeOf) === 'string')
|
|
249
257
|
? { programMembershipUsed: itemOffered.programMembershipUsed }
|
|
250
258
|
: undefined);
|
|
@@ -269,7 +277,10 @@ function createReservation(params) {
|
|
|
269
277
|
busNumber: tripByEvent.busNumber,
|
|
270
278
|
identifier: tripByEvent.identifier
|
|
271
279
|
};
|
|
272
|
-
|
|
280
|
+
if (params.issuedThrough.typeOf !== factory.product.ProductType.Transportation) {
|
|
281
|
+
throw new factory.errors.Argument('issuedThrough', `issuedThrough.typeOf must be ${factory.product.ProductType.Transportation}`);
|
|
282
|
+
}
|
|
283
|
+
reservationItem = Object.assign({ project: itemOffered.project, typeOf: itemOffered.typeOf, additionalProperty: itemOffered.additionalProperty, additionalTicketText: itemOffered.additionalTicketText, id: itemOffered.id, issuedThrough: params.issuedThrough, reservationNumber: itemOffered.reservationNumber, reservationFor,
|
|
273
284
|
reservedTicket }, (typeof ((_d = itemOffered.programMembershipUsed) === null || _d === void 0 ? void 0 : _d.typeOf) === 'string')
|
|
274
285
|
? { programMembershipUsed: itemOffered.programMembershipUsed }
|
|
275
286
|
: undefined);
|
package/package.json
CHANGED
|
@@ -9,8 +9,8 @@
|
|
|
9
9
|
}
|
|
10
10
|
],
|
|
11
11
|
"dependencies": {
|
|
12
|
-
"@chevre/factory": "4.313.0-alpha.
|
|
13
|
-
"@cinerino/sdk": "3.157.0-alpha.
|
|
12
|
+
"@chevre/factory": "4.313.0-alpha.27",
|
|
13
|
+
"@cinerino/sdk": "3.157.0-alpha.8",
|
|
14
14
|
"@motionpicture/coa-service": "9.2.0",
|
|
15
15
|
"@motionpicture/gmo-service": "5.2.0",
|
|
16
16
|
"@sendgrid/mail": "6.4.0",
|
|
@@ -117,5 +117,5 @@
|
|
|
117
117
|
"postversion": "git push origin --tags",
|
|
118
118
|
"prepublishOnly": "npm run clean && npm run build && npm test && npm run doc"
|
|
119
119
|
},
|
|
120
|
-
"version": "21.2.0-alpha.
|
|
120
|
+
"version": "21.2.0-alpha.98"
|
|
121
121
|
}
|