Files
faunosteo/supabase/migrations/20261011100000_profiles_professional.sql
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

24 lines
1.3 KiB
SQL

-- Step 7 identity: professional information on the account profile.
-- Free text declared by the practitioner, shown in "Mon compte". Verification
-- (SIRET check, documents, badge) belongs to the Professional Verification
-- domain (DOMAIN_MAP §2) and lands with its own tables; nothing here is trusted.
alter table public.profiles
add column practice_name text
constraint profiles_practice_name_length check (char_length(practice_name) between 1 and 120),
add column professional_title text
constraint profiles_professional_title_length check (char_length(professional_title) between 1 and 80),
-- French SIRET: 14 digits, format only (no Luhn, no registry lookup).
add column siret text
constraint profiles_siret_format check (siret ~ '^[0-9]{14}$');
comment on column public.profiles.practice_name is
'Cabinet / practice name declared by the user. Unverified.';
comment on column public.profiles.professional_title is
'Professional title declared by the user (e.g. ostéopathe animalier). Unverified.';
comment on column public.profiles.siret is
'SIRET declared by the user, 14 digits, format-checked only. Verification = later domain.';
-- Same rule as the other user-editable columns: column-level UPDATE, own row through RLS.
grant update (practice_name, professional_title, siret) on public.profiles to authenticated;