@chevre/domain 20.0.0-alpha.2 → 20.0.0-alpha.4
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/example/src/chevre/migrateMovieTicketChargePriceSpecs.ts +5 -5
- package/lib/chevre/service/assetTransaction/registerService/factory.d.ts +2 -2
- package/lib/chevre/service/assetTransaction/reserve/factory/price.d.ts +1 -1
- package/lib/chevre/service/assetTransaction/reserve/factory.d.ts +3 -3
- package/lib/chevre/service/offer/event/authorize.js +1 -1
- package/lib/chevre/service/offer/event/factory.d.ts +4 -2
- package/lib/chevre/service/offer/event/factory.js +4 -5
- package/lib/chevre/service/offer/event/searchEventTicketOffers.d.ts +1 -1
- package/lib/chevre/service/offer/eventServiceByCOA/factory.d.ts +3 -1
- package/lib/chevre/service/offer/eventServiceByCOA/factory.js +12 -40
- package/lib/chevre/service/offer/factory.d.ts +3 -3
- package/lib/chevre/service/offer/factory.js +34 -11
- package/lib/chevre/service/offer/product/factory.js +2 -2
- package/lib/chevre/service/offer/product/searchProductOffers.d.ts +1 -1
- package/lib/chevre/service/offer/product/searchProductOffers.js +6 -6
- package/lib/chevre/service/offer/product.d.ts +1 -1
- package/lib/chevre/service/transaction/placeOrderInProgress/result/acceptedOffers.js +4 -2
- package/package.json +3 -3
|
@@ -35,13 +35,13 @@ async function main() {
|
|
|
35
35
|
console.log(
|
|
36
36
|
'appliesToVideoFormat is...',
|
|
37
37
|
CREATING_VIDEO_FORMAT,
|
|
38
|
-
priceSpec.project
|
|
38
|
+
priceSpec.project?.id, priceSpec.appliesToMovieTicket.serviceType, priceSpec.appliesToVideoFormat, priceSpec.price, i);
|
|
39
39
|
} else {
|
|
40
40
|
// 券種区分について、もうひとつの上映方式に対応する価格仕様が存在しなければ、作成する
|
|
41
41
|
const priceSpecs = await priceSpecRepo.search({
|
|
42
42
|
limit: 1,
|
|
43
43
|
page: 1,
|
|
44
|
-
project: { id: { $eq:
|
|
44
|
+
project: { id: { $eq: project.id } },
|
|
45
45
|
typeOf: chevre.factory.priceSpecificationType.MovieTicketTypeChargeSpecification,
|
|
46
46
|
appliesToVideoFormats: [CREATING_VIDEO_FORMAT],
|
|
47
47
|
appliesToMovieTicket: {
|
|
@@ -52,7 +52,7 @@ async function main() {
|
|
|
52
52
|
if (priceSpec4all !== undefined) {
|
|
53
53
|
console.log(
|
|
54
54
|
'already exist.',
|
|
55
|
-
priceSpec.project
|
|
55
|
+
priceSpec.project?.id, priceSpec.appliesToMovieTicket.serviceType, priceSpec.appliesToVideoFormat, priceSpec.price, i);
|
|
56
56
|
} else {
|
|
57
57
|
const newPriceSpec: IMovieTicketPriceSpec = {
|
|
58
58
|
typeOf: chevre.factory.priceSpecificationType.MovieTicketTypeChargeSpecification,
|
|
@@ -67,7 +67,7 @@ async function main() {
|
|
|
67
67
|
|
|
68
68
|
console.log(
|
|
69
69
|
'creating priceSpec...',
|
|
70
|
-
priceSpec.project
|
|
70
|
+
priceSpec.project?.id,
|
|
71
71
|
newPriceSpec.appliesToMovieTicket.serviceType, newPriceSpec.appliesToVideoFormat, newPriceSpec.price, i);
|
|
72
72
|
await priceSpecRepo.save({
|
|
73
73
|
attributes: newPriceSpec
|
|
@@ -76,7 +76,7 @@ async function main() {
|
|
|
76
76
|
updateCount += 1;
|
|
77
77
|
console.log(
|
|
78
78
|
'created',
|
|
79
|
-
priceSpec.project
|
|
79
|
+
priceSpec.project?.id,
|
|
80
80
|
newPriceSpec.appliesToMovieTicket.serviceType, newPriceSpec.appliesToVideoFormat, newPriceSpec.price, i);
|
|
81
81
|
|
|
82
82
|
}
|
|
@@ -5,7 +5,7 @@ export declare type IUnitPriceSpecification = factory.priceSpecification.IPriceS
|
|
|
5
5
|
*/
|
|
6
6
|
export declare function createPointAward(params: {
|
|
7
7
|
acceptedOffer: factory.assetTransaction.registerService.IAcceptedOfferWithoutDetail;
|
|
8
|
-
offer: factory.
|
|
8
|
+
offer: factory.product.ITicketOffer;
|
|
9
9
|
}): factory.product.IPointAward | undefined;
|
|
10
10
|
/**
|
|
11
11
|
* サービスアウトプットを作成する
|
|
@@ -14,6 +14,6 @@ export declare function createServiceOutput(params: {
|
|
|
14
14
|
dateIssued: Date;
|
|
15
15
|
product: factory.product.IProduct;
|
|
16
16
|
acceptedOffer: factory.assetTransaction.registerService.IAcceptedOfferWithoutDetail;
|
|
17
|
-
offer: factory.
|
|
17
|
+
offer: factory.product.ITicketOffer;
|
|
18
18
|
transactionNumber: string;
|
|
19
19
|
}): factory.assetTransaction.registerService.IServiceOutput;
|
|
@@ -7,7 +7,7 @@ export declare function createPrice(params: {
|
|
|
7
7
|
id: string;
|
|
8
8
|
typeOf: factory.organizationType.Project;
|
|
9
9
|
};
|
|
10
|
-
ticketOffer: factory.
|
|
10
|
+
ticketOffer: factory.product.ITicketOffer;
|
|
11
11
|
seatPriceComponent: factory.place.seat.IPriceComponent[];
|
|
12
12
|
acceptedAddOns: factory.offer.IAddOn[];
|
|
13
13
|
appliesToMovieTicket?: factory.assetTransaction.reserve.IAcceptedAppliesToMovieTicket;
|
|
@@ -8,7 +8,7 @@ export declare function createStartParams(params: factory.assetTransaction.reser
|
|
|
8
8
|
*/
|
|
9
9
|
export declare function createPointAward(params: {
|
|
10
10
|
acceptedOffer: factory.assetTransaction.reserve.IAcceptedTicketOfferWithoutDetail;
|
|
11
|
-
offer: factory.
|
|
11
|
+
offer: factory.product.ITicketOffer;
|
|
12
12
|
reservation: {
|
|
13
13
|
id: string;
|
|
14
14
|
};
|
|
@@ -22,7 +22,7 @@ export declare function createReservedTicket(params: {
|
|
|
22
22
|
reservedSeatsOnly: boolean;
|
|
23
23
|
screeningRoomSections?: factory.place.screeningRoomSection.IPlace[];
|
|
24
24
|
availableSeatOffers: factory.place.seat.IPlaceWithOffer[];
|
|
25
|
-
ticketOffer: factory.
|
|
25
|
+
ticketOffer: factory.product.ITicketOffer;
|
|
26
26
|
transaction: factory.assetTransaction.ITransaction<factory.assetTransactionType.Reserve>;
|
|
27
27
|
}): factory.reservation.ITicket;
|
|
28
28
|
export declare function validateAppliesToMovieTicket(params: {
|
|
@@ -58,7 +58,7 @@ export declare function createReservation(params: {
|
|
|
58
58
|
reservedTicket: factory.reservation.ITicket;
|
|
59
59
|
additionalProperty?: factory.propertyValue.IPropertyValue<string>[];
|
|
60
60
|
additionalTicketText?: string;
|
|
61
|
-
ticketOffer: factory.
|
|
61
|
+
ticketOffer: factory.product.ITicketOffer;
|
|
62
62
|
seatPriceComponent: factory.place.seat.IPriceComponent[];
|
|
63
63
|
acceptedAddOns: factory.offer.IAddOn[];
|
|
64
64
|
subReservation?: factory.reservation.ISubReservation<factory.reservationType.EventReservation>[];
|
|
@@ -329,7 +329,7 @@ function acceptedOfferWithoutDetail2acceptedOffer(params) {
|
|
|
329
329
|
addOn: (Array.isArray(offerWithoutDetail.addOn))
|
|
330
330
|
? offerWithoutDetail.addOn.map((a) => {
|
|
331
331
|
return {
|
|
332
|
-
project: offer.project,
|
|
332
|
+
// project: offer.project,
|
|
333
333
|
typeOf: factory.offerType.Offer,
|
|
334
334
|
id: a.id,
|
|
335
335
|
priceCurrency: offer.priceCurrency
|
|
@@ -20,8 +20,9 @@ export declare function createAuthorizeSeatReservationActionAttributes(params: {
|
|
|
20
20
|
broker?: factory.reservation.IBroker<factory.reservationType.EventReservation>;
|
|
21
21
|
}): factory.action.authorize.offer.seatReservation.IAttributes<factory.service.webAPI.Identifier.Chevre>;
|
|
22
22
|
export declare function acceptedOffers2amount(params: {
|
|
23
|
-
acceptedOffers:
|
|
23
|
+
acceptedOffers: IResultAcceptedOffer[];
|
|
24
24
|
}): number;
|
|
25
|
+
declare type IResultAcceptedOffer = factory.action.authorize.offer.seatReservation.IResultAcceptedOffer;
|
|
25
26
|
export declare function responseBody2acceptedOffers4result(params: {
|
|
26
27
|
responseBody: factory.action.authorize.offer.seatReservation.IResponseBody<factory.service.webAPI.Identifier.Chevre>;
|
|
27
28
|
event: factory.event.IEvent<factory.eventType.ScreeningEvent>;
|
|
@@ -30,7 +31,7 @@ export declare function responseBody2acceptedOffers4result(params: {
|
|
|
30
31
|
typeOf: factory.organizationType.Project;
|
|
31
32
|
};
|
|
32
33
|
seller: factory.transaction.placeOrder.ISeller;
|
|
33
|
-
}):
|
|
34
|
+
}): IResultAcceptedOffer[];
|
|
34
35
|
export declare function coaTicket2offer(params: {
|
|
35
36
|
project: {
|
|
36
37
|
id: string;
|
|
@@ -40,3 +41,4 @@ export declare function coaTicket2offer(params: {
|
|
|
40
41
|
defaultCurrencyType?: factory.categoryCode.ICategoryCode;
|
|
41
42
|
defaultMembershipType?: factory.categoryCode.ICategoryCode;
|
|
42
43
|
}): factory.unitPriceOffer.IUnitPriceOffer;
|
|
44
|
+
export {};
|
|
@@ -155,8 +155,7 @@ function responseBody2acceptedOffers4result(params) {
|
|
|
155
155
|
let acceptedOffers4result = [];
|
|
156
156
|
// 予約取引からacceptedOffers4resultを生成する
|
|
157
157
|
if (Array.isArray(params.responseBody.object.subReservation)) {
|
|
158
|
-
acceptedOffers4result = params.responseBody.object.subReservation
|
|
159
|
-
.map((itemOffered) => {
|
|
158
|
+
acceptedOffers4result = params.responseBody.object.subReservation.map((itemOffered) => {
|
|
160
159
|
var _a;
|
|
161
160
|
const reservation = createReservation({ project: params.project, itemOffered, event: params.event });
|
|
162
161
|
// appliesToMovieTicketがArrayでないケースは廃止(2022-09-12~)
|
|
@@ -182,7 +181,7 @@ function responseBody2acceptedOffers4result(params) {
|
|
|
182
181
|
: undefined);
|
|
183
182
|
});
|
|
184
183
|
return {
|
|
185
|
-
project: { typeOf: params.project.typeOf, id: params.project.id },
|
|
184
|
+
// project: { typeOf: params.project.typeOf, id: params.project.id },
|
|
186
185
|
typeOf: factory.offerType.Offer,
|
|
187
186
|
id: itemOffered.reservedTicket.ticketType.id,
|
|
188
187
|
name: itemOffered.reservedTicket.ticketType.name,
|
|
@@ -200,7 +199,7 @@ function responseBody2acceptedOffers4result(params) {
|
|
|
200
199
|
? itemOffered.priceCurrency
|
|
201
200
|
: factory.priceCurrency.JPY,
|
|
202
201
|
seller: {
|
|
203
|
-
project: { typeOf: params.project.typeOf, id: params.project.id },
|
|
202
|
+
// project: { typeOf: params.project.typeOf, id: params.project.id },
|
|
204
203
|
typeOf: params.seller.typeOf,
|
|
205
204
|
name: (typeof params.seller.name === 'string')
|
|
206
205
|
? params.seller.name
|
|
@@ -281,7 +280,7 @@ function coaTicket2offer(params) {
|
|
|
281
280
|
}]
|
|
282
281
|
: undefined;
|
|
283
282
|
const unitPriceSpec = {
|
|
284
|
-
project: { typeOf: factory.organizationType.Project, id: params.project.id },
|
|
283
|
+
// project: { typeOf: factory.organizationType.Project, id: params.project.id },
|
|
285
284
|
typeOf: factory.priceSpecificationType.UnitPriceSpecification,
|
|
286
285
|
price: 0,
|
|
287
286
|
priceCurrency: factory.priceCurrency.JPY,
|
|
@@ -72,5 +72,5 @@ export declare function searchEventTicketOffers(params: {
|
|
|
72
72
|
*/
|
|
73
73
|
kbnEisyahousiki: string;
|
|
74
74
|
};
|
|
75
|
-
}): ISearchEventTicketOffersOperation<factory.
|
|
75
|
+
}): ISearchEventTicketOffersOperation<factory.product.ITicketOffer[]>;
|
|
76
76
|
export {};
|
|
@@ -12,6 +12,7 @@ export declare function offers2resultPrice(offers: factory.action.authorize.offe
|
|
|
12
12
|
price: number;
|
|
13
13
|
requiredPoint: number;
|
|
14
14
|
};
|
|
15
|
+
declare type IResultAcceptedOffer = factory.action.authorize.offer.seatReservation.IResultAcceptedOffer;
|
|
15
16
|
/**
|
|
16
17
|
* COA仮予約結果から注文アイテムを生成する
|
|
17
18
|
*/
|
|
@@ -22,4 +23,5 @@ export declare function responseBody2acceptedOffers4result(params: {
|
|
|
22
23
|
seller: factory.transaction.placeOrder.ISeller;
|
|
23
24
|
bookingTime: Date;
|
|
24
25
|
totalPrice: number;
|
|
25
|
-
}):
|
|
26
|
+
}): IResultAcceptedOffer[];
|
|
27
|
+
export {};
|
|
@@ -2,18 +2,8 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.responseBody2acceptedOffers4result = exports.offers2resultPrice = exports.createAuthorizeSeatReservationActionAttributes = exports.WebAPIIdentifier = void 0;
|
|
4
4
|
const moment = require("moment");
|
|
5
|
-
// import * as COA from '../../../coa';
|
|
6
5
|
const factory = require("../../../factory");
|
|
7
6
|
exports.WebAPIIdentifier = factory.service.webAPI.Identifier;
|
|
8
|
-
// export type IAcceptedOfferWithoutDetail =
|
|
9
|
-
// factory.action.authorize.offer.seatReservation.IAcceptedOfferWithoutDetail<WebAPIIdentifier.COA> & {
|
|
10
|
-
// additionalProperty?: factory.propertyValue.IPropertyValue<string>[];
|
|
11
|
-
// ticketInfo: factory.offer.seatReservation.ICOATicketInfo & {
|
|
12
|
-
// spseatAdd1: number;
|
|
13
|
-
// spseatAdd2: number;
|
|
14
|
-
// spseatKbn: string;
|
|
15
|
-
// };
|
|
16
|
-
// };
|
|
17
7
|
function createAuthorizeSeatReservationActionAttributes(params) {
|
|
18
8
|
var _a;
|
|
19
9
|
const transaction = params.transaction;
|
|
@@ -68,25 +58,6 @@ function offers2resultPrice(offers) {
|
|
|
68
58
|
return { price, requiredPoint };
|
|
69
59
|
}
|
|
70
60
|
exports.offers2resultPrice = offers2resultPrice;
|
|
71
|
-
// export function createUpdTmpReserveSeatArgs(params: {
|
|
72
|
-
// object: factory.action.authorize.offer.seatReservation.IObjectWithoutDetail<WebAPIIdentifier.COA>;
|
|
73
|
-
// coaInfo: factory.event.screeningEvent.ICOAInfo;
|
|
74
|
-
// }): COA.factory.reserve.IUpdTmpReserveSeatArgs {
|
|
75
|
-
// return {
|
|
76
|
-
// theaterCode: params.coaInfo.theaterCode,
|
|
77
|
-
// dateJouei: params.coaInfo.dateJouei,
|
|
78
|
-
// titleCode: params.coaInfo.titleCode,
|
|
79
|
-
// titleBranchNum: params.coaInfo.titleBranchNum,
|
|
80
|
-
// timeBegin: params.coaInfo.timeBegin,
|
|
81
|
-
// screenCode: params.coaInfo.screenCode,
|
|
82
|
-
// listSeat: params.object.acceptedOffer.map((offer) => {
|
|
83
|
-
// return {
|
|
84
|
-
// seatSection: offer.seatSection,
|
|
85
|
-
// seatNum: offer.seatNumber
|
|
86
|
-
// };
|
|
87
|
-
// })
|
|
88
|
-
// };
|
|
89
|
-
// }
|
|
90
61
|
/**
|
|
91
62
|
* COA仮予約結果から注文アイテムを生成する
|
|
92
63
|
*/
|
|
@@ -129,14 +100,6 @@ function responseBody2acceptedOffers4result(params) {
|
|
|
129
100
|
].join('');
|
|
130
101
|
const reservationNumber = String(updTmpReserveSeatResult.tmpReserveNum);
|
|
131
102
|
const reservationId = `${reservationNumber}-${index.toString()}`;
|
|
132
|
-
// tslint:disable-next-line:max-line-length
|
|
133
|
-
// const unitPriceSpec = <factory.priceSpecification.IPriceSpecification<factory.priceSpecificationType.UnitPriceSpecification>>
|
|
134
|
-
// requestedOffer.priceSpecification.priceComponent.find(
|
|
135
|
-
// (spec) => spec.typeOf === factory.priceSpecificationType.UnitPriceSpecification
|
|
136
|
-
// );
|
|
137
|
-
// if (unitPriceSpec === undefined) {
|
|
138
|
-
// throw new factory.errors.Argument('Accepted Offer', 'Unit price specification not found');
|
|
139
|
-
// }
|
|
140
103
|
const workPerformed = {
|
|
141
104
|
project: event.superEvent.workPerformed.project,
|
|
142
105
|
id: event.superEvent.workPerformed.id,
|
|
@@ -202,17 +165,26 @@ function responseBody2acceptedOffers4result(params) {
|
|
|
202
165
|
const reservation = Object.assign(Object.assign(Object.assign({ project: { typeOf: event.project.typeOf, id: event.project.id }, typeOf: factory.reservationType.EventReservation, id: reservationId, issuedThrough: { typeOf: factory.product.ProductType.EventService }, bookingTime: params.bookingTime }, (Array.isArray(additionalProperty)) ? { additionalProperty } : undefined), (typeof additionalTicketText === 'string') ? { additionalTicketText } : undefined), {
|
|
203
166
|
// numSeats: 1, // 廃止(2022-08-18~)
|
|
204
167
|
reservationFor: reservationFor, reservationNumber: reservationNumber, reservedTicket: reservedTicket });
|
|
168
|
+
if (requestedOffer.priceSpecification === undefined) {
|
|
169
|
+
throw new factory.errors.NotFound('acceptedOffer.priceSpecification');
|
|
170
|
+
}
|
|
171
|
+
const priceSpecification = {
|
|
172
|
+
typeOf: requestedOffer.priceSpecification.typeOf,
|
|
173
|
+
priceCurrency: requestedOffer.priceSpecification.priceCurrency,
|
|
174
|
+
valueAddedTaxIncluded: requestedOffer.priceSpecification.valueAddedTaxIncluded,
|
|
175
|
+
priceComponent: requestedOffer.priceSpecification.priceComponent
|
|
176
|
+
};
|
|
205
177
|
return {
|
|
206
|
-
project: { typeOf: event.project.typeOf, id: event.project.id },
|
|
178
|
+
// project: { typeOf: event.project.typeOf, id: event.project.id },
|
|
207
179
|
typeOf: factory.offerType.Offer,
|
|
208
180
|
id: requestedOffer.id,
|
|
209
181
|
name: requestedOffer.name,
|
|
210
182
|
itemOffered: reservation,
|
|
211
183
|
offeredThrough: { typeOf: 'WebAPI', identifier: factory.service.webAPI.Identifier.COA },
|
|
212
|
-
priceSpecification
|
|
184
|
+
priceSpecification,
|
|
213
185
|
priceCurrency: factory.priceCurrency.JPY,
|
|
214
186
|
seller: {
|
|
215
|
-
project: { typeOf: event.project.typeOf, id: event.project.id },
|
|
187
|
+
// project: { typeOf: event.project.typeOf, id: event.project.id },
|
|
216
188
|
typeOf: params.seller.typeOf,
|
|
217
189
|
name: params.seller.name
|
|
218
190
|
}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import * as factory from '../../factory';
|
|
2
2
|
declare type IMovieTicketTypeChargeSpecification = factory.priceSpecification.IPriceSpecification<factory.priceSpecificationType.MovieTicketTypeChargeSpecification>;
|
|
3
3
|
declare type ICategoryCodeChargeSpecification = factory.priceSpecification.IPriceSpecification<factory.priceSpecificationType.CategoryCodeChargeSpecification>;
|
|
4
|
-
|
|
4
|
+
declare function createCompoundPriceSpec4event(params: {
|
|
5
5
|
eligibleQuantity: factory.quantitativeValue.IQuantitativeValue<factory.unitCode.C62>;
|
|
6
6
|
offer: factory.unitPriceOffer.IUnitPriceOffer;
|
|
7
7
|
movieTicketTypeChargeSpecs: IMovieTicketTypeChargeSpecification[];
|
|
8
8
|
videoFormatChargeSpecifications: ICategoryCodeChargeSpecification[];
|
|
9
9
|
soundFormatChargeSpecifications: ICategoryCodeChargeSpecification[];
|
|
10
10
|
videoFormatTypes: string[];
|
|
11
|
-
}): factory.
|
|
12
|
-
export {};
|
|
11
|
+
}): factory.product.ITicketOffer;
|
|
12
|
+
export { createCompoundPriceSpec4event };
|
|
@@ -1,23 +1,38 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
3
|
+
var t = {};
|
|
4
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
5
|
+
t[p] = s[p];
|
|
6
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
7
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
8
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
9
|
+
t[p[i]] = s[p[i]];
|
|
10
|
+
}
|
|
11
|
+
return t;
|
|
12
|
+
};
|
|
2
13
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
14
|
exports.createCompoundPriceSpec4event = void 0;
|
|
4
15
|
const factory = require("../../factory");
|
|
5
16
|
const USE_MULTIPLE_MOVIE_TICKET_CHARGE = process.env.USE_MULTIPLE_MOVIE_TICKET_CHARGE === '1';
|
|
17
|
+
function categoryCodeChargePriceSpec2component(params) {
|
|
18
|
+
var _a;
|
|
19
|
+
return Object.assign({ id: params.id, typeOf: params.typeOf, name: params.name, price: params.price, priceCurrency: params.priceCurrency, valueAddedTaxIncluded: params.valueAddedTaxIncluded, appliesToCategoryCode: params.appliesToCategoryCode }, (typeof ((_a = params.accounting) === null || _a === void 0 ? void 0 : _a.typeOf) === 'string') ? { accounting: params.accounting } : undefined);
|
|
20
|
+
}
|
|
21
|
+
function mvtkChargePriceSpec2component(params) {
|
|
22
|
+
var _a;
|
|
23
|
+
return Object.assign({ id: params.id, typeOf: params.typeOf, name: params.name, price: params.price, priceCurrency: params.priceCurrency, valueAddedTaxIncluded: params.valueAddedTaxIncluded, appliesToVideoFormat: params.appliesToVideoFormat, appliesToMovieTicket: params.appliesToMovieTicket }, (typeof ((_a = params.accounting) === null || _a === void 0 ? void 0 : _a.typeOf) === 'string') ? { accounting: params.accounting } : undefined);
|
|
24
|
+
}
|
|
6
25
|
function createCompoundPriceSpec4event(params) {
|
|
7
26
|
// priceSpecificationはマスタ管理の仕様上必ず存在するはず
|
|
8
27
|
if (params.offer.priceSpecification === undefined) {
|
|
9
28
|
throw new factory.errors.NotFound(`priceSpecification of the offer: ${params.offer.id}`);
|
|
10
29
|
}
|
|
11
30
|
const unitPriceSpec = Object.assign(Object.assign({}, params.offer.priceSpecification), { name: params.offer.name });
|
|
12
|
-
|
|
13
|
-
const
|
|
14
|
-
|
|
15
|
-
...params.videoFormatChargeSpecifications,
|
|
16
|
-
...params.soundFormatChargeSpecifications
|
|
17
|
-
];
|
|
31
|
+
const videoFormatChargeSpecComponents = params.videoFormatChargeSpecifications.map(categoryCodeChargePriceSpec2component);
|
|
32
|
+
const soundFormatChargeSpecComponents = params.soundFormatChargeSpecifications.map(categoryCodeChargePriceSpec2component);
|
|
33
|
+
let mvtkPriceComponents = [];
|
|
18
34
|
// 複数決済カード対応(2022-07-11~)
|
|
19
35
|
if (Array.isArray(unitPriceSpec.appliesToMovieTicket)) {
|
|
20
|
-
const mvtkSpecs = [];
|
|
21
36
|
unitPriceSpec.appliesToMovieTicket.forEach((appliesToMovieTicket) => {
|
|
22
37
|
// すべての上映方式に該当する加算料金を追加(2022-10-29~)
|
|
23
38
|
if (USE_MULTIPLE_MOVIE_TICKET_CHARGE) {
|
|
@@ -27,7 +42,7 @@ function createCompoundPriceSpec4event(params) {
|
|
|
27
42
|
&& s.appliesToMovieTicket.serviceType === appliesToMovieTicket.serviceType
|
|
28
43
|
&& params.videoFormatTypes.includes(s.appliesToVideoFormat);
|
|
29
44
|
});
|
|
30
|
-
|
|
45
|
+
mvtkPriceComponents = mvtkSpecs4appliesToMovieTicket.map(mvtkChargePriceSpec2component);
|
|
31
46
|
}
|
|
32
47
|
else {
|
|
33
48
|
const mvtkSpec4appliesToMovieTicket = params.movieTicketTypeChargeSpecs.find((s) => {
|
|
@@ -36,15 +51,21 @@ function createCompoundPriceSpec4event(params) {
|
|
|
36
51
|
&& s.appliesToMovieTicket.serviceType === appliesToMovieTicket.serviceType;
|
|
37
52
|
});
|
|
38
53
|
if (mvtkSpec4appliesToMovieTicket !== undefined) {
|
|
39
|
-
|
|
54
|
+
mvtkPriceComponents = [mvtkChargePriceSpec2component(mvtkSpec4appliesToMovieTicket)];
|
|
40
55
|
}
|
|
41
56
|
}
|
|
42
57
|
});
|
|
43
|
-
priceComponent.push(...mvtkSpecs);
|
|
44
58
|
}
|
|
45
59
|
else {
|
|
46
60
|
// Arrayでないケースは廃止(2022-09-12~)
|
|
47
61
|
}
|
|
62
|
+
// 区分加算料金は決済カード適用でも価格要素に含まれるはず(2022-11-02~)
|
|
63
|
+
const priceComponent = [
|
|
64
|
+
unitPriceSpec,
|
|
65
|
+
...videoFormatChargeSpecComponents,
|
|
66
|
+
...soundFormatChargeSpecComponents,
|
|
67
|
+
...mvtkPriceComponents
|
|
68
|
+
];
|
|
48
69
|
const compoundPriceSpecification = {
|
|
49
70
|
// 不要な属性を除外(2022-11-02~)
|
|
50
71
|
// project: params.offer.project,
|
|
@@ -53,6 +74,8 @@ function createCompoundPriceSpec4event(params) {
|
|
|
53
74
|
valueAddedTaxIncluded: true,
|
|
54
75
|
priceComponent
|
|
55
76
|
};
|
|
56
|
-
|
|
77
|
+
// 不要な属性を除外(2022-11-07~)
|
|
78
|
+
const _a = params.offer, { project } = _a, unitOfferFields4ticketOffer = __rest(_a, ["project"]);
|
|
79
|
+
return Object.assign(Object.assign({}, unitOfferFields4ticketOffer), { eligibleQuantity: params.eligibleQuantity, priceSpecification: compoundPriceSpecification });
|
|
57
80
|
}
|
|
58
81
|
exports.createCompoundPriceSpec4event = createCompoundPriceSpec4event;
|
|
@@ -133,14 +133,14 @@ function responseBody2resultAcceptedOffer(params) {
|
|
|
133
133
|
})
|
|
134
134
|
};
|
|
135
135
|
return {
|
|
136
|
-
project: { typeOf: params.project.typeOf, id: params.project.id },
|
|
136
|
+
// project: { typeOf: params.project.typeOf, id: params.project.id },
|
|
137
137
|
typeOf: responseBodyObject.typeOf,
|
|
138
138
|
id: offer.id,
|
|
139
139
|
name: offer.name,
|
|
140
140
|
itemOffered,
|
|
141
141
|
priceSpecification,
|
|
142
142
|
priceCurrency: offer.priceCurrency,
|
|
143
|
-
seller: offer.seller
|
|
143
|
+
seller: { name: offer.seller.name, typeOf: offer.seller.typeOf }
|
|
144
144
|
};
|
|
145
145
|
});
|
|
146
146
|
}
|
|
@@ -23,11 +23,8 @@ function searchProductOffers(params) {
|
|
|
23
23
|
if (typeof offerCatalogId !== 'string') {
|
|
24
24
|
return [];
|
|
25
25
|
}
|
|
26
|
-
const offers = yield repos.offer.findOffersByOfferCatalogId({
|
|
27
|
-
|
|
28
|
-
});
|
|
29
|
-
return offers
|
|
30
|
-
.map((o) => {
|
|
26
|
+
const offers = yield repos.offer.findOffersByOfferCatalogId({ offerCatalog: { id: offerCatalogId } });
|
|
27
|
+
return offers.map((o) => {
|
|
31
28
|
const unitSpec = o.priceSpecification;
|
|
32
29
|
const compoundPriceSpecification = {
|
|
33
30
|
// 不要な属性を除外(2022-11-02~)
|
|
@@ -39,7 +36,10 @@ function searchProductOffers(params) {
|
|
|
39
36
|
...(unitSpec !== undefined) ? [unitSpec] : []
|
|
40
37
|
]
|
|
41
38
|
};
|
|
42
|
-
return Object.assign(Object.assign({ additionalProperty: (Array.isArray(o.additionalProperty)) ? o.additionalProperty : [], alternateName: o.alternateName, availability: o.availability, availableAtOrFrom: o.availableAtOrFrom, color: o.color, description: o.description, id: o.id, identifier: o.identifier, itemOffered: o.itemOffered, name: o.name, priceCurrency: o.priceCurrency,
|
|
39
|
+
return Object.assign(Object.assign({ additionalProperty: (Array.isArray(o.additionalProperty)) ? o.additionalProperty : [], alternateName: o.alternateName, availability: o.availability, availableAtOrFrom: o.availableAtOrFrom, color: o.color, description: o.description, id: o.id, identifier: o.identifier, itemOffered: o.itemOffered, name: o.name, priceCurrency: o.priceCurrency,
|
|
40
|
+
// 不要な属性を除外(2022-11-07~)
|
|
41
|
+
// project: o.project,
|
|
42
|
+
typeOf: o.typeOf, priceSpecification: compoundPriceSpecification }, (o.validFrom instanceof Date) ? { validFrom: o.validFrom } : undefined), (o.validThrough instanceof Date) ? { validThrough: o.validThrough } : undefined);
|
|
43
43
|
});
|
|
44
44
|
});
|
|
45
45
|
}
|
|
@@ -53,7 +53,7 @@ export declare function search(params: {
|
|
|
53
53
|
}): (repos: {
|
|
54
54
|
offer: OfferRepo;
|
|
55
55
|
product: ProductRepo;
|
|
56
|
-
}) => Promise<factory.
|
|
56
|
+
}) => Promise<factory.product.ITicketOffer[]>;
|
|
57
57
|
export declare type IAuthorizeOfferAction = factory.action.authorize.offer.product.IAction;
|
|
58
58
|
/**
|
|
59
59
|
* サービス(Chevreプロダクト)オファー承認
|
|
@@ -133,14 +133,16 @@ function createMoneyTransferAcceptedOffers(params) {
|
|
|
133
133
|
name: `${amountValue} ${currency}`
|
|
134
134
|
};
|
|
135
135
|
acceptedOffers.push({
|
|
136
|
-
|
|
136
|
+
// 不要なので廃止(2022-11-05~)
|
|
137
|
+
// project: { typeOf: params.transaction.project.typeOf, id: params.transaction.project.id },
|
|
137
138
|
typeOf: factory.offerType.Offer,
|
|
138
139
|
itemOffered,
|
|
139
140
|
// ↓いったん廃止(2022-05-17~)
|
|
140
141
|
// price: authorizeMoneyTansferAction.result.price,
|
|
141
142
|
priceCurrency: authorizeMoneyTansferAction.result.priceCurrency,
|
|
142
143
|
seller: {
|
|
143
|
-
|
|
144
|
+
// 不要なので廃止(2022-11-05~)
|
|
145
|
+
// project: { typeOf: params.transaction.project.typeOf, id: params.transaction.project.id },
|
|
144
146
|
typeOf: params.seller.typeOf,
|
|
145
147
|
name: params.seller.name
|
|
146
148
|
}
|
package/package.json
CHANGED
|
@@ -9,8 +9,8 @@
|
|
|
9
9
|
}
|
|
10
10
|
],
|
|
11
11
|
"dependencies": {
|
|
12
|
-
"@chevre/factory": "4.274.0
|
|
13
|
-
"@cinerino/sdk": "3.130.0-alpha.
|
|
12
|
+
"@chevre/factory": "4.274.0",
|
|
13
|
+
"@cinerino/sdk": "3.130.0-alpha.6",
|
|
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.0.0-alpha.
|
|
123
|
+
"version": "20.0.0-alpha.4"
|
|
124
124
|
}
|