@chevre/domain 20.11.0-alpha.3 → 20.11.0
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.
|
@@ -22,7 +22,7 @@ export declare function responseBody2acceptedOffers4result(params: {
|
|
|
22
22
|
responseBody: factory.action.authorize.offer.seatReservation.IResponseBody<factory.service.webAPI.Identifier.COA>;
|
|
23
23
|
object: factory.action.authorize.offer.seatReservation.IObject<factory.service.webAPI.Identifier.COA>;
|
|
24
24
|
event: IMinimizedIndividualEvent<factory.eventType.ScreeningEvent>;
|
|
25
|
-
seller: factory.transaction.placeOrder.ISeller
|
|
25
|
+
seller: Pick<factory.transaction.placeOrder.ISeller, 'typeOf' | 'name'>;
|
|
26
26
|
bookingTime: Date;
|
|
27
27
|
totalPrice: number;
|
|
28
28
|
}): IResultAcceptedOffer[];
|
|
@@ -71,11 +71,11 @@ exports.offers2resultPrice = offers2resultPrice;
|
|
|
71
71
|
function responseBody2acceptedOffers4result(params) {
|
|
72
72
|
const acceptedOffers4result = [];
|
|
73
73
|
const event = params.event;
|
|
74
|
-
const
|
|
74
|
+
const reservationNumber = String(params.responseBody.tmpReserveNum);
|
|
75
75
|
// 座席仮予約からオファー情報を生成する
|
|
76
76
|
// tslint:disable-next-line:max-func-body-length
|
|
77
|
-
acceptedOffers4result.push(...
|
|
78
|
-
var _a, _b, _c, _d
|
|
77
|
+
acceptedOffers4result.push(...params.responseBody.listTmpReserve.map((tmpReserve, index) => {
|
|
78
|
+
var _a, _b, _c, _d;
|
|
79
79
|
const requestedOffer = params.object.acceptedOffer.find((o) => {
|
|
80
80
|
var _a, _b, _c, _d;
|
|
81
81
|
return ((_d = (_c = (_b = (_a = o.itemOffered) === null || _a === void 0 ? void 0 : _a.serviceOutput) === null || _b === void 0 ? void 0 : _b.reservedTicket) === null || _c === void 0 ? void 0 : _c.ticketedSeat) === null || _d === void 0 ? void 0 : _d.seatNumber) === tmpReserve.seatNum
|
|
@@ -84,14 +84,7 @@ function responseBody2acceptedOffers4result(params) {
|
|
|
84
84
|
if (requestedOffer === undefined) {
|
|
85
85
|
throw new factory.errors.Argument('offers', '要求された供給情報と仮予約結果が一致しません');
|
|
86
86
|
}
|
|
87
|
-
|
|
88
|
-
if (event.coaInfo !== undefined) {
|
|
89
|
-
coaInfo = event.coaInfo;
|
|
90
|
-
}
|
|
91
|
-
else {
|
|
92
|
-
const coaInfoProperty = (_a = event.additionalProperty) === null || _a === void 0 ? void 0 : _a.find((p) => p.name === 'coaInfo');
|
|
93
|
-
coaInfo = (coaInfoProperty !== undefined) ? JSON.parse(coaInfoProperty.value) : undefined;
|
|
94
|
-
}
|
|
87
|
+
const coaInfo = event.coaInfo;
|
|
95
88
|
if (coaInfo === undefined) {
|
|
96
89
|
throw new factory.errors.NotFound('Event COA Info');
|
|
97
90
|
}
|
|
@@ -100,11 +93,10 @@ function responseBody2acceptedOffers4result(params) {
|
|
|
100
93
|
coaInfo.theaterCode,
|
|
101
94
|
coaInfo.dateJouei,
|
|
102
95
|
// tslint:disable-next-line:no-magic-numbers
|
|
103
|
-
(`00000000${
|
|
96
|
+
(`00000000${reservationNumber}`).slice(-8),
|
|
104
97
|
// tslint:disable-next-line:no-magic-numbers
|
|
105
98
|
(`000${index + 1}`).slice(-3)
|
|
106
99
|
].join('');
|
|
107
|
-
const reservationNumber = String(updTmpReserveSeatResult.tmpReserveNum);
|
|
108
100
|
const reservationId = `${reservationNumber}-${index.toString()}`;
|
|
109
101
|
const workPerformed = {
|
|
110
102
|
id: event.superEvent.workPerformed.id,
|
|
@@ -159,8 +151,8 @@ function responseBody2acceptedOffers4result(params) {
|
|
|
159
151
|
name: requestedOffer.name
|
|
160
152
|
}
|
|
161
153
|
};
|
|
162
|
-
const additionalProperty = (
|
|
163
|
-
const additionalTicketText = (
|
|
154
|
+
const additionalProperty = (_b = (_a = requestedOffer.itemOffered) === null || _a === void 0 ? void 0 : _a.serviceOutput) === null || _b === void 0 ? void 0 : _b.additionalProperty;
|
|
155
|
+
const additionalTicketText = (_d = (_c = requestedOffer.itemOffered) === null || _c === void 0 ? void 0 : _c.serviceOutput) === null || _d === void 0 ? void 0 : _d.additionalTicketText;
|
|
164
156
|
const issuedThrough = {
|
|
165
157
|
typeOf: factory.product.ProductType.EventService,
|
|
166
158
|
id: '',
|
|
@@ -250,9 +250,6 @@ function validateAcceptedOffers(params) {
|
|
|
250
250
|
// tslint:disable-next-line:max-func-body-length
|
|
251
251
|
return (repos) => __awaiter(this, void 0, void 0, function* () {
|
|
252
252
|
var _a;
|
|
253
|
-
// const offerIds: string[] = (Array.isArray(params.object.acceptedOffer))
|
|
254
|
-
// ? [...new Set(params.object.acceptedOffer.map((o) => o.id))]
|
|
255
|
-
// : [];
|
|
256
253
|
const theaterCode = String((_a = params.screeningEvent.coaInfo) === null || _a === void 0 ? void 0 : _a.theaterCode);
|
|
257
254
|
const offerIdentifiers = (Array.isArray(params.object.acceptedOffer))
|
|
258
255
|
? [...new Set((params.object.acceptedOffer).map((o) => {
|
|
@@ -262,12 +259,6 @@ function validateAcceptedOffers(params) {
|
|
|
262
259
|
let availableUnitPriceOffers = [];
|
|
263
260
|
// 指定された単価オファーを検索
|
|
264
261
|
// ticketCodeで検索(2023-03-22~)
|
|
265
|
-
// if (offerIds.length > 0) {
|
|
266
|
-
// availableUnitPriceOffers = await repos.offer.search({
|
|
267
|
-
// id: { $in: offerIds },
|
|
268
|
-
// project: { id: { $eq: params.project.id } }
|
|
269
|
-
// });
|
|
270
|
-
// }
|
|
271
262
|
if (offerIdentifiers.length > 0) {
|
|
272
263
|
availableUnitPriceOffers = yield repos.offer.search({
|
|
273
264
|
identifier: { $in: offerIdentifiers },
|
|
@@ -320,7 +311,7 @@ function validateAcceptedOffers(params) {
|
|
|
320
311
|
name,
|
|
321
312
|
price,
|
|
322
313
|
priceSpecification, ticketInfo: Object.assign(Object.assign({}, ticketInfo), {
|
|
323
|
-
// usePoint
|
|
314
|
+
// usePointを自動設定(2023-03-22~)
|
|
324
315
|
usePoint: (typeof usePointValue === 'string') ? Number(usePointValue) : 0, salePrice // COAに渡す販売金額を上書き(2023-03-20~)
|
|
325
316
|
}),
|
|
326
317
|
// 以下属性については単価オファーから読む(2023-03-09~)
|
package/package.json
CHANGED
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
],
|
|
11
11
|
"dependencies": {
|
|
12
12
|
"@chevre/factory": "4.306.0",
|
|
13
|
-
"@cinerino/sdk": "3.151.0-alpha.
|
|
13
|
+
"@cinerino/sdk": "3.151.0-alpha.2",
|
|
14
14
|
"@motionpicture/coa-service": "9.2.0",
|
|
15
15
|
"@motionpicture/gmo-service": "5.2.0",
|
|
16
16
|
"@sendgrid/mail": "6.4.0",
|
|
@@ -120,5 +120,5 @@
|
|
|
120
120
|
"postversion": "git push origin --tags",
|
|
121
121
|
"prepublishOnly": "npm run clean && npm run build && npm test && npm run doc"
|
|
122
122
|
},
|
|
123
|
-
"version": "20.11.0
|
|
123
|
+
"version": "20.11.0"
|
|
124
124
|
}
|