Skip to content

SessionType rows exist only via seed — fresh DB blocks session creation & evaluator assignment #296

Description

@TusharW4ni

Part of #285 (Group D — robustness).

Problem

SessionType rows exist only because the seed script inserts them. On a fresh/un-seeded database the type table is empty, which blocks session creation (the picker is empty and a type is required) and blocks evaluator assignment (which looks up a "Evaluation Appointment" type and 500s if absent).

Evidence

  • prisma/seed.ts — the only source of SessionType rows (~10 types). server/api/session/types.get.ts is a bare findMany; there is no runtime seeding and no UI to create types.
  • components/schedule/SessionDetailModal.vue requires a selected type to submit; an empty list makes creation impossible.
  • server/api/session/appointments/index.put.ts throws 500 ("seed it before assigning evaluators") when the "Evaluation Appointment" type is missing.

Impact

P1 (environment). A fresh deploy/dev DB without seeding can't create any session or assign any evaluator.

Proposed approach

  • Guarantee the required SessionType rows via an idempotent runtime ensure-seed on boot/migration, and/or an ADMIN UI to manage session types.
  • At minimum, ensure the "Evaluation Appointment" type always exists before evaluator assignment can be reached.

Acceptance criteria

  • A freshly migrated DB (no manual seed) can create sessions and assign evaluators.
  • Session types are manageable without editing the seed script (UI or documented ensure-seed).

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    P1: highImportant functionality gapsarea: scheduleCalendar, appointments, sessionsbugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions