Skip to content

[ShanaBoo] Reject inverted job budget ranges in job validation#6643

Open
genesisrevelationinc-debug wants to merge 9 commits into
SecureBananaLabs:mainfrom
genesisrevelationinc-debug:shanaboo-fix-2827
Open

[ShanaBoo] Reject inverted job budget ranges in job validation#6643
genesisrevelationinc-debug wants to merge 9 commits into
SecureBananaLabs:mainfrom
genesisrevelationinc-debug:shanaboo-fix-2827

Conversation

@genesisrevelationinc-debug

Copy link
Copy Markdown

ShanaBoo Autonomous Fix

This PR was automatically generated by ShanaBoo Earn Engine to claim the $780.00 bounty on this issue.

Source: Github | Task: 4557364252

Closes #2827


Auto-submitted by ShanaBoo CNS — NVIDIA NIM + Microsoft Agent Framework

Copilot AI review requested due to automatic review settings June 11, 2026 06:35
github-actions Bot added a commit that referenced this pull request Jun 11, 2026

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Note

Copilot was unable to run its full agentic suite in this review.

Adds Zod validation schemas for Job create/update payloads, including inferred input types and budget range validation.

Changes:

  • Introduces createJobSchema and updateJobSchema for request validation
  • Adds a refinement to enforce budgetMax >= budgetMin when both are provided
  • Exports CreateJobInput / UpdateJobInput inferred types

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread apps/api/src/validation/job.schema.ts Outdated
Comment on lines +22 to +38
export const updateJobSchema = z.object({
title: z.string().min(1).max(200).optional(),
budgetMax: z.number().nonnegative().optional(),
categoryId: z.string().uuid().optional(),
skills: z.array(z.string()).optional(),
}).refine(
(data) => {
if (data.budgetMin !== undefined && data.budgetMax !== undefined) {
return data.budgetMax >= data.budgetMin;
}
return true;
},
{
message: 'budgetMax must be greater than or equal to budgetMin',
path: ['budgetMax'],
}
);
Comment thread apps/api/src/validation/job.schema.ts Outdated
@@ -0,0 +1,41 @@
import { z, RefinementCtx } from 'zod';
Comment thread apps/api/src/validation/job.schema.ts Outdated
Comment on lines +9 to +20
}).refine(
(data) => {
if (data.budgetMin !== undefined && data.budgetMax !== undefined) {
return data.budgetMax >= data.budgetMin;
}
return true;
},
{
message: 'budgetMax must be greater than or equal to budgetMin',
path: ['budgetMax'],
}
);
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.

Reject inverted job budget ranges in job validation

2 participants