@chevre/domain 21.2.0-alpha.96 → 21.2.0-alpha.97

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.
@@ -69,7 +69,9 @@ async function main() {
69
69
  validateEvent: false,
70
70
  validateEventOfferPeriod: false,
71
71
  validateAppliesToMovieTicket: true,
72
- disablePendingReservations: true
72
+ disablePendingReservations: true,
73
+ stockHoldUntilDaysAfterEventEnd: 31,
74
+ useHoldStockByTransactionNumber: true
73
75
  })({
74
76
  stockHolder: itemAvailabilityRepo,
75
77
  event: eventRepo,
@@ -0,0 +1,30 @@
1
+ // tslint:disable:no-implicit-dependencies no-console
2
+ import { chevre } from '../../../lib/index';
3
+
4
+ import * as mongoose from 'mongoose';
5
+
6
+ const project = { id: String(process.env.PROJECT_ID) };
7
+
8
+ async function main() {
9
+ await mongoose.connect(<string>process.env.MONGOLAB_URI, { autoIndex: true });
10
+
11
+ const assetTransactionRepo = new chevre.repository.AssetTransaction(mongoose.connection);
12
+ const assetTransactions = await assetTransactionRepo.search(
13
+ {
14
+ typeOf: chevre.factory.assetTransactionType.Reserve,
15
+ project: { id: { $eq: project.id } },
16
+ object: {
17
+ reservations: { reservedTicket: { ticketedSeat: { seatNumber: { $eq: 'A-03' } } } }
18
+ }
19
+ },
20
+ ['_id', 'transactionNumber'],
21
+ []
22
+ );
23
+ console.log('assetTransactions:', assetTransactions);
24
+ }
25
+
26
+ main()
27
+ .then(() => {
28
+ console.log('success!');
29
+ })
30
+ .catch(console.error);
@@ -23,7 +23,7 @@ class MongoRepository {
23
23
  }
24
24
  // tslint:disable-next-line:cyclomatic-complexity max-func-body-length
25
25
  static CREATE_MONGO_CONDITIONS(params) {
26
- 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;
26
+ 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;
27
27
  const andConditions = [
28
28
  {
29
29
  typeOf: params.typeOf
@@ -246,9 +246,18 @@ class MongoRepository {
246
246
  }
247
247
  });
248
248
  }
249
+ const objectSubReservationSeatNumberEq = (_13 = (_12 = (_11 = (_10 = (_9 = params.object) === null || _9 === void 0 ? void 0 : _9.reservations) === null || _10 === void 0 ? void 0 : _10.reservedTicket) === null || _11 === void 0 ? void 0 : _11.ticketedSeat) === null || _12 === void 0 ? void 0 : _12.seatNumber) === null || _13 === void 0 ? void 0 : _13.$eq;
250
+ if (typeof objectSubReservationSeatNumberEq === 'string') {
251
+ andConditions.push({
252
+ 'object.subReservation.reservedTicket.ticketedSeat.seatNumber': {
253
+ $exists: true,
254
+ $eq: objectSubReservationSeatNumberEq
255
+ }
256
+ });
257
+ }
249
258
  break;
250
259
  case factory.assetTransactionType.RegisterService:
251
- const objectItemOfferedServiceOutputIdentifierEq = (_12 = (_11 = (_10 = (_9 = params.object) === null || _9 === void 0 ? void 0 : _9.itemOffered) === null || _10 === void 0 ? void 0 : _10.serviceOutput) === null || _11 === void 0 ? void 0 : _11.identifier) === null || _12 === void 0 ? void 0 : _12.$eq;
260
+ const objectItemOfferedServiceOutputIdentifierEq = (_17 = (_16 = (_15 = (_14 = params.object) === null || _14 === void 0 ? void 0 : _14.itemOffered) === null || _15 === void 0 ? void 0 : _15.serviceOutput) === null || _16 === void 0 ? void 0 : _16.identifier) === null || _17 === void 0 ? void 0 : _17.$eq;
252
261
  if (typeof objectItemOfferedServiceOutputIdentifierEq === 'string') {
253
262
  andConditions.push({
254
263
  'object.itemOffered.serviceOutput.identifier': {
@@ -257,7 +266,7 @@ class MongoRepository {
257
266
  }
258
267
  });
259
268
  }
260
- const objectItemOfferedServiceOutputIdentifierIn = (_16 = (_15 = (_14 = (_13 = params.object) === null || _13 === void 0 ? void 0 : _13.itemOffered) === null || _14 === void 0 ? void 0 : _14.serviceOutput) === null || _15 === void 0 ? void 0 : _15.identifier) === null || _16 === void 0 ? void 0 : _16.$in;
269
+ const objectItemOfferedServiceOutputIdentifierIn = (_21 = (_20 = (_19 = (_18 = params.object) === null || _18 === void 0 ? void 0 : _18.itemOffered) === null || _19 === void 0 ? void 0 : _19.serviceOutput) === null || _20 === void 0 ? void 0 : _20.identifier) === null || _21 === void 0 ? void 0 : _21.$in;
261
270
  if (Array.isArray(objectItemOfferedServiceOutputIdentifierIn)) {
262
271
  andConditions.push({
263
272
  'object.itemOffered.serviceOutput.identifier': {
@@ -117,6 +117,12 @@ schema.index({ 'object.subReservation.reservationFor.id': 1, startDate: -1 }, {
117
117
  'object.subReservation.reservationFor.id': { $exists: true }
118
118
  }
119
119
  });
120
+ schema.index({ 'object.subReservation.reservedTicket.ticketedSeat.seatNumber': 1, startDate: -1 }, {
121
+ name: 'searchByObjectSubReservationTicketedSeatSeatNumber',
122
+ partialFilterExpression: {
123
+ 'object.subReservation.reservedTicket.ticketedSeat.seatNumber': { $exists: true }
124
+ }
125
+ });
120
126
  schema.index({ 'object.reservationFor.id': 1, startDate: -1 }, {
121
127
  name: 'searchByObjectReservationForId',
122
128
  partialFilterExpression: {
@@ -61,10 +61,10 @@ declare const schema: Schema<any, import("mongoose").Model<any, any, any, any, a
61
61
  project?: any;
62
62
  additionalProperty?: any;
63
63
  reservationFor?: any;
64
+ underName?: any;
64
65
  issuedThrough?: any;
65
66
  subReservation?: any;
66
67
  broker?: any;
67
- underName?: any;
68
68
  price?: any;
69
69
  priceCurrency?: string | undefined;
70
70
  reservedTicket?: any;
@@ -89,10 +89,10 @@ declare const schema: Schema<any, import("mongoose").Model<any, any, any, any, a
89
89
  project?: any;
90
90
  additionalProperty?: any;
91
91
  reservationFor?: any;
92
+ underName?: any;
92
93
  issuedThrough?: any;
93
94
  subReservation?: any;
94
95
  broker?: any;
95
- underName?: any;
96
96
  price?: any;
97
97
  priceCurrency?: string | undefined;
98
98
  reservedTicket?: any;
@@ -117,10 +117,10 @@ declare const schema: Schema<any, import("mongoose").Model<any, any, any, any, a
117
117
  project?: any;
118
118
  additionalProperty?: any;
119
119
  reservationFor?: any;
120
+ underName?: any;
120
121
  issuedThrough?: any;
121
122
  subReservation?: any;
122
123
  broker?: any;
123
- underName?: any;
124
124
  price?: any;
125
125
  priceCurrency?: string | undefined;
126
126
  reservedTicket?: any;
package/package.json CHANGED
@@ -9,8 +9,8 @@
9
9
  }
10
10
  ],
11
11
  "dependencies": {
12
- "@chevre/factory": "4.313.0-alpha.25",
13
- "@cinerino/sdk": "3.157.0-alpha.6",
12
+ "@chevre/factory": "4.313.0-alpha.26",
13
+ "@cinerino/sdk": "3.157.0-alpha.7",
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.96"
120
+ "version": "21.2.0-alpha.97"
121
121
  }
@@ -1,26 +0,0 @@
1
- // tslint:disable:no-implicit-dependencies no-console
2
- import { chevre } from '../../../lib/index';
3
-
4
- import * as mongoose from 'mongoose';
5
-
6
- // const project = { id: String(process.env.PROJECT_ID) };
7
-
8
- async function main() {
9
- await mongoose.connect(<string>process.env.MONGOLAB_URI, { autoIndex: false });
10
-
11
- const actionRepo = new chevre.repository.Action(mongoose.connection);
12
- const actions = await actionRepo.search(
13
- {
14
- object: { reservationNumber: { $eq: 'xxx' } }
15
- },
16
- ['_id'],
17
- []
18
- );
19
- console.log('actions:', actions);
20
- }
21
-
22
- main()
23
- .then(() => {
24
- console.log('success!');
25
- })
26
- .catch(console.error);