Skip to content

Commit

Permalink
CHE-40 Created registrations model and associated type file
Browse files Browse the repository at this point in the history
  • Loading branch information
brok3turtl3 committed Mar 26, 2024
1 parent 4248956 commit e8b571a
Show file tree
Hide file tree
Showing 2 changed files with 52 additions and 0 deletions.
40 changes: 40 additions & 0 deletions server/models/graduateInvitationModel.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
import mongoose from "mongoose";
import { IGraduateInvitation } from "../types/graduateInvitation";

const graduateInvitationSchema = new mongoose.Schema<IGraduateInvitation>({
email: {
type: String,
required: true,
unique: true,
},
token: {
type: String,
required: true,
},
tokenExpiry: {
type: Date,
required: true,
},
isRegistered: {
type: Boolean,
required: true,
default: false,
},
createdAt: {
type: Date,
default: Date.now,
},
name: String,
registeredAt: Date,
lastEmailSent: {
type: Date,
default: Date.now,
},
});

const GraduateInvitation = mongoose.model<IGraduateInvitation>(
"GraduateInvitation",
graduateInvitationSchema
);

export default GraduateInvitation;
12 changes: 12 additions & 0 deletions server/types/graduateInvitation.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import { Document } from "mongoose";

export interface IGraduateInvitation extends Document {
email: string;
token: string;
tokenExpiry: Date;
isRegistered: boolean;
createdAt?: Date;
name?: string;
registeredAt?: Date;
lastEmailSent?: Date;
}

0 comments on commit e8b571a

Please sign in to comment.