feat: make responsiblePerson required on project creation/edit

- Zod schema: responsiblePerson now min(1) required, no longer optional
- ProjectModal: required indicator (*), HTML required attribute, no undefined fallback
- ProjectWizard: same fix for create flow
- Existing projects with null responsiblePerson still work (DB allows null)
- Validation enforced at API boundary on new creates/updates

Co-Authored-By: claude-flow <ruv@ruv.net>
This commit is contained in:
2026-03-23 07:35:42 +01:00
parent 3c0befb7db
commit 624badebad
3 changed files with 7 additions and 6 deletions
@@ -204,7 +204,7 @@ export function ProjectModal({ project, onClose }: ProjectModalProps) {
startDate: new Date(form.startDate),
endDate: new Date(form.endDate),
status: form.status as unknown as ProjectStatus,
responsiblePerson: form.responsiblePerson.trim() || undefined,
responsiblePerson: form.responsiblePerson.trim(),
...(form.color ? { color: form.color } : {}),
...(form.utilizationCategoryId ? { utilizationCategoryId: form.utilizationCategoryId } : {}),
...(form.clientId ? { clientId: form.clientId } : {}),
@@ -223,7 +223,7 @@ export function ProjectModal({ project, onClose }: ProjectModalProps) {
status: form.status as unknown as ProjectStatus,
staffingReqs: [],
dynamicFields: {},
responsiblePerson: form.responsiblePerson.trim() || undefined,
responsiblePerson: form.responsiblePerson.trim(),
...(form.color ? { color: form.color } : {}),
...(form.utilizationCategoryId ? { utilizationCategoryId: form.utilizationCategoryId } : {}),
...(form.clientId ? { clientId: form.clientId } : {}),
@@ -521,8 +521,8 @@ export function ProjectModal({ project, onClose }: ProjectModalProps) {
</div>
<div>
<label className={labelClass} htmlFor="responsiblePerson">
Responsible Person
<InfoTooltip content="Project lead or account manager responsible for this project." />
Responsible Person <span className="text-red-500">*</span>
<InfoTooltip content="Project lead or account manager responsible for this project. Required." />
</label>
<input
id="responsiblePerson"
@@ -530,6 +530,7 @@ export function ProjectModal({ project, onClose }: ProjectModalProps) {
value={form.responsiblePerson}
onChange={(e) => setField("responsiblePerson", e.target.value)}
placeholder="Name or EID"
required
className={inputClass}
/>
</div>