@chevre/domain 20.4.0-alpha.10 → 20.4.0-alpha.11
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/searchEventTicketOffers.ts +1 -2
- package/example/src/chevre/unsetUnnecessaryFields.ts +13 -7
- package/lib/chevre/repo/offer.d.ts +1 -0
- package/lib/chevre/repo/offer.js +34 -35
- package/lib/chevre/service/offer/event/authorize.js +0 -1
- package/lib/chevre/service/offer/event/searchEventTicketOffers.d.ts +2 -4
- package/lib/chevre/service/offer/event/searchEventTicketOffers.js +35 -39
- package/package.json +2 -2
|
@@ -22,11 +22,10 @@ async function main() {
|
|
|
22
22
|
const productRepo = new chevre.repository.Product(mongoose.connection);
|
|
23
23
|
|
|
24
24
|
const { ticketOffers } = await chevre.service.offer.event.searchEventTicketOffers({
|
|
25
|
-
event: { id: '
|
|
25
|
+
event: { id: 'aldmhwweb' },
|
|
26
26
|
onlyValid: true,
|
|
27
27
|
sort: true,
|
|
28
28
|
validateOfferRateLimit: true
|
|
29
|
-
// ...(typeof sellerId === 'string') ? { seller: { id: sellerId } } : undefined,
|
|
30
29
|
// ...(typeof availableAtId === 'string') ? { store: { id: availableAtId } } : undefined
|
|
31
30
|
})({
|
|
32
31
|
event: eventRepo,
|
|
@@ -6,17 +6,23 @@ import { chevre } from '../../../lib/index';
|
|
|
6
6
|
async function main() {
|
|
7
7
|
await mongoose.connect(<string>process.env.MONGOLAB_URI);
|
|
8
8
|
|
|
9
|
-
const accountRepo = new chevre.repository.Account(mongoose.connection);
|
|
9
|
+
// const accountRepo = new chevre.repository.Account(mongoose.connection);
|
|
10
10
|
const permitRepo = new chevre.repository.ServiceOutput(mongoose.connection);
|
|
11
11
|
|
|
12
|
-
let updateResult
|
|
13
|
-
|
|
14
|
-
|
|
12
|
+
let updateResult: any;
|
|
13
|
+
// updateResult = await accountRepo.unsetUnnecessaryFields({
|
|
14
|
+
// filter: { status: { $exists: true } },
|
|
15
|
+
// $unset: { status: 1 }
|
|
16
|
+
// });
|
|
17
|
+
// console.log('accounts unset.', updateResult);
|
|
18
|
+
updateResult = await permitRepo.unsetUnnecessaryFields({
|
|
19
|
+
filter: { 'paymentAccount.project': { $exists: true } },
|
|
20
|
+
$unset: { 'paymentAccount.project': 1 }
|
|
15
21
|
});
|
|
16
|
-
console.log('
|
|
22
|
+
console.log('permits unset', updateResult);
|
|
17
23
|
updateResult = await permitRepo.unsetUnnecessaryFields({
|
|
18
|
-
filter: { '
|
|
19
|
-
$unset: { '
|
|
24
|
+
filter: { 'issuedThrough.project': { $exists: true } },
|
|
25
|
+
$unset: { 'issuedThrough.project': 1 }
|
|
20
26
|
});
|
|
21
27
|
console.log('permits unset', updateResult);
|
|
22
28
|
}
|
package/lib/chevre/repo/offer.js
CHANGED
|
@@ -35,7 +35,7 @@ class MongoRepository {
|
|
|
35
35
|
}
|
|
36
36
|
// tslint:disable-next-line:cyclomatic-complexity max-func-body-length
|
|
37
37
|
static CREATE_OFFER_MONGO_CONDITIONS(params) {
|
|
38
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12, _13, _14, _15, _16, _17, _18, _19, _20, _21, _22, _23, _24;
|
|
38
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12, _13, _14, _15, _16, _17, _18, _19, _20, _21, _22, _23, _24, _25, _26, _27, _28;
|
|
39
39
|
// MongoDB検索条件
|
|
40
40
|
const andConditions = [];
|
|
41
41
|
const projectIdEq = (_b = (_a = params.project) === null || _a === void 0 ? void 0 : _a.id) === null || _b === void 0 ? void 0 : _b.$eq;
|
|
@@ -184,8 +184,16 @@ class MongoRepository {
|
|
|
184
184
|
}
|
|
185
185
|
});
|
|
186
186
|
}
|
|
187
|
+
const appliesToMovieTicketServiceOutputTypeOfNin = (_4 = (_3 = (_2 = (_1 = params.priceSpecification) === null || _1 === void 0 ? void 0 : _1.appliesToMovieTicket) === null || _2 === void 0 ? void 0 : _2.serviceOutput) === null || _3 === void 0 ? void 0 : _3.typeOf) === null || _4 === void 0 ? void 0 : _4.$nin;
|
|
188
|
+
if (Array.isArray(appliesToMovieTicketServiceOutputTypeOfNin)) {
|
|
189
|
+
andConditions.push({
|
|
190
|
+
'priceSpecification.appliesToMovieTicket.serviceOutput.typeOf': {
|
|
191
|
+
$nin: appliesToMovieTicketServiceOutputTypeOfNin
|
|
192
|
+
}
|
|
193
|
+
});
|
|
194
|
+
}
|
|
187
195
|
if (params.priceSpecification !== undefined && params.priceSpecification !== null) {
|
|
188
|
-
const priceSpecificationPriceGte = (
|
|
196
|
+
const priceSpecificationPriceGte = (_5 = params.priceSpecification.price) === null || _5 === void 0 ? void 0 : _5.$gte;
|
|
189
197
|
if (typeof priceSpecificationPriceGte === 'number') {
|
|
190
198
|
andConditions.push({
|
|
191
199
|
'priceSpecification.price': {
|
|
@@ -194,7 +202,7 @@ class MongoRepository {
|
|
|
194
202
|
}
|
|
195
203
|
});
|
|
196
204
|
}
|
|
197
|
-
const priceSpecificationPriceLte = (
|
|
205
|
+
const priceSpecificationPriceLte = (_6 = params.priceSpecification.price) === null || _6 === void 0 ? void 0 : _6.$lte;
|
|
198
206
|
if (typeof priceSpecificationPriceLte === 'number') {
|
|
199
207
|
andConditions.push({
|
|
200
208
|
'priceSpecification.price': {
|
|
@@ -203,7 +211,7 @@ class MongoRepository {
|
|
|
203
211
|
}
|
|
204
212
|
});
|
|
205
213
|
}
|
|
206
|
-
const accountsReceivableGte = (
|
|
214
|
+
const accountsReceivableGte = (_8 = (_7 = params.priceSpecification.accounting) === null || _7 === void 0 ? void 0 : _7.accountsReceivable) === null || _8 === void 0 ? void 0 : _8.$gte;
|
|
207
215
|
if (typeof accountsReceivableGte === 'number') {
|
|
208
216
|
andConditions.push({
|
|
209
217
|
'priceSpecification.accounting.accountsReceivable': {
|
|
@@ -212,7 +220,7 @@ class MongoRepository {
|
|
|
212
220
|
}
|
|
213
221
|
});
|
|
214
222
|
}
|
|
215
|
-
const accountsReceivableLte = (
|
|
223
|
+
const accountsReceivableLte = (_10 = (_9 = params.priceSpecification.accounting) === null || _9 === void 0 ? void 0 : _9.accountsReceivable) === null || _10 === void 0 ? void 0 : _10.$lte;
|
|
216
224
|
if (typeof accountsReceivableLte === 'number') {
|
|
217
225
|
andConditions.push({
|
|
218
226
|
'priceSpecification.accounting.accountsReceivable': {
|
|
@@ -221,7 +229,7 @@ class MongoRepository {
|
|
|
221
229
|
}
|
|
222
230
|
});
|
|
223
231
|
}
|
|
224
|
-
const accountingCodeValueEq = (
|
|
232
|
+
const accountingCodeValueEq = (_13 = (_12 = (_11 = params.priceSpecification.accounting) === null || _11 === void 0 ? void 0 : _11.operatingRevenue) === null || _12 === void 0 ? void 0 : _12.codeValue) === null || _13 === void 0 ? void 0 : _13.$eq;
|
|
225
233
|
if (typeof accountingCodeValueEq === 'string') {
|
|
226
234
|
andConditions.push({
|
|
227
235
|
'priceSpecification.accounting.operatingRevenue.codeValue': {
|
|
@@ -230,7 +238,7 @@ class MongoRepository {
|
|
|
230
238
|
}
|
|
231
239
|
});
|
|
232
240
|
}
|
|
233
|
-
const accountingCodeValueIn = (
|
|
241
|
+
const accountingCodeValueIn = (_16 = (_15 = (_14 = params.priceSpecification.accounting) === null || _14 === void 0 ? void 0 : _14.operatingRevenue) === null || _15 === void 0 ? void 0 : _15.codeValue) === null || _16 === void 0 ? void 0 : _16.$in;
|
|
234
242
|
if (Array.isArray(accountingCodeValueIn)) {
|
|
235
243
|
andConditions.push({
|
|
236
244
|
'priceSpecification.accounting.operatingRevenue.codeValue': {
|
|
@@ -239,7 +247,7 @@ class MongoRepository {
|
|
|
239
247
|
}
|
|
240
248
|
});
|
|
241
249
|
}
|
|
242
|
-
const referenceQuantityValueEq = (
|
|
250
|
+
const referenceQuantityValueEq = (_18 = (_17 = params.priceSpecification.referenceQuantity) === null || _17 === void 0 ? void 0 : _17.value) === null || _18 === void 0 ? void 0 : _18.$eq;
|
|
243
251
|
if (typeof referenceQuantityValueEq === 'number') {
|
|
244
252
|
andConditions.push({
|
|
245
253
|
'priceSpecification.referenceQuantity.value': {
|
|
@@ -249,7 +257,7 @@ class MongoRepository {
|
|
|
249
257
|
});
|
|
250
258
|
}
|
|
251
259
|
}
|
|
252
|
-
const availableAtOrFromIdEq = (
|
|
260
|
+
const availableAtOrFromIdEq = (_20 = (_19 = params.availableAtOrFrom) === null || _19 === void 0 ? void 0 : _19.id) === null || _20 === void 0 ? void 0 : _20.$eq;
|
|
253
261
|
if (typeof availableAtOrFromIdEq === 'string') {
|
|
254
262
|
andConditions.push({
|
|
255
263
|
'availableAtOrFrom.id': {
|
|
@@ -258,7 +266,7 @@ class MongoRepository {
|
|
|
258
266
|
}
|
|
259
267
|
});
|
|
260
268
|
}
|
|
261
|
-
const availableAtOrFromIdIn = (
|
|
269
|
+
const availableAtOrFromIdIn = (_22 = (_21 = params.availableAtOrFrom) === null || _21 === void 0 ? void 0 : _21.id) === null || _22 === void 0 ? void 0 : _22.$in;
|
|
262
270
|
if (Array.isArray(availableAtOrFromIdIn)) {
|
|
263
271
|
andConditions.push({
|
|
264
272
|
'availableAtOrFrom.id': {
|
|
@@ -267,7 +275,7 @@ class MongoRepository {
|
|
|
267
275
|
}
|
|
268
276
|
});
|
|
269
277
|
}
|
|
270
|
-
const addOnItemOfferedIdEq = (
|
|
278
|
+
const addOnItemOfferedIdEq = (_25 = (_24 = (_23 = params.addOn) === null || _23 === void 0 ? void 0 : _23.itemOffered) === null || _24 === void 0 ? void 0 : _24.id) === null || _25 === void 0 ? void 0 : _25.$eq;
|
|
271
279
|
if (typeof addOnItemOfferedIdEq === 'string') {
|
|
272
280
|
andConditions.push({
|
|
273
281
|
'addOn.itemOffered.id': {
|
|
@@ -276,7 +284,7 @@ class MongoRepository {
|
|
|
276
284
|
}
|
|
277
285
|
});
|
|
278
286
|
}
|
|
279
|
-
const hasMerchantReturnPolicyIdEq = (
|
|
287
|
+
const hasMerchantReturnPolicyIdEq = (_27 = (_26 = params.hasMerchantReturnPolicy) === null || _26 === void 0 ? void 0 : _26.id) === null || _27 === void 0 ? void 0 : _27.$eq;
|
|
280
288
|
if (typeof hasMerchantReturnPolicyIdEq === 'string') {
|
|
281
289
|
andConditions.push({
|
|
282
290
|
'hasMerchantReturnPolicy.id': {
|
|
@@ -285,7 +293,7 @@ class MongoRepository {
|
|
|
285
293
|
}
|
|
286
294
|
});
|
|
287
295
|
}
|
|
288
|
-
const additionalPropertyElemMatch = (
|
|
296
|
+
const additionalPropertyElemMatch = (_28 = params.additionalProperty) === null || _28 === void 0 ? void 0 : _28.$elemMatch;
|
|
289
297
|
if (additionalPropertyElemMatch !== undefined && additionalPropertyElemMatch !== null) {
|
|
290
298
|
andConditions.push({
|
|
291
299
|
additionalProperty: {
|
|
@@ -324,31 +332,22 @@ class MongoRepository {
|
|
|
324
332
|
const sortedOfferIds = (Array.isArray(itemListElements))
|
|
325
333
|
? itemListElements.map((element) => element.id)
|
|
326
334
|
: [];
|
|
327
|
-
// const offerCatalog = await this.offerCatalogModel.findById(
|
|
328
|
-
// params.offerCatalog.id,
|
|
329
|
-
// {
|
|
330
|
-
// itemListElement: 1
|
|
331
|
-
// }
|
|
332
|
-
// )
|
|
333
|
-
// .exec()
|
|
334
|
-
// .then((doc) => {
|
|
335
|
-
// if (doc === null) {
|
|
336
|
-
// throw new factory.errors.NotFound(this.offerCatalogModel.modelName);
|
|
337
|
-
// }
|
|
338
|
-
// return <Pick<factory.offerCatalog.IOfferCatalog, 'itemListElement'>>doc.toObject();
|
|
339
|
-
// });
|
|
340
|
-
// let sortedOfferIds: string[] = (Array.isArray(offerCatalog.itemListElement))
|
|
341
|
-
// ? offerCatalog.itemListElement.map((element) => element.id)
|
|
342
|
-
// : [];
|
|
343
|
-
// const filteredIds = params.ids;
|
|
344
|
-
// if (Array.isArray(filteredIds)) {
|
|
345
|
-
// sortedOfferIds = sortedOfferIds.filter((id) => filteredIds.includes(id));
|
|
346
|
-
// }
|
|
347
335
|
let offers = [];
|
|
348
336
|
if (sortedOfferIds.length > 0) {
|
|
349
|
-
|
|
337
|
+
const searchOffersConditions = Object.assign(Object.assign({ id: { $in: sortedOfferIds } }, (typeof ((_a = params.availableAtOrFrom) === null || _a === void 0 ? void 0 : _a.id) === 'string')
|
|
350
338
|
? { availableAtOrFrom: { id: { $eq: params.availableAtOrFrom.id } } }
|
|
351
|
-
: undefined))
|
|
339
|
+
: undefined), (Array.isArray(params.unacceptedPaymentMethod) && params.unacceptedPaymentMethod.length > 0)
|
|
340
|
+
? {
|
|
341
|
+
priceSpecification: {
|
|
342
|
+
appliesToMovieTicket: {
|
|
343
|
+
serviceOutput: {
|
|
344
|
+
typeOf: { $nin: params.unacceptedPaymentMethod }
|
|
345
|
+
}
|
|
346
|
+
}
|
|
347
|
+
}
|
|
348
|
+
}
|
|
349
|
+
: undefined);
|
|
350
|
+
offers = yield this.search(searchOffersConditions);
|
|
352
351
|
if (params.sort) {
|
|
353
352
|
// sorting
|
|
354
353
|
offers = offers.sort((a, b) => sortedOfferIds.indexOf(String(a.id)) - sortedOfferIds.indexOf(String(b.id)));
|
|
@@ -27,10 +27,6 @@ declare function searchEventTicketOffers(params: {
|
|
|
27
27
|
event: {
|
|
28
28
|
id: string;
|
|
29
29
|
};
|
|
30
|
-
/**
|
|
31
|
-
* どの販売者に対して
|
|
32
|
-
* 不要なので廃止(2023-01-27~)
|
|
33
|
-
*/
|
|
34
30
|
/**
|
|
35
31
|
* どのアプリケーションに対して
|
|
36
32
|
*/
|
|
@@ -74,6 +70,8 @@ declare function searchEventTicketOffers(params: {
|
|
|
74
70
|
*/
|
|
75
71
|
kbnEisyahousiki: string;
|
|
76
72
|
};
|
|
73
|
+
limit?: number;
|
|
74
|
+
page?: number;
|
|
77
75
|
sort: boolean;
|
|
78
76
|
validateOfferRateLimit: boolean;
|
|
79
77
|
}): ISearchEventTicketOffersOperation<{
|
|
@@ -23,6 +23,7 @@ function searchTransportationEventTicketOffers(params) {
|
|
|
23
23
|
const screeningEvent = params.event;
|
|
24
24
|
const soundFormatTypes = [];
|
|
25
25
|
const videoFormatTypes = [];
|
|
26
|
+
const unacceptedPaymentMethod = getUnacceptedPaymentMethodByEvent({ event: screeningEvent });
|
|
26
27
|
let availableOffers = [];
|
|
27
28
|
// 興行設定があれば興行のカタログを参照する(2022-08-31~)
|
|
28
29
|
const eventOffers = screeningEvent.offers;
|
|
@@ -33,6 +34,7 @@ function searchTransportationEventTicketOffers(params) {
|
|
|
33
34
|
ids: params.ids,
|
|
34
35
|
offerCatalog: { id: transportation.hasOfferCatalog.id },
|
|
35
36
|
availableAtOrFrom: { id: (_c = params.store) === null || _c === void 0 ? void 0 : _c.id },
|
|
37
|
+
unacceptedPaymentMethod,
|
|
36
38
|
sort: params.sort
|
|
37
39
|
});
|
|
38
40
|
}
|
|
@@ -42,24 +44,6 @@ function searchTransportationEventTicketOffers(params) {
|
|
|
42
44
|
throw new factory.errors.NotFound('event.offers.itemOffered.id');
|
|
43
45
|
}
|
|
44
46
|
const { soundFormatChargeSpecifications, videoFormatChargeSpecifications, movieTicketTypeChargeSpecs } = yield searchPriceSpecs4event({ project: { id: screeningEvent.project.id }, soundFormatTypes, videoFormatTypes })(repos);
|
|
45
|
-
const unacceptedPaymentMethod = getUnacceptedPaymentMethodByEvent({ event: screeningEvent });
|
|
46
|
-
// 不許可決済方法があれば、該当オファーを除外
|
|
47
|
-
if (Array.isArray(unacceptedPaymentMethod) && unacceptedPaymentMethod.length > 0) {
|
|
48
|
-
availableOffers = availableOffers.filter((o) => {
|
|
49
|
-
var _a;
|
|
50
|
-
// 複数決済カード対応(2022-07-11~)
|
|
51
|
-
const priceSpecificationAppliesToMovieTicket = (_a = o.priceSpecification) === null || _a === void 0 ? void 0 : _a.appliesToMovieTicket;
|
|
52
|
-
if (Array.isArray(priceSpecificationAppliesToMovieTicket)) {
|
|
53
|
-
return priceSpecificationAppliesToMovieTicket.every((appliesToMovieTicket) => {
|
|
54
|
-
return !unacceptedPaymentMethod.includes(appliesToMovieTicket.serviceOutput.typeOf);
|
|
55
|
-
});
|
|
56
|
-
}
|
|
57
|
-
else {
|
|
58
|
-
// Arrayでないケースは廃止(2022-09-10~)
|
|
59
|
-
return true;
|
|
60
|
-
}
|
|
61
|
-
});
|
|
62
|
-
}
|
|
63
47
|
// 適用決済カード条件がある場合、決済カード加算料金が存在しないオファーは除外する
|
|
64
48
|
availableOffers = availableOffers.filter((o) => {
|
|
65
49
|
var _a;
|
|
@@ -91,6 +75,12 @@ function searchTransportationEventTicketOffers(params) {
|
|
|
91
75
|
return true;
|
|
92
76
|
}
|
|
93
77
|
});
|
|
78
|
+
// paging処理を追加(2023-02-21~)
|
|
79
|
+
if (typeof params.limit === 'number' && typeof params.page === 'number') {
|
|
80
|
+
const start = params.limit * (params.page - 1);
|
|
81
|
+
const end = params.limit * params.page;
|
|
82
|
+
availableOffers = availableOffers.slice(start, end);
|
|
83
|
+
}
|
|
94
84
|
let offers4event = availableOffers.map((availableOffer) => {
|
|
95
85
|
return (0, factory_1.createCompoundPriceSpec4event)({
|
|
96
86
|
eligibleQuantity: eventOffers.eligibleQuantity,
|
|
@@ -138,12 +128,12 @@ function searchScreeningEventTicketOffers(params) {
|
|
|
138
128
|
return (repos) => __awaiter(this, void 0, void 0, function* () {
|
|
139
129
|
var _a, _b, _c, _d;
|
|
140
130
|
// イベント取得属性最適化(2023-01-23~)
|
|
141
|
-
// const screeningEvent = await repos.event.findById<factory.eventType.ScreeningEvent>({ id: params.eventId });
|
|
142
131
|
const screeningEvent = params.event;
|
|
143
132
|
// 取得属性最適化(2023-01-25~)
|
|
144
133
|
const superEvent = yield repos.event.findById({ id: screeningEvent.superEvent.id }, { soundFormat: 1, videoFormat: 1 });
|
|
145
134
|
const soundFormatTypes = (Array.isArray(superEvent.soundFormat)) ? superEvent.soundFormat.map((f) => f.typeOf) : [];
|
|
146
135
|
const videoFormatTypes = (Array.isArray(superEvent.videoFormat)) ? superEvent.videoFormat.map((f) => f.typeOf) : [];
|
|
136
|
+
const unacceptedPaymentMethod = getUnacceptedPaymentMethodByEvent({ event: screeningEvent });
|
|
147
137
|
let availableOffers = [];
|
|
148
138
|
// 興行設定があれば興行のカタログを参照する(2022-08-31~)
|
|
149
139
|
const eventOffers = screeningEvent.offers;
|
|
@@ -154,6 +144,7 @@ function searchScreeningEventTicketOffers(params) {
|
|
|
154
144
|
ids: params.ids,
|
|
155
145
|
offerCatalog: { id: eventService.hasOfferCatalog.id },
|
|
156
146
|
availableAtOrFrom: { id: (_c = params.store) === null || _c === void 0 ? void 0 : _c.id },
|
|
147
|
+
unacceptedPaymentMethod,
|
|
157
148
|
sort: params.sort
|
|
158
149
|
});
|
|
159
150
|
}
|
|
@@ -163,24 +154,22 @@ function searchScreeningEventTicketOffers(params) {
|
|
|
163
154
|
throw new factory.errors.NotFound('event.offers.itemOffered.id');
|
|
164
155
|
}
|
|
165
156
|
const { soundFormatChargeSpecifications, videoFormatChargeSpecifications, movieTicketTypeChargeSpecs } = yield searchPriceSpecs4event({ project: { id: screeningEvent.project.id }, soundFormatTypes, videoFormatTypes })(repos);
|
|
166
|
-
const unacceptedPaymentMethod = getUnacceptedPaymentMethodByEvent({ event: screeningEvent });
|
|
167
157
|
// 不許可決済方法があれば、該当オファーを除外
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
}
|
|
158
|
+
// Mongoオファー検索条件へ移行(2023-02-21~)
|
|
159
|
+
// if (Array.isArray(unacceptedPaymentMethod) && unacceptedPaymentMethod.length > 0) {
|
|
160
|
+
// availableOffers = availableOffers.filter((o) => {
|
|
161
|
+
// // 複数決済カード対応(2022-07-11~)
|
|
162
|
+
// const priceSpecificationAppliesToMovieTicket = o.priceSpecification?.appliesToMovieTicket;
|
|
163
|
+
// if (Array.isArray(priceSpecificationAppliesToMovieTicket)) {
|
|
164
|
+
// return priceSpecificationAppliesToMovieTicket.every((appliesToMovieTicket) => {
|
|
165
|
+
// return !unacceptedPaymentMethod.includes(appliesToMovieTicket.serviceOutput.typeOf);
|
|
166
|
+
// });
|
|
167
|
+
// } else {
|
|
168
|
+
// // Arrayでないケースは廃止(2022-09-10~)
|
|
169
|
+
// return true;
|
|
170
|
+
// }
|
|
171
|
+
// });
|
|
172
|
+
// }
|
|
184
173
|
// 適用決済カード条件がある場合、決済カード加算料金が存在しないオファーは除外する
|
|
185
174
|
availableOffers = availableOffers.filter((o) => {
|
|
186
175
|
var _a;
|
|
@@ -212,6 +201,12 @@ function searchScreeningEventTicketOffers(params) {
|
|
|
212
201
|
return true;
|
|
213
202
|
}
|
|
214
203
|
});
|
|
204
|
+
// paging処理を追加(2023-02-21~)
|
|
205
|
+
if (typeof params.limit === 'number' && typeof params.page === 'number') {
|
|
206
|
+
const start = params.limit * (params.page - 1);
|
|
207
|
+
const end = params.limit * params.page;
|
|
208
|
+
availableOffers = availableOffers.slice(start, end);
|
|
209
|
+
}
|
|
215
210
|
let offers4event = availableOffers.map((availableOffer) => {
|
|
216
211
|
return (0, factory_1.createCompoundPriceSpec4event)({
|
|
217
212
|
eligibleQuantity: eventOffers.eligibleQuantity,
|
|
@@ -253,9 +248,6 @@ function getUnacceptedPaymentMethodByEvent(params) {
|
|
|
253
248
|
const eventOffers = params.event.offers;
|
|
254
249
|
const unacceptedPaymentMethodByEvent = eventOffers === null || eventOffers === void 0 ? void 0 : eventOffers.unacceptedPaymentMethod;
|
|
255
250
|
// 施設コンテンツを参照する必要はない(2022-10-31~)
|
|
256
|
-
// if (Array.isArray(unacceptedPaymentMethodBySuperEvent)) {
|
|
257
|
-
// unacceptedPaymentMethod = unacceptedPaymentMethodBySuperEvent;
|
|
258
|
-
// }
|
|
259
251
|
// イベントにunacceptedPaymentMethod設定があれば上書き
|
|
260
252
|
if (Array.isArray(unacceptedPaymentMethodByEvent)) {
|
|
261
253
|
unacceptedPaymentMethod = unacceptedPaymentMethodByEvent;
|
|
@@ -394,6 +386,8 @@ function searchEventTicketOffers(params) {
|
|
|
394
386
|
ids: params.ids,
|
|
395
387
|
event,
|
|
396
388
|
store: params.store,
|
|
389
|
+
limit: params.limit,
|
|
390
|
+
page: params.page,
|
|
397
391
|
sort: params.sort,
|
|
398
392
|
validateOfferRateLimit: params.validateOfferRateLimit
|
|
399
393
|
})(repos);
|
|
@@ -405,6 +399,8 @@ function searchEventTicketOffers(params) {
|
|
|
405
399
|
ids: params.ids,
|
|
406
400
|
event,
|
|
407
401
|
store: params.store,
|
|
402
|
+
limit: params.limit,
|
|
403
|
+
page: params.page,
|
|
408
404
|
sort: params.sort,
|
|
409
405
|
validateOfferRateLimit: params.validateOfferRateLimit
|
|
410
406
|
})(repos);
|
package/package.json
CHANGED
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
}
|
|
10
10
|
],
|
|
11
11
|
"dependencies": {
|
|
12
|
-
"@chevre/factory": "4.289.0-alpha.
|
|
12
|
+
"@chevre/factory": "4.289.0-alpha.10",
|
|
13
13
|
"@cinerino/sdk": "3.140.0-alpha.11",
|
|
14
14
|
"@motionpicture/coa-service": "9.2.0",
|
|
15
15
|
"@motionpicture/gmo-service": "5.2.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.4.0-alpha.
|
|
123
|
+
"version": "20.4.0-alpha.11"
|
|
124
124
|
}
|