33 lines
1.3 KiB
TypeScript
33 lines
1.3 KiB
TypeScript
import { String, Text, Price, Boolean, 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 'oak-general-business/lib/entities/User';
|
|
import { Schema as Address } from 'oak-general-business/lib/entities/Address';
|
|
import { Schema as AccountOper } from './AccountOper';
|
|
import { Schema as System } from './System';
|
|
export interface Schema extends EntityShape {
|
|
price: Price;
|
|
paid: Price;
|
|
refunded: Price;
|
|
settled: Price;
|
|
settlePlanned: Price;
|
|
title: String<32>;
|
|
desc: Text;
|
|
timeoutAt?: Datetime;
|
|
creator: User;
|
|
entity: String<32>;
|
|
entityId: String<64>;
|
|
allowPartialPay?: Boolean;
|
|
system: System;
|
|
address?: Address;
|
|
payAt?: Datetime;
|
|
opers: AccountOper[];
|
|
}
|
|
export type IAction = 'startPaying' | 'payAll' | 'payPartially' | 'payNone' | 'timeout' | 'cancel' | 'startRefunding' | 'refundAll' | 'refundPartially' | 'refundNone';
|
|
export type IState = 'unpaid' | 'timeout' | 'cancelled' | 'paying' | 'partiallyPaid' | 'paid' | 'refunding' | 'partiallyRefunded' | 'refunded';
|
|
export declare const IActionDef: ActionDef<IAction, IState>;
|
|
export type Action = IAction;
|
|
export declare const entityDesc: EntityDesc<Schema, Action, '', {
|
|
iState: IState;
|
|
}>;
|