This commit is contained in:
728
2023-10-01 20:54:53 +08:00
parent 2a7451fe69
commit 9504ca8f53
2 changed files with 21 additions and 62 deletions

View File

@ -1 +1 @@
export * from "https://deno.land/x/mongo@v0.31.2/mod.ts"
export * from "https://deno.land/x/mongo@v0.32.0/mod.ts"

View File

@ -4,88 +4,47 @@ export type Id = {
nam: string,
adm1: string,
adm2: string,
intro: string,
}
export type Re = {
rej?: Usr["_id"][],
ref?: Usr["_id"][],
}
export type Rel = {
sec: Usr["_id"][],
uid: Usr["_id"][],
res?: Usr["_id"][],
}
export type Itm = {
nam: string,
rmb: number,
amt: number,
msg: string,
}
export type Mnu = {
nam: string,
utc: { start: number, end: number },
lim: { amt: number, sum: number, week: number },
itm: Itm[],
loc: { nam: string, src: string }[],
}
export type Usr = Id & Re & {
export type Usr = Id & {
nbr?: string,
sms?: { code: number, utc: number },
jwt?: string,
}
export type Agd = Id & Re & Rel & {
acc: { src: string, budget: number, fund: number, expense: number },
gol: { nam: string, pct: number }[],
img: { nam: string, src: string }[],
mnu: Mnu[],
export type Soc = Id & {
sec: Usr["_id"][],
cde: boolean,
}
export type Agd = Id & {
soc: Soc["_id"],
}
export type Soc = Id & Re & Rel
export type Rec = {
_id: { uid: Usr["_id"], aid: Agd["_id"], utc: number },
}
export type Work = Rec & Re & {
_id: { usr: Usr["_id"], soc: Soc["_id"], utc: number },
msg: string,
key: string,
amt: number,
sec?: Usr["_id"],
}
export type Video = Rec & Re & {
nam: string,
src: string,
utc?: { start: number, end: number },
}
export type Ord = Rec & {
nam: string,
itm: Itm[],
msg: "",
fin: boolean,
rev?: { uid: Usr["_id"][], mrk: number, msg: string },
loc?: Mnu["loc"][0],
rd?: Dst["_id"]["rd"],
}
export type Dst = {
_id: { rd: number, aid: Agd["_id"], uid?: Usr["_id"] },
export type Cdt = Rec & {
utc: { eft: number, exp: number }
}
export type Dbt = Rec
export type Ern = Rec
export type Md = {
export type Msg = {
_id: number,
nam: string,
utc: { pre: number, put: number },
uid: Usr["_id"],
md: string,
msg: string,
pin?: boolean,
}
export type Wsl = Md
export type Lit = Md
export type Wsl = Msg
export type Lit = Msg
export type Aut = {
_id: Usr["_id"],
aut: ("sup" | "aud" | "aut" | "wsl" | "lit")[],
}
export type Act = {
_id: string,
exp: number,
aid: Agd["_id"],
nam: string,
itm: Itm[],
rd?: Dst["_id"]["rd"],
aut: ("sup" | "aut" | "wsl" | "lit")[],
}