@chevre/domain 21.4.0-alpha.2 → 21.4.0-alpha.21

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.
Files changed (86) hide show
  1. package/example/src/chevre/cleanActions.ts +23 -0
  2. package/example/src/chevre/cleanEventsByMovieTheater.ts +32 -0
  3. package/example/src/chevre/createDeleteTransactionTasksOfDeletedPeople.ts +126 -0
  4. package/example/src/chevre/createManyEventsIfNotExist.ts +6 -0
  5. package/example/src/chevre/migrateEventOrganizer.ts +125 -0
  6. package/example/src/chevre/migrateReservationProvider.ts +117 -0
  7. package/example/src/chevre/migrateScreeningRoomOrganizer.ts +91 -0
  8. package/example/src/chevre/processReserve.ts +0 -1
  9. package/example/src/chevre/searchEvents.ts +1 -9
  10. package/example/src/chevre/searchProductOffers.ts +6 -0
  11. package/lib/chevre/factory/event.d.ts +1 -1
  12. package/lib/chevre/repo/action.d.ts +6 -0
  13. package/lib/chevre/repo/action.js +13 -0
  14. package/lib/chevre/repo/assetTransaction.d.ts +4 -1
  15. package/lib/chevre/repo/assetTransaction.js +6 -12
  16. package/lib/chevre/repo/event.d.ts +25 -4
  17. package/lib/chevre/repo/event.js +122 -60
  18. package/lib/chevre/repo/mongoose/schemas/event.d.ts +7 -4
  19. package/lib/chevre/repo/mongoose/schemas/event.js +15 -2
  20. package/lib/chevre/repo/mongoose/schemas/place.d.ts +6 -6
  21. package/lib/chevre/repo/mongoose/schemas/place.js +9 -2
  22. package/lib/chevre/repo/mongoose/schemas/product.d.ts +3 -3
  23. package/lib/chevre/repo/mongoose/schemas/reservation.d.ts +3 -0
  24. package/lib/chevre/repo/mongoose/schemas/reservation.js +6 -3
  25. package/lib/chevre/repo/order.d.ts +21 -0
  26. package/lib/chevre/repo/order.js +54 -62
  27. package/lib/chevre/repo/place.d.ts +57 -16
  28. package/lib/chevre/repo/place.js +112 -167
  29. package/lib/chevre/repo/product.d.ts +2 -4
  30. package/lib/chevre/repo/product.js +52 -7
  31. package/lib/chevre/repo/productOffer.d.ts +19 -4
  32. package/lib/chevre/repo/productOffer.js +37 -14
  33. package/lib/chevre/repo/reservation.d.ts +33 -21
  34. package/lib/chevre/repo/reservation.js +97 -79
  35. package/lib/chevre/repo/seller.d.ts +4 -3
  36. package/lib/chevre/repo/seller.js +40 -38
  37. package/lib/chevre/repo/task.d.ts +1 -1
  38. package/lib/chevre/service/aggregation/event/aggregateScreeningEvent.d.ts +2 -2
  39. package/lib/chevre/service/aggregation/event/aggregateScreeningEvent.js +3 -2
  40. package/lib/chevre/service/aggregation/event/aggregateUseActionsOnEvent.js +1 -1
  41. package/lib/chevre/service/assetTransaction/pay/account/validation.js +9 -1
  42. package/lib/chevre/service/assetTransaction/pay.js +9 -1
  43. package/lib/chevre/service/assetTransaction/registerService.js +2 -2
  44. package/lib/chevre/service/assetTransaction/reserve/factory.d.ts +10 -4
  45. package/lib/chevre/service/assetTransaction/reserve/factory.js +21 -40
  46. package/lib/chevre/service/assetTransaction/reserve.d.ts +0 -1
  47. package/lib/chevre/service/assetTransaction/reserve.js +7 -22
  48. package/lib/chevre/service/event/createEvent.d.ts +9 -0
  49. package/lib/chevre/service/event/createEvent.js +86 -0
  50. package/lib/chevre/service/event.d.ts +2 -0
  51. package/lib/chevre/service/event.js +26 -26
  52. package/lib/chevre/service/moneyTransfer.js +1 -1
  53. package/lib/chevre/service/offer/event/authorize.d.ts +0 -1
  54. package/lib/chevre/service/offer/event/authorize.js +6 -2
  55. package/lib/chevre/service/offer/event/searchEventTicketOffers.js +16 -2
  56. package/lib/chevre/service/offer/eventServiceByCOA/factory.d.ts +1 -1
  57. package/lib/chevre/service/offer/product/searchProductOffers.js +1 -1
  58. package/lib/chevre/service/order/returnOrder.js +8 -1
  59. package/lib/chevre/service/order/sendOrder.js +8 -1
  60. package/lib/chevre/service/payment/creditCard.js +9 -1
  61. package/lib/chevre/service/payment/movieTicket/factory.d.ts +2 -1
  62. package/lib/chevre/service/payment/movieTicket/validation.js +9 -1
  63. package/lib/chevre/service/payment/movieTicket.js +19 -2
  64. package/lib/chevre/service/payment/paymentCard.js +1 -3
  65. package/lib/chevre/service/reserve/cancelReservation.js +15 -28
  66. package/lib/chevre/service/reserve/confirmReservation.js +12 -30
  67. package/lib/chevre/service/reserve/verifyToken4reservation.d.ts +3 -0
  68. package/lib/chevre/service/reserve/verifyToken4reservation.js +3 -1
  69. package/lib/chevre/service/task/{syncScreeningRooms.d.ts → createEvent.d.ts} +1 -1
  70. package/lib/chevre/service/task/{syncScreeningRooms.js → createEvent.js} +10 -4
  71. package/lib/chevre/service/task/onAuthorizationCreated.js +1 -0
  72. package/lib/chevre/service/task/returnPayTransaction.js +1 -0
  73. package/lib/chevre/service/transaction/moneyTransfer.js +9 -1
  74. package/lib/chevre/service/transaction/orderProgramMembership/findCreditCard.js +1 -1
  75. package/lib/chevre/service/transaction/placeOrderInProgress.js +9 -6
  76. package/lib/chevre/service/transaction/returnOrder.js +9 -3
  77. package/package.json +3 -3
  78. package/example/src/chevre/findByOrderNumberAndReservationId.ts +0 -20
  79. package/example/src/chevre/findScreeningRoomsByBranchCode.ts +0 -27
  80. package/example/src/chevre/migrateEventOffersItemOfferedAvailableChannel.ts +0 -90
  81. package/example/src/chevre/migrateEventOffersItemOfferedTypeOf.ts +0 -75
  82. package/example/src/chevre/migrateSSKTEventCOAEndpoint.ts +0 -64
  83. package/example/src/chevre/migrateScreeningEventSeriesVersion.ts +0 -79
  84. package/example/src/chevre/searchScreeningRooms.ts +0 -33
  85. package/example/src/chevre/syncScreeningRooms.ts +0 -21
  86. package/example/src/chevre/syncScreeningRoomsAll.ts +0 -41
@@ -54,9 +54,9 @@ declare const schema: Schema<any, import("mongoose").Model<any, any, any, any, a
54
54
  }, {
55
55
  typeOf: string;
56
56
  additionalProperty: any[];
57
+ provider: any[];
57
58
  offers: any[];
58
59
  productID: string;
59
- provider: any[];
60
60
  name?: any;
61
61
  project?: any;
62
62
  description?: any;
@@ -67,9 +67,9 @@ declare const schema: Schema<any, import("mongoose").Model<any, any, any, any, a
67
67
  }, import("mongoose").Document<unknown, {}, import("mongoose").FlatRecord<{
68
68
  typeOf: string;
69
69
  additionalProperty: any[];
70
+ provider: any[];
70
71
  offers: any[];
71
72
  productID: string;
72
- provider: any[];
73
73
  name?: any;
74
74
  project?: any;
75
75
  description?: any;
@@ -80,9 +80,9 @@ declare const schema: Schema<any, import("mongoose").Model<any, any, any, any, a
80
80
  }>> & Omit<import("mongoose").FlatRecord<{
81
81
  typeOf: string;
82
82
  additionalProperty: any[];
83
+ provider: any[];
83
84
  offers: any[];
84
85
  productID: string;
85
- provider: any[];
86
86
  name?: any;
87
87
  project?: any;
88
88
  description?: any;
@@ -67,6 +67,7 @@ declare const schema: Schema<any, import("mongoose").Model<any, any, any, any, a
67
67
  underName?: any;
68
68
  issuedThrough?: any;
69
69
  subReservation?: any;
70
+ provider?: any;
70
71
  reservedTicket?: any;
71
72
  additionalTicketText?: string | undefined;
72
73
  bookingTime?: Date | undefined;
@@ -95,6 +96,7 @@ declare const schema: Schema<any, import("mongoose").Model<any, any, any, any, a
95
96
  underName?: any;
96
97
  issuedThrough?: any;
97
98
  subReservation?: any;
99
+ provider?: any;
98
100
  reservedTicket?: any;
99
101
  additionalTicketText?: string | undefined;
100
102
  bookingTime?: Date | undefined;
@@ -123,6 +125,7 @@ declare const schema: Schema<any, import("mongoose").Model<any, any, any, any, a
123
125
  underName?: any;
124
126
  issuedThrough?: any;
125
127
  subReservation?: any;
128
+ provider?: any;
126
129
  reservedTicket?: any;
127
130
  additionalTicketText?: string | undefined;
128
131
  bookingTime?: Date | undefined;
@@ -10,6 +10,7 @@ exports.modelName = modelName;
10
10
  */
11
11
  const schema = new mongoose_1.Schema({
12
12
  project: mongoose_1.SchemaTypes.Mixed,
13
+ provider: mongoose_1.SchemaTypes.Mixed,
13
14
  _id: String,
14
15
  typeOf: {
15
16
  type: String,
@@ -74,9 +75,11 @@ exports.schema = schema;
74
75
  schema.index({ createdAt: 1 }, { name: 'searchByCreatedAt' });
75
76
  schema.index({ updatedAt: 1 }, { name: 'searchByUpdatedAt' });
76
77
  schema.index({ bookingTime: -1 }, { name: 'searchByBookingTime-v3' });
77
- schema.index({ 'project.id': 1, bookingTime: -1 }, {
78
- name: 'searchByProjectId-v20220721'
79
- });
78
+ schema.index({ 'project.id': 1, bookingTime: -1 }, { name: 'searchByProjectId-v20220721' });
79
+ // schema.index(
80
+ // { 'provider.id': 1, bookingTime: -1 },
81
+ // { name: 'searchByProviderId' }
82
+ // );
80
83
  schema.index({ typeOf: 1, bookingTime: -1 }, { name: 'searchByTypeOf-v3' });
81
84
  schema.index({ reservationNumber: 1, bookingTime: -1 }, { name: 'searchByReservationNumber-v3' });
82
85
  schema.index({ reservationStatus: 1, bookingTime: -1 }, { name: 'searchByReservationStatus-v3' });
@@ -39,6 +39,9 @@ export declare class MongoRepository {
39
39
  * 注文ステータスを変更する
40
40
  */
41
41
  changeStatus(params: {
42
+ project: {
43
+ id: string;
44
+ };
42
45
  orderNumber: string;
43
46
  orderStatus: factory.orderStatus;
44
47
  previousOrderStatus: factory.orderStatus;
@@ -47,6 +50,9 @@ export declare class MongoRepository {
47
50
  * 注文を返品する
48
51
  */
49
52
  returnOrder(params: {
53
+ project: {
54
+ id: string;
55
+ };
50
56
  orderNumber: string;
51
57
  dateReturned: Date;
52
58
  returner: factory.order.IReturner;
@@ -55,6 +61,9 @@ export declare class MongoRepository {
55
61
  * 変更可能な属性を更新する
56
62
  */
57
63
  updateChangeableAttributes(params: {
64
+ project: {
65
+ id: string;
66
+ };
58
67
  additionalProperty?: factory.propertyValue.IPropertyValue<string>[];
59
68
  name?: string;
60
69
  orderNumber: string;
@@ -71,10 +80,22 @@ export declare class MongoRepository {
71
80
  */
72
81
  findByOrderNumber(params: {
73
82
  orderNumber: string;
83
+ project: {
84
+ id: string;
85
+ };
86
+ seller?: {
87
+ id?: string;
88
+ };
74
89
  inclusion: string[];
75
90
  exclusion: string[];
76
91
  }): Promise<factory.order.IOrder>;
77
92
  findByOrderNumberAndReservationId(params: {
93
+ project: {
94
+ id: string;
95
+ };
96
+ seller?: {
97
+ id?: string;
98
+ };
78
99
  orderNumber: string;
79
100
  reservationId: string;
80
101
  }): Promise<Pick<factory.order.IOrder, 'orderNumber' | 'orderStatus' | 'typeOf'>>;
@@ -24,34 +24,25 @@ class MongoRepository {
24
24
  }
25
25
  // tslint:disable-next-line:cyclomatic-complexity max-func-body-length
26
26
  static CREATE_MONGO_CONDITIONS(params) {
27
- 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;
27
+ 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;
28
28
  const andConditions = [];
29
- // tslint:disable-next-line:no-single-line-block-comment
30
- /* istanbul ignore else */
31
- if (params.project !== undefined) {
32
- if (params.project.id !== undefined && params.project.id !== null) {
33
- if (typeof params.project.id.$eq === 'string') {
34
- andConditions.push({
35
- 'project.id': {
36
- $eq: params.project.id.$eq
37
- }
38
- });
39
- }
40
- }
29
+ const projectIdEq = (_b = (_a = params.project) === null || _a === void 0 ? void 0 : _a.id) === null || _b === void 0 ? void 0 : _b.$eq;
30
+ if (typeof projectIdEq === 'string') {
31
+ andConditions.push({ 'project.id': { $eq: projectIdEq } });
41
32
  }
42
- const additionalPropertyAll = (_a = params.additionalProperty) === null || _a === void 0 ? void 0 : _a.$all;
33
+ const additionalPropertyAll = (_c = params.additionalProperty) === null || _c === void 0 ? void 0 : _c.$all;
43
34
  if (Array.isArray(additionalPropertyAll)) {
44
35
  andConditions.push({ additionalProperty: { $exists: true, $all: additionalPropertyAll } });
45
36
  }
46
- const additionalPropertyIn = (_b = params.additionalProperty) === null || _b === void 0 ? void 0 : _b.$in;
37
+ const additionalPropertyIn = (_d = params.additionalProperty) === null || _d === void 0 ? void 0 : _d.$in;
47
38
  if (Array.isArray(additionalPropertyIn)) {
48
39
  andConditions.push({ additionalProperty: { $exists: true, $in: additionalPropertyIn } });
49
40
  }
50
- const additionalPropertyNin = (_c = params.additionalProperty) === null || _c === void 0 ? void 0 : _c.$nin;
41
+ const additionalPropertyNin = (_e = params.additionalProperty) === null || _e === void 0 ? void 0 : _e.$nin;
51
42
  if (Array.isArray(additionalPropertyNin)) {
52
43
  andConditions.push({ additionalProperty: { $nin: additionalPropertyNin } });
53
44
  }
54
- const additionalPropertyElemMatch = (_d = params.additionalProperty) === null || _d === void 0 ? void 0 : _d.$elemMatch;
45
+ const additionalPropertyElemMatch = (_f = params.additionalProperty) === null || _f === void 0 ? void 0 : _f.$elemMatch;
55
46
  if (additionalPropertyElemMatch !== undefined && additionalPropertyElemMatch !== null) {
56
47
  andConditions.push({ additionalProperty: { $exists: true, $elemMatch: additionalPropertyElemMatch } });
57
48
  }
@@ -79,31 +70,22 @@ class MongoRepository {
79
70
  });
80
71
  }
81
72
  }
82
- // tslint:disable-next-line:no-single-line-block-comment
83
- /* istanbul ignore else */
84
- if (params.seller !== undefined) {
85
- // tslint:disable-next-line:no-single-line-block-comment
86
- /* istanbul ignore else */
87
- if (params.seller.typeOf !== undefined) {
88
- andConditions.push({
89
- 'seller.typeOf': {
90
- $exists: true,
91
- $eq: params.seller.typeOf
92
- }
93
- });
94
- }
95
- // tslint:disable-next-line:no-single-line-block-comment
96
- /* istanbul ignore else */
97
- if (Array.isArray(params.seller.ids)) {
98
- andConditions.push({
99
- 'seller.id': {
100
- $exists: true,
101
- $in: params.seller.ids
102
- }
103
- });
104
- }
73
+ const providerIdEq = (_h = (_g = params.provider) === null || _g === void 0 ? void 0 : _g.id) === null || _h === void 0 ? void 0 : _h.$eq;
74
+ if (typeof providerIdEq === 'string') {
75
+ andConditions.push({ 'seller.id': { $exists: true, $eq: providerIdEq } });
76
+ }
77
+ const sellerIdEq = (_k = (_j = params.seller) === null || _j === void 0 ? void 0 : _j.id) === null || _k === void 0 ? void 0 : _k.$eq;
78
+ if (typeof sellerIdEq === 'string') {
79
+ andConditions.push({ 'seller.id': { $exists: true, $eq: sellerIdEq } });
80
+ }
81
+ const sellerIds = (_l = params.seller) === null || _l === void 0 ? void 0 : _l.ids;
82
+ if (Array.isArray(sellerIds)) {
83
+ andConditions.push({ 'seller.id': { $exists: true, $in: sellerIds } });
105
84
  }
106
- const brokerIdEq = (_f = (_e = params.broker) === null || _e === void 0 ? void 0 : _e.id) === null || _f === void 0 ? void 0 : _f.$eq;
85
+ if (typeof ((_m = params.seller) === null || _m === void 0 ? void 0 : _m.typeOf) === 'string') {
86
+ andConditions.push({ 'seller.typeOf': { $exists: true, $eq: params.seller.typeOf } });
87
+ }
88
+ const brokerIdEq = (_p = (_o = params.broker) === null || _o === void 0 ? void 0 : _o.id) === null || _p === void 0 ? void 0 : _p.$eq;
107
89
  if (typeof brokerIdEq === 'string') {
108
90
  andConditions.push({
109
91
  'broker.id': {
@@ -320,7 +302,7 @@ class MongoRepository {
320
302
  }
321
303
  }
322
304
  }
323
- const nameEq = (_g = params.name) === null || _g === void 0 ? void 0 : _g.$eq;
305
+ const nameEq = (_q = params.name) === null || _q === void 0 ? void 0 : _q.$eq;
324
306
  if (typeof nameEq === 'string') {
325
307
  andConditions.push({
326
308
  name: {
@@ -329,7 +311,7 @@ class MongoRepository {
329
311
  }
330
312
  });
331
313
  }
332
- const nameRegex = (_h = params.name) === null || _h === void 0 ? void 0 : _h.$regex;
314
+ const nameRegex = (_r = params.name) === null || _r === void 0 ? void 0 : _r.$regex;
333
315
  if (typeof nameRegex === 'string' && nameRegex.length > 0) {
334
316
  andConditions.push({
335
317
  name: {
@@ -362,7 +344,7 @@ class MongoRepository {
362
344
  }
363
345
  });
364
346
  }
365
- const itemOfferedIdentifierIn = (_l = (_k = (_j = params.acceptedOffers) === null || _j === void 0 ? void 0 : _j.itemOffered) === null || _k === void 0 ? void 0 : _k.identifier) === null || _l === void 0 ? void 0 : _l.$in;
347
+ const itemOfferedIdentifierIn = (_u = (_t = (_s = params.acceptedOffers) === null || _s === void 0 ? void 0 : _s.itemOffered) === null || _t === void 0 ? void 0 : _t.identifier) === null || _u === void 0 ? void 0 : _u.$in;
366
348
  if (Array.isArray(itemOfferedIdentifierIn)) {
367
349
  andConditions.push({
368
350
  'acceptedOffers.itemOffered.identifier': {
@@ -371,7 +353,7 @@ class MongoRepository {
371
353
  }
372
354
  });
373
355
  }
374
- const itemOfferedTypeOfIn = (_p = (_o = (_m = params.acceptedOffers) === null || _m === void 0 ? void 0 : _m.itemOffered) === null || _o === void 0 ? void 0 : _o.typeOf) === null || _p === void 0 ? void 0 : _p.$in;
356
+ const itemOfferedTypeOfIn = (_x = (_w = (_v = params.acceptedOffers) === null || _v === void 0 ? void 0 : _v.itemOffered) === null || _w === void 0 ? void 0 : _w.typeOf) === null || _x === void 0 ? void 0 : _x.$in;
375
357
  if (Array.isArray(itemOfferedTypeOfIn)) {
376
358
  andConditions.push({
377
359
  'acceptedOffers.itemOffered.typeOf': {
@@ -380,7 +362,7 @@ class MongoRepository {
380
362
  }
381
363
  });
382
364
  }
383
- const itemOfferedIssuedThroughTypeOfEq = (_t = (_s = (_r = (_q = params.acceptedOffers) === null || _q === void 0 ? void 0 : _q.itemOffered) === null || _r === void 0 ? void 0 : _r.issuedThrough) === null || _s === void 0 ? void 0 : _s.typeOf) === null || _t === void 0 ? void 0 : _t.$eq;
365
+ const itemOfferedIssuedThroughTypeOfEq = (_1 = (_0 = (_z = (_y = params.acceptedOffers) === null || _y === void 0 ? void 0 : _y.itemOffered) === null || _z === void 0 ? void 0 : _z.issuedThrough) === null || _0 === void 0 ? void 0 : _0.typeOf) === null || _1 === void 0 ? void 0 : _1.$eq;
384
366
  if (typeof itemOfferedIssuedThroughTypeOfEq === 'string') {
385
367
  andConditions.push({
386
368
  'acceptedOffers.itemOffered.issuedThrough.typeOf': {
@@ -389,7 +371,7 @@ class MongoRepository {
389
371
  }
390
372
  });
391
373
  }
392
- const itemOfferedIssuedThroughIdIn = (_x = (_w = (_v = (_u = params.acceptedOffers) === null || _u === void 0 ? void 0 : _u.itemOffered) === null || _v === void 0 ? void 0 : _v.issuedThrough) === null || _w === void 0 ? void 0 : _w.id) === null || _x === void 0 ? void 0 : _x.$in;
374
+ const itemOfferedIssuedThroughIdIn = (_5 = (_4 = (_3 = (_2 = params.acceptedOffers) === null || _2 === void 0 ? void 0 : _2.itemOffered) === null || _3 === void 0 ? void 0 : _3.issuedThrough) === null || _4 === void 0 ? void 0 : _4.id) === null || _5 === void 0 ? void 0 : _5.$in;
393
375
  if (Array.isArray(itemOfferedIssuedThroughIdIn)) {
394
376
  andConditions.push({
395
377
  'acceptedOffers.itemOffered.issuedThrough.id': {
@@ -398,7 +380,7 @@ class MongoRepository {
398
380
  }
399
381
  });
400
382
  }
401
- const itemOfferedProgramMembershipUsedIdentifierEq = (_1 = (_0 = (_z = (_y = params.acceptedOffers) === null || _y === void 0 ? void 0 : _y.itemOffered) === null || _z === void 0 ? void 0 : _z.programMembershipUsed) === null || _0 === void 0 ? void 0 : _0.identifier) === null || _1 === void 0 ? void 0 : _1.$eq;
383
+ const itemOfferedProgramMembershipUsedIdentifierEq = (_9 = (_8 = (_7 = (_6 = params.acceptedOffers) === null || _6 === void 0 ? void 0 : _6.itemOffered) === null || _7 === void 0 ? void 0 : _7.programMembershipUsed) === null || _8 === void 0 ? void 0 : _8.identifier) === null || _9 === void 0 ? void 0 : _9.$eq;
402
384
  if (typeof itemOfferedProgramMembershipUsedIdentifierEq === 'string') {
403
385
  andConditions.push({
404
386
  'acceptedOffers.itemOffered.programMembershipUsed.identifier': {
@@ -407,7 +389,7 @@ class MongoRepository {
407
389
  }
408
390
  });
409
391
  }
410
- const itemOfferedProgramMembershipUsedIssuedThroughServiceTypeCodeValueEq = (_7 = (_6 = (_5 = (_4 = (_3 = (_2 = params.acceptedOffers) === null || _2 === void 0 ? void 0 : _2.itemOffered) === null || _3 === void 0 ? void 0 : _3.programMembershipUsed) === null || _4 === void 0 ? void 0 : _4.issuedThrough) === null || _5 === void 0 ? void 0 : _5.serviceType) === null || _6 === void 0 ? void 0 : _6.codeValue) === null || _7 === void 0 ? void 0 : _7.$eq;
392
+ const itemOfferedProgramMembershipUsedIssuedThroughServiceTypeCodeValueEq = (_15 = (_14 = (_13 = (_12 = (_11 = (_10 = params.acceptedOffers) === null || _10 === void 0 ? void 0 : _10.itemOffered) === null || _11 === void 0 ? void 0 : _11.programMembershipUsed) === null || _12 === void 0 ? void 0 : _12.issuedThrough) === null || _13 === void 0 ? void 0 : _13.serviceType) === null || _14 === void 0 ? void 0 : _14.codeValue) === null || _15 === void 0 ? void 0 : _15.$eq;
411
393
  if (typeof itemOfferedProgramMembershipUsedIssuedThroughServiceTypeCodeValueEq === 'string') {
412
394
  andConditions.push({
413
395
  'acceptedOffers.itemOffered.programMembershipUsed.issuedThrough.serviceType.codeValue': {
@@ -603,7 +585,7 @@ class MongoRepository {
603
585
  });
604
586
  }
605
587
  }
606
- const paymentMethodAdditionalPropertyAll = (_9 = (_8 = params.paymentMethods) === null || _8 === void 0 ? void 0 : _8.additionalProperty) === null || _9 === void 0 ? void 0 : _9.$all;
588
+ const paymentMethodAdditionalPropertyAll = (_17 = (_16 = params.paymentMethods) === null || _16 === void 0 ? void 0 : _16.additionalProperty) === null || _17 === void 0 ? void 0 : _17.$all;
607
589
  if (Array.isArray(paymentMethodAdditionalPropertyAll)) {
608
590
  andConditions.push({
609
591
  'paymentMethods.additionalProperty': {
@@ -612,7 +594,7 @@ class MongoRepository {
612
594
  }
613
595
  });
614
596
  }
615
- const paymentMethodAdditionalPropertyIn = (_11 = (_10 = params.paymentMethods) === null || _10 === void 0 ? void 0 : _10.additionalProperty) === null || _11 === void 0 ? void 0 : _11.$in;
597
+ const paymentMethodAdditionalPropertyIn = (_19 = (_18 = params.paymentMethods) === null || _18 === void 0 ? void 0 : _18.additionalProperty) === null || _19 === void 0 ? void 0 : _19.$in;
616
598
  if (Array.isArray(paymentMethodAdditionalPropertyIn)) {
617
599
  andConditions.push({
618
600
  'paymentMethods.additionalProperty': {
@@ -696,8 +678,9 @@ class MongoRepository {
696
678
  changeStatus(params) {
697
679
  return __awaiter(this, void 0, void 0, function* () {
698
680
  const doc = yield this.orderModel.findOneAndUpdate({
699
- orderNumber: params.orderNumber,
700
- orderStatus: params.previousOrderStatus
681
+ orderNumber: { $eq: params.orderNumber },
682
+ orderStatus: { $eq: params.previousOrderStatus },
683
+ 'project.id': { $eq: params.project.id }
701
684
  }, { orderStatus: params.orderStatus }, {
702
685
  new: true,
703
686
  projection: {
@@ -711,6 +694,7 @@ class MongoRepository {
711
694
  if (doc === null) {
712
695
  const order = yield this.findByOrderNumber({
713
696
  orderNumber: params.orderNumber,
697
+ project: { id: params.project.id },
714
698
  inclusion: [],
715
699
  exclusion: []
716
700
  });
@@ -735,8 +719,9 @@ class MongoRepository {
735
719
  returnOrder(params) {
736
720
  return __awaiter(this, void 0, void 0, function* () {
737
721
  const doc = yield this.orderModel.findOneAndUpdate({
738
- orderNumber: params.orderNumber,
739
- orderStatus: factory.orderStatus.OrderDelivered
722
+ orderNumber: { $eq: params.orderNumber },
723
+ orderStatus: { $eq: factory.orderStatus.OrderDelivered },
724
+ 'project.id': { $eq: params.project.id }
740
725
  }, {
741
726
  orderStatus: factory.orderStatus.OrderReturned,
742
727
  dateReturned: params.dateReturned,
@@ -754,6 +739,7 @@ class MongoRepository {
754
739
  if (doc === null) {
755
740
  const order = yield this.findByOrderNumber({
756
741
  orderNumber: params.orderNumber,
742
+ project: { id: params.project.id },
757
743
  inclusion: [],
758
744
  exclusion: []
759
745
  });
@@ -777,7 +763,10 @@ class MongoRepository {
777
763
  */
778
764
  updateChangeableAttributes(params) {
779
765
  return __awaiter(this, void 0, void 0, function* () {
780
- const doc = yield this.orderModel.findOneAndUpdate({ orderNumber: { $eq: params.orderNumber } }, {
766
+ const doc = yield this.orderModel.findOneAndUpdate({
767
+ orderNumber: { $eq: params.orderNumber },
768
+ 'project.id': { $eq: params.project.id }
769
+ }, {
781
770
  $set: Object.assign(Object.assign({}, (Array.isArray(params.additionalProperty)) ? { additionalProperty: params.additionalProperty } : undefined), (typeof params.name === 'string') ? { name: params.name } : undefined)
782
771
  }, {
783
772
  new: true,
@@ -844,7 +833,10 @@ class MongoRepository {
844
833
  });
845
834
  }
846
835
  }
847
- const doc = yield this.orderModel.findOne({ orderNumber: params.orderNumber }, projection)
836
+ const doc = yield this.orderModel.findOne({
837
+ orderNumber: { $eq: params.orderNumber },
838
+ 'project.id': { $eq: params.project.id }
839
+ }, projection)
848
840
  .exec();
849
841
  if (doc === null) {
850
842
  throw new factory.errors.NotFound(this.orderModel.modelName);
@@ -853,6 +845,7 @@ class MongoRepository {
853
845
  });
854
846
  }
855
847
  findByOrderNumberAndReservationId(params) {
848
+ var _a;
856
849
  return __awaiter(this, void 0, void 0, function* () {
857
850
  const projection = {
858
851
  orderStatus: 1,
@@ -860,15 +853,14 @@ class MongoRepository {
860
853
  orderNumber: 1,
861
854
  _id: 0
862
855
  };
863
- const doc = yield this.orderModel.findOne({
864
- orderNumber: { $eq: params.orderNumber },
865
- acceptedOffers: {
856
+ const doc = yield this.orderModel.findOne(Object.assign({ orderNumber: { $eq: params.orderNumber }, 'project.id': { $eq: params.project.id }, acceptedOffers: {
866
857
  $elemMatch: {
867
858
  'itemOffered.typeOf': { $in: [factory.reservationType.BusReservation, factory.reservationType.EventReservation] },
868
859
  'itemOffered.id': { $eq: params.reservationId }
869
860
  }
870
- }
871
- }, projection)
861
+ } }, (typeof ((_a = params.seller) === null || _a === void 0 ? void 0 : _a.id) === 'string')
862
+ ? { 'seller.id': { $exists: true, $eq: params.seller.id } }
863
+ : undefined), projection)
872
864
  .exec();
873
865
  if (doc === null) {
874
866
  throw new factory.errors.NotFound(this.orderModel.modelName);
@@ -25,7 +25,7 @@
25
25
  import { Connection } from 'mongoose';
26
26
  import * as factory from '../factory';
27
27
  type IScreeningRoomSectionWithoutContainsPlace = Omit<factory.place.screeningRoomSection.IPlace, 'containsPlace'>;
28
- export type IScreeningRoomFoundByBranchCode = Pick<factory.place.screeningRoom.IPlace, 'typeOf' | 'branchCode' | 'name' | 'containsPlace' | 'seatCount'>;
28
+ export type IScreeningRoomFoundByBranchCode = Pick<factory.place.screeningRoom.IPlace, 'typeOf' | 'branchCode' | 'name' | 'containsPlace' | 'seatCount' | 'parentOrganization'>;
29
29
  /**
30
30
  * 施設リポジトリ
31
31
  */
@@ -44,12 +44,18 @@ export declare class MongoRepository {
44
44
  */
45
45
  searchMovieTheaters(params: factory.place.movieTheater.ISearchConditions & {}, inclusion: string[], exclusion: string[]): Promise<factory.place.movieTheater.IPlaceWithoutScreeningRoom[]>;
46
46
  deleteMovieTheaterById(params: {
47
+ project: {
48
+ id: string;
49
+ };
47
50
  id: string;
48
51
  }): Promise<void>;
49
- createScreeningRoom(screeningRoom: Omit<factory.place.screeningRoom.IPlace, 'containedInPlace' | 'containsPlace'> & {
52
+ createScreeningRoom(screeningRoom: Omit<factory.place.screeningRoom.IPlace, 'containedInPlace' | 'containsPlace' | 'parentOrganization'> & {
50
53
  containedInPlace: {
51
54
  branchCode: string;
52
55
  };
56
+ parentOrganization?: {
57
+ id?: string;
58
+ };
53
59
  }): Promise<{
54
60
  containedInPlace: {
55
61
  /**
@@ -59,10 +65,13 @@ export declare class MongoRepository {
59
65
  };
60
66
  typeOf: factory.placeType.ScreeningRoom;
61
67
  }>;
62
- updateScreeningRoom(screeningRoom: Omit<factory.place.screeningRoom.IPlace, 'containedInPlace' | 'containsPlace'> & {
68
+ updateScreeningRoom(screeningRoom: Omit<factory.place.screeningRoom.IPlace, 'containedInPlace' | 'containsPlace' | 'parentOrganization'> & {
63
69
  containedInPlace: {
64
70
  branchCode: string;
65
71
  };
72
+ parentOrganization?: {
73
+ id?: string;
74
+ };
66
75
  }, $unset: any): Promise<{
67
76
  containedInPlace: {
68
77
  /**
@@ -72,6 +81,19 @@ export declare class MongoRepository {
72
81
  };
73
82
  typeOf: factory.placeType.ScreeningRoom;
74
83
  }>;
84
+ addParentOrganization2ScreeningRoom(screeningRoom: Pick<factory.place.screeningRoom.IPlace, 'branchCode' | 'parentOrganization' | 'project'> & {
85
+ containedInPlace: {
86
+ branchCode: string;
87
+ };
88
+ }): Promise<{
89
+ containedInPlace: {
90
+ /**
91
+ * 施設ID
92
+ */
93
+ id: string;
94
+ };
95
+ typeOf: factory.placeType.ScreeningRoom;
96
+ }>;
75
97
  updateScreeningRoomsByContainedInPlaceId(screeningRoom: {
76
98
  project: {
77
99
  id: string;
@@ -82,6 +104,9 @@ export declare class MongoRepository {
82
104
  project: {
83
105
  id: string;
84
106
  };
107
+ parentOrganization?: {
108
+ id?: string;
109
+ };
85
110
  /**
86
111
  * ルームコード
87
112
  */
@@ -112,7 +137,11 @@ export declare class MongoRepository {
112
137
  id: string;
113
138
  };
114
139
  }): Promise<void>;
115
- createScreeningRoomSection(screeningRoomSection: IScreeningRoomSectionWithoutContainsPlace): Promise<{
140
+ createScreeningRoomSection(screeningRoomSection: IScreeningRoomSectionWithoutContainsPlace & {
141
+ parentOrganization?: {
142
+ id?: string;
143
+ };
144
+ }): Promise<{
116
145
  containedInPlace: {
117
146
  /**
118
147
  * 施設ID
@@ -128,6 +157,9 @@ export declare class MongoRepository {
128
157
  branchCode: string;
129
158
  };
130
159
  };
160
+ parentOrganization?: {
161
+ id?: string;
162
+ };
131
163
  }, $unset: any): Promise<{
132
164
  containedInPlace: {
133
165
  /**
@@ -146,6 +178,9 @@ export declare class MongoRepository {
146
178
  project: {
147
179
  id: string;
148
180
  };
181
+ parentOrganization?: {
182
+ id?: string;
183
+ };
149
184
  /**
150
185
  * セクションコード
151
186
  */
@@ -171,8 +206,11 @@ export declare class MongoRepository {
171
206
  };
172
207
  typeOf: factory.placeType.ScreeningRoom;
173
208
  }>;
174
- searchScreeningRooms(searchConditions: factory.place.screeningRoom.ISearchConditions): Promise<Omit<factory.place.screeningRoom.IPlace, 'containsPlace'>[]>;
209
+ searchScreeningRooms(searchConditions: factory.place.screeningRoom.ISearchConditions): Promise<Omit<factory.place.screeningRoom.IPlace, 'containsPlace' | 'parentOrganization'>[]>;
175
210
  findScreeningRoomsByBranchCode(params: {
211
+ project: {
212
+ id: string;
213
+ };
176
214
  branchCode: {
177
215
  $eq: string;
178
216
  };
@@ -182,7 +220,11 @@ export declare class MongoRepository {
182
220
  };
183
221
  };
184
222
  }): Promise<IScreeningRoomFoundByBranchCode>;
185
- createSeat(seat: factory.place.seat.IPlace): Promise<{
223
+ createSeat(seat: factory.place.seat.IPlace & {
224
+ parentOrganization?: {
225
+ id?: string;
226
+ };
227
+ }): Promise<{
186
228
  containedInPlace: {
187
229
  /**
188
230
  * 施設ID
@@ -201,6 +243,9 @@ export declare class MongoRepository {
201
243
  };
202
244
  };
203
245
  };
246
+ parentOrganization?: {
247
+ id?: string;
248
+ };
204
249
  }, $unset: any): Promise<{
205
250
  containedInPlace: {
206
251
  /**
@@ -215,6 +260,9 @@ export declare class MongoRepository {
215
260
  project: {
216
261
  id: string;
217
262
  };
263
+ parentOrganization?: {
264
+ id?: string;
265
+ };
218
266
  /**
219
267
  * 座席コード
220
268
  */
@@ -246,16 +294,6 @@ export declare class MongoRepository {
246
294
  };
247
295
  typeOf: factory.placeType.ScreeningRoom;
248
296
  }>;
249
- syncScreeningRooms(__: {
250
- /**
251
- * 施設ID
252
- */
253
- id: string;
254
- /**
255
- * 特定のルームのみ同期する場合、ルームコードを指定する
256
- */
257
- screeningRoomBranchCode?: string;
258
- }): Promise<void>;
259
297
  unsetContainsPlaceFromMovieTheater(params: {
260
298
  /**
261
299
  * 施設ID
@@ -281,6 +319,9 @@ export declare class MongoRepository {
281
319
  id: string;
282
320
  }, projection?: any): Promise<factory.place.busStop.IPlace>;
283
321
  deleteBusStopById(params: {
322
+ project: {
323
+ id: string;
324
+ };
284
325
  id: string;
285
326
  }): Promise<void>;
286
327
  getCursor(conditions: any, projection: any): import("mongoose").Cursor<any, import("mongoose").QueryOptions<any>>;