bchanot
b54c8e5bd8
feat(supabase): animals and relations M3 with RPCs, history and caps
...
Species rows (8 + other), animals with the D6b birth model, relations with
composite workspace keys, current/ended/voided states and a partial unique
index; definer RPCs for animals and relations (one lock order, shared write
budget, caps), invoker reads (search_animals, list_client_animals,
client_archive_preview) and search_clients with current_animal_count.
pgTAP 014 (254), parity test, sandbox suite, types from the isolated stack.
2026-10-26 00:52:22 +01:00
bchanot
4adbfcb608
feat(supabase): clients M2 with RPCs, search and per-workspace budget
...
V1-1.2 (contract V1-1_OWNERS_ANIMALS.md §5, §9, §10). public.clients (person or organization, display name only, optional contact, folded search keys), create/update/set_archived as definer RPCs (identical not_found, idempotent create with divergent-replay refusal, revisions, archive read-only), search_clients invoker with keyset pages and phone search, write budget per workspace in UTC hour/day windows under a row lock, 20 000-client cap, ids-only audit hidden from platform staff (N9), nothing for anon or service_role. pgTAP 013 (130), field-limits parity test, sandbox suite (concurrency, budget races, 20 000-client search), types regenerated.
2026-10-25 21:09:45 +01:00
bchanot
7bf4fb6079
feat(supabase): workspaces M1, one personal workspace per account
...
V1-1.1 (contract V1-1_OWNERS_ANIMALS.md §4, §8, §9). Tables workspaces and workspace_members, created with the profile by trigger through one atomic, idempotent write path; deferred invariant (a personal workspace has exactly its account as holder); backfill of existing profiles; access helpers caller_workspace_ids (active profile, confirmed email) and writable_workspace_ids; RLS select for members only; no privilege for anon or service_role. log_event keeps x-correlation-id only as a short token. pgTAP 012 (85 checks), census and types updated, config test.
2026-10-25 19:53:16 +01:00
bchanot
614887470c
feat(supabase): files foundation — assets table, private buckets, avatar policies through assets, purge queue, browser and worker RPCs
...
Migration 20261013100000: asset_status enum, public.assets (server-built keys,
lease token, closed rejection reasons), seven private buckets (avatars open with
cap and MIME list, six closed), storage.objects SELECT/INSERT policies for
avatars evaluated through assets, private.object_purge_queue fed by status and
delete triggers (48 h / 1 h grace), storage ceiling, RPCs begin_avatar_upload /
confirm_asset_upload / remove_avatar (authenticated) and claim_avatar_jobs /
complete_avatar_job / reject_avatar_job / mark_quarantine_purged / claim_purges /
ack_purge / claim_quarantine_leftovers / expire_pending_uploads (service_role),
explicit revokes and column grants. pgTAP 010 (125 checks: allowed and denied
twins, policy census, stale lease, supersede, removal, leftovers, cascade,
ceiling), 001 census extended, database.types.ts regenerated from the real
stack, schema-types test counts input arguments only.
2026-10-13 19:32:15 +02:00
bchanot
b10b227ee9
feat(supabase): auth, profile and roles services; professional columns on profiles; OAuth + TOTP config
...
- packages/supabase: signIn/signUp/OAuth/reset/updatePassword/signOut wrappers with a closed AuthFailure kind, fetch/update own profile, own platform roles
- migration 20261011100000: practice_name, professional_title, siret (format-checked, column grants); pgTAP 009; database.types regenerated
- config.toml: TOTP enroll/verify on, [auth.external.google|apple] via env(), wildcard redirect URLs
- app config: authProviders (APP_AUTH_PROVIDERS / VITE_AUTH_PROVIDERS), entrypoint env.js, DEPLOY table
- TODO: Step 7 plan
2026-10-11 23:16:13 +02:00
bchanot
dee4ce43d9
fix(supabase): confirmed uploads gate asset reads (hash claim), seeds-listed test, Dockerfile workspace manifests; importer declares every authored label, real in=out control
2026-10-09 00:50:36 +02:00
bchanot
f4682cdba5
feat(supabase): sheet asset Storage bucket + read policy through the sheet, shim storage tables, seeds in the PGlite harness, upload script
2026-10-09 00:28:34 +02:00
bchanot
d3fa65af29
fix(supabase): revoke PUBLIC EXECUTE on private helpers, audited visibility RPC, input caps, authz-first RPCs, +32 pgTAP checks
2026-10-08 23:59:39 +02:00
bchanot
8cac8b1a68
feat(supabase): regenerated types, row aliases, publishSheetVersion gate, schema test
2026-10-08 23:42:44 +02:00
bchanot
ab04b2e43d
style(supabase): prettier pass on the new TypeScript files
2026-10-08 22:46:37 +02:00
bchanot
ce76c6597a
feat(supabase): @faunosteo/supabase package with PGlite harness and typed client
...
- tests/db: PGlite (PostgreSQL 17 WASM) applies the Supabase shim + migrations and
runs supabase/tests/*.sql through pgTAP without Docker
- schema-types test pins tables, columns, enums, RPC args, RLS-on, no using(true)
- database.types.ts in supabase gen types format; createBrowserClient (PKCE)
- Supabase CLI pinned as root devDependency; db:* root scripts
2026-10-08 22:20:54 +02:00