Commit Graph

47 Commits

Author SHA1 Message Date
43801340f8 fix: add missing round finalization migration
All checks were successful
Build and Push Docker Image / build (push) Successful in 8m49s
The migration adding gracePeriodEndsAt, finalizedAt, finalizedBy to Round
and proposedOutcome to ProjectRoundState was never committed, causing
production to fail with "column does not exist" errors.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-03 21:49:06 +01:00
cb688ba3e6 feat: formula-based ranking with optional AI, configurable score/pass-rate weights
All checks were successful
Build and Push Docker Image / build (push) Successful in 8m56s
Add scoreWeight and passRateWeight (0-10) to evaluation config for
configurable composite score formula. When ranking criteria text is
empty, triggerAutoRank uses pure formula ranking (no LLM calls).
When criteria text is present, AI-assisted ranking runs as before.

- Add FORMULA to RankingMode enum with migration
- Extract fetchCategoryProjects helper, add formulaRank service
- Update computeCompositeScore to accept configurable weights
- Add score/pass-rate weight sliders to ranking dashboard UI
- Mode-aware button labels (Calculator/formula vs Sparkles/AI)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-02 20:24:17 +01:00
49e706f2cf feat: applicant onboarding, bulk invite, team management enhancements
All checks were successful
Build and Push Docker Image / build (push) Successful in 9m50s
- Add nationality/institution fields to User model with migration
- Applicant onboarding wizard (name, photo, nationality, country, institution, bio, project logo, preferences)
- Project logo upload from applicant context with team membership verification
- APPLICANT redirects in set-password, onboarding, and auth layout
- Mask evaluation round names as "Evaluation Round 1/2/..." for applicants
- Extend inviteTeamMember with nationality/country/institution/sendInvite fields
- Admin getApplicants query with search/filter/pagination
- Admin bulkInviteApplicants mutation with token generation and emails
- Applicants tab on Members page with bulk select and floating invite bar

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-02 10:11:11 +01:00
91bc100559 feat(01-01): add RankingSnapshot model + enums to schema.prisma
- Add RankingTriggerType enum (MANUAL, AUTO, RETROACTIVE, QUICK)
- Add RankingMode enum (PREVIEW, CONFIRMED, QUICK)
- Add RankingSnapshotStatus enum (PENDING, RUNNING, COMPLETED, FAILED)
- Add RankingSnapshot model with roundId/triggeredById FKs, criteria/results JSON fields, AI metadata
- Add Round.rankingSnapshots back-relation (RoundRankingSnapshots)
- Add User.rankingSnapshots back-relation (TriggeredRankingSnapshots)
- Create migration 20260227000000_add_ranking_snapshot
- Regenerate Prisma client (prisma.rankingSnapshot accessible)
2026-02-27 00:51:07 +01:00
f3fd9eebee Multi-role members, round detail UI overhaul, dashboard jury progress, and submit bug fix
Some checks failed
Build and Push Docker Image / build (push) Has been cancelled
- Add roles UserRole[] to User model with migration + backfill from existing role column
- Update auth JWT/session to propagate roles array with [role] fallback for stale tokens
- Update tRPC hasRole() middleware and add userHasRole() helper for inline role checks
- Update ~15 router inline checks and ~13 DB queries to use roles array
- Add updateRoles admin mutation with SUPER_ADMIN guard and priority-based primary role
- Add role switcher UI in admin sidebar and role-nav for multi-role users
- Remove redundant stats cards from round detail, add window dates to header banner
- Merge Members section into JuryProgressTable with inline cap editor and remove buttons
- Reorder round detail assignments tab: Progress > Score Dist > Assignments > Coverage > Jury Group
- Make score distribution fill full vertical height, reassignment history always open
- Add per-juror progress bars to admin dashboard ActiveRoundPanel for EVALUATION rounds
- Fix evaluation submit bug: use isSubmitting state instead of startMutation.isPending

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-24 17:44:55 +01:00
feccd269f7 Add COI_REASSIGNED and MANUAL_REASSIGNED to prod SQL insert script
All checks were successful
Build and Push Docker Image / build (push) Successful in 10m0s
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-23 16:12:33 +01:00
95d51e7de3 Add juror quick actions to Members section, redistribute button, dropout emails, and transfer duplicate detection
Some checks failed
Build and Push Docker Image / build (push) Has been cancelled
- Add mail/transfer/reshuffle/redistribute icons to each juror row in Members card
- New redistributeJurorAssignments procedure: reassign all pending projects without dropping juror from group
- New DROPOUT_REASSIGNED email template with project names, deadline, and dropped juror context
- Update reassignDroppedJuror to send per-juror DROPOUT_REASSIGNED emails instead of generic BATCH_ASSIGNED
- Transfer dialog now shows all candidates with "Already assigned" / "At cap" labels instead of hiding them
- SQL script for prod DB insertion of new notification setting without seeding

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-23 16:08:46 +01:00
ee2f10e080 Add jury assignment transfer, cap redistribution, and learning hub overhaul
All checks were successful
Build and Push Docker Image / build (push) Successful in 12m19s
- Add getTransferCandidates/transferAssignments procedures for targeted
  assignment moves between jurors with TOCTOU guards and audit logging
- Add getOverCapPreview/redistributeOverCap for auto-redistributing
  assignments when a juror's cap is lowered below their current load
- Add TransferAssignmentsDialog (2-step: select projects, pick destinations)
- Extend InlineMemberCap with over-cap detection and redistribute banner
- Extend getReassignmentHistory to show ASSIGNMENT_TRANSFER and CAP_REDISTRIBUTE events
- Learning hub: replace ResourceType/CohortLevel enums with accessJson JSONB,
  add coverImageKey, resource detail pages for jury/mentor, shared renderer
- Migration: 20260221200000_learning_hub_overhaul

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-21 18:50:29 +01:00
f42b452899 Add Anthropic API integration, remove locale settings UI
All checks were successful
Build and Push Docker Image / build (push) Successful in 13m15s
Anthropic API:
- Add @anthropic-ai/sdk with adapter wrapping OpenAI-shaped interface
- Support Claude models (opus, sonnet, haiku) with extended thinking
- Auto-reset model on provider switch, JSON retry logic
- Add Claude model pricing to ai-usage tracker
- Update AI settings form with Anthropic provider option
- Add provider field to AIUsageLog for cross-provider cost tracking

Locale Settings Removal:
- Strip Localization tab from admin settings (mobile + desktop)
- Remove i18n settings from router and feature flags
- Remove LOCALIZATION from SettingCategory enum
- Keep franc document language detection intact

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-21 17:26:59 +01:00
Matt
a02ed59158 Fix AI filtering bugs, add special award shortlist integration
All checks were successful
Build and Push Docker Image / build (push) Successful in 8m20s
Part 1 - Bug Fixes:
- Fix toProjectWithRelations() stripping file fields needed by AI (detectedLang, textContent, etc.)
- Fix parseAIData() reading flat when aiScreeningJson is nested under rule ID
- Fix getAIConfidenceScore() with same nesting issue (always returned 0)

Part 2 - Special Award Track Integration:
- Add shortlistSize to SpecialAward, qualityScore/shortlisted/confirmed fields to AwardEligibility
- Add specialAwardId to Round for award-owned rounds
- Update AI eligibility service to return qualityScore (0-100) for ranking
- Update eligibility job with filteringRoundId scoping and auto-shortlist top N
- Add 8 new specialAward router procedures (listForRound, runEligibilityForRound,
  listShortlist, toggleShortlisted, confirmShortlist, listRounds, createRound, deleteRound)
- Create award-shortlist.tsx component with ranked table, shortlist checkboxes, confirm dialog
- Add "Special Award Tracks" section to filtering dashboard

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-17 15:38:31 +01:00
Matt
c9640c6086 Add document analysis: page count, text extraction & language detection
All checks were successful
Build and Push Docker Image / build (push) Successful in 11m7s
Introduces a document analyzer service that extracts page count (via pdf-parse),
text preview, and detected language (via franc) from uploaded files. Analysis runs
automatically on upload (configurable via SystemSettings) and can be triggered
retroactively for existing files. Results are displayed as badges in the FileViewer
and fed to AI screening for language-based filtering criteria.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-17 10:09:04 +01:00
Matt
5e0c8b2dfe Add schema reconciliation migration and file removal in bulk upload
All checks were successful
Build and Push Docker Image / build (push) Successful in 7m38s
Migration:
- Add standalone hasConflict index on ConflictOfInterest
- Ensure roundId is nullable on ConflictOfInterest
- Drop stale composite roundId_hasConflict index

Bulk upload:
- Add trash icon button to remove uploaded files
- Uses existing file.delete endpoint with audit logging

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-16 13:46:12 +01:00
Matt
c707899179 Add missing migration for ProjectFile.pageCount column
All checks were successful
Build and Push Docker Image / build (push) Successful in 8m48s
Column was in Prisma schema but had no migration file, causing
'column does not exist' errors on file uploads.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-16 13:23:18 +01:00
Matt
effc078918 Make all migration SQL files idempotent for clean prod deploys
All checks were successful
Build and Push Docker Image / build (push) Successful in 8m14s
Added IF NOT EXISTS, IF EXISTS, and DO $$ EXCEPTION guards to all
migration files from 20260205 onwards so they survive partial application
and work correctly on both fresh databases and existing deployments.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-16 13:09:41 +01:00
1233cdd22c Fix phase7 FK rename migration: drop old roundId before rename
All checks were successful
Build and Push Docker Image / build (push) Successful in 7m45s
The pipeline migration (20260213) added stageId columns while keeping
the original roundId columns as nullable. The rename migration tried
to RENAME stageId TO roundId but failed because roundId already existed.
Fix: DROP the old roundId column first, then rename stageId → roundId.
Also restore FK constraints on ConflictOfInterest and TaggingJob.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-15 23:16:06 +01:00
6ca39c976b Competition/Round architecture: full platform rewrite (Phases 1-9)
All checks were successful
Build and Push Docker Image / build (push) Successful in 7m45s
Replace Pipeline/Stage system with Competition/Round architecture.
New schema: Competition, Round (7 types), JuryGroup, AssignmentPolicy,
ProjectRoundState, DeliberationSession, ResultLock, SubmissionWindow.
New services: round-engine, round-assignment, deliberation, result-lock,
submission-manager, competition-context, ai-prompt-guard.
Full admin/jury/applicant/mentor UI rewrite. AI prompt hardening with
structured prompts, retry logic, and injection detection. All legacy
pipeline/stage code removed. 4 new migrations + seed aligned.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-15 23:04:15 +01:00
9ab4717f96 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>
2026-02-15 14:25:05 +01:00
Matt
b5425e705e Apply full refactor updates plus pipeline/email UX confirmations
All checks were successful
Build and Push Docker Image / build (push) Successful in 10m33s
2026-02-14 15:26:42 +01:00
31225b099e Fix migration: drop RoundTemplate before RoundType enum
RoundTemplate table depends on RoundType enum, must be dropped first.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-13 19:45:34 +01:00
dc075f8969 Fix migration with fully idempotent SQL to handle partial application
Rewrote pipeline/stage migration with defensive guards:
- DO blocks with EXCEPTION handlers for enum/constraint creation
- IF NOT EXISTS on all CREATE TABLE/INDEX
- IF EXISTS on all DROP INDEX
- Handles re-running after partial failure

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-13 16:42:54 +01:00
68d3dde1aa Add migration for pipeline/stage system, new enums, and Round retirement
The Round system redesign commit added Pipeline, Track, Stage models
and converted roundId to legacy fields but was missing the SQL migration.
This caused seed failure (AWARD_MASTER enum not found in DB).

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-13 16:19:56 +01:00
52cdca1b85 Move required reviews field into evaluation settings and add live voting migration
Move the "Required Reviews per Project" field from the Basic Information
card into the Evaluation Settings section of RoundTypeSettings, where it
contextually belongs. Add missing database migration for live voting
enhancements (criteria voting, audience voting, AudienceVoter table).

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-02-12 16:57:56 +01:00
ce4069bf92 Platform-wide visual overhaul, team invites, analytics improvements, and deployment hardening
UI overhaul applying jury dashboard design patterns across all pages:
- Stat cards with border-l-4 accent + icon pills on admin, observer, mentor, applicant dashboards and reports
- Card section headers with color-coded icon pills throughout
- Hover lift effects (translate-y + shadow) on cards and list items
- Gradient progress bars (brand-teal to brand-blue) platform-wide
- AnimatedCard stagger animations on all dashboard sections
- Auth pages with gradient accent strip and polished icon containers
- EmptyState component upgraded with rounded icon pill containers
- Replaced AI-looking icons (Brain/Sparkles/Bot/Wand2/Cpu) with descriptive alternatives across 12 files
- Removed gradient overlay from jury dashboard header
- Quick actions restyled as card links with group hover effects

Backend improvements:
- Team member invite emails with account setup flow and notification logging
- Analytics routers accept edition-wide queries (programId) in addition to roundId
- Round detail endpoint returns inline progress data (eliminates extra getProgress call)
- Award voting endpoints parallelized with Promise.all
- Bulk invite supports optional sendInvitation flag
- AwardVote composite index migration for query performance

Infrastructure:
- Docker entrypoint with migration retry loop (configurable retries/delay)
- docker-compose pull_policy: always for automatic image refresh
- Simplified deploy/update scripts using docker compose up -d --pull always
- Updated deployment documentation

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-11 13:20:52 +01:00
98f4a957cc Performance optimization, applicant portal, and missing DB migration
Performance:
- Convert admin dashboard from SSR to client-side tRPC (fixes 503/ChunkLoadError)
- New dashboard.getStats tRPC endpoint batches 16 queries into single response
- Parallelize jury dashboard queries (assignments + gracePeriods via Promise.all)
- Add project.getFullDetail combined endpoint (project + assignments + stats)
- Configure Prisma connection pool (connection_limit=20, pool_timeout=10)
- Add optimizePackageImports for lucide-react tree-shaking
- Increase React Query staleTime from 1min to 5min

Applicant portal:
- Add applicant layout, nav, dashboard, documents, team, and mentor pages
- Add applicant router with document and team management endpoints
- Add chunk error recovery utility
- Update role nav and auth redirect for applicant role

Database:
- Add migration for missing schema elements (SpecialAward job tracking
  columns, WizardTemplate table, missing indexes)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-11 11:04:26 +01:00
7e3d600eed Fix project detail 500 error and round deletion data integrity
- Add missing migration for FileRequirement table and ProjectFile.requirementId
  column (existed in Prisma schema but had no migration, causing all queries
  with `include: { files: true }` to fail with column not found)
- Make projectTags query resilient with try-catch in project.get
- Reset project status to SUBMITTED when round is deleted (prevents orphaned
  ASSIGNED status after ON DELETE SET NULL nullifies roundId)
- Fix round creation/update to allow requiredReviews=0 for filtering rounds
- Parse Zod validation errors in round creation error display

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-11 00:20:28 +01:00
d787a24921 Observer dashboard extraction, PDF reports, jury UX overhaul, and miscellaneous improvements
- Extract observer dashboard to client component, add PDF export button
- Add PDF report generator with jsPDF for analytics reports
- Overhaul jury evaluation page with improved layout and UX
- Add new analytics endpoints for observer/admin reports
- Improve round creation/edit forms with better settings
- Fix filtering rules page, CSV export dialog, notification bell
- Update auth, prisma schema, and various type fixes

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-10 23:08:00 +01:00
573785e440 Fix round deletion FK constraint with migration and defensive code
- Add SQL migration to CASCADE Evaluation.formId and SET NULL ProjectFile.roundId
- Explicitly delete evaluations in round delete transaction as defensive measure
- Make sidebar Apply Page link dynamic using current edition context

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-10 20:42:33 +01:00
e0e4cb2a32 Reconcile schema with migrations and fix failed migration
- Align schema.prisma with add_15_features migration (15 discrepancies):
  nullability, column names, PKs, missing/extra columns, onDelete behavior
- Make universal_apply_programid migration idempotent for safe re-execution
- Add reconciliation migration for missing FKs and indexes
- Fix message.ts and mentor.ts to match corrected schema field names

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-08 14:37:32 +01:00
e7c86a7b1b Add dynamic apply wizard customization with admin settings UI
- Create wizard config types, utilities, and defaults (wizard-config.ts)
- Add admin apply settings page with drag-and-drop step ordering, dropdown
  option management, feature toggles, welcome message customization, and
  custom field builder with select/multiselect options editor
- Build dynamic apply wizard component with animated step transitions,
  mobile-first responsive design, and config-driven form validation
- Update step components to accept dynamic config (categories, ocean issues,
  field visibility, feature flags)
- Replace hardcoded enum validation with string-based validation for
  admin-configurable dropdown values, with safe enum casting at storage layer
- Add wizard template system (model, router, admin UI) with built-in
  MOPC Classic preset
- Add program wizard config CRUD procedures to program router
- Update application router getConfig to return wizardConfig, submit handler
  to store custom field data in metadataJson
- Add edition-based apply page, project pool page, and supporting routers
- Fix CSS (invalid sm:fixed-none), Enter key handler (skip textarea),
  safe area insets for notched phones, buildStepsArray field visibility

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-08 13:21:26 +01:00
4830c0638c Add database migration for 15 platform features
Creates tables: DigestLog, RoundTemplate, MentorNote, MentorMilestone,
MentorMilestoneCompletion, Message, MessageTemplate, MessageRecipient,
Webhook, WebhookDelivery, EvaluationDiscussion, DiscussionComment,
ReminderLog, ConflictOfInterest, EvaluationSummary, ProjectStatusHistory,
MentorMessage. Adds columns to User, AuditLog, LiveVotingSession, LiveVote,
MentorAssignment, Project, ProjectFile. Adds SettingCategory enum values.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-05 23:32:25 +01:00
3abfccb22a Fix AI suggestions not displaying after job completion
BREAKING CHANGE: AI assignment job now stores suggestions in database

- Add suggestionsJson column to AssignmentJob table
- Store enriched suggestions when job completes
- Update getAISuggestions to retrieve stored suggestions instead of regenerating
- Filter out already-assigned pairs from stored suggestions

Previously, the background job generated suggestions but discarded them,
and getAISuggestions tried to regenerate from scratch (causing infinite loading).

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-05 14:38:43 +01:00
e3e3fa9da4 Fix AI assignment errors and tag matching
- Add missing updatedAt column to AssignmentJob table
- Fix algorithmic assignment to use AI-assigned projectTags instead of raw CSV tags
- Add case-insensitive tag matching for better expertise matching
- Scores should now properly reflect tag matches between judges and projects

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-05 14:14:19 +01:00
fbb1173ea9 Add migration for User.country column
The country field was in the schema but missing its migration.
This was causing user.get and user.me queries to fail.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-05 13:58:11 +01:00
1b2311b4a3 Convert AI tagging to background job with progress tracking
- Add TaggingJob model for tracking tagging progress
- Convert batch tagging to background job processing (prevents timeouts)
- Add real-time progress polling in UI with percentage/count display
- Add admin notifications when tagging job completes or fails
- Export getTaggingSettings and getAvailableTags functions

After deployment, run: npx prisma migrate deploy

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-05 11:48:57 +01:00
e37154d812 Make migrations idempotent and add missing tables
- Make all pending migrations idempotent (safe to re-run)
- Disable decouple_projects_from_rounds migration (schema not changed)
- Add ProjectTag table for AI tagging
- Add AssignmentJob table for AI assignment progress

On server deployment, run: npx prisma migrate deploy

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-05 11:09:37 +01:00
6d2537ec04 Add per-round assignment constraints (min/max per judge)
- Add minAssignmentsPerJuror and maxAssignmentsPerJuror fields to Round model
- Update assignment router:
  - Calculate effective max from user override or round default
  - Add forceOverride parameter for manual assignment beyond limits
  - Update getSuggestions to use round constraints with min target bonus
  - Update getAISuggestions to pass constraints to AI service
- Update AI assignment service:
  - Add minAssignmentsPerJuror to constraints interface
  - Update fallback algorithm with under-min bonus scoring
  - New score weights: 50% expertise, 30% load, 20% under-min bonus
- Update round router:
  - Add new constraint fields to create/update schemas
  - Add validation for min <= max constraint
- Update admin UI:
  - Add min/max constraint fields to round edit page
  - Remove hardcoded maxPerJuror from assignments page
- Add migration files for production deployment:
  - User.bio field for judge/mentor profiles
  - Round assignment constraint fields

Constraint hierarchy:
1. User.maxAssignments (if set) overrides round default
2. Round.maxAssignmentsPerJuror is the default cap
3. Admin can force-override any limit with confirmation

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-04 16:01:18 +01:00
d1f7f0361d Add migration for Round.sortOrder field
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-04 14:32:52 +01:00
8cdf6c9e5e Add unified expertise tag system and round entry notifications
- ExpertiseSelect now fetches tags from database with category grouping
- Tags set by admin during invitation are locked and cannot be removed
- Onboarding merges user-selected tags with admin-preset tags
- MENTOR role now goes through onboarding flow
- Added migration for Round.entryNotificationType column
- Added seed script with ~90 comprehensive expertise tags

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-04 01:15:21 +01:00
0277768ed7 Add notification bell system and MOPC onboarding form
Notification System:
- Add InAppNotification and NotificationEmailSetting database models
- Create notification service with 60+ notification types for all user roles
- Add notification router with CRUD endpoints
- Build NotificationBell UI component with dropdown and unread count
- Integrate bell into admin, jury, mentor, and observer navs
- Add notification email settings admin UI in Settings > Notifications
- Add notification triggers to filtering router (complete/failed)
- Add sendNotificationEmail function to email library
- Add formatRelativeTime utility function

MOPC Onboarding Form:
- Create /apply landing page with auto-redirect for single form
- Create seed script for MOPC 2026 application form (6 steps)
- Create seed script for default notification email settings

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-03 21:30:25 +01:00
e2782b2b19 Add background filtering jobs, improved date picker, AI reasoning display
- Implement background job system for AI filtering to avoid HTTP timeouts
- Add FilteringJob model to track progress of long-running filtering operations
- Add real-time progress polling for filtering operations on round details page
- Create custom DateTimePicker component with calendar popup (no year picker hassle)
- Fix round date persistence bug (refetchOnWindowFocus was resetting form state)
- Integrate filtering controls into round details page for filtering rounds
- Display AI reasoning for flagged/filtered projects in results table
- Add onboarding system scaffolding (schema, routes, basic UI)
- Allow setting round dates in the past for manual overrides

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-03 19:48:41 +01:00
8be740a4fb Fix multiple UI/UX issues and invite token migration
Fixes:
- Round edit: Add cache invalidation for voting dates
- Criteria weights: Replace number input with visual slider
- Member invite: Per-member expertise tags with suggestions
  - Tags now added per member, not globally
  - Comma key support for quick tag entry
  - Suggested tags based on ocean/business expertise
- Accept-invite: Add Suspense boundary for useSearchParams
- Add missing inviteToken columns migration

The invite token columns were accidentally skipped in prototype1
migration. This adds them with IF NOT EXISTS checks.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-03 15:25:28 +01:00
3986da172f Fix GPT-5 API compatibility and add AIUsageLog migration
- Add AIUsageLog table migration for token tracking
- Fix GPT-5 temperature parameter (not supported, like o-series)
- Add usesNewTokenParam() and supportsTemperature() functions
- Add GPT-5+ category to model selection UI
- Update model sorting to show GPT-5+ first

GPT-5 and newer models use max_completion_tokens and don't support
custom temperature values, similar to reasoning models.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-03 15:04:16 +01:00
fd5e5222da Decouple projects from rounds with RoundProject join table
Projects now exist at the program level instead of being locked to a
single round. A new RoundProject join table enables many-to-many
relationships with per-round status tracking. Rounds have sortOrder
for configurable progression paths.

- Add RoundProject model, programId on Project, sortOrder on Round
- Migration preserves existing data (roundId -> RoundProject entries)
- Update all routers to query through RoundProject join
- Add assign/remove/advance/reorder round endpoints
- Add Assign, Advance, Remove Projects dialogs on round detail page
- Add round reorder controls (up/down arrows) on rounds list
- Show all rounds on project detail page

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-02 22:33:55 +01:00
8931da98ba Add AI eligibility toggle and include-submitted filter for awards
- Add useAiEligibility boolean to SpecialAward schema (default true)
- Toggle on creation form lets admins disable AI for feeling-based awards
- Detail page shows "Load All Projects" when AI is off vs "Run AI Eligibility"
- Include Submitted toggle lets admins include SUBMITTED-status projects
- Fix perPage: 200 → 100 to match user.list validation max
- Fix edition display on award detail page
- Add migration for new column

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-02 20:02:58 +01:00
afe8a58535 Fix migration: skip inviteToken columns and index that already exist in production
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-02 17:17:55 +01:00
90e3adfab2 Implement Prototype 1 improvements: unified members, project filters, audit expansion, filtering rounds, special awards
- Unified Member Management: merge /admin/users and /admin/mentors into /admin/members with role tabs, search, pagination
- Project List Filters: add search, multi-status filter, round/category/country selects, boolean toggles, URL persistence
- Audit Log Expansion: track logins, round state changes, evaluation submissions, file access, role changes via shared logAudit utility
- Founding Date Field: add foundedAt to Project model with CSV import support
- Filtering Round System: configurable rules (field-based, document check, AI screening), execution engine, results review with override/reinstate
- Special Awards System: named awards with eligibility criteria, dedicated jury, PICK_WINNER/RANKED/SCORED voting modes, AI eligibility
- Dashboard resilience: wrap heavy queries in try-catch to prevent error boundary on transient DB failures
- Reusable pagination component extracted to src/components/shared/pagination.tsx
- Old /admin/users and /admin/mentors routes redirect to /admin/members
- Prisma migration for all schema additions (additive, no data loss)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-02 16:58:29 +01:00
4071606005 Add initial Prisma migration from schema
Generated via prisma migrate diff --from-empty for fresh DB deployment.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-30 19:10:27 +01:00