Create Group.ts model

This commit is contained in:
Mathias Wagner
2024-07-20 12:32:03 +02:00
parent 7000eff5a0
commit 013be6b380

26
src/models/Group.ts Normal file
View File

@ -0,0 +1,26 @@
import {model, ObjectId, Schema} from "mongoose";
export interface IGroup {
projectId: ObjectId,
name: string,
description?: string,
permissions: string[]
}
const GroupSchema = new Schema<IGroup>({
projectId: {
type: String,
required: true
},
name: {
type: String,
required: true
},
description: {
type: String,
default: "No description provided"
},
permissions: [String]
});
export const Group = model<IGroup>("groups", GroupSchema);