feat: alignement master sur develop (squash)
- Dossiers unifiés #119, pending-families enrichi, validation admin (wizards) - Front: modèles dossier_unifie / pending_family, NIR, auth - Migrations dossier_famille, scripts de test API - Résolution conflits: parents.*, docs tickets, auth_service, nir_utils Made-with: Cursor
This commit is contained in:
@@ -0,0 +1,27 @@
|
||||
-- Un dossier = une famille, N enfants. Ticket #119 évolution.
|
||||
-- Table: un enregistrement par famille (lien via numero_dossier / id_parent).
|
||||
CREATE TABLE IF NOT EXISTS dossier_famille (
|
||||
id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
|
||||
numero_dossier VARCHAR(20) NOT NULL,
|
||||
id_parent UUID NOT NULL REFERENCES parents(id_utilisateur) ON DELETE CASCADE,
|
||||
presentation TEXT,
|
||||
type_contrat VARCHAR(50),
|
||||
repas BOOLEAN NOT NULL DEFAULT false,
|
||||
budget NUMERIC(10,2),
|
||||
planning_souhaite JSONB,
|
||||
statut statut_dossier_type NOT NULL DEFAULT 'envoye',
|
||||
cree_le TIMESTAMPTZ NOT NULL DEFAULT now(),
|
||||
modifie_le TIMESTAMPTZ NOT NULL DEFAULT now()
|
||||
);
|
||||
|
||||
CREATE INDEX IF NOT EXISTS idx_dossier_famille_numero ON dossier_famille(numero_dossier);
|
||||
CREATE INDEX IF NOT EXISTS idx_dossier_famille_id_parent ON dossier_famille(id_parent);
|
||||
|
||||
-- Enfants concernés par ce dossier famille (N par dossier).
|
||||
CREATE TABLE IF NOT EXISTS dossier_famille_enfants (
|
||||
id_dossier_famille UUID NOT NULL REFERENCES dossier_famille(id) ON DELETE CASCADE,
|
||||
id_enfant UUID NOT NULL REFERENCES enfants(id) ON DELETE CASCADE,
|
||||
PRIMARY KEY (id_dossier_famille, id_enfant)
|
||||
);
|
||||
|
||||
CREATE INDEX IF NOT EXISTS idx_dossier_famille_enfants_enfant ON dossier_famille_enfants(id_enfant);
|
||||
@@ -0,0 +1,5 @@
|
||||
-- Dossier famille = inscription uniquement, pas les données de dossier de garde (repas, type_contrat, budget, etc.)
|
||||
ALTER TABLE dossier_famille DROP COLUMN IF EXISTS repas;
|
||||
ALTER TABLE dossier_famille DROP COLUMN IF EXISTS type_contrat;
|
||||
ALTER TABLE dossier_famille DROP COLUMN IF EXISTS budget;
|
||||
ALTER TABLE dossier_famille DROP COLUMN IF EXISTS planning_souhaite;
|
||||
Reference in New Issue
Block a user