because I got bored of customising my CV for every job
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

refactor(domain): remove foreign keys from domain entities

- Remove foreign key fields (userId, companyId, roleId, levelId) from UserJobExperience domain entity
- Remove user relation from domain entity
- Update DTOs to use full entities instead of IDs
- Implement domain-driven design principles
- Prepare for resolver updates to use full entities

+14 -25
+14 -9
apps/server/src/modules/job-experience/employment/user-job-experience.dto.ts
··· 1 + import type { Company } from "../company/company.entity"; 2 + import type { Level } from "../level/level.entity"; 3 + import type { Role } from "../role/role.entity"; 4 + import type { Skill } from "../skill/skill.entity"; 5 + 1 6 export interface CreateUserJobExperienceDto { 2 - userId: string; 3 - companyId: string; 4 - roleId: string; 5 - levelId: string; 7 + user: { id: string }; // Only need user ID for the relation 8 + company: Company; 9 + role: Role; 10 + level: Level; 6 11 startDate: Date; 7 12 endDate?: Date; 8 13 description?: string; 9 - skillIds?: string[]; 14 + skills?: Skill[]; 10 15 } 11 16 12 17 export interface UpdateUserJobExperienceDto { 13 - companyId?: string; 14 - roleId?: string; 15 - levelId?: string; 18 + company?: Company; 19 + role?: Role; 20 + level?: Level; 16 21 startDate?: Date; 17 22 endDate?: Date; 18 23 description?: string; 19 - skillIds?: string[]; 24 + skills?: Skill[]; 20 25 }
-16
apps/server/src/modules/job-experience/employment/user-job-experience.entity.ts
··· 1 - import type { User } from "../../auth/user.entity"; 2 1 import { BaseEntity } from "../../base/base.entity"; 3 2 import type { Company } from "../company/company.entity"; 4 3 import type { Level } from "../level/level.entity"; ··· 6 5 import type { Skill } from "../skill/skill.entity"; 7 6 8 7 export class UserJobExperience extends BaseEntity { 9 - userId: string; 10 - companyId: string; 11 - roleId: string; 12 - levelId: string; 13 8 startDate: Date; 14 9 endDate?: Date; 15 10 description?: string; 16 11 17 12 // Relations 18 - user: User; 19 13 company: Company; 20 14 role: Role; 21 15 level: Level; ··· 23 17 24 18 constructor( 25 19 id: string, 26 - userId: string, 27 - companyId: string, 28 - roleId: string, 29 - levelId: string, 30 20 startDate: Date, 31 21 createdAt: Date, 32 22 updatedAt: Date, 33 - user: User, 34 23 company: Company, 35 24 role: Role, 36 25 level: Level, ··· 39 28 skills?: Skill[], 40 29 ) { 41 30 super(id, createdAt, updatedAt); 42 - this.userId = userId; 43 - this.companyId = companyId; 44 - this.roleId = roleId; 45 - this.levelId = levelId; 46 31 this.startDate = startDate; 47 - this.user = user; 48 32 this.company = company; 49 33 this.role = role; 50 34 this.level = level;