@chevre/domain
Version:
Chevre Domain Library for Node.js
61 lines (60 loc) • 2.31 kB
TypeScript
import type { ActionRepo } from '../../../repo/action';
import type { AssetTransactionRepo } from '../../../repo/assetTransaction';
import type { AuthorizationRepo } from '../../../repo/authorization';
import type { ConfirmationNumberRepo } from '../../../repo/confirmationNumber';
import type { EmailMessageRepo } from '../../../repo/emailMessage';
import type { MessageRepo } from '../../../repo/message';
import type { OrderInTransactionRepo } from '../../../repo/orderInTransaction';
import type { OrderNumberRepo } from '../../../repo/orderNumber';
import type { ProjectRepo } from '../../../repo/project';
import type { SettingRepo } from '../../../repo/setting';
import type { TransactionRepo } from '../../../repo/transaction';
import * as factory from '../../../factory';
import { placeOrder as PlaceOrderFactory } from '../../../factory/transaction';
interface IConfirmOperationRepos {
action: ActionRepo;
assetTransaction: AssetTransactionRepo;
authorization: AuthorizationRepo;
emailMessage?: EmailMessageRepo;
message: MessageRepo;
project: ProjectRepo;
transaction: TransactionRepo;
orderInTransaction: OrderInTransactionRepo;
orderNumber: OrderNumberRepo;
confirmationNumber: ConfirmationNumberRepo;
setting: SettingRepo;
}
type IConfirmOperation<T> = (repos: IConfirmOperationRepos) => Promise<T>;
interface IConfirmOptions {
/**
* 確定レスポンスに予約IDを含めるかどうか(ttts対応)
*/
expectsReservationIds: boolean;
/**
* 数値を指定すると、同期的に注文コードを発行
*/
publishCodeExpiresInSeconds: number | false;
/**
* 注文における最大CreditCardIF決済方法数
*/
maxNumCreditCardPaymentMethod: number;
}
type IConfirmParams = PlaceOrderFactory.IConfirmParams;
interface IConfirmResult {
order: factory.transaction.placeOrder.IOrderAsResult;
customer: factory.order.ICustomer;
code?: string;
/**
* expectsReservationIdsの場合のみ
*/
eventId?: string;
/**
* expectsReservationIdsの場合のみ
*/
reservationIds?: string[];
}
/**
* 注文取引を確定する
*/
declare function confirm(params: IConfirmParams, options: IConfirmOptions): IConfirmOperation<IConfirmResult>;
export { confirm };