ujusum:3-codage:1-repository:2-prisma-schema
Différences
Ci-dessous, les différences entre deux révisions de la page.
| Les deux révisions précédentesRévision précédenteProchaine révision | Révision précédente | ||
| ujusum:3-codage:1-repository:2-prisma-schema [2026/06/07 05:13] – 91.170.108.99 | ujusum:3-codage:1-repository:2-prisma-schema [2026/06/07 05:27] (Version actuelle) – 91.170.108.99 | ||
|---|---|---|---|
| Ligne 1089: | Ligne 1089: | ||
| @@index([expiresAt]) | @@index([expiresAt]) | ||
| </ | </ | ||
| - | |||
| - | ---- | ||
| - | ====== Phase 2-C — Domaine Catalogue Immobilier (Properties) ====== | ||
| - | |||
| - | Effectivement. | ||
| - | |||
| - | Dans le modèle précédent, | ||
| - | |||
| - | <code prisma> | ||
| - | properties Property[] | ||
| - | </ | ||
| - | |||
| - | dans la table : | ||
| - | |||
| - | <code prisma> | ||
| - | Tenant | ||
| - | </ | ||
| - | |||
| - | mais la table : | ||
| - | |||
| - | <code prisma> | ||
| - | Property | ||
| - | </ | ||
| - | |||
| - | n' | ||
| - | |||
| - | Or le domaine " | ||
| - | |||
| - | Toutes les fonctionnalités suivantes en dépendent : | ||
| - | |||
| - | * Réservations | ||
| - | * Disponibilités | ||
| - | * Tarification | ||
| - | * Contrats | ||
| - | * OTA | ||
| - | * Revenue Management | ||
| - | * CRM | ||
| - | * Extranet propriétaire | ||
| - | |||
| - | La table Property doit donc être construite très tôt. | ||
| ---- | ---- | ||
| Ligne 1555: | Ligne 1515: | ||
| ---- | ---- | ||
| - | ====== | + | ====== |
| - | Ces tables seront enrichies dans les prochains domaines : | + | ===== Architecture |
| - | + | ||
| - | ===== Sprint 4 ===== | + | |
| < | < | ||
| - | Reservation | + | Owner |
| + | |||
| + | OwnerAddress | ||
| + | |||
| + | OwnerDocument | ||
| + | |||
| + | OwnerBankAccount | ||
| + | |||
| + | PropertyOwner | ||
| </ | </ | ||
| - | ajoutera : | + | ---- |
| - | < | + | ====== Owner ====== |
| - | Property | + | |
| - | ↓ | + | <code prisma> |
| + | model Owner { | ||
| - | Reservations | + | id String @id @default(uuid()) |
| + | |||
| + | tenantId | ||
| + | |||
| + | code String @unique | ||
| + | |||
| + | companyName | ||
| + | |||
| + | firstName | ||
| + | |||
| + | lastName | ||
| + | |||
| + | email | ||
| + | |||
| + | phone | ||
| + | |||
| + | mobile | ||
| + | |||
| + | taxIdentifier | ||
| + | |||
| + | vatNumber | ||
| + | |||
| + | active | ||
| + | |||
| + | createdAt | ||
| + | |||
| + | updatedAt | ||
| + | |||
| + | deletedAt | ||
| + | |||
| + | tenant | ||
| + | fields: | ||
| + | references: | ||
| + | ) | ||
| + | |||
| + | address | ||
| + | |||
| + | documents | ||
| + | |||
| + | bankAccounts | ||
| + | |||
| + | properties | ||
| + | } | ||
| </ | </ | ||
| ---- | ---- | ||
| - | ===== Sprint 7 ===== | + | ====== OwnerAddress ====== |
| - | < | + | < |
| - | Owner | + | model OwnerAddress { |
| + | |||
| + | id String @id @default(uuid()) | ||
| + | |||
| + | ownerId | ||
| + | |||
| + | addressLine1 | ||
| + | |||
| + | addressLine2 | ||
| + | |||
| + | postalCode | ||
| + | |||
| + | city String | ||
| + | |||
| + | state | ||
| + | |||
| + | countryCode | ||
| + | |||
| + | owner Owner @relation( | ||
| + | fields: | ||
| + | references: | ||
| + | ) | ||
| + | } | ||
| </ | </ | ||
| - | ajoutera | + | ---- |
| + | |||
| + | ====== OwnerDocument ====== | ||
| + | |||
| + | <code prisma> | ||
| + | model OwnerDocument { | ||
| + | |||
| + | id String @id @default(uuid()) | ||
| + | |||
| + | ownerId | ||
| + | |||
| + | documentType | ||
| + | |||
| + | fileUrl | ||
| + | |||
| + | createdAt | ||
| + | |||
| + | owner Owner @relation( | ||
| + | fields:[ownerId], | ||
| + | references: | ||
| + | ) | ||
| + | } | ||
| + | </ | ||
| + | |||
| + | ---- | ||
| + | |||
| + | ===== Document Types ===== | ||
| < | < | ||
| - | PropertyOwner | + | IDENTITY |
| - | OwnerDocuments | + | TAX_DOCUMENT |
| - | OwnerRevenue | + | MANDATE |
| + | |||
| + | BANK_DETAILS | ||
| + | |||
| + | INSURANCE | ||
| </ | </ | ||
| ---- | ---- | ||
| - | ===== Sprint 17 ===== | + | ====== OwnerBankAccount ====== |
| - | ajoutera | + | <code prisma> |
| + | model OwnerBankAccount { | ||
| + | |||
| + | id String @id @default(uuid()) | ||
| + | |||
| + | ownerId | ||
| + | |||
| + | iban String | ||
| + | |||
| + | bic | ||
| + | |||
| + | accountHolder | ||
| + | |||
| + | active | ||
| + | |||
| + | owner Owner @relation( | ||
| + | fields:[ownerId], | ||
| + | references: | ||
| + | ) | ||
| + | } | ||
| + | </ | ||
| + | |||
| + | ---- | ||
| + | |||
| + | ====== Domaine Reservation ====== | ||
| + | |||
| + | ===== Architecture ===== | ||
| < | < | ||
| - | DynamicPrice | + | Reservation |
| - | PricingRule | + | ReservationGuest |
| - | RevenueSimulation | + | ReservationStatusHistory |
| + | |||
| + | ReservationEvent | ||
| + | |||
| + | ReservationPricing | ||
| </ | </ | ||
| ---- | ---- | ||
| - | ===== Sprint 18 ===== | + | ====== |
| + | |||
| + | ===== Table centrale ===== | ||
| + | |||
| + | <code prisma> | ||
| + | model Reservation { | ||
| + | |||
| + | id String @id @default(uuid()) | ||
| + | |||
| + | tenantId | ||
| + | |||
| + | propertyId | ||
| + | |||
| + | customerId | ||
| + | |||
| + | reference | ||
| + | |||
| + | status | ||
| + | |||
| + | checkInDate | ||
| + | |||
| + | checkOutDate | ||
| + | |||
| + | nights | ||
| + | |||
| + | adults | ||
| + | |||
| + | children | ||
| + | |||
| + | infants | ||
| + | |||
| + | totalGuests | ||
| + | |||
| + | notes | ||
| + | |||
| + | source | ||
| + | |||
| + | createdAt | ||
| + | |||
| + | updatedAt | ||
| + | |||
| + | cancelledAt | ||
| + | |||
| + | tenant | ||
| + | fields: | ||
| + | references: | ||
| + | ) | ||
| + | |||
| + | property | ||
| + | fields: | ||
| + | references: | ||
| + | ) | ||
| + | |||
| + | guests | ||
| + | |||
| + | events | ||
| + | |||
| + | statusHistory | ||
| + | |||
| + | pricing | ||
| + | } | ||
| + | </ | ||
| + | |||
| + | ---- | ||
| + | |||
| + | ====== ReservationStatus ====== | ||
| + | |||
| + | <code prisma> | ||
| + | enum ReservationStatus { | ||
| + | |||
| + | DRAFT | ||
| + | |||
| + | PENDING | ||
| + | |||
| + | CONFIRMED | ||
| + | |||
| + | SIGNED | ||
| + | |||
| + | PAID | ||
| + | |||
| + | CHECKED_IN | ||
| + | |||
| + | COMPLETED | ||
| + | |||
| + | CANCELLED | ||
| + | } | ||
| + | </ | ||
| + | |||
| + | ---- | ||
| + | |||
| + | ====== ReservationSource ====== | ||
| + | |||
| + | <code prisma> | ||
| + | enum ReservationSource { | ||
| + | |||
| + | WEBSITE | ||
| + | |||
| + | BACKOFFICE | ||
| + | |||
| + | AIRBNB | ||
| + | |||
| + | BOOKING | ||
| + | |||
| + | VRBO | ||
| + | |||
| + | API | ||
| + | } | ||
| + | </ | ||
| + | |||
| + | ---- | ||
| + | |||
| + | ====== ReservationGuest ====== | ||
| + | |||
| + | <code prisma> | ||
| + | model ReservationGuest { | ||
| + | |||
| + | id String @id @default(uuid()) | ||
| + | |||
| + | reservationId | ||
| + | |||
| + | firstName | ||
| + | |||
| + | lastName | ||
| + | |||
| + | birthDate | ||
| + | |||
| + | email | ||
| + | |||
| + | phone | ||
| + | |||
| + | isPrimary | ||
| + | |||
| + | reservation | ||
| + | fields: | ||
| + | references: | ||
| + | ) | ||
| + | } | ||
| + | </ | ||
| + | |||
| + | ---- | ||
| + | |||
| + | ====== ReservationPricing ====== | ||
| + | |||
| + | <code prisma> | ||
| + | model ReservationPricing { | ||
| + | |||
| + | id String @id @default(uuid()) | ||
| + | |||
| + | reservationId | ||
| + | |||
| + | nightlyAmount | ||
| + | |||
| + | cleaningFee | ||
| + | |||
| + | touristTax | ||
| + | |||
| + | discountAmount | ||
| + | |||
| + | totalAmount | ||
| + | |||
| + | currencyCode | ||
| + | |||
| + | reservation | ||
| + | fields: | ||
| + | references: | ||
| + | ) | ||
| + | } | ||
| + | </ | ||
| + | |||
| + | ---- | ||
| + | |||
| + | ====== ReservationEvent ====== | ||
| + | |||
| + | <code prisma> | ||
| + | model ReservationEvent { | ||
| + | |||
| + | id String @id @default(uuid()) | ||
| + | |||
| + | reservationId | ||
| + | |||
| + | eventType | ||
| + | |||
| + | payload | ||
| + | |||
| + | createdAt | ||
| + | |||
| + | reservation | ||
| + | fields: | ||
| + | references: | ||
| + | ) | ||
| + | } | ||
| + | </ | ||
| + | |||
| + | ---- | ||
| - | ajoutera : | + | ===== Event Types ===== |
| < | < | ||
| - | PropertyDistribution | + | CREATED |
| - | OTA Mapping | + | CONFIRMED |
| - | Channel Publication | + | SIGNED |
| + | |||
| + | PAID | ||
| + | |||
| + | CHECK_IN | ||
| + | |||
| + | CHECK_OUT | ||
| + | |||
| + | CANCELLED | ||
| + | </ | ||
| + | |||
| + | ---- | ||
| + | |||
| + | ====== ReservationStatusHistory ====== | ||
| + | |||
| + | <code prisma> | ||
| + | model ReservationStatusHistory { | ||
| + | |||
| + | id String @id @default(uuid()) | ||
| + | |||
| + | reservationId | ||
| + | |||
| + | previousStatus | ||
| + | |||
| + | newStatus | ||
| + | |||
| + | changedAt | ||
| + | |||
| + | reservation | ||
| + | fields: | ||
| + | references: | ||
| + | ) | ||
| + | } | ||
| + | </ | ||
| + | |||
| + | ---- | ||
| + | |||
| + | ====== Relations à ajouter ====== | ||
| + | |||
| + | ===== Property ===== | ||
| + | |||
| + | Ajouter : | ||
| + | |||
| + | <code prisma> | ||
| + | reservations Reservation[] | ||
| + | </ | ||
| + | |||
| + | ---- | ||
| + | |||
| + | ===== Tenant ===== | ||
| + | |||
| + | Ajouter : | ||
| + | |||
| + | <code prisma> | ||
| + | owners Owner[] | ||
| + | |||
| + | reservations Reservation[] | ||
| + | </ | ||
| + | |||
| + | ---- | ||
| + | |||
| + | ====== Indexes ====== | ||
| + | |||
| + | ===== Owner ===== | ||
| + | |||
| + | <code prisma> | ||
| + | @@index([tenantId]) | ||
| + | |||
| + | @@index([email]) | ||
| + | |||
| + | @@index([active]) | ||
| + | </ | ||
| + | |||
| + | ---- | ||
| + | |||
| + | ===== Reservation ===== | ||
| + | |||
| + | <code prisma> | ||
| + | @@index([tenantId]) | ||
| + | |||
| + | @@index([propertyId]) | ||
| + | |||
| + | @@index([status]) | ||
| + | |||
| + | @@index([checkInDate]) | ||
| + | |||
| + | @@index([checkOutDate]) | ||
| + | |||
| + | @@index([reference]) | ||
| + | </ | ||
| + | |||
| + | ---- | ||
| + | |||
| + | ===== ReservationGuest ===== | ||
| + | |||
| + | <code prisma> | ||
| + | @@index([reservationId]) | ||
| </ | </ | ||
| Ligne 1639: | Ligne 2018: | ||
| <code bash> | <code bash> | ||
| npx prisma migrate dev \ | npx prisma migrate dev \ | ||
| - | --name | + | --name |
| </ | </ | ||
| ---- | ---- | ||
| - | ====== | + | ====== |
| - | À ce stade, | + | À ce stade, |
| < | < | ||
| Ligne 1656: | Ligne 2035: | ||
| Permission | Permission | ||
| + | |||
| + | Owner | ||
| Property | Property | ||
| - | PropertyAddress | + | Reservation |
| + | </ | ||
| - | PropertyFeature | + | avec : |
| - | PropertyMedia | + | < |
| + | Catalogue Immobilier | ||
| - | PropertyAvailability | + | Propriétaires |
| - | PropertyRate | + | Réservations |
| + | |||
| + | RBAC | ||
| + | |||
| + | Multi-tenant | ||
| </ | </ | ||
| - | Toutes les futures fonctionnalités métier pourront désormais s'appuyer sur ce socle immobilier. | + | ---- |
| + | |||
| + | ====== Étape suivante ====== | ||
| + | |||
| + | ===== Phase 2-E ===== | ||
| + | |||
| + | Domaines financiers et contractuels : | ||
| + | |||
| + | < | ||
| + | Contract | ||
| + | |||
| + | ContractTemplate | ||
| + | |||
| + | ContractSignature | ||
| + | |||
| + | Document | ||
| + | |||
| + | Payment | ||
| + | |||
| + | Invoice | ||
| + | |||
| + | Refund | ||
| + | |||
| + | AccountingEntry | ||
| + | </ | ||
| + | |||
| + | Ces tables permettront d'implémenter intégralement : | ||
| + | |||
| + | * Sprint 5 — Contrats & Signature Électronique | ||
| + | * Sprint 6 — Paiements & Facturation | ||
| + | |||
| + | et de disposer du premier flux métier complet : | ||
| + | |||
| + | < | ||
| + | Property | ||
| + | |||
| + | ↓ | ||
| + | |||
| + | Reservation | ||
| + | |||
| + | ↓ | ||
| + | |||
| + | Contract | ||
| + | |||
| + | ↓ | ||
| + | |||
| + | Payment | ||
| + | |||
| + | ↓ | ||
| + | |||
| + | Invoice | ||
| + | </ | ||
ujusum/3-codage/1-repository/2-prisma-schema.1780802032.txt.gz · Dernière modification : 2026/06/07 05:13 de 91.170.108.99 · Actuellement bloqué par : 192.168.0.100,216.73.216.72