> ## 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.

# CargoWise mirror

> Understand the full current-state model used for advanced CargoWise consultation.

`cargowise_mirror` turns source evidence into current business records and explicit relationships.

Use [Reporting](/analytics/reporting) for normal reports, Power BI, exports, and reusable SQL. Use the
mirror when a complex consultation needs a root, detail, or relationship that reporting does not
expose.

## When to use the mirror

The mirror includes consols, bookings, operational shipment details, documents, air waybill data,
and other structures outside the smaller reporting contract.

<Warning>
  Direct mirror queries must select the active generation and preserve each table's grain and
  ownership rules. Internal table shapes can change as CargoWise projection support grows.
</Warning>

## Business records

The mirror has four roots: shipments, consols, bookings, and one-off quotes. Detail tables can
belong to one supported root. Bridge tables keep relationships proven by CargoWise data.

<Accordion title="Complete mirror table inventory">
  ### Roots

  | Table            | Business object |
  | ---------------- | --------------- |
  | `shipments`      | Shipment        |
  | `consols`        | Consol          |
  | `bookings`       | Booking         |
  | `one_off_quotes` | One-off quote   |

  ### Details

  | Family              | Tables                                                                                                                                                                                                                                                        |
  | ------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
  | Common details      | `charges`, `charge_rating_bases`, `dates`, `milestones`, `parties`, `party_registration_numbers`, `packing_lines`, `containers`, `container_penalties`, `dangerous_goods`, `transport_legs`, `emissions`, `documents`, `business_references`, `custom_fields` |
  | Shipment operations | `shipment_notes`, `shipment_carriage_stages`, `shipment_instructions`, `shipment_instruction_containers`, `shipment_instruction_packing_lines`, `shipment_instruction_confirmations`                                                                          |
  | Air waybill details | `air_waybills`, `air_waybill_rate_lines`, `air_waybill_other_charges`, `air_waybill_screening_methods`                                                                                                                                                        |

  ### Relationships

  | Table                     | Relationship              |
  | ------------------------- | ------------------------- |
  | `consol_shipments`        | Consol to shipment        |
  | `quote_bookings`          | Quote to booking          |
  | `quote_shipments`         | Quote to shipment         |
  | `packing_line_containers` | Packing line to container |
</Accordion>

The mirror does not create a relationship from matching names, dates, routes, or amounts.

## Identity and completeness

| Field             | Values                       | Meaning                                                        |
| ----------------- | ---------------------------- | -------------------------------------------------------------- |
| `identity_status` | `stable`, `source_event`     | Stable business identity or identity limited to a source event |
| `data_status`     | `complete`, `reference_only` | Complete body or identity and relationship evidence only       |

## Generations

| Status     | Meaning                                                                     |
| ---------- | --------------------------------------------------------------------------- |
| `building` | A historical rebuild is writing a separate generation                       |
| `ready`    | The generation finished and passed the required checks                      |
| `active`   | Reporting reads this generation. Only one can be active for an organization |
| `retired`  | A previous generation was replaced after a safe switch                      |
| `failed`   | The generation failed and does not become the source for normal reports     |

## Unknown data

Unknown XML evidence remains in `source_data`. Scalar values can still appear through
`reporting.source_fields`. Structured data stays in the source layer until the mirror and reporting
contract support it.

<Note>
  The mirror reserves `unmapped_fields` and `unmapped_items` for coverage tracking. Source data
  remains the durable evidence for unsupported XML.
</Note>

Coverage checks flag business paths and collections without an approved mirror destination.
Unknown data does not become a guessed field or relationship.

Next, read [Reporting](/analytics/reporting) for the smaller model used by normal reports.
