@chevre/domain 21.13.0-alpha.2 → 21.13.0-alpha.3
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/lib/chevre/factory/transaction.d.ts +42 -0
- package/lib/chevre/factory/transaction.js +2 -0
- package/lib/chevre/service/transaction/moneyTransfer.d.ts +2 -4
- package/lib/chevre/service/transaction/placeOrderInProgress.d.ts +5 -32
- package/lib/chevre/service/transaction/validation.d.ts +1 -3
- package/lib/chevre/service.d.ts +2 -0
- package/lib/chevre/service.js +3 -0
- package/package.json +1 -1
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import * as factory from '../factory';
|
|
2
|
+
export type IPassportValidator = (params: {
|
|
3
|
+
passport: factory.waiter.passport.IPassport;
|
|
4
|
+
}) => boolean;
|
|
5
|
+
export declare namespace moneyTransfer {
|
|
6
|
+
type IStartParams = factory.transaction.moneyTransfer.IStartParamsWithoutDetail & {
|
|
7
|
+
passportValidator?: IPassportValidator;
|
|
8
|
+
};
|
|
9
|
+
}
|
|
10
|
+
export declare namespace placeOrder {
|
|
11
|
+
type IStartParams = factory.transaction.placeOrder.IStartParamsWithoutDetail & {
|
|
12
|
+
passportValidator?: IPassportValidator;
|
|
13
|
+
broker?: factory.order.IBroker;
|
|
14
|
+
validateSeller?: boolean;
|
|
15
|
+
};
|
|
16
|
+
type IOrderURLGenerator = (order: factory.order.IOrder) => string;
|
|
17
|
+
type IResultOrderParams = factory.transaction.placeOrder.IResultOrderParams & {
|
|
18
|
+
/**
|
|
19
|
+
* 注文日時
|
|
20
|
+
*/
|
|
21
|
+
orderDate: Date;
|
|
22
|
+
/**
|
|
23
|
+
* 注文確認URLのカスタム指定
|
|
24
|
+
*/
|
|
25
|
+
url?: string | IOrderURLGenerator;
|
|
26
|
+
/**
|
|
27
|
+
* 注文アイテム数
|
|
28
|
+
*/
|
|
29
|
+
numItems?: {
|
|
30
|
+
maxValue?: number;
|
|
31
|
+
minValue?: number;
|
|
32
|
+
};
|
|
33
|
+
};
|
|
34
|
+
type IConfirmParams = factory.transaction.placeOrder.IConfirmParams & {
|
|
35
|
+
project: {
|
|
36
|
+
id: string;
|
|
37
|
+
};
|
|
38
|
+
result: {
|
|
39
|
+
order: IResultOrderParams;
|
|
40
|
+
};
|
|
41
|
+
};
|
|
42
|
+
}
|
|
@@ -8,7 +8,7 @@ import type { MongoRepository as SellerRepo } from '../../repo/seller';
|
|
|
8
8
|
import type { MongoRepository as TaskRepo } from '../../repo/task';
|
|
9
9
|
import type { MongoRepository as TransactionRepo } from '../../repo/transaction';
|
|
10
10
|
import type { RedisRepository as TransactionNumberRepo } from '../../repo/transactionNumber';
|
|
11
|
-
import { IPassportValidator as IWaiterPassportValidator } from '
|
|
11
|
+
import { IPassportValidator as IWaiterPassportValidator, moneyTransfer as MoneyTransferFactory } from '../../factory/transaction';
|
|
12
12
|
export interface IStartOperationRepos {
|
|
13
13
|
action: ActionRepo;
|
|
14
14
|
order: OrderRepo;
|
|
@@ -29,9 +29,7 @@ export type IConfirmOperation<T> = (repos: {
|
|
|
29
29
|
transaction: TransactionRepo;
|
|
30
30
|
}) => Promise<T>;
|
|
31
31
|
export type IPassportValidator = IWaiterPassportValidator;
|
|
32
|
-
export type IStartParams =
|
|
33
|
-
passportValidator?: IPassportValidator;
|
|
34
|
-
};
|
|
32
|
+
export type IStartParams = MoneyTransferFactory.IStartParams;
|
|
35
33
|
/**
|
|
36
34
|
* 取引開始
|
|
37
35
|
* 通貨転送資産取引サービスを利用して転送取引を開始する
|
|
@@ -6,7 +6,7 @@ import type { RedisRepository as OrderNumberRepo } from '../../repo/orderNumber'
|
|
|
6
6
|
import type { MongoRepository as ProjectRepo } from '../../repo/project';
|
|
7
7
|
import type { MongoRepository as SellerRepo } from '../../repo/seller';
|
|
8
8
|
import type { MongoRepository as TransactionRepo } from '../../repo/transaction';
|
|
9
|
-
import { IPassportValidator as IWaiterPassportValidator } from '
|
|
9
|
+
import { IPassportValidator as IWaiterPassportValidator, placeOrder as PlaceOrderFactory } from '../../factory/transaction';
|
|
10
10
|
export declare const POINT_AWARD_IDENTIFIER_NAME = "pointAwardIdentifiers";
|
|
11
11
|
export interface IStartOperationRepos {
|
|
12
12
|
seller: SellerRepo;
|
|
@@ -23,41 +23,14 @@ export interface IConfirmOperationRepos {
|
|
|
23
23
|
}
|
|
24
24
|
export type IConfirmOperation<T> = (repos: IConfirmOperationRepos) => Promise<T>;
|
|
25
25
|
export type IPassportValidator = IWaiterPassportValidator;
|
|
26
|
-
export type IStartParams =
|
|
27
|
-
passportValidator?: IPassportValidator;
|
|
28
|
-
broker?: factory.order.IBroker;
|
|
29
|
-
validateSeller?: boolean;
|
|
30
|
-
};
|
|
26
|
+
export type IStartParams = PlaceOrderFactory.IStartParams;
|
|
31
27
|
/**
|
|
32
28
|
* 取引開始
|
|
33
29
|
*/
|
|
34
30
|
export declare function start(params: IStartParams): IStartOperation<factory.transaction.placeOrder.ITransaction>;
|
|
35
|
-
export type IOrderURLGenerator =
|
|
36
|
-
export type IResultOrderParams =
|
|
37
|
-
|
|
38
|
-
* 注文日時
|
|
39
|
-
*/
|
|
40
|
-
orderDate: Date;
|
|
41
|
-
/**
|
|
42
|
-
* 注文確認URLのカスタム指定
|
|
43
|
-
*/
|
|
44
|
-
url?: string | IOrderURLGenerator;
|
|
45
|
-
/**
|
|
46
|
-
* 注文アイテム数
|
|
47
|
-
*/
|
|
48
|
-
numItems?: {
|
|
49
|
-
maxValue?: number;
|
|
50
|
-
minValue?: number;
|
|
51
|
-
};
|
|
52
|
-
};
|
|
53
|
-
export type IConfirmParams = factory.transaction.placeOrder.IConfirmParams & {
|
|
54
|
-
project: {
|
|
55
|
-
id: string;
|
|
56
|
-
};
|
|
57
|
-
result: {
|
|
58
|
-
order: IResultOrderParams;
|
|
59
|
-
};
|
|
60
|
-
};
|
|
31
|
+
export type IOrderURLGenerator = PlaceOrderFactory.IOrderURLGenerator;
|
|
32
|
+
export type IResultOrderParams = PlaceOrderFactory.IResultOrderParams;
|
|
33
|
+
export type IConfirmParams = PlaceOrderFactory.IConfirmParams;
|
|
61
34
|
/**
|
|
62
35
|
* 注文取引を確定する
|
|
63
36
|
*/
|
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
import * as factory from '../../factory';
|
|
2
|
-
|
|
3
|
-
passport: factory.waiter.passport.IPassport;
|
|
4
|
-
}) => boolean;
|
|
2
|
+
import { IPassportValidator } from '../../factory/transaction';
|
|
5
3
|
export type IStartParams = (factory.transaction.placeOrder.IStartParamsWithoutDetail | factory.transaction.moneyTransfer.IStartParamsWithoutDetail) & {
|
|
6
4
|
passportValidator?: IPassportValidator;
|
|
7
5
|
};
|
package/lib/chevre/service.d.ts
CHANGED
|
@@ -5,6 +5,7 @@ import * as AccountTransactionIdentifierFactory from './factory/accountTransacti
|
|
|
5
5
|
import * as EventFactory from './factory/event';
|
|
6
6
|
import * as OrderFactory from './factory/order';
|
|
7
7
|
import * as ReservedAgentIdentifireNamesFactory from './factory/reservedAgentIdentifireNames';
|
|
8
|
+
import * as TransactionFactory from './factory/transaction';
|
|
8
9
|
import type * as AccountService from './service/account';
|
|
9
10
|
import type * as AccountTransactionService from './service/accountTransaction';
|
|
10
11
|
import type * as AggregationService from './service/aggregation';
|
|
@@ -84,4 +85,5 @@ export declare namespace factory {
|
|
|
84
85
|
export import event = EventFactory;
|
|
85
86
|
export import order = OrderFactory;
|
|
86
87
|
export import reservedAgentIdentifireNames = ReservedAgentIdentifireNamesFactory;
|
|
88
|
+
export import transaction = TransactionFactory;
|
|
87
89
|
}
|
package/lib/chevre/service.js
CHANGED
|
@@ -17,6 +17,7 @@ const AccountTransactionIdentifierFactory = require("./factory/accountTransactio
|
|
|
17
17
|
const EventFactory = require("./factory/event");
|
|
18
18
|
const OrderFactory = require("./factory/order");
|
|
19
19
|
const ReservedAgentIdentifireNamesFactory = require("./factory/reservedAgentIdentifireNames");
|
|
20
|
+
const TransactionFactory = require("./factory/transaction");
|
|
20
21
|
// import type * as UtilService from './service/util';
|
|
21
22
|
// import all lazily(2023-10-11~)
|
|
22
23
|
var account;
|
|
@@ -273,4 +274,6 @@ var factory;
|
|
|
273
274
|
// tslint:disable-next-line:no-shadowed-variable
|
|
274
275
|
factory.order = OrderFactory;
|
|
275
276
|
factory.reservedAgentIdentifireNames = ReservedAgentIdentifireNamesFactory;
|
|
277
|
+
// tslint:disable-next-line:no-shadowed-variable
|
|
278
|
+
factory.transaction = TransactionFactory;
|
|
276
279
|
})(factory = exports.factory || (exports.factory = {}));
|
package/package.json
CHANGED