Round system redesign: Phases 1-7 complete

Full pipeline/track/stage architecture replacing the legacy round system.

Schema: 11 new models (Pipeline, Track, Stage, StageTransition,
ProjectStageState, RoutingRule, Cohort, CohortProject, LiveProgressCursor,
OverrideAction, AudienceVoter) + 8 new enums.

Backend: 9 new routers (pipeline, stage, routing, stageFiltering,
stageAssignment, cohort, live, decision, award) + 6 new services
(stage-engine, routing-engine, stage-filtering, stage-assignment,
stage-notifications, live-control).

Frontend: Pipeline wizard (17 components), jury stage pages (7),
applicant pipeline pages (3), public stage pages (2), admin pipeline
pages (5), shared stage components (3), SSE route, live hook.

Phase 6 refit: 23 routers/services migrated from roundId to stageId,
all frontend components refitted. Deleted round.ts (985 lines),
roundTemplate.ts, round-helpers.ts, round-settings.ts, round-type-settings.tsx,
10 legacy admin pages, 7 legacy jury pages, 3 legacy dialogs.

Phase 7 validation: 36 tests (10 unit + 8 integration files) all passing,
TypeScript 0 errors, Next.js build succeeds, 13 integrity checks,
legacy symbol sweep clean, auto-seed on first Docker startup.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-02-13 13:57:09 +01:00
parent 8a328357e3
commit 331b67dae0
256 changed files with 29117 additions and 21424 deletions

View File

@@ -82,7 +82,7 @@ export default function ApplicantDocumentsPage() {
)
}
const { project, openRounds } = data
const { project, openStages } = data
const isDraft = !project.submittedAt
return (
@@ -98,23 +98,23 @@ export default function ApplicantDocumentsPage() {
</p>
</div>
{/* Per-round upload sections */}
{openRounds.length > 0 && (
{/* Per-stage upload sections */}
{openStages.length > 0 && (
<div className="space-y-6">
{openRounds.map((round) => {
{openStages.map((stage) => {
const now = new Date()
const isLate = round.votingStartAt && now > new Date(round.votingStartAt)
const hasDeadline = !!round.submissionDeadline
const deadlinePassed = hasDeadline && now > new Date(round.submissionDeadline!)
const hasDeadline = !!stage.windowCloseAt
const deadlinePassed = hasDeadline && now > new Date(stage.windowCloseAt!)
const isLate = deadlinePassed
return (
<Card key={round.id}>
<Card key={stage.id}>
<CardHeader>
<div className="flex items-center justify-between">
<div>
<CardTitle className="text-lg">{round.name}</CardTitle>
<CardTitle className="text-lg">{stage.name}</CardTitle>
<CardDescription>
Upload documents for this round
Upload documents for this stage
</CardDescription>
</div>
<div className="flex items-center gap-2">
@@ -127,7 +127,7 @@ export default function ApplicantDocumentsPage() {
{hasDeadline && !deadlinePassed && (
<Badge variant="outline" className="gap-1">
<Clock className="h-3 w-3" />
Due {new Date(round.submissionDeadline!).toLocaleDateString()}
Due {new Date(stage.windowCloseAt!).toLocaleDateString()}
</Badge>
)}
</div>
@@ -136,7 +136,7 @@ export default function ApplicantDocumentsPage() {
<CardContent>
<RequirementUploadList
projectId={project.id}
roundId={round.id}
stageId={stage.id}
disabled={false}
/>
</CardContent>
@@ -146,27 +146,6 @@ export default function ApplicantDocumentsPage() {
</div>
)}
{/* Original round upload (if not already in openRounds) */}
{project.roundId && !openRounds.some((r) => r.id === project.roundId) && (
<Card>
<CardHeader>
<CardTitle className="text-lg">
{project.round?.name || 'Submission Documents'}
</CardTitle>
<CardDescription>
Documents uploaded with your original application
</CardDescription>
</CardHeader>
<CardContent>
<RequirementUploadList
projectId={project.id}
roundId={project.roundId}
disabled={!isDraft}
/>
</CardContent>
</Card>
)}
{/* Uploaded files list */}
<Card>
<CardHeader>
@@ -184,7 +163,7 @@ export default function ApplicantDocumentsPage() {
<div className="space-y-2">
{project.files.map((file) => {
const Icon = fileTypeIcons[file.fileType] || File
const fileRecord = file as typeof file & { isLate?: boolean; roundId?: string | null }
const fileRecord = file as typeof file & { isLate?: boolean; stageId?: string | null }
return (
<div
@@ -218,13 +197,13 @@ export default function ApplicantDocumentsPage() {
</CardContent>
</Card>
{/* No open rounds message */}
{openRounds.length === 0 && !project.roundId && (
{/* No open stages message */}
{openStages.length === 0 && project.files.length === 0 && (
<Card className="bg-muted/50">
<CardContent className="p-6 text-center">
<Clock className="h-10 w-10 mx-auto text-muted-foreground/50 mb-3" />
<p className="text-muted-foreground">
No rounds are currently open for document submissions.
No stages are currently open for document submissions.
</p>
</CardContent>
</Card>