Skip to content

Implement Job Proposals Functionality #39

Open
@AhmedFatthy1040

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:

  1. 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".
  2. 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.
  3. Get Proposal Status:

    • Create an endpoint for freelancers to check the status of their proposals for specific jobs.
  4. 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 POST request to /proposals to submit a proposal.
    • Return 201 Created if the proposal is submitted successfully.
    • Return 400 Bad Request if any required fields are missing or invalid.
  • Get Proposals for a Job:

    • Clients should be able to make a GET request to /jobs/{jobId}/proposals to retrieve proposals for their job.
    • Return 200 OK with a list of proposals or 204 No Content if no proposals are found.
  • Get Proposal Status:

    • Freelancers should be able to make a GET request to /proposals/{proposalId} to check their proposal status.
    • Return 200 OK with proposal details or 404 Not Found if the proposal does not exist.
  • Update Proposal Status:

    • Clients should be able to make a PUT request to /proposals/{proposalId}/status to update the proposal status.
    • Return 200 OK if the update is successful or 404 Not Found if the proposal does not exist.

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
      }
  • Get Proposals for a Job:

    • Method: GET
    • URL: /jobs/{jobId}/proposals
  • Get Proposal Status:

    • Method: GET
    • URL: /proposals/{proposalId}
  • Update Proposal Status:

    • Method: PUT
    • URL: /proposals/{proposalId}/status
    • Request Body Example:
      {
        "status": "Accepted"
      }

Metadata

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions