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

46 lines
1.7 KiB
TypeScript
Raw Permalink 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 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为nulldeposit指向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 {};