Skip to content
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
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
1 change: 0 additions & 1 deletion nextstep-backend/src/config/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ export const config = {
resumeMaxSize: () => 5 * 1024 * 1024 // Max file size: 5MB
},
assets: {
resumeTemplatesDirectoryPath: () => 'assets/resume-templates',
jobQuizzesJobHuntHtmlPath: () => 'assets/job-quizzes/jobhunt/מאגר שאלות מראיונות עבודה.html',
jobQuizzesTheWorkerHtmlDirectoryPath: () => 'assets/job-quizzes/theworker/interviews',
},
Expand Down
29 changes: 2 additions & 27 deletions nextstep-backend/src/controllers/resume_controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { Request, Response } from 'express';
import { config } from '../config/config';
import fs from 'fs';
import path from 'path';
import { scoreResume, streamScoreResume, getResumeTemplates, generateImprovedResume, parseResumeFields } from '../services/resume_service';
import { scoreResume, streamScoreResume, parseResumeFields } from '../services/resume_service';
import multer from 'multer';
import { CustomRequest } from "types/customRequest";
import { handleError } from "../utils/handle_error";
Expand Down Expand Up @@ -69,31 +69,6 @@ const getStreamResumeScore = async (req: Request, res: Response) => {
}
};

const getTemplates = async (req: Request, res: Response) => {
try {
const templates = await getResumeTemplates();
return res.status(200).json(templates);
} catch (error) {
handleError(error, res);
}
};

const generateResume = async (req: Request, res: Response) => {
try {
const { feedback, jobDescription, templateName } = req.body;

if (!feedback || !jobDescription || !templateName) {
return res.status(400).json({ error: 'Missing required fields' });
}

const result = await generateImprovedResume(feedback, jobDescription, templateName);
return res.status(200).json(result);
} catch (error) {
handleError(error, res);
}
};


const parseResume = async (req: Request, res: Response) => {
try {
if (!req.file) {
Expand All @@ -107,4 +82,4 @@ const parseResume = async (req: Request, res: Response) => {
}
};

export default { parseResume, getResumeScore, getStreamResumeScore, getTemplates, generateResume };
export default { parseResume, getResumeScore, getStreamResumeScore };
102 changes: 0 additions & 102 deletions nextstep-backend/src/openapi/swagger.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -986,109 +986,7 @@ paths:
'500':
description: Internal server error

/resume/templates:
get:
tags:
- Resume
summary: Get available resume templates
security:
- BearerAuth: []
responses:
'200':
description: List of available resume templates retrieved successfully
content:
application/json:
schema:
type: array
items:
type: object
properties:
name:
type: string
description: The name of the template (with extension)
content:
type: string
description: Base64 encoded content of the template file
type:
type: string
description: MIME type of the template file
enum:
- application/pdf
- application/msword
- application/vnd.openxmlformats-officedocument.wordprocessingml.document
'401':
description: Unauthorized
'500':
description: Internal server error

/resume/generate:
post:
tags:
- Resume
summary: Generate an improved resume based on a resume template, feedback and job description
security:
- BearerAuth: []
requestBody:
required: true
content:
application/json:
schema:
type: object
required:
- feedback
- jobDescription
- templateName
properties:
feedback:
type: string
description: The feedback received from the resume scoring process
jobDescription:
type: string
description: The job description used for scoring the resume
templateName:
type: string
description: The name of the template to use for generating the improved resume
responses:
'200':
description: The generated improved resume
content:
application/json:
schema:
type: object
properties:
content:
type: string
description: Base64 encoded content of the generated resume file
type:
type: string
description: MIME type of the generated resume file
enum:
- application/msword
- application/vnd.openxmlformats-officedocument.wordprocessingml.document
'400':
description: Bad request - Missing required fields
content:
application/json:
schema:
type: object
properties:
error:
type: string
description: Error message indicating missing fields
'401':
description: Unauthorized - Missing or invalid authentication token
'404':
description: Template not found
content:
application/json:
schema:
type: object
properties:
error:
type: string
description: Error message indicating template not found
'500':
description: Internal server error

/room/user/{receiverUserId}:
get:
Expand Down
4 changes: 0 additions & 4 deletions nextstep-backend/src/routes/resume_routes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,6 @@ router.get('/score/:filename', Resume.getResumeScore);

router.get('/streamScore/:filename', Resume.getStreamResumeScore);

router.get('/templates', Resume.getTemplates);

router.post('/generate', Resume.generateResume);

router.post('/parseResume', upload.single('resume'), Resume.parseResume);

export default router;
Loading
Loading