63 lines
2.1 KiB
TypeScript
63 lines
2.1 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 { AppendOnlyAction } from "oak-domain/lib/actions/action";
|
|
import { Price, String } from "oak-domain/lib/types/DataType";
|
|
export type SysAccountOperType = "pay" | "refund" | "withdrawTransfer" | "compensate" | "moveIn" | "moveOut";
|
|
export type OpSchema = EntityShape & {
|
|
delta: Price;
|
|
type: SysAccountOperType;
|
|
entity: "offlineAccount" | "wpAccount" | string;
|
|
entityId: String<64>;
|
|
payId?: ForeignKey<"pay"> | null;
|
|
refundId?: ForeignKey<"refund"> | null;
|
|
withdrawTransferId?: ForeignKey<"withdrawTransfer"> | null;
|
|
sysAccountMoveId?: ForeignKey<"sysAccountMove"> | null;
|
|
} & {
|
|
[A in ExpressionKey]?: any;
|
|
};
|
|
export type OpAttr = keyof OpSchema;
|
|
export type OpFilter = {
|
|
id: Q_StringValue;
|
|
$$createAt$$: Q_DateValue;
|
|
$$seq$$: Q_NumberValue;
|
|
$$updateAt$$: Q_DateValue;
|
|
delta: Q_NumberValue;
|
|
type: Q_EnumValue<SysAccountOperType>;
|
|
entity: Q_EnumValue<"offlineAccount" | "wpAccount" | string>;
|
|
entityId: Q_StringValue;
|
|
payId: Q_StringValue;
|
|
refundId: Q_StringValue;
|
|
withdrawTransferId: Q_StringValue;
|
|
sysAccountMoveId: Q_StringValue;
|
|
} & ExprOp<OpAttr | string>;
|
|
export type OpProjection = {
|
|
"#id"?: NodeId;
|
|
[k: string]: any;
|
|
id?: number;
|
|
$$createAt$$?: number;
|
|
$$updateAt$$?: number;
|
|
$$seq$$?: number;
|
|
delta?: number;
|
|
type?: number;
|
|
entity?: number;
|
|
entityId?: number;
|
|
payId?: number;
|
|
refundId?: number;
|
|
withdrawTransferId?: number;
|
|
sysAccountMoveId?: number;
|
|
} & Partial<ExprOp<OpAttr | string>>;
|
|
export type OpSortAttr = Partial<{
|
|
id: number;
|
|
$$createAt$$: number;
|
|
$$seq$$: number;
|
|
$$updateAt$$: number;
|
|
delta: number;
|
|
type: number;
|
|
entity: number;
|
|
entityId: number;
|
|
[k: string]: any;
|
|
} | ExprOp<OpAttr | string>>;
|
|
export type OpAction = OakMakeAction<AppendOnlyAction | string>;
|
|
export type OpUpdateAction = "update" | string;
|