Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
121 changes: 121 additions & 0 deletions backend/src/entities/education.entity.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,121 @@
import {
Entity,
PrimaryGeneratedColumn,
Column,
CreateDateColumn,
UpdateDateColumn,
} from "typeorm";
import { Field, ID, ObjectType } from "type-graphql";
import { Length } from "class-validator";

@ObjectType()
@Entity()
export class Education {
@Field(() => ID)
@PrimaryGeneratedColumn()
id: number;

@Field()
@Column({ length: 100 })
@Length(1, 100, {
message: "TitleFR must have between 1 to 100 characters",
})
titleFR: string;

@Field()
@Column({ length: 50 })
@Length(1, 50, {
message: "TtitleEN must have between 1 to 50 characters",
})
titleEN: string;

@Field()
@Column({ length: 50 })
@Length(1, 50, {
message: "DiplomateFR must have between 1 to 50 characters",
})
diplomaLevelFR: string;

@Field()
@Column({ length: 50 })
@Length(1, 50, {
message: "DiplomateEN must have between 1 to 50 characters",
})
diplomaLevelEN: string;

@Field()
@Column({ length: 50 })
@Length(1, 50, {
message: "Shool must have between 1 to 50 characters",
})
school: string;

@Field()
@Column({ length: 50 })
@Length(1, 50, {
message: "Location must have between 1 to 50 characters",
})
location: string;

@Field()
@Column({ type: "int" })
year: number;

@Field()
@Column({ length: 20 })
@Length(1, 20, {
message: "StartDateEN must have between 1 to 20 characters",
})
startDateEN: string;

@Field()
@Column({ length: 20 })
@Length(1, 20, {
message: "StartDateFR must have between 1 to 20 characters",
})
startDateFR: string;

@Field()
@Column({ length: 20 })
@Length(1, 20, {
message: "EndDateEN must have between 1 to 20 characters",
})
endDateEN: string;

@Field()
@Column({ length: 20 })
@Length(1, 20, {
message: "EndDateFR must have between 1 to 20 characters",
})
endDateFR: string;

@Field({ nullable: true })
@Column({ nullable: true, type: "int" })
month: number | null;

@Field()
@Column({ length: 30 })
@Length(1, 30, {
message: "TypeEN must have between 1 to 30 characters",
})
typeEN: string;

@Field()
@Column({ length: 30 })
@Length(1, 30, {
message: "TypeFR must have between 1 to 30 characters",
})
typeFR: string;

@Field()
@CreateDateColumn({ default: () => "CURRENT_TIMESTAMP" })
created_at: Date;

@Field()
@UpdateDateColumn({
name: "updated_at",
default: () => "CURRENT_TIMESTAMP",
onUpdate: "CURRENT_TIMESTAMP",
})
updated_at: Date;
}
110 changes: 110 additions & 0 deletions backend/src/entities/experience.entity.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,110 @@
import {
Entity,
PrimaryGeneratedColumn,
Column,
CreateDateColumn,
UpdateDateColumn,
} from "typeorm";
import { Field, ID, ObjectType } from "type-graphql";
import { Length } from "class-validator";

@ObjectType()
@Entity()
export class Experience {
@Field(() => ID)
@PrimaryGeneratedColumn()
id: number;

@Field()
@Column({ length: 100 })
@Length(1, 40, {
message: "JobEN must have between 1 to 40 characters",
})
jobEN: string;

@Field()
@Column({ length: 100 })
@Length(1, 40, {
message: "JobFR must have between 1 to 40 characters",
})
jobFR: string;

@Field()
@Column({ length: 25 })
@Length(1, 25, {
message: "Business must have between 1 to 25 characters",
})
business: string;

@Field({ nullable: true })
@Column({ length: 50, nullable: true })
@Length(1, 50, {
message: "EmploymentContractEN must have between 1 to 50 characters",
})
employmentContractEN: string | null;

@Field({ nullable: true })
@Column({ length: 100, nullable: true })
@Length(1, 50, {
message: "EmploymentContractFR must have between 1 to 50 characters",
})
employmentContractFR: string | null;

@Field()
@Column({ length: 20 })
@Length(1, 20, {
message: "StartDateEN must have between 1 to 20 characters",
})
startDateEN: string;

@Field()
@Column({ length: 20 })
@Length(1, 20, {
message: "StartDateFR must have between 1 to 20 characters",
})
startDateFR: string;

@Field()
@Column({ length: 20 })
@Length(1, 20, {
message: "EndDateEN must have between 1 to 20 characters",
})
endDateEN: string;

@Field()
@Column({ length: 20 })
@Length(1, 20, {
message: "EndDateFR must have between 1 to 20 characters",
})
endDateFR: string;

@Field({ nullable: true })
@Column({ nullable: true, type: "int" })
month: number | null;

@Field()
@Column({ length: 50 })
@Length(1, 50, {
message: "TypeEN must have between 1 to 50 characters",
})
typeEN: string;

@Field()
@Column({ length: 50 })
@Length(1, 50, {
message: "TypeFR must have between 1 to 50 characters",
})
typeFR: string;

@Field()
@CreateDateColumn({ default: () => "CURRENT_TIMESTAMP" })
created_at: Date;

@Field()
@UpdateDateColumn({
name: "updated_at",
default: () => "CURRENT_TIMESTAMP",
onUpdate: "CURRENT_TIMESTAMP",
})
updated_at: Date;
}
67 changes: 67 additions & 0 deletions backend/src/entities/project.entity.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
import {
Entity,
PrimaryGeneratedColumn,
Column,
ManyToMany,
JoinTable,
CreateDateColumn,
UpdateDateColumn,
} from "typeorm";
import { Field, ID, ObjectType } from "type-graphql";
import { SkillSubItem } from "./skillSubItem.entity";
import { Length } from "class-validator";

@ObjectType()
@Entity()
export class Project {
@Field(() => ID)
@PrimaryGeneratedColumn()
id: number;

@Field()
@Column({ length: 100 })
@Length(1, 100, {
message: "Title must have between 1 to 100 characters",
})
title: string;

@Field()
@Column("text")
descriptionFR: string;

@Field()
@Column("text")
descriptionEN: string;

@Field()
@Column({ length: 50 })
@Length(1, 50, {
message: "TypeDisplay must have between 1 to 50 characters",
})
typeDisplay: string;

@Field({ nullable: true })
@Column({ nullable: true })
github: string | null;

@Field()
@Column("text")
contentDisplay: string;

@Field(() => [SkillSubItem])
@ManyToMany(() => SkillSubItem, { cascade: true })
@JoinTable()
skills: SkillSubItem[];

@Field()
@CreateDateColumn({ default: () => "CURRENT_TIMESTAMP" })
created_at: Date;

@Field()
@UpdateDateColumn({
name: "updated_at",
default: () => "CURRENT_TIMESTAMP",
onUpdate: "CURRENT_TIMESTAMP",
})
updated_at: Date;
}
51 changes: 51 additions & 0 deletions backend/src/entities/skill.entity.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
import {
Entity,
PrimaryGeneratedColumn,
CreateDateColumn,
Column,
UpdateDateColumn,
OneToMany,
} from "typeorm";
import { Length } from "class-validator";
import { Field, ID, ObjectType } from "type-graphql";
import { SkillSubItem } from "./skillSubItem.entity";

@ObjectType()
@Entity()
export class Skill {
@Field(() => ID)
@PrimaryGeneratedColumn()
id: number;

@Field()
@Column({ length: 50 })
@Length(1, 50, {
message: "Category must have between 1 to 50 characters",
})
categoryFR: string;

@Field()
@Column({ length: 50 })
@Length(1, 50, {
message: "Category must have between 1 to 50 characters",
})
categoryEN: string;

@Field(() => [SkillSubItem])
@OneToMany(() => SkillSubItem, (skillSubItem) => skillSubItem.skill, {
cascade: true,
})
skills: SkillSubItem[];

@Field()
@CreateDateColumn({ default: () => "CURRENT_TIMESTAMP" })
created_at: Date;

@Field()
@UpdateDateColumn({
name: "updated_at",
default: () => "CURRENT_TIMESTAMP",
onUpdate: "CURRENT_TIMESTAMP",
})
update_at: Date;
}
32 changes: 32 additions & 0 deletions backend/src/entities/skillSubItem.entity.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
import {
Entity,
PrimaryGeneratedColumn,
Column,
ManyToOne,
} from "typeorm";
import { Field, ID, ObjectType } from "type-graphql";
import { Skill } from "./skill.entity";

@ObjectType()
@Entity()
export class SkillSubItem {
@Field(() => ID)
@PrimaryGeneratedColumn()
id: number;

@Field()
@Column({ length: 50 })
name: string;

@Field()
@Column({ nullable: true })
image: string;

@Field()
@Column({ length: 50 })
category: string;

@Field(() => Skill)
@ManyToOne(() => Skill, (skill) => skill.skills)
skill: Skill;
}
1 change: 0 additions & 1 deletion backend/src/entities/user.entity.ts

This file was deleted.

Loading