Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(interview): add new api & deprecation marks to the old #2272

Merged
merged 2 commits into from
Aug 26, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
249 changes: 249 additions & 0 deletions client/src/api/api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -379,6 +379,18 @@ export interface AvailableStudentDto {
* @memberof AvailableStudentDto
*/
'registeredDate': string;
/**
*
* @type {number}
* @memberof AvailableStudentDto
*/
'maxScore': number;
/**
*
* @type {number}
* @memberof AvailableStudentDto
*/
'feedbackVersion': number;
}
/**
*
Expand Down Expand Up @@ -3079,6 +3091,37 @@ export interface InterviewDto {
*/
'attributes': Attributes;
}
/**
*
* @export
* @interface InterviewFeedbackDto
*/
export interface InterviewFeedbackDto {
/**
*
* @type {number}
* @memberof InterviewFeedbackDto
*/
'version'?: number;
/**
*
* @type {object}
* @memberof InterviewFeedbackDto
*/
'json'?: object;
/**
*
* @type {boolean}
* @memberof InterviewFeedbackDto
*/
'isCompleted': boolean;
/**
*
* @type {number}
* @memberof InterviewFeedbackDto
*/
'maxScore': number;
}
/**
*
* @export
Expand Down Expand Up @@ -3996,6 +4039,49 @@ export interface PublicVisibilitySettings {
*/
'all': boolean;
}
/**
*
* @export
* @interface PutInterviewFeedbackDto
*/
export interface PutInterviewFeedbackDto {
/**
*
* @type {number}
* @memberof PutInterviewFeedbackDto
*/
'version': number;
/**
*
* @type {object}
* @memberof PutInterviewFeedbackDto
*/
'json': object;
/**
*
* @type {string}
* @memberof PutInterviewFeedbackDto
*/
'decision'?: string;
/**
*
* @type {boolean}
* @memberof PutInterviewFeedbackDto
*/
'isGoodCandidate'?: boolean;
/**
*
* @type {boolean}
* @memberof PutInterviewFeedbackDto
*/
'isCompleted': boolean;
/**
*
* @type {number}
* @memberof PutInterviewFeedbackDto
*/
'score'?: number;
}
/**
*
* @export
Expand Down Expand Up @@ -8639,6 +8725,53 @@ export class CoursesEventsApi extends BaseAPI {
*/
export const CoursesInterviewsApiAxiosParamCreator = function (configuration?: Configuration) {
return {
/**
*
* @param {number} courseId
* @param {number} interviewId
* @param {string} type
* @param {PutInterviewFeedbackDto} putInterviewFeedbackDto
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
createInterviewFeedback: async (courseId: number, interviewId: number, type: string, putInterviewFeedbackDto: PutInterviewFeedbackDto, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
// verify required parameter 'courseId' is not null or undefined
assertParamExists('createInterviewFeedback', 'courseId', courseId)
// verify required parameter 'interviewId' is not null or undefined
assertParamExists('createInterviewFeedback', 'interviewId', interviewId)
// verify required parameter 'type' is not null or undefined
assertParamExists('createInterviewFeedback', 'type', type)
// verify required parameter 'putInterviewFeedbackDto' is not null or undefined
assertParamExists('createInterviewFeedback', 'putInterviewFeedbackDto', putInterviewFeedbackDto)
const localVarPath = `/courses/{courseId}/interviews/{interviewId}/{type}/feedback`
.replace(`{${"courseId"}}`, encodeURIComponent(String(courseId)))
.replace(`{${"interviewId"}}`, encodeURIComponent(String(interviewId)))
.replace(`{${"type"}}`, encodeURIComponent(String(type)));
// use dummy base URL string because the URL constructor only accepts absolute URLs.
const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
let baseOptions;
if (configuration) {
baseOptions = configuration.baseOptions;
}

const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options};
const localVarHeaderParameter = {} as any;
const localVarQueryParameter = {} as any;



localVarHeaderParameter['Content-Type'] = 'application/json';

setSearchParams(localVarUrlObj, localVarQueryParameter);
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
localVarRequestOptions.data = serializeDataIfNeeded(putInterviewFeedbackDto, localVarRequestOptions, configuration)

return {
url: toPathString(localVarUrlObj),
options: localVarRequestOptions,
};
},
/**
*
* @param {number} courseId
Expand Down Expand Up @@ -8704,6 +8837,47 @@ export const CoursesInterviewsApiAxiosParamCreator = function (configuration?: C



setSearchParams(localVarUrlObj, localVarQueryParameter);
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};

return {
url: toPathString(localVarUrlObj),
options: localVarRequestOptions,
};
},
/**
*
* @param {number} courseId
* @param {number} interviewId
* @param {string} type
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
getInterviewFeedback: async (courseId: number, interviewId: number, type: string, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
// verify required parameter 'courseId' is not null or undefined
assertParamExists('getInterviewFeedback', 'courseId', courseId)
// verify required parameter 'interviewId' is not null or undefined
assertParamExists('getInterviewFeedback', 'interviewId', interviewId)
// verify required parameter 'type' is not null or undefined
assertParamExists('getInterviewFeedback', 'type', type)
const localVarPath = `/courses/{courseId}/interviews/{interviewId}/{type}/feedback`
.replace(`{${"courseId"}}`, encodeURIComponent(String(courseId)))
.replace(`{${"interviewId"}}`, encodeURIComponent(String(interviewId)))
.replace(`{${"type"}}`, encodeURIComponent(String(type)));
// use dummy base URL string because the URL constructor only accepts absolute URLs.
const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
let baseOptions;
if (configuration) {
baseOptions = configuration.baseOptions;
}

const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options};
const localVarHeaderParameter = {} as any;
const localVarQueryParameter = {} as any;



setSearchParams(localVarUrlObj, localVarQueryParameter);
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
Expand Down Expand Up @@ -8766,6 +8940,19 @@ export const CoursesInterviewsApiAxiosParamCreator = function (configuration?: C
export const CoursesInterviewsApiFp = function(configuration?: Configuration) {
const localVarAxiosParamCreator = CoursesInterviewsApiAxiosParamCreator(configuration)
return {
/**
*
* @param {number} courseId
* @param {number} interviewId
* @param {string} type
* @param {PutInterviewFeedbackDto} putInterviewFeedbackDto
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
async createInterviewFeedback(courseId: number, interviewId: number, type: string, putInterviewFeedbackDto: PutInterviewFeedbackDto, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<void>> {
const localVarAxiosArgs = await localVarAxiosParamCreator.createInterviewFeedback(courseId, interviewId, type, putInterviewFeedbackDto, options);
return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
},
/**
*
* @param {number} courseId
Expand All @@ -8788,6 +8975,18 @@ export const CoursesInterviewsApiFp = function(configuration?: Configuration) {
const localVarAxiosArgs = await localVarAxiosParamCreator.getInterview(interviewId, courseId, options);
return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
},
/**
*
* @param {number} courseId
* @param {number} interviewId
* @param {string} type
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
async getInterviewFeedback(courseId: number, interviewId: number, type: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<InterviewFeedbackDto>> {
const localVarAxiosArgs = await localVarAxiosParamCreator.getInterviewFeedback(courseId, interviewId, type, options);
return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
},
/**
*
* @param {number} courseId
Expand All @@ -8810,6 +9009,18 @@ export const CoursesInterviewsApiFp = function(configuration?: Configuration) {
export const CoursesInterviewsApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) {
const localVarFp = CoursesInterviewsApiFp(configuration)
return {
/**
*
* @param {number} courseId
* @param {number} interviewId
* @param {string} type
* @param {PutInterviewFeedbackDto} putInterviewFeedbackDto
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
createInterviewFeedback(courseId: number, interviewId: number, type: string, putInterviewFeedbackDto: PutInterviewFeedbackDto, options?: any): AxiosPromise<void> {
return localVarFp.createInterviewFeedback(courseId, interviewId, type, putInterviewFeedbackDto, options).then((request) => request(axios, basePath));
},
/**
*
* @param {number} courseId
Expand All @@ -8830,6 +9041,17 @@ export const CoursesInterviewsApiFactory = function (configuration?: Configurati
getInterview(interviewId: number, courseId: number, options?: any): AxiosPromise<InterviewDto> {
return localVarFp.getInterview(interviewId, courseId, options).then((request) => request(axios, basePath));
},
/**
*
* @param {number} courseId
* @param {number} interviewId
* @param {string} type
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
getInterviewFeedback(courseId: number, interviewId: number, type: string, options?: any): AxiosPromise<InterviewFeedbackDto> {
return localVarFp.getInterviewFeedback(courseId, interviewId, type, options).then((request) => request(axios, basePath));
},
/**
*
* @param {number} courseId
Expand All @@ -8851,6 +9073,20 @@ export const CoursesInterviewsApiFactory = function (configuration?: Configurati
* @extends {BaseAPI}
*/
export class CoursesInterviewsApi extends BaseAPI {
/**
*
* @param {number} courseId
* @param {number} interviewId
* @param {string} type
* @param {PutInterviewFeedbackDto} putInterviewFeedbackDto
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof CoursesInterviewsApi
*/
public createInterviewFeedback(courseId: number, interviewId: number, type: string, putInterviewFeedbackDto: PutInterviewFeedbackDto, options?: AxiosRequestConfig) {
return CoursesInterviewsApiFp(this.configuration).createInterviewFeedback(courseId, interviewId, type, putInterviewFeedbackDto, options).then((request) => request(this.axios, this.basePath));
}

/**
*
* @param {number} courseId
Expand All @@ -8875,6 +9111,19 @@ export class CoursesInterviewsApi extends BaseAPI {
return CoursesInterviewsApiFp(this.configuration).getInterview(interviewId, courseId, options).then((request) => request(this.axios, this.basePath));
}

/**
*
* @param {number} courseId
* @param {number} interviewId
* @param {string} type
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof CoursesInterviewsApi
*/
public getInterviewFeedback(courseId: number, interviewId: number, type: string, options?: AxiosRequestConfig) {
return CoursesInterviewsApiFp(this.configuration).getInterviewFeedback(courseId, interviewId, type, options).then((request) => request(this.axios, this.basePath));
}

/**
*
* @param {number} courseId
Expand Down
18 changes: 9 additions & 9 deletions client/src/services/course.ts
Original file line number Diff line number Diff line change
Expand Up @@ -443,16 +443,17 @@ export class CourseService {
return result.data.data;
}

/**
* @deprecated. should be removed after feedbacks are migrated to new template
*/
async getInterviewerStageInterviews(githubId: string) {
const result = await this.axios.get(`/interview/stage/interviewer/${githubId}/students`);
return result.data.data as { id: number; completed: boolean; student: StudentBasic }[];
}

async postStageInterviews(stageId: number) {
const result = await this.axios.post(`/stage/${stageId}/interviews`);
return result.data.data;
}

/**
* @deprecated. should be removed after feedbacks are migrated to new template
*/
async postStageInterviewFeedback(
interviewId: number,
data: { json: unknown; githubId: string; isGoodCandidate: boolean; isCompleted: boolean; decision: string },
Expand All @@ -461,13 +462,12 @@ export class CourseService {
return result.data.data;
}

/**
* @deprecated. should be removed after feedbacks are migrated to new template
*/
async getStageInterviewFeedback(interviewId: number) {
const result = await this.axios.get(`/interview/stage/${interviewId}/feedback`);
return result.data.data;
}

async getStageInterviewsByStudent(githubId: string) {
const result = await this.axios.get(`/student/${githubId}/interviews`);
return result.data.data;
}

Expand Down
3 changes: 2 additions & 1 deletion nestjs/src/courses/courses.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ import { StudentsService, StudentsController } from './students';
import { MentorsService, MentorsController } from './mentors';
import { CourseAccessService } from './course-access.service';
import { CourseTasksController, CourseTasksService } from './course-tasks';
import { InterviewsController, InterviewsService } from './interviews';
import { InterviewsController, InterviewsService, InterviewFeedbackService } from './interviews';
import { TasksController } from './tasks/tasks.controller';
import { TasksService } from './tasks/tasks.service';
import { CourseStatsController, CourseStatsService } from './stats';
Expand Down Expand Up @@ -126,6 +126,7 @@ import { SelfEducationService } from './task-verifications/self-education.servic
MentorsService,
CourseAccessService,
InterviewsService,
InterviewFeedbackService,
TasksService,
CourseStatsService,
CourseCrossCheckService,
Expand Down
Loading