Skip to content

Commit

Permalink
Merge branch 'main' of github.com:MuNuChapterHKN/HKrecruitment into dev
Browse files Browse the repository at this point in the history
  • Loading branch information
AlbertoBaroso committed Jan 22, 2024
2 parents 27f282f + 1c90eb3 commit bb6e7e8
Show file tree
Hide file tree
Showing 13 changed files with 989 additions and 2 deletions.
36 changes: 36 additions & 0 deletions api/src/mocks/data.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@ import {
PhdApplication,
} from 'src/application/application.entity';
import { UpdateApplicationDto } from 'src/application/update-application.dto';
import { RecruitmentSessionState } from '@hkrecruitment/shared/recruitment-session';
import { CreateRecruitmentSessionDto } from 'src/recruitment-session/create-recruitment-session.dto';
import { UpdateRecruitmentSessionDto } from 'src/recruitment-session/update-recruitment-session.dto';

export const testDate = new Date(2023, 0, 1);
export const testDateTimeStart = new Date(2023, 0, 1, 10, 30, 0);
Expand All @@ -24,6 +27,39 @@ export const mockTimeSlot = {
id: 1,
};

export const testInterviewStart = '11:55' as unknown as Date;
export const testInterviewEnd = '20:35' as unknown as Date;
export const testDay1 = '2024-10-20' as unknown as Date;
export const testDay2 = '2024-10-21' as unknown as Date;
export const testDay3 = '2024-10-22' as unknown as Date;
export const testDateCreatedAt = '2024-9-10' as unknown as Date;
export const testDateLastModified = '2024-9-12' as unknown as Date;

export const mockRecruitmentSession = {
id: 1,
state: RecruitmentSessionState.Active,
slotDuration: 50,
interviewStart: testInterviewStart,
interviewEnd: testInterviewEnd,
days: [testDay1, testDay2, testDay3],
createdAt: testDateCreatedAt,
lastModified: testDateLastModified,
};

export const mockCreateRecruitmentSessionDto = {
slotDuration: 50,
interviewStart: testInterviewStart,
interviewEnd: testInterviewEnd,
days: [testDay1, testDay2, testDay3],
} as CreateRecruitmentSessionDto;

export const mockUpdateRecruitmentSessionDto = {
slotDuration: 50,
interviewStart: testInterviewStart,
interviewEnd: testInterviewEnd,
days: [testDay1, testDay2, testDay3],
} as UpdateRecruitmentSessionDto;

export const baseFile = {
encoding: '7bit',
mimetype: 'application/pdf',
Expand Down
18 changes: 18 additions & 0 deletions api/src/recruitment-session/create-recruitment-session.dto.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import { RecruitmentSession } from '@hkrecruitment/shared/recruitment-session';
import { ApiProperty } from '@nestjs/swagger';

export class CreateRecruitmentSessionDto
implements Partial<RecruitmentSession>
{
@ApiProperty()
slotDuration: number;

@ApiProperty()
interviewStart: Date;

@ApiProperty()
interviewEnd: Date;

@ApiProperty({ isArray: true })
days: Date[];
}
14 changes: 14 additions & 0 deletions api/src/recruitment-session/recruitment-session-response.dto.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import {
RecruitmentSession,
RecruitmentSessionState,
} from '@hkrecruitment/shared/recruitment-session';
import { Exclude, Expose } from 'class-transformer';

@Exclude()
export class RecruitmentSessionResponseDto
implements Partial<RecruitmentSession>
{
@Expose() id: number;
@Expose() createdAt: Date;
@Expose() state: RecruitmentSessionState;
}
Loading

0 comments on commit bb6e7e8

Please sign in to comment.