dreamteamprod / dreamteamprod/DigiScript

Add forward-planned session scheduling

Open
#1,112 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

claude
Dominant language
Vue
Stars
19
Forks
4
Avg merge
2d 12h
Merged PRs (30d)
37

Description

Summary

DigiScript currently creates a ShowSession the instant "Start" is pressed. This feature adds the ability to schedule sessions ahead of time (with a date, time, and script revision), so that upcoming performances exist as first-class objects before they go live. Sessions can then be prepared (casting assigned, mics reviewed) before show day. The existing "Start Ad-hoc Session" path is preserved.

Part 1 of 3 for issue #792. Must be completed before #1113 (casting matrix) and #1114 (mic re-runs).

Note: Performance categorisation (Preview, Press Night, etc.) is handled via the existing user-defined SessionTag system — no new session_type field is needed. The "Schedule Session" modal includes a tag picker so tags can be assigned at creation time.


Backend changes

ShowSession model (server/models/session.py):

  • Add scheduled_date_time: Mapped[datetime | None] — when set and start_date_time is null, the session is in "scheduled" state

Alembic migration: alembic revision --autogenerate -m "add_scheduled_session_fields" — adds scheduled_date_time column to showsession.

Schema (server/schemas/schemas.py): add scheduled_date_time to ShowSessionSchema.

New/updated controllers (server/controllers/api/show/session/):

Method Path Role Description
POST /api/v1/show/sessions/schedule EXECUTE Create a scheduled session. Body: {scheduled_date_time, tag_ids, script_revision_id}. start_date_time left null. tag_ids assigns existing SessionTags at creation time.
PATCH /api/v1/show/sessions/{id} EXECUTE Update scheduled_date_time, script_revision_id, or tags. Returns 409 if session already started.
DELETE /api/v1/show/sessions/{id} EXECUTE Delete a scheduled session. Returns 409 if already started.

Update SessionStartController (POST /show/sessions/start):

  • Accept optional show_session_id in request body
  • If present: find that ShowSession, set start_date_time, client_internal_id, user_id (no new row created)
  • If absent: existing ad-hoc behaviour unchanged

Frontend changes (client-v3/)

ConfigSessions.vue — significant update:

  • Add "+ Schedule Session" button → ScheduleSessionModal.vue
  • Keep "Start Ad-hoc Session" button (existing flow)
  • Update table columns: Date · Time | Tags | Revision | Status | Actions
  • Status badges: Scheduled (blue) / Next Up (green) / In Progress (green) / Complete (grey)
  • Per-row actions: [Edit] [Delete] [Start] for scheduled; [Stop] for live; [View Log] for complete

New ScheduleSessionModal.vue (components/show/config/sessions/):

  • Fields: datetime-local picker, tags multi-select (from existing SessionTags), script revision select
  • Calls POST /api/v1/show/sessions/schedule

StartSessionConfirmModal.vue — extend to accept show_session_id for starting a pre-scheduled session; show session date/time + tags in header.

stores/show.ts additions:

  • New actions: scheduleSession(data), updateScheduledSession(id, data), deleteScheduledSession(id)
  • New getter: scheduledSessions — sessions where start_date_time is null, sorted by scheduled_date_time

src/types/api/session.ts: add scheduled_date_time: string | null to ShowSession.


E2E tests

Update client-v3/e2e/tests/12-show-config-sessions.spec.ts:

  • Schedule a session → verify "Scheduled" row appears
  • Edit → verify table updates
  • Delete → verify row removed
  • Start scheduled session → confirm modal → "In Progress" status

Verification

  • pytest — all existing tests pass + new tests for schedule/edit/delete/start-scheduled endpoints
  • npm run typecheck + npm run lint in client-v3/
  • npm run test:e2e — full suite

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with server/models/session.py, server/schemas/schemas.py, and the controllers under server/controllers/api/show/session/; inspect the existing SessionStartController and migration conventions. Then trace ConfigSessions.vue, ScheduleSessionModal.vue, stores/show.ts, and the listed E2E spec. Done means scheduled sessions can be created, edited, deleted, prepared, and started without changing ad-hoc behavior, with backend, typecheck, lint, and E2E tests passing.

Written by the indexing model from the issue text.

Assessment

Tech stack
python, sql, sqlalchemy, typescript
Domain
api, backend, database, frontend, full-stack, testing-qa
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Quiet
Clarity
Clearly specified
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.