@chevre/domain
Version:
Chevre Domain Library for Node.js
52 lines (51 loc) • 1.59 kB
TypeScript
import * as factory from '../../factory';
import type { AssetTransactionRepo } from '../../repo/assetTransaction';
import type { ProductRepo } from '../../repo/product';
import type { ProjectRepo } from '../../repo/project';
import type { TaskRepo } from '../../repo/task';
export type IStartOperation<T> = (repos: {
product: ProductRepo;
project: ProjectRepo;
assetTransaction: AssetTransactionRepo;
}) => Promise<T>;
export type ITaskAndTransactionOperation<T> = (repos: {
task: TaskRepo;
assetTransaction: AssetTransactionRepo;
}) => Promise<T>;
export type IConfirmOperation<T> = (repos: {
assetTransaction: AssetTransactionRepo;
}) => Promise<T>;
export type ICancelOperation<T> = (repos: {
assetTransaction: AssetTransactionRepo;
}) => Promise<T>;
/**
* 取引開始
* Pecorinoサービスを利用して口座取引を開始する
*/
export declare function start(params: factory.assetTransaction.moneyTransfer.IStartParamsWithoutDetail): IStartOperation<factory.assetTransaction.moneyTransfer.ITransaction>;
/**
* 取引確定
*/
export declare function confirm(params: {
id?: string;
transactionNumber?: string;
}): IConfirmOperation<void>;
/**
* 取引中止
*/
export declare function cancel(params: {
id?: string;
transactionNumber?: string;
}): ICancelOperation<void>;
/**
* 取引のタスク出力
*/
export declare function exportTasksById(params: {
id: string;
/**
* タスク実行日時バッファ
*/
runsTasksAfterInSeconds?: number;
}): ITaskAndTransactionOperation<{
id: string;
}[]>;