Implémenter le cœur transactionnel de la plateforme.
Ce sprint transforme la plateforme Property Management en véritable plateforme de réservation exploitable.
À l'issue du Sprint 5 :
✓ Reservation ✓ Guest ✓ Booking Workflow ✓ Check-In ✓ Check-Out ✓ Payments Integration ✓ Billing ✓ Stay Management ✓ Reservation Intelligence
Customer ↓ Reservation ↓ Booking Workflow ↓ Payment ↓ Check-In ↓ Stay Management ↓ Check-Out ↓ Billing ↓ Analytics
Le Sprint 5 introduit les domaines suivants :
Reservation Guest ReservationGuest ReservationPayment ReservationInvoice ReservationTimeline CheckIn CheckOut Stay ReservationDocument
Fondation Réservation
Reservation Core Guest Management Reservation Lifecycle Workflow Engine
Paiement & Facturation
Payment Integration Invoices Refunds Transactions
Check-In / Check-Out
Arrival Workflow Departure Workflow Digital Check-In Stay Tracking
Exploitation Séjour
Guest Requests Incidents Housekeeping Maintenance
Reservation Intelligence
Reservation Analytics Fraud Detection Booking Insights Forecasting
Reservation Engine Booking Workflow Engine Payment Platform Invoice Engine Check-In Platform Stay Management Reservation Analytics Enterprise Booking System
Créer le cœur du moteur de réservation.
Cette couche constitue la fondation transactionnelle de toute la plateforme.
À l'issue de cette étape :
✓ Reservation ✓ Guest ✓ ReservationGuest ✓ Multi-tenant ✓ Property Ready ✓ Customer Ready ✓ Payment Ready ✓ Analytics Ready
Customer ↓ Reservation ↓ ReservationGuest ↓ Guests ↓ Payments ↓ Check-In
model Reservation {
id String
@id
@default(uuid())
tenantId String
propertyId String
customerId String
reservationNumber String
@unique
status ReservationStatus
source ReservationSource
checkInDate DateTime
checkOutDate DateTime
nights Int
adults Int
@default(1)
children Int
@default(0)
infants Int
@default(0)
totalGuests Int
currency String
@default("EUR")
subtotalAmount Decimal
@db.Decimal(12,2)
taxesAmount Decimal
@db.Decimal(12,2)
feesAmount Decimal
@db.Decimal(12,2)
discountAmount Decimal
@db.Decimal(12,2)
@default(0)
totalAmount Decimal
@db.Decimal(12,2)
paidAmount Decimal
@db.Decimal(12,2)
@default(0)
notes String?
internalNotes String?
confirmedAt DateTime?
cancelledAt DateTime?
createdAt DateTime
@default(now())
updatedAt DateTime
@updatedAt
tenant Tenant
@relation(
fields:[tenantId],
references:[id]
)
property Property
@relation(
fields:[propertyId],
references:[id]
)
customer Customer
@relation(
fields:[customerId],
references:[id]
)
guests ReservationGuest[]
@@index([tenantId])
@@index([propertyId])
@@index([customerId])
@@index([status])
@@index([checkInDate])
@@index([checkOutDate])
@@index([reservationNumber])
}
model Guest {
id String
@id
@default(uuid())
tenantId String
firstName String
lastName String
email String?
phone String?
dateOfBirth DateTime?
nationality String?
documentType String?
documentNumber String?
emergencyContact String?
emergencyPhone String?
notes String?
createdAt DateTime
@default(now())
updatedAt DateTime
@updatedAt
tenant Tenant
@relation(
fields:[tenantId],
references:[id]
)
reservations ReservationGuest[]
@@index([tenantId])
@@index([email])
@@index([lastName])
@@index([documentNumber])
}
model ReservationGuest {
id String
@id
@default(uuid())
reservationId String
guestId String
isPrimaryGuest Boolean
@default(false)
createdAt DateTime
@default(now())
reservation Reservation
@relation(
fields:[reservationId],
references:[id],
onDelete:Cascade
)
guest Guest
@relation(
fields:[guestId],
references:[id],
onDelete:Cascade
)
@@unique([
reservationId,
guestId
])
@@index([reservationId])
@@index([guestId])
}
enum ReservationStatus {
DRAFT
PENDING
CONFIRMED
CHECKED_IN
CHECKED_OUT
COMPLETED
CANCELLED
NO_SHOW
}
enum ReservationSource {
DIRECT
WEBSITE
MOBILE_APP
AIRBNB
BOOKING
EXPEDIA
MANUAL
API
}
reservations Reservation[]
reservations Reservation[]
reservations Reservation[] guests Guest[]
checkInDate < checkOutDate
nights = checkOutDate - checkInDate
totalGuests = adults + children + infants
via :
PropertyAvailability Reservation Engine
@@index([ tenantId, status ]) @@index([ propertyId, checkInDate ]) @@index([ propertyId, checkOutDate ]) @@index([ customerId, createdAt ])
Optimiser :
Réservation Client Propriété Date Statut
Compatible avec :
Occupancy Analytics Revenue Analytics Booking Analytics Forecasting
Compatible avec :
Customer Analytics Guest Analytics Travel Patterns
npx prisma migrate dev \
--name reservation_core
npx prisma generate
npx prisma studio
Présence de :
Reservation Guest ReservationGuest
Le Sprint 5-A.1 est terminé lorsque :
✓ Reservation créé ✓ Guest créé ✓ ReservationGuest créé ✓ Enums créés ✓ Relations créées ✓ Multi-tenant Ready ✓ Payment Ready ✓ Analytics Ready ✓ Migration exécutée
Reservation Guest ReservationGuest ReservationStatus ReservationSource Reservation Core Schema
Transformer le modèle Reservation en véritable moteur transactionnel Enterprise.
Cette couche gère :
Lifecycle Workflow Automatisation Audit Historique Orchestration
de toutes les réservations.
À l'issue de cette étape :
✓ ReservationTimeline ✓ ReservationEvent ✓ ReservationWorkflow ✓ Status Machine ✓ Lifecycle Automation ✓ Audit Trail ✓ Booking Orchestration Engine
Reservation ↓ Workflow Engine ├── State Machine ├── Timeline ├── Events ├── Automation ├── Notifications └── Audit Trail ↓ Payments ↓ Check-In ↓ Stay Management
model ReservationTimeline {
id String
@id
@default(uuid())
reservationId String
eventType ReservationEventType
title String
description String?
metadata Json?
createdBy String?
createdAt DateTime
@default(now())
reservation Reservation
@relation(
fields:[reservationId],
references:[id],
onDelete:Cascade
)
@@index([reservationId])
@@index([eventType])
@@index([createdAt])
}
model ReservationEvent {
id String
@id
@default(uuid())
reservationId String
eventType ReservationEventType
oldStatus ReservationStatus?
newStatus ReservationStatus?
payload Json?
processed Boolean
@default(false)
createdAt DateTime
@default(now())
reservation Reservation
@relation(
fields:[reservationId],
references:[id],
onDelete:Cascade
)
@@index([reservationId])
@@index([processed])
@@index([eventType])
}
model ReservationWorkflow {
reservationId String
@id
currentStatus ReservationStatus
lastTransitionAt DateTime?
workflowVersion String
@default("1.0")
automated Boolean
@default(true)
updatedAt DateTime
@updatedAt
reservation Reservation
@relation(
fields:[reservationId],
references:[id],
onDelete:Cascade
)
}
npx prisma migrate dev \
--name reservation_workflow
src/modules/reservation-workflow ├── workflow │ ├── state-machine │ ├── timeline │ ├── events │ ├── automation │ └── reservation-workflow.module.ts
ReservationWorkflowService ReservationStateMachineService ReservationTimelineService ReservationEventService ReservationAutomationService
DRAFT ↓ PENDING ↓ CONFIRMED ↓ CHECKED_IN ↓ CHECKED_OUT ↓ COMPLETED
PENDING ↓ CANCELLED
CONFIRMED ↓ NO_SHOW
const transitions = {
DRAFT: [
PENDING,
CANCELLED
],
PENDING: [
CONFIRMED,
CANCELLED
],
CONFIRMED: [
CHECKED_IN,
CANCELLED,
NO_SHOW
],
CHECKED_IN: [
CHECKED_OUT
],
CHECKED_OUT: [
COMPLETED
]
};
toute transition invalide.
reservation-timeline.service.ts
addEvent() getTimeline() buildHistory()
Création Confirmation Paiement Check-In Check-Out Annulation
{
"event":"CONFIRMED",
"timestamp":"2027-01-10T12:00:00Z"
}
reservation-event.service.ts
RESERVATION_CREATED RESERVATION_CONFIRMED RESERVATION_CANCELLED CHECKIN_STARTED CHECKOUT_COMPLETED
Compatible avec :
Payments Notifications Invoices Analytics
Domain Events
pour les futurs microservices.
reservation-automation.service.ts
Confirmation Reminders Check-In Check-Out Completion
J-7 Arrival Reminder J-1 Arrival Reminder Check-In Reminder Check-Out Reminder
CHECKED_OUT ↓ COMPLETED
après validation du séjour.
Status Change User Action System Action Automation Action
Reservation #RSV-1001 CONFIRMED Par : Admin Le : 2027-01-05 14:32
AuditLog AuditModule
déjà présent dans la plateforme.
GET /reservations/{id}/timeline
GET /reservations/{id}/workflow
POST /reservations/{id}/confirm
POST /reservations/{id}/cancel
POST /reservations/{id}/check-in
POST /reservations/{id}/check-out
POST /reservations/{id}/complete
{
"status":"CONFIRMED",
"lastTransitionAt":"2027-01-05T14:32:00Z"
}
reservation.read reservation.create reservation.update reservation.cancel reservation.checkin reservation.checkout reservation.workflow
sur toutes les transitions :
tenantId propertyId reservationId
qu'un événement :
CHECK_IN CHECK_OUT CONFIRM
ne soit pas exécuté deux fois.
Préparer :
Payment Intent Invoice Refund Transaction
Préparer :
Notifications Emails SMS Push
Préparer :
Reservation Analytics Fraud Detection Revenue Analytics
Le Sprint 5-A.2 est terminé lorsque :
✓ ReservationTimeline créé ✓ ReservationEvent créé ✓ ReservationWorkflow créé ✓ State Machine opérationnelle ✓ Lifecycle Automation opérationnelle ✓ Audit Trail opérationnel ✓ Event Bus opérationnel
ReservationTimeline ReservationEvent ReservationWorkflow ReservationWorkflowService ReservationStateMachineService ReservationTimelineService ReservationEventService ReservationAutomationService Booking Workflow Engine
Connecter le moteur de réservation au moteur financier.
Cette couche gère :
Paiements Intentions de paiement Transactions Remboursements Webhooks Réconciliation
pour toutes les réservations.
À l'issue de cette étape :
✓ ReservationPayment ✓ PaymentIntent ✓ Transaction ✓ Refund ✓ Stripe Integration ✓ Webhook Processing ✓ Financial Transaction Engine
Reservation ↓ Payment Engine ├── Payment Intent ├── Transaction ├── Refund ├── Webhooks ├── Reconciliation └── Audit ↓ Invoice Engine ↓ Revenue Analytics
model ReservationPayment {
id String
@id
@default(uuid())
tenantId String
reservationId String
paymentProvider PaymentProvider
paymentStatus PaymentStatus
currency String
@default("EUR")
amount Decimal
@db.Decimal(12,2)
paidAmount Decimal
@db.Decimal(12,2)
@default(0)
dueAmount Decimal
@db.Decimal(12,2)
externalReference String?
paidAt DateTime?
createdAt DateTime
@default(now())
updatedAt DateTime
@updatedAt
reservation Reservation
@relation(
fields:[reservationId],
references:[id],
onDelete:Cascade
)
transactions PaymentTransaction[]
refunds PaymentRefund[]
@@index([tenantId])
@@index([reservationId])
@@index([paymentStatus])
}
model PaymentIntent {
id String
@id
@default(uuid())
reservationPaymentId String
providerIntentId String
@unique
amount Decimal
@db.Decimal(12,2)
currency String
clientSecret String?
status PaymentIntentStatus
expiresAt DateTime?
createdAt DateTime
@default(now())
@@index([providerIntentId])
@@index([status])
}
model PaymentTransaction {
id String
@id
@default(uuid())
reservationPaymentId String
transactionReference String
@unique
providerTransactionId String?
amount Decimal
@db.Decimal(12,2)
currency String
status TransactionStatus
metadata Json?
processedAt DateTime?
createdAt DateTime
@default(now())
@@index([transactionReference])
@@index([status])
}
model PaymentRefund {
id String
@id
@default(uuid())
reservationPaymentId String
transactionId String?
refundReference String
@unique
amount Decimal
@db.Decimal(12,2)
reason String?
status RefundStatus
refundedAt DateTime?
createdAt DateTime
@default(now())
@@index([refundReference])
@@index([status])
}
enum PaymentProvider {
STRIPE
PAYPAL
ADYEN
MANUAL
}
enum PaymentStatus {
PENDING
PARTIALLY_PAID
PAID
FAILED
REFUNDED
CANCELLED
}
enum PaymentIntentStatus {
REQUIRES_PAYMENT_METHOD
REQUIRES_CONFIRMATION
PROCESSING
SUCCEEDED
CANCELED
}
enum TransactionStatus {
PENDING
SUCCESS
FAILED
CANCELLED
}
enum RefundStatus {
PENDING
PROCESSING
COMPLETED
FAILED
}
payments ReservationPayment[]
npx prisma migrate dev \
--name reservation_payments
src/modules/payments ├── stripe │ ├── intents │ ├── transactions │ ├── refunds │ ├── webhooks │ └── payments.module.ts
PaymentService StripePaymentService PaymentIntentService TransactionService RefundService WebhookService
npm install stripe
STRIPE_SECRET_KEY= STRIPE_WEBHOOK_SECRET= STRIPE_PUBLISHABLE_KEY=
stripe-payment.service.ts
createPaymentIntent() confirmPayment() cancelPayment() retrievePayment()
const intent =
await stripe.paymentIntents.create({
amount: 12500,
currency: 'eur',
metadata: {
reservationId
}
});
payment.service.ts
createReservationPayment() payReservation() capturePayment() cancelPayment()
Reservation ↓ Payment Intent ↓ Stripe ↓ Webhook ↓ PAID
Reservation.paidAmount ReservationPayment.status
automatiquement.
transaction.service.ts
Authorization Capture Failure Cancellation
Stripe = Base locale
TX-2027-000001
pour chaque transaction.
refund.service.ts
createRefund() approveRefund() executeRefund()
Full Refund Partial Refund Policy Refund
Paiement 500 € ↓ Refund 100 €
webhook.controller.ts
POST /payments/webhooks/stripe
payment_intent.succeeded payment_intent.payment_failed charge.refunded charge.dispute.created
STRIPE_WEBHOOK_SECRET
avant traitement.
POST /reservations/{id}/payments
GET /reservations/{id}/payments
POST /payments/intents
POST /payments/{id}/capture
POST /payments/{id}/refund
GET /payments/{id}/transactions
{
"paymentIntentId":"pi_xxx",
"clientSecret":"secret_xxx"
}
payment.read payment.create payment.capture payment.refund payment.webhook payment.admin
PAYMENT_CREATED PAYMENT_SUCCEEDED PAYMENT_FAILED REFUND_CREATED REFUND_COMPLETED WEBHOOK_RECEIVED
pour :
Webhooks Captures Refunds
afin d'éviter les doublons.
Préparer :
Invoices Credit Notes Taxes Accounting
Préparer :
Multi Currency Payment Plans Installments Deposit Payments
Le Sprint 5-B.1 est terminé lorsque :
✓ ReservationPayment créé ✓ PaymentIntent créé ✓ PaymentTransaction créé ✓ PaymentRefund créé ✓ Stripe intégré ✓ Webhooks intégrés ✓ Refunds intégrés ✓ Audit intégré
ReservationPayment PaymentIntent PaymentTransaction PaymentRefund StripePaymentService PaymentService RefundService WebhookService Enterprise Payment Platform
Transformer le moteur de paiement en plateforme financière Enterprise.
Cette couche gère :
Facturation Avoirs Fiscalité Comptabilité Conformité financière Exports ERP
À l'issue de cette étape :
✓ Invoice ✓ InvoiceLine ✓ CreditNote ✓ Tax Engine ✓ Accounting Export ✓ Financial Compliance ✓ Financial Platform
Reservation ↓ Payment ↓ Invoice Engine ├── Invoices ├── Invoice Lines ├── Credit Notes ├── Tax Engine ├── Accounting └── Compliance ↓ ERP ↓ Financial Reporting
model Invoice {
id String
@id
@default(uuid())
tenantId String
reservationId String?
customerId String
invoiceNumber String
@unique
status InvoiceStatus
currency String
@default("EUR")
issueDate DateTime
dueDate DateTime?
subtotalAmount Decimal
@db.Decimal(14,2)
taxAmount Decimal
@db.Decimal(14,2)
totalAmount Decimal
@db.Decimal(14,2)
paidAmount Decimal
@db.Decimal(14,2)
@default(0)
notes String?
createdAt DateTime
@default(now())
updatedAt DateTime
@updatedAt
lines InvoiceLine[]
creditNotes CreditNote[]
@@index([tenantId])
@@index([reservationId])
@@index([customerId])
@@index([status])
}
model InvoiceLine {
id String
@id
@default(uuid())
invoiceId String
description String
quantity Decimal
@db.Decimal(10,2)
unitPrice Decimal
@db.Decimal(12,2)
taxRate Decimal
@db.Decimal(5,2)
totalAmount Decimal
@db.Decimal(14,2)
createdAt DateTime
@default(now())
invoice Invoice
@relation(
fields:[invoiceId],
references:[id],
onDelete:Cascade
)
@@index([invoiceId])
}
model CreditNote {
id String
@id
@default(uuid())
tenantId String
invoiceId String
creditNoteNumber String
@unique
reason String
amount Decimal
@db.Decimal(14,2)
status CreditNoteStatus
issuedAt DateTime
createdAt DateTime
@default(now())
invoice Invoice
@relation(
fields:[invoiceId],
references:[id]
)
@@index([tenantId])
@@index([invoiceId])
@@index([status])
}
model AccountingExport {
id String
@id
@default(uuid())
tenantId String
exportType AccountingExportType
fileName String
status ExportStatus
generatedAt DateTime?
createdAt DateTime
@default(now())
@@index([tenantId])
@@index([exportType])
@@index([status])
}
enum InvoiceStatus {
DRAFT
ISSUED
PARTIALLY_PAID
PAID
OVERDUE
CANCELLED
}
enum CreditNoteStatus {
DRAFT
ISSUED
APPLIED
CANCELLED
}
enum AccountingExportType {
CSV
FEC
SAGE
CEGID
QUICKBOOKS
XERO
}
enum ExportStatus {
PENDING
PROCESSING
COMPLETED
FAILED
}
npx prisma migrate dev \
--name invoicing_accounting
src/modules/invoicing ├── invoices │ ├── credit-notes │ ├── taxes │ ├── exports │ ├── compliance │ └── invoicing.module.ts
InvoiceService InvoiceLineService CreditNoteService TaxEngineService AccountingExportService FinancialComplianceService
invoice.service.ts
createInvoice() issueInvoice() markAsPaid() cancelInvoice() generatePdf()
INV-2027-000001
de manière séquentielle.
après :
Reservation Confirmed ou Payment Completed
selon configuration.
tax-engine.service.ts
TVA France TVA UE Taxe de séjour Taxes locales Exonérations
model TaxRule {
id String
@id
@default(uuid())
countryCode String
regionCode String?
taxType String
rate Decimal
@db.Decimal(6,3)
active Boolean
@default(true)
createdAt DateTime
@default(now())
@@index([countryCode])
@@index([taxType])
}
HT TVA TTC
pour toutes les factures.
credit-note.service.ts
createCreditNote() applyCreditNote() cancelCreditNote()
Annulation Remboursement Erreur facturation Geste commercial
Facture 500 € ↓ Avoir 100 €
accounting-export.service.ts
CSV Excel FEC Sage Cegid QuickBooks Xero
POST /accounting/exports
GET /accounting/exports
GET /accounting/exports/{id}
exports mensuels automatiques.
financial-compliance.service.ts
Numérotation Intégrité TVA Archivage Traçabilité
l'immutabilité des factures émises.
PDF/A Stockage S3 Conservation légale
GET /invoices
GET /invoices/{id}
POST /invoices
POST /invoices/{id}/issue
POST /invoices/{id}/pay
POST /credit-notes
GET /credit-notes
{
"invoiceNumber":"INV-2027-000001",
"status":"ISSUED",
"totalAmount":1250.00
}
invoice.read invoice.create invoice.issue invoice.pay invoice.export creditnote.manage accounting.admin
sur :
Invoice CreditNote AccountingExport
INVOICE_CREATED INVOICE_ISSUED INVOICE_PAID CREDIT_NOTE_CREATED ACCOUNTING_EXPORT_GENERATED
Préparer :
Check-In Check-Out Guest Identity Arrival Workflow
Préparer :
Revenue Recognition Financial Reporting BI Platform Enterprise ERP
Le Sprint 5-B.2 est terminé lorsque :
✓ Invoice créé ✓ InvoiceLine créé ✓ CreditNote créé ✓ Tax Engine créé ✓ Exports comptables créés ✓ Conformité financière créée ✓ Audit intégré
Invoice InvoiceLine CreditNote TaxRule AccountingExport InvoiceService CreditNoteService TaxEngineService AccountingExportService FinancialComplianceService Enterprise Financial Platform
Implémenter l'expérience d'arrivée complète des voyageurs.
Cette couche transforme la réservation confirmée en séjour actif.
À l'issue de cette étape :
✓ CheckIn ✓ Guest Verification ✓ Identity Documents ✓ Arrival Workflow ✓ Digital Signature ✓ Arrival Dashboard ✓ Digital Arrival Platform
Reservation ↓ Arrival Workflow ├── Guest Verification ├── Identity Documents ├── Digital Signature ├── Check-In Validation ├── Key Delivery └── Arrival Dashboard ↓ Stay Management ↓ Check-Out
model CheckIn {
id String
@id
@default(uuid())
tenantId String
reservationId String
@unique
status CheckInStatus
scheduledAt DateTime?
startedAt DateTime?
completedAt DateTime?
verified Boolean
@default(false)
signatureCompleted Boolean
@default(false)
notes String?
createdAt DateTime
@default(now())
updatedAt DateTime
@updatedAt
reservation Reservation
@relation(
fields:[reservationId],
references:[id],
onDelete:Cascade
)
documents IdentityDocument[]
@@index([tenantId])
@@index([status])
}
model IdentityDocument {
id String
@id
@default(uuid())
checkInId String
guestId String
documentType IdentityDocumentType
documentNumber String?
storagePath String
verificationStatus VerificationStatus
verifiedAt DateTime?
createdAt DateTime
@default(now())
checkIn CheckIn
@relation(
fields:[checkInId],
references:[id],
onDelete:Cascade
)
@@index([checkInId])
@@index([guestId])
@@index([verificationStatus])
}
model GuestVerification {
id String
@id
@default(uuid())
guestId String
verificationStatus VerificationStatus
verificationMethod VerificationMethod
riskScore Float?
@default(0)
verifiedAt DateTime?
createdAt DateTime
@default(now())
@@index([guestId])
@@index([verificationStatus])
}
model DigitalSignature {
id String
@id
@default(uuid())
reservationId String
signerId String
documentType String
signaturePath String?
signedAt DateTime?
ipAddress String?
status SignatureStatus
createdAt DateTime
@default(now())
@@index([reservationId])
@@index([signerId])
@@index([status])
}
enum CheckInStatus {
PENDING
IN_PROGRESS
VERIFIED
COMPLETED
REJECTED
}
enum IdentityDocumentType {
PASSPORT
ID_CARD
DRIVER_LICENSE
RESIDENCE_PERMIT
}
enum VerificationStatus {
PENDING
VERIFIED
REJECTED
MANUAL_REVIEW
}
enum VerificationMethod {
MANUAL
OCR
BIOMETRIC
THIRD_PARTY
}
npx prisma migrate dev \
--name digital_checkin
src/modules/checkin ├── checkin │ ├── verification │ ├── documents │ ├── signatures │ ├── arrivals │ └── checkin.module.ts
CheckInService GuestVerificationService IdentityDocumentService DigitalSignatureService ArrivalWorkflowService ArrivalDashboardService
arrival-workflow.service.ts
Reservation Confirmed ↓ Document Upload ↓ Identity Verification ↓ Digital Signature ↓ Check-In Approval ↓ Arrival Completed
Document valide Signature valide Paiement conforme
avant check-in.
J-7 Arrival Email J-3 Reminder J-1 Check-In Link Arrival Instructions
guest-verification.service.ts
verifyGuest() calculateRiskScore() approveVerification() rejectVerification()
Identité Âge Document expiré Doublons Blacklist
à partir de :
Documents Historique Pays Fraude
identity-document.service.ts
uploadDocument() validateDocument() extractDocumentData() deleteDocument()
Passport Carte identité Permis Titre séjour
MinIO S3 Encryption At Rest
Nom Prénom Date naissance Numéro document Expiration
digital-signature.service.ts
requestSignature() signDocument() verifySignature()
Contrat location Conditions générales Règlement intérieur Décharge responsabilité
Date IP Utilisateur Document
arrival-dashboard.service.ts
Arrivées du jour Check-In en attente Vérifications manuelles Documents manquants Signatures manquantes
Arrival Completion Rate Average Check-In Time Verification Success Rate Digital Adoption Rate
GET /arrivals/dashboard
GET /reservations/{id}/checkin
POST /reservations/{id}/checkin/start
POST /reservations/{id}/documents
POST /reservations/{id}/verify
POST /reservations/{id}/signature
POST /reservations/{id}/checkin/complete
{
"status":"VERIFIED",
"documentsValid":true,
"signatureCompleted":true
}
checkin.read checkin.start checkin.verify checkin.complete checkin.documents checkin.admin
Consentement Chiffrement Conservation limitée Suppression automatique
aux documents d'identité.
CHECKIN_STARTED DOCUMENT_UPLOADED GUEST_VERIFIED SIGNATURE_COMPLETED CHECKIN_COMPLETED
Préparer :
Check-Out Damage Reports Deposit Release Guest Satisfaction
Préparer :
Smart Locks Keyless Entry IoT Access Mobile Keys
Le Sprint 5-C.1 est terminé lorsque :
✓ CheckIn créé ✓ Guest Verification créée ✓ Identity Documents créés ✓ Arrival Workflow créé ✓ Digital Signature créée ✓ Arrival Dashboard créé ✓ Audit intégré
CheckIn IdentityDocument GuestVerification DigitalSignature CheckInService GuestVerificationService IdentityDocumentService DigitalSignatureService ArrivalWorkflowService ArrivalDashboardService Digital Check-In Platform
Finaliser le cycle de vie complet du séjour.
Cette couche transforme un séjour actif en séjour clôturé tout en gérant :
Départ Contrôle logement Dépôt de garantie Satisfaction client Clôture financière Clôture opérationnelle
À l'issue de cette étape :
✓ CheckOut ✓ Damage Report ✓ Deposit Release ✓ Guest Feedback ✓ Stay Closure ✓ Departure Dashboard ✓ Digital Departure Platform
Stay ↓ Check-Out Workflow ├── Departure Validation ├── Damage Inspection ├── Deposit Release ├── Guest Feedback ├── Invoice Closure └── Reservation Completion ↓ Analytics ↓ CRM ↓ Reviews
model CheckOut {
id String
@id
@default(uuid())
tenantId String
reservationId String
@unique
status CheckOutStatus
scheduledAt DateTime?
startedAt DateTime?
completedAt DateTime?
depositReleased Boolean
@default(false)
feedbackSubmitted Boolean
@default(false)
notes String?
createdAt DateTime
@default(now())
updatedAt DateTime
@updatedAt
reservation Reservation
@relation(
fields:[reservationId],
references:[id],
onDelete:Cascade
)
damageReports DamageReport[]
@@index([tenantId])
@@index([status])
}
model DamageReport {
id String
@id
@default(uuid())
checkOutId String
severity DamageSeverity
category DamageCategory
title String
description String?
estimatedCost Decimal?
@db.Decimal(12,2)
resolved Boolean
@default(false)
createdAt DateTime
@default(now())
checkOut CheckOut
@relation(
fields:[checkOutId],
references:[id],
onDelete:Cascade
)
photos DamagePhoto[]
@@index([checkOutId])
@@index([severity])
@@index([resolved])
}
model DamagePhoto {
id String
@id
@default(uuid())
damageReportId String
imageUrl String
createdAt DateTime
@default(now())
damageReport DamageReport
@relation(
fields:[damageReportId],
references:[id],
onDelete:Cascade
)
@@index([damageReportId])
}
model GuestFeedback {
id String
@id
@default(uuid())
reservationId String
@unique
overallRating Int
cleanlinessRating Int?
comfortRating Int?
serviceRating Int?
comment String?
submittedAt DateTime
@default(now())
reservation Reservation
@relation(
fields:[reservationId],
references:[id],
onDelete:Cascade
)
}
enum CheckOutStatus {
PENDING
IN_PROGRESS
INSPECTED
COMPLETED
}
enum DamageSeverity {
LOW
MEDIUM
HIGH
CRITICAL
}
enum DamageCategory {
CLEANING
FURNITURE
ELECTRICAL
PLUMBING
SECURITY
OTHER
}
npx prisma migrate dev \
--name digital_checkout
src/modules/checkout ├── checkout │ ├── damages │ ├── deposits │ ├── feedback │ ├── departure │ └── checkout.module.ts
CheckOutService DamageReportService DepositReleaseService GuestFeedbackService StayClosureService DepartureDashboardService
stay-closure.service.ts
Check-Out Started ↓ Inspection ↓ Damage Review ↓ Deposit Decision ↓ Feedback ↓ Reservation Completed
Paiements finalisés Inspection terminée Aucune anomalie bloquante
avant clôture.
Check-Out Reminder Feedback Request Review Invitation CRM Update
damage-report.service.ts
createDamageReport() uploadDamagePhoto() estimateDamageCost() resolveDamage()
Ménage Mobilier Électrique Plomberie Sécurité
Préparer :
Vision AI Damage Detection Cost Estimation
deposit-release.service.ts
releaseDeposit() holdDeposit() partialRelease() chargeDamageCost()
Full Release Partial Release Full Retention
SecurityDepositPolicy PaymentRefund ReservationPayment
guest-feedback.service.ts
submitFeedback() calculateSatisfaction() generateReviewRequest()
Propreté Confort Service Expérience globale
Property Reviews CRM Analytics Property Reputation
departure-dashboard.service.ts
Départs du jour Inspections en attente Dépôts à rembourser Feedbacks reçus Incidents ouverts
Checkout Completion Rate Average Checkout Time Deposit Release Time Guest Satisfaction
GET /departures/dashboard
GET /reservations/{id}/checkout
POST /reservations/{id}/checkout/start
POST /reservations/{id}/damage-reports
POST /reservations/{id}/deposit/release
POST /reservations/{id}/feedback
POST /reservations/{id}/checkout/complete
{
"status":"COMPLETED",
"depositReleased":true,
"feedbackSubmitted":true
}
checkout.read checkout.start checkout.complete checkout.damage checkout.deposit checkout.admin
CHECKOUT_STARTED DAMAGE_REPORTED DEPOSIT_RELEASED FEEDBACK_SUBMITTED CHECKOUT_COMPLETED
sur :
CheckOut DamageReport GuestFeedback
Préparer :
Housekeeping Maintenance Guest Requests Incident Management
Préparer :
Guest Journey Customer Success Operational Excellence Service Automation
Le Sprint 5-C.2 est terminé lorsque :
✓ CheckOut créé ✓ DamageReport créé ✓ Deposit Release créé ✓ Guest Feedback créé ✓ Stay Closure créé ✓ Departure Dashboard créé ✓ Audit intégré
CheckOut DamageReport DamagePhoto GuestFeedback CheckOutService DamageReportService DepositReleaseService GuestFeedbackService StayClosureService DepartureDashboardService Digital Check-Out Platform
Mettre en place la couche opérationnelle du séjour.
Cette couche permet de gérer :
Demandes voyageurs Incidents Maintenance Tâches Communication Suivi opérationnel
depuis l'arrivée jusqu'au départ.
À l'issue de cette étape :
✓ GuestRequest ✓ ServiceTicket ✓ Incident ✓ TaskAssignment ✓ Guest Communication ✓ Service Dashboard ✓ Hospitality Service Desk
Guest ↓ Guest Request ↓ Service Desk ├── Tickets ├── Incidents ├── Tasks ├── Communications ├── Escalations └── SLA ↓ Operations ↓ Analytics
model GuestRequest {
id String
@id
@default(uuid())
tenantId String
reservationId String
guestId String?
requestType GuestRequestType
priority TicketPriority
status TicketStatus
subject String
description String
requestedAt DateTime
@default(now())
resolvedAt DateTime?
satisfactionScore Int?
createdAt DateTime
@default(now())
updatedAt DateTime
@updatedAt
tickets ServiceTicket[]
@@index([tenantId])
@@index([reservationId])
@@index([status])
@@index([priority])
}
model ServiceTicket {
id String
@id
@default(uuid())
tenantId String
guestRequestId String
assignedTo String?
ticketNumber String
@unique
status TicketStatus
priority TicketPriority
slaDueAt DateTime?
resolvedAt DateTime?
createdAt DateTime
@default(now())
updatedAt DateTime
@updatedAt
request GuestRequest
@relation(
fields:[guestRequestId],
references:[id],
onDelete:Cascade
)
tasks TaskAssignment[]
@@index([tenantId])
@@index([assignedTo])
@@index([status])
}
model Incident {
id String
@id
@default(uuid())
tenantId String
reservationId String?
propertyId String
severity IncidentSeverity
category IncidentCategory
title String
description String
status IncidentStatus
openedAt DateTime
@default(now())
closedAt DateTime?
createdAt DateTime
@default(now())
@@index([tenantId])
@@index([propertyId])
@@index([status])
@@index([severity])
}
model TaskAssignment {
id String
@id
@default(uuid())
tenantId String
ticketId String?
incidentId String?
assignedUserId String
title String
description String?
dueDate DateTime?
completed Boolean
@default(false)
completedAt DateTime?
createdAt DateTime
@default(now())
@@index([tenantId])
@@index([assignedUserId])
@@index([completed])
}
model GuestCommunication {
id String
@id
@default(uuid())
tenantId String
reservationId String
channel CommunicationChannel
direction CommunicationDirection
subject String?
message String
sentAt DateTime
@default(now())
createdAt DateTime
@default(now())
@@index([tenantId])
@@index([reservationId])
@@index([channel])
}
enum GuestRequestType {
HOUSEKEEPING
MAINTENANCE
AMENITY
INFORMATION
CHECKIN
CHECKOUT
TRANSPORT
OTHER
}
enum TicketStatus {
OPEN
IN_PROGRESS
WAITING
RESOLVED
CLOSED
}
enum TicketPriority {
LOW
MEDIUM
HIGH
URGENT
}
enum IncidentSeverity {
LOW
MEDIUM
HIGH
CRITICAL
}
enum IncidentStatus {
OPEN
INVESTIGATING
RESOLVED
CLOSED
}
enum IncidentCategory {
FACILITY
SECURITY
CLEANING
PAYMENT
TECHNICAL
OTHER
}
enum CommunicationChannel {
EMAIL
SMS
PHONE
WHATSAPP
IN_APP
}
enum CommunicationDirection {
INBOUND
OUTBOUND
}
npx prisma migrate dev \
--name guest_service_desk
src/modules/service-desk ├── guest-requests │ ├── tickets │ ├── incidents │ ├── tasks │ ├── communications │ ├── sla │ └── service-desk.module.ts
GuestRequestService ServiceTicketService IncidentService TaskAssignmentService GuestCommunicationService ServiceDashboardService
guest-request.service.ts
createRequest() assignRequest() resolveRequest() rateSatisfaction()
Serviettes Ménage Réparation Questions Transport Assistance
Guest Request ↓ Ticket ↓ Assignment ↓ Resolution ↓ Feedback
service-ticket.service.ts
LOW 48h MEDIUM 24h HIGH 8h URGENT 1h
createTicket() assignTicket() escalateTicket() closeTicket()
TKT-2027-000001
incident.service.ts
openIncident() investigateIncident() resolveIncident() closeIncident()
Panne climatisation Fuite Problème serrure Sécurité Incident paiement
si :
Severity = CRITICAL
task-assignment.service.ts
assignTask() completeTask() reassignTask()
Housekeeping Maintenance Reception Manager
lors des nouvelles tâches.
guest-communication.service.ts
sendMessage() receiveMessage() getConversation()
Email SMS Téléphone WhatsApp In-App
toutes les interactions client.
service-dashboard.service.ts
Tickets ouverts Tickets SLA en retard Incidents actifs Tâches assignées Satisfaction client
Resolution Time SLA Compliance Ticket Volume CSAT Incident Rate
GET /service-desk/dashboard
GET /guest-requests
POST /guest-requests
PUT /guest-requests/{id}
POST /tickets/{id}/assign
POST /tickets/{id}/close
POST /incidents
PUT /incidents/{id}
POST /tasks/{id}/complete
GET /communications/{reservationId}
{
"requestType":"HOUSEKEEPING",
"subject":"Serviettes supplémentaires"
}
service.read service.manage service.assign service.incident service.communication service.admin
REQUEST_CREATED TICKET_ASSIGNED INCIDENT_OPENED TASK_COMPLETED MESSAGE_SENT SLA_BREACHED
Compatible avec :
Housekeeping Automation Maintenance Management Operational Intelligence Work Orders
Le Sprint 5-D.1 est terminé lorsque :
✓ GuestRequest créé ✓ ServiceTicket créé ✓ Incident créé ✓ TaskAssignment créé ✓ GuestCommunication créé ✓ Service Dashboard créé ✓ SLA intégré ✓ Audit intégré
GuestRequest ServiceTicket Incident TaskAssignment GuestCommunication GuestRequestService ServiceTicketService IncidentService TaskAssignmentService GuestCommunicationService ServiceDashboardService Hospitality Service Desk
Automatiser les opérations terrain de la plateforme.
Cette couche permet de piloter :
Ménage Maintenance Statut des logements Inventaire Maintenance préventive Performance opérationnelle
afin de transformer la plateforme en véritable PMS (Property Management System).
À l'issue de cette étape :
✓ Housekeeping ✓ Room Status ✓ Maintenance Work Orders ✓ Preventive Maintenance ✓ Inventory Usage ✓ Operations Dashboard ✓ Operations Management Platform
Reservation ↓ Operations Engine ├── Housekeeping ├── Room Status ├── Maintenance ├── Preventive Maintenance ├── Inventory └── Operations Dashboard ↓ Property Operations ↓ Analytics
model HousekeepingTask {
id String
@id
@default(uuid())
tenantId String
propertyId String
reservationId String?
assignedUserId String?
taskType HousekeepingTaskType
status HousekeepingStatus
priority TaskPriority
scheduledAt DateTime?
startedAt DateTime?
completedAt DateTime?
notes String?
createdAt DateTime
@default(now())
updatedAt DateTime
@updatedAt
@@index([tenantId])
@@index([propertyId])
@@index([status])
@@index([assignedUserId])
}
model PropertyRoomStatus {
propertyId String
@id
status RoomStatus
lastUpdatedAt DateTime
@updatedAt
notes String?
property Property
@relation(
fields:[propertyId],
references:[id],
onDelete:Cascade
)
}
model MaintenanceWorkOrder {
id String
@id
@default(uuid())
tenantId String
propertyId String
assignedUserId String?
category MaintenanceCategory
priority TaskPriority
status WorkOrderStatus
title String
description String?
estimatedCost Decimal?
@db.Decimal(12,2)
actualCost Decimal?
@db.Decimal(12,2)
scheduledAt DateTime?
completedAt DateTime?
createdAt DateTime
@default(now())
updatedAt DateTime
@updatedAt
@@index([tenantId])
@@index([propertyId])
@@index([status])
@@index([priority])
}
model PreventiveMaintenance {
id String
@id
@default(uuid())
tenantId String
propertyId String
title String
frequencyDays Int
nextDueDate DateTime
active Boolean
@default(true)
lastCompletedAt DateTime?
createdAt DateTime
@default(now())
@@index([tenantId])
@@index([propertyId])
@@index([nextDueDate])
}
model InventoryUsage {
id String
@id
@default(uuid())
tenantId String
propertyId String
itemName String
quantity Decimal
@db.Decimal(10,2)
unit String
usedAt DateTime
@default(now())
referenceType String?
referenceId String?
@@index([tenantId])
@@index([propertyId])
@@index([usedAt])
}
enum HousekeepingTaskType {
CHECKOUT_CLEANING
DEEP_CLEANING
INSPECTION
LINEN_CHANGE
RESTOCK
OTHER
}
enum HousekeepingStatus {
PENDING
ASSIGNED
IN_PROGRESS
COMPLETED
CANCELLED
}
enum RoomStatus {
AVAILABLE
OCCUPIED
DIRTY
CLEANING
INSPECTING
OUT_OF_SERVICE
}
enum MaintenanceCategory {
HVAC
ELECTRICAL
PLUMBING
FURNITURE
SECURITY
APPLIANCE
GENERAL
}
enum WorkOrderStatus {
OPEN
ASSIGNED
IN_PROGRESS
COMPLETED
CANCELLED
}
enum TaskPriority {
LOW
MEDIUM
HIGH
URGENT
}
npx prisma migrate dev \
--name operations_management
src/modules/operations ├── housekeeping │ ├── room-status │ ├── maintenance │ ├── preventive-maintenance │ ├── inventory │ ├── dashboard │ └── operations.module.ts
HousekeepingService RoomStatusService MaintenanceWorkOrderService PreventiveMaintenanceService InventoryUsageService OperationsDashboardService
housekeeping.service.ts
createCleaningTask() assignTask() startCleaning() completeCleaning()
Check-Out ↓ Cleaning Task
DIRTY ↓ CLEANING ↓ INSPECTING ↓ AVAILABLE
room-status.service.ts
updateStatus() getStatus() transitionStatus()
à partir de :
Reservation CheckIn CheckOut Housekeeping
Occupé Disponible En ménage Hors service
maintenance-work-order.service.ts
createWorkOrder() assignTechnician() completeWorkOrder() calculateCosts()
Incident Inspection Preventive Maintenance Manual Request
si :
Priority = URGENT
preventive-maintenance.service.ts
scheduleMaintenance() generateWorkOrders() markCompleted()
Climatisation 90 jours ↓ Work Order auto
Détecteur fumée 180 jours ↓ Inspection auto
inventory-usage.service.ts
Produits ménage Linge Consommables Produits accueil
registerUsage() calculateConsumption() forecastInventory()
sur :
Stock faible Surconsommation Rupture
operations-dashboard.service.ts
Nettoyages en attente Logements sales Work Orders ouverts Maintenances prévues Consommation inventaire
Cleaning Time Room Turnover Time Maintenance SLA Inventory Cost Operational Efficiency
GET /operations/dashboard
GET /housekeeping/tasks
POST /housekeeping/tasks
PUT /housekeeping/tasks/{id}
GET /room-status
PUT /room-status/{propertyId}
GET /maintenance/work-orders
POST /maintenance/work-orders
PUT /maintenance/work-orders/{id}
GET /preventive-maintenance
POST /preventive-maintenance
GET /inventory/usage
{
"category":"HVAC",
"priority":"HIGH",
"title":"Réparation climatisation"
}
operations.read operations.housekeeping operations.maintenance operations.inventory operations.dashboard operations.admin
HOUSEKEEPING_CREATED HOUSEKEEPING_COMPLETED ROOM_STATUS_UPDATED WORK_ORDER_CREATED WORK_ORDER_COMPLETED PREVENTIVE_MAINTENANCE_EXECUTED
Toutes les heures Maintenance Scheduler Toutes les nuits Inventory Forecast Operations KPIs Refresh
À la fin du Sprint 5-D.2 :
✓ Service Desk ✓ Guest Requests ✓ Incidents ✓ Housekeeping ✓ Maintenance ✓ Inventory ✓ Operations Dashboard
sont entièrement opérationnels.
Mettre en place le cockpit analytique des réservations.
Cette couche fournit une vision complète de :
Réservations Revenus Annulations Voyageurs Performance Conversion
afin de piloter l'activité commerciale et opérationnelle.
À l'issue de cette étape :
✓ Reservation Dashboard ✓ Booking Analytics ✓ Revenue KPIs ✓ Cancellation Analytics ✓ Guest Analytics ✓ Reservation Performance ✓ Reservation Intelligence Dashboard
Reservations ↓ Reservation Analytics ├── Booking Analytics ├── Revenue Analytics ├── Cancellation Analytics ├── Guest Analytics ├── Conversion Analytics └── KPI Dashboard ↓ Revenue Management ↓ Executive Reporting
model ReservationAnalyticsSnapshot {
id String
@id
@default(uuid())
tenantId String
snapshotDate DateTime
reservationsCount Int
@default(0)
confirmedBookings Int
@default(0)
cancelledBookings Int
@default(0)
revenue Decimal
@db.Decimal(14,2)
averageBookingValue Decimal
@db.Decimal(14,2)
averageLengthOfStay Float?
occupancyImpact Float?
createdAt DateTime
@default(now())
@@index([tenantId])
@@index([snapshotDate])
}
model ReservationKPI {
tenantId String
@id
bookingConversionRate Float?
cancellationRate Float?
averageBookingValue Float?
averageStayLength Float?
repeatGuestRate Float?
revenuePerBooking Float?
updatedAt DateTime
@updatedAt
}
npx prisma migrate dev \
--name reservation_analytics
src/modules/reservation-analytics ├── dashboard │ ├── bookings │ ├── revenue │ ├── cancellations │ ├── guests │ ├── performance │ └── reservation-analytics.module.ts
ReservationDashboardService BookingAnalyticsService RevenueKPIService CancellationAnalyticsService GuestAnalyticsService ReservationPerformanceService
booking-analytics.service.ts
calculateBookings() calculateBookingTrend() analyzeBookingSources() analyzeLeadTime()
Total Reservations Confirmed Reservations Pending Reservations No Shows Lead Time
Direct Website Mobile App Airbnb Booking Expedia
revenue-kpi.service.ts
Gross Revenue Net Revenue Average Booking Value Revenue Per Booking Revenue Growth
Revenue 125 000 € ↑ 14%
Reservation Payments Invoices Refunds
cancellation-analytics.service.ts
calculateCancellationRate() analyzeCancellationReasons() forecastCancellationRisk()
Cancellation Rate Refund Rate No Show Rate Cancellation Cost
par :
Property Source Country Season
guest-analytics.service.ts
Repeat Guests New Guests Average Group Size Countries Guest Lifetime Value
calculateRepeatGuestRate() analyzeGuestOrigins() calculateGuestLTV()
Customer Score Customer Segment Loyalty Program
reservation-performance.service.ts
Booking Conversion Booking Velocity Reservation Growth Channel Performance Forecast Accuracy
Best Performing Properties Best Channels Best Markets
Booking Score Revenue Score Guest Score Cancellation Score Global Reservation Score
reservation-dashboard.service.ts
Bookings Revenue Guests Cancellations Performance
GET /reservations/dashboard
{
"bookings":842,
"revenue":125000,
"cancellationRate":4.2,
"repeatGuests":31,
"bookingScore":89
}
GET /reservations/dashboard GET /reservations/analytics/bookings GET /reservations/analytics/revenue GET /reservations/analytics/cancellations GET /reservations/analytics/guests GET /reservations/analytics/performance
Today 7 Days 30 Days 90 Days 12 Months Custom Range
GET /reservations/analytics/export
Formats :
CSV Excel PDF
reservation.analytics.read reservation.analytics.export reservation.analytics.kpi reservation.analytics.admin
RESERVATION_DASHBOARD_VIEWED BOOKING_ANALYTICS_VIEWED REVENUE_KPI_CALCULATED CANCELLATION_ANALYTICS_VIEWED ANALYTICS_EXPORTED
Toutes les heures KPI Refresh Toutes les nuits Analytics Snapshot Forecast Refresh
Compatible avec :
Fraud Detection Revenue Forecast Reservation Intelligence Predictive Booking
Le Sprint 5-E.1 est terminé lorsque :
✓ Reservation Dashboard ✓ Booking Analytics ✓ Revenue KPIs ✓ Cancellation Analytics ✓ Guest Analytics ✓ Reservation Performance ✓ Export Analytics ✓ Audit intégré
ReservationAnalyticsSnapshot ReservationKPI ReservationDashboardService BookingAnalyticsService RevenueKPIService CancellationAnalyticsService GuestAnalyticsService ReservationPerformanceService Reservation Analytics Platform
Transformer le moteur analytique de réservation en plateforme Reservation Intelligence Enterprise.
Cette couche permet :
Prévision Détection de fraude Prédiction d'annulation Analyse de risque Optimisation des revenus Pilotage intelligent
À l'issue de cette étape :
✓ Prévision réservations ✓ Prévision revenus ✓ Fraud Detection ✓ Cancellation Prediction ✓ Guest Risk Score ✓ Reservation Health Score ✓ Reservation Intelligence Platform
Reservation Analytics ↓ Reservation Intelligence Engine ├── Booking Forecast ├── Revenue Forecast ├── Cancellation Prediction ├── Fraud Detection ├── Guest Risk Scoring ├── Health Scoring └── AI Recommendations ↓ Revenue Management ↓ Executive Intelligence
model ReservationForecast {
id String
@id
@default(uuid())
tenantId String
forecastType ReservationForecastType
forecastDate DateTime
predictedValue Float
confidenceScore Float?
generatedAt DateTime
@default(now())
@@index([tenantId])
@@index([forecastType])
@@index([forecastDate])
}
model ReservationInsight {
id String
@id
@default(uuid())
tenantId String
category ReservationInsightCategory
severity InsightSeverity
title String
description String
recommendation String?
impactScore Float?
resolved Boolean
@default(false)
createdAt DateTime
@default(now())
@@index([tenantId])
@@index([category])
@@index([resolved])
}
model GuestRiskScore {
guestId String
@id
overallRisk Float
fraudRisk Float
cancellationRisk Float
paymentRisk Float
behaviorRisk Float
calculatedAt DateTime
@updatedAt
}
model ReservationHealthScore {
reservationId String
@id
overallScore Float
paymentScore Float
guestScore Float
fraudScore Float
completionScore Float
calculatedAt DateTime
@updatedAt
}
enum ReservationForecastType {
BOOKINGS
REVENUE
CANCELLATIONS
OCCUPANCY
}
enum ReservationInsightCategory {
BOOKINGS
REVENUE
CANCELLATION
FRAUD
GUEST
}
npx prisma migrate dev \
--name reservation_intelligence
src/modules/reservation-intelligence ├── forecasts │ ├── fraud │ ├── cancellation │ ├── risk │ ├── insights │ ├── health-score │ └── reservation-intelligence.module.ts
BookingForecastService RevenueForecastService CancellationPredictionService FraudDetectionService GuestRiskScoreService ReservationHealthScoreService ReservationInsightService
booking-forecast.service.ts
forecastBookings() forecastOccupancyImpact() forecastSeasonality()
Reservations Property Analytics Seasonality Events Historical Trends
30 prochains jours Prévision +18% Réservations
revenue-forecast.service.ts
forecastRevenue() forecastADR() forecastRevPAR() forecastCashFlow()
avec :
Reservations Invoices Payments Refunds
Revenue Forecast 145 000 € +11%
cancellation-prediction.service.ts
predictCancellation() calculateCancellationRisk() recommendRetentionAction()
Lead Time Country Booking Source Past Behavior Price Sensitivity
Reservation #RSV-1001 Cancellation Risk 72%
Reminder Special Offer Deposit Request
fraud-detection.service.ts
Card Fraud Identity Fraud Chargeback Risk Multi Account Abuse Bot Activity
calculateFraudRisk() detectSuspiciousPatterns() triggerFraudAlert()
Payments Guest Verification Connection History Behavior Analysis
LOW MEDIUM HIGH CRITICAL
guest-risk-score.service.ts
Fraude Paiement Historique Annulations Incidents
0-25 Low Risk 26-50 Moderate 51-75 High 76-100 Critical
Guest Risk 18 Low Risk
reservation-health-score.service.ts
Payment Status 30% Guest Risk 25% Fraud Risk 20% Workflow Progress 15% Communication 10%
90-100 Excellent 75-89 Healthy 50-74 At Risk 0-49 Critical
Reservation Health 91 Excellent
reservation-insight.service.ts
Opportunités revenus Risques annulation Segments performants Canaux performants Alertes fraude
Les réservations Airbnb ↑ 24% ↓ Renforcer ce canal
Les annulations augmentent sur les réservations >60 jours ↓ Adapter la politique
GET /reservations/intelligence
GET /reservations/forecasts
GET /reservations/insights
GET /reservations/fraud
GET /reservations/health-score
GET /guests/{id}/risk-score
{
"bookingForecast":1240,
"revenueForecast":145000,
"cancellationRisk":12,
"fraudAlerts":2,
"healthScore":91
}
Forecast Accuracy Fraud Detection Rate Cancellation Prediction Accuracy Health Score Trends Insight Adoption
reservation.intelligence.read reservation.intelligence.forecast reservation.intelligence.fraud reservation.intelligence.health reservation.intelligence.admin
FORECAST_GENERATED FRAUD_ALERT_TRIGGERED CANCELLATION_RISK_CALCULATED GUEST_RISK_UPDATED HEALTH_SCORE_UPDATED INTELLIGENCE_DASHBOARD_VIEWED
Toutes les heures Fraud Detection Toutes les nuits Forecast Generation Risk Recalculation Insight Generation
À la fin du Sprint 5, la plateforme dispose désormais de :
✓ Reservation Engine ✓ Booking Workflow ✓ Payment Platform ✓ Invoicing Platform ✓ Digital Check-In ✓ Digital Check-Out ✓ Service Desk ✓ Housekeeping ✓ Maintenance ✓ Reservation Analytics ✓ Reservation Intelligence
Compatible avec :
Multi Property Management Portfolio Management Owners Operators Asset Management
Compatible avec :
Enterprise Hospitality OS AI Revenue Platform Predictive Operations Global Reservation Intelligence
Le Sprint 5-E.2 est terminé lorsque :
✓ Prévision réservations ✓ Prévision revenus ✓ Fraud Detection ✓ Cancellation Prediction ✓ Guest Risk Score ✓ Reservation Health Score ✓ Insights IA ✓ Dashboard Intelligence
ReservationForecast ReservationInsight GuestRiskScore ReservationHealthScore BookingForecastService RevenueForecastService CancellationPredictionService FraudDetectionService GuestRiskScoreService ReservationHealthScoreService ReservationInsightService Reservation Intelligence Platform