46 lines
1.7 KiB
TypeScript
46 lines
1.7 KiB
TypeScript
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 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';
|
||
import { Schema as Deposit } from './Deposit';
|
||
/**
|
||
* 约定:充值类pay,其orderId为null,deposit指向DEPOSIT
|
||
* 订单类pay,其orderId指向订单,deposit指向null
|
||
* entity/entityId指向充值渠道,目前支持Account/WpProduct
|
||
*/
|
||
export interface Schema extends EntityShape {
|
||
price: Price;
|
||
paid: Price;
|
||
refunded: Price;
|
||
entity: String<32>;
|
||
entityId: String<64>;
|
||
timeoutAt?: Datetime;
|
||
successAt?: Datetime;
|
||
forbidRefundAt?: Datetime;
|
||
refundable: Boolean;
|
||
deposit?: Deposit;
|
||
order?: Order;
|
||
externalId?: String<80>;
|
||
meta: Object;
|
||
application: Application;
|
||
creator: User;
|
||
phantom1?: String<32>;
|
||
phantom2?: String<32>;
|
||
phantom3?: Int<4>;
|
||
phantom4?: Int<8>;
|
||
phantom5?: Object;
|
||
opers: AccountOper[];
|
||
autoStart?: Boolean;
|
||
}
|
||
export type IAction = 'startPaying' | 'succeedPaying' | 'close' | 'startRefunding' | 'refundAll' | 'refundPartially' | 'stopRefunding';
|
||
export 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 {};
|