# Transport - Segment - Delivery

## Understanding the Structure of a Transport in Dashdoc

### 1. What is a Transport?

A **Transport** is the main object in Dashdoc. It represents a **shipping operation** managed by a **single shipper** and executed by a **single carrier**.

A transport **must** :

* Always include **at least one Delivery** and **at least one Segment**.

A Transport can:

* Contain **several Deliveries** (all from the same shipper).
* Contain **several Segments** (each representing a part of the truck’s route).

***

### 2. Key Concepts

#### Delivery : What is shipped

A **Delivery** represents the path of the goods from **one origin to one destination**.\
It describes *what must be transported* for a client.

Each Delivery:

* Belongs to **one Transport**.
* Has one **origin** and one **destination**.
* Contains one or more **Loads** → the goods being shipped.

> 💡 Example: A delivery from warehouse **A** to warehouse **B** carrying 10 pallets of goods.

***

#### 🚛 Segment — How it’s shipped

A **Segment** represents the **path taken by the truck**.\
It describes *how* the deliveries are physically executed.

Each Segment:

* Has one **origin** and one **destination**.
* Specifies the **trucker**, **vehicle**, and/or **trailer license plates** assigned to that leg.
* **Always starts where the previous segment ended.**

> ⚠️ **Important:**
>
> * A single Delivery **cannot be split** across multiple Segments.
> * If multiple Deliveries are needed (e.g. multiple clients or destinations), then **multiple Segments** are required to represent each delivery leg.

***

### 3. Simple Example : One Delivery, One Segment

**Scenario:**\
A carrier ships goods from warehouse **A** to client **B** using one truck.

| Object         | Origin | Destination | Description             |
| -------------- | ------ | ----------- | ----------------------- |
| **Delivery 1** | A      | B           | Goods from A to B       |
| **Segment 1**  | A      | B           | Truck route from A to B |

Here, both the Delivery and the Segment share the same route:

* The **Delivery** holds the commercial and shipping details (client, goods, etc.).
* The **Segment** holds the operational details (driver, truck, plates, etc.).

![Simple Transport Example](https://3074350244-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LU-jgnMbbOKXxePIFGq%2Fuploads%2Fgit-blob-8ab8db8d49865e2eb52b498c059a7e44c19210f6%2FCapture%20d%E2%80%99e%CC%81cran%202018-12-18%20a%CC%80%2015.37.48.png?alt=media)

***

### 4. Complex Example : Multiple Deliveries to Different Clients

**Scenario:**\
The shipper wants to deliver goods from a warehouse **A** to **three clients** located at **B**, **C**, and **D**.\
One truck will make all deliveries in sequence.

| Stop | Description                   |
| ---- | ----------------------------- |
| A    | Shipper’s warehouse (loading) |
| B    | First delivery stop           |
| C    | Second delivery stop          |
| D    | Third delivery stop           |

#### Deliveries

| Delivery       | Origin | Destination | Description        |
| -------------- | ------ | ----------- | ------------------ |
| **Delivery 1** | A      | B           | Goods for Client 1 |
| **Delivery 2** | A      | C           | Goods for Client 2 |
| **Delivery 3** | A      | D           | Goods for Client 3 |

#### Segments

| Segment       | Origin | Destination | Description                         |
| ------------- | ------ | ----------- | ----------------------------------- |
| **Segment 1** | A      | B           | Truck drives from A to first client |
| **Segment 2** | B      | C           | Truck continues to second client    |
| **Segment 3** | C      | D           | Truck finishes at third client      |

<figure><img src="https://3074350244-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LU-jgnMbbOKXxePIFGq%2Fuploads%2Fgit-blob-ca8b58d1c8b2a4bcf3d867dbde42fb11609900c5%2FAdrien%20Draft%20board%20(2).png?alt=media" alt="Complex transport" width="563"><figcaption><p>Complex transport example</p></figcaption></figure>

🧩 **Connections:**

* **Deliveries** represent the intended paths of the goods (**A→B**, **A→C**, **A→D**).
* **Segments** represent the actual route of the truck (**A→B→C→D**).
* Each Segment starts where the previous one ends, forming a continuous trip.
* Each Delivery corresponds to one drop-off point.

***

### 5. Key Rules Summary

| Concept       | Definition                     | Rules                                                        |
| ------------- | ------------------------------ | ------------------------------------------------------------ |
| **Transport** | The overall shipping operation | Must have ≥1 Delivery and ≥1 Segment                         |
| **Delivery**  | The path of the goods (A → B)  | One origin, one destination; cannot be split                 |
| **Segment**   | The path of the truck          | One origin, one destination; continues from previous segment |
| **Loads**     | The goods to transport         | Belong to a Delivery                                         |
