Simplify routing to award assignment, seed all CSV entries, fix category mapping
All checks were successful
Build and Push Docker Image / build (push) Successful in 8m3s

- Remove RoutingRule model and routing engine (replaced by direct award assignment)
- Simplify RoutingMode enum: PARALLEL/POST_MAIN → SHARED, keep EXCLUSIVE
- Remove routing router, routing-rules-editor, and related tests
- Update pipeline, award, and notification code to remove routing references
- Seed: include all CSV entries (no filtering/dedup), AI screening handles duplicates
- Seed: fix non-breaking space (U+00A0) bug in category/issue mapping
- Stage filtering: add duplicate detection that flags projects for admin review

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-02-15 14:25:05 +01:00
parent 382570cebd
commit 9ab4717f96
23 changed files with 249 additions and 2449 deletions

View File

@@ -163,9 +163,8 @@ enum TrackKind {
}
enum RoutingMode {
PARALLEL
SHARED
EXCLUSIVE
POST_MAIN
}
enum StageStatus {
@@ -1846,7 +1845,6 @@ model Pipeline {
// Relations
program Program @relation(fields: [programId], references: [id], onDelete: Cascade)
tracks Track[]
routingRules RoutingRule[]
@@index([programId])
@@index([status])
@@ -1871,8 +1869,6 @@ model Track {
stages Stage[]
projectStageStates ProjectStageState[]
specialAward SpecialAward?
routingRulesAsSource RoutingRule[] @relation("RoutingSourceTrack")
routingRulesAsDestination RoutingRule[] @relation("RoutingDestinationTrack")
@@unique([pipelineId, slug])
@@unique([pipelineId, sortOrder])
@@ -1969,30 +1965,6 @@ model ProjectStageState {
@@index([projectId, trackId])
}
model RoutingRule {
id String @id @default(cuid())
pipelineId String
name String
scope String @default("global") // global, track, stage
sourceTrackId String?
destinationTrackId String
destinationStageId String?
predicateJson Json @db.JsonB // { field, operator, value } or compound
priority Int @default(0)
isActive Boolean @default(true)
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
// Relations
pipeline Pipeline @relation(fields: [pipelineId], references: [id], onDelete: Cascade)
sourceTrack Track? @relation("RoutingSourceTrack", fields: [sourceTrackId], references: [id], onDelete: SetNull)
destinationTrack Track @relation("RoutingDestinationTrack", fields: [destinationTrackId], references: [id], onDelete: Cascade)
@@index([pipelineId])
@@index([priority])
@@index([isActive])
}
model Cohort {
id String @id @default(cuid())