@chevre/domain 22.10.0-alpha.8 → 22.10.0
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/adminIdentities.ts +8 -8
- package/example/src/chevre/assetTransaction/processReserve.ts +4 -1
- package/example/src/chevre/concurrentLock/lockOfferRateLimit.ts +64 -0
- package/example/src/chevre/concurrentLock/lockTransactionProcess.ts +44 -0
- package/example/src/chevre/createTaskIfNotExistByAlternateName.ts +1 -1
- package/example/src/chevre/findOneAvailableHours.ts +39 -0
- package/example/src/chevre/identity/getCommonClients.ts +126 -0
- package/example/src/chevre/identity/migrateClients2oauth.ts +200 -0
- package/example/src/chevre/issuer/adminMemberProgramTiers.ts +55 -0
- package/example/src/chevre/maintenance/checkTransactionStatuses.ts +105 -0
- package/example/src/chevre/migrateIdentities.ts +24 -37
- package/example/src/chevre/reIndex.ts +1 -1
- package/example/src/chevre/roles/addPermissionIfNotExists.ts +27 -0
- package/example/src/chevre/roles/addRoleMembers.ts +75 -0
- package/example/src/chevre/saveWebSite.ts +14 -17
- package/example/src/chevre/stockHolder/checkRedisKeyCount.ts +43 -22
- package/example/src/chevre/transactionNumber/publishConfimationNumber.ts +37 -0
- package/example/src/chevre/transactionNumber/publishOrderNumber.ts +40 -0
- package/example/src/chevre/transactionNumber/setUseMongo4confirmationNumberFrom.ts +45 -0
- package/example/src/chevre/transactionNumber/setUseMongo4orderNumberFrom.ts +41 -0
- package/example/src/chevre/transactionNumber/setUseMongo4transactionNumberFrom.ts +41 -0
- package/example/src/redisMulti.ts +63 -0
- package/example/src/signPayload.ts +1 -1
- package/lib/chevre/eventEmitter/task.d.ts +36 -6
- package/lib/chevre/eventEmitter/task.js +5 -4
- package/lib/chevre/eventEmitter.d.ts +2 -2
- package/lib/chevre/eventEmitter.js +2 -2
- package/lib/chevre/repo/concurrentLock.d.ts +14 -0
- package/lib/chevre/repo/concurrentLock.js +48 -0
- package/lib/chevre/repo/concurrentLockAbstract.d.ts +42 -0
- package/lib/chevre/repo/concurrentLockAbstract.js +9 -0
- package/lib/chevre/repo/confirmationNumber.d.ts +17 -4
- package/lib/chevre/repo/confirmationNumber.js +89 -32
- package/lib/chevre/repo/identity.d.ts +42 -5
- package/lib/chevre/repo/identity.js +35 -4
- package/lib/chevre/repo/issuer.d.ts +10 -2
- package/lib/chevre/repo/member.js +2 -2
- package/lib/chevre/repo/memberProgram.d.ts +43 -2
- package/lib/chevre/repo/memberProgram.js +79 -8
- package/lib/chevre/repo/mongoose/schemas/issuer.d.ts +3 -1
- package/lib/chevre/repo/mongoose/schemas/issuer.js +10 -0
- package/lib/chevre/repo/mongoose/schemas/offer/event.js +30 -2
- package/lib/chevre/repo/mongoose/schemas/role.d.ts +2 -3
- package/lib/chevre/repo/mongoose/schemas/role.js +11 -1
- package/lib/chevre/repo/mongoose/schemas/service/availableHour.d.ts +18 -0
- package/lib/chevre/repo/mongoose/schemas/service/availableHour.js +65 -0
- package/lib/chevre/repo/mongoose/schemas/setting.d.ts +3 -0
- package/lib/chevre/repo/mongoose/schemas/setting.js +4 -1
- package/lib/chevre/repo/mongoose/schemas/transactionNumber.d.ts +39 -0
- package/lib/chevre/repo/mongoose/schemas/transactionNumber.js +101 -0
- package/lib/chevre/repo/orderNumber.d.ts +15 -4
- package/lib/chevre/repo/orderNumber.js +71 -24
- package/lib/chevre/repo/passport.d.ts +1 -1
- package/lib/chevre/repo/passport.js +31 -13
- package/lib/chevre/repo/rateLimit/offer.d.ts +7 -2
- package/lib/chevre/repo/rateLimit/offer.js +41 -40
- package/lib/chevre/repo/role.d.ts +18 -4
- package/lib/chevre/repo/role.js +53 -4
- package/lib/chevre/repo/service/availableHour.d.ts +15 -0
- package/lib/chevre/repo/service/availableHour.js +53 -0
- package/lib/chevre/repo/serviceOutputIdentifier.d.ts +8 -4
- package/lib/chevre/repo/serviceOutputIdentifier.js +54 -22
- package/lib/chevre/repo/stockHolder.d.ts +0 -2
- package/lib/chevre/repo/stockHolder.js +24 -31
- package/lib/chevre/repo/task.d.ts +10 -25
- package/lib/chevre/repo/task.js +65 -36
- package/lib/chevre/repo/transactionNumber.d.ts +15 -4
- package/lib/chevre/repo/transactionNumber.js +67 -22
- package/lib/chevre/repo/transactionNumberCounter.d.ts +28 -0
- package/lib/chevre/repo/transactionNumberCounter.js +128 -0
- package/lib/chevre/repo/transactionProcess.d.ts +7 -4
- package/lib/chevre/repo/transactionProcess.js +34 -13
- package/lib/chevre/repository.d.ts +5 -0
- package/lib/chevre/repository.js +14 -1
- package/lib/chevre/service/aggregation/event/aggregateOffers.js +1 -0
- package/lib/chevre/service/assetTransaction/reserve/start.js +9 -1
- package/lib/chevre/service/assetTransaction/reserve/validateStartRequest.js +1 -1
- package/lib/chevre/service/code.js +1 -1
- package/lib/chevre/service/offer/event/checkAvailability.d.ts +1 -1
- package/lib/chevre/service/offer/event/checkAvailability.js +1 -0
- package/lib/chevre/service/offer/product.js +0 -40
- package/lib/chevre/service/payment/any.d.ts +0 -2
- package/lib/chevre/service/payment/any.js +1 -0
- package/lib/chevre/service/reserve/cancelReservation.d.ts +3 -0
- package/lib/chevre/service/reserve/cancelReservation.js +5 -1
- package/lib/chevre/service/task/acceptCOAOffer.js +2 -2
- package/lib/chevre/service/task/authorizePayment.js +4 -4
- package/lib/chevre/service/task/givePointAward.js +1 -1
- package/lib/chevre/service/task/moneyTransfer.js +1 -1
- package/lib/chevre/service/task/publishPaymentUrl.js +2 -2
- package/lib/chevre/service/task/refund.js +1 -1
- package/lib/chevre/service/task/returnMoneyTransfer.js +1 -1
- package/lib/chevre/service/task/returnPayTransaction.js +1 -1
- package/lib/chevre/service/task/returnPointAward.js +1 -1
- package/lib/chevre/service/task/returnReserveTransaction.js +1 -1
- package/lib/chevre/service/task.d.ts +8 -17
- package/lib/chevre/service/task.js +14 -5
- package/lib/chevre/service/transaction/placeOrder/start/validateStartRequest.js +2 -2
- package/lib/chevre/service/transaction/returnOrder/preStart/factory.d.ts +20 -0
- package/lib/chevre/service/transaction/returnOrder/preStart/factory.js +2 -0
- package/lib/chevre/service/transaction/returnOrder/preStart/findApplicableReturnPolicy.d.ts +23 -0
- package/lib/chevre/service/transaction/returnOrder/preStart/findApplicableReturnPolicy.js +323 -0
- package/lib/chevre/service/transaction/returnOrder/preStart/getReturnPolicyByProject.d.ts +13 -0
- package/lib/chevre/service/transaction/returnOrder/preStart/getReturnPolicyByProject.js +132 -0
- package/lib/chevre/service/transaction/returnOrder/preStart.js +2 -391
- package/package.json +3 -3
- package/example/src/chevre/migrateMembers2identities.ts +0 -109
- package/example/src/chevre/publishConfimationNumber.ts +0 -27
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.TransactionNumberCounterRepo = void 0;
|
|
13
|
+
const errorHandler_1 = require("../errorHandler");
|
|
14
|
+
const factory = require("../factory");
|
|
15
|
+
const transactionNumber_1 = require("./mongoose/schemas/transactionNumber");
|
|
16
|
+
const MAX_RETRY_INCREMENT = 1;
|
|
17
|
+
/**
|
|
18
|
+
* 取引番号カウンターリポジトリ
|
|
19
|
+
*/
|
|
20
|
+
class TransactionNumberCounterRepo {
|
|
21
|
+
constructor(params) {
|
|
22
|
+
const { redisClient, connection } = params;
|
|
23
|
+
this.redisClient = redisClient;
|
|
24
|
+
this.transactionNumberModel = connection.model(transactionNumber_1.modelName, (0, transactionNumber_1.createSchema)());
|
|
25
|
+
}
|
|
26
|
+
incrementByRedis(params) {
|
|
27
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
28
|
+
// const now = moment();
|
|
29
|
+
const { expires } = params;
|
|
30
|
+
const key = `${params.includedInDataCatalog.identifier}:${params.identifier}`;
|
|
31
|
+
// const TTL = moment(expires)
|
|
32
|
+
// .diff(now, 'seconds');
|
|
33
|
+
const [incrReply, expireAtReply] = yield this.redisClient.multi()
|
|
34
|
+
.incr(key)
|
|
35
|
+
// .expire(key, TTL)
|
|
36
|
+
.expireAt(key, expires)
|
|
37
|
+
.exec();
|
|
38
|
+
// tslint:disable-next-line:no-single-line-block-comment
|
|
39
|
+
/* istanbul ignore else: please write tests */
|
|
40
|
+
if (typeof incrReply !== 'number') {
|
|
41
|
+
// 基本的にありえないフロー
|
|
42
|
+
throw new factory.errors.Internal('transaction number not incremented unexpectedly');
|
|
43
|
+
}
|
|
44
|
+
// expireAtReplyの検証も追加する(2023-04-19~)
|
|
45
|
+
const expiredSet = expireAtReply === 1 || expireAtReply === true;
|
|
46
|
+
if (!expiredSet) {
|
|
47
|
+
// 基本的にありえないフロー
|
|
48
|
+
throw new factory.errors.Internal('transaction number expiration not set unexpectedly');
|
|
49
|
+
}
|
|
50
|
+
return incrReply;
|
|
51
|
+
});
|
|
52
|
+
}
|
|
53
|
+
incrementByMongo(params) {
|
|
54
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
55
|
+
var _a;
|
|
56
|
+
const now = new Date();
|
|
57
|
+
const dataFeedExpires = params.expires;
|
|
58
|
+
const dataFeedIdentifier = params.identifier;
|
|
59
|
+
const dataFeed = {
|
|
60
|
+
typeOf: 'DataFeed',
|
|
61
|
+
includedInDataCatalog: {
|
|
62
|
+
identifier: params.includedInDataCatalog.identifier,
|
|
63
|
+
typeOf: 'DataCatalog'
|
|
64
|
+
},
|
|
65
|
+
dateCreated: now,
|
|
66
|
+
expires: dataFeedExpires,
|
|
67
|
+
identifier: dataFeedIdentifier,
|
|
68
|
+
interactionStatistic: {
|
|
69
|
+
typeOf: 'InteractionCounter',
|
|
70
|
+
userInteractionCount: 0
|
|
71
|
+
},
|
|
72
|
+
project: { id: '*', typeOf: factory.organizationType.Project }
|
|
73
|
+
};
|
|
74
|
+
const { typeOf, includedInDataCatalog, dateCreated, expires, identifier, project, interactionStatistic } = dataFeed;
|
|
75
|
+
let doc;
|
|
76
|
+
let retryCount = 0;
|
|
77
|
+
while (retryCount <= MAX_RETRY_INCREMENT) {
|
|
78
|
+
try {
|
|
79
|
+
doc = yield this.transactionNumberModel.findOneAndUpdate({
|
|
80
|
+
'project.id': { $eq: dataFeed.project.id },
|
|
81
|
+
'includedInDataCatalog.identifier': { $eq: dataFeed.includedInDataCatalog.identifier },
|
|
82
|
+
identifier: { $eq: dataFeed.identifier }
|
|
83
|
+
}, {
|
|
84
|
+
$set: {
|
|
85
|
+
dateModified: now
|
|
86
|
+
},
|
|
87
|
+
$setOnInsert: {
|
|
88
|
+
typeOf, includedInDataCatalog, dateCreated, expires, identifier, project,
|
|
89
|
+
'interactionStatistic.typeOf': interactionStatistic.typeOf
|
|
90
|
+
},
|
|
91
|
+
$inc: {
|
|
92
|
+
'interactionStatistic.userInteractionCount': 1
|
|
93
|
+
}
|
|
94
|
+
}, {
|
|
95
|
+
upsert: true,
|
|
96
|
+
new: true,
|
|
97
|
+
projection: { _id: 0, interactionStatistic: 1 }
|
|
98
|
+
})
|
|
99
|
+
.lean()
|
|
100
|
+
.exec();
|
|
101
|
+
break;
|
|
102
|
+
}
|
|
103
|
+
catch (error) {
|
|
104
|
+
if (yield (0, errorHandler_1.isMongoError)(error)) {
|
|
105
|
+
if (error.code === errorHandler_1.MongoErrorCode.DuplicateKey) {
|
|
106
|
+
// すでに存在するので、リトライすればincrementに成功するはず
|
|
107
|
+
retryCount += 1;
|
|
108
|
+
continue;
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
throw error;
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
if (doc === undefined) {
|
|
115
|
+
throw new factory.errors.NotFound('DataFeed');
|
|
116
|
+
}
|
|
117
|
+
const incrReply = (_a = doc.interactionStatistic) === null || _a === void 0 ? void 0 : _a.userInteractionCount;
|
|
118
|
+
// tslint:disable-next-line:no-single-line-block-comment
|
|
119
|
+
/* istanbul ignore if */
|
|
120
|
+
if (typeof incrReply !== 'number') {
|
|
121
|
+
// 基本的にありえないフロー
|
|
122
|
+
throw new factory.errors.Internal('confirmation number not incremented unexpectedly');
|
|
123
|
+
}
|
|
124
|
+
return incrReply;
|
|
125
|
+
});
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
exports.TransactionNumberCounterRepo = TransactionNumberCounterRepo;
|
|
@@ -6,6 +6,9 @@ interface IProcessKey {
|
|
|
6
6
|
* 取引ID
|
|
7
7
|
*/
|
|
8
8
|
id: string;
|
|
9
|
+
project: {
|
|
10
|
+
id: string;
|
|
11
|
+
};
|
|
9
12
|
}
|
|
10
13
|
interface IOptions {
|
|
11
14
|
lockExpiresInSeconds: number;
|
|
@@ -14,11 +17,11 @@ interface IOptions {
|
|
|
14
17
|
* 取引プロセスリポジトリ
|
|
15
18
|
*/
|
|
16
19
|
export declare class TransactionProcessRepo {
|
|
20
|
+
private readonly concurrentLockRepo;
|
|
17
21
|
private readonly options;
|
|
18
|
-
private readonly redisClient;
|
|
19
22
|
constructor(redisClient: RedisClientType, options: IOptions);
|
|
20
|
-
static CREATE_REDIS_KEY(params: IProcessKey): string;
|
|
21
|
-
lock(params: IProcessKey): Promise<
|
|
22
|
-
unlock(params: IProcessKey): Promise<void>;
|
|
23
|
+
static CREATE_REDIS_KEY(params: Pick<IProcessKey, 'id' | 'typeOf'>): string;
|
|
24
|
+
lock(params: IProcessKey): Promise<void>;
|
|
25
|
+
unlock(params: Pick<IProcessKey, 'id' | 'typeOf'>): Promise<void>;
|
|
23
26
|
}
|
|
24
27
|
export {};
|
|
@@ -11,44 +11,65 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
12
|
exports.TransactionProcessRepo = void 0;
|
|
13
13
|
const createDebug = require("debug");
|
|
14
|
+
const moment = require("moment");
|
|
14
15
|
const factory = require("../factory");
|
|
16
|
+
const concurrentLock_1 = require("./concurrentLock");
|
|
15
17
|
const debug = createDebug('chevre-domain:repo:transactionProcess');
|
|
16
18
|
const DEFAULT_LOCK_EXPIRES = 120;
|
|
17
19
|
/**
|
|
18
20
|
* 取引プロセスリポジトリ
|
|
19
21
|
*/
|
|
20
22
|
class TransactionProcessRepo {
|
|
23
|
+
// private readonly redisClient: RedisClientType;
|
|
21
24
|
constructor(redisClient, options) {
|
|
22
|
-
this.
|
|
25
|
+
this.concurrentLockRepo = new concurrentLock_1.ConcurrentLockRepo({ redisClient });
|
|
26
|
+
// this.redisClient = redisClient;
|
|
23
27
|
this.options = options;
|
|
24
28
|
}
|
|
25
29
|
static CREATE_REDIS_KEY(params) {
|
|
26
|
-
// 最適化(2024-03-21~)
|
|
27
|
-
// return `chevre-api:${params.project.id}:transactionProcess:${params.typeOf}:${params.id}`;
|
|
28
30
|
return `chvrapi:lockTxn:${params.id}`;
|
|
29
31
|
}
|
|
30
32
|
lock(params) {
|
|
31
33
|
return __awaiter(this, void 0, void 0, function* () {
|
|
32
34
|
const key = TransactionProcessRepo.CREATE_REDIS_KEY(params);
|
|
33
|
-
// const ttl = TRANSACTION_RROCESS_LOCK_EXPIRES;
|
|
34
35
|
const ttl = (typeof this.options.lockExpiresInSeconds === 'number') ? this.options.lockExpiresInSeconds : DEFAULT_LOCK_EXPIRES;
|
|
35
|
-
const
|
|
36
|
-
.
|
|
37
|
-
.
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
36
|
+
const expires = moment()
|
|
37
|
+
.add(ttl, 'seconds')
|
|
38
|
+
.toDate();
|
|
39
|
+
// reimplement using concurrentLockRepo(2025-05-27~)
|
|
40
|
+
try {
|
|
41
|
+
yield this.concurrentLockRepo.lock({
|
|
42
|
+
project: { id: params.project.id, typeOf: factory.organizationType.Project },
|
|
43
|
+
about: { identifier: key, typeOf: 'Thing' },
|
|
44
|
+
expires,
|
|
45
|
+
audience: { identifier: '1', typeOf: 'Audience' }
|
|
46
|
+
});
|
|
47
|
+
debug('locked,', params.id);
|
|
42
48
|
}
|
|
43
|
-
|
|
49
|
+
catch (error) {
|
|
44
50
|
throw new factory.errors.AlreadyInUse(params.typeOf, [], 'Another transaction process in progress');
|
|
45
51
|
}
|
|
52
|
+
// const results = await this.redisClient.multi()
|
|
53
|
+
// .setNX(key, '1')
|
|
54
|
+
// .expire(key, ttl)
|
|
55
|
+
// .exec();
|
|
56
|
+
// debug('locked,', params.id, results);
|
|
57
|
+
// if (Array.isArray(results) && (results[0] === 1 || (<any>results)[0] === true)) {
|
|
58
|
+
// return;
|
|
59
|
+
// } else {
|
|
60
|
+
// throw new factory.errors.AlreadyInUse(params.typeOf, [], 'Another transaction process in progress');
|
|
61
|
+
// }
|
|
46
62
|
});
|
|
47
63
|
}
|
|
48
64
|
unlock(params) {
|
|
49
65
|
return __awaiter(this, void 0, void 0, function* () {
|
|
50
66
|
const key = TransactionProcessRepo.CREATE_REDIS_KEY(params);
|
|
51
|
-
|
|
67
|
+
// reimplement using concurrentLockRepo(2025-05-27~)
|
|
68
|
+
yield this.concurrentLockRepo.unlock({
|
|
69
|
+
about: { identifier: key, typeOf: 'Thing' },
|
|
70
|
+
audience: { identifier: '1', typeOf: 'Audience' }
|
|
71
|
+
});
|
|
72
|
+
// await this.redisClient.del([key]);
|
|
52
73
|
});
|
|
53
74
|
}
|
|
54
75
|
}
|
|
@@ -68,6 +68,7 @@ import type { ScheduleRepo } from './repo/schedule';
|
|
|
68
68
|
import type { SellerRepo } from './repo/seller';
|
|
69
69
|
import type { SellerPaymentAcceptedRepo } from './repo/sellerPaymentAccepted';
|
|
70
70
|
import type { SellerReturnPolicyRepo } from './repo/sellerReturnPolicy';
|
|
71
|
+
import type { ServiceAvailableHourRepo } from './repo/service/availableHour';
|
|
71
72
|
import type { ServiceOutputRepo } from './repo/serviceOutput';
|
|
72
73
|
import type { ServiceOutputIdentifierRepo } from './repo/serviceOutputIdentifier';
|
|
73
74
|
import type { SettingRepo } from './repo/setting';
|
|
@@ -390,6 +391,10 @@ export type SellerReturnPolicy = SellerReturnPolicyRepo;
|
|
|
390
391
|
export declare namespace SellerReturnPolicy {
|
|
391
392
|
function createInstance(...params: ConstructorParameters<typeof SellerReturnPolicyRepo>): Promise<SellerReturnPolicyRepo>;
|
|
392
393
|
}
|
|
394
|
+
export type ServiceAvailableHour = ServiceAvailableHourRepo;
|
|
395
|
+
export declare namespace ServiceAvailableHour {
|
|
396
|
+
function createInstance(...params: ConstructorParameters<typeof ServiceAvailableHourRepo>): Promise<ServiceAvailableHourRepo>;
|
|
397
|
+
}
|
|
393
398
|
export type ServiceOutput = ServiceOutputRepo;
|
|
394
399
|
export declare namespace ServiceOutput {
|
|
395
400
|
function createInstance(...params: ConstructorParameters<typeof ServiceOutputRepo>): Promise<ServiceOutputRepo>;
|
package/lib/chevre/repository.js
CHANGED
|
@@ -10,7 +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.Permit = exports.Person = exports.paymentMethod = exports.PendingReservation = exports.PaymentServiceProvider = exports.PaymentServiceChannel = exports.PaymentService = exports.Passport = exports.OwnershipInfo = exports.OrderNumber = exports.OrderInTransaction = exports.Order = exports.Offer = exports.OfferItemCondition = exports.OfferCatalogItem = exports.OfferCatalog = exports.Note = exports.Message = exports.MerchantReturnPolicy = exports.MemberProgram = exports.Member = exports.Issuer = exports.IdentityProvider = exports.Identity = exports.EventSeries = exports.EventSellerMakesOffer = exports.EventOffer = exports.Event = exports.EmailMessage = exports.CustomerType = exports.Customer = exports.Credentials = exports.CreativeWork = exports.ConfirmationNumber = exports.Comment = exports.Authorization = exports.CategoryCode = exports.AssetTransaction = exports.Aggregation = exports.AggregateReservation = exports.AggregateOrder = exports.AggregateOffer = exports.AdvanceBookingRequirement = exports.AdditionalProperty = exports.Action = exports.AccountTransaction = exports.AccountTitle = exports.AccountingReport = exports.Account = exports.AcceptedOffer = void 0;
|
|
13
|
-
exports.WebSite = exports.rateLimit = exports.Trip = exports.TransactionProcess = exports.TransactionNumber = exports.Transaction = exports.Ticket = exports.Telemetry = exports.Task = exports.StockHolder = exports.setting = exports.Setting = exports.ServiceOutputIdentifier = exports.ServiceOutput = exports.SellerReturnPolicy = exports.SellerPaymentAccepted = exports.Seller = exports.Schedule = exports.Role = exports.ReserveInterface = exports.Reservation = exports.ProjectMakesOffer = exports.Project = exports.ProductOffer = exports.ProductModel = exports.Product = exports.PriceSpecification = exports.PotentialAction = exports.place = void 0;
|
|
13
|
+
exports.WebSite = exports.rateLimit = exports.Trip = exports.TransactionProcess = exports.TransactionNumber = exports.Transaction = exports.Ticket = exports.Telemetry = exports.Task = exports.StockHolder = exports.setting = exports.Setting = exports.ServiceOutputIdentifier = exports.ServiceOutput = exports.ServiceAvailableHour = exports.SellerReturnPolicy = exports.SellerPaymentAccepted = exports.Seller = exports.Schedule = exports.Role = exports.ReserveInterface = exports.Reservation = exports.ProjectMakesOffer = exports.Project = exports.ProductOffer = exports.ProductModel = exports.Product = exports.PriceSpecification = exports.PotentialAction = exports.place = void 0;
|
|
14
14
|
var AcceptedOffer;
|
|
15
15
|
(function (AcceptedOffer) {
|
|
16
16
|
let repo;
|
|
@@ -945,6 +945,19 @@ var SellerReturnPolicy;
|
|
|
945
945
|
}
|
|
946
946
|
SellerReturnPolicy.createInstance = createInstance;
|
|
947
947
|
})(SellerReturnPolicy || (exports.SellerReturnPolicy = SellerReturnPolicy = {}));
|
|
948
|
+
var ServiceAvailableHour;
|
|
949
|
+
(function (ServiceAvailableHour) {
|
|
950
|
+
let repo;
|
|
951
|
+
function createInstance(...params) {
|
|
952
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
953
|
+
if (repo === undefined) {
|
|
954
|
+
repo = (yield Promise.resolve().then(() => require('./repo/service/availableHour'))).ServiceAvailableHourRepo;
|
|
955
|
+
}
|
|
956
|
+
return new repo(...params);
|
|
957
|
+
});
|
|
958
|
+
}
|
|
959
|
+
ServiceAvailableHour.createInstance = createInstance;
|
|
960
|
+
})(ServiceAvailableHour || (exports.ServiceAvailableHour = ServiceAvailableHour = {}));
|
|
948
961
|
var ServiceOutput;
|
|
949
962
|
(function (ServiceOutput) {
|
|
950
963
|
let repo;
|
|
@@ -239,6 +239,7 @@ function isHoldByRateLimit(params) {
|
|
|
239
239
|
const unitInSeconds = (_b = params.offer.validRateLimit) === null || _b === void 0 ? void 0 : _b.unitInSeconds;
|
|
240
240
|
if (typeof scope === 'string' && typeof unitInSeconds === 'number') {
|
|
241
241
|
const rateLimitKey = {
|
|
242
|
+
project: { id: params.event.project.id },
|
|
242
243
|
reservedTicket: {
|
|
243
244
|
ticketType: {
|
|
244
245
|
validRateLimit: { scope: scope, unitInSeconds: unitInSeconds }
|
|
@@ -170,6 +170,7 @@ function addReservations(params) {
|
|
|
170
170
|
let lockedOfferRateLimitKeys = [];
|
|
171
171
|
try {
|
|
172
172
|
lockedOfferRateLimitKeys = yield processLockOfferRateLimit({
|
|
173
|
+
project: { id: params.event.project.id },
|
|
173
174
|
reservations: objectSubReservations,
|
|
174
175
|
reservationFor,
|
|
175
176
|
reservationNumber
|
|
@@ -179,6 +180,7 @@ function addReservations(params) {
|
|
|
179
180
|
if (lockedOfferRateLimitKeys.length > 0) {
|
|
180
181
|
yield Promise.all(objectSubReservations.map((reservation) => __awaiter(this, void 0, void 0, function* () {
|
|
181
182
|
yield (0, cancelReservation_1.processUnlockOfferRateLimit)({
|
|
183
|
+
project: { id: params.event.project.id },
|
|
182
184
|
reservation: {
|
|
183
185
|
reservationNumber,
|
|
184
186
|
reservedTicket: reservation.reservedTicket
|
|
@@ -469,6 +471,7 @@ function processLockOfferRateLimit(params) {
|
|
|
469
471
|
const unitInSeconds = (_b = reservation.reservedTicket.ticketType.validRateLimit) === null || _b === void 0 ? void 0 : _b.unitInSeconds;
|
|
470
472
|
if (typeof scope === 'string' && typeof unitInSeconds === 'number') {
|
|
471
473
|
const rateLimitKey = {
|
|
474
|
+
project: { id: params.project.id },
|
|
472
475
|
reservedTicket: {
|
|
473
476
|
ticketType: {
|
|
474
477
|
validRateLimit: {
|
|
@@ -489,7 +492,12 @@ function processLockOfferRateLimit(params) {
|
|
|
489
492
|
rateLimitKeys.push(rateLimitKey);
|
|
490
493
|
}
|
|
491
494
|
});
|
|
492
|
-
|
|
495
|
+
if (rateLimitKeys.length > 0) {
|
|
496
|
+
if (rateLimitKeys.length > 1) {
|
|
497
|
+
throw new factory.errors.Argument('acceptedOffers', `Number of offers with rateLimit must be less than or equal to 1`);
|
|
498
|
+
}
|
|
499
|
+
yield repos.offerRateLimit.lock(rateLimitKeys[0]);
|
|
500
|
+
}
|
|
493
501
|
return rateLimitKeys;
|
|
494
502
|
});
|
|
495
503
|
}
|
|
@@ -143,7 +143,7 @@ function validateEventOfferPeriod(params) {
|
|
|
143
143
|
throw new factory.errors.ArgumentNull('reservationFor.offers.validForMemberTier');
|
|
144
144
|
}
|
|
145
145
|
// トークン検証
|
|
146
|
-
const memberProgram = (yield repos.memberProgram.
|
|
146
|
+
const memberProgram = (yield repos.memberProgram.projectMemberPrograms({
|
|
147
147
|
limit: 1,
|
|
148
148
|
page: 1,
|
|
149
149
|
project: { id: { $eq: params.event.project.id } },
|
|
@@ -41,7 +41,7 @@ function getToken(params) {
|
|
|
41
41
|
const { id } = yield repos.ticket.issueByTicketToken(Object.assign({ project: { id: params.project.id }, ticketToken: params.code }, (typeof ((_a = authorization.issuedBy) === null || _a === void 0 ? void 0 : _a.id) === 'string') ? { issuedBy: authorization.issuedBy } : undefined));
|
|
42
42
|
const jti = id;
|
|
43
43
|
// ロール承認の場合、subjectはメンバーID,typはメンバータイプ
|
|
44
|
-
if (authorization.object.typeOf === factory.
|
|
44
|
+
if (authorization.object.typeOf === factory.role.RoleType.OrganizationRole) {
|
|
45
45
|
subject = authorization.object.member.id;
|
|
46
46
|
typ = `${jwtSetting.payloadTypPrefix}:${authorization.object.member.typeOf}`;
|
|
47
47
|
}
|
|
@@ -2,7 +2,7 @@ import type { IMinimizedIndividualEvent } from '../../../repo/event';
|
|
|
2
2
|
import type { OfferRateLimitRepo } from '../../../repo/rateLimit/offer';
|
|
3
3
|
import * as factory from '../../../factory';
|
|
4
4
|
declare function checkAvailability(params: {
|
|
5
|
-
event: Pick<IMinimizedIndividualEvent<factory.eventType.Event | factory.eventType.ScreeningEvent>, 'startDate'>;
|
|
5
|
+
event: Pick<IMinimizedIndividualEvent<factory.eventType.Event | factory.eventType.ScreeningEvent>, 'startDate' | 'project'>;
|
|
6
6
|
unitPriceOffer: factory.unitPriceOffer.IUnitPriceOffer;
|
|
7
7
|
}): (repos: {
|
|
8
8
|
offerRateLimit: OfferRateLimitRepo;
|
|
@@ -22,6 +22,7 @@ function checkAvailability(params) {
|
|
|
22
22
|
const unitInSeconds = (_b = unitPriceOffer.validRateLimit) === null || _b === void 0 ? void 0 : _b.unitInSeconds;
|
|
23
23
|
if (typeof scope === 'string' && typeof unitInSeconds === 'number') {
|
|
24
24
|
const rateLimitKey = {
|
|
25
|
+
project: { id: params.event.project.id },
|
|
25
26
|
reservedTicket: {
|
|
26
27
|
ticketType: {
|
|
27
28
|
validRateLimit: {
|
|
@@ -388,43 +388,3 @@ function createServiceOutputIdentifier(params) {
|
|
|
388
388
|
})));
|
|
389
389
|
});
|
|
390
390
|
}
|
|
391
|
-
// function processLockRegisterMembershipService(params: {
|
|
392
|
-
// agent: { id: string };
|
|
393
|
-
// product: factory.product.IProduct;
|
|
394
|
-
// purpose: factory.action.authorize.offer.product.IPurpose;
|
|
395
|
-
// }) {
|
|
396
|
-
// return async (repos: {
|
|
397
|
-
// registerActionInProgress: RegisterServiceInProgressRepo;
|
|
398
|
-
// }) => {
|
|
399
|
-
// if (params.product.typeOf === factory.product.ProductType.MembershipService) {
|
|
400
|
-
// await repos.registerActionInProgress.lock(
|
|
401
|
-
// {
|
|
402
|
-
// agent: { id: params.agent.id },
|
|
403
|
-
// product: { id: String(params.product.id) }
|
|
404
|
-
// },
|
|
405
|
-
// params.purpose.id
|
|
406
|
-
// );
|
|
407
|
-
// }
|
|
408
|
-
// };
|
|
409
|
-
// }
|
|
410
|
-
// export function processUnlockRegisterMembershipService(params: {
|
|
411
|
-
// agent: { id: string };
|
|
412
|
-
// product: { id: string };
|
|
413
|
-
// purpose: factory.action.authorize.offer.product.IPurpose;
|
|
414
|
-
// }) {
|
|
415
|
-
// return async (repos: {
|
|
416
|
-
// registerActionInProgress: RegisterServiceInProgressRepo;
|
|
417
|
-
// }) => {
|
|
418
|
-
// // 登録ロックIDが取引IDであればロック解除
|
|
419
|
-
// const holder = await repos.registerActionInProgress.getHolder({
|
|
420
|
-
// agent: { id: params.agent.id },
|
|
421
|
-
// product: { id: params.product.id }
|
|
422
|
-
// });
|
|
423
|
-
// if (holder === params.purpose.id) {
|
|
424
|
-
// await repos.registerActionInProgress.unlock({
|
|
425
|
-
// agent: { id: params.agent.id },
|
|
426
|
-
// product: { id: params.product.id }
|
|
427
|
-
// });
|
|
428
|
-
// }
|
|
429
|
-
// };
|
|
430
|
-
// }
|
|
@@ -18,7 +18,6 @@ import type { TaskRepo } from '../../repo/task';
|
|
|
18
18
|
import type { TicketRepo } from '../../repo/ticket';
|
|
19
19
|
import type { TransactionRepo } from '../../repo/transaction';
|
|
20
20
|
import type { TransactionNumberRepo } from '../../repo/transactionNumber';
|
|
21
|
-
import type { TransactionProcessRepo } from '../../repo/transactionProcess';
|
|
22
21
|
import * as PayTransactionService from '../assetTransaction/pay';
|
|
23
22
|
import { onPaymentStatusChanged } from './any/onPaymentStatusChanged';
|
|
24
23
|
import { person2username } from './any/person2username';
|
|
@@ -97,7 +96,6 @@ interface IAuthorizeRepos {
|
|
|
97
96
|
ticket: TicketRepo;
|
|
98
97
|
transaction: TransactionRepo;
|
|
99
98
|
transactionNumber: TransactionNumberRepo;
|
|
100
|
-
transactionProcess: TransactionProcessRepo;
|
|
101
99
|
}
|
|
102
100
|
type IAuthorizeOperation<T> = (repos: IAuthorizeRepos, settings: Settings) => Promise<T>;
|
|
103
101
|
interface IPublishPaymentUrlRepos {
|
|
@@ -20,6 +20,7 @@ exports.processVoidPayTransaction = processVoidPayTransaction;
|
|
|
20
20
|
exports.publishPaymentUrl = publishPaymentUrl;
|
|
21
21
|
const util = require("util");
|
|
22
22
|
const factory = require("../../factory");
|
|
23
|
+
// import type { TransactionProcessRepo } from '../../repo/transactionProcess';
|
|
23
24
|
const PayTransactionService = require("../assetTransaction/pay");
|
|
24
25
|
const publishOrderNumberIfNotExist_1 = require("../transaction/placeOrder/publishOrderNumberIfNotExist");
|
|
25
26
|
const factory_1 = require("./any/factory");
|
|
@@ -31,6 +31,9 @@ declare function cancelReservation(actionAttributesList: factory.action.cancel.r
|
|
|
31
31
|
assetTransaction: AssetTransactionRepo;
|
|
32
32
|
}) => Promise<void>;
|
|
33
33
|
declare function processUnlockOfferRateLimit(params: {
|
|
34
|
+
project: {
|
|
35
|
+
id: string;
|
|
36
|
+
};
|
|
34
37
|
reservation: {
|
|
35
38
|
reservationNumber: string;
|
|
36
39
|
reservedTicket: factory.reservation.ITicket;
|
|
@@ -104,6 +104,7 @@ function cancelPengindIfNotYet(params) {
|
|
|
104
104
|
: reserveTransactionId
|
|
105
105
|
})(repos);
|
|
106
106
|
yield processUnlockOfferRateLimit({
|
|
107
|
+
project: { id: reserveTransaction.project.id },
|
|
107
108
|
reservation: {
|
|
108
109
|
reservationNumber: reserveTransaction.object.reservationNumber,
|
|
109
110
|
reservedTicket: cancelingSubReservation.reservedTicket
|
|
@@ -204,6 +205,7 @@ function cancelReservation(actionAttributesList) {
|
|
|
204
205
|
: reserveTransaction.id
|
|
205
206
|
})(repos);
|
|
206
207
|
yield processUnlockOfferRateLimit({
|
|
208
|
+
project: { id: reserveTransaction.project.id },
|
|
207
209
|
reservation: {
|
|
208
210
|
reservationNumber: reserveTransaction.object.reservationNumber,
|
|
209
211
|
reservedTicket: cancelingSubReservation.reservedTicket
|
|
@@ -253,6 +255,7 @@ function cancelReservation(actionAttributesList) {
|
|
|
253
255
|
})(repos);
|
|
254
256
|
}
|
|
255
257
|
yield processUnlockOfferRateLimit({
|
|
258
|
+
project: { id: reservation.project.id },
|
|
256
259
|
reservation: {
|
|
257
260
|
reservationNumber: reservation.reservationNumber,
|
|
258
261
|
reservedTicket: reservation.reservedTicket
|
|
@@ -401,6 +404,7 @@ function processUnlockOfferRateLimit(params) {
|
|
|
401
404
|
const unitInSeconds = (_b = reservation.reservedTicket.ticketType.validRateLimit) === null || _b === void 0 ? void 0 : _b.unitInSeconds;
|
|
402
405
|
if (typeof scope === 'string' && typeof unitInSeconds === 'number') {
|
|
403
406
|
const rateLimitKey = {
|
|
407
|
+
project: { id: params.project.id },
|
|
404
408
|
reservedTicket: {
|
|
405
409
|
ticketType: {
|
|
406
410
|
validRateLimit: {
|
|
@@ -420,7 +424,7 @@ function processUnlockOfferRateLimit(params) {
|
|
|
420
424
|
};
|
|
421
425
|
const holder = yield repos.offerRateLimit.getHolder(rateLimitKey);
|
|
422
426
|
if (holder === rateLimitKey.reservationNumber) {
|
|
423
|
-
yield repos.offerRateLimit.unlock(
|
|
427
|
+
yield repos.offerRateLimit.unlock(rateLimitKey);
|
|
424
428
|
}
|
|
425
429
|
}
|
|
426
430
|
});
|
|
@@ -86,7 +86,7 @@ function call(params) {
|
|
|
86
86
|
})({
|
|
87
87
|
action: actionRepo,
|
|
88
88
|
event: new event_1.EventRepo(connection),
|
|
89
|
-
orderNumber: new orderNumber_1.OrderNumberRepo(redisClient),
|
|
89
|
+
orderNumber: new orderNumber_1.OrderNumberRepo({ redisClient, connection }),
|
|
90
90
|
project: new project_1.ProjectRepo(connection),
|
|
91
91
|
transaction: new transaction_1.TransactionRepo(connection),
|
|
92
92
|
reserveService,
|
|
@@ -104,7 +104,7 @@ function call(params) {
|
|
|
104
104
|
})({
|
|
105
105
|
action: actionRepo,
|
|
106
106
|
event: new event_1.EventRepo(connection),
|
|
107
|
-
orderNumber: new orderNumber_1.OrderNumberRepo(redisClient),
|
|
107
|
+
orderNumber: new orderNumber_1.OrderNumberRepo({ redisClient, connection }),
|
|
108
108
|
project: new project_1.ProjectRepo(connection),
|
|
109
109
|
transaction: new transaction_1.TransactionRepo(connection),
|
|
110
110
|
reserveService,
|
|
@@ -57,13 +57,13 @@ function call(params) {
|
|
|
57
57
|
action: actionRepo,
|
|
58
58
|
assetTransaction: new assetTransaction_1.AssetTransactionRepo(connection),
|
|
59
59
|
authorization: new authorization_1.AuthorizationRepo(connection),
|
|
60
|
-
confirmationNumber: new confirmationNumber_1.ConfirmationNumberRepo(redisClient),
|
|
60
|
+
confirmationNumber: new confirmationNumber_1.ConfirmationNumberRepo({ redisClient, connection }),
|
|
61
61
|
credentials: new credentials_1.CredentialsRepo(redisClient, {
|
|
62
62
|
scope: `${factory.service.paymentService.PaymentServiceType.MovieTicket}:${paymentServiceId}`,
|
|
63
63
|
expireInSeconds: (useCredentialsRepo) ? credentialsExpireInSeconds : 0
|
|
64
64
|
}),
|
|
65
65
|
event: new event_1.EventRepo(connection),
|
|
66
|
-
orderNumber: new orderNumber_1.OrderNumberRepo(redisClient),
|
|
66
|
+
orderNumber: new orderNumber_1.OrderNumberRepo({ redisClient, connection }),
|
|
67
67
|
paymentAccepted: new sellerPaymentAccepted_1.SellerPaymentAcceptedRepo(connection),
|
|
68
68
|
paymentService: new paymentService_1.PaymentServiceRepo(connection),
|
|
69
69
|
paymentServiceProvider: new paymentServiceProvider_1.PaymentServiceProviderRepo(connection),
|
|
@@ -73,8 +73,8 @@ function call(params) {
|
|
|
73
73
|
task: new task_1.TaskRepo(connection),
|
|
74
74
|
ticket: new ticket_1.TicketRepo(connection),
|
|
75
75
|
transaction: new transaction_1.TransactionRepo(connection),
|
|
76
|
-
transactionNumber: new transactionNumber_1.TransactionNumberRepo(redisClient)
|
|
77
|
-
transactionProcess: transactionProcessRepo
|
|
76
|
+
transactionNumber: new transactionNumber_1.TransactionNumberRepo({ redisClient, connection })
|
|
77
|
+
// transactionProcess: transactionProcessRepo
|
|
78
78
|
}, settings);
|
|
79
79
|
}
|
|
80
80
|
catch (error) {
|
|
@@ -29,7 +29,7 @@ function call(data) {
|
|
|
29
29
|
const assetTransactionRepo = new assetTransaction_1.AssetTransactionRepo(connection);
|
|
30
30
|
const productRepo = new product_1.ProductRepo(connection);
|
|
31
31
|
const projectRepo = new project_1.ProjectRepo(connection);
|
|
32
|
-
const transactionNumberRepo = new transactionNumber_1.TransactionNumberRepo(redisClient);
|
|
32
|
+
const transactionNumberRepo = new transactionNumber_1.TransactionNumberRepo({ redisClient, connection });
|
|
33
33
|
yield DeliveryService.givePointAward(data)({
|
|
34
34
|
action: actionRepo,
|
|
35
35
|
assetTransaction: assetTransactionRepo,
|
|
@@ -25,7 +25,7 @@ function call(data) {
|
|
|
25
25
|
}
|
|
26
26
|
const actionRepo = new action_1.ActionRepo(connection);
|
|
27
27
|
const productRepo = new product_1.ProductRepo(connection);
|
|
28
|
-
const transactionNumberRepo = new transactionNumber_1.TransactionNumberRepo(redisClient);
|
|
28
|
+
const transactionNumberRepo = new transactionNumber_1.TransactionNumberRepo({ redisClient, connection });
|
|
29
29
|
yield MoneyTransferService.moneyTransfer(data)({
|
|
30
30
|
action: actionRepo,
|
|
31
31
|
product: productRepo,
|
|
@@ -43,14 +43,14 @@ function call(params) {
|
|
|
43
43
|
action: actionRepo,
|
|
44
44
|
assetTransaction: new assetTransaction_1.AssetTransactionRepo(connection),
|
|
45
45
|
authorization: new authorization_1.AuthorizationRepo(connection),
|
|
46
|
-
orderNumber: new orderNumber_1.OrderNumberRepo(redisClient),
|
|
46
|
+
orderNumber: new orderNumber_1.OrderNumberRepo({ redisClient, connection }),
|
|
47
47
|
paymentAccepted: new sellerPaymentAccepted_1.SellerPaymentAcceptedRepo(connection),
|
|
48
48
|
paymentService: new paymentService_1.PaymentServiceRepo(connection),
|
|
49
49
|
paymentServiceProvider: new paymentServiceProvider_1.PaymentServiceProviderRepo(connection),
|
|
50
50
|
project: new project_1.ProjectRepo(connection),
|
|
51
51
|
ticket: new ticket_1.TicketRepo(connection),
|
|
52
52
|
transaction: new transaction_1.TransactionRepo(connection),
|
|
53
|
-
transactionNumber: new transactionNumber_1.TransactionNumberRepo(redisClient)
|
|
53
|
+
transactionNumber: new transactionNumber_1.TransactionNumberRepo({ redisClient, connection })
|
|
54
54
|
}, settings);
|
|
55
55
|
}
|
|
56
56
|
catch (error) {
|
|
@@ -58,7 +58,7 @@ function call(params) {
|
|
|
58
58
|
project: new project_1.ProjectRepo(connection),
|
|
59
59
|
task: new task_1.TaskRepo(connection),
|
|
60
60
|
assetTransaction: new assetTransaction_1.AssetTransactionRepo(connection),
|
|
61
|
-
transactionNumber: new transactionNumber_1.TransactionNumberRepo(redisClient)
|
|
61
|
+
transactionNumber: new transactionNumber_1.TransactionNumberRepo({ redisClient, connection })
|
|
62
62
|
}, settings);
|
|
63
63
|
});
|
|
64
64
|
}
|
|
@@ -29,7 +29,7 @@ function call(data) {
|
|
|
29
29
|
const assetTransactionRepo = new assetTransaction_1.AssetTransactionRepo(connection);
|
|
30
30
|
const productRepo = new product_1.ProductRepo(connection);
|
|
31
31
|
const projectRepo = new project_1.ProjectRepo(connection);
|
|
32
|
-
const transactionNumberRepo = new transactionNumber_1.TransactionNumberRepo(redisClient);
|
|
32
|
+
const transactionNumberRepo = new transactionNumber_1.TransactionNumberRepo({ redisClient, connection });
|
|
33
33
|
yield (0, returnMoneyTransfer_1.returnMoneyTransfer)(data)({
|
|
34
34
|
action: actionRepo,
|
|
35
35
|
assetTransaction: assetTransactionRepo,
|
|
@@ -39,7 +39,7 @@ function call(params) {
|
|
|
39
39
|
product: new product_1.ProductRepo(connection),
|
|
40
40
|
task: new task_1.TaskRepo(connection),
|
|
41
41
|
transaction: new transaction_1.TransactionRepo(connection),
|
|
42
|
-
transactionNumber: new transactionNumber_1.TransactionNumberRepo(redisClient)
|
|
42
|
+
transactionNumber: new transactionNumber_1.TransactionNumberRepo({ redisClient, connection })
|
|
43
43
|
});
|
|
44
44
|
});
|
|
45
45
|
}
|
|
@@ -29,7 +29,7 @@ function call(data) {
|
|
|
29
29
|
const assetTransactionRepo = new assetTransaction_1.AssetTransactionRepo(connection);
|
|
30
30
|
const productRepo = new product_1.ProductRepo(connection);
|
|
31
31
|
const projectRepo = new project_1.ProjectRepo(connection);
|
|
32
|
-
const transactionNumberRepo = new transactionNumber_1.TransactionNumberRepo(redisClient);
|
|
32
|
+
const transactionNumberRepo = new transactionNumber_1.TransactionNumberRepo({ redisClient, connection });
|
|
33
33
|
yield DeliveryService.returnPointAward(data)({
|
|
34
34
|
action: actionRepo,
|
|
35
35
|
assetTransaction: assetTransactionRepo,
|
|
@@ -55,7 +55,7 @@ function call(params) {
|
|
|
55
55
|
assetTransaction: new assetTransaction_1.AssetTransactionRepo(connection),
|
|
56
56
|
project: new project_1.ProjectRepo(connection),
|
|
57
57
|
reservation: new reservation_1.ReservationRepo(connection),
|
|
58
|
-
transactionNumber: new transactionNumber_1.TransactionNumberRepo(redisClient),
|
|
58
|
+
transactionNumber: new transactionNumber_1.TransactionNumberRepo({ redisClient, connection }),
|
|
59
59
|
reserveService
|
|
60
60
|
});
|
|
61
61
|
});
|