Documentation de la Base de Données
Schéma de la Base de Données (ERD)
erDiagram
Person ||--o{ Favorite : has
Person ||--o{ Attachment : has
Person ||--|| Phone : has
Person ||--|| Address : has
Person {
string id PK
string picture
string lastName
string firstName
enum gender
date dateOfBirth
string email
string type
enum status
boolean isDeleted
}
Phone {
string id PK
string indicative
string number
boolean isDeleted
string person_id FK
}
Address {
string id PK
string number
string route
string complement
string stage
string zipPostal
string city
string country
boolean isDeleted
string person_id FK
}
Favorite {
string id PK
enum entityType
string entityId
boolean isDeleted
string person_id FK
}
Attachment {
string id PK
enum entityType
string entityId
boolean isDeleted
string person_id FK
}
Description des Tables
Person
Table principale stockant les informations des personnes.
| Colonne | Type | Description | Index |
|---|---|---|---|
| id | UUID | Identifiant unique (PK) | Primary Key |
| picture | VARCHAR | URL/chemin de la photo | - |
| lastName | VARCHAR | Nom de famille | - |
| firstName | VARCHAR | Prénom | - |
| gender | ENUM | Genre (MALE/FEMALE) | - |
| dateOfBirth | DATE | Date de naissance | - |
| VARCHAR | Adresse email | - | |
| type | ENUM | Type (PRO/PART) | - |
| status | ENUM | Statut (ACTIVATED/ACTIVATION_IN_PROGRESS/MISSING_INFORMATIONS) | - |
| isDeleted | BOOLEAN | Marqueur de suppression | Index |
Phone
Table stockant les numéros de téléphone.
| Colonne | Type | Description | Index |
|---|---|---|---|
| id | UUID | Identifiant unique (PK) | Primary Key |
| indicative | VARCHAR | Indicatif téléphonique | - |
| number | VARCHAR | Numéro de téléphone | - |
| isDeleted | BOOLEAN | Marqueur de suppression | Index |
| person_id | UUID | Référence vers Person (FK) | Foreign Key |
Address
Table stockant les adresses.
| Colonne | Type | Description | Index |
|---|---|---|---|
| id | UUID | Identifiant unique (PK) | Primary Key |
| number | VARCHAR | Numéro de rue | - |
| route | VARCHAR | Nom de la rue | - |
| complement | VARCHAR | Complément d'adresse | - |
| stage | VARCHAR | Étage | - |
| zipPostal | VARCHAR | Code postal | - |
| city | VARCHAR | Ville | - |
| country | VARCHAR | Pays | - |
| isDeleted | BOOLEAN | Marqueur de suppression | Index |
| person_id | UUID | Référence vers Person (FK) | Foreign Key |
Favorite
Table stockant les favoris.
| Colonne | Type | Description | Index |
|---|---|---|---|
| id | UUID | Identifiant unique (PK) | Primary Key |
| entityType | ENUM | Type d'entité | - |
| entityId | VARCHAR | ID de l'entité favorite | - |
| isDeleted | BOOLEAN | Marqueur de suppression | Index |
| person_id | UUID | Référence vers Person (FK) | Foreign Key, Index |
Contrainte unique : (entityId, person_id)
Attachment
Table stockant les pièces jointes.
| Colonne | Type | Description | Index |
|---|---|---|---|
| id | UUID | Identifiant unique (PK) | Primary Key |
| entityType | ENUM | Type d'entité (ESTABLISHMENT/ORGANIZATION) | - |
| entityId | VARCHAR | ID de l'entité attachée | - |
| isDeleted | BOOLEAN | Marqueur de suppression | Index |
| person_id | UUID | Référence vers Person (FK) | Foreign Key, Index |
Contrainte unique : (entityId, person_id)
Base de données supportées
L'application utilise principalement PostgreSQL en production, mais grâce à l'utilisation de JPA/Hibernate, elle peut théoriquement fonctionner avec n'importe quelle base de données relationnelle supportée par Hibernate.