Aircraft
Status: v1 primary
Packages: packages/domain/aircraft, packages/application/aircraft
Purpose
The Aircraft context manages the fleet: what aircraft exist, their details, and their operational state. It is the authoritative source of whether an aircraft is available or grounded. The Scheduling context consults Aircraft state before allowing a booking.
Entities
Aircraft (aggregate root)
Represents a single aircraft in the fleet.
Key attributes:
id— unique identifierregistration— official registration mark (e.g.ZK-ABC); unique and immutable after creationtype— aircraft type / model (e.g.Cessna 172)status—available|groundedgroundedReason— required when status isgrounded; null otherwisegroundedAt— timestamp of when grounding was appliedgroundedBy—MemberIdof the staff member who applied the grounding
Value objects
- AircraftId — typed identifier wrapping a UUID.
- Registration — validated aircraft registration string; enforces format (e.g. alphanumeric, country prefix).
- GroundedReason — non-empty string describing why the aircraft is grounded.
Domain rules
- Registration must be unique within the organisation.
- An aircraft cannot be booked when its status is
grounded. - Grounding requires a
groundedReason; it may not be empty. - Only authorised personnel (Staff role) can ground or unground an aircraft.
- An aircraft cannot be hard-deleted if it has associated Bookings or Flights; deactivation or status annotation is used instead.
Key use cases
addAircraft— register a new aircraft in the fleet.updateAircraft— update aircraft details (type, notes).groundAircraft— transition status togroundedwith a mandatory reason.ungroundAircraft— transition status back toavailable; clears grounding fields.listAircraft— return all aircraft with current status (filterable by status).getAircraft— return a single aircraft by ID or registration.
Cross-context relationships
| Context | Usage |
|---|---|
| Scheduling | Checks aircraft status before allowing a Booking; holds AircraftId on a Booking |
| Compliance | References AircraftId for airworthiness document tracking |
| Reporting | Reads aircraft utilisation data (infrastructure layer only) |
The Aircraft context does not import from Scheduling or People. It owns fleet state; other contexts reference it by AircraftId.