Created the Group.ts model
This commit is contained in:
parent
3dc20be029
commit
6909c13225
26
src/models/Group.ts
Normal file
26
src/models/Group.ts
Normal 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);
|
Loading…
x
Reference in New Issue
Block a user