58 lines
1.7 KiB
TypeScript
58 lines
1.7 KiB
TypeScript
import { ForeignKey } from "oak-domain/lib/types/DataType";
|
|
import { Q_DateValue, Q_NumberValue, Q_StringValue, Q_EnumValue, NodeId, ExprOp, ExpressionKey } from "oak-domain/lib/types/Demand";
|
|
import { MakeAction as OakMakeAction, EntityShape } from "oak-domain/lib/types/Entity";
|
|
import { Action, ParticularAction, IState } from "./Action";
|
|
import { Datetime, Price } from "oak-domain/lib/types/DataType";
|
|
export type OpSchema = EntityShape & {
|
|
when?: Datetime | null;
|
|
orderId: ForeignKey<"order">;
|
|
price: Price;
|
|
settledAt?: Datetime | null;
|
|
closedAt?: Datetime | null;
|
|
iState: IState;
|
|
} & {
|
|
[A in ExpressionKey]?: any;
|
|
};
|
|
export type OpAttr = keyof OpSchema;
|
|
export type OpFilter = {
|
|
id: Q_StringValue;
|
|
$$createAt$$: Q_DateValue;
|
|
$$seq$$: Q_NumberValue;
|
|
$$updateAt$$: Q_DateValue;
|
|
when: Q_DateValue;
|
|
orderId: Q_StringValue;
|
|
price: Q_NumberValue;
|
|
settledAt: Q_DateValue;
|
|
closedAt: Q_DateValue;
|
|
iState: Q_EnumValue<IState>;
|
|
} & ExprOp<OpAttr | string>;
|
|
export type OpProjection = {
|
|
"#id"?: NodeId;
|
|
[k: string]: any;
|
|
id?: number;
|
|
$$createAt$$?: number;
|
|
$$updateAt$$?: number;
|
|
$$seq$$?: number;
|
|
when?: number;
|
|
orderId?: number;
|
|
price?: number;
|
|
settledAt?: number;
|
|
closedAt?: number;
|
|
iState?: number;
|
|
} & Partial<ExprOp<OpAttr | string>>;
|
|
export type OpSortAttr = Partial<{
|
|
id: number;
|
|
$$createAt$$: number;
|
|
$$seq$$: number;
|
|
$$updateAt$$: number;
|
|
when: number;
|
|
orderId: number;
|
|
price: number;
|
|
settledAt: number;
|
|
closedAt: number;
|
|
iState: number;
|
|
[k: string]: any;
|
|
} | ExprOp<OpAttr | string>>;
|
|
export type OpAction = OakMakeAction<Action | string>;
|
|
export type OpUpdateAction = "update" | ParticularAction | string;
|