UNPKG

@chevre/domain

Version:

Chevre Domain Library for Node.js

53 lines (52 loc) 1.78 kB
import * as factory from '../../factory'; import type { ActionRepo } from '../../repo/action'; import type { AssetTransactionRepo } from '../../repo/assetTransaction'; import type { PaymentServiceRepo } from '../../repo/paymentService'; import type { PotentialActionRepo } from '../../repo/potentialAction'; import type { ProductRepo } from '../../repo/product'; import type { TaskRepo } from '../../repo/task'; export interface IStartOperationRepos { action: ActionRepo; paymentService: PaymentServiceRepo; potentialAction: PotentialActionRepo; product: ProductRepo; assetTransaction: AssetTransactionRepo; } export type IStartOperation<T> = (repos: IStartOperationRepos) => Promise<T>; export type ICancelOperation<T> = (repos: { assetTransaction: AssetTransactionRepo; }) => Promise<T>; export type IConfirmOperation<T> = (repos: { assetTransaction: AssetTransactionRepo; }) => Promise<T>; export type IExportTasksOperation<T> = (repos: { task: TaskRepo; assetTransaction: AssetTransactionRepo; }) => Promise<T>; /** * 取引開始 */ export declare function start(params: factory.assetTransaction.refund.IStartParamsWithoutDetail): IStartOperation<Pick<factory.assetTransaction.refund.ITransaction, 'id'>>; /** * 取引確定 */ export declare function confirm(params: factory.assetTransaction.refund.IConfirmParams): IConfirmOperation<void>; /** * 取引中止 */ export declare function cancel(params: { id?: string; transactionNumber?: string; }): ICancelOperation<void>; /** * 取引のタスク出力 */ export declare function exportTasksById(params: { id: string; /** * タスク実行日時バッファ */ runsTasksAfterInSeconds?: number; }): IExportTasksOperation<{ id: string; }[]>;