-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
115 additions
and
2 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,2 @@ | ||
dist | ||
.prettierrc |
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
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,49 @@ | ||
export interface Talent { | ||
name: string; | ||
email: string; | ||
hashedPassword: string; | ||
experience?: Array<Experience>; | ||
skill?: Array<string>; | ||
education?: Array<Education>; | ||
hasOffer: boolean; | ||
rank: number; | ||
socials?: Array<string>; | ||
github?: string; | ||
bio?: string; | ||
profileImg?: string; | ||
certifications?: Array<Certification>; | ||
projects?: Array<Project>; | ||
createdAt?: Date; | ||
updatedAt?: Date; | ||
} | ||
|
||
export interface Experience { | ||
jobTitle: string; | ||
city: string; | ||
country: string; | ||
employer?: string; | ||
startDate: Date; | ||
endDate?: Date; | ||
description?: string; | ||
} | ||
|
||
export interface Education { | ||
degree: string; | ||
school: string; | ||
country: string; | ||
city: string; | ||
description: string; | ||
startDate: Date; | ||
endDate?: Date; | ||
} | ||
|
||
export interface Certification { | ||
title: string; | ||
link: string; | ||
} | ||
|
||
export interface Project { | ||
name: string; | ||
description: string; | ||
link: string; | ||
} |
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,62 @@ | ||
import { model, Schema } from 'mongoose'; | ||
import { | ||
Certification, | ||
Education, | ||
Experience, | ||
Project, | ||
Talent, | ||
} from '../interfaces/talentInterface'; | ||
|
||
const experienceSchema = new Schema<Experience>( | ||
{ | ||
jobTitle: String, | ||
description: String, | ||
employer: String, | ||
city: String, | ||
country: String, | ||
startDate: Schema.Types.Date, | ||
endDate: Schema.Types.Date, | ||
}, | ||
{ _id: false }, | ||
); | ||
const educationSchema = new Schema<Education>( | ||
{ | ||
degree: String, | ||
description: String, | ||
city: String, | ||
country: String, | ||
startDate: Schema.Types.Date, | ||
endDate: Schema.Types.Date, | ||
school: String, | ||
}, | ||
{ _id: false }, | ||
); | ||
const certificationSchema = new Schema<Certification>( | ||
{ link: String, title: String }, | ||
{ _id: false }, | ||
); | ||
const projectSchema = new Schema<Project>( | ||
{ name: String, description: String, link: String }, | ||
{ _id: false }, | ||
); | ||
|
||
const talentSchema = new Schema<Talent>({ | ||
name: { type: String, required: true }, | ||
email: { type: String, required: true }, | ||
hashedPassword: { type: String, required: true }, | ||
experience: [experienceSchema], | ||
skill: [String], | ||
education: [educationSchema], | ||
bio: String, | ||
certifications: [certificationSchema], | ||
github: String, | ||
socials: [String], | ||
hasOffer: { type: Boolean, default: false }, | ||
profileImg: String, | ||
rank: { type: Number, default: 0 }, | ||
projects: [projectSchema], | ||
}); | ||
|
||
const Talent = model<Talent>('talents', talentSchema); | ||
|
||
export default Talent; |