Skip to content

Fix: Add schema validation and positive bid bounds to proposals (ref #743) #12520

Open

Description

@PINYOPATTANAWASANPORN

Bug Description

In apps/api/src/controllers/proposalController.js, postProposal directly consumes req.body without schema validation. This allows unvalidated payloads, non-positive or negative bid amounts, and missing job references to be accepted.

Proposed Fix

  1. Create apps/api/src/validators/proposal.js requiring valid jobId, minimum coverLetter length, and strictly positive finite bidAmount.
  2. Validate request payload in proposalController.postProposal using createProposalSchema.parse(req.body).
  3. Add automated unit/regression tests verifying rejection of negative/zero bids and acceptance of valid proposals.

This issue is limited only to the creator of this issue. This means that only the issue author can attempt to solve this issue. If you would like to work on it, please create another issue with the same contents and refer to issue #743 for more information.

Activity

  1. PINYOPATTANAWASANPORN commented on Sep 16, 2026

    @PINYOPATTANAWASANPORN
    Author

    I have implemented the schema validation and positive bid bounds for proposals along with automated regression test coverage.

    Delivered in PR #12521

  2. monopolymummat-cmyk commented on Oct 3, 2026

    @monopolymummat-cmyk

    Hi — I've opened #12890 (#12890) to address this.

    Disclosed: authored with AI assistance (Z.ai) and submitted for this project specifically.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions