Skip to content

Booking ID format (draft) ​

Job: one lodging reference issuer in Middleware. Display = storage.

FieldRule
FormatExactly 6 digits, zero-padded string
Live start010000 only if current live max numeric ref < 10000
Storage"010000" — not integer 10000
ScopeGlobal lodging counter, not per-hotel
IssuerMiddleware create-booking only

Examples: 010000, 010001, … 099999, 100000.

Listing-booking counters (100000SL) stay a different product line.

Seed ​

Preferred: counter value 9999 so the next issue is 10000 → "010000".

If production already issued ≥ 010000, do not rewind. Next ref = max(legacyNumeric, 9999) + 1. Staging may use 900000+.

Imports keep original refs (including alphanumeric).

How to build ​

On POST https://middleware-dev.bookdirect.live/api/v1/bookdirect/bookings (proposed remount; v1 still documents /nellalink/bookings):

  1. Allocate next counter atomically
  2. Store on Core booking as meta_key / reference string (live emails already read booking.meta_key)
  3. Return the same string to FE, emails, manage ?ref=

Do not confuse with payment reference (PSP id).

IDOR ​

Counter service is Middleware + server Core key. Public browse key must not increment.

Acceptance ​

  • First live booking after a clean cutover is 010000 (or documented continuation)
  • Emails, invoices, reservation cards show the 6-digit form
  • Concurrent creates cannot duplicate
  • Support search works for legacy + new refs

API-first. Middleware Backend wins over Core Backend when both exist.