> ## Documentation Index
> Fetch the complete documentation index at: https://docs.jaantonio.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Data model

> Understand reporting roots, detail ownership, relationships, and collection updates.

The reporting model has two roots:

| Root             | Grain                     | Primary join key |
| ---------------- | ------------------------- | ---------------- |
| `shipments`      | One current shipment      | `shipment_id`    |
| `one_off_quotes` | One current one-off quote | `quote_id`       |

## Detail ownership

A root can have many charges, dates, parties, milestones, packing lines, and other details. Each
detail stays in its own view and carries its root ID.

For example, several `shipment_charges` rows can share one `shipment_id`. They are separate charges,
not duplicate shipments.

## Relationship views

Analytics publishes a relationship only when the CargoWise source supports it.

| View               | Relationship               |
| ------------------ | -------------------------- |
| `shipment_consols` | Shipment to consol context |
| `quote_shipments`  | Quote to shipment          |
| `quote_bookings`   | Quote to booking           |

There is no standalone reporting root for a consol or booking. The relationship views provide the
supported link and context. A missing row means the source did not prove the relationship.

## Collection updates

| CargoWise content | Analytics behavior                                             |
| ----------------- | -------------------------------------------------------------- |
| Partial           | Add or update the observed rows. Keep rows that were not sent. |
| Complete          | Replace the current rows for that collection.                  |
