Skip to content

[CA-12] Integrate Supabase as internal database #21

Description

@luigischmitt

Goal

Add Supabase as the internal source of truth for complete charge and payment history, while keeping Google Sheets as public visualization.

Context

Currently we only use Google Sheets to track payments. This works, but:

  • We don't have charge history (txid, creation date, etc.)
  • Any manual edit to the spreadsheet can break the system
  • We can't run complex queries (e.g., "how much did X pay in 2025?")

Proposed Architecture

Supabase (source of truth)      Google Sheets (visualization)
┌─────────────────────────┐     ┌─────────────────────────┐
│  members                │     │  Shared spreadsheet     │
│  charges                │ ──► │  (sync via jobs)        │
└─────────────────────────┘     └─────────────────────────┘

Database Schema

Table members

Field Type Description
id uuid PK
name text Member name
email text Member email
created_at timestamp Registration date

Table charges

Field Type Description
id uuid PK
member_id uuid FK → members
txid text Efí transaction ID
amount decimal Charged amount
month text Reference month (e.g., "FEB")
year int Reference year
status text pending, paid, expired
created_at timestamp Charge creation date
paid_at timestamp Payment date

Tasks

  • Create Supabase project
  • Create members and charges tables
  • Add src/services/supabase.py with SupabaseService
  • Add supabase to pyproject.toml
  • Configure environment variables (SUPABASE_URL, SUPABASE_KEY)

Dependencies

None - can be done in parallel with other issues.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions