@chevre/domain
Version:
Chevre Domain Library for Node.js
77 lines (76 loc) • 2.16 kB
TypeScript
import * as factory from '../factory';
import type { ActionRepo } from '../repo/action';
import type { AssetTransactionRepo } from '../repo/assetTransaction';
import type { ProductRepo } from '../repo/product';
import type { ProjectRepo } from '../repo/project';
import type { TransactionNumberRepo } from '../repo/transactionNumber';
export type IAuthorizeOperation<T> = (repos: {
product: ProductRepo;
project: ProjectRepo;
assetTransaction: AssetTransactionRepo;
}) => Promise<T>;
export interface IObject {
amount: number;
description?: string;
fromLocation: {
identifier?: string;
hasNoPermit?: boolean;
issuedThrough?: {
/**
* カード発行サービスID
*/
id: string;
};
};
toLocation: {
identifier?: string;
hasNoPermit?: boolean;
issuedThrough?: {
/**
* カード発行サービスID
*/
id: string;
};
};
force: boolean;
}
/**
* 口座残高差し押さえ
*/
export declare function authorize(params: {
typeOf: factory.account.transactionType;
identifier?: string;
transactionNumber: string;
project: {
id: string;
typeOf: factory.organizationType.Project;
};
agent: factory.action.transfer.moneyTransfer.IAgent;
object: IObject;
recipient: factory.action.transfer.moneyTransfer.IRecipient;
purpose: {
typeOf: factory.assetTransactionType;
id: string;
};
}): IAuthorizeOperation<void>;
/**
* 口座承認取消
*/
export declare function cancelMoneyTransfer(params: {
purpose: {
typeOf: factory.assetTransactionType;
id: string;
};
}): (repos: {
product: ProductRepo;
assetTransaction: AssetTransactionRepo;
}) => Promise<void>;
export declare function moneyTransfer(params: factory.task.moneyTransfer.IData): (repos: {
action: ActionRepo;
product: ProductRepo;
transactionNumber: TransactionNumberRepo;
}) => Promise<void>;
/**
* 返金後のアクション
* @param refundActionAttributes 返金アクション属性
*/