@chevre/domain 21.17.0-alpha.13 → 21.17.0-alpha.15

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.
@@ -10,10 +10,10 @@ mongoose.Model.on('index', (...args) => {
10
10
  async function main() {
11
11
  await mongoose.connect(<string>process.env.MONGOLAB_URI);
12
12
 
13
- const indexes = await mongoose.connection.db.collection('aggregateOffers')
14
- .indexes();
15
- console.log(indexes);
16
- console.log(indexes.length);
13
+ // const indexes = await mongoose.connection.db.collection('aggregateOffers')
14
+ // .indexes();
15
+ // console.log(indexes);
16
+ // console.log(indexes.length);
17
17
  // await mongoose.connection.db.collection('aggregateOffers')
18
18
  // .dropIndexes();
19
19
  // console.log('indexes droped');
@@ -27,7 +27,17 @@ async function main() {
27
27
  availability: { $eq: chevre.factory.itemAvailability.InStock },
28
28
  parentOffer: {
29
29
  },
30
- includedInDataCatalog: { id: { $in: ['0001'] } }
30
+ priceSpecification: {
31
+ appliesToMovieTicket: {
32
+ serviceOutput: {
33
+ typeOf: {
34
+ // $eq: '',
35
+ // $all: []
36
+ }
37
+ }
38
+ }
39
+ }
40
+ // includedInDataCatalog: { id: { $in: ['0001'] } }
31
41
  // additionalProperty: {
32
42
  // $all: [
33
43
  // {
@@ -45,9 +55,9 @@ async function main() {
45
55
  // ]
46
56
  // }
47
57
  });
48
- // console.log(offers.map((offer) => {
49
- // return `${offer.project.id} ${offer.id} ${offer.identifier} ${offer.name.ja}`;
50
- // }));
58
+ console.log(offers.map((offer) => {
59
+ return `${offer.project.id} ${offer.id} ${offer.identifier} ${offer.name.ja}`;
60
+ }));
51
61
  console.log(offers.length);
52
62
  }
53
63
 
@@ -22,7 +22,7 @@ class MongoRepository {
22
22
  }
23
23
  // tslint:disable-next-line:cyclomatic-complexity max-func-body-length
24
24
  static CREATE_AGGREGATE_OFFERS_MATCH_CONDITIONS(params) {
25
- 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, _29, _30, _31, _32, _33, _34, _35, _36;
25
+ 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, _29, _30, _31, _32, _33, _34, _35, _36, _37, _38, _39, _40;
26
26
  const matchStages = [];
27
27
  const projectIdEq = (_b = (_a = params.project) === null || _a === void 0 ? void 0 : _a.id) === null || _b === void 0 ? void 0 : _b.$eq;
28
28
  if (typeof projectIdEq === 'string') {
@@ -204,7 +204,18 @@ class MongoRepository {
204
204
  }
205
205
  });
206
206
  }
207
- const appliesToMovieTicketServiceOutputTypeOfNin = (_7 = (_6 = (_5 = (_4 = params.priceSpecification) === null || _4 === void 0 ? void 0 : _4.appliesToMovieTicket) === null || _5 === void 0 ? void 0 : _5.serviceOutput) === null || _6 === void 0 ? void 0 : _6.typeOf) === null || _7 === void 0 ? void 0 : _7.$nin;
207
+ const appliesToMovieTicketServiceOutputTypeOfAll = (_7 = (_6 = (_5 = (_4 = params.priceSpecification) === null || _4 === void 0 ? void 0 : _4.appliesToMovieTicket) === null || _5 === void 0 ? void 0 : _5.serviceOutput) === null || _6 === void 0 ? void 0 : _6.typeOf) === null || _7 === void 0 ? void 0 : _7.$all;
208
+ if (Array.isArray(appliesToMovieTicketServiceOutputTypeOfAll)) {
209
+ matchStages.push({
210
+ $match: {
211
+ 'offers.priceSpecification.appliesToMovieTicket.serviceOutput.typeOf': {
212
+ $exists: true,
213
+ $all: appliesToMovieTicketServiceOutputTypeOfAll
214
+ }
215
+ }
216
+ });
217
+ }
218
+ const appliesToMovieTicketServiceOutputTypeOfNin = (_11 = (_10 = (_9 = (_8 = params.priceSpecification) === null || _8 === void 0 ? void 0 : _8.appliesToMovieTicket) === null || _9 === void 0 ? void 0 : _9.serviceOutput) === null || _10 === void 0 ? void 0 : _10.typeOf) === null || _11 === void 0 ? void 0 : _11.$nin;
208
219
  if (Array.isArray(appliesToMovieTicketServiceOutputTypeOfNin)) {
209
220
  matchStages.push({
210
221
  $match: {
@@ -215,7 +226,7 @@ class MongoRepository {
215
226
  });
216
227
  }
217
228
  if (params.priceSpecification !== undefined && params.priceSpecification !== null) {
218
- const priceSpecificationPriceGte = (_8 = params.priceSpecification.price) === null || _8 === void 0 ? void 0 : _8.$gte;
229
+ const priceSpecificationPriceGte = (_12 = params.priceSpecification.price) === null || _12 === void 0 ? void 0 : _12.$gte;
219
230
  if (typeof priceSpecificationPriceGte === 'number') {
220
231
  matchStages.push({
221
232
  $match: {
@@ -226,7 +237,7 @@ class MongoRepository {
226
237
  }
227
238
  });
228
239
  }
229
- const priceSpecificationPriceLte = (_9 = params.priceSpecification.price) === null || _9 === void 0 ? void 0 : _9.$lte;
240
+ const priceSpecificationPriceLte = (_13 = params.priceSpecification.price) === null || _13 === void 0 ? void 0 : _13.$lte;
230
241
  if (typeof priceSpecificationPriceLte === 'number') {
231
242
  matchStages.push({
232
243
  $match: {
@@ -237,7 +248,7 @@ class MongoRepository {
237
248
  }
238
249
  });
239
250
  }
240
- const accountsReceivableGte = (_11 = (_10 = params.priceSpecification.accounting) === null || _10 === void 0 ? void 0 : _10.accountsReceivable) === null || _11 === void 0 ? void 0 : _11.$gte;
251
+ const accountsReceivableGte = (_15 = (_14 = params.priceSpecification.accounting) === null || _14 === void 0 ? void 0 : _14.accountsReceivable) === null || _15 === void 0 ? void 0 : _15.$gte;
241
252
  if (typeof accountsReceivableGte === 'number') {
242
253
  matchStages.push({
243
254
  $match: {
@@ -248,7 +259,7 @@ class MongoRepository {
248
259
  }
249
260
  });
250
261
  }
251
- const accountsReceivableLte = (_13 = (_12 = params.priceSpecification.accounting) === null || _12 === void 0 ? void 0 : _12.accountsReceivable) === null || _13 === void 0 ? void 0 : _13.$lte;
262
+ const accountsReceivableLte = (_17 = (_16 = params.priceSpecification.accounting) === null || _16 === void 0 ? void 0 : _16.accountsReceivable) === null || _17 === void 0 ? void 0 : _17.$lte;
252
263
  if (typeof accountsReceivableLte === 'number') {
253
264
  matchStages.push({
254
265
  $match: {
@@ -259,7 +270,7 @@ class MongoRepository {
259
270
  }
260
271
  });
261
272
  }
262
- const accountingCodeValueEq = (_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.$eq;
273
+ const accountingCodeValueEq = (_20 = (_19 = (_18 = params.priceSpecification.accounting) === null || _18 === void 0 ? void 0 : _18.operatingRevenue) === null || _19 === void 0 ? void 0 : _19.codeValue) === null || _20 === void 0 ? void 0 : _20.$eq;
263
274
  if (typeof accountingCodeValueEq === 'string') {
264
275
  matchStages.push({
265
276
  $match: {
@@ -270,7 +281,7 @@ class MongoRepository {
270
281
  }
271
282
  });
272
283
  }
273
- const accountingCodeValueIn = (_19 = (_18 = (_17 = params.priceSpecification.accounting) === null || _17 === void 0 ? void 0 : _17.operatingRevenue) === null || _18 === void 0 ? void 0 : _18.codeValue) === null || _19 === void 0 ? void 0 : _19.$in;
284
+ const accountingCodeValueIn = (_23 = (_22 = (_21 = params.priceSpecification.accounting) === null || _21 === void 0 ? void 0 : _21.operatingRevenue) === null || _22 === void 0 ? void 0 : _22.codeValue) === null || _23 === void 0 ? void 0 : _23.$in;
274
285
  if (Array.isArray(accountingCodeValueIn)) {
275
286
  matchStages.push({
276
287
  $match: {
@@ -281,7 +292,7 @@ class MongoRepository {
281
292
  }
282
293
  });
283
294
  }
284
- const referenceQuantityValueEq = (_21 = (_20 = params.priceSpecification.referenceQuantity) === null || _20 === void 0 ? void 0 : _20.value) === null || _21 === void 0 ? void 0 : _21.$eq;
295
+ const referenceQuantityValueEq = (_25 = (_24 = params.priceSpecification.referenceQuantity) === null || _24 === void 0 ? void 0 : _24.value) === null || _25 === void 0 ? void 0 : _25.$eq;
285
296
  if (typeof referenceQuantityValueEq === 'number') {
286
297
  matchStages.push({
287
298
  $match: {
@@ -293,7 +304,7 @@ class MongoRepository {
293
304
  });
294
305
  }
295
306
  }
296
- const availabilityEq = (_22 = params.availability) === null || _22 === void 0 ? void 0 : _22.$eq;
307
+ const availabilityEq = (_26 = params.availability) === null || _26 === void 0 ? void 0 : _26.$eq;
297
308
  if (typeof availabilityEq === 'string') {
298
309
  matchStages.push({
299
310
  $match: {
@@ -301,7 +312,7 @@ class MongoRepository {
301
312
  }
302
313
  });
303
314
  }
304
- const availableAtOrFromIdEq = (_24 = (_23 = params.availableAtOrFrom) === null || _23 === void 0 ? void 0 : _23.id) === null || _24 === void 0 ? void 0 : _24.$eq;
315
+ const availableAtOrFromIdEq = (_28 = (_27 = params.availableAtOrFrom) === null || _27 === void 0 ? void 0 : _27.id) === null || _28 === void 0 ? void 0 : _28.$eq;
305
316
  if (typeof availableAtOrFromIdEq === 'string') {
306
317
  matchStages.push({
307
318
  $match: {
@@ -312,7 +323,7 @@ class MongoRepository {
312
323
  }
313
324
  });
314
325
  }
315
- const availableAtOrFromIdIn = (_26 = (_25 = params.availableAtOrFrom) === null || _25 === void 0 ? void 0 : _25.id) === null || _26 === void 0 ? void 0 : _26.$in;
326
+ const availableAtOrFromIdIn = (_30 = (_29 = params.availableAtOrFrom) === null || _29 === void 0 ? void 0 : _29.id) === null || _30 === void 0 ? void 0 : _30.$in;
316
327
  if (Array.isArray(availableAtOrFromIdIn)) {
317
328
  matchStages.push({
318
329
  $match: {
@@ -323,7 +334,7 @@ class MongoRepository {
323
334
  }
324
335
  });
325
336
  }
326
- const addOnItemOfferedIdEq = (_29 = (_28 = (_27 = params.addOn) === null || _27 === void 0 ? void 0 : _27.itemOffered) === null || _28 === void 0 ? void 0 : _28.id) === null || _29 === void 0 ? void 0 : _29.$eq;
337
+ const addOnItemOfferedIdEq = (_33 = (_32 = (_31 = params.addOn) === null || _31 === void 0 ? void 0 : _31.itemOffered) === null || _32 === void 0 ? void 0 : _32.id) === null || _33 === void 0 ? void 0 : _33.$eq;
327
338
  if (typeof addOnItemOfferedIdEq === 'string') {
328
339
  matchStages.push({
329
340
  $match: {
@@ -331,7 +342,7 @@ class MongoRepository {
331
342
  }
332
343
  });
333
344
  }
334
- const addOnItemOfferedIdIn = (_32 = (_31 = (_30 = params.addOn) === null || _30 === void 0 ? void 0 : _30.itemOffered) === null || _31 === void 0 ? void 0 : _31.id) === null || _32 === void 0 ? void 0 : _32.$in;
345
+ const addOnItemOfferedIdIn = (_36 = (_35 = (_34 = params.addOn) === null || _34 === void 0 ? void 0 : _34.itemOffered) === null || _35 === void 0 ? void 0 : _35.id) === null || _36 === void 0 ? void 0 : _36.$in;
335
346
  if (Array.isArray(addOnItemOfferedIdIn)) {
336
347
  matchStages.push({
337
348
  $match: {
@@ -339,7 +350,7 @@ class MongoRepository {
339
350
  }
340
351
  });
341
352
  }
342
- const hasMerchantReturnPolicyIdEq = (_34 = (_33 = params.hasMerchantReturnPolicy) === null || _33 === void 0 ? void 0 : _33.id) === null || _34 === void 0 ? void 0 : _34.$eq;
353
+ const hasMerchantReturnPolicyIdEq = (_38 = (_37 = params.hasMerchantReturnPolicy) === null || _37 === void 0 ? void 0 : _37.id) === null || _38 === void 0 ? void 0 : _38.$eq;
343
354
  if (typeof hasMerchantReturnPolicyIdEq === 'string') {
344
355
  matchStages.push({
345
356
  $match: {
@@ -350,7 +361,7 @@ class MongoRepository {
350
361
  }
351
362
  });
352
363
  }
353
- const additionalPropertyAll = (_35 = params.additionalProperty) === null || _35 === void 0 ? void 0 : _35.$all;
364
+ const additionalPropertyAll = (_39 = params.additionalProperty) === null || _39 === void 0 ? void 0 : _39.$all;
354
365
  if (Array.isArray(additionalPropertyAll)) {
355
366
  matchStages.push({
356
367
  $match: {
@@ -361,7 +372,7 @@ class MongoRepository {
361
372
  }
362
373
  });
363
374
  }
364
- const additionalPropertyElemMatch = (_36 = params.additionalProperty) === null || _36 === void 0 ? void 0 : _36.$elemMatch;
375
+ const additionalPropertyElemMatch = (_40 = params.additionalProperty) === null || _40 === void 0 ? void 0 : _40.$elemMatch;
365
376
  if (additionalPropertyElemMatch !== undefined && additionalPropertyElemMatch !== null) {
366
377
  matchStages.push({
367
378
  $match: {
@@ -11,6 +11,22 @@ export type IUnitPriceOfferFromAggregateOffer = factory.unitPriceOffer.IUnitPric
11
11
  id: string;
12
12
  };
13
13
  };
14
+ export interface IPriceSpecificationConditionsOnSearchWithSortIndex {
15
+ appliesToMovieTicket?: {
16
+ serviceType?: {
17
+ $exists?: boolean;
18
+ };
19
+ serviceOutput?: {
20
+ /**
21
+ * 適用決済方法タイプ
22
+ */
23
+ typeOf?: {
24
+ $eq?: string;
25
+ $all?: string[];
26
+ };
27
+ };
28
+ };
29
+ }
14
30
  /**
15
31
  * 単価オファーリポジトリ
16
32
  */
@@ -83,7 +99,7 @@ export declare class MongoRepository {
83
99
  /**
84
100
  * 適用決済カード条件
85
101
  */
86
- priceSpecification: Pick<factory.unitPriceOffer.IPriceSpecificationSearchConditions, 'appliesToMovieTicket'>;
102
+ priceSpecification: IPriceSpecificationConditionsOnSearchWithSortIndex;
87
103
  onlyValid?: boolean;
88
104
  useIncludeInDataCatalog: boolean;
89
105
  limit?: number;
@@ -40,7 +40,7 @@ class MongoRepository {
40
40
  }
41
41
  // tslint:disable-next-line:cyclomatic-complexity max-func-body-length
42
42
  static CREATE_AGGREGATE_OFFERS_MATCH_CONDITIONS(params) {
43
- 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, _29, _30, _31, _32, _33, _34, _35, _36, _37, _38, _39, _40;
43
+ 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, _29, _30, _31, _32, _33, _34, _35, _36, _37, _38, _39, _40, _41, _42, _43, _44;
44
44
  const matchStages = [];
45
45
  const projectIdEq = (_b = (_a = params.project) === null || _a === void 0 ? void 0 : _a.id) === null || _b === void 0 ? void 0 : _b.$eq;
46
46
  if (typeof projectIdEq === 'string') {
@@ -202,7 +202,18 @@ class MongoRepository {
202
202
  }
203
203
  });
204
204
  }
205
- const appliesToMovieTicketServiceOutputTypeOfNin = (_11 = (_10 = (_9 = (_8 = params.priceSpecification) === null || _8 === void 0 ? void 0 : _8.appliesToMovieTicket) === null || _9 === void 0 ? void 0 : _9.serviceOutput) === null || _10 === void 0 ? void 0 : _10.typeOf) === null || _11 === void 0 ? void 0 : _11.$nin;
205
+ const appliesToMovieTicketServiceOutputTypeOfAll = (_11 = (_10 = (_9 = (_8 = params.priceSpecification) === null || _8 === void 0 ? void 0 : _8.appliesToMovieTicket) === null || _9 === void 0 ? void 0 : _9.serviceOutput) === null || _10 === void 0 ? void 0 : _10.typeOf) === null || _11 === void 0 ? void 0 : _11.$all;
206
+ if (Array.isArray(appliesToMovieTicketServiceOutputTypeOfAll)) {
207
+ matchStages.push({
208
+ $match: {
209
+ 'offers.priceSpecification.appliesToMovieTicket.serviceOutput.typeOf': {
210
+ $exists: true,
211
+ $all: appliesToMovieTicketServiceOutputTypeOfAll
212
+ }
213
+ }
214
+ });
215
+ }
216
+ const appliesToMovieTicketServiceOutputTypeOfNin = (_15 = (_14 = (_13 = (_12 = params.priceSpecification) === null || _12 === void 0 ? void 0 : _12.appliesToMovieTicket) === null || _13 === void 0 ? void 0 : _13.serviceOutput) === null || _14 === void 0 ? void 0 : _14.typeOf) === null || _15 === void 0 ? void 0 : _15.$nin;
206
217
  if (Array.isArray(appliesToMovieTicketServiceOutputTypeOfNin)) {
207
218
  matchStages.push({
208
219
  $match: {
@@ -213,7 +224,7 @@ class MongoRepository {
213
224
  });
214
225
  }
215
226
  if (params.priceSpecification !== undefined && params.priceSpecification !== null) {
216
- const priceSpecificationPriceGte = (_12 = params.priceSpecification.price) === null || _12 === void 0 ? void 0 : _12.$gte;
227
+ const priceSpecificationPriceGte = (_16 = params.priceSpecification.price) === null || _16 === void 0 ? void 0 : _16.$gte;
217
228
  if (typeof priceSpecificationPriceGte === 'number') {
218
229
  matchStages.push({
219
230
  $match: {
@@ -224,7 +235,7 @@ class MongoRepository {
224
235
  }
225
236
  });
226
237
  }
227
- const priceSpecificationPriceLte = (_13 = params.priceSpecification.price) === null || _13 === void 0 ? void 0 : _13.$lte;
238
+ const priceSpecificationPriceLte = (_17 = params.priceSpecification.price) === null || _17 === void 0 ? void 0 : _17.$lte;
228
239
  if (typeof priceSpecificationPriceLte === 'number') {
229
240
  matchStages.push({
230
241
  $match: {
@@ -235,7 +246,7 @@ class MongoRepository {
235
246
  }
236
247
  });
237
248
  }
238
- const accountsReceivableGte = (_15 = (_14 = params.priceSpecification.accounting) === null || _14 === void 0 ? void 0 : _14.accountsReceivable) === null || _15 === void 0 ? void 0 : _15.$gte;
249
+ const accountsReceivableGte = (_19 = (_18 = params.priceSpecification.accounting) === null || _18 === void 0 ? void 0 : _18.accountsReceivable) === null || _19 === void 0 ? void 0 : _19.$gte;
239
250
  if (typeof accountsReceivableGte === 'number') {
240
251
  matchStages.push({
241
252
  $match: {
@@ -246,7 +257,7 @@ class MongoRepository {
246
257
  }
247
258
  });
248
259
  }
249
- const accountsReceivableLte = (_17 = (_16 = params.priceSpecification.accounting) === null || _16 === void 0 ? void 0 : _16.accountsReceivable) === null || _17 === void 0 ? void 0 : _17.$lte;
260
+ const accountsReceivableLte = (_21 = (_20 = params.priceSpecification.accounting) === null || _20 === void 0 ? void 0 : _20.accountsReceivable) === null || _21 === void 0 ? void 0 : _21.$lte;
250
261
  if (typeof accountsReceivableLte === 'number') {
251
262
  matchStages.push({
252
263
  $match: {
@@ -257,7 +268,7 @@ class MongoRepository {
257
268
  }
258
269
  });
259
270
  }
260
- const accountingCodeValueEq = (_20 = (_19 = (_18 = params.priceSpecification.accounting) === null || _18 === void 0 ? void 0 : _18.operatingRevenue) === null || _19 === void 0 ? void 0 : _19.codeValue) === null || _20 === void 0 ? void 0 : _20.$eq;
271
+ const accountingCodeValueEq = (_24 = (_23 = (_22 = params.priceSpecification.accounting) === null || _22 === void 0 ? void 0 : _22.operatingRevenue) === null || _23 === void 0 ? void 0 : _23.codeValue) === null || _24 === void 0 ? void 0 : _24.$eq;
261
272
  if (typeof accountingCodeValueEq === 'string') {
262
273
  matchStages.push({
263
274
  $match: {
@@ -268,7 +279,7 @@ class MongoRepository {
268
279
  }
269
280
  });
270
281
  }
271
- const accountingCodeValueIn = (_23 = (_22 = (_21 = params.priceSpecification.accounting) === null || _21 === void 0 ? void 0 : _21.operatingRevenue) === null || _22 === void 0 ? void 0 : _22.codeValue) === null || _23 === void 0 ? void 0 : _23.$in;
282
+ const accountingCodeValueIn = (_27 = (_26 = (_25 = params.priceSpecification.accounting) === null || _25 === void 0 ? void 0 : _25.operatingRevenue) === null || _26 === void 0 ? void 0 : _26.codeValue) === null || _27 === void 0 ? void 0 : _27.$in;
272
283
  if (Array.isArray(accountingCodeValueIn)) {
273
284
  matchStages.push({
274
285
  $match: {
@@ -279,7 +290,7 @@ class MongoRepository {
279
290
  }
280
291
  });
281
292
  }
282
- const referenceQuantityValueEq = (_25 = (_24 = params.priceSpecification.referenceQuantity) === null || _24 === void 0 ? void 0 : _24.value) === null || _25 === void 0 ? void 0 : _25.$eq;
293
+ const referenceQuantityValueEq = (_29 = (_28 = params.priceSpecification.referenceQuantity) === null || _28 === void 0 ? void 0 : _28.value) === null || _29 === void 0 ? void 0 : _29.$eq;
283
294
  if (typeof referenceQuantityValueEq === 'number') {
284
295
  matchStages.push({
285
296
  $match: {
@@ -291,7 +302,7 @@ class MongoRepository {
291
302
  });
292
303
  }
293
304
  }
294
- const availabilityEq = (_26 = params.availability) === null || _26 === void 0 ? void 0 : _26.$eq;
305
+ const availabilityEq = (_30 = params.availability) === null || _30 === void 0 ? void 0 : _30.$eq;
295
306
  if (typeof availabilityEq === 'string') {
296
307
  matchStages.push({
297
308
  $match: {
@@ -299,7 +310,7 @@ class MongoRepository {
299
310
  }
300
311
  });
301
312
  }
302
- const availableAtOrFromIdEq = (_28 = (_27 = params.availableAtOrFrom) === null || _27 === void 0 ? void 0 : _27.id) === null || _28 === void 0 ? void 0 : _28.$eq;
313
+ const availableAtOrFromIdEq = (_32 = (_31 = params.availableAtOrFrom) === null || _31 === void 0 ? void 0 : _31.id) === null || _32 === void 0 ? void 0 : _32.$eq;
303
314
  if (typeof availableAtOrFromIdEq === 'string') {
304
315
  matchStages.push({
305
316
  $match: {
@@ -310,7 +321,7 @@ class MongoRepository {
310
321
  }
311
322
  });
312
323
  }
313
- const availableAtOrFromIdIn = (_30 = (_29 = params.availableAtOrFrom) === null || _29 === void 0 ? void 0 : _29.id) === null || _30 === void 0 ? void 0 : _30.$in;
324
+ const availableAtOrFromIdIn = (_34 = (_33 = params.availableAtOrFrom) === null || _33 === void 0 ? void 0 : _33.id) === null || _34 === void 0 ? void 0 : _34.$in;
314
325
  if (Array.isArray(availableAtOrFromIdIn)) {
315
326
  matchStages.push({
316
327
  $match: {
@@ -321,7 +332,7 @@ class MongoRepository {
321
332
  }
322
333
  });
323
334
  }
324
- const addOnItemOfferedIdEq = (_33 = (_32 = (_31 = params.addOn) === null || _31 === void 0 ? void 0 : _31.itemOffered) === null || _32 === void 0 ? void 0 : _32.id) === null || _33 === void 0 ? void 0 : _33.$eq;
335
+ const addOnItemOfferedIdEq = (_37 = (_36 = (_35 = params.addOn) === null || _35 === void 0 ? void 0 : _35.itemOffered) === null || _36 === void 0 ? void 0 : _36.id) === null || _37 === void 0 ? void 0 : _37.$eq;
325
336
  if (typeof addOnItemOfferedIdEq === 'string') {
326
337
  matchStages.push({
327
338
  $match: {
@@ -329,7 +340,7 @@ class MongoRepository {
329
340
  }
330
341
  });
331
342
  }
332
- const addOnItemOfferedIdIn = (_36 = (_35 = (_34 = params.addOn) === null || _34 === void 0 ? void 0 : _34.itemOffered) === null || _35 === void 0 ? void 0 : _35.id) === null || _36 === void 0 ? void 0 : _36.$in;
343
+ const addOnItemOfferedIdIn = (_40 = (_39 = (_38 = params.addOn) === null || _38 === void 0 ? void 0 : _38.itemOffered) === null || _39 === void 0 ? void 0 : _39.id) === null || _40 === void 0 ? void 0 : _40.$in;
333
344
  if (Array.isArray(addOnItemOfferedIdIn)) {
334
345
  matchStages.push({
335
346
  $match: {
@@ -337,7 +348,7 @@ class MongoRepository {
337
348
  }
338
349
  });
339
350
  }
340
- const hasMerchantReturnPolicyIdEq = (_38 = (_37 = params.hasMerchantReturnPolicy) === null || _37 === void 0 ? void 0 : _37.id) === null || _38 === void 0 ? void 0 : _38.$eq;
351
+ const hasMerchantReturnPolicyIdEq = (_42 = (_41 = params.hasMerchantReturnPolicy) === null || _41 === void 0 ? void 0 : _41.id) === null || _42 === void 0 ? void 0 : _42.$eq;
341
352
  if (typeof hasMerchantReturnPolicyIdEq === 'string') {
342
353
  matchStages.push({
343
354
  $match: {
@@ -348,7 +359,7 @@ class MongoRepository {
348
359
  }
349
360
  });
350
361
  }
351
- const additionalPropertyAll = (_39 = params.additionalProperty) === null || _39 === void 0 ? void 0 : _39.$all;
362
+ const additionalPropertyAll = (_43 = params.additionalProperty) === null || _43 === void 0 ? void 0 : _43.$all;
352
363
  if (Array.isArray(additionalPropertyAll)) {
353
364
  matchStages.push({
354
365
  $match: {
@@ -359,7 +370,7 @@ class MongoRepository {
359
370
  }
360
371
  });
361
372
  }
362
- const additionalPropertyElemMatch = (_40 = params.additionalProperty) === null || _40 === void 0 ? void 0 : _40.$elemMatch;
373
+ const additionalPropertyElemMatch = (_44 = params.additionalProperty) === null || _44 === void 0 ? void 0 : _44.$elemMatch;
363
374
  if (additionalPropertyElemMatch !== undefined && additionalPropertyElemMatch !== null) {
364
375
  matchStages.push({
365
376
  $match: {
@@ -527,7 +538,7 @@ class MongoRepository {
527
538
  * カタログ内ソートインデックスはsortedOfferIdsで判断する
528
539
  */
529
540
  searchByOfferCatalogIdWithSortIndex(params) {
530
- var _a, _b, _c, _d, _e, _f, _g, _h;
541
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
531
542
  return __awaiter(this, void 0, void 0, function* () {
532
543
  const sortedOfferIds = yield this.searchAggregateOfferIdsBySubOfferCatalog({
533
544
  id: params.offerCatalog.id,
@@ -536,17 +547,20 @@ class MongoRepository {
536
547
  let offers = [];
537
548
  if (sortedOfferIds.length > 0) {
538
549
  const appliesToMovieTicketServiceOutputTypeOfEq = (_d = (_c = (_b = (_a = params.priceSpecification) === null || _a === void 0 ? void 0 : _a.appliesToMovieTicket) === null || _b === void 0 ? void 0 : _b.serviceOutput) === null || _c === void 0 ? void 0 : _c.typeOf) === null || _d === void 0 ? void 0 : _d.$eq;
539
- const appliesToMovieTicketServiceTypeExists = (_g = (_f = (_e = params.priceSpecification) === null || _e === void 0 ? void 0 : _e.appliesToMovieTicket) === null || _f === void 0 ? void 0 : _f.serviceType) === null || _g === void 0 ? void 0 : _g.$exists;
550
+ const appliesToMovieTicketServiceOutputTypeOfAll = (_h = (_g = (_f = (_e = params.priceSpecification) === null || _e === void 0 ? void 0 : _e.appliesToMovieTicket) === null || _f === void 0 ? void 0 : _f.serviceOutput) === null || _g === void 0 ? void 0 : _g.typeOf) === null || _h === void 0 ? void 0 : _h.$all;
551
+ const appliesToMovieTicketServiceTypeExists = (_l = (_k = (_j = params.priceSpecification) === null || _j === void 0 ? void 0 : _j.appliesToMovieTicket) === null || _k === void 0 ? void 0 : _k.serviceType) === null || _l === void 0 ? void 0 : _l.$exists;
540
552
  // 適用決済カード条件なしのみを検索するかどうか
541
553
  const onlyNoAppliesToMovieTicket = params.excludeAppliesToMovieTicket || (appliesToMovieTicketServiceTypeExists === false);
542
554
  const onlyAppliesToMovieTicket = !params.excludeAppliesToMovieTicket && (appliesToMovieTicketServiceTypeExists === true);
543
555
  const priceSpecificationConditions = {
544
556
  appliesToMovieTicket: Object.assign(Object.assign({ serviceOutput: {
545
- typeOf: Object.assign(Object.assign({}, (Array.isArray(params.unacceptedPaymentMethod) && params.unacceptedPaymentMethod.length > 0)
557
+ typeOf: Object.assign(Object.assign(Object.assign({}, (Array.isArray(params.unacceptedPaymentMethod) && params.unacceptedPaymentMethod.length > 0)
546
558
  // 利用不可決済方法区分条件を追加(2023-02-21~)
547
559
  ? { $nin: params.unacceptedPaymentMethod }
548
560
  : undefined), (typeof appliesToMovieTicketServiceOutputTypeOfEq === 'string')
549
561
  ? { $eq: appliesToMovieTicketServiceOutputTypeOfEq }
562
+ : undefined), (Array.isArray(appliesToMovieTicketServiceOutputTypeOfAll))
563
+ ? { $all: appliesToMovieTicketServiceOutputTypeOfAll }
550
564
  : undefined)
551
565
  } }, (onlyNoAppliesToMovieTicket)
552
566
  ? { serviceType: { $exists: false } }
@@ -556,7 +570,7 @@ class MongoRepository {
556
570
  };
557
571
  const searchOffersConditions = Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({ priceSpecification: priceSpecificationConditions, onlyValid: params.onlyValid === true }, (params.useIncludeInDataCatalog)
558
572
  ? { includedInDataCatalog: { id: { $in: [params.offerCatalog.id] } } }
559
- : { parentOffer: { id: { $in: sortedOfferIds } } }), (typeof ((_h = params.availableAtOrFrom) === null || _h === void 0 ? void 0 : _h.id) === 'string')
573
+ : { parentOffer: { id: { $in: sortedOfferIds } } }), (typeof ((_m = params.availableAtOrFrom) === null || _m === void 0 ? void 0 : _m.id) === 'string')
560
574
  ? { availableAtOrFrom: { id: { $eq: params.availableAtOrFrom.id } } } // store.idでのフィルターをmongoで処理(2023-01-27~)
561
575
  : undefined), (typeof params.limit === 'number' && typeof params.page === 'number')
562
576
  // 明示的なソート指定を調整(決して重複しない属性が相応)(2023-09-07~)
@@ -25,6 +25,7 @@
25
25
  import { AnyExpression, Connection, FilterQuery } from 'mongoose';
26
26
  import * as factory from '../factory';
27
27
  export type ISeller = factory.seller.ISeller;
28
+ export type ISavingSeller = Omit<factory.seller.ISeller, 'paymentAccepted'>;
28
29
  export type ISellerByAggregate = Pick<ISeller, 'additionalProperty' | 'branchCode' | 'hasMerchantReturnPolicy' | 'id' | 'name' | 'project' | 'telephone' | 'typeOf' | 'url'>;
29
30
  export interface IMemberSearchConditions {
30
31
  /**
@@ -54,8 +55,8 @@ export declare class MongoRepository {
54
55
  */
55
56
  save(params: {
56
57
  id?: string;
57
- attributes: factory.seller.ISeller;
58
- }): Promise<ISeller>;
58
+ attributes: ISavingSeller;
59
+ }): Promise<ISavingSeller>;
59
60
  /**
60
61
  * 集計検索(publicな属性検索が目的)
61
62
  */
@@ -1,5 +1,5 @@
1
1
  import type { MongoRepository as EventRepo } from '../../../repo/event';
2
- import type { MongoRepository as OfferRepo } from '../../../repo/offer';
2
+ import type { IPriceSpecificationConditionsOnSearchWithSortIndex, MongoRepository as OfferRepo } from '../../../repo/offer';
3
3
  import type { MongoRepository as OfferCatalogRepo } from '../../../repo/offerCatalog';
4
4
  import type { MongoRepository as OfferCatalogItemRepo } from '../../../repo/offerCatalogItem';
5
5
  import type { MongoRepository as PriceSpecificationRepo } from '../../../repo/priceSpecification';
@@ -41,7 +41,7 @@ declare function searchEventTicketOffers(params: {
41
41
  * 有効期間内のみかどうか
42
42
  */
43
43
  onlyValid: boolean;
44
- priceSpecification: Pick<factory.unitPriceOffer.IPriceSpecificationSearchConditions, 'appliesToMovieTicket'>;
44
+ priceSpecification: IPriceSpecificationConditionsOnSearchWithSortIndex;
45
45
  includedInDataCatalog: {
46
46
  id: string;
47
47
  };
@@ -17,7 +17,7 @@ const factory_1 = require("../factory");
17
17
  function searchTicketOffersByItemOffered(params) {
18
18
  // tslint:disable-next-line:max-func-body-length
19
19
  return (repos) => __awaiter(this, void 0, void 0, function* () {
20
- var _a, _b, _c, _d, _e, _f, _g, _h, _j;
20
+ var _a, _b, _c, _d, _e, _f, _g;
21
21
  let eventService;
22
22
  let catalogId;
23
23
  eventService = yield repos.product.findById({ id: (_a = params.itemOffered) === null || _a === void 0 ? void 0 : _a.id }, ['hasOfferCatalog', 'project'], []);
@@ -61,11 +61,15 @@ function searchTicketOffersByItemOffered(params) {
61
61
  throw new factory.errors.NotFound('OfferCatalogItem');
62
62
  }
63
63
  // 強制的にサブカタログの適用決済カード条件に変更
64
- const appliesToMovieTicketServiceOutputTypeOfBySubCatalog = (_g = (_f = (_e = (_d = offerCatalogItem.relatedOffer) === null || _d === void 0 ? void 0 : _d.priceSpecification) === null || _e === void 0 ? void 0 : _e.appliesToMovieTicket) === null || _f === void 0 ? void 0 : _f.shift()) === null || _g === void 0 ? void 0 : _g.serviceOutput.typeOf;
65
- if (typeof appliesToMovieTicketServiceOutputTypeOfBySubCatalog === 'string') {
64
+ const appliesToMovieTicketBySubCatalog = (_e = (_d = offerCatalogItem.relatedOffer) === null || _d === void 0 ? void 0 : _d.priceSpecification) === null || _e === void 0 ? void 0 : _e.appliesToMovieTicket;
65
+ if (Array.isArray(appliesToMovieTicketBySubCatalog)) {
66
66
  priceSpecificationCondition = {
67
67
  appliesToMovieTicket: {
68
- serviceOutput: { typeOf: { $eq: appliesToMovieTicketServiceOutputTypeOfBySubCatalog } },
68
+ serviceOutput: {
69
+ typeOf: {
70
+ $all: appliesToMovieTicketBySubCatalog.map((movieTicket) => movieTicket.serviceOutput.typeOf) // 複数条件対応
71
+ }
72
+ },
69
73
  serviceType: { $exists: true }
70
74
  }
71
75
  };
@@ -78,7 +82,7 @@ function searchTicketOffersByItemOffered(params) {
78
82
  }
79
83
  const { offers, sortedOfferIds } = yield repos.offer.searchByOfferCatalogIdWithSortIndex({
80
84
  offerCatalog: { id: subOfferCatalogId, isOfferCatalogItem },
81
- availableAtOrFrom: { id: (_h = params.store) === null || _h === void 0 ? void 0 : _h.id },
85
+ availableAtOrFrom: { id: (_f = params.store) === null || _f === void 0 ? void 0 : _f.id },
82
86
  unacceptedPaymentMethod: params.unacceptedPaymentMethod,
83
87
  excludeAppliesToMovieTicket: params.excludeAppliesToMovieTicket,
84
88
  priceSpecification: priceSpecificationCondition,
@@ -106,7 +110,7 @@ function searchTicketOffersByItemOffered(params) {
106
110
  const availableOffers = yield repos.offer.searchAllByIdsAndOfferCatalogId({
107
111
  ids: params.ids,
108
112
  includedInDataCatalog: { id: includedInDataCatalogIds, isOfferCatalogItem },
109
- availableAtOrFrom: { id: (_j = params.store) === null || _j === void 0 ? void 0 : _j.id },
113
+ availableAtOrFrom: { id: (_g = params.store) === null || _g === void 0 ? void 0 : _g.id },
110
114
  unacceptedPaymentMethod: params.unacceptedPaymentMethod,
111
115
  excludeAppliesToMovieTicket: params.excludeAppliesToMovieTicket,
112
116
  onlyValid: params.onlyValid === true
package/package.json CHANGED
@@ -10,7 +10,7 @@
10
10
  ],
11
11
  "dependencies": {
12
12
  "@aws-sdk/credential-providers": "3.433.0",
13
- "@chevre/factory": "4.343.0-alpha.4",
13
+ "@chevre/factory": "4.343.0-alpha.5",
14
14
  "@cinerino/sdk": "5.2.0-alpha.4",
15
15
  "@motionpicture/coa-service": "9.2.0",
16
16
  "@motionpicture/gmo-service": "5.2.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.17.0-alpha.13"
120
+ "version": "21.17.0-alpha.15"
121
121
  }