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

36 lines
1.3 KiB
TypeScript

import { String, Datetime, Int } from 'oak-domain/lib/types/DataType';
import { EntityShape } from 'oak-domain/lib/types/Entity';
import { ActionDef, EntityDesc } from 'oak-domain/lib/types';
import { Schema as ShipService } from './ShipService';
import { Schema as Address } from 'oak-general-business/lib/entities/Address';
type Paths = Array<{
time: number;
action: string;
}>;
export interface Schema extends EntityShape {
type: 'virtual' | 'pickup' | 'express';
shipService?: ShipService;
to?: Address;
from?: Address;
entity?: String<32>;
entityId?: String<64>;
phantom1?: String<32>;
phantom2?: String<32>;
phantom3?: Int<4>;
phantom4?: Int<8>;
phantom5?: Object;
extraShipId?: String<128>;
extraPaths?: Paths;
receiveAt?: Datetime;
}
export type IState = 'unshipped' | 'shipping' | 'cancelled' | 'received' | 'rejected' | 'unknown' | 'receiving';
export type IAction = 'ship' | 'receive' | 'cancel' | 'reject' | 'unknow' | 'startReceiving' | 'succeedReceiving';
export declare const IActionDef: ActionDef<IAction, IState>;
export type EAction = 'syncState' | 'syncPaths' | 'syncAll' | 'print';
export type Action = IAction | EAction;
export declare const entityDesc: EntityDesc<Schema, Action, '', {
iState: IState;
type: Schema['type'];
}>;
export {};