120 lines
3.5 KiB
TypeScript
120 lines
3.5 KiB
TypeScript
import { ForeignKey } from "oak-domain/lib/types/DataType";
|
|
import { Q_DateValue, Q_BooleanValue, 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 { Price, String, Datetime, Boolean, Int } from "oak-domain/lib/types/DataType";
|
|
export type OpSchema = EntityShape & {
|
|
price: Price;
|
|
paid: Price;
|
|
refunded: Price;
|
|
entity: "account" | "apProduct" | "offlineAccount" | "wpProduct" | string;
|
|
entityId: String<64>;
|
|
timeoutAt?: Datetime | null;
|
|
successAt?: Datetime | null;
|
|
forbidRefundAt?: Datetime | null;
|
|
refundable: Boolean;
|
|
depositId?: ForeignKey<"deposit"> | null;
|
|
orderId?: ForeignKey<"order"> | null;
|
|
externalId?: String<80> | null;
|
|
meta: Object;
|
|
applicationId: ForeignKey<"application">;
|
|
creatorId: ForeignKey<"user">;
|
|
phantom1?: String<32> | null;
|
|
phantom2?: String<32> | null;
|
|
phantom3?: Int<4> | null;
|
|
phantom4?: Int<8> | null;
|
|
phantom5?: Object | null;
|
|
autoStart?: Boolean | 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;
|
|
price: Q_NumberValue;
|
|
paid: Q_NumberValue;
|
|
refunded: Q_NumberValue;
|
|
entity: Q_EnumValue<"account" | "apProduct" | "offlineAccount" | "wpProduct" | string>;
|
|
entityId: Q_StringValue;
|
|
timeoutAt: Q_DateValue;
|
|
successAt: Q_DateValue;
|
|
forbidRefundAt: Q_DateValue;
|
|
refundable: Q_BooleanValue;
|
|
depositId: Q_StringValue;
|
|
orderId: Q_StringValue;
|
|
externalId: Q_StringValue;
|
|
meta: Object;
|
|
applicationId: Q_StringValue;
|
|
creatorId: Q_StringValue;
|
|
phantom1: Q_StringValue;
|
|
phantom2: Q_StringValue;
|
|
phantom3: Q_NumberValue;
|
|
phantom4: Q_NumberValue;
|
|
phantom5: Object;
|
|
autoStart: Q_BooleanValue;
|
|
iState: Q_EnumValue<IState>;
|
|
} & ExprOp<OpAttr | string>;
|
|
export type OpProjection = {
|
|
"#id"?: NodeId;
|
|
[k: string]: any;
|
|
id?: number;
|
|
$$createAt$$?: number;
|
|
$$updateAt$$?: number;
|
|
$$seq$$?: number;
|
|
price?: number;
|
|
paid?: number;
|
|
refunded?: number;
|
|
entity?: number;
|
|
entityId?: number;
|
|
timeoutAt?: number;
|
|
successAt?: number;
|
|
forbidRefundAt?: number;
|
|
refundable?: number;
|
|
depositId?: number;
|
|
orderId?: number;
|
|
externalId?: number;
|
|
meta?: number | Object;
|
|
applicationId?: number;
|
|
creatorId?: number;
|
|
phantom1?: number;
|
|
phantom2?: number;
|
|
phantom3?: number;
|
|
phantom4?: number;
|
|
phantom5?: number | Object;
|
|
autoStart?: number;
|
|
iState?: number;
|
|
} & Partial<ExprOp<OpAttr | string>>;
|
|
export type OpSortAttr = Partial<{
|
|
id: number;
|
|
$$createAt$$: number;
|
|
$$seq$$: number;
|
|
$$updateAt$$: number;
|
|
price: number;
|
|
paid: number;
|
|
refunded: number;
|
|
entity: number;
|
|
entityId: number;
|
|
timeoutAt: number;
|
|
successAt: number;
|
|
forbidRefundAt: number;
|
|
refundable: number;
|
|
depositId: number;
|
|
orderId: number;
|
|
externalId: number;
|
|
applicationId: number;
|
|
creatorId: number;
|
|
phantom1: number;
|
|
phantom2: number;
|
|
phantom3: number;
|
|
phantom4: number;
|
|
autoStart: number;
|
|
iState: number;
|
|
[k: string]: any;
|
|
} | ExprOp<OpAttr | string>>;
|
|
export type OpAction = OakMakeAction<Action | string>;
|
|
export type OpUpdateAction = "update" | ParticularAction | string;
|