Skip to content

Commit ee6ec75

Browse files
capJavertclaude
andcommitted
fix(recruiter): increase parse opportunity content limit to 5000
Parsed job descriptions from external URLs can exceed the 2500 char edit limit. Use a separate parse content schema with 5000 max while keeping the manual edit limit at 2500. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent b987bd7 commit ee6ec75

1 file changed

Lines changed: 18 additions & 2 deletions

File tree

src/common/schema/opportunities.ts

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,12 @@ export const opportunityMatchDescriptionSchema = z.object({
2626

2727
export const createOpportunityEditContentSchema = ({
2828
optional = false,
29+
maxLength = 2500,
2930
}: {
3031
optional?: boolean;
32+
maxLength?: number;
3133
} = {}) => {
32-
const contentSchema = z.string().max(2500);
34+
const contentSchema = z.string().max(maxLength);
3335

3436
return z.object({
3537
content: optional ? contentSchema.optional() : contentSchema.nonempty(),
@@ -55,6 +57,20 @@ export const opportunityContentSchema = z.object({
5557
}).optional(),
5658
});
5759

60+
const opportunityParseContentSchema = z.object({
61+
overview: createOpportunityEditContentSchema({ maxLength: 5000 }),
62+
responsibilities: createOpportunityEditContentSchema({ maxLength: 5000 }),
63+
requirements: createOpportunityEditContentSchema({ maxLength: 5000 }),
64+
whatYoullDo: createOpportunityEditContentSchema({
65+
optional: true,
66+
maxLength: 5000,
67+
}).optional(),
68+
interviewProcess: createOpportunityEditContentSchema({
69+
optional: true,
70+
maxLength: 5000,
71+
}).optional(),
72+
});
73+
5874
const opportunityMetaBaseSchema = z.object({
5975
employmentType: z.coerce.number().min(1).optional(),
6076
teamSize: z.number().int().nonnegative().min(1).max(1_000_000).optional(),
@@ -138,7 +154,7 @@ export const opportunityCreateParseSchema = opportunityCreateSchema.extend({
138154
.partial()
139155
.optional()
140156
.default({}),
141-
content: opportunityContentSchema.partial().optional().default({}),
157+
content: opportunityParseContentSchema.partial().optional().default({}),
142158
location: z
143159
.array(
144160
z

0 commit comments

Comments
 (0)