Skip to content
Snippets Groups Projects
Commit 50f7bd91 authored by Bodor Máté's avatar Bodor Máté
Browse files

Create profile and warning schema/interface

parent 6b87344c
No related branches found
No related tags found
2 merge requests!10Feature/12 dev auto deploy,!8[Review]Feature/user
import { Document, Schema, model } from 'mongoose';
import { IWarnings, WarningSchema } from './WarningSchema';
export interface IProfile extends Document {
external_id: string,
studentCardNumber: string,
roomNumber?: string,
picture: any,
role: string,
email?: string,
name?: string,
warnings: [IWarnings] | [],
};
const ProfileSchema = new Schema({
external_id: {type: String, required: true },
studentCardNumber: {type: String, required: true },
roomNumber: {type: String},
picture: {type: String},
role: {type: String, required: true},
warnings: [WarningSchema]
});
export default model<IProfile>('News', ProfileSchema);
\ No newline at end of file
import { Schema } from 'mongoose';
export interface IWarnings extends Document{
text: string,
date: Date,
given_by: {
_id: string,
name: string,
}
}
export const WarningSchema = new Schema({
text: {type: String, required: true},
date: {type: Date, required: true},
given_by: {required: true, type: {
_id: {type: String, required: true},
name: {String, required: true},
}}
});
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment