-
Notifications
You must be signed in to change notification settings - Fork 10
Open
Description
Issue Title: Implement Job Proposals Functionality
Issue Description:
As a freelancer, I want to submit proposals for job listings posted by clients so that I can express my interest and qualifications for available projects. This functionality should allow freelancers to submit proposals for jobs and enable clients to review those proposals.
Tasks:
-
Submit Proposal:
- Create an endpoint in the ProposalController for freelancers to submit proposals for specific jobs.
- Collect necessary details for the proposal, including:
job_id: The ID of the job being applied for.freelancer_id: The ID of the freelancer (automatically derived from the authenticated user's context).cover_letter: A cover letter detailing the freelancer's qualifications and interest in the job.proposed_rate: The rate proposed by the freelancer for the job.status: Default to "Pending".
-
Get Proposals for a Job:
- Create an endpoint to retrieve all proposals submitted for a specific job, accessible by the client who posted the job.
-
Get Proposal Status:
- Create an endpoint for freelancers to check the status of their proposals for specific jobs.
-
Update Proposal Status:
- Create an endpoint for clients to update the status of proposals (e.g., Accepted, Rejected).
Acceptance Criteria:
-
Submit Proposal:
- Freelancers should be able to make a
POSTrequest to/proposalsto submit a proposal. - Return 201 Created if the proposal is submitted successfully.
- Return 400 Bad Request if any required fields are missing or invalid.
- Freelancers should be able to make a
-
Get Proposals for a Job:
- Clients should be able to make a
GETrequest to/jobs/{jobId}/proposalsto retrieve proposals for their job. - Return 200 OK with a list of proposals or 204 No Content if no proposals are found.
- Clients should be able to make a
-
Get Proposal Status:
- Freelancers should be able to make a
GETrequest to/proposals/{proposalId}to check their proposal status. - Return 200 OK with proposal details or 404 Not Found if the proposal does not exist.
- Freelancers should be able to make a
-
Update Proposal Status:
- Clients should be able to make a
PUTrequest to/proposals/{proposalId}/statusto update the proposal status. - Return 200 OK if the update is successful or 404 Not Found if the proposal does not exist.
- Clients should be able to make a
Endpoint Specifications:
-
Submit Proposal:
- Method:
POST - URL:
/proposals - Request Body Example:
{ "job_id": 12345, "cover_letter": "I am very interested in this job...", "proposed_rate": 50.00 }
- Method:
-
Get Proposals for a Job:
- Method:
GET - URL:
/jobs/{jobId}/proposals
- Method:
-
Get Proposal Status:
- Method:
GET - URL:
/proposals/{proposalId}
- Method:
-
Update Proposal Status:
- Method:
PUT - URL:
/proposals/{proposalId}/status - Request Body Example:
{ "status": "Accepted" }
- Method: