Documentation Base de Données
Bases de données supportées
L'application supporte les bases de données suivantes : - PostgreSQL (recommandé pour la production) - H2 (pour les tests)
Schéma de la base de données
erDiagram
TRIP ||--o{ TRIP_PROGRAM_DETAILS : contains
TRIP {
string id PK
string reference UK
string establishmentId
string title
string smallDescription
string detailedDescription
boolean isDeleted
}
TRIP_PROGRAM_DETAILS ||--o{ ACTIVITE : contains
TRIP_PROGRAM_DETAILS ||--o{ OPTION : contains
TRIP_PROGRAM_DETAILS {
string id PK
string city
string country
boolean stay
string description
}
TRIP_PUBLICATION ||--o{ TRIP_DATE : contains
TRIP_PUBLICATION ||--|| TRIP : references
TRIP_PUBLICATION {
string id PK
string tripId FK
boolean isAutomaticReservation
string status
int childsMaxAge
int babiesMaxAge
boolean isDeleted
}
TRIP_RESERVATION ||--|| TRIP_PUBLICATION : references
TRIP_RESERVATION {
string id PK
string tripId FK
string publicationId FK
string transactionId
string tripDateId
string status
}
ACTIVITE {
string id PK
string title
string picture
string description
boolean isIncluded
long adultPriceValue
string adultPriceCurrency
long childPriceValue
string childPriceCurrency
long babiesPriceValue
string babiesPriceCurrency
}
OPTION {
string id PK
string title
string picture
string description
long adultPriceValue
string adultPriceCurrency
long childPriceValue
string childPriceCurrency
long babiesPriceValue
string babiesPriceCurrency
}
Description des tables
TRIP
Table principale contenant les informations de base des voyages.
| Colonne | Type | Description | Index |
|---|---|---|---|
| id | UUID | Identifiant unique | Primary Key |
| reference | VARCHAR | Référence unique du voyage | Unique |
| establishmentId | VARCHAR | ID de l'établissement | Index |
| title | VARCHAR | Titre du voyage | - |
| smallDescription | TEXT | Description courte | - |
| detailedDescription | TEXT | Description détaillée | - |
| isDeleted | BOOLEAN | Indicateur de suppression | Index |
TRIP_PUBLICATION
Table de publication des voyages.
| Colonne | Type | Description | Index |
|---|---|---|---|
| id | UUID | Identifiant unique | Primary Key |
| tripId | UUID | Référence au voyage | Foreign Key |
| isAutomaticReservation | BOOLEAN | Réservation automatique | - |
| status | VARCHAR | Statut de publication | Index |
| childsMaxAge | INTEGER | Âge maximum enfant | - |
| babiesMaxAge | INTEGER | Âge maximum bébé | - |
| isDeleted | BOOLEAN | Indicateur de suppression | Index |
TRIP_RESERVATION
Table des réservations.
| Colonne | Type | Description | Index |
|---|---|---|---|
| id | UUID | Identifiant unique | Primary Key |
| tripId | UUID | Référence au voyage | Foreign Key |
| publicationId | UUID | Référence à la publication | Foreign Key, Index |
| transactionId | VARCHAR | ID de transaction | Index |
| tripDateId | UUID | Référence à la date | Index |
| status | VARCHAR | Statut de la réservation | Index |
[...]
Indexes importants
- TRIP.establishmentId : Pour la recherche rapide des voyages par établissement
- TRIP_PUBLICATION.status : Pour le filtrage des publications par statut
- TRIP_RESERVATION.publicationId : Pour la liaison avec les publications
- TRIP_RESERVATION.status : Pour le suivi des réservations par statut
Contraintes
- Clés étrangères entre TRIP_PUBLICATION et TRIP
- Clés étrangères entre TRIP_RESERVATION et TRIP_PUBLICATION
- Unicité de la référence du voyage
- Vérification des statuts valides pour les publications et réservations