Context
Unit tests cover scheduling and status-transition math, but the DB-backed RPC behavior still needs local Supabase verification. This is the accounting core: done and no_show_student consume a session, no_show_tutor and rescheduled do not.
Acceptance criteria
- Add a local Supabase-backed test or documented verification harness for
increment_sessions_used, decrement_sessions_used, and tutor_update_session.
- Cover transitions between
scheduled, done, no_show_student, no_show_tutor, and rescheduled without double-incrementing.
- Confirm RPC permissions only allow intended callers/service role paths.
- Ensure tests can be run from a clean
npx supabase db reset state.
- Document the command and expected output.
References
docs/plan-CorvEd.md section 4.5 testing
docs/MVP.md session/no-show policy
lib/services/__tests__/session-status-transitions.test.ts
supabase/migrations/*increment_sessions_used*
Context
Unit tests cover scheduling and status-transition math, but the DB-backed RPC behavior still needs local Supabase verification. This is the accounting core:
doneandno_show_studentconsume a session,no_show_tutorandrescheduleddo not.Acceptance criteria
increment_sessions_used,decrement_sessions_used, andtutor_update_session.scheduled,done,no_show_student,no_show_tutor, andrescheduledwithout double-incrementing.npx supabase db resetstate.References
docs/plan-CorvEd.mdsection 4.5 testingdocs/MVP.mdsession/no-show policylib/services/__tests__/session-status-transitions.test.tssupabase/migrations/*increment_sessions_used*