Skip to content

Store bookings and cancellations #84

Open

Description

@selvarajuv

Blocked by: #83

Problem

We only know each night's final numbers, not when its rooms were booked or cancelled. Without booking and cancellation dates we can't tell a night that sold out weeks early (priced too low) from one that sold out at the last minute (priced about right).

Goal

Every booking and cancellation from the Guestline exports is stored, linked by booking reference, and loading the same file again changes nothing.

Scope

  • A bookings table: booking reference, hotel, booking date, arrival, departure, nights, room type code, company, agent, ADR and reservation value (nett), cancelled flag.
  • A booking_cancellations table: booking reference, cancellation date, reason code, arrival, departure, estimated lost revenue.
  • Parsers for Daily New Reservations and Cancellations that drop guest columns and map Guestline's column names to ours.
  • Models, repository and services through every layer, following the Widget slice; idempotent upserts keyed on booking reference.
  • An Alembic migration that applies and rolls back.
  • Not in scope: the upload endpoint (a separate issue) and features built from bookings.

Considerations

  • A booking reference may cover several rooms (/1, /2); store it as Guestline gives it until we know what the suffix means.
  • Store money as nett so every report agrees; note the VAT rate if converting.
  • Room types: keep Guestline's code on each booking even though recommendations use one room type for now.
  • Bookings later amended may change dates; note what we can and can't see.

Acceptance criteria

  • Sample files of both reports load into the new tables.
  • Loading the same file twice doesn't add rows.
  • No guest names or profile references are stored.
  • The migration upgrades and downgrades cleanly.
  • Tests cover parsing, upserts and malformed rows.

Metadata

Metadata

Assignees

No one assigned

    Labels

    featureIntroduces a new and complete featurehotel dataGuestline PMS exports, parsers, upload endpoint and checks

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions