Skip to content

fix: reject inverted budget ranges in job validation#6663

Open
juntinglu-229 wants to merge 1 commit into
SecureBananaLabs:mainfrom
juntinglu-229:fix/2853-inverted-budget-validation
Open

fix: reject inverted budget ranges in job validation#6663
juntinglu-229 wants to merge 1 commit into
SecureBananaLabs:mainfrom
juntinglu-229:fix/2853-inverted-budget-validation

Conversation

@juntinglu-229

Copy link
Copy Markdown

Closes #2853

Problem

createJobSchema does not validate that budgetMax >= budgetMin, allowing inverted budget ranges.

Fix

Added .refine() to both schemas to reject budgetMax < budgetMin:

  • createJobSchema: always validates
  • updateJobSchema: validates only when both fields present in partial update

Test Cases

Input Expected
budgetMin:100, budgetMax:500 Pass
budgetMin:500, budgetMax:500 Pass
budgetMin:500, budgetMax:100 Reject
Partial {budgetMax:200} Pass

github-actions Bot added a commit that referenced this pull request Jun 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Job validation should reject inverted budget ranges

1 participant