@chevre/domain 21.2.0-alpha.2 → 21.2.0-alpha.4
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.
- package/example/src/chevre/aggregateEventReservation.ts +1 -1
- package/example/src/chevre/processReserve.ts +2 -2
- package/example/src/chevre/searchEventSeats.ts +42 -0
- package/lib/chevre/repo/confirmationNumber.js +1 -1
- package/lib/chevre/repo/rateLimit/offer.d.ts +3 -2
- package/lib/chevre/repo/rateLimit/offer.js +14 -14
- package/lib/chevre/repo/serviceOutputIdentifier.d.ts +3 -1
- package/lib/chevre/repo/serviceOutputIdentifier.js +23 -14
- package/lib/chevre/repo/{itemAvailability/screeningEvent.d.ts → stockHolder.d.ts} +4 -6
- package/lib/chevre/repo/{itemAvailability/screeningEvent.js → stockHolder.js} +51 -38
- package/lib/chevre/repo/transactionNumber.d.ts +3 -1
- package/lib/chevre/repo/transactionNumber.js +23 -14
- package/lib/chevre/repository.d.ts +3 -5
- package/lib/chevre/repository.js +5 -8
- package/lib/chevre/service/aggregation/event/aggregateScreeningEvent.d.ts +2 -2
- package/lib/chevre/service/aggregation/event/aggregateScreeningEvent.js +4 -3
- package/lib/chevre/service/assetTransaction/reserve.d.ts +4 -4
- package/lib/chevre/service/assetTransaction/reserve.js +7 -4
- package/lib/chevre/service/offer/event/authorize.d.ts +2 -2
- package/lib/chevre/service/offer/event/cancel.d.ts +2 -2
- package/lib/chevre/service/offer/event/voidTransaction.d.ts +2 -2
- package/lib/chevre/service/offer.d.ts +2 -2
- package/lib/chevre/service/offer.js +5 -2
- package/lib/chevre/service/reserve/cancelReservation.d.ts +3 -3
- package/lib/chevre/service/reserve/cancelReservation.js +6 -6
- package/lib/chevre/service/task/aggregateScreeningEvent.js +2 -2
- package/lib/chevre/service/task/cancelPendingReservation.js +3 -3
- package/lib/chevre/service/task/cancelReservation.js +3 -3
- package/lib/chevre/service/task/voidReserveTransaction.js +3 -3
- package/lib/chevre/settings.d.ts +1 -0
- package/lib/chevre/settings.js +5 -2
- package/package.json +1 -1
|
@@ -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
|
-
|
|
25
|
+
stockHolder: new chevre.repository.StockHolder(client),
|
|
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),
|
|
@@ -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.
|
|
33
|
+
const itemAvailabilityRepo = new chevre.repository.StockHolder(client);
|
|
34
34
|
const offerRateLimitRepo = new chevre.repository.rateLimit.Offer(client);
|
|
35
35
|
|
|
36
36
|
const identifier = `CIN${(new Date()).valueOf()}`;
|
|
@@ -70,7 +70,7 @@ async function main() {
|
|
|
70
70
|
validateEventOfferPeriod: false,
|
|
71
71
|
validateAppliesToMovieTicket: true
|
|
72
72
|
})({
|
|
73
|
-
|
|
73
|
+
stockHolder: itemAvailabilityRepo,
|
|
74
74
|
event: eventRepo,
|
|
75
75
|
offer: offerRepo,
|
|
76
76
|
offerCatalog: offerCatalogRepo,
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
// tslint:disable:no-console
|
|
2
|
+
import * as redis from 'redis';
|
|
3
|
+
|
|
4
|
+
import { chevre } from '../../../lib/index';
|
|
5
|
+
|
|
6
|
+
// const project = { id: String(process.env.PROJECT_ID) };
|
|
7
|
+
|
|
8
|
+
// tslint:disable-next-line:max-func-body-length
|
|
9
|
+
async function main() {
|
|
10
|
+
const client = redis.createClient<redis.RedisDefaultModules, Record<string, never>, Record<string, never>>({
|
|
11
|
+
socket: {
|
|
12
|
+
port: Number(<string>process.env.REDIS_PORT),
|
|
13
|
+
host: <string>process.env.REDIS_HOST
|
|
14
|
+
},
|
|
15
|
+
password: <string>process.env.REDIS_KEY
|
|
16
|
+
});
|
|
17
|
+
await client.connect();
|
|
18
|
+
|
|
19
|
+
const itemAvailabilityRepo = new chevre.repository.StockHolder(client);
|
|
20
|
+
|
|
21
|
+
const result = await itemAvailabilityRepo.searchHolders({
|
|
22
|
+
eventId: 'alckc9mlx',
|
|
23
|
+
startDate: new Date(),
|
|
24
|
+
offers: [
|
|
25
|
+
{
|
|
26
|
+
seatSection: 'Default',
|
|
27
|
+
seatNumber: 'B-10'
|
|
28
|
+
},
|
|
29
|
+
{
|
|
30
|
+
seatSection: 'xxx',
|
|
31
|
+
seatNumber: 'xxx'
|
|
32
|
+
}
|
|
33
|
+
]
|
|
34
|
+
});
|
|
35
|
+
console.log(result);
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
main()
|
|
39
|
+
.then(() => {
|
|
40
|
+
console.log('success!');
|
|
41
|
+
})
|
|
42
|
+
.catch(console.error);
|
|
@@ -36,7 +36,7 @@ class RedisRepository {
|
|
|
36
36
|
static createKey(params) {
|
|
37
37
|
const useNewKey = params.orderDate instanceof Date
|
|
38
38
|
&& moment(params.orderDate)
|
|
39
|
-
.isSameOrAfter(settings_1.
|
|
39
|
+
.isSameOrAfter(settings_1.USE_NEW_CONFIRMATION_NUMBER_KEY_FROM);
|
|
40
40
|
if (useNewKey) {
|
|
41
41
|
return util.format('%s:%s', RedisRepository.REDIS_KEY_PREFIX_NEW, moment(params.orderDate)
|
|
42
42
|
.tz('Asia/Tokyo')
|
|
@@ -18,10 +18,11 @@ export interface IRateLimitKey {
|
|
|
18
18
|
* オファーレート制限リポジトリ
|
|
19
19
|
*/
|
|
20
20
|
export declare class RedisRepository {
|
|
21
|
-
static
|
|
21
|
+
private static readonly KEY_PREFIX_NEW;
|
|
22
|
+
private static readonly KEY_PREFIX;
|
|
22
23
|
private readonly redisClient;
|
|
23
24
|
constructor(redisClient: RedisClientType);
|
|
24
|
-
static
|
|
25
|
+
private static createKey;
|
|
25
26
|
/**
|
|
26
27
|
* ロックする
|
|
27
28
|
*/
|
|
@@ -10,10 +10,9 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
10
10
|
};
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
12
|
exports.RedisRepository = void 0;
|
|
13
|
-
const createDebug = require("debug");
|
|
14
13
|
const moment = require("moment");
|
|
15
14
|
const factory = require("../../factory");
|
|
16
|
-
const
|
|
15
|
+
const settings_1 = require("../../settings");
|
|
17
16
|
/**
|
|
18
17
|
* オファーレート制限リポジトリ
|
|
19
18
|
*/
|
|
@@ -21,11 +20,17 @@ class RedisRepository {
|
|
|
21
20
|
constructor(redisClient) {
|
|
22
21
|
this.redisClient = redisClient;
|
|
23
22
|
}
|
|
24
|
-
static
|
|
23
|
+
static createKey(ratelimitKey) {
|
|
25
24
|
const dateNow = moment(ratelimitKey.reservationFor.startDate);
|
|
26
25
|
const unitInSeconds = Number(ratelimitKey.reservedTicket.ticketType.validRateLimit.unitInSeconds.toString());
|
|
27
|
-
const validFrom = dateNow.unix() - dateNow.unix() % unitInSeconds;
|
|
28
|
-
|
|
26
|
+
const validFrom = dateNow.unix() - (dateNow.unix() % unitInSeconds);
|
|
27
|
+
const useNewKey = dateNow.isSameOrAfter(settings_1.USE_NEW_EVENT_AVAILABILITY_KEY_FROM);
|
|
28
|
+
if (useNewKey) {
|
|
29
|
+
return `${RedisRepository.KEY_PREFIX_NEW}:${ratelimitKey.reservedTicket.ticketType.validRateLimit.scope}:${validFrom.toString()}`;
|
|
30
|
+
}
|
|
31
|
+
else {
|
|
32
|
+
return `${RedisRepository.KEY_PREFIX}:${ratelimitKey.reservedTicket.ticketType.validRateLimit.scope}:${validFrom.toString()}`;
|
|
33
|
+
}
|
|
29
34
|
}
|
|
30
35
|
/**
|
|
31
36
|
* ロックする
|
|
@@ -34,7 +39,7 @@ class RedisRepository {
|
|
|
34
39
|
return __awaiter(this, void 0, void 0, function* () {
|
|
35
40
|
const datasets = ratelimitKeys.map((ratelimitKey) => {
|
|
36
41
|
return {
|
|
37
|
-
key: RedisRepository.
|
|
42
|
+
key: RedisRepository.createKey(ratelimitKey),
|
|
38
43
|
value: ratelimitKey.reservationNumber,
|
|
39
44
|
ttl: moment(ratelimitKey.reservationFor.startDate)
|
|
40
45
|
.add(ratelimitKey.reservedTicket.ticketType.validRateLimit.unitInSeconds, 'seconds')
|
|
@@ -43,29 +48,24 @@ class RedisRepository {
|
|
|
43
48
|
});
|
|
44
49
|
let multi = this.redisClient.multi();
|
|
45
50
|
datasets.forEach((dataset) => {
|
|
46
|
-
debug('setting if not exist...', dataset.key);
|
|
47
51
|
multi.setNX(dataset.key, dataset.value)
|
|
48
52
|
.expire(dataset.key, dataset.ttl);
|
|
49
53
|
});
|
|
50
54
|
const results = yield multi.exec();
|
|
51
55
|
const lockedFields = [];
|
|
52
56
|
results.forEach((r, index) => {
|
|
53
|
-
debug('r, index:', r, index);
|
|
54
57
|
// tslint:disable-next-line:no-magic-numbers
|
|
55
58
|
if (index % 2 === 0 && (r === 1 || r === true)) {
|
|
56
59
|
// tslint:disable-next-line:no-magic-numbers
|
|
57
60
|
lockedFields.push(datasets[index / 2].key);
|
|
58
61
|
}
|
|
59
62
|
});
|
|
60
|
-
debug('locked fields:', lockedFields);
|
|
61
63
|
const lockedAll = lockedFields.length === ratelimitKeys.length;
|
|
62
|
-
debug('lockedAll?', lockedAll);
|
|
63
64
|
if (!lockedAll) {
|
|
64
65
|
if (lockedFields.length > 0) {
|
|
65
66
|
// 全てロックできなければロックできたものは解除
|
|
66
67
|
multi = this.redisClient.multi();
|
|
67
68
|
lockedFields.forEach((key) => {
|
|
68
|
-
debug('deleting...', key);
|
|
69
69
|
multi.del(key);
|
|
70
70
|
});
|
|
71
71
|
yield multi.exec();
|
|
@@ -78,8 +78,7 @@ class RedisRepository {
|
|
|
78
78
|
return __awaiter(this, void 0, void 0, function* () {
|
|
79
79
|
const multi = this.redisClient.multi();
|
|
80
80
|
ratelimitKeys.forEach((ratelimitKey) => {
|
|
81
|
-
const key = RedisRepository.
|
|
82
|
-
debug('deleting...', key);
|
|
81
|
+
const key = RedisRepository.createKey(ratelimitKey);
|
|
83
82
|
multi.del(key);
|
|
84
83
|
});
|
|
85
84
|
yield multi.exec();
|
|
@@ -87,10 +86,11 @@ class RedisRepository {
|
|
|
87
86
|
}
|
|
88
87
|
getHolder(ratelimitKey) {
|
|
89
88
|
return __awaiter(this, void 0, void 0, function* () {
|
|
90
|
-
const key = RedisRepository.
|
|
89
|
+
const key = RedisRepository.createKey(ratelimitKey);
|
|
91
90
|
return this.redisClient.get(key);
|
|
92
91
|
});
|
|
93
92
|
}
|
|
94
93
|
}
|
|
94
|
+
RedisRepository.KEY_PREFIX_NEW = 'rateLimit:offer';
|
|
95
95
|
RedisRepository.KEY_PREFIX = 'chevre:rateLimit:offer';
|
|
96
96
|
exports.RedisRepository = RedisRepository;
|
|
@@ -3,9 +3,11 @@ import { RedisClientType } from 'redis';
|
|
|
3
3
|
* サービスアウトプット識別子リポジトリ
|
|
4
4
|
*/
|
|
5
5
|
export declare class RedisRepository {
|
|
6
|
-
static
|
|
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,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
|
/**
|
|
20
21
|
* サービスアウトプット識別子リポジトリ
|
|
21
22
|
*/
|
|
@@ -23,6 +24,17 @@ class RedisRepository {
|
|
|
23
24
|
constructor(redisClient) {
|
|
24
25
|
this.redisClient = redisClient;
|
|
25
26
|
}
|
|
27
|
+
static createKey(params) {
|
|
28
|
+
const useNewKey = params.startDate instanceof Date
|
|
29
|
+
&& moment(params.startDate)
|
|
30
|
+
.isSameOrAfter(settings_1.USE_NEW_ORDER_NUMBER_KEY_FROM);
|
|
31
|
+
if (useNewKey) {
|
|
32
|
+
return util.format('%s:%s', RedisRepository.REDIS_KEY_PREFIX_NEW, params.timestamp);
|
|
33
|
+
}
|
|
34
|
+
else {
|
|
35
|
+
return util.format('%s:%s', RedisRepository.REDIS_KEY_PREFIX, params.timestamp);
|
|
36
|
+
}
|
|
37
|
+
}
|
|
26
38
|
/**
|
|
27
39
|
* タイムスタンプから発行する
|
|
28
40
|
*/
|
|
@@ -35,30 +47,27 @@ class RedisRepository {
|
|
|
35
47
|
const TTL = moment(params.startDate)
|
|
36
48
|
.add(1, 'minute') // ミリ秒でカウントしていくので、予約日時後1分で十分
|
|
37
49
|
.diff(now, 'seconds');
|
|
38
|
-
const key =
|
|
50
|
+
const key = RedisRepository.createKey({ startDate: params.startDate, timestamp });
|
|
39
51
|
const [incrReply] = yield this.redisClient.multi()
|
|
40
52
|
.incr(key)
|
|
41
53
|
.expire(key, TTL)
|
|
42
54
|
.exec();
|
|
43
55
|
// tslint:disable-next-line:no-single-line-block-comment
|
|
44
56
|
/* istanbul ignore else: please write tests */
|
|
45
|
-
if (typeof incrReply
|
|
46
|
-
let identifier = timestamp;
|
|
47
|
-
const no = incrReply;
|
|
48
|
-
identifier = `${identifier}${no}`;
|
|
49
|
-
// checkdigit
|
|
50
|
-
const cd = cdigit.luhn.compute(identifier);
|
|
51
|
-
const cipher = fpe({ password: cd });
|
|
52
|
-
identifier = cipher.encrypt(identifier);
|
|
53
|
-
identifier = `${cd}${identifier}`;
|
|
54
|
-
return identifier;
|
|
55
|
-
}
|
|
56
|
-
else {
|
|
57
|
+
if (typeof incrReply !== 'number') {
|
|
57
58
|
// 基本的にありえないフロー
|
|
58
|
-
throw new factory.errors.ServiceUnavailable('
|
|
59
|
+
throw new factory.errors.ServiceUnavailable('serviceOutput identifier not incremented unexpectedly');
|
|
59
60
|
}
|
|
61
|
+
let identifier = `${timestamp}${incrReply}`;
|
|
62
|
+
// checkdigit
|
|
63
|
+
const cd = cdigit.luhn.compute(identifier);
|
|
64
|
+
identifier = fpe({ password: cd })
|
|
65
|
+
.encrypt(identifier);
|
|
66
|
+
identifier = `${cd}${identifier}`;
|
|
67
|
+
return identifier;
|
|
60
68
|
});
|
|
61
69
|
}
|
|
62
70
|
}
|
|
71
|
+
RedisRepository.REDIS_KEY_PREFIX_NEW = 'serviceOutputIdentifier';
|
|
63
72
|
RedisRepository.REDIS_KEY_PREFIX = 'chevre:serviceOutputIdentifier';
|
|
64
73
|
exports.RedisRepository = RedisRepository;
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { RedisClientType } from 'redis';
|
|
2
|
-
import * as factory from '../../factory';
|
|
3
2
|
export interface IOffer {
|
|
4
3
|
itemOffered?: {
|
|
5
4
|
serviceOutput?: {
|
|
@@ -24,10 +23,11 @@ export interface IUnlockKey {
|
|
|
24
23
|
startDate: Date;
|
|
25
24
|
offer: IOffer;
|
|
26
25
|
}
|
|
26
|
+
export type IGetHolderResult = string | null;
|
|
27
27
|
/**
|
|
28
28
|
* イベントストックホルダーリポジトリ
|
|
29
29
|
*/
|
|
30
|
-
export declare class
|
|
30
|
+
export declare class StockHolderRepository {
|
|
31
31
|
static KEY_PREFIX_NEW: string;
|
|
32
32
|
static KEY_PREFIX: string;
|
|
33
33
|
private readonly redisClient;
|
|
@@ -70,11 +70,9 @@ export declare class RedisRepository {
|
|
|
70
70
|
* 在庫状況を検索する
|
|
71
71
|
* offers.lengthが0だと"ERR wrong number of arguments for 'hmget' command"となるので注意
|
|
72
72
|
*/
|
|
73
|
-
|
|
73
|
+
searchHolders(params: {
|
|
74
74
|
eventId: string;
|
|
75
75
|
startDate: Date;
|
|
76
76
|
offers: IOffer[];
|
|
77
|
-
}): Promise<
|
|
78
|
-
availability: factory.itemAvailability;
|
|
79
|
-
}[]>;
|
|
77
|
+
}): Promise<IGetHolderResult[]>;
|
|
80
78
|
}
|
|
@@ -9,16 +9,16 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
9
9
|
});
|
|
10
10
|
};
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
exports.
|
|
12
|
+
exports.StockHolderRepository = void 0;
|
|
13
13
|
const createDebug = require("debug");
|
|
14
14
|
const moment = require("moment");
|
|
15
|
-
const factory = require("
|
|
16
|
-
const settings_1 = require("
|
|
15
|
+
const factory = require("../factory");
|
|
16
|
+
const settings_1 = require("../settings");
|
|
17
17
|
const debug = createDebug('chevre-domain:repo');
|
|
18
18
|
/**
|
|
19
19
|
* イベントストックホルダーリポジトリ
|
|
20
20
|
*/
|
|
21
|
-
class
|
|
21
|
+
class StockHolderRepository {
|
|
22
22
|
constructor(redisClient) {
|
|
23
23
|
this.redisClient = redisClient;
|
|
24
24
|
}
|
|
@@ -36,10 +36,10 @@ class RedisRepository {
|
|
|
36
36
|
&& moment(params.startDate)
|
|
37
37
|
.isSameOrAfter(settings_1.USE_NEW_EVENT_AVAILABILITY_KEY_FROM);
|
|
38
38
|
if (useNewKey) {
|
|
39
|
-
return `${
|
|
39
|
+
return `${StockHolderRepository.KEY_PREFIX_NEW}:${params.eventId}`;
|
|
40
40
|
}
|
|
41
41
|
else {
|
|
42
|
-
return `${
|
|
42
|
+
return `${StockHolderRepository.KEY_PREFIX}:${params.eventId}`;
|
|
43
43
|
}
|
|
44
44
|
}
|
|
45
45
|
/**
|
|
@@ -47,7 +47,7 @@ class RedisRepository {
|
|
|
47
47
|
*/
|
|
48
48
|
lockIfNotLimitExceeded(lockKey, maximum) {
|
|
49
49
|
return __awaiter(this, void 0, void 0, function* () {
|
|
50
|
-
const key =
|
|
50
|
+
const key = StockHolderRepository.createKey({ eventId: lockKey.eventId, startDate: lockKey.startDate });
|
|
51
51
|
yield this.redisClient.watch(key);
|
|
52
52
|
const hashCount = yield this.redisClient.hLen(key);
|
|
53
53
|
// Process result
|
|
@@ -64,10 +64,10 @@ class RedisRepository {
|
|
|
64
64
|
*/
|
|
65
65
|
lock(lockKey) {
|
|
66
66
|
return __awaiter(this, void 0, void 0, function* () {
|
|
67
|
-
const key =
|
|
67
|
+
const key = StockHolderRepository.createKey({ eventId: lockKey.eventId, startDate: lockKey.startDate });
|
|
68
68
|
const value = lockKey.holder;
|
|
69
69
|
const multi = this.redisClient.multi();
|
|
70
|
-
const fields = lockKey.offers.map((offer) =>
|
|
70
|
+
const fields = lockKey.offers.map((offer) => StockHolderRepository.offer2field(offer));
|
|
71
71
|
fields.forEach((field) => {
|
|
72
72
|
multi.hSetNX(key, field, value);
|
|
73
73
|
});
|
|
@@ -103,8 +103,8 @@ class RedisRepository {
|
|
|
103
103
|
*/
|
|
104
104
|
unlock(params) {
|
|
105
105
|
return __awaiter(this, void 0, void 0, function* () {
|
|
106
|
-
const key =
|
|
107
|
-
const field =
|
|
106
|
+
const key = StockHolderRepository.createKey({ eventId: params.eventId, startDate: params.startDate });
|
|
107
|
+
const field = StockHolderRepository.offer2field(params.offer);
|
|
108
108
|
yield this.redisClient.multi()
|
|
109
109
|
.hDel(key, field)
|
|
110
110
|
.exec();
|
|
@@ -115,7 +115,7 @@ class RedisRepository {
|
|
|
115
115
|
*/
|
|
116
116
|
findUnavailableOffersByEventId(params) {
|
|
117
117
|
return __awaiter(this, void 0, void 0, function* () {
|
|
118
|
-
const key =
|
|
118
|
+
const key = StockHolderRepository.createKey({ eventId: params.eventId, startDate: params.startDate });
|
|
119
119
|
const reply = yield this.redisClient.hGetAll(key);
|
|
120
120
|
let offers = [];
|
|
121
121
|
if (reply !== null) {
|
|
@@ -134,7 +134,7 @@ class RedisRepository {
|
|
|
134
134
|
*/
|
|
135
135
|
countUnavailableOffers(params) {
|
|
136
136
|
return __awaiter(this, void 0, void 0, function* () {
|
|
137
|
-
const key =
|
|
137
|
+
const key = StockHolderRepository.createKey({ eventId: params.event.id, startDate: params.event.startDate });
|
|
138
138
|
const reply = yield this.redisClient.hLen(key);
|
|
139
139
|
let fieldCount = 0;
|
|
140
140
|
if (typeof reply === 'number') {
|
|
@@ -148,8 +148,8 @@ class RedisRepository {
|
|
|
148
148
|
*/
|
|
149
149
|
getHolder(params) {
|
|
150
150
|
return __awaiter(this, void 0, void 0, function* () {
|
|
151
|
-
const key =
|
|
152
|
-
const field =
|
|
151
|
+
const key = StockHolderRepository.createKey({ eventId: params.eventId, startDate: params.startDate });
|
|
152
|
+
const field = StockHolderRepository.offer2field(params.offer);
|
|
153
153
|
return this.redisClient.hGet(key, field);
|
|
154
154
|
});
|
|
155
155
|
}
|
|
@@ -157,37 +157,50 @@ class RedisRepository {
|
|
|
157
157
|
* 在庫状況を検索する
|
|
158
158
|
* offers.lengthが0だと"ERR wrong number of arguments for 'hmget' command"となるので注意
|
|
159
159
|
*/
|
|
160
|
-
searchAvailability(params
|
|
160
|
+
// public async searchAvailability(params: {
|
|
161
|
+
// eventId: string;
|
|
162
|
+
// startDate: Date;
|
|
163
|
+
// offers: IOffer[];
|
|
164
|
+
// }): Promise<{
|
|
165
|
+
// seatSection: string;
|
|
166
|
+
// seatNumber: string;
|
|
167
|
+
// availability: factory.itemAvailability;
|
|
168
|
+
// }[]> {
|
|
169
|
+
// const key = RedisRepository.createKey({ eventId: params.eventId, startDate: params.startDate });
|
|
170
|
+
// const fields = params.offers.map((o) => {
|
|
171
|
+
// return RedisRepository.offer2field(o);
|
|
172
|
+
// });
|
|
173
|
+
// // Array reply: list of values associated with the given fields, in the same order as they are requested.
|
|
174
|
+
// const result = await this.redisClient.hmGet(key, fields);
|
|
175
|
+
// if (!Array.isArray(result)) {
|
|
176
|
+
// throw new factory.errors.ServiceUnavailable(`searchAvailability got non-array: ${typeof result}`);
|
|
177
|
+
// }
|
|
178
|
+
// return params.offers.map((o, index) => {
|
|
179
|
+
// const value4offer = result[index];
|
|
180
|
+
// return {
|
|
181
|
+
// ...o,
|
|
182
|
+
// availability: (typeof value4offer === 'string')
|
|
183
|
+
// ? factory.itemAvailability.OutOfStock // ホルダーが存在すればOutOfStock
|
|
184
|
+
// : factory.itemAvailability.InStock
|
|
185
|
+
// };
|
|
186
|
+
// });
|
|
187
|
+
// }
|
|
188
|
+
searchHolders(params) {
|
|
161
189
|
return __awaiter(this, void 0, void 0, function* () {
|
|
162
|
-
const key =
|
|
190
|
+
const key = StockHolderRepository.createKey({ eventId: params.eventId, startDate: params.startDate });
|
|
163
191
|
const fields = params.offers.map((o) => {
|
|
164
|
-
return
|
|
192
|
+
return StockHolderRepository.offer2field(o);
|
|
165
193
|
});
|
|
166
194
|
// Array reply: list of values associated with the given fields, in the same order as they are requested.
|
|
167
195
|
const result = yield this.redisClient.hmGet(key, fields);
|
|
168
196
|
if (!Array.isArray(result)) {
|
|
169
197
|
throw new factory.errors.ServiceUnavailable(`searchAvailability got non-array: ${typeof result}`);
|
|
170
198
|
}
|
|
171
|
-
//
|
|
172
|
-
|
|
173
|
-
// return {
|
|
174
|
-
// ...o,
|
|
175
|
-
// availability: (typeof value4offer === 'string')
|
|
176
|
-
// ? factory.itemAvailability.OutOfStock // ホルダーが存在すればOutOfStock
|
|
177
|
-
// : factory.itemAvailability.InStock
|
|
178
|
-
// };
|
|
179
|
-
// });
|
|
180
|
-
// availabilityのみ返却(2023-04-17~)
|
|
181
|
-
return result.map((holder) => {
|
|
182
|
-
return {
|
|
183
|
-
availability: (typeof holder === 'string')
|
|
184
|
-
? factory.itemAvailability.OutOfStock // ホルダーが存在すればOutOfStock
|
|
185
|
-
: factory.itemAvailability.InStock
|
|
186
|
-
};
|
|
187
|
-
});
|
|
199
|
+
// そのまま返却(2023-04-17~)
|
|
200
|
+
return result;
|
|
188
201
|
});
|
|
189
202
|
}
|
|
190
203
|
}
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
exports.
|
|
204
|
+
StockHolderRepository.KEY_PREFIX_NEW = 'stockHolder';
|
|
205
|
+
StockHolderRepository.KEY_PREFIX = 'chevre:itemAvailability:screeningEvent';
|
|
206
|
+
exports.StockHolderRepository = StockHolderRepository;
|
|
@@ -6,9 +6,11 @@ interface IPublishResult {
|
|
|
6
6
|
* 取引番号リポジトリ
|
|
7
7
|
*/
|
|
8
8
|
export declare class RedisRepository {
|
|
9
|
-
static
|
|
9
|
+
private static readonly REDIS_KEY_PREFIX_NEW;
|
|
10
|
+
private static readonly REDIS_KEY_PREFIX;
|
|
10
11
|
private readonly redisClient;
|
|
11
12
|
constructor(redisClient: RedisClientType);
|
|
13
|
+
private static createKey;
|
|
12
14
|
/**
|
|
13
15
|
* タイムスタンプから発行する
|
|
14
16
|
*/
|
|
@@ -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
|
/**
|
|
20
21
|
* 取引番号リポジトリ
|
|
21
22
|
*/
|
|
@@ -23,6 +24,17 @@ class RedisRepository {
|
|
|
23
24
|
constructor(redisClient) {
|
|
24
25
|
this.redisClient = redisClient;
|
|
25
26
|
}
|
|
27
|
+
static createKey(params) {
|
|
28
|
+
const useNewKey = params.startDate instanceof Date
|
|
29
|
+
&& moment(params.startDate)
|
|
30
|
+
.isSameOrAfter(settings_1.USE_NEW_ORDER_NUMBER_KEY_FROM);
|
|
31
|
+
if (useNewKey) {
|
|
32
|
+
return util.format('%s:%s', RedisRepository.REDIS_KEY_PREFIX_NEW, params.timestamp);
|
|
33
|
+
}
|
|
34
|
+
else {
|
|
35
|
+
return util.format('%s:%s', RedisRepository.REDIS_KEY_PREFIX, params.timestamp);
|
|
36
|
+
}
|
|
37
|
+
}
|
|
26
38
|
/**
|
|
27
39
|
* タイムスタンプから発行する
|
|
28
40
|
*/
|
|
@@ -35,30 +47,27 @@ class RedisRepository {
|
|
|
35
47
|
const TTL = moment(params.startDate)
|
|
36
48
|
.add(1, 'minute') // ミリ秒でカウントしていくので、予約日時後1分で十分
|
|
37
49
|
.diff(now, 'seconds');
|
|
38
|
-
const key =
|
|
50
|
+
const key = RedisRepository.createKey({ startDate: params.startDate, timestamp });
|
|
39
51
|
const [incrReply] = yield this.redisClient.multi()
|
|
40
52
|
.incr(key)
|
|
41
53
|
.expire(key, TTL)
|
|
42
54
|
.exec();
|
|
43
55
|
// tslint:disable-next-line:no-single-line-block-comment
|
|
44
56
|
/* istanbul ignore else: please write tests */
|
|
45
|
-
if (typeof incrReply
|
|
46
|
-
let transactionNumber = timestamp;
|
|
47
|
-
const no = incrReply;
|
|
48
|
-
transactionNumber = `${transactionNumber}${no}`;
|
|
49
|
-
// checkdigit
|
|
50
|
-
const cd = cdigit.luhn.compute(transactionNumber);
|
|
51
|
-
const cipher = fpe({ password: cd });
|
|
52
|
-
transactionNumber = cipher.encrypt(transactionNumber);
|
|
53
|
-
transactionNumber = `${cd}${transactionNumber}`;
|
|
54
|
-
return { transactionNumber };
|
|
55
|
-
}
|
|
56
|
-
else {
|
|
57
|
+
if (typeof incrReply !== 'number') {
|
|
57
58
|
// 基本的にありえないフロー
|
|
58
|
-
throw new factory.errors.ServiceUnavailable('
|
|
59
|
+
throw new factory.errors.ServiceUnavailable('transaction number not incremented unexpectedly');
|
|
59
60
|
}
|
|
61
|
+
let transactionNumber = `${timestamp}${incrReply}`;
|
|
62
|
+
// checkdigit
|
|
63
|
+
const cd = cdigit.luhn.compute(transactionNumber);
|
|
64
|
+
transactionNumber = fpe({ password: cd })
|
|
65
|
+
.encrypt(transactionNumber);
|
|
66
|
+
transactionNumber = `${cd}${transactionNumber}`;
|
|
67
|
+
return { transactionNumber };
|
|
60
68
|
});
|
|
61
69
|
}
|
|
62
70
|
}
|
|
71
|
+
RedisRepository.REDIS_KEY_PREFIX_NEW = 'transactionNumber';
|
|
63
72
|
RedisRepository.REDIS_KEY_PREFIX = 'chevre:transactionNumber';
|
|
64
73
|
exports.RedisRepository = RedisRepository;
|
|
@@ -16,7 +16,6 @@ import { MongoRepository as CreativeWorkRepo } from './repo/creativeWork';
|
|
|
16
16
|
import { MongoRepository as CustomerRepo } from './repo/customer';
|
|
17
17
|
import { MongoRepository as EmailMessageRepo } from './repo/emailMessage';
|
|
18
18
|
import { MongoRepository as EventRepo } from './repo/event';
|
|
19
|
-
import { RedisRepository as ScreeningEventItemAvailabilityRepo } from './repo/itemAvailability/screeningEvent';
|
|
20
19
|
import { MongoRepository as MemberRepo } from './repo/member';
|
|
21
20
|
import { MongoRepository as MerchantReturnPolicyRepo } from './repo/merchantReturnPolicy';
|
|
22
21
|
import { MongoRepository as OfferRepo } from './repo/offer';
|
|
@@ -34,6 +33,7 @@ import { MongoRepository as RoleRepo } from './repo/role';
|
|
|
34
33
|
import { MongoRepository as SellerRepo } from './repo/seller';
|
|
35
34
|
import { MongoRepository as ServiceOutputRepo } from './repo/serviceOutput';
|
|
36
35
|
import { RedisRepository as ServiceOutputIdentifierRepo } from './repo/serviceOutputIdentifier';
|
|
36
|
+
import { StockHolderRepository as StockHolderRepo } from './repo/stockHolder';
|
|
37
37
|
import { MongoRepository as TaskRepo } from './repo/task';
|
|
38
38
|
import { MongoRepository as TelemetryRepo } from './repo/telemetry';
|
|
39
39
|
import { MongoRepository as TransactionRepo } from './repo/transaction';
|
|
@@ -183,6 +183,8 @@ export declare class ServiceOutput extends ServiceOutputRepo {
|
|
|
183
183
|
}
|
|
184
184
|
export declare class ServiceOutputIdentifier extends ServiceOutputIdentifierRepo {
|
|
185
185
|
}
|
|
186
|
+
export declare class StockHolder extends StockHolderRepo {
|
|
187
|
+
}
|
|
186
188
|
export declare class Task extends TaskRepo {
|
|
187
189
|
}
|
|
188
190
|
export declare class Telemetry extends TelemetryRepo {
|
|
@@ -193,10 +195,6 @@ export declare class TransactionNumber extends TransactionNumberRepo {
|
|
|
193
195
|
}
|
|
194
196
|
export declare class Trip extends TripRepo {
|
|
195
197
|
}
|
|
196
|
-
export declare namespace itemAvailability {
|
|
197
|
-
class ScreeningEvent extends ScreeningEventItemAvailabilityRepo {
|
|
198
|
-
}
|
|
199
|
-
}
|
|
200
198
|
export declare namespace rateLimit {
|
|
201
199
|
class Offer extends OfferRateLimitRepo {
|
|
202
200
|
}
|
package/lib/chevre/repository.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.rateLimit = exports.
|
|
3
|
+
exports.rateLimit = exports.Trip = exports.TransactionNumber = exports.Transaction = exports.Telemetry = exports.Task = exports.StockHolder = exports.ServiceOutputIdentifier = exports.ServiceOutput = exports.Seller = exports.Role = exports.Reservation = exports.Project = exports.Product = exports.PriceSpecification = exports.Place = exports.Permit = exports.Person = exports.paymentMethod = exports.OwnershipInfo = exports.OrderNumber = exports.Order = exports.OfferCatalog = exports.Offer = exports.MerchantReturnPolicy = exports.Member = exports.Event = exports.EmailMessage = exports.Customer = exports.CreativeWork = exports.ConfirmationNumber = exports.Comment = exports.Code = exports.CategoryCode = exports.AssetTransaction = exports.action = exports.Aggregation = exports.AdditionalProperty = exports.Action = exports.AccountTransaction = exports.AccountTitle = exports.AccountingReport = exports.Account = void 0;
|
|
4
4
|
// tslint:disable:max-classes-per-file completed-docs
|
|
5
5
|
/**
|
|
6
6
|
* リポジトリ
|
|
@@ -20,7 +20,6 @@ const creativeWork_1 = require("./repo/creativeWork");
|
|
|
20
20
|
const customer_1 = require("./repo/customer");
|
|
21
21
|
const emailMessage_1 = require("./repo/emailMessage");
|
|
22
22
|
const event_1 = require("./repo/event");
|
|
23
|
-
const screeningEvent_1 = require("./repo/itemAvailability/screeningEvent");
|
|
24
23
|
const member_1 = require("./repo/member");
|
|
25
24
|
const merchantReturnPolicy_1 = require("./repo/merchantReturnPolicy");
|
|
26
25
|
const offer_1 = require("./repo/offer");
|
|
@@ -38,6 +37,7 @@ const role_1 = require("./repo/role");
|
|
|
38
37
|
const seller_1 = require("./repo/seller");
|
|
39
38
|
const serviceOutput_1 = require("./repo/serviceOutput");
|
|
40
39
|
const serviceOutputIdentifier_1 = require("./repo/serviceOutputIdentifier");
|
|
40
|
+
const stockHolder_1 = require("./repo/stockHolder");
|
|
41
41
|
const task_1 = require("./repo/task");
|
|
42
42
|
const telemetry_1 = require("./repo/telemetry");
|
|
43
43
|
const transaction_1 = require("./repo/transaction");
|
|
@@ -225,6 +225,9 @@ exports.ServiceOutput = ServiceOutput;
|
|
|
225
225
|
class ServiceOutputIdentifier extends serviceOutputIdentifier_1.RedisRepository {
|
|
226
226
|
}
|
|
227
227
|
exports.ServiceOutputIdentifier = ServiceOutputIdentifier;
|
|
228
|
+
class StockHolder extends stockHolder_1.StockHolderRepository {
|
|
229
|
+
}
|
|
230
|
+
exports.StockHolder = StockHolder;
|
|
228
231
|
class Task extends task_1.MongoRepository {
|
|
229
232
|
}
|
|
230
233
|
exports.Task = Task;
|
|
@@ -240,12 +243,6 @@ exports.TransactionNumber = TransactionNumber;
|
|
|
240
243
|
class Trip extends trip_1.MongoRepository {
|
|
241
244
|
}
|
|
242
245
|
exports.Trip = Trip;
|
|
243
|
-
var itemAvailability;
|
|
244
|
-
(function (itemAvailability) {
|
|
245
|
-
class ScreeningEvent extends screeningEvent_1.RedisRepository {
|
|
246
|
-
}
|
|
247
|
-
itemAvailability.ScreeningEvent = ScreeningEvent;
|
|
248
|
-
})(itemAvailability = exports.itemAvailability || (exports.itemAvailability = {}));
|
|
249
246
|
var rateLimit;
|
|
250
247
|
(function (rateLimit) {
|
|
251
248
|
// tslint:disable-next-line:no-shadowed-variable
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { MongoRepository as EventRepo } from '../../../repo/event';
|
|
2
|
-
import { RedisRepository as EventAvailabilityRepo } from '../../../repo/itemAvailability/screeningEvent';
|
|
3
2
|
import { MongoRepository as OfferRepo } from '../../../repo/offer';
|
|
4
3
|
import { MongoRepository as OfferCatalogRepo } from '../../../repo/offerCatalog';
|
|
5
4
|
import { MongoRepository as PlaceRepo } from '../../../repo/place';
|
|
@@ -7,11 +6,12 @@ import { MongoRepository as ProductRepo } from '../../../repo/product';
|
|
|
7
6
|
import { MongoRepository as ProjectRepo } from '../../../repo/project';
|
|
8
7
|
import { RedisRepository as OfferRateLimitRepo } from '../../../repo/rateLimit/offer';
|
|
9
8
|
import { MongoRepository as ReservationRepo } from '../../../repo/reservation';
|
|
9
|
+
import { StockHolderRepository as StockHolderRepo } from '../../../repo/stockHolder';
|
|
10
10
|
import { MongoRepository as TaskRepo } from '../../../repo/task';
|
|
11
11
|
import * as factory from '../../../factory';
|
|
12
12
|
export type IAggregateScreeningEventOperation<T> = (repos: {
|
|
13
13
|
event: EventRepo;
|
|
14
|
-
|
|
14
|
+
stockHolder: StockHolderRepo;
|
|
15
15
|
offer: OfferRepo;
|
|
16
16
|
offerCatalog: OfferCatalogRepo;
|
|
17
17
|
offerRateLimit: OfferRateLimitRepo;
|
|
@@ -387,13 +387,14 @@ function filterByEligibleSeatingType(params) {
|
|
|
387
387
|
const maximumAttendeeCapacity = eligibleSeatOffers.length;
|
|
388
388
|
let remainingAttendeeCapacity;
|
|
389
389
|
if (maximumAttendeeCapacity > 0) {
|
|
390
|
-
const availabilities = yield repos.
|
|
390
|
+
const availabilities = yield repos.stockHolder.searchHolders({
|
|
391
391
|
eventId: params.event.id,
|
|
392
392
|
startDate: moment(params.event.startDate)
|
|
393
393
|
.toDate(),
|
|
394
394
|
offers: eligibleSeatOffers
|
|
395
395
|
});
|
|
396
|
-
remainingAttendeeCapacity = availabilities.filter((a) => a.availability === factory.itemAvailability.InStock).length;
|
|
396
|
+
// remainingAttendeeCapacity = availabilities.filter((a) => a.availability === factory.itemAvailability.InStock).length;
|
|
397
|
+
remainingAttendeeCapacity = availabilities.filter((holder) => typeof holder !== 'string').length;
|
|
397
398
|
}
|
|
398
399
|
else {
|
|
399
400
|
remainingAttendeeCapacity = 0;
|
|
@@ -438,7 +439,7 @@ function aggregateReservationByEvent(params) {
|
|
|
438
439
|
// remainingAttendeeCapacityを決定
|
|
439
440
|
if (typeof maximumAttendeeCapacity === 'number') {
|
|
440
441
|
// 残席数を座席ロック数から計算
|
|
441
|
-
const unavailableOfferCount = yield repos.
|
|
442
|
+
const unavailableOfferCount = yield repos.stockHolder.countUnavailableOffers({
|
|
442
443
|
event: {
|
|
443
444
|
id: params.event.id,
|
|
444
445
|
startDate: moment(params.event.startDate)
|
|
@@ -2,7 +2,6 @@ import * as factory from '../../factory';
|
|
|
2
2
|
import { MongoRepository as ActionRepo } from '../../repo/action';
|
|
3
3
|
import { MongoRepository as AssetTransactionRepo } from '../../repo/assetTransaction';
|
|
4
4
|
import { IMinimizedIndividualEvent, MongoRepository as EventRepo } from '../../repo/event';
|
|
5
|
-
import { RedisRepository as ScreeningEventAvailabilityRepo } from '../../repo/itemAvailability/screeningEvent';
|
|
6
5
|
import { MongoRepository as OfferRepo } from '../../repo/offer';
|
|
7
6
|
import { MongoRepository as OfferCatalogRepo } from '../../repo/offerCatalog';
|
|
8
7
|
import { MongoRepository as OrderRepo } from '../../repo/order';
|
|
@@ -12,9 +11,10 @@ import { MongoRepository as ProductRepo } from '../../repo/product';
|
|
|
12
11
|
import { MongoRepository as ProjectRepo } from '../../repo/project';
|
|
13
12
|
import { RedisRepository as OfferRateLimitRepo } from '../../repo/rateLimit/offer';
|
|
14
13
|
import { MongoRepository as ReservationRepo } from '../../repo/reservation';
|
|
14
|
+
import { StockHolderRepository as StockHolderRepo } from '../../repo/stockHolder';
|
|
15
15
|
import { MongoRepository as TaskRepo } from '../../repo/task';
|
|
16
16
|
export interface IStartOperationRepos {
|
|
17
|
-
|
|
17
|
+
stockHolder: StockHolderRepo;
|
|
18
18
|
event: EventRepo;
|
|
19
19
|
offer: OfferRepo;
|
|
20
20
|
offerCatalog: OfferCatalogRepo;
|
|
@@ -29,7 +29,7 @@ export interface IStartOperationRepos {
|
|
|
29
29
|
}
|
|
30
30
|
export type IStartOperation<T> = (repos: IStartOperationRepos) => Promise<T>;
|
|
31
31
|
export interface IAddReservationsOperationRepos {
|
|
32
|
-
|
|
32
|
+
stockHolder: StockHolderRepo;
|
|
33
33
|
event: EventRepo;
|
|
34
34
|
offer: OfferRepo;
|
|
35
35
|
offerCatalog: OfferCatalogRepo;
|
|
@@ -44,7 +44,7 @@ export interface IAddReservationsOperationRepos {
|
|
|
44
44
|
export type IAddReservationsOperation<T> = (repos: IAddReservationsOperationRepos) => Promise<T>;
|
|
45
45
|
export type ICancelOperation<T> = (repos: {
|
|
46
46
|
action: ActionRepo;
|
|
47
|
-
|
|
47
|
+
stockHolder: StockHolderRepo;
|
|
48
48
|
offerRateLimit: OfferRateLimitRepo;
|
|
49
49
|
reservation: ReservationRepo;
|
|
50
50
|
task: TaskRepo;
|
|
@@ -209,7 +209,7 @@ function searchEventSeatOffers(params) {
|
|
|
209
209
|
$projection: params.$projection
|
|
210
210
|
});
|
|
211
211
|
if (seats.length > 0) {
|
|
212
|
-
const availabilities = yield repos.
|
|
212
|
+
const availabilities = yield repos.stockHolder.searchHolders({
|
|
213
213
|
eventId: params.event.id,
|
|
214
214
|
startDate: moment(params.event.startDate)
|
|
215
215
|
.toDate(),
|
|
@@ -225,7 +225,10 @@ function searchEventSeatOffers(params) {
|
|
|
225
225
|
return OfferService.addOffers2Seat({
|
|
226
226
|
seat,
|
|
227
227
|
// unavailableOffers: [],
|
|
228
|
-
availability: availabilities[index].availability,
|
|
228
|
+
// availability: availabilities[index].availability,
|
|
229
|
+
availability: (typeof availabilities[index] === 'string')
|
|
230
|
+
? factory.itemAvailability.OutOfStock // ホルダーが存在すればOutOfStock
|
|
231
|
+
: factory.itemAvailability.InStock,
|
|
229
232
|
priceSpecs
|
|
230
233
|
});
|
|
231
234
|
});
|
|
@@ -638,7 +641,7 @@ function processLockSeats(params) {
|
|
|
638
641
|
const holder = params.transaction.id;
|
|
639
642
|
const maximumAttendeeCapacity4event = (_a = params.event.location) === null || _a === void 0 ? void 0 : _a.maximumAttendeeCapacity;
|
|
640
643
|
if (typeof maximumAttendeeCapacity4event === 'number') {
|
|
641
|
-
yield repos.
|
|
644
|
+
yield repos.stockHolder.lockIfNotLimitExceeded({
|
|
642
645
|
eventId: params.event.id,
|
|
643
646
|
startDate: moment(params.event.startDate)
|
|
644
647
|
.toDate(),
|
|
@@ -648,7 +651,7 @@ function processLockSeats(params) {
|
|
|
648
651
|
}, maximumAttendeeCapacity4event);
|
|
649
652
|
}
|
|
650
653
|
else {
|
|
651
|
-
yield repos.
|
|
654
|
+
yield repos.stockHolder.lock({
|
|
652
655
|
eventId: params.event.id,
|
|
653
656
|
startDate: moment(params.event.startDate)
|
|
654
657
|
.toDate(),
|
|
@@ -2,7 +2,6 @@ import * as factory from '../../../factory';
|
|
|
2
2
|
import { MongoRepository as ActionRepo } from '../../../repo/action';
|
|
3
3
|
import { MongoRepository as AssetTransactionRepo } from '../../../repo/assetTransaction';
|
|
4
4
|
import { MongoRepository as EventRepo } from '../../../repo/event';
|
|
5
|
-
import { RedisRepository as ScreeningEventAvailabilityRepo } from '../../../repo/itemAvailability/screeningEvent';
|
|
6
5
|
import { MongoRepository as OfferRepo } from '../../../repo/offer';
|
|
7
6
|
import { MongoRepository as OfferCatalogRepo } from '../../../repo/offerCatalog';
|
|
8
7
|
import { MongoRepository as PlaceRepo } from '../../../repo/place';
|
|
@@ -11,6 +10,7 @@ import { MongoRepository as ProductRepo } from '../../../repo/product';
|
|
|
11
10
|
import { MongoRepository as ProjectRepo } from '../../../repo/project';
|
|
12
11
|
import { RedisRepository as OfferRateLimitRepo } from '../../../repo/rateLimit/offer';
|
|
13
12
|
import { MongoRepository as ReservationRepo } from '../../../repo/reservation';
|
|
13
|
+
import { StockHolderRepository as StockHolderRepo } from '../../../repo/stockHolder';
|
|
14
14
|
import { MongoRepository as TaskRepo } from '../../../repo/task';
|
|
15
15
|
import { MongoRepository as TransactionRepo } from '../../../repo/transaction';
|
|
16
16
|
import { RedisRepository as TransactionNumberRepo } from '../../../repo/transactionNumber';
|
|
@@ -19,7 +19,7 @@ interface IAuthorizeRepos {
|
|
|
19
19
|
action: ActionRepo;
|
|
20
20
|
assetTransaction: AssetTransactionRepo;
|
|
21
21
|
event: EventRepo;
|
|
22
|
-
|
|
22
|
+
stockHolder: StockHolderRepo;
|
|
23
23
|
offer: OfferRepo;
|
|
24
24
|
offerCatalog: OfferCatalogRepo;
|
|
25
25
|
offerRateLimit: OfferRateLimitRepo;
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import * as factory from '../../../factory';
|
|
2
2
|
import { MongoRepository as ActionRepo } from '../../../repo/action';
|
|
3
3
|
import { MongoRepository as AssetTransactionRepo } from '../../../repo/assetTransaction';
|
|
4
|
-
import { RedisRepository as ScreeningEventAvailabilityRepo } from '../../../repo/itemAvailability/screeningEvent';
|
|
5
4
|
import { RedisRepository as OfferRateLimitRepo } from '../../../repo/rateLimit/offer';
|
|
6
5
|
import { MongoRepository as ReservationRepo } from '../../../repo/reservation';
|
|
6
|
+
import { StockHolderRepository as StockHolderRepo } from '../../../repo/stockHolder';
|
|
7
7
|
import { MongoRepository as TaskRepo } from '../../../repo/task';
|
|
8
8
|
import { MongoRepository as TransactionRepo } from '../../../repo/transaction';
|
|
9
9
|
interface ICancelRepos {
|
|
10
10
|
action: ActionRepo;
|
|
11
11
|
assetTransaction: AssetTransactionRepo;
|
|
12
|
-
|
|
12
|
+
stockHolder: StockHolderRepo;
|
|
13
13
|
offerRateLimit: OfferRateLimitRepo;
|
|
14
14
|
reservation: ReservationRepo;
|
|
15
15
|
task: TaskRepo;
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import * as factory from '../../../factory';
|
|
2
2
|
import { MongoRepository as ActionRepo } from '../../../repo/action';
|
|
3
3
|
import { MongoRepository as AssetTransactionRepo } from '../../../repo/assetTransaction';
|
|
4
|
-
import { RedisRepository as ScreeningEventAvailabilityRepo } from '../../../repo/itemAvailability/screeningEvent';
|
|
5
4
|
import { RedisRepository as OfferRateLimitRepo } from '../../../repo/rateLimit/offer';
|
|
6
5
|
import { MongoRepository as ReservationRepo } from '../../../repo/reservation';
|
|
6
|
+
import { StockHolderRepository as StockHolderRepo } from '../../../repo/stockHolder';
|
|
7
7
|
import { MongoRepository as TaskRepo } from '../../../repo/task';
|
|
8
8
|
export import WebAPIIdentifier = factory.service.webAPI.Identifier;
|
|
9
9
|
interface IVoidTransactionRepos {
|
|
10
10
|
action: ActionRepo;
|
|
11
11
|
assetTransaction: AssetTransactionRepo;
|
|
12
|
-
|
|
12
|
+
stockHolder: StockHolderRepo;
|
|
13
13
|
offerRateLimit: OfferRateLimitRepo;
|
|
14
14
|
reservation: ReservationRepo;
|
|
15
15
|
task: TaskRepo;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { MongoRepository as EventRepo } from '../repo/event';
|
|
2
|
-
import { RedisRepository as EventAvailabilityRepo } from '../repo/itemAvailability/screeningEvent';
|
|
3
2
|
import { MongoRepository as PlaceRepo } from '../repo/place';
|
|
4
3
|
import { MongoRepository as PriceSpecificationRepo } from '../repo/priceSpecification';
|
|
5
4
|
import { MongoRepository as ProjectRepo } from '../repo/project';
|
|
5
|
+
import { StockHolderRepository as StockHolderRepo } from '../repo/stockHolder';
|
|
6
6
|
import { MongoRepository as TaskRepo } from '../repo/task';
|
|
7
7
|
import * as factory from '../factory';
|
|
8
8
|
import * as EventOfferService from './offer/event';
|
|
@@ -44,7 +44,7 @@ export declare function searchEventSeatOffersWithPaging(params: {
|
|
|
44
44
|
}): (repos: {
|
|
45
45
|
event: EventRepo;
|
|
46
46
|
priceSpecification: PriceSpecificationRepo;
|
|
47
|
-
|
|
47
|
+
stockHolder: StockHolderRepo;
|
|
48
48
|
place: PlaceRepo;
|
|
49
49
|
}) => Promise<factory.place.seat.IPlaceWithOffer[]>;
|
|
50
50
|
interface IChangedEvent {
|
|
@@ -88,7 +88,7 @@ function searchEventSeatOffersWithPaging(params) {
|
|
|
88
88
|
}
|
|
89
89
|
} }));
|
|
90
90
|
if (seats.length > 0) {
|
|
91
|
-
const availabilities = yield repos.
|
|
91
|
+
const availabilities = yield repos.stockHolder.searchHolders({
|
|
92
92
|
eventId: params.event.id,
|
|
93
93
|
startDate: moment(event.startDate)
|
|
94
94
|
.toDate(),
|
|
@@ -104,7 +104,10 @@ function searchEventSeatOffersWithPaging(params) {
|
|
|
104
104
|
return addOffers2Seat({
|
|
105
105
|
seat,
|
|
106
106
|
// unavailableOffers: [],
|
|
107
|
-
availability: availabilities[index].availability,
|
|
107
|
+
// availability: availabilities[index].availability,
|
|
108
|
+
availability: (typeof availabilities[index] === 'string')
|
|
109
|
+
? factory.itemAvailability.OutOfStock // ホルダーが存在すればOutOfStock
|
|
110
|
+
: factory.itemAvailability.InStock,
|
|
108
111
|
priceSpecs
|
|
109
112
|
});
|
|
110
113
|
});
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import * as factory from '../../factory';
|
|
2
2
|
import { MongoRepository as ActionRepo } from '../../repo/action';
|
|
3
3
|
import { MongoRepository as AssetTransactionRepo } from '../../repo/assetTransaction';
|
|
4
|
-
import { RedisRepository as ScreeningEventAvailabilityRepo } from '../../repo/itemAvailability/screeningEvent';
|
|
5
4
|
import { RedisRepository as OfferRateLimitRepo } from '../../repo/rateLimit/offer';
|
|
6
5
|
import { MongoRepository as ReservationRepo } from '../../repo/reservation';
|
|
6
|
+
import { StockHolderRepository as StockHolderRepo } from '../../repo/stockHolder';
|
|
7
7
|
import { MongoRepository as TaskRepo } from '../../repo/task';
|
|
8
8
|
type IObjectSubReservation = factory.assetTransaction.reserve.IObjectSubReservation;
|
|
9
9
|
/**
|
|
@@ -12,7 +12,7 @@ type IObjectSubReservation = factory.assetTransaction.reserve.IObjectSubReservat
|
|
|
12
12
|
declare function cancelPendingReservation(actionAttributesList: factory.action.cancel.reservation.IAttributes[]): (repos: {
|
|
13
13
|
action: ActionRepo;
|
|
14
14
|
assetTransaction: AssetTransactionRepo;
|
|
15
|
-
|
|
15
|
+
stockHolder: StockHolderRepo;
|
|
16
16
|
offerRateLimit: OfferRateLimitRepo;
|
|
17
17
|
reservation: ReservationRepo;
|
|
18
18
|
task: TaskRepo;
|
|
@@ -22,7 +22,7 @@ declare function cancelPendingReservation(actionAttributesList: factory.action.c
|
|
|
22
22
|
*/
|
|
23
23
|
declare function cancelReservation(actionAttributesList: factory.action.cancel.reservation.IAttributes[]): (repos: {
|
|
24
24
|
action: ActionRepo;
|
|
25
|
-
|
|
25
|
+
stockHolder: StockHolderRepo;
|
|
26
26
|
offerRateLimit: OfferRateLimitRepo;
|
|
27
27
|
reservation: ReservationRepo;
|
|
28
28
|
task: TaskRepo;
|
|
@@ -344,9 +344,9 @@ function processUnlockSeat(params) {
|
|
|
344
344
|
seatSection: ''
|
|
345
345
|
}
|
|
346
346
|
};
|
|
347
|
-
let holder = yield repos.
|
|
347
|
+
let holder = yield repos.stockHolder.getHolder(lockKey);
|
|
348
348
|
if (holder === params.expectedHolder) {
|
|
349
|
-
yield repos.
|
|
349
|
+
yield repos.stockHolder.unlock(lockKey);
|
|
350
350
|
}
|
|
351
351
|
// 予約取引がまだ座席を保持していれば座席ロック解除
|
|
352
352
|
const ticketedSeat = reservation.reservedTicket.ticketedSeat;
|
|
@@ -359,9 +359,9 @@ function processUnlockSeat(params) {
|
|
|
359
359
|
seatSection: ticketedSeat.seatSection
|
|
360
360
|
}
|
|
361
361
|
};
|
|
362
|
-
holder = yield repos.
|
|
362
|
+
holder = yield repos.stockHolder.getHolder(lockKey);
|
|
363
363
|
if (holder === params.expectedHolder) {
|
|
364
|
-
yield repos.
|
|
364
|
+
yield repos.stockHolder.unlock(lockKey);
|
|
365
365
|
}
|
|
366
366
|
}
|
|
367
367
|
// subReservationがあれば、そちらも解除(順不同)
|
|
@@ -380,9 +380,9 @@ function processUnlockSeat(params) {
|
|
|
380
380
|
seatSection: seatSection4sub
|
|
381
381
|
}
|
|
382
382
|
};
|
|
383
|
-
const holder4sub = yield repos.
|
|
383
|
+
const holder4sub = yield repos.stockHolder.getHolder(lockKey4sub);
|
|
384
384
|
if (holder4sub === params.expectedHolder) {
|
|
385
|
-
yield repos.
|
|
385
|
+
yield repos.stockHolder.unlock(lockKey4sub);
|
|
386
386
|
}
|
|
387
387
|
}
|
|
388
388
|
})));
|
|
@@ -12,7 +12,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
12
12
|
exports.call = void 0;
|
|
13
13
|
const factory = require("../../factory");
|
|
14
14
|
const event_1 = require("../../repo/event");
|
|
15
|
-
const screeningEvent_1 = require("../../repo/itemAvailability/screeningEvent");
|
|
16
15
|
const offer_1 = require("../../repo/offer");
|
|
17
16
|
const offerCatalog_1 = require("../../repo/offerCatalog");
|
|
18
17
|
const place_1 = require("../../repo/place");
|
|
@@ -20,6 +19,7 @@ const product_1 = require("../../repo/product");
|
|
|
20
19
|
const project_1 = require("../../repo/project");
|
|
21
20
|
const offer_2 = require("../../repo/rateLimit/offer");
|
|
22
21
|
const reservation_1 = require("../../repo/reservation");
|
|
22
|
+
const stockHolder_1 = require("../../repo/stockHolder");
|
|
23
23
|
const task_1 = require("../../repo/task");
|
|
24
24
|
const AggregationService = require("../aggregation");
|
|
25
25
|
/**
|
|
@@ -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
|
-
|
|
35
|
+
stockHolder: new stockHolder_1.StockHolderRepository(settings.redisClient),
|
|
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),
|
|
@@ -13,9 +13,9 @@ exports.call = void 0;
|
|
|
13
13
|
const factory = require("../../factory");
|
|
14
14
|
const action_1 = require("../../repo/action");
|
|
15
15
|
const assetTransaction_1 = require("../../repo/assetTransaction");
|
|
16
|
-
const screeningEvent_1 = require("../../repo/itemAvailability/screeningEvent");
|
|
17
16
|
const offer_1 = require("../../repo/rateLimit/offer");
|
|
18
17
|
const reservation_1 = require("../../repo/reservation");
|
|
18
|
+
const stockHolder_1 = require("../../repo/stockHolder");
|
|
19
19
|
const task_1 = require("../../repo/task");
|
|
20
20
|
const ReserveService = require("../reserve");
|
|
21
21
|
/**
|
|
@@ -30,12 +30,12 @@ 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
|
|
33
|
+
const stockHolderRepo = new stockHolder_1.StockHolderRepository(settings.redisClient);
|
|
34
34
|
const offerRateLimitRepo = new offer_1.RedisRepository(settings.redisClient);
|
|
35
35
|
yield ReserveService.cancelPendingReservation(data.actionAttributes)({
|
|
36
36
|
action: actionRepo,
|
|
37
37
|
assetTransaction: assetTransactionRepo,
|
|
38
|
-
|
|
38
|
+
stockHolder: stockHolderRepo,
|
|
39
39
|
offerRateLimit: offerRateLimitRepo,
|
|
40
40
|
reservation: reservationRepo,
|
|
41
41
|
task: taskRepo
|
|
@@ -13,9 +13,9 @@ exports.call = void 0;
|
|
|
13
13
|
const factory = require("../../factory");
|
|
14
14
|
const action_1 = require("../../repo/action");
|
|
15
15
|
const assetTransaction_1 = require("../../repo/assetTransaction");
|
|
16
|
-
const screeningEvent_1 = require("../../repo/itemAvailability/screeningEvent");
|
|
17
16
|
const offer_1 = require("../../repo/rateLimit/offer");
|
|
18
17
|
const reservation_1 = require("../../repo/reservation");
|
|
18
|
+
const stockHolder_1 = require("../../repo/stockHolder");
|
|
19
19
|
const task_1 = require("../../repo/task");
|
|
20
20
|
const ReserveService = require("../reserve");
|
|
21
21
|
/**
|
|
@@ -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
|
|
33
|
+
const stockHolderRepo = new stockHolder_1.StockHolderRepository(settings.redisClient);
|
|
34
34
|
const offerRateLimitRepo = new offer_1.RedisRepository(settings.redisClient);
|
|
35
35
|
yield ReserveService.cancelReservation(data.actionAttributes)({
|
|
36
36
|
action: actionRepo,
|
|
@@ -38,7 +38,7 @@ function call(data) {
|
|
|
38
38
|
task: taskRepo,
|
|
39
39
|
assetTransaction: transactionRepo,
|
|
40
40
|
offerRateLimit: offerRateLimitRepo,
|
|
41
|
-
|
|
41
|
+
stockHolder: stockHolderRepo
|
|
42
42
|
});
|
|
43
43
|
});
|
|
44
44
|
}
|
|
@@ -13,9 +13,9 @@ exports.call = void 0;
|
|
|
13
13
|
const factory = require("../../factory");
|
|
14
14
|
const action_1 = require("../../repo/action");
|
|
15
15
|
const assetTransaction_1 = require("../../repo/assetTransaction");
|
|
16
|
-
const screeningEvent_1 = require("../../repo/itemAvailability/screeningEvent");
|
|
17
16
|
const offer_1 = require("../../repo/rateLimit/offer");
|
|
18
17
|
const reservation_1 = require("../../repo/reservation");
|
|
18
|
+
const stockHolder_1 = require("../../repo/stockHolder");
|
|
19
19
|
const task_1 = require("../../repo/task");
|
|
20
20
|
const EventOfferService = require("../offer/event");
|
|
21
21
|
/**
|
|
@@ -28,14 +28,14 @@ function call(data) {
|
|
|
28
28
|
}
|
|
29
29
|
const actionRepo = new action_1.MongoRepository(settings.connection);
|
|
30
30
|
const assetTransactionRepo = new assetTransaction_1.MongoRepository(settings.connection);
|
|
31
|
-
const
|
|
31
|
+
const stockHolderRepo = new stockHolder_1.StockHolderRepository(settings.redisClient);
|
|
32
32
|
const offerRateLimitRepo = new offer_1.RedisRepository(settings.redisClient);
|
|
33
33
|
const reservationRepo = new reservation_1.MongoRepository(settings.connection);
|
|
34
34
|
const taskRepo = new task_1.MongoRepository(settings.connection);
|
|
35
35
|
yield EventOfferService.voidTransaction(data)({
|
|
36
36
|
action: actionRepo,
|
|
37
37
|
assetTransaction: assetTransactionRepo,
|
|
38
|
-
|
|
38
|
+
stockHolder: stockHolderRepo,
|
|
39
39
|
offerRateLimit: offerRateLimitRepo,
|
|
40
40
|
reservation: reservationRepo,
|
|
41
41
|
task: taskRepo
|
package/lib/chevre/settings.d.ts
CHANGED
|
@@ -30,6 +30,7 @@ export declare const DEFAULT_PAYMENT_METHOD_TYPE_FOR_CREDIT_CARD: string;
|
|
|
30
30
|
export declare const USE_ASSET_TRANSACTION_SYNC_PROCESSING: boolean;
|
|
31
31
|
export declare const USE_PAY_ASSET_TRANSACTION_SYNC_PROCESSING: boolean;
|
|
32
32
|
export declare const USE_NEW_EVENT_AVAILABILITY_KEY_FROM: moment.Moment;
|
|
33
|
+
export declare const USE_NEW_CONFIRMATION_NUMBER_KEY_FROM: moment.Moment;
|
|
33
34
|
export declare const USE_NEW_ORDER_NUMBER_KEY_FROM: moment.Moment;
|
|
34
35
|
/**
|
|
35
36
|
* グローバル設定
|
package/lib/chevre/settings.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
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;
|
|
3
|
+
exports.settings = exports.USE_NEW_ORDER_NUMBER_KEY_FROM = exports.USE_NEW_CONFIRMATION_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
4
|
const moment = require("moment");
|
|
5
5
|
const factory = require("./factory");
|
|
6
6
|
const transactionWebhookUrls = (typeof process.env.INFORM_TRANSACTION_URL === 'string')
|
|
@@ -49,9 +49,12 @@ exports.USE_PAY_ASSET_TRANSACTION_SYNC_PROCESSING = process.env.USE_PAY_ASSET_TR
|
|
|
49
49
|
exports.USE_NEW_EVENT_AVAILABILITY_KEY_FROM = (typeof process.env.USE_NEW_EVENT_AVAILABILITY_KEY_FROM === 'string')
|
|
50
50
|
? moment(process.env.USE_NEW_EVENT_AVAILABILITY_KEY_FROM)
|
|
51
51
|
: moment('2023-07-23T15:00:00Z');
|
|
52
|
+
exports.USE_NEW_CONFIRMATION_NUMBER_KEY_FROM = (typeof process.env.USE_NEW_CONFIRMATION_NUMBER_KEY_FROM === 'string')
|
|
53
|
+
? moment(process.env.USE_NEW_CONFIRMATION_NUMBER_KEY_FROM)
|
|
54
|
+
: moment('2023-04-30T15:00:00Z');
|
|
52
55
|
exports.USE_NEW_ORDER_NUMBER_KEY_FROM = (typeof process.env.USE_NEW_ORDER_NUMBER_KEY_FROM === 'string')
|
|
53
56
|
? moment(process.env.USE_NEW_ORDER_NUMBER_KEY_FROM)
|
|
54
|
-
: moment('2023-04-
|
|
57
|
+
: moment('2023-04-18T15:00:00Z');
|
|
55
58
|
/**
|
|
56
59
|
* グローバル設定
|
|
57
60
|
*/
|
package/package.json
CHANGED