-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
CHE-40 Created registrations model and associated type file
- Loading branch information
1 parent
4248956
commit e8b571a
Showing
2 changed files
with
52 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; | ||
} |