# Hotel Operations — Genyra

> An eight-area COBOL hotel application rebuilt in Rust with exact-cent billing and persistent state: 7,351 exact record comparisons over 155 scenarios.

Canonical page: https://genyra.com/engineering/lab/hotel-operations

A 3,067-line COBOL hotel simulator with eight operating areas, rebuilt as native Rust with a structured command interface and persistent state. 155 operational scenarios and 7,351 exact table-record comparisons against the running original, with zero mismatches and zero monetary tolerance.

## Why this case matters.

Business applications are webs, not lists. In Alejandro Blanco's COBOL hotel simulator a reservation prices a room by nights, meal plan and children, applies a loyalty discount, adds tax and sets a pending balance; a check-in changes the room state; services append to the invoice; checkout settles the invoice and earns points; reports read all of it. Modernising one area without the others breaks the whole.

Genyra reconstructed all eight areas in Rust, replaced the terminal menus with one JSON command per line, kept the original field names in every record, and added the persistence the original never had, as a separately tested feature.

## State consistency, by construction.

Every command validates before it mutates. A rejected command, whether an invalid transition, an overflowing receiving field or a malformed amount, leaves the entire in-memory state unchanged and is reported as a failure without stopping the batch. Money is integer cents parsed from decimal strings, never from floating-point JSON numbers, and every calculation truncates toward zero at the same receiving field the original truncates at.

The known Gold-client example is asserted exactly in the native tests: three nights in room 101 with one adult, one child and the AD meal plan yields 267.00 room, 45.00 adult supplement, 22.50 child supplement, 40.14 discount, 29.43 tax and 323.79 total; 100.00 of services makes checkout 433.79.

## The boundary of the claim.

The proof is the recorded business-state comparison across the documented workflows: complete active table snapshots, byte for byte. It is not the original's Spanish report text, not every possible command sequence, and not a live reservations or payment service. The session date is the original simulator's fixed date, and nights are supplied explicitly, as in the original.

## Questions we are asked

**How does the harness drive a terminal application?** It compiles the unchanged original with bounds checking, adds a single observation that prints the active tables immediately before the existing STOP RUN, and feeds real menu input sequences. The native implementation runs the corresponding JSON commands from a fresh state, and both snapshots are compared as bytes.

**What was added that the original did not have?** Persistent snapshots, operation-level rollback, structured queries and a JSON interface. Each is implemented and tested as a native feature and kept outside the equivalence claim, which covers the original's business state only.

## Related work

- [Engineering Lab](https://genyra.com/engineering/lab): Legacy system migration evidence: three COBOL applications replaced by verified Rust reconstructions, and a native Rust desktop measured against its original.
- [Legacy Ledger & Payroll](https://genyra.com/engineering/lab/legacy-ledger): 13 COBOL banking and payroll programs reconstructed in Rust with exact fixed-point arithmetic: 2,174 exact file comparisons against the originals, 0 failures.
- [Legacy system modernisation](https://genyra.com/solutions/legacy-modernisation): Legacy modernization services: COBOL and mainframe application modernization to native software, not a conversion to the JVM estate that is now the next legacy.
- [Enterprise platform engineering](https://genyra.com/software/enterprise-platforms): Enterprise platform development for shared records, business rules, permissions, integrations and reliable operational workflows.

Contact: contact@genyra.com

Genyra LLC and the Dubai business Genyra L.L.C-FZ / Genyra.ai are distinct entities. Project scope and the contracting entity are agreed explicitly.
