26 lines
889 B
TypeScript
26 lines
889 B
TypeScript
import { Text, Price } 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 Account } from './Account';
|
|
import { Schema as AccountOper } from './AccountOper';
|
|
import { Schema as User } from './User';
|
|
export interface Schema extends EntityShape {
|
|
account: Account;
|
|
price: Price;
|
|
loss: Price;
|
|
dealPrice: Price;
|
|
dealLoss: Price;
|
|
opers: AccountOper[];
|
|
creator: User;
|
|
reason?: Text;
|
|
meta?: Object;
|
|
}
|
|
type IState = 'withdrawing' | 'successful' | 'partiallySuccessful' | 'failed' | 'applying';
|
|
type IAction = 'succeed' | 'fail' | 'succeedPartially';
|
|
export declare const IActionDef: ActionDef<IAction, IState>;
|
|
type Action = IAction;
|
|
export declare const entityDesc: EntityDesc<Schema, Action, '', {
|
|
iState: IState;
|
|
}>;
|
|
export {};
|