Baseleg Docs

Reporting

Status: v1 lite — scaffolded, not a primary v1 delivery focus
Packages: packages/domain/reporting, packages/application/reporting

Purpose

The Reporting context produces operational summaries and data exports from activity across the system. It is a read-only context — it does not modify state in other contexts.

Reporting queries are implemented at the infrastructure layer (behind ports) to avoid coupling the reporting context to other domains’ internals. In v1, basic operational reports and CSV exports are the target. Complex analytics and custom report builders come later.

Key concepts

Report

A computed, read-only summary covering a time range and scope. Reports are not persisted as domain entities — they are computed on demand or cached at the infrastructure level.

Common report types in v1:

  • Bookings summary — all bookings in a period, filterable by aircraft, instructor, and member.
  • Aircraft utilisation — hours flown per aircraft in a period.
  • Instructor activity — bookings and lessons per instructor in a period.
  • Member activity — bookings and flights per member in a period.

Export

A downloadable file (typically CSV) representing a report or raw data set. Exports are a convenience form of a Report targeting data portability, e.g. for import into accounting or scheduling tools.

Common exports in v1:

  • Bookings export (date range)
  • Flight log export (per member)
  • Charge items export (for accounting)

Domain rules

  1. Reports are always read-only. No report operation modifies data in any other context.
  2. Reporting queries must be implemented in the infrastructure layer (repository or read-model) — not by importing domain packages from other contexts.
  3. Exported data must not include sensitive personal information beyond what is operationally necessary (e.g. full payment details should not appear in a bookings export).

Key use cases

  • generateBookingsSummary — return a bookings summary for a given date range and optional filters.
  • generateAircraftUtilisation — return utilisation totals per aircraft for a period.
  • exportBookings — produce a CSV export of bookings for a date range.
  • exportFlightLog — produce a CSV export of flight records for a Member.
  • exportChargeItems — produce a CSV export of charge items for an accounting period.

Cross-context relationships

Reporting reads from all contexts but depends on none of their domain packages.

ContextWhat is read
SchedulingBookings, assignments, time ranges
PeopleMember names and roles (for labels in reports)
AircraftAircraft registration and type (for labels in reports)
TrainingFlight records and lesson counts
BillingCharge items and invoice totals

All reads happen via infrastructure read-models or repository ports, not by importing other contexts’ domain types.