hngprojects / hng_boilerplate_nestjs

Description
Apache License 2.0
181 stars 105 forks source link

[FEAT] :Endpoint to Add Job Application -BE #73

Closed oderahub closed 1 week ago

oderahub commented 1 month ago

Description

Develop backend logic to handle job applications, including validation, storage, and management.

Acceptance Criteria

API Endpoint Implementation:

  1. The endpoint should be accessible at /api/v1/jobs/{job-id}/applications

  2. The endpoint should accept HTTP POST requests.

Data Validation and Management:

  1. Implement server-side logic to handle job applications.
  2. Validate applications against job requirements stored in the database.
  3. Prevent duplicate applications from the same candidate for the same job.

Purpose

To streamline the job application process on the careers page, ensuring efficient handling, validation, and management of job applications.

Requirements

Expected Outcome

Endpoints:

Submit Job Application

Description: Submit a job application for a specific job. Endpoint: POST /api/v1/jobs/{job-id}/applications Request Body

{
  "applicant_name": "John Doe",
  "email": "johndoe@example.com",
  "resume": "https://example.com/resume.pdf",
  "cover_letter": "Cover letter text here"
}
{
  "status": "success",
  "message": "Application submitted successfully",
  "status_code": 200
}

{
  "error": "Bad Request"
  "message": ["applicant_name is required", "email is required", "cv is required",  "cover_later is required"],
  "status_code": 400
}
{

  "message": "Duplicate application.",
   "status_code": 409

}

Tasks

Testing

  1. Write unit tests for backend validation and transaction handling.

  2. Perform security testing to ensure data protection and compliance.

  3. Test various scenarios for submitting job applications.

markessien commented 1 month ago

This is not a single ticket

highb33kay commented 1 month ago
{ 
 "status_code": 201
  "application_id": Id,
  "message": "Application submitted successfully.",

}

Please check other approved tickets formatting

bamo100 commented 1 month ago

@highb33kay kindly grant permission to work on the ticket

highb33kay commented 1 month ago

Approved. Check for duplicates and proceed please. Thank you!!