@chevre/domain 21.1.0 → 21.2.0-alpha.1

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.
@@ -3,10 +3,12 @@ import { RedisClientType } from 'redis';
3
3
  * 確認番号リポジトリ
4
4
  */
5
5
  export declare class RedisRepository {
6
+ private static readonly REDIS_KEY_PREFIX_NEW;
6
7
  private static readonly REDIS_KEY_PREFIX;
7
8
  private readonly redisClient;
8
9
  constructor(redisClient: RedisClientType);
9
- static ALIGN_DIGITS(params: string): string;
10
+ private static alignDigits;
11
+ private static createKey;
10
12
  /**
11
13
  * 発行する
12
14
  */
@@ -16,6 +16,7 @@ const util = require("util");
16
16
  // tslint:disable-next-line:no-require-imports no-var-requires
17
17
  const fpe = require('node-fpe');
18
18
  const factory = require("../factory");
19
+ const settings_1 = require("../settings");
19
20
  const CONFIRMATION_NUMBER_MIN_LENGH = 4;
20
21
  /**
21
22
  * 確認番号リポジトリ
@@ -24,7 +25,7 @@ class RedisRepository {
24
25
  constructor(redisClient) {
25
26
  this.redisClient = redisClient;
26
27
  }
27
- static ALIGN_DIGITS(params) {
28
+ static alignDigits(params) {
28
29
  let aligndNumber = String(params);
29
30
  if (aligndNumber.length < CONFIRMATION_NUMBER_MIN_LENGH) {
30
31
  aligndNumber = `${'0'.repeat(CONFIRMATION_NUMBER_MIN_LENGH)}${aligndNumber}`
@@ -32,6 +33,21 @@ class RedisRepository {
32
33
  }
33
34
  return aligndNumber;
34
35
  }
36
+ static createKey(params) {
37
+ const useNewKey = params.orderDate instanceof Date
38
+ && moment(params.orderDate)
39
+ .isSameOrAfter(settings_1.USE_NEW_ORDER_NUMBER_KEY_FROM);
40
+ if (useNewKey) {
41
+ return util.format('%s:%s', RedisRepository.REDIS_KEY_PREFIX_NEW, moment(params.orderDate)
42
+ .tz('Asia/Tokyo')
43
+ .format('YYMM'));
44
+ }
45
+ else {
46
+ return util.format('%s:%s', RedisRepository.REDIS_KEY_PREFIX, moment(params.orderDate)
47
+ .tz('Asia/Tokyo')
48
+ .format('YYMM'));
49
+ }
50
+ }
35
51
  /**
36
52
  * 発行する
37
53
  */
@@ -41,44 +57,29 @@ class RedisRepository {
41
57
  const TTL = moment(params.orderDate)
42
58
  .add(1, 'month')
43
59
  .diff(moment(params.orderDate), 'seconds');
44
- const key = util.format('%s:%s', RedisRepository.REDIS_KEY_PREFIX, moment(params.orderDate)
45
- .tz('Asia/Tokyo')
46
- .format('YYMM'));
60
+ const key = RedisRepository.createKey({ orderDate: params.orderDate });
47
61
  const [incrReply] = yield this.redisClient.multi()
48
62
  .incr(key)
49
63
  .expire(key, TTL)
50
64
  .exec();
51
- // if (!Array.isArray(results)) {
52
- // // なぜかresults: nullのことがあるのでハンドリング
53
- // throw new factory.errors.ServiceUnavailable('incr confirmationNumber result not array');
54
- // }
55
65
  // tslint:disable-next-line:no-single-line-block-comment
56
- /* istanbul ignore else: please write tests */
57
- if (typeof incrReply === 'number') {
58
- const no = incrReply;
59
- // debug('no incremented.', no);
60
- // 桁数調整
61
- let confirmationNumber = RedisRepository.ALIGN_DIGITS(String(no));
62
- // debug('encrypting confirmationNumber...', confirmationNumber);
63
- // checkdigit
64
- const cd = cdigit.luhn.compute(confirmationNumber);
65
- // debug('check digit:', cd);
66
- confirmationNumber = fpe({ password: cd })
67
- .encrypt(confirmationNumber);
68
- confirmationNumber = `${cd}${confirmationNumber}`;
69
- // console.log(
70
- // 'decrypted confirmationNumber:',
71
- // fpe({ password: confirmationNumber.slice(0, 1) })
72
- // .decrypt(confirmationNumber.slice(1))
73
- // );
74
- return confirmationNumber;
75
- }
76
- else {
66
+ /* istanbul ignore if */
67
+ if (typeof incrReply !== 'number') {
77
68
  // 基本的にありえないフロー
78
- throw new factory.errors.ServiceUnavailable('Confirmation number not published');
69
+ throw new factory.errors.ServiceUnavailable('confirmation number not incremented unexpectedly');
79
70
  }
71
+ // 桁数調整
72
+ let confirmationNumber = RedisRepository.alignDigits(incrReply);
73
+ // checkdigit
74
+ const cd = cdigit.luhn.compute(confirmationNumber);
75
+ // debug('check digit:', cd);
76
+ confirmationNumber = fpe({ password: cd })
77
+ .encrypt(confirmationNumber);
78
+ confirmationNumber = `${cd}${confirmationNumber}`;
79
+ return confirmationNumber;
80
80
  });
81
81
  }
82
82
  }
83
+ RedisRepository.REDIS_KEY_PREFIX_NEW = 'confirmationNumber';
83
84
  RedisRepository.REDIS_KEY_PREFIX = 'cinerino:confirmationNumber';
84
85
  exports.RedisRepository = RedisRepository;
@@ -14,22 +14,26 @@ export interface IOffer {
14
14
  }
15
15
  export interface ILockKey {
16
16
  eventId: string;
17
+ startDate: Date;
17
18
  offers: IOffer[];
18
19
  expires: Date;
19
20
  holder: string;
20
21
  }
21
22
  export interface IUnlockKey {
22
23
  eventId: string;
24
+ startDate: Date;
23
25
  offer: IOffer;
24
26
  }
25
27
  /**
26
- * イベントの座席在庫リポジトリ
28
+ * イベントストックホルダーリポジトリ
27
29
  */
28
30
  export declare class RedisRepository {
31
+ static KEY_PREFIX_NEW: string;
29
32
  static KEY_PREFIX: string;
30
33
  private readonly redisClient;
31
34
  constructor(redisClient: RedisClientType);
32
- static OFFER2FIELD(params: IOffer): string;
35
+ private static offer2field;
36
+ private static createKey;
33
37
  /**
34
38
  * 座席をロックする(maxキャパシティチェック有)
35
39
  */
@@ -47,6 +51,7 @@ export declare class RedisRepository {
47
51
  */
48
52
  findUnavailableOffersByEventId(params: {
49
53
  eventId: string;
54
+ startDate: Date;
50
55
  }): Promise<IOffer[]>;
51
56
  /**
52
57
  * 空席でない座席をカウントする
@@ -54,6 +59,7 @@ export declare class RedisRepository {
54
59
  countUnavailableOffers(params: {
55
60
  event: {
56
61
  id: string;
62
+ startDate: Date;
57
63
  };
58
64
  }): Promise<number>;
59
65
  /**
@@ -66,6 +72,7 @@ export declare class RedisRepository {
66
72
  */
67
73
  searchAvailability(params: {
68
74
  eventId: string;
75
+ startDate: Date;
69
76
  offers: IOffer[];
70
77
  }): Promise<{
71
78
  seatSection: string;
@@ -13,15 +13,16 @@ exports.RedisRepository = void 0;
13
13
  const createDebug = require("debug");
14
14
  const moment = require("moment");
15
15
  const factory = require("../../factory");
16
+ const settings_1 = require("../../settings");
16
17
  const debug = createDebug('chevre-domain:repo');
17
18
  /**
18
- * イベントの座席在庫リポジトリ
19
+ * イベントストックホルダーリポジトリ
19
20
  */
20
21
  class RedisRepository {
21
22
  constructor(redisClient) {
22
23
  this.redisClient = redisClient;
23
24
  }
24
- static OFFER2FIELD(params) {
25
+ static offer2field(params) {
25
26
  var _a, _b;
26
27
  // 予約IDをfieldにする場合
27
28
  const serviceOutputId = (_b = (_a = params.itemOffered) === null || _a === void 0 ? void 0 : _a.serviceOutput) === null || _b === void 0 ? void 0 : _b.id;
@@ -30,12 +31,23 @@ class RedisRepository {
30
31
  }
31
32
  return `${params.seatSection}:${params.seatNumber}`;
32
33
  }
34
+ static createKey(params) {
35
+ const useNewKey = params.startDate instanceof Date
36
+ && moment(params.startDate)
37
+ .isSameOrAfter(settings_1.USE_NEW_EVENT_AVAILABILITY_KEY_FROM);
38
+ if (useNewKey) {
39
+ return `${RedisRepository.KEY_PREFIX_NEW}:${params.eventId}`;
40
+ }
41
+ else {
42
+ return `${RedisRepository.KEY_PREFIX}:${params.eventId}`;
43
+ }
44
+ }
33
45
  /**
34
46
  * 座席をロックする(maxキャパシティチェック有)
35
47
  */
36
48
  lockIfNotLimitExceeded(lockKey, maximum) {
37
49
  return __awaiter(this, void 0, void 0, function* () {
38
- const key = `${RedisRepository.KEY_PREFIX}:${lockKey.eventId}`;
50
+ const key = RedisRepository.createKey({ eventId: lockKey.eventId, startDate: lockKey.startDate });
39
51
  yield this.redisClient.watch(key);
40
52
  const hashCount = yield this.redisClient.hLen(key);
41
53
  // Process result
@@ -52,11 +64,10 @@ class RedisRepository {
52
64
  */
53
65
  lock(lockKey) {
54
66
  return __awaiter(this, void 0, void 0, function* () {
55
- debug('locking...', lockKey);
56
- const key = `${RedisRepository.KEY_PREFIX}:${lockKey.eventId}`;
67
+ const key = RedisRepository.createKey({ eventId: lockKey.eventId, startDate: lockKey.startDate });
57
68
  const value = lockKey.holder;
58
69
  const multi = this.redisClient.multi();
59
- const fields = lockKey.offers.map((offer) => RedisRepository.OFFER2FIELD(offer));
70
+ const fields = lockKey.offers.map((offer) => RedisRepository.offer2field(offer));
60
71
  fields.forEach((field) => {
61
72
  multi.hSetNX(key, field, value);
62
73
  });
@@ -92,8 +103,8 @@ class RedisRepository {
92
103
  */
93
104
  unlock(params) {
94
105
  return __awaiter(this, void 0, void 0, function* () {
95
- const key = `${RedisRepository.KEY_PREFIX}:${params.eventId}`;
96
- const field = RedisRepository.OFFER2FIELD(params.offer);
106
+ const key = RedisRepository.createKey({ eventId: params.eventId, startDate: params.startDate });
107
+ const field = RedisRepository.offer2field(params.offer);
97
108
  yield this.redisClient.multi()
98
109
  .hDel(key, field)
99
110
  .exec();
@@ -104,7 +115,7 @@ class RedisRepository {
104
115
  */
105
116
  findUnavailableOffersByEventId(params) {
106
117
  return __awaiter(this, void 0, void 0, function* () {
107
- const key = `${RedisRepository.KEY_PREFIX}:${params.eventId}`;
118
+ const key = RedisRepository.createKey({ eventId: params.eventId, startDate: params.startDate });
108
119
  const reply = yield this.redisClient.hGetAll(key);
109
120
  let offers = [];
110
121
  if (reply !== null) {
@@ -123,7 +134,7 @@ class RedisRepository {
123
134
  */
124
135
  countUnavailableOffers(params) {
125
136
  return __awaiter(this, void 0, void 0, function* () {
126
- const key = `${RedisRepository.KEY_PREFIX}:${params.event.id}`;
137
+ const key = RedisRepository.createKey({ eventId: params.event.id, startDate: params.event.startDate });
127
138
  const reply = yield this.redisClient.hLen(key);
128
139
  let fieldCount = 0;
129
140
  if (typeof reply === 'number') {
@@ -137,8 +148,8 @@ class RedisRepository {
137
148
  */
138
149
  getHolder(params) {
139
150
  return __awaiter(this, void 0, void 0, function* () {
140
- const key = `${RedisRepository.KEY_PREFIX}:${params.eventId}`;
141
- const field = RedisRepository.OFFER2FIELD(params.offer);
151
+ const key = RedisRepository.createKey({ eventId: params.eventId, startDate: params.startDate });
152
+ const field = RedisRepository.offer2field(params.offer);
142
153
  return this.redisClient.hGet(key, field);
143
154
  });
144
155
  }
@@ -148,9 +159,9 @@ class RedisRepository {
148
159
  */
149
160
  searchAvailability(params) {
150
161
  return __awaiter(this, void 0, void 0, function* () {
151
- const key = `${RedisRepository.KEY_PREFIX}:${params.eventId}`;
162
+ const key = RedisRepository.createKey({ eventId: params.eventId, startDate: params.startDate });
152
163
  const fields = params.offers.map((o) => {
153
- return RedisRepository.OFFER2FIELD(o);
164
+ return RedisRepository.offer2field(o);
154
165
  });
155
166
  const result = yield this.redisClient.hmGet(key, fields);
156
167
  if (!Array.isArray(result)) {
@@ -165,5 +176,6 @@ class RedisRepository {
165
176
  });
166
177
  }
167
178
  }
179
+ RedisRepository.KEY_PREFIX_NEW = 'stockHolder';
168
180
  RedisRepository.KEY_PREFIX = 'chevre:itemAvailability:screeningEvent';
169
181
  exports.RedisRepository = RedisRepository;
@@ -3,9 +3,11 @@ import { RedisClientType } from 'redis';
3
3
  * 注文番号リポジトリ
4
4
  */
5
5
  export declare class RedisRepository {
6
- static REDIS_KEY_PREFIX: string;
6
+ private static readonly REDIS_KEY_PREFIX_NEW;
7
+ private static readonly REDIS_KEY_PREFIX;
7
8
  private readonly redisClient;
8
9
  constructor(redisClient: RedisClientType);
10
+ private static createKey;
9
11
  /**
10
12
  * タイムスタンプから発行する
11
13
  */
@@ -16,6 +16,8 @@ const util = require("util");
16
16
  // tslint:disable-next-line:no-require-imports no-var-requires
17
17
  const fpe = require('node-fpe');
18
18
  const factory = require("../factory");
19
+ const settings_1 = require("../settings");
20
+ const ORDER_NUMBER_SEPARATOR = '-';
19
21
  /**
20
22
  * 注文番号リポジトリ
21
23
  */
@@ -23,6 +25,17 @@ class RedisRepository {
23
25
  constructor(redisClient) {
24
26
  this.redisClient = redisClient;
25
27
  }
28
+ static createKey(params) {
29
+ const useNewKey = params.orderDate instanceof Date
30
+ && moment(params.orderDate)
31
+ .isSameOrAfter(settings_1.USE_NEW_ORDER_NUMBER_KEY_FROM);
32
+ if (useNewKey) {
33
+ return util.format('%s:%s:%s', RedisRepository.REDIS_KEY_PREFIX_NEW, params.projectPrefix, params.timestamp);
34
+ }
35
+ else {
36
+ return util.format('%s:%s:%s', RedisRepository.REDIS_KEY_PREFIX, params.projectPrefix, params.timestamp);
37
+ }
38
+ }
26
39
  /**
27
40
  * タイムスタンプから発行する
28
41
  */
@@ -37,42 +50,35 @@ class RedisRepository {
37
50
  const TTL = moment(params.orderDate)
38
51
  .add(1, 'minute') // ミリ秒でカウントしていくので、注文日時後1分で十分
39
52
  .diff(now, 'seconds');
40
- const key = util.format('%s:%s:%s', RedisRepository.REDIS_KEY_PREFIX, projectPrefix, timestamp);
53
+ const key = RedisRepository.createKey({ orderDate: params.orderDate, projectPrefix, timestamp });
41
54
  const [incrReply] = yield this.redisClient.multi()
42
55
  .incr(key)
43
56
  .expire(key, TTL)
44
57
  .exec();
45
- // if (!Array.isArray(results)) {
46
- // // なぜかresults: nullのことがあるのでハンドリング
47
- // throw new factory.errors.ServiceUnavailable('incr orderNumber result not array');
48
- // }
49
58
  // tslint:disable-next-line:no-single-line-block-comment
50
- /* istanbul ignore else: please write tests */
51
- if (typeof incrReply === 'number') {
52
- let orderNumber = timestamp;
53
- const no = incrReply;
54
- orderNumber = `${orderNumber}${no}`;
55
- // checkdigit
56
- const cd = cdigit.luhn.compute(orderNumber);
57
- const cipher = fpe({ password: cd });
58
- orderNumber = cipher.encrypt(orderNumber);
59
- orderNumber = `${projectPrefix}${cd}${orderNumber}`;
60
- orderNumber = `${[
61
- // tslint:disable-next-line:no-magic-numbers
62
- orderNumber.slice(0, 4),
63
- // tslint:disable-next-line:no-magic-numbers
64
- orderNumber.slice(4, 11),
65
- // tslint:disable-next-line:no-magic-numbers
66
- orderNumber.slice(11)
67
- ].join('-')}`;
68
- return orderNumber;
69
- }
70
- else {
59
+ /* istanbul ignore if */
60
+ if (typeof incrReply !== 'number') {
71
61
  // 基本的にありえないフロー
72
- throw new factory.errors.ServiceUnavailable('Order number not published');
62
+ throw new factory.errors.ServiceUnavailable('order number not incremented unexpectedly');
73
63
  }
64
+ let orderNumber = `${timestamp}${incrReply}`;
65
+ // checkdigit
66
+ const cd = cdigit.luhn.compute(orderNumber);
67
+ orderNumber = fpe({ password: cd })
68
+ .encrypt(orderNumber);
69
+ orderNumber = `${projectPrefix}${cd}${orderNumber}`;
70
+ orderNumber = `${[
71
+ // tslint:disable-next-line:no-magic-numbers
72
+ orderNumber.slice(0, 4),
73
+ // tslint:disable-next-line:no-magic-numbers
74
+ orderNumber.slice(4, 11),
75
+ // tslint:disable-next-line:no-magic-numbers
76
+ orderNumber.slice(11)
77
+ ].join(ORDER_NUMBER_SEPARATOR)}`;
78
+ return orderNumber;
74
79
  });
75
80
  }
76
81
  }
82
+ RedisRepository.REDIS_KEY_PREFIX_NEW = 'orderNumber';
77
83
  RedisRepository.REDIS_KEY_PREFIX = 'cinerino:orderNumber';
78
84
  exports.RedisRepository = RedisRepository;
@@ -389,6 +389,8 @@ function filterByEligibleSeatingType(params) {
389
389
  if (maximumAttendeeCapacity > 0) {
390
390
  const availabilities = yield repos.eventAvailability.searchAvailability({
391
391
  eventId: params.event.id,
392
+ startDate: moment(params.event.startDate)
393
+ .toDate(),
392
394
  offers: eligibleSeatOffers
393
395
  });
394
396
  remainingAttendeeCapacity = availabilities.filter((a) => a.availability === factory.itemAvailability.InStock).length;
@@ -436,7 +438,13 @@ function aggregateReservationByEvent(params) {
436
438
  // remainingAttendeeCapacityを決定
437
439
  if (typeof maximumAttendeeCapacity === 'number') {
438
440
  // 残席数を座席ロック数から計算
439
- const unavailableOfferCount = yield repos.eventAvailability.countUnavailableOffers({ event: { id: params.event.id } });
441
+ const unavailableOfferCount = yield repos.eventAvailability.countUnavailableOffers({
442
+ event: {
443
+ id: params.event.id,
444
+ startDate: moment(params.event.startDate)
445
+ .toDate()
446
+ }
447
+ });
440
448
  remainingAttendeeCapacity = maximumAttendeeCapacity - unavailableOfferCount;
441
449
  if (remainingAttendeeCapacity < 0) {
442
450
  remainingAttendeeCapacity = 0;
@@ -577,6 +577,8 @@ function processLockSeats(params) {
577
577
  if (typeof maximumAttendeeCapacity4event === 'number') {
578
578
  yield repos.eventAvailability.lockIfNotLimitExceeded({
579
579
  eventId: params.event.id,
580
+ startDate: moment(params.event.startDate)
581
+ .toDate(),
580
582
  offers,
581
583
  expires,
582
584
  holder
@@ -585,6 +587,8 @@ function processLockSeats(params) {
585
587
  else {
586
588
  yield repos.eventAvailability.lock({
587
589
  eventId: params.event.id,
590
+ startDate: moment(params.event.startDate)
591
+ .toDate(),
588
592
  offers,
589
593
  expires,
590
594
  holder
@@ -10,6 +10,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
10
10
  };
11
11
  Object.defineProperty(exports, "__esModule", { value: true });
12
12
  exports.createAggregateScreeningEventIfNotExist = exports.onEventChanged = exports.searchEventSeatOffersWithPaging = exports.searchEventSeatOffers = exports.product = exports.moneyTransfer = exports.eventServiceByCOA = exports.event = void 0;
13
+ const moment = require("moment");
13
14
  const factory = require("../factory");
14
15
  const EventOfferService = require("./offer/event");
15
16
  exports.event = EventOfferService;
@@ -111,6 +112,8 @@ function searchEventSeatOffers(params) {
111
112
  if (seats.length > 0) {
112
113
  const availabilities = yield repos.eventAvailability.searchAvailability({
113
114
  eventId: params.event.id,
115
+ startDate: moment(event.startDate)
116
+ .toDate(),
114
117
  offers: seats.map((s) => {
115
118
  var _a;
116
119
  return {
@@ -182,6 +185,8 @@ function searchEventSeatOffersWithPaging(params) {
182
185
  if (seats.length > 0) {
183
186
  const availabilities = yield repos.eventAvailability.searchAvailability({
184
187
  eventId: params.event.id,
188
+ startDate: moment(event.startDate)
189
+ .toDate(),
185
190
  offers: seats.map((s) => {
186
191
  var _a;
187
192
  return {
@@ -62,7 +62,12 @@ function cancelPendingReservation(actionAttributesList) {
62
62
  id: cancelingSubReservation.id,
63
63
  reservedTicket: cancelingSubReservation.reservedTicket,
64
64
  subReservation: cancelingSubReservation.subReservation,
65
- reservationFor: { id: String(reservationFor.id) }
65
+ reservationFor: {
66
+ id: String(reservationFor.id),
67
+ startDate: (reservationFor.typeOf === factory.eventType.ScreeningEvent)
68
+ ? reservationFor.startDate
69
+ : reservationFor.departureTime
70
+ }
66
71
  },
67
72
  expectedHolder: reserveTransactionId
68
73
  })(repos);
@@ -199,7 +204,12 @@ function cancelReservation(actionAttributesList) {
199
204
  id: cancelingSubReservation.id,
200
205
  reservedTicket: cancelingSubReservation.reservedTicket,
201
206
  subReservation: cancelingSubReservation.subReservation,
202
- reservationFor: { id: String(reservationFor.id) }
207
+ reservationFor: {
208
+ id: String(reservationFor.id),
209
+ startDate: (reservationFor.typeOf === factory.eventType.ScreeningEvent)
210
+ ? reservationFor.startDate
211
+ : reservationFor.departureTime
212
+ }
203
213
  },
204
214
  expectedHolder: reserveTransaction.id
205
215
  })(repos);
@@ -241,7 +251,10 @@ function cancelReservation(actionAttributesList) {
241
251
  id: reservation.id,
242
252
  reservedTicket: reservation.reservedTicket,
243
253
  subReservation: reservation.subReservation,
244
- reservationFor: { id: reservation.reservationFor.id }
254
+ reservationFor: {
255
+ id: reservation.reservationFor.id,
256
+ startDate: reservation.reservationFor.startDate
257
+ }
245
258
  },
246
259
  expectedHolder
247
260
  })(repos);
@@ -319,9 +332,12 @@ exports.cancelReservation = cancelReservation;
319
332
  function processUnlockSeat(params) {
320
333
  return (repos) => __awaiter(this, void 0, void 0, function* () {
321
334
  const reservation = params.reservation;
335
+ const eventStartDate = moment(reservation.reservationFor.startDate)
336
+ .toDate();
322
337
  // 予約IDでロックされていれば解除
323
338
  let lockKey = {
324
339
  eventId: reservation.reservationFor.id,
340
+ startDate: eventStartDate,
325
341
  offer: {
326
342
  itemOffered: { serviceOutput: { id: reservation.id } },
327
343
  seatNumber: '',
@@ -337,6 +353,7 @@ function processUnlockSeat(params) {
337
353
  if (ticketedSeat !== undefined) {
338
354
  lockKey = {
339
355
  eventId: reservation.reservationFor.id,
356
+ startDate: eventStartDate,
340
357
  offer: {
341
358
  seatNumber: ticketedSeat.seatNumber,
342
359
  seatSection: ticketedSeat.seatSection
@@ -357,6 +374,7 @@ function processUnlockSeat(params) {
357
374
  if (typeof seatSection4sub === 'string' && typeof seatNumber4sub === 'string') {
358
375
  const lockKey4sub = {
359
376
  eventId: reservation.reservationFor.id,
377
+ startDate: eventStartDate,
360
378
  offer: {
361
379
  seatNumber: seatNumber4sub,
362
380
  seatSection: seatSection4sub
@@ -1,3 +1,4 @@
1
+ import * as moment from 'moment';
1
2
  import * as factory from './factory';
2
3
  export declare const ABORTED_TASKS_WITHOUT_REPORT: string[];
3
4
  /**
@@ -28,6 +29,8 @@ export type ISettings = factory.project.ISettings & {
28
29
  export declare const DEFAULT_PAYMENT_METHOD_TYPE_FOR_CREDIT_CARD: string;
29
30
  export declare const USE_ASSET_TRANSACTION_SYNC_PROCESSING: boolean;
30
31
  export declare const USE_PAY_ASSET_TRANSACTION_SYNC_PROCESSING: boolean;
32
+ export declare const USE_NEW_EVENT_AVAILABILITY_KEY_FROM: moment.Moment;
33
+ export declare const USE_NEW_ORDER_NUMBER_KEY_FROM: moment.Moment;
31
34
  /**
32
35
  * グローバル設定
33
36
  */
@@ -1,6 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.settings = exports.USE_PAY_ASSET_TRANSACTION_SYNC_PROCESSING = exports.USE_ASSET_TRANSACTION_SYNC_PROCESSING = 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 = void 0;
3
+ exports.settings = exports.USE_NEW_ORDER_NUMBER_KEY_FROM = exports.USE_NEW_EVENT_AVAILABILITY_KEY_FROM = exports.USE_PAY_ASSET_TRANSACTION_SYNC_PROCESSING = exports.USE_ASSET_TRANSACTION_SYNC_PROCESSING = 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 = void 0;
4
+ const moment = require("moment");
4
5
  const factory = require("./factory");
5
6
  const transactionWebhookUrls = (typeof process.env.INFORM_TRANSACTION_URL === 'string')
6
7
  ? process.env.INFORM_TRANSACTION_URL.split(' ')
@@ -45,6 +46,12 @@ exports.DEFAULT_SENDER_EMAIL = process.env.DEFAULT_SENDER_EMAIL;
45
46
  exports.DEFAULT_PAYMENT_METHOD_TYPE_FOR_CREDIT_CARD = String(process.env.DEFAULT_PAYMENT_METHOD_TYPE_FOR_CREDIT_CARD);
46
47
  exports.USE_ASSET_TRANSACTION_SYNC_PROCESSING = process.env.USE_ASSET_TRANSACTION_SYNC_PROCESSING === '1';
47
48
  exports.USE_PAY_ASSET_TRANSACTION_SYNC_PROCESSING = process.env.USE_PAY_ASSET_TRANSACTION_SYNC_PROCESSING === '1';
49
+ exports.USE_NEW_EVENT_AVAILABILITY_KEY_FROM = (typeof process.env.USE_NEW_EVENT_AVAILABILITY_KEY_FROM === 'string')
50
+ ? moment(process.env.USE_NEW_EVENT_AVAILABILITY_KEY_FROM)
51
+ : moment('2023-07-23T15:00:00Z');
52
+ exports.USE_NEW_ORDER_NUMBER_KEY_FROM = (typeof process.env.USE_NEW_ORDER_NUMBER_KEY_FROM === 'string')
53
+ ? moment(process.env.USE_NEW_ORDER_NUMBER_KEY_FROM)
54
+ : moment('2023-04-30T15:00:00Z');
48
55
  /**
49
56
  * グローバル設定
50
57
  */
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.1.0"
120
+ "version": "21.2.0-alpha.1"
121
121
  }