Skip to content

Commit

Permalink
fix: import
Browse files Browse the repository at this point in the history
  • Loading branch information
whiitex committed Jun 1, 2024
1 parent 7c49dbd commit 238f415
Show file tree
Hide file tree
Showing 4 changed files with 82 additions and 8 deletions.
6 changes: 4 additions & 2 deletions api/src/application/applications.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,11 +53,13 @@ export class ApplicationsService {
return match.length > 0;
}

async findLastApplicationByActiveUserId(applicantId: string): Promise<Application> {
async findLastApplicationByActiveUserId(
applicantId: string,
): Promise<Application> {
return await this.applicationRepository.findOne({
where: { applicantId },
order: {
lastModified: 'DESC'
lastModified: 'DESC',
},
});
}
Expand Down
2 changes: 1 addition & 1 deletion api/src/interview/interview.controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import {
ConflictException,
} from '@nestjs/common';
import { Interview } from './interview.entity';
import { InterviewService } from './interview.Service';
import { InterviewService } from './interview.service';
import { TimeSlotsService } from '../timeslots/timeslots.service';
import { ApplicationsService } from '../application/applications.service';
import { CreateInterviewDto } from './create-interview.dto';
Expand Down
78 changes: 75 additions & 3 deletions api/src/mocks/data.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,6 @@ import {
AvailabilityState,
TimeSlot,
} from '@hkrecruitment/shared';
import { Interview } from 'src/interview/interview.entity';
import { UpdateInterviewDto } from 'src/interview/update-interview.dto';
import { CreateInterviewDto } from 'src/interview/create-interview.dto';

export const testDate = new Date(2023, 0, 1, 10, 0, 0);
export const testDateTimeStart = new Date(2023, 0, 1, 10, 30, 0);
Expand Down Expand Up @@ -232,3 +229,78 @@ export const mockAvailability = {
export const mockCreateAvailabilityDto = {
timeSlotId: mockTimeSlot.id,
} as CreateAvailabilityDto;

export const mockTimeSlotsJoined = [
{
start: new Date('2022-01-01T09:00:00'),
end: new Date('2022-01-01T10:00:00'),
id: 1,
recruitmentSession: 3,
availabilities: [
{
state: AvailabilityState.Interviewing,
user: {
role: Role.None,
is_board: false,
is_expert: true,
},
},
{
state: AvailabilityState.Free,
user: {
role: Role.Member,
is_board: true,
is_expert: false,
},
},
{
state: AvailabilityState.Free,
user: {
role: Role.Applicant,
is_board: false,
is_expert: false,
},
},
{
state: AvailabilityState.Free,
user: {
role: Role.Member,
is_board: false,
is_expert: true,
},
},
{
state: AvailabilityState.Interviewing,
user: {
role: Role.Member,
is_board: false,
is_expert: true,
},
},
{
state: AvailabilityState.Interviewing,
user: {
role: Role.Admin,
is_board: false,
is_expert: true,
},
},
],
},
{
start: new Date('2022-01-01T9:00:00'),
end: new Date('2022-01-01T20:00:00'),
id: 2,
recruitmentSession: 3,
availabilities: [
{
state: AvailabilityState.Free,
user: {
role: Role.Member,
is_board: true,
is_expert: true,
},
},
],
},
];
4 changes: 2 additions & 2 deletions shared/src/interview.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import { Person, createUserSchema, updateUserSchema, Role } from "./person";
import { TimeSlot } from "timeslot";
import { TimeSlot } from "./timeslot";
import {
Application,
createApplicationSchema,
updateApplicationSchema,
} from "application";
} from "./application";
import { Action, ApplyAbilities } from "./abilities";
import * as Joi from "joi";

Expand Down

0 comments on commit 238f415

Please sign in to comment.