Skip to content

Commit

Permalink
templates support
Browse files Browse the repository at this point in the history
  • Loading branch information
jackgarritano committed Apr 16, 2024
1 parent c4590b4 commit b9bd321
Showing 1 changed file with 11 additions and 6 deletions.
17 changes: 11 additions & 6 deletions src/models/resume.model.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,24 @@ import mongoose from "mongoose";

const Schema = mongoose.Schema;

export enum templates {
JAKES = "jakes",
BLUE = "blue",
}

//typescript type corresponding with the mongoose schema structure
export interface resumeType extends mongoose.Document {
user: string;
itemName: string;
user: string;
itemName: string;
itemIds: mongoose.Types.ObjectId[];
templateId: mongoose.Types.ObjectId;
templateId: templates;
}

const Resume = new Schema<resumeType>({
user: { type: String, required: true },
itemName: { type: String, required: true },
user: { type: String, required: true },
itemName: { type: String, required: true },
itemIds: { type: [Schema.Types.ObjectId], required: true },
templateId: { type: Schema.Types.ObjectId, required: false, default: null },
templateId: { type: String, enum: Object.values(templates), required: true, default: templates.JAKES },
});

export const ResumeModel = mongoose.model("Resume", Resume);

0 comments on commit b9bd321

Please sign in to comment.