first
This commit is contained in:
@@ -0,0 +1,14 @@
|
||||
export enum JobType {
|
||||
FullTime = "fullTime",
|
||||
PartTime = "partTime",
|
||||
Contract = "contract",
|
||||
}
|
||||
|
||||
export interface IJob {
|
||||
title: string;
|
||||
description: string;
|
||||
location: string;
|
||||
type: JobType;
|
||||
// salaryRange:string;
|
||||
// skillsRequired:string[]
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
import { Types } from "mongoose";
|
||||
|
||||
import { StatusEnum } from "../../../../common/enums/status.enum";
|
||||
|
||||
export interface IResume {
|
||||
job: Types.ObjectId;
|
||||
// applicant: Types.ObjectId;
|
||||
fullName: string;
|
||||
fatherName: string;
|
||||
placeOfBirth: string;
|
||||
birthday: string;
|
||||
resumeUrl: string;
|
||||
status: StatusEnum;
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
import { Schema, model } from "mongoose";
|
||||
|
||||
import { IJob, JobType } from "./Abstraction/IJob";
|
||||
|
||||
const JobSchema = new Schema<IJob>(
|
||||
{
|
||||
title: { type: String, required: true },
|
||||
description: { type: String, required: true },
|
||||
location: { type: String, required: true },
|
||||
type: { type: String, enum: JobType, required: true },
|
||||
},
|
||||
{ timestamps: true, toJSON: { versionKey: false, virtuals: true }, id: false },
|
||||
);
|
||||
|
||||
const JobModel = model<IJob>("Job", JobSchema);
|
||||
|
||||
export { JobModel };
|
||||
@@ -0,0 +1,21 @@
|
||||
import { Schema, model } from "mongoose";
|
||||
|
||||
import { IResume } from "./Abstraction/IResume";
|
||||
import { StatusEnum } from "../../../common/enums/status.enum";
|
||||
|
||||
const ResumeSchema = new Schema<IResume>(
|
||||
{
|
||||
job: { type: Schema.Types.ObjectId, ref: "Job", required: true },
|
||||
fullName: { type: String, ref: "Job", required: true },
|
||||
fatherName: { type: String, ref: "Job", required: true },
|
||||
placeOfBirth: { type: String, ref: "Job", required: true },
|
||||
birthday: { type: String, ref: "Job", required: true },
|
||||
resumeUrl: { type: String, required: true },
|
||||
status: { type: String, enum: StatusEnum, default: StatusEnum.Pending },
|
||||
},
|
||||
{ timestamps: true, toJSON: { versionKey: false, virtuals: true }, id: false },
|
||||
);
|
||||
|
||||
const ResumeModel = model<IResume>("Resume", ResumeSchema);
|
||||
|
||||
export { ResumeModel };
|
||||
Reference in New Issue
Block a user