From 6909c132252917ce8db20ca66fe4ba17438c8b0a Mon Sep 17 00:00:00 2001 From: Mathias Wagner Date: Sat, 14 Jan 2023 23:15:39 +0100 Subject: [PATCH] Created the Group.ts model --- src/models/Group.ts | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 src/models/Group.ts diff --git a/src/models/Group.ts b/src/models/Group.ts new file mode 100644 index 0000000..79ee55b --- /dev/null +++ b/src/models/Group.ts @@ -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({ + projectId: { + type: Types.ObjectId, + required: true + }, + name: { + type: String, + required: true + }, + description: { + type: String, + default: "Keine Beschreibung angegeben" + }, + permissions: [String] +}); + +export const Group = model('groups', GroupSchema); \ No newline at end of file