import DB from "../database"; import { ModelDataBase } from "@hibas123/safe_mongo/lib/model"; import { ObjectId } from "mongodb"; export interface IGrant extends ModelDataBase { user: ObjectId; client: ObjectId; permissions: ObjectId[]; } const Grant = DB.addModel({ name: "grant", versions: [ { migration: () => { }, schema: { user: { type: ObjectId }, client: { type: ObjectId }, permissions: { type: ObjectId, array: true }, }, }, ], }); export default Grant;