29 lines
959 B
TypeScript
29 lines
959 B
TypeScript
import { String, Text, Price, Datetime } 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 User } from './User';
|
|
import { Schema as Pay } from './Pay';
|
|
import { Schema as AccountOper } from './AccountOper';
|
|
import { Schema as Withdraw } from './Withdraw';
|
|
export interface Schema extends EntityShape {
|
|
withdraw?: Withdraw;
|
|
loss: Price;
|
|
pay: Pay;
|
|
meta?: Object;
|
|
externalMeta?: Object;
|
|
externalId?: String<128>;
|
|
price: Price;
|
|
creator: User;
|
|
reason?: Text;
|
|
successAt?: Datetime;
|
|
opers: AccountOper[];
|
|
}
|
|
export type IAction = 'succeed' | 'fail';
|
|
export type IState = 'refunding' | 'successful' | 'failed';
|
|
export declare const IActionDef: ActionDef<IAction, IState>;
|
|
type Action = IAction;
|
|
export declare const entityDesc: EntityDesc<Schema, Action, '', {
|
|
iState: IState;
|
|
}>;
|
|
export {};
|