Skip to content

Add Supabase RPC integration tests for session usage accounting #145

@Taleef7

Description

@Taleef7

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*

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions