import { ForeignKey } from "oak-domain/lib/types/DataType"; import { Q_DateValue, Q_NumberValue, Q_StringValue, Q_EnumValue, NodeId, MakeFilter, ExprOp, ExpressionKey } from "oak-domain/lib/types/Demand"; import { OneOf } from "oak-domain/lib/types/Polyfill"; import { FormCreateData, FormUpdateData, DeduceAggregation, Operation as OakOperation, Selection as OakSelection, 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"; import * as Account from "../Account/Schema"; import * as Deposit from "../Deposit/Schema"; import * as Order from "../Order/Schema"; import * as Pay from "../Pay/Schema"; import * as Refund from "../Refund/Schema"; import * as Withdraw from "../Withdraw/Schema"; import * as WithdrawTransfer from "../WithdrawTransfer/Schema"; type Type = "deposit" | "withdraw" | "consume" | "consumeBack" | "loan" | "repay" | "withdrawBack" | "earn" | "encash" | "cutoffRefundable" | "tax" | "taxRefund" | "refund" | "refundFailure"; export type OpSchema = EntityShape & { accountId: ForeignKey<"account">; type: Type; totalPlus: Price; availPlus: Price; refundablePlus?: Price | null; total: Price; avail: Price; refundable: Price; entity: "deposit" | "order" | "pay" | "refund" | "withdraw" | "withdrawTransfer" | string; entityId: String<64>; }; export type OpAttr = keyof OpSchema; export type Schema = OpSchema & { account: Account.Schema; deposit?: Deposit.Schema; order?: Order.Schema; pay?: Pay.Schema; refund?: Refund.Schema; withdraw?: Withdraw.Schema; withdrawTransfer?: WithdrawTransfer.Schema; } & { [A in ExpressionKey]?: any; }; type AttrFilter = { id: Q_StringValue; $$createAt$$: Q_DateValue; $$seq$$: Q_NumberValue; $$updateAt$$: Q_DateValue; accountId: Q_StringValue; account: Account.Filter; type: Q_EnumValue; totalPlus: Q_NumberValue; availPlus: Q_NumberValue; refundablePlus: Q_NumberValue; total: Q_NumberValue; avail: Q_NumberValue; refundable: Q_NumberValue; entity: Q_EnumValue<"deposit" | "order" | "pay" | "refund" | "withdraw" | "withdrawTransfer" | string>; entityId: Q_StringValue; deposit: Deposit.Filter; order: Order.Filter; pay: Pay.Filter; refund: Refund.Filter; withdraw: Withdraw.Filter; withdrawTransfer: WithdrawTransfer.Filter; }; export type Filter = MakeFilter>; export type Projection = { "#id"?: NodeId; [k: string]: any; id?: number; $$createAt$$?: number; $$updateAt$$?: number; $$seq$$?: number; accountId?: number; account?: Account.Projection; type?: number; totalPlus?: number; availPlus?: number; refundablePlus?: number; total?: number; avail?: number; refundable?: number; entity?: number; entityId?: number; deposit?: Deposit.Projection; order?: Order.Projection; pay?: Pay.Projection; refund?: Refund.Projection; withdraw?: Withdraw.Projection; withdrawTransfer?: WithdrawTransfer.Projection; } & Partial>; type AccountOperIdProjection = OneOf<{ id: number; }>; type AccountIdProjection = OneOf<{ accountId: number; }>; type DepositIdProjection = OneOf<{ entityId: number; }>; type OrderIdProjection = OneOf<{ entityId: number; }>; type PayIdProjection = OneOf<{ entityId: number; }>; type RefundIdProjection = OneOf<{ entityId: number; }>; type WithdrawIdProjection = OneOf<{ entityId: number; }>; type WithdrawTransferIdProjection = OneOf<{ entityId: number; }>; export type SortAttr = { id: number; } | { $$createAt$$: number; } | { $$seq$$: number; } | { $$updateAt$$: number; } | { accountId: number; } | { account: Account.SortAttr; } | { type: number; } | { totalPlus: number; } | { availPlus: number; } | { refundablePlus: number; } | { total: number; } | { avail: number; } | { refundable: number; } | { entity: number; } | { entityId: number; } | { deposit: Deposit.SortAttr; } | { order: Order.SortAttr; } | { pay: Pay.SortAttr; } | { refund: Refund.SortAttr; } | { withdraw: Withdraw.SortAttr; } | { withdrawTransfer: WithdrawTransfer.SortAttr; } | { [k: string]: any; } | OneOf>; export type SortNode = { $attr: SortAttr; $direction?: "asc" | "desc"; }; export type Sorter = SortNode[]; export type SelectOperation

= OakSelection<"select", P, Filter, Sorter>; export type Selection

= SelectOperation

; export type Aggregation = DeduceAggregation; export type CreateOperationData = FormCreateData> & (({ accountId?: never; account: Account.CreateSingleOperation; } | { accountId: ForeignKey<"account">; account?: Account.UpdateOperation; } | { account?: never; accountId: ForeignKey<"account">; })) & ({ entity?: never; entityId?: never; deposit: Deposit.CreateSingleOperation; } | { entity: "deposit"; entityId: ForeignKey<"Deposit">; deposit?: Deposit.UpdateOperation; } | { entity: "deposit"; entityId: ForeignKey<"Deposit">; deposit?: never; } | { entity?: never; entityId?: never; order: Order.CreateSingleOperation; } | { entity: "order"; entityId: ForeignKey<"Order">; order?: Order.UpdateOperation; } | { entity: "order"; entityId: ForeignKey<"Order">; order?: never; } | { entity?: never; entityId?: never; pay: Pay.CreateSingleOperation; } | { entity: "pay"; entityId: ForeignKey<"Pay">; pay?: Pay.UpdateOperation; } | { entity: "pay"; entityId: ForeignKey<"Pay">; pay?: never; } | { entity?: never; entityId?: never; refund: Refund.CreateSingleOperation; } | { entity: "refund"; entityId: ForeignKey<"Refund">; refund?: Refund.UpdateOperation; } | { entity: "refund"; entityId: ForeignKey<"Refund">; refund?: never; } | { entity?: never; entityId?: never; withdraw: Withdraw.CreateSingleOperation; } | { entity: "withdraw"; entityId: ForeignKey<"Withdraw">; withdraw?: Withdraw.UpdateOperation; } | { entity: "withdraw"; entityId: ForeignKey<"Withdraw">; withdraw?: never; } | { entity?: never; entityId?: never; withdrawTransfer: WithdrawTransfer.CreateSingleOperation; } | { entity: "withdrawTransfer"; entityId: ForeignKey<"WithdrawTransfer">; withdrawTransfer?: WithdrawTransfer.UpdateOperation; } | { entity: "withdrawTransfer"; entityId: ForeignKey<"WithdrawTransfer">; withdrawTransfer?: never; } | { entity?: string; entityId?: string; [K: string]: any; }); export type CreateSingleOperation = OakOperation<"create", CreateOperationData>; export type CreateMultipleOperation = OakOperation<"create", Array>; export type CreateOperation = CreateSingleOperation | CreateMultipleOperation; export type UpdateOperationData = FormUpdateData> & (({ account?: Account.CreateSingleOperation; accountId?: never; } | { account?: Account.UpdateOperation; accountId?: never; } | { account?: Account.RemoveOperation; accountId?: never; } | { account?: never; accountId?: ForeignKey<"account">; })) & ({ deposit?: Deposit.CreateSingleOperation | Deposit.UpdateOperation | Deposit.RemoveOperation; entityId?: never; entity?: never; } | { order?: Order.CreateSingleOperation | Order.UpdateOperation | Order.RemoveOperation; entityId?: never; entity?: never; } | { pay?: Pay.CreateSingleOperation | Pay.UpdateOperation | Pay.RemoveOperation; entityId?: never; entity?: never; } | { refund?: Refund.CreateSingleOperation | Refund.UpdateOperation | Refund.RemoveOperation; entityId?: never; entity?: never; } | { withdraw?: Withdraw.CreateSingleOperation | Withdraw.UpdateOperation | Withdraw.RemoveOperation; entityId?: never; entity?: never; } | { withdrawTransfer?: WithdrawTransfer.CreateSingleOperation | WithdrawTransfer.UpdateOperation | WithdrawTransfer.RemoveOperation; entityId?: never; entity?: never; } | { entity?: ("deposit" | "order" | "pay" | "refund" | "withdraw" | "withdrawTransfer" | string) | null; entityId?: ForeignKey<"Deposit" | "Order" | "Pay" | "Refund" | "Withdraw" | "WithdrawTransfer"> | null; deposit?: never; order?: never; pay?: never; refund?: never; withdraw?: never; withdrawTransfer?: never; }) & { [k: string]: any; }; export type UpdateOperation = OakOperation<"update" | string, UpdateOperationData, Filter, Sorter>; export type RemoveOperationData = {} & (({ account?: Account.UpdateOperation | Account.RemoveOperation; })) & ({ deposit?: Deposit.UpdateOperation | Deposit.RemoveOperation; } | { order?: Order.UpdateOperation | Order.RemoveOperation; } | { pay?: Pay.UpdateOperation | Pay.RemoveOperation; } | { refund?: Refund.UpdateOperation | Refund.RemoveOperation; } | { withdraw?: Withdraw.UpdateOperation | Withdraw.RemoveOperation; } | { withdrawTransfer?: WithdrawTransfer.UpdateOperation | WithdrawTransfer.RemoveOperation; } | { [k: string]: any; }); export type RemoveOperation = OakOperation<"remove", RemoveOperationData, Filter, Sorter>; export type Operation = CreateOperation | UpdateOperation | RemoveOperation; export type AccountIdSubQuery = Selection; export type DepositIdSubQuery = Selection; export type OrderIdSubQuery = Selection; export type PayIdSubQuery = Selection; export type RefundIdSubQuery = Selection; export type WithdrawIdSubQuery = Selection; export type WithdrawTransferIdSubQuery = Selection; export type AccountOperIdSubQuery = Selection; export type EntityDef = { Schema: Schema; OpSchema: OpSchema; Action: OakMakeAction | string; Selection: Selection; Aggregation: Aggregation; Operation: Operation; Create: CreateOperation; Update: UpdateOperation; Remove: RemoveOperation; CreateSingle: CreateSingleOperation; CreateMulti: CreateMultipleOperation; }; export {};