From a23b7160324272f17d3047b9704deb9993edcacb Mon Sep 17 00:00:00 2001 From: Alexandre Renard <16491342+Alexandre78R@users.noreply.github.com> Date: Tue, 22 Oct 2024 18:41:51 +0200 Subject: [PATCH 01/13] add security api tocken email send --- backend/src/resolvers/contact.resolver.ts | 6 ++-- docker-compose.yml | 42 +++++++++++------------ 2 files changed, 24 insertions(+), 24 deletions(-) diff --git a/backend/src/resolvers/contact.resolver.ts b/backend/src/resolvers/contact.resolver.ts index 264929e2..41b5ce30 100644 --- a/backend/src/resolvers/contact.resolver.ts +++ b/backend/src/resolvers/contact.resolver.ts @@ -32,10 +32,10 @@ export class ContactResolver { @Mutation(() => MessageType) async sendContact(@Arg("data", () => ContactFrom) data: ContactFrom, @Ctx() context: MyContext): Promise { - // if (!context.apiKey) - // throw new Error('Unauthorized TOKEN API'); + if (!context.apiKey) + throw new Error('Unauthorized TOKEN API'); - // await checkApiKey(context.apiKey); + await checkApiKey(context.apiKey); if (!checkRegex(emailRegex, data.email)) throw new Error("Invaid format email."); diff --git a/docker-compose.yml b/docker-compose.yml index f0a20fb5..06f43fd6 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -10,29 +10,29 @@ services: - WDS_SOCKET_HOST=127.0.0.1 - CHOKIDAR_USEPOLLING=true - WATCHPACK_POLLING=true - depends_on: - db: - condition: service_healthy + # depends_on: + # db: + # condition: service_healthy env_file: - ./backend/.env - db: - image: postgres:15 - ports: - - 5432:5432 - restart: always - healthcheck: - test: ["CMD-SHELL", "pg_isready -d ${POSTGRES_DB} -U ${POSTGRES_USER}"] - interval: 5s - timeout: 5s - retries: 10 - environment: - - POSTGRES_USER=${POSTGRES_USER} - - POSTGRES_PASSWORD=${POSTGRES_PASSWORD} - - POSTGRES_DB=${POSTGRES_DB} - env_file: - - ./.env - volumes: - - portfolio-data:/var/lib/postgresql/data + # db: + # image: postgres:15 + # ports: + # - 5432:5432 + # restart: always + # healthcheck: + # test: ["CMD-SHELL", "pg_isready -d ${POSTGRES_DB} -U ${POSTGRES_USER}"] + # interval: 5s + # timeout: 5s + # retries: 10 + # environment: + # - POSTGRES_USER=${POSTGRES_USER} + # - POSTGRES_PASSWORD=${POSTGRES_PASSWORD} + # - POSTGRES_DB=${POSTGRES_DB} + # env_file: + # - ./.env + # volumes: + # - portfolio-data:/var/lib/postgresql/data frontend: # build: ./frontend build: From 87e44b0f0f7e943359e35c45f0b7d5cb511ebfff Mon Sep 17 00:00:00 2001 From: Alexandre Renard <16491342+Alexandre78R@users.noreply.github.com> Date: Tue, 22 Oct 2024 18:43:52 +0200 Subject: [PATCH 02/13] delete graphql contact test query --- backend/src/resolvers/contact.resolver.ts | 6 ------ 1 file changed, 6 deletions(-) diff --git a/backend/src/resolvers/contact.resolver.ts b/backend/src/resolvers/contact.resolver.ts index 41b5ce30..2c1b2fbd 100644 --- a/backend/src/resolvers/contact.resolver.ts +++ b/backend/src/resolvers/contact.resolver.ts @@ -23,12 +23,6 @@ import { checkRegex, emailRegex } from "../regex"; @Resolver() export class ContactResolver { - @Query(() => String) - async contact(@Ctx() context: MyContext): Promise { - console.log(context) - return "ok"; - } - @Mutation(() => MessageType) async sendContact(@Arg("data", () => ContactFrom) data: ContactFrom, @Ctx() context: MyContext): Promise { From 98be7209a2b50dff773c21cb0764220972c6fa1f Mon Sep 17 00:00:00 2001 From: Alexandre Renard <16491342+Alexandre78R@users.noreply.github.com> Date: Tue, 22 Oct 2024 18:44:48 +0200 Subject: [PATCH 03/13] clear code --- backend/src/types/contact.types.ts | 2 -- 1 file changed, 2 deletions(-) diff --git a/backend/src/types/contact.types.ts b/backend/src/types/contact.types.ts index 3fe2a7e2..1180c146 100644 --- a/backend/src/types/contact.types.ts +++ b/backend/src/types/contact.types.ts @@ -10,7 +10,6 @@ export class ContactFrom { @Field() message: string; - } @ObjectType() @@ -23,5 +22,4 @@ export class ContactResponse { @Field() message: string; - } \ No newline at end of file From a534c393f9cd57097493f85e123e9ebd6b2d6160 Mon Sep 17 00:00:00 2001 From: Alexandre Renard <16491342+Alexandre78R@users.noreply.github.com> Date: Tue, 22 Oct 2024 18:58:10 +0200 Subject: [PATCH 04/13] add entity skill and skillsubitem --- backend/src/entities/skill.entity.ts | 51 +++++++++++++++++++++ backend/src/entities/skillSubItem.entity.ts | 28 +++++++++++ 2 files changed, 79 insertions(+) create mode 100644 backend/src/entities/skill.entity.ts create mode 100644 backend/src/entities/skillSubItem.entity.ts diff --git a/backend/src/entities/skill.entity.ts b/backend/src/entities/skill.entity.ts new file mode 100644 index 00000000..4ac7009b --- /dev/null +++ b/backend/src/entities/skill.entity.ts @@ -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; + } \ No newline at end of file diff --git a/backend/src/entities/skillSubItem.entity.ts b/backend/src/entities/skillSubItem.entity.ts new file mode 100644 index 00000000..584b6995 --- /dev/null +++ b/backend/src/entities/skillSubItem.entity.ts @@ -0,0 +1,28 @@ +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(() => Skill) + @ManyToOne(() => Skill, (skill) => skill.skills) + skill: Skill; + } \ No newline at end of file From b7c137ef568a4f711bca2521f8d7db6268a7b397 Mon Sep 17 00:00:00 2001 From: Alexandre Renard <16491342+Alexandre78R@users.noreply.github.com> Date: Tue, 22 Oct 2024 19:01:50 +0200 Subject: [PATCH 05/13] fix entity skillsubitem --- backend/src/entities/skillSubItem.entity.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/backend/src/entities/skillSubItem.entity.ts b/backend/src/entities/skillSubItem.entity.ts index 584b6995..2392d71b 100644 --- a/backend/src/entities/skillSubItem.entity.ts +++ b/backend/src/entities/skillSubItem.entity.ts @@ -21,6 +21,10 @@ import { @Field() @Column({ nullable: true }) image: string; + + @Field() + @Column({ length: 50 }) + category: string; @Field(() => Skill) @ManyToOne(() => Skill, (skill) => skill.skills) From 9f0f26e56df68c62efddcf027c0b1260420e6e31 Mon Sep 17 00:00:00 2001 From: Alexandre Renard <16491342+Alexandre78R@users.noreply.github.com> Date: Wed, 23 Oct 2024 21:27:18 +0200 Subject: [PATCH 06/13] add entity project --- backend/src/entities/project.entity.ts | 61 ++++++++++++++++++++++++++ 1 file changed, 61 insertions(+) create mode 100644 backend/src/entities/project.entity.ts diff --git a/backend/src/entities/project.entity.ts b/backend/src/entities/project.entity.ts new file mode 100644 index 00000000..bc1c3b40 --- /dev/null +++ b/backend/src/entities/project.entity.ts @@ -0,0 +1,61 @@ +import { + Entity, + PrimaryGeneratedColumn, + Column, + ManyToMany, + JoinTable, + CreateDateColumn, + UpdateDateColumn, + } from "typeorm"; + import { Field, ID, ObjectType } from "type-graphql"; + import { SkillSubItem } from "./skillSubItem.entity"; // Importer SkillSubItem + + @ObjectType() + @Entity() + export class Project { + @Field(() => ID) + @PrimaryGeneratedColumn() + id: number; + + @Field() + @Column({ length: 100 }) + title: string; + + @Field() + @Column("text") + descriptionFR: string; + + @Field() + @Column("text") + descriptionEN: string; + + @Field() + @Column({ length: 50 }) + typeDisplay: string; + + @Field({ nullable: true }) + @Column({ nullable: true }) + github: string | null; + + @Field() + @Column("text") + contentDisplay: string; + + // Relation Many-to-Many avec SkillSubItem + @Field(() => [SkillSubItem]) + @ManyToMany(() => SkillSubItem, { cascade: true }) + @JoinTable() // Cette table de jointure sera nommée 'project_skillsubitem' + skills: SkillSubItem[]; + + @Field() + @CreateDateColumn({ default: () => "CURRENT_TIMESTAMP" }) + created_at: Date; + + @Field() + @UpdateDateColumn({ + name: "updated_at", + default: () => "CURRENT_TIMESTAMP", + onUpdate: "CURRENT_TIMESTAMP", + }) + updated_at: Date; + } \ No newline at end of file From 78019962e9b0b467141ae7b462f012d0a2a10094 Mon Sep 17 00:00:00 2001 From: Alexandre Renard <16491342+Alexandre78R@users.noreply.github.com> Date: Wed, 23 Oct 2024 21:32:15 +0200 Subject: [PATCH 07/13] add entity experience --- backend/src/entities/experience.entity.ts | 76 +++++++++++++++++++++++ backend/src/entities/project.entity.ts | 5 +- 2 files changed, 78 insertions(+), 3 deletions(-) create mode 100644 backend/src/entities/experience.entity.ts diff --git a/backend/src/entities/experience.entity.ts b/backend/src/entities/experience.entity.ts new file mode 100644 index 00000000..e8fc5e7c --- /dev/null +++ b/backend/src/entities/experience.entity.ts @@ -0,0 +1,76 @@ +import { + Entity, + PrimaryGeneratedColumn, + Column, + CreateDateColumn, + UpdateDateColumn, + } from "typeorm"; + import { Field, ID, ObjectType } from "type-graphql"; + + @ObjectType() + @Entity() + export class Experience { + @Field(() => ID) + @PrimaryGeneratedColumn() + id: number; + + @Field() + @Column({ length: 100 }) + jobEN: string; + + @Field() + @Column({ length: 100 }) + jobFR: string; + + @Field() + @Column({ length: 100 }) + business: string; + + @Field({ nullable: true }) + @Column({ length: 100, nullable: true }) + employmentContractEN: string | null; + + @Field({ nullable: true }) + @Column({ length: 100, nullable: true }) + employmentContractFR: string | null; + + @Field() + @Column({ length: 50 }) + startDateEN: Date; + + @Field() + @Column({ length: 50 }) + startDateFR: Date; + + @Field() + @Column({ length: 50 }) + endDateEN: Date; + + @Field() + @Column({ length: 50 }) + endDateFR: Date; + + @Field({ nullable: true }) + @Column({ nullable: true, type: "int" }) + month: number | null; + + @Field() + @Column({ length: 50 }) + typeEN: string; + + @Field() + @Column({ length: 50 }) + typeFR: string; + + @Field() + @CreateDateColumn({ default: () => "CURRENT_TIMESTAMP" }) + created_at: Date; + + @Field() + @UpdateDateColumn({ + name: "updated_at", + default: () => "CURRENT_TIMESTAMP", + onUpdate: "CURRENT_TIMESTAMP", + }) + updated_at: Date; + } \ No newline at end of file diff --git a/backend/src/entities/project.entity.ts b/backend/src/entities/project.entity.ts index bc1c3b40..4d22bb20 100644 --- a/backend/src/entities/project.entity.ts +++ b/backend/src/entities/project.entity.ts @@ -8,7 +8,7 @@ import { UpdateDateColumn, } from "typeorm"; import { Field, ID, ObjectType } from "type-graphql"; - import { SkillSubItem } from "./skillSubItem.entity"; // Importer SkillSubItem + import { SkillSubItem } from "./skillSubItem.entity"; @ObjectType() @Entity() @@ -41,10 +41,9 @@ import { @Column("text") contentDisplay: string; - // Relation Many-to-Many avec SkillSubItem @Field(() => [SkillSubItem]) @ManyToMany(() => SkillSubItem, { cascade: true }) - @JoinTable() // Cette table de jointure sera nommée 'project_skillsubitem' + @JoinTable() skills: SkillSubItem[]; @Field() From 19d74bb621eb08e63f819721cb5a1cb4a39ff1bf Mon Sep 17 00:00:00 2001 From: Alexandre Renard <16491342+Alexandre78R@users.noreply.github.com> Date: Wed, 23 Oct 2024 21:42:25 +0200 Subject: [PATCH 08/13] add entity education --- backend/src/entities/education.entity.ts | 84 ++++++++++++++++++++++++ 1 file changed, 84 insertions(+) create mode 100644 backend/src/entities/education.entity.ts diff --git a/backend/src/entities/education.entity.ts b/backend/src/entities/education.entity.ts new file mode 100644 index 00000000..a111d6ab --- /dev/null +++ b/backend/src/entities/education.entity.ts @@ -0,0 +1,84 @@ +import { + Entity, + PrimaryGeneratedColumn, + Column, + CreateDateColumn, + UpdateDateColumn, + } from "typeorm"; + import { Field, ID, ObjectType } from "type-graphql"; + + @ObjectType() + @Entity() + export class Education { + @Field(() => ID) + @PrimaryGeneratedColumn() + id: number; + + @Field() + @Column({ length: 100 }) + titleFR: string; + + @Field() + @Column({ length: 100 }) + titleEN: string; + + @Field() + @Column({ length: 100 }) + diplomaLevelFR: string; + + @Field() + @Column({ length: 100 }) + diplomaLevelEN: string; + + @Field() + @Column({ length: 100 }) + school: string; + + @Field() + @Column({ length: 100 }) + location: string; + + @Field() + @Column({ type: "int" }) + year: number; + + @Field() + @Column({ length: 50 }) + startDateEN: string; + + @Field() + @Column({ length: 50 }) + startDateFR: string; + + @Field() + @Column({ length: 50 }) + endDateEN: string; + + @Field() + @Column({ length: 50 }) + endDateFR: string; + + @Field({ nullable: true }) + @Column({ nullable: true, type: "int" }) + month: number | null; + + @Field() + @Column({ length: 50 }) + typeEN: string; + + @Field() + @Column({ length: 50 }) + typeFR: string; + + @Field() + @CreateDateColumn({ default: () => "CURRENT_TIMESTAMP" }) + created_at: Date; + + @Field() + @UpdateDateColumn({ + name: "updated_at", + default: () => "CURRENT_TIMESTAMP", + onUpdate: "CURRENT_TIMESTAMP", + }) + updated_at: Date; + } \ No newline at end of file From c2c891c766b5e6f9397066f6f76f49a985fc6f2b Mon Sep 17 00:00:00 2001 From: Alexandre Renard <16491342+Alexandre78R@users.noreply.github.com> Date: Wed, 23 Oct 2024 21:43:02 +0200 Subject: [PATCH 09/13] fixed type data colonne table experience entity --- backend/src/entities/experience.entity.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/backend/src/entities/experience.entity.ts b/backend/src/entities/experience.entity.ts index e8fc5e7c..a0f5a1cc 100644 --- a/backend/src/entities/experience.entity.ts +++ b/backend/src/entities/experience.entity.ts @@ -36,19 +36,19 @@ import { @Field() @Column({ length: 50 }) - startDateEN: Date; + startDateEN: string; @Field() @Column({ length: 50 }) - startDateFR: Date; + startDateFR: string; @Field() @Column({ length: 50 }) - endDateEN: Date; + endDateEN: string; @Field() @Column({ length: 50 }) - endDateFR: Date; + endDateFR: string; @Field({ nullable: true }) @Column({ nullable: true, type: "int" }) From 094a3b8906c18e096bd27bbd3e72aec173dcb41e Mon Sep 17 00:00:00 2001 From: Alexandre Renard <16491342+Alexandre78R@users.noreply.github.com> Date: Wed, 23 Oct 2024 21:44:32 +0200 Subject: [PATCH 10/13] delete user data --- backend/src/entities/user.entity.ts | 1 - backend/src/services/user.service.ts | 0 2 files changed, 1 deletion(-) delete mode 100644 backend/src/entities/user.entity.ts delete mode 100644 backend/src/services/user.service.ts diff --git a/backend/src/entities/user.entity.ts b/backend/src/entities/user.entity.ts deleted file mode 100644 index 5acfc37d..00000000 --- a/backend/src/entities/user.entity.ts +++ /dev/null @@ -1 +0,0 @@ -// User Entity.... \ No newline at end of file diff --git a/backend/src/services/user.service.ts b/backend/src/services/user.service.ts deleted file mode 100644 index e69de29b..00000000 From 61afb6ef9d88f75f64fbec882708d76384fe47b0 Mon Sep 17 00:00:00 2001 From: Alexandre Renard <16491342+Alexandre78R@users.noreply.github.com> Date: Wed, 23 Oct 2024 22:17:17 +0200 Subject: [PATCH 11/13] udate rules caract table education --- backend/src/entities/education.entity.ts | 59 +++++++++++++++++++----- 1 file changed, 48 insertions(+), 11 deletions(-) diff --git a/backend/src/entities/education.entity.ts b/backend/src/entities/education.entity.ts index a111d6ab..79a4a0f2 100644 --- a/backend/src/entities/education.entity.ts +++ b/backend/src/entities/education.entity.ts @@ -6,6 +6,7 @@ import { UpdateDateColumn, } from "typeorm"; import { Field, ID, ObjectType } from "type-graphql"; +import { Length } from "class-validator"; @ObjectType() @Entity() @@ -16,26 +17,44 @@ import { @Field() @Column({ length: 100 }) + @Length(1, 100, { + message: "TitleFR must have between 1 to 100 characters", + }) titleFR: string; @Field() - @Column({ length: 100 }) + @Column({ length: 50 }) + @Length(1, 50, { + message: "TtitleEN must have between 1 to 50 characters", + }) titleEN: string; @Field() - @Column({ length: 100 }) + @Column({ length: 50 }) + @Length(1, 50, { + message: "DiplomateFR must have between 1 to 50 characters", + }) diplomaLevelFR: string; @Field() - @Column({ length: 100 }) + @Column({ length: 50 }) + @Length(1, 50, { + message: "DiplomateEN must have between 1 to 50 characters", + }) diplomaLevelEN: string; @Field() - @Column({ length: 100 }) + @Column({ length: 50 }) + @Length(1, 50, { + message: "Shool must have between 1 to 50 characters", + }) school: string; @Field() - @Column({ length: 100 }) + @Column({ length: 50 }) + @Length(1, 50, { + message: "Location must have between 1 to 50 characters", + }) location: string; @Field() @@ -43,19 +62,31 @@ import { year: number; @Field() - @Column({ length: 50 }) + @Column({ length: 20 }) + @Length(1, 20, { + message: "StartDateEN must have between 1 to 20 characters", + }) startDateEN: string; @Field() - @Column({ length: 50 }) + @Column({ length: 20 }) + @Length(1, 20, { + message: "StartDateFR must have between 1 to 20 characters", + }) startDateFR: string; @Field() - @Column({ length: 50 }) + @Column({ length: 20 }) + @Length(1, 20, { + message: "EndDateEN must have between 1 to 20 characters", + }) endDateEN: string; @Field() - @Column({ length: 50 }) + @Column({ length: 20 }) + @Length(1, 20, { + message: "EndDateFR must have between 1 to 20 characters", + }) endDateFR: string; @Field({ nullable: true }) @@ -63,11 +94,17 @@ import { month: number | null; @Field() - @Column({ length: 50 }) + @Column({ length: 30 }) + @Length(1, 30, { + message: "TypeEN must have between 1 to 30 characters", + }) typeEN: string; @Field() - @Column({ length: 50 }) + @Column({ length: 30 }) + @Length(1, 30, { + message: "TypeFR must have between 1 to 30 characters", + }) typeFR: string; @Field() From 2c148e3c235c474d49fbc654703035728ab5eaae Mon Sep 17 00:00:00 2001 From: Alexandre Renard <16491342+Alexandre78R@users.noreply.github.com> Date: Wed, 23 Oct 2024 22:19:05 +0200 Subject: [PATCH 12/13] update rules caract table project --- backend/src/entities/project.entity.ts | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/backend/src/entities/project.entity.ts b/backend/src/entities/project.entity.ts index 4d22bb20..a3d168a9 100644 --- a/backend/src/entities/project.entity.ts +++ b/backend/src/entities/project.entity.ts @@ -9,7 +9,8 @@ import { } from "typeorm"; import { Field, ID, ObjectType } from "type-graphql"; import { SkillSubItem } from "./skillSubItem.entity"; - +import { Length } from "class-validator"; + @ObjectType() @Entity() export class Project { @@ -19,6 +20,9 @@ import { @Field() @Column({ length: 100 }) + @Length(1, 100, { + message: "Title must have between 1 to 100 characters", + }) title: string; @Field() @@ -31,6 +35,9 @@ import { @Field() @Column({ length: 50 }) + @Length(1, 50, { + message: "TypeDisplay must have between 1 to 50 characters", + }) typeDisplay: string; @Field({ nullable: true }) From 83f454de46051166a2f7b8a7d0e6c28bc544bb0e Mon Sep 17 00:00:00 2001 From: Alexandre Renard <16491342+Alexandre78R@users.noreply.github.com> Date: Wed, 23 Oct 2024 22:33:17 +0200 Subject: [PATCH 13/13] update rules caract table experience --- backend/src/entities/experience.entity.ts | 46 ++++++++++++++++++++--- 1 file changed, 40 insertions(+), 6 deletions(-) diff --git a/backend/src/entities/experience.entity.ts b/backend/src/entities/experience.entity.ts index a0f5a1cc..4ce111c5 100644 --- a/backend/src/entities/experience.entity.ts +++ b/backend/src/entities/experience.entity.ts @@ -6,6 +6,7 @@ import { UpdateDateColumn, } from "typeorm"; import { Field, ID, ObjectType } from "type-graphql"; +import { Length } from "class-validator"; @ObjectType() @Entity() @@ -16,38 +17,65 @@ import { @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: 100 }) + @Column({ length: 25 }) + @Length(1, 25, { + message: "Business must have between 1 to 25 characters", + }) business: string; @Field({ nullable: true }) - @Column({ length: 100, 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: 50 }) + @Column({ length: 20 }) + @Length(1, 20, { + message: "StartDateEN must have between 1 to 20 characters", + }) startDateEN: string; @Field() - @Column({ length: 50 }) + @Column({ length: 20 }) + @Length(1, 20, { + message: "StartDateFR must have between 1 to 20 characters", + }) startDateFR: string; @Field() - @Column({ length: 50 }) + @Column({ length: 20 }) + @Length(1, 20, { + message: "EndDateEN must have between 1 to 20 characters", + }) endDateEN: string; @Field() - @Column({ length: 50 }) + @Column({ length: 20 }) + @Length(1, 20, { + message: "EndDateFR must have between 1 to 20 characters", + }) endDateFR: string; @Field({ nullable: true }) @@ -56,10 +84,16 @@ import { @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()