beginner
shop-rentals
out-of-service
maintenance

Out-of-Service Lifecycle

Take a bike out of service, document the reason, and bring it back online — with automatic availability blocking on reservations

Levy Fleets TeamMay 7, 20264 min read

When a bike is unrideable, broken, or being repaired, mark it out-of-service. The system blocks new reservations on it until it returns to service.

Quick toggle

/dashboard/vehicles/[id] → Service Log section. Top banner:

  • Green when the bike is in service
  • Amber when it's out of service, with reason and timestamp

Click Take out of service to flip green → amber. Click Mark in service to flip back.

Required fields when going OOS

  • Reason — short text shown to staff. Examples:
    • "Flat tire"
    • "Brake pads need replacement"
    • "Crash damage — frame inspection required"
    • "Lost / stolen — under investigation"
  • Until (optional) — expected return-to-service date. Helps with fleet planning.

What it does

When you flip to OOS:

  1. vehicles.out_of_service_at = now()
  2. vehicles.out_of_service_reason = "..."
  3. vehicles.out_of_service_until = ... (if provided)
  4. A vehicle_service_log row is inserted with event_type='out_of_service'

When you flip back to in-service:

  1. All three OOS fields cleared on vehicles
  2. A new service log row with event_type='returned_to_service' and the previous reason captured in metadata

What blocks while OOS

The reservation availability check excludes OOS vehicles. Specifically:

  • The walk-in wizard's model availability check skips them
  • The public booking page's availability skips them
  • Manual assignment from the booking detail's eligible-vehicles dropdown filters them out
  • The calendar shows blocked windows for OOS vehicles (rendered as amber wrench pills)

Existing reservations that already have this vehicle assigned don't auto-reassign. The operator should manually reassign or cancel/refund those bookings.

Calendar visualization

The shop-rentals calendar at /dashboard/shop-rentals/calendar renders OOS windows as amber pills with a wrench icon. Click a day to see the blocked windows in the sidebar with reasons and time ranges.

This gives you a visual sense of fleet capacity over the next month — a row of amber pills means you're running thin on bookable bikes.

OOS with end date

Setting an out_of_service_until date makes the OOS time-bounded. The availability check should consider the bike unavailable during that window only. (Currently the check treats OOS as fully unavailable until explicitly cleared — the time-bounded version is on the roadmap.)

For now, set the until field for record-keeping but rely on the Mark in service click to actually un-block.

Common scenarios

Flat tire, fix today

  1. Take out of service: "Flat tire"
  2. Repair the tire
  3. Mark in service

The service log captures both events with timestamps; total OOS duration ≈ 30 min.

Frame damage, awaiting parts (1 week)

  1. Take out of service: "Frame crack, replacement frame ordered"
  2. Set until to the expected delivery + repair date
  3. Order parts; do the repair
  4. Mark in service

Customers booking that model in the meantime will simply not see this specific vehicle in their assignment options — but if you have other vehicles of the same model, the model is still bookable up to the cap minus this OOS unit.

Recall — pause all units of a model

Currently no bulk OOS UI. To pause all units of a model:

UPDATE vehicles
SET out_of_service_at = now(),
    out_of_service_reason = 'Manufacturer recall',
    out_of_service_until = '2026-06-01'
WHERE subaccount_id = '<your-subaccount-id>'
  AND vehicle_model_id = '<the-model-id>'
  AND deleted_at IS NULL;

After the recall is resolved, run the inverse update.

A bulk-OOS UI is queued for a future release.

Stolen / lost bike

  1. Take out of service: "Lost / stolen — under investigation"
  2. Don't set an until date (unclear)
  3. File the police report and insurance claim using the bike's serial number
  4. Either:
    • Bike returns: mark in service
    • Bike doesn't return: leave OOS or soft-delete the vehicle entirely via deleted_at

Reporting

SELECT
  v.vehicle_number,
  v.out_of_service_at,
  v.out_of_service_reason,
  v.out_of_service_until,
  EXTRACT(EPOCH FROM (now() - v.out_of_service_at)) / 86400 AS days_out
FROM vehicles v
WHERE v.subaccount_id = '<your-subaccount-id>'
  AND v.out_of_service_at IS NOT NULL
  AND v.deleted_at IS NULL
ORDER BY v.out_of_service_at DESC;

Track how often each vehicle goes out and how long it stays out. Bikes that go OOS frequently (say, monthly) are candidates for replacement.

Common mistakes

Forgetting to flip back

The most common operator mistake. After repair, before the bike goes back on the rack, mark it in service. Otherwise it's invisible to new bookings forever.

A daily morning routine: open the vehicle list filtered by OOS status and verify each one is still legitimately out.

Marking OOS to "block availability for VIP"

Don't. OOS is for actual unavailability. To block a bike for a planned event, use a different mechanism (a reservation directly, or a maintenance event log entry without flipping OOS).

Forgetting to reassign existing bookings

If a bike goes OOS while assigned to a future reservation, the customer will arrive expecting that bike. Either reassign to another vehicle of the same model, or cancel and apologize.