because I got bored of customising my CV for every job
1import { ClockService, Factory, UuidFactoryService } from "@cv/system";
2import { Injectable } from "@nestjs/common";
3import type { CreateSkillDto } from "./skill.dto";
4import { Skill } from "./skill.entity";
5
6@Injectable()
7export class SkillFactory implements Factory<Skill, CreateSkillDto> {
8 constructor(
9 private readonly uuidFactory: UuidFactoryService,
10 private readonly clock: ClockService,
11 ) {}
12
13 create(dto: CreateSkillDto): Skill {
14 const now = this.clock.now();
15 return new Skill(
16 this.uuidFactory.generate(),
17 dto.name,
18 now,
19 now,
20 dto.description,
21 );
22 }
23}