fix: remove capacity requirement from user-facing workshop proposal schema#356
Open
fix: remove capacity requirement from user-facing workshop proposal schema#356
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
… validation Co-authored-by: Starefossen <[email protected]>
Copilot
AI
changed the title
[WIP] Fix workshop proposals update validation error
fix: remove capacity requirement from user-facing workshop proposal schema
Feb 28, 2026
Contributor
There was a problem hiding this comment.
Pull request overview
Removes the speaker-facing “workshop capacity required” validation that prevented workshop proposals from being updated via the CFP form, while keeping capacity management in the admin layer.
Changes:
- Removed the
capacityrequirement refine fromProposalInputSchema(speaker create/update validation). - Simplified client-side proposal validation by removing the capacity-specific message/options and checks.
- Updated tests to reflect that workshops can be valid without
capacityin the speaker schema/validator.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
src/server/schemas/proposal.ts |
Drops workshop-capacity requirement from the user-facing proposal input schema (keeps admin create requirement). |
src/lib/proposal/validation.ts |
Removes capacity-related validation message/options and the capacity check from validateProposalForm. |
__tests__/lib/proposal/validation.test.ts |
Removes now-obsolete capacity validation tests. |
__tests__/lib/proposal/schemas.test.ts |
Updates strict schema tests to allow workshops without capacity. |
Comments suppressed due to low confidence (1)
src/server/schemas/proposal.ts:83
ProposalInputSchemano longer requirescapacity(good for unblocking speakers), but it still acceptscapacitybecause it’s part ofProposalInputBaseSchema. Since the PR description states capacity is organizer/admin-managed, a speaker could still set/overwritecapacityby crafting a request that passes this schema. Consider omittingcapacityfrom the user-facing schema (or explicitly rejecting it) and/or stripping it server-side before persisting updates so only admin routes can change it.
export const ProposalInputSchema = ProposalInputBaseSchema.refine(
(data) => {
// Prerequisites should only be provided for workshop formats
if (data.prerequisites && !isWorkshopFormat(data.format)) {
return false
}
return true
},
{
message: 'Prerequisites are only allowed for workshop formats',
path: ['prerequisites'],
},
)
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
ProposalInputSchemaenforcedcapacityfor workshop formats server-side, butProposalDetailsFormhad no capacity input field — leaving speakers stuck in an unresolvable validation error when updating workshop proposals.Capacity is an organizer concern (room size, registration limits), not a speaker concern. It's already manageable via
updateWorkshopCapacitySchemain the admin layer.Changes
src/server/schemas/proposal.ts— removed capacity.refine()fromProposalInputSchema;ProposalAdminCreateSchemais unchanged (admins can still set capacity at creation time)src/lib/proposal/validation.ts— removedCAPACITY_REQUIREDmessage,ProposalValidationOptionsinterface, and the capacity check fromvalidateProposalFormschemas.test.ts(replaced "requires capacity" with "accepts workshop without capacity") and removed obsolete capacity tests fromvalidation.test.tsBefore:
After:
Original prompt
🔒 GitHub Advanced Security automatically protects Copilot coding agent pull requests. You can protect all pull requests by enabling Advanced Security for your repositories. Learn more about Advanced Security.
Greptile Summary
Correctly removes the speaker-facing capacity requirement for workshop proposals, resolving the issue where speakers couldn't update workshops due to a missing form field.
Key Changes:
.refine()validation fromProposalInputSchema— speakers no longer blocked by capacity requirementProposalAdminCreateSchema— admins can still set capacity at creationvalidateProposalFormHow It Works:
Workshop queries already use
coalesce(capacity, 30)fallback logic, so workshops without capacity default to 30 slots when displayed. Admins can set explicit capacity viaupdateWorkshopCapacitySchema.Verified:
Confidence Score: 5/5
coalesce()defaults in queries.Important Files Changed
ProposalInputSchema; admin schema unchanged and still enforces capacity for workshop formatsProposalValidationOptionsinterface; validation now simplifiedLast reviewed commit: 766b7ca