@chevre/domain 21.2.0-alpha.118 → 21.2.0-alpha.119

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.
@@ -22,7 +22,7 @@ async function main() {
22
22
  id: String(process.env.EVENT_ID)
23
23
  })({
24
24
  event: new chevre.repository.Event(mongoose.connection),
25
- stockHolder: new chevre.repository.StockHolder(client),
25
+ stockHolder: new chevre.repository.StockHolder(client, mongoose.connection),
26
26
  offer: new chevre.repository.Offer(mongoose.connection),
27
27
  offerCatalog: new chevre.repository.OfferCatalog(mongoose.connection),
28
28
  offerRateLimit: new chevre.repository.rateLimit.Offer(client),
@@ -1,5 +1,6 @@
1
1
  // tslint:disable:no-console
2
2
  import * as moment from 'moment';
3
+ import * as mongoose from 'mongoose';
3
4
  import * as redis from 'redis';
4
5
 
5
6
  import { chevre } from '../../../lib/index';
@@ -19,7 +20,7 @@ async function main() {
19
20
 
20
21
  const startDate = moment('2023-04-18T00:00:00Z');
21
22
 
22
- const stockHolderRepo = new chevre.repository.StockHolder(client);
23
+ const stockHolderRepo = new chevre.repository.StockHolder(client, mongoose.connection);
23
24
  await stockHolderRepo.lock({
24
25
  eventId: 'sampleEventId',
25
26
  startDate: startDate.toDate(),
@@ -21,7 +21,7 @@ async function main() {
21
21
  await mongoose.connect(<string>process.env.MONGOLAB_URI);
22
22
 
23
23
  const eventRepo = new chevre.repository.Event(mongoose.connection);
24
- const stockHolderRepo = new chevre.repository.StockHolder(client);
24
+ const stockHolderRepo = new chevre.repository.StockHolder(client, mongoose.connection);
25
25
 
26
26
  const cursor = eventRepo.getCursor(
27
27
  {
@@ -30,7 +30,7 @@ async function main() {
30
30
  const priceSpecRepo = new chevre.repository.PriceSpecification(mongoose.connection);
31
31
  const reservationRepo = new chevre.repository.Reservation(mongoose.connection);
32
32
  const eventRepo = new chevre.repository.Event(mongoose.connection);
33
- const itemAvailabilityRepo = new chevre.repository.StockHolder(client);
33
+ const itemAvailabilityRepo = new chevre.repository.StockHolder(client, mongoose.connection);
34
34
  const offerRateLimitRepo = new chevre.repository.rateLimit.Offer(client);
35
35
 
36
36
  const identifier = `CIN${(new Date()).valueOf()}`;
@@ -1,4 +1,5 @@
1
1
  // tslint:disable:no-console
2
+ import * as mongoose from 'mongoose';
2
3
  import * as redis from 'redis';
3
4
 
4
5
  import { chevre } from '../../../lib/index';
@@ -16,7 +17,7 @@ async function main() {
16
17
  });
17
18
  await client.connect();
18
19
 
19
- const itemAvailabilityRepo = new chevre.repository.StockHolder(client);
20
+ const itemAvailabilityRepo = new chevre.repository.StockHolder(client, mongoose.connection);
20
21
 
21
22
  const result = await itemAvailabilityRepo.searchHolders({
22
23
  eventId: 'alckc9mlx',
@@ -0,0 +1,75 @@
1
+ /// <reference types="mongoose/types/aggregate" />
2
+ /// <reference types="mongoose/types/callback" />
3
+ /// <reference types="mongoose/types/collection" />
4
+ /// <reference types="mongoose/types/connection" />
5
+ /// <reference types="mongoose/types/cursor" />
6
+ /// <reference types="mongoose/types/document" />
7
+ /// <reference types="mongoose/types/error" />
8
+ /// <reference types="mongoose/types/expressions" />
9
+ /// <reference types="mongoose/types/helpers" />
10
+ /// <reference types="mongoose/types/middlewares" />
11
+ /// <reference types="mongoose/types/indexes" />
12
+ /// <reference types="mongoose/types/models" />
13
+ /// <reference types="mongoose/types/mongooseoptions" />
14
+ /// <reference types="mongoose/types/pipelinestage" />
15
+ /// <reference types="mongoose/types/populate" />
16
+ /// <reference types="mongoose/types/query" />
17
+ /// <reference types="mongoose/types/schemaoptions" />
18
+ /// <reference types="mongoose/types/schematypes" />
19
+ /// <reference types="mongoose/types/session" />
20
+ /// <reference types="mongoose/types/types" />
21
+ /// <reference types="mongoose/types/utility" />
22
+ /// <reference types="mongoose/types/validation" />
23
+ /// <reference types="mongoose/types/virtuals" />
24
+ /// <reference types="mongoose/types/inferschematype" />
25
+ import { Schema } from 'mongoose';
26
+ declare const modelName = "HoldReservation";
27
+ /**
28
+ * 保留予約スキーマ
29
+ */
30
+ declare const schema: Schema<any, import("mongoose").Model<any, any, any, any, any, any>, {}, {}, {}, {}, {
31
+ collection: string;
32
+ id: true;
33
+ read: string;
34
+ writeConcern: import("mongodb").WriteConcern;
35
+ strict: true;
36
+ strictQuery: false;
37
+ useNestedStrict: boolean;
38
+ timestamps: {
39
+ createdAt: string;
40
+ updatedAt: string;
41
+ };
42
+ toJSON: {
43
+ getters: false;
44
+ virtuals: false;
45
+ minimize: false;
46
+ versionKey: false;
47
+ };
48
+ toObject: {
49
+ getters: false;
50
+ virtuals: true;
51
+ minimize: false;
52
+ versionKey: false;
53
+ };
54
+ }, {
55
+ typeOf: string;
56
+ reservations: any[];
57
+ reservationCount: number;
58
+ project?: any;
59
+ reservationFor?: any;
60
+ }, import("mongoose").Document<unknown, {}, import("mongoose").FlatRecord<{
61
+ typeOf: string;
62
+ reservations: any[];
63
+ reservationCount: number;
64
+ project?: any;
65
+ reservationFor?: any;
66
+ }>> & Omit<import("mongoose").FlatRecord<{
67
+ typeOf: string;
68
+ reservations: any[];
69
+ reservationCount: number;
70
+ project?: any;
71
+ reservationFor?: any;
72
+ }> & {
73
+ _id: import("mongoose").Types.ObjectId;
74
+ }, never>>;
75
+ export { modelName, schema };
@@ -0,0 +1,56 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.schema = exports.modelName = void 0;
4
+ const mongoose_1 = require("mongoose");
5
+ const writeConcern_1 = require("../writeConcern");
6
+ const modelName = 'HoldReservation';
7
+ exports.modelName = modelName;
8
+ /**
9
+ * 保留予約スキーマ
10
+ */
11
+ const schema = new mongoose_1.Schema({
12
+ project: mongoose_1.SchemaTypes.Mixed,
13
+ typeOf: {
14
+ type: String,
15
+ required: true
16
+ },
17
+ reservationFor: mongoose_1.SchemaTypes.Mixed,
18
+ reservationCount: {
19
+ type: Number,
20
+ default: 0,
21
+ required: true
22
+ },
23
+ reservations: [mongoose_1.SchemaTypes.Mixed]
24
+ }, {
25
+ collection: 'holdReservations',
26
+ id: true,
27
+ read: 'primary',
28
+ writeConcern: writeConcern_1.writeConcern,
29
+ strict: true,
30
+ strictQuery: false,
31
+ useNestedStrict: true,
32
+ timestamps: {
33
+ createdAt: 'createdAt',
34
+ updatedAt: 'updatedAt'
35
+ },
36
+ toJSON: {
37
+ getters: false,
38
+ virtuals: false,
39
+ minimize: false,
40
+ versionKey: false
41
+ },
42
+ toObject: {
43
+ getters: false,
44
+ virtuals: true,
45
+ minimize: false,
46
+ versionKey: false
47
+ }
48
+ });
49
+ exports.schema = schema;
50
+ schema.index({ createdAt: 1 }, { name: 'searchByCreatedAt' });
51
+ schema.index({ updatedAt: 1 }, { name: 'searchByUpdatedAt' });
52
+ schema.index({ 'reservationFor.startDate': -1 }, { name: 'searchByReservationForStartDate' });
53
+ // イベントIDでunique
54
+ schema.index({ 'reservationFor.id': 1 }, { name: 'uniqueReservationForId', unique: true });
55
+ schema.index({ 'reservationFor.id': 1, 'reservationFor.startDate': -1 }, { name: 'searchByReservationForId' });
56
+ schema.index({ 'project.id': 1, 'reservationFor.startDate': -1 }, { name: 'searchByProjectId' });
@@ -1,3 +1,4 @@
1
+ import { Connection } from 'mongoose';
1
2
  import { RedisClientType } from 'redis';
2
3
  export interface IOffer {
3
4
  itemOffered?: {
@@ -31,9 +32,14 @@ export declare class StockHolderRepository {
31
32
  static KEY_PREFIX_NEW: string;
32
33
  static KEY_PREFIX: string;
33
34
  private readonly redisClient;
34
- constructor(redisClient: RedisClientType);
35
+ private readonly holdReservationModel;
36
+ constructor(redisClient: RedisClientType, connection: Connection);
35
37
  private static offer2field;
36
38
  private static createKey;
39
+ /**
40
+ * 新リポジトリを使用するかどうか
41
+ */
42
+ private static useMongoose;
37
43
  /**
38
44
  * 座席をロックする(maxキャパシティチェック有)
39
45
  */
@@ -13,14 +13,16 @@ exports.StockHolderRepository = void 0;
13
13
  const createDebug = require("debug");
14
14
  const moment = require("moment");
15
15
  const factory = require("../factory");
16
+ const holdReservation_1 = require("./mongoose/schemas/holdReservation");
16
17
  const settings_1 = require("../settings");
17
18
  const debug = createDebug('chevre-domain:repo');
18
19
  /**
19
20
  * イベントストックホルダーリポジトリ
20
21
  */
21
22
  class StockHolderRepository {
22
- constructor(redisClient) {
23
+ constructor(redisClient, connection) {
23
24
  this.redisClient = redisClient;
25
+ this.holdReservationModel = connection.model(holdReservation_1.modelName, holdReservation_1.schema);
24
26
  }
25
27
  // public static GET_KEY(params: {
26
28
  // eventId: string;
@@ -50,21 +52,35 @@ class StockHolderRepository {
50
52
  return `${StockHolderRepository.KEY_PREFIX}:${params.eventId}`;
51
53
  }
52
54
  }
55
+ /**
56
+ * 新リポジトリを使用するかどうか
57
+ */
58
+ static useMongoose(params) {
59
+ if (settings_1.USE_NEW_STOCK_HOLDER_REPO_IDS.includes(params.eventId)) {
60
+ return true;
61
+ }
62
+ return false;
63
+ }
53
64
  /**
54
65
  * 座席をロックする(maxキャパシティチェック有)
55
66
  */
56
67
  lockIfNotLimitExceeded(lockKey, maximum) {
57
68
  return __awaiter(this, void 0, void 0, function* () {
58
- const key = StockHolderRepository.createKey({ eventId: lockKey.eventId, startDate: lockKey.startDate });
59
- yield this.redisClient.watch(key);
60
- const hashCount = yield this.redisClient.hLen(key);
61
- // Process result
62
- // Heavy and time consuming operation here
63
- debug('checking hash count...hashCount:', hashCount);
64
- if (hashCount + lockKey.offers.length > maximum) {
65
- throw new factory.errors.Argument('Event', 'maximumAttendeeCapacity exceeded');
69
+ if (StockHolderRepository.useMongoose({ eventId: lockKey.eventId, startDate: lockKey.startDate })) {
70
+ throw new factory.errors.NotImplemented(`new stock holder repository not implemented for the event '${lockKey.eventId}'`);
71
+ }
72
+ else {
73
+ const key = StockHolderRepository.createKey({ eventId: lockKey.eventId, startDate: lockKey.startDate });
74
+ yield this.redisClient.watch(key);
75
+ const hashCount = yield this.redisClient.hLen(key);
76
+ // Process result
77
+ // Heavy and time consuming operation here
78
+ debug('checking hash count...hashCount:', hashCount);
79
+ if (hashCount + lockKey.offers.length > maximum) {
80
+ throw new factory.errors.Argument('Event', 'maximumAttendeeCapacity exceeded');
81
+ }
82
+ yield this.lock(lockKey);
66
83
  }
67
- yield this.lock(lockKey);
68
84
  });
69
85
  }
70
86
  /**
@@ -72,47 +88,52 @@ class StockHolderRepository {
72
88
  */
73
89
  lock(lockKey) {
74
90
  return __awaiter(this, void 0, void 0, function* () {
75
- if (!(lockKey.expires instanceof Date)) {
76
- throw new factory.errors.Argument('expires', 'must be Date');
91
+ if (StockHolderRepository.useMongoose({ eventId: lockKey.eventId, startDate: lockKey.startDate })) {
92
+ throw new factory.errors.NotImplemented(`new stock holder repository not implemented for the event '${lockKey.eventId}'`);
77
93
  }
78
- const key = StockHolderRepository.createKey({ eventId: lockKey.eventId, startDate: lockKey.startDate });
79
- yield this.checkIfConflicted({ key, eventId: lockKey.eventId });
80
- const value = lockKey.holder;
81
- const multi = this.redisClient.multi();
82
- const fields = lockKey.offers.map((offer) => StockHolderRepository.offer2field(offer));
83
- fields.forEach((field) => {
84
- multi.hSetNX(key, field, value);
85
- });
86
- const results = yield multi.expireAt(key, moment(lockKey.expires)
87
- .unix())
88
- .exec();
89
- const lockedFields = [];
90
- if (Array.isArray(results)) {
91
- results.slice(0, fields.length)
92
- .forEach((r, index) => {
93
- if (r === 1 || r === true) {
94
- lockedFields.push(fields[index]);
95
- }
96
- });
97
- }
98
- const lockedAll = lockedFields.length === fields.length;
99
- debug('lockedAll?', lockedAll);
100
- // expireAtReplyの検証も追加する(2023-04-19~)
101
- const expiredAll = results.slice(fields.length)
102
- .every((r) => (r === 1 || r === true));
103
- debug('expiredAll?', expiredAll);
104
- if (!lockedAll || !expiredAll) {
105
- if (lockedFields.length > 0) {
106
- // 全て仮押さえできなければ仮押さえできたものは解除
107
- yield this.redisClient.multi()
108
- .hDel(key, lockedFields)
109
- .exec();
94
+ else {
95
+ if (!(lockKey.expires instanceof Date)) {
96
+ throw new factory.errors.Argument('expires', 'must be Date');
110
97
  }
111
- if (!lockedAll) {
112
- throw new factory.errors.AlreadyInUse(factory.reservationType.EventReservation, ['ticketedSeat'], 'Already hold');
98
+ const key = StockHolderRepository.createKey({ eventId: lockKey.eventId, startDate: lockKey.startDate });
99
+ yield this.checkIfConflicted({ key, eventId: lockKey.eventId });
100
+ const value = lockKey.holder;
101
+ const multi = this.redisClient.multi();
102
+ const fields = lockKey.offers.map((offer) => StockHolderRepository.offer2field(offer));
103
+ fields.forEach((field) => {
104
+ multi.hSetNX(key, field, value);
105
+ });
106
+ const results = yield multi.expireAt(key, moment(lockKey.expires)
107
+ .unix())
108
+ .exec();
109
+ const lockedFields = [];
110
+ if (Array.isArray(results)) {
111
+ results.slice(0, fields.length)
112
+ .forEach((r, index) => {
113
+ if (r === 1 || r === true) {
114
+ lockedFields.push(fields[index]);
115
+ }
116
+ });
113
117
  }
114
- else {
115
- throw new factory.errors.ServiceUnavailable('timeout cannot be set unexpectedly');
118
+ const lockedAll = lockedFields.length === fields.length;
119
+ debug('lockedAll?', lockedAll);
120
+ // expireAtReplyの検証も追加する(2023-04-19~)
121
+ const expiredAll = results.slice(fields.length)
122
+ .every((r) => (r === 1 || r === true));
123
+ debug('expiredAll?', expiredAll);
124
+ if (!lockedAll || !expiredAll) {
125
+ if (lockedFields.length > 0) {
126
+ // 全て仮押さえできなければ仮押さえできたものは解除
127
+ yield this.redisClient.multi()
128
+ .hDel(key, lockedFields)
129
+ .exec();
130
+ }
131
+ if (!lockedAll) {
132
+ throw new factory.errors.AlreadyInUse(factory.reservationType.EventReservation, ['ticketedSeat'], 'Already hold');
133
+ }
134
+ else {
135
+ throw new factory.errors.ServiceUnavailable('timeout cannot be set unexpectedly');
136
+ }
116
137
  }
117
138
  }
118
139
  });
@@ -122,12 +143,17 @@ class StockHolderRepository {
122
143
  */
123
144
  unlock(params) {
124
145
  return __awaiter(this, void 0, void 0, function* () {
125
- const key = StockHolderRepository.createKey({ eventId: params.eventId, startDate: params.startDate });
126
- yield this.checkIfConflicted({ key, eventId: params.eventId });
127
- const field = StockHolderRepository.offer2field(params.offer);
128
- yield this.redisClient.multi()
129
- .hDel(key, field)
130
- .exec();
146
+ if (StockHolderRepository.useMongoose({ eventId: params.eventId, startDate: params.startDate })) {
147
+ throw new factory.errors.NotImplemented(`new stock holder repository not implemented for the event '${params.eventId}'`);
148
+ }
149
+ else {
150
+ const key = StockHolderRepository.createKey({ eventId: params.eventId, startDate: params.startDate });
151
+ yield this.checkIfConflicted({ key, eventId: params.eventId });
152
+ const field = StockHolderRepository.offer2field(params.offer);
153
+ yield this.redisClient.multi()
154
+ .hDel(key, field)
155
+ .exec();
156
+ }
131
157
  });
132
158
  }
133
159
  /**
@@ -152,13 +178,30 @@ class StockHolderRepository {
152
178
  */
153
179
  countUnavailableOffers(params) {
154
180
  return __awaiter(this, void 0, void 0, function* () {
155
- const key = StockHolderRepository.createKey({ eventId: params.event.id, startDate: params.event.startDate });
156
- const reply = yield this.redisClient.hLen(key);
157
- let fieldCount = 0;
158
- if (typeof reply === 'number') {
159
- fieldCount = Number(reply);
181
+ if (StockHolderRepository.useMongoose({ eventId: params.event.id, startDate: params.event.startDate })) {
182
+ return this.holdReservationModel.findOne({
183
+ 'reservationFor.id': { $eq: params.event.id }
184
+ })
185
+ .select({ reservationCount: 1 })
186
+ .exec()
187
+ .then((doc) => {
188
+ if (doc === null) {
189
+ return 0;
190
+ }
191
+ else {
192
+ return doc.reservationCount;
193
+ }
194
+ });
195
+ }
196
+ else {
197
+ const key = StockHolderRepository.createKey({ eventId: params.event.id, startDate: params.event.startDate });
198
+ const reply = yield this.redisClient.hLen(key);
199
+ let fieldCount = 0;
200
+ if (typeof reply === 'number') {
201
+ fieldCount = Number(reply);
202
+ }
203
+ return fieldCount;
160
204
  }
161
- return fieldCount;
162
205
  });
163
206
  }
164
207
  /**
@@ -166,9 +209,14 @@ class StockHolderRepository {
166
209
  */
167
210
  getHolder(params) {
168
211
  return __awaiter(this, void 0, void 0, function* () {
169
- const key = StockHolderRepository.createKey({ eventId: params.eventId, startDate: params.startDate });
170
- const field = StockHolderRepository.offer2field(params.offer);
171
- return this.redisClient.hGet(key, field);
212
+ if (StockHolderRepository.useMongoose({ eventId: params.eventId, startDate: params.startDate })) {
213
+ throw new factory.errors.NotImplemented(`new stock holder repository not implemented for the event '${params.eventId}'`);
214
+ }
215
+ else {
216
+ const key = StockHolderRepository.createKey({ eventId: params.eventId, startDate: params.startDate });
217
+ const field = StockHolderRepository.offer2field(params.offer);
218
+ return this.redisClient.hGet(key, field);
219
+ }
172
220
  });
173
221
  }
174
222
  /**
@@ -205,17 +253,22 @@ class StockHolderRepository {
205
253
  // }
206
254
  searchHolders(params) {
207
255
  return __awaiter(this, void 0, void 0, function* () {
208
- const key = StockHolderRepository.createKey({ eventId: params.eventId, startDate: params.startDate });
209
- const fields = params.offers.map((o) => {
210
- return StockHolderRepository.offer2field(o);
211
- });
212
- // Array reply: list of values associated with the given fields, in the same order as they are requested.
213
- const result = yield this.redisClient.hmGet(key, fields);
214
- if (!Array.isArray(result)) {
215
- throw new factory.errors.ServiceUnavailable(`searchAvailability got non-array: ${typeof result}`);
256
+ if (StockHolderRepository.useMongoose({ eventId: params.eventId, startDate: params.startDate })) {
257
+ throw new factory.errors.NotImplemented(`new stock holder repository not implemented for the event '${params.eventId}'`);
258
+ }
259
+ else {
260
+ const key = StockHolderRepository.createKey({ eventId: params.eventId, startDate: params.startDate });
261
+ const fields = params.offers.map((o) => {
262
+ return StockHolderRepository.offer2field(o);
263
+ });
264
+ // Array reply: list of values associated with the given fields, in the same order as they are requested.
265
+ const result = yield this.redisClient.hmGet(key, fields);
266
+ if (!Array.isArray(result)) {
267
+ throw new factory.errors.ServiceUnavailable(`searchAvailability got non-array: ${typeof result}`);
268
+ }
269
+ // そのまま返却(2023-04-17~)
270
+ return result;
216
271
  }
217
- // そのまま返却(2023-04-17~)
218
- return result;
219
272
  });
220
273
  }
221
274
  // public async migrateKey(params: {
@@ -32,7 +32,7 @@ function call(data) {
32
32
  }
33
33
  yield AggregationService.event.aggregateScreeningEvent(data)({
34
34
  event: new event_1.MongoRepository(settings.connection),
35
- stockHolder: new stockHolder_1.StockHolderRepository(settings.redisClient),
35
+ stockHolder: new stockHolder_1.StockHolderRepository(settings.redisClient, settings.connection),
36
36
  offer: new offer_1.MongoRepository(settings.connection),
37
37
  offerCatalog: new offerCatalog_1.MongoRepository(settings.connection),
38
38
  offerRateLimit: new offer_2.RedisRepository(settings.redisClient),
@@ -30,7 +30,7 @@ function call(data) {
30
30
  const assetTransactionRepo = new assetTransaction_1.MongoRepository(settings.connection);
31
31
  const taskRepo = new task_1.MongoRepository(settings.connection);
32
32
  const reservationRepo = new reservation_1.MongoRepository(settings.connection);
33
- const stockHolderRepo = new stockHolder_1.StockHolderRepository(settings.redisClient);
33
+ const stockHolderRepo = new stockHolder_1.StockHolderRepository(settings.redisClient, settings.connection);
34
34
  const offerRateLimitRepo = new offer_1.RedisRepository(settings.redisClient);
35
35
  // アクション数は予約番号単位で1しかありえないはず(2023-06-05~)
36
36
  if (data.actionAttributes.length !== 1) {
@@ -30,7 +30,7 @@ function call(data) {
30
30
  const reservationRepo = new reservation_1.MongoRepository(settings.connection);
31
31
  const taskRepo = new task_1.MongoRepository(settings.connection);
32
32
  const transactionRepo = new assetTransaction_1.MongoRepository(settings.connection);
33
- const stockHolderRepo = new stockHolder_1.StockHolderRepository(settings.redisClient);
33
+ const stockHolderRepo = new stockHolder_1.StockHolderRepository(settings.redisClient, settings.connection);
34
34
  const offerRateLimitRepo = new offer_1.RedisRepository(settings.redisClient);
35
35
  yield ReserveService.cancelReservation(data.actionAttributes)({
36
36
  action: actionRepo,
@@ -29,7 +29,7 @@ function call(data) {
29
29
  }
30
30
  const actionRepo = new action_1.MongoRepository(settings.connection);
31
31
  const assetTransactionRepo = new assetTransaction_1.MongoRepository(settings.connection);
32
- const stockHolderRepo = new stockHolder_1.StockHolderRepository(settings.redisClient);
32
+ const stockHolderRepo = new stockHolder_1.StockHolderRepository(settings.redisClient, settings.connection);
33
33
  const offerRateLimitRepo = new offer_1.RedisRepository(settings.redisClient);
34
34
  const reservationRepo = new reservation_1.MongoRepository(settings.connection);
35
35
  const taskRepo = new task_1.MongoRepository(settings.connection);
@@ -39,6 +39,7 @@ export declare const DEFAULT_TASKS_EXPORT_AGENT_NAME: string;
39
39
  export declare const USE_ASSET_TRANSACTION_SYNC_PROCESSING: boolean;
40
40
  export declare const USE_PAY_ASSET_TRANSACTION_SYNC_PROCESSING: boolean;
41
41
  export declare const USE_NEW_EVENT_AVAILABILITY_KEY_FROM: moment.Moment;
42
+ export declare const USE_NEW_STOCK_HOLDER_REPO_IDS: string[];
42
43
  export declare const INFORM_RESERVATION_TASK_DELAY_IN_SECONDS: number;
43
44
  export declare const MONGO_MAX_TIME_MS: number;
44
45
  /**
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.settings = exports.MONGO_MAX_TIME_MS = exports.INFORM_RESERVATION_TASK_DELAY_IN_SECONDS = exports.USE_NEW_EVENT_AVAILABILITY_KEY_FROM = exports.USE_PAY_ASSET_TRANSACTION_SYNC_PROCESSING = exports.USE_ASSET_TRANSACTION_SYNC_PROCESSING = exports.DEFAULT_TASKS_EXPORT_AGENT_NAME = exports.DEFAULT_PAYMENT_METHOD_TYPE_FOR_CREDIT_CARD = exports.DEFAULT_SENDER_EMAIL = exports.TRANSACTION_CANCELED_STORAGE_PERIOD_IN_DAYS = exports.TRANSACTION_CONFIRMED_STORAGE_PERIOD_IN_DAYS = exports.ASSET_TRANSACTION_STORAGE_PERIOD_IN_DAYS = exports.ABORTED_TASKS_WITHOUT_REPORT = exports.TRIGGER_WEBHOOK_RETRY_INTERVAL_IN_MS = exports.TRIGGER_WEBHOOK_MAX_RETRY_COUNT = void 0;
3
+ exports.settings = exports.MONGO_MAX_TIME_MS = exports.INFORM_RESERVATION_TASK_DELAY_IN_SECONDS = exports.USE_NEW_STOCK_HOLDER_REPO_IDS = exports.USE_NEW_EVENT_AVAILABILITY_KEY_FROM = exports.USE_PAY_ASSET_TRANSACTION_SYNC_PROCESSING = exports.USE_ASSET_TRANSACTION_SYNC_PROCESSING = exports.DEFAULT_TASKS_EXPORT_AGENT_NAME = exports.DEFAULT_PAYMENT_METHOD_TYPE_FOR_CREDIT_CARD = exports.DEFAULT_SENDER_EMAIL = exports.TRANSACTION_CANCELED_STORAGE_PERIOD_IN_DAYS = exports.TRANSACTION_CONFIRMED_STORAGE_PERIOD_IN_DAYS = exports.ASSET_TRANSACTION_STORAGE_PERIOD_IN_DAYS = exports.ABORTED_TASKS_WITHOUT_REPORT = exports.TRIGGER_WEBHOOK_RETRY_INTERVAL_IN_MS = exports.TRIGGER_WEBHOOK_MAX_RETRY_COUNT = void 0;
4
4
  const moment = require("moment");
5
5
  const factory = require("./factory");
6
6
  const transactionWebhookUrls = (typeof process.env.INFORM_TRANSACTION_URL === 'string')
@@ -65,6 +65,9 @@ exports.USE_PAY_ASSET_TRANSACTION_SYNC_PROCESSING = process.env.USE_PAY_ASSET_TR
65
65
  exports.USE_NEW_EVENT_AVAILABILITY_KEY_FROM = (typeof process.env.USE_NEW_EVENT_AVAILABILITY_KEY_FROM === 'string')
66
66
  ? moment(process.env.USE_NEW_EVENT_AVAILABILITY_KEY_FROM)
67
67
  : moment('2023-08-31T15:00:00Z');
68
+ exports.USE_NEW_STOCK_HOLDER_REPO_IDS = (typeof process.env.USE_NEW_STOCK_HOLDER_REPO_IDS === 'string')
69
+ ? process.env.USE_NEW_STOCK_HOLDER_REPO_IDS.split(' ')
70
+ : [];
68
71
  exports.INFORM_RESERVATION_TASK_DELAY_IN_SECONDS = (typeof process.env.INFORM_RESERVATION_TASK_DELAY_IN_SECONDS === 'string')
69
72
  ? Number(process.env.INFORM_RESERVATION_TASK_DELAY_IN_SECONDS)
70
73
  : 0;
package/package.json CHANGED
@@ -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.118"
120
+ "version": "21.2.0-alpha.119"
121
121
  }