CV/src/education/education.types.ts

47 lines
1.2 KiB
TypeScript

import { ApiProperty } from "@nestjs/swagger";
import { DtoClass } from "@/common/dtoClass.factory";
export type EducationType = {
institute: string;
city: string;
url?: string;
course: string;
level: string;
startDate: Date;
endDate: Date;
description: string;
};
export class EducationDto extends DtoClass<EducationType, EducationDto>() implements EducationType {
@ApiProperty()
readonly institute: string;
@ApiProperty()
readonly city: string;
@ApiProperty()
readonly url?: string;
@ApiProperty()
readonly course: string;
@ApiProperty()
readonly level: string;
@ApiProperty()
readonly startDate: Date;
@ApiProperty()
readonly endDate: Date;
@ApiProperty()
readonly description: string;
constructor(education: EducationType) {
super(education);
Object.assign(this, {
institute: education.institute,
city: education.city,
url: education.url,
course: education.course,
level: education.level,
startDate: education.startDate,
endDate: education.endDate,
description: education.description,
});
}
}