Preparing your design workspace

Loading the problem and your saved attempt…

Design a Rental Product Circulation Domain

Model bike and scooter inventory, customers, rentals, overdue queries, damage retirement, charges, and consistent operational snapshots.

Design the low-level domain and interfaces for a bike-and-scooter rental business. The required product variants are small, medium, and large bikes plus gas and electric scooters.

The system must answer: how many small bikes are available; what products are available for rent; whether a customer has an outstanding balance; which products are currently rented; which rentals are overdue and who holds them; and which products one customer has rented.

It must support adding a product unit, adding a customer, permanently removing a damaged product, recording a rental, and creating a charge.

For this exercise, assume every physical product unit and customer has a stable identifier. A product is AVAILABLE, RENTED, or RETIRED. Recording a rental for an available unit creates one active Rental with checkout and due timestamps and atomically makes that unit rented; one unit has at most one active rental.

Permanently removing a damaged product accepts a damage reason and is allowed only while the unit is available, then records immutable retirement and excludes it from future availability.

CreateCharge adds a positive integer-minor-unit ledger entry to a customer, and hasBalance means the sum of that customer's charge entries is positive; payment collection is outside scope. A rental is overdue only when it remains active and the query time is strictly later than dueAt.

Commands use stable request IDs: exact retries return their first outcomes and conflicting reuse is rejected. Queries return immutable snapshots ordered by stable identifiers.

Design objects, interfaces, errors, and interactions. Pricing, reservations, rental returns, payment processing, maintenance repair, persistence implementation, and distributed deployment are outside scope.

A focused follow-up asks how overlapping rent, damage-removal, charge, and reporting calls remain consistent without exposing partial state.