oak-pay-business/lib/entities/Pay.d.ts

41 lines
1.6 KiB
TypeScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

import { String, Price, Boolean, Datetime, Int } from 'oak-domain/lib/types/DataType';
import { EntityShape } from 'oak-domain/lib/types/Entity';
import { EntityDesc, ActionDef } from 'oak-domain/lib/types';
import { Schema as Order } from './Order';
import { Schema as Account } from './Account';
import { Schema as AccountOper } from './AccountOper';
import { Schema as Application } from 'oak-general-business/lib/entities/Application';
import { Schema as User } from 'oak-general-business/lib/entities/User';
/**
* 约定充值类pay其orderId为nullaccountId指向要充值的帐户channel不能是ACCOUNT
* 订单类pay其orderId指向订单accountId指向付款的帐户channel必须是ACCOUNT
*/
export interface Schema extends EntityShape {
price: Price;
paid: Price;
refunded: Price;
channel: String<32>;
timeoutAt?: Datetime;
forbidRefundAt?: Datetime;
refundable: Boolean;
account?: Account;
order?: Order;
externalId?: String<80>;
meta: Object;
opers: AccountOper[];
application: Application;
creator: User;
phantom1?: String<32>;
phantom2?: String<32>;
phantom3?: Int<4>;
phantom4?: Int<8>;
}
type IAction = 'startPaying' | 'succeedPaying' | 'close' | 'startRefunding' | 'refundAll' | 'refundPartially' | 'stopRefunding';
type IState = 'unpaid' | 'paying' | 'paid' | 'closed' | 'refunding' | 'partiallyRefunded' | 'refunded';
export declare const IActionDef: ActionDef<IAction, IState>;
type Action = IAction | 'closeRefund' | 'continuePaying';
export declare const entityDesc: EntityDesc<Schema, Action, '', {
iState: IState;
}>;
export {};