Created the Group.ts model

This commit is contained in:
Mathias Wagner 2023-01-14 23:15:39 +01:00
parent 3dc20be029
commit 6909c13225
Signed by: Mathias
GPG Key ID: B8DC354B0A1F5B44

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

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