# Domain Model — {{Product Name}}

> *This is the conceptual heart of the project. Every Forge agent references this document to understand the business domain. It uses the Ubiquitous Language of the business — the same terms domain experts use.*
>
> *Last updated: {{date}}*

---

## Product Vision

{{2-3 sentences describing what the product is, who it's for, and what problem it solves. In the user's own words. Keep this authentic — it's the north star.}}

---

## Bounded Contexts

### {{Context Name}}

**Purpose**: {{What this context is responsible for}}

**Key Entities**: {{List of primary entities in this context}}

**Relationships to other contexts**:
- {{How this context interacts with other contexts}}

<!--
Repeat for each bounded context.

Common contexts for business software:
- Core domain (the thing that makes this product unique)
- Supporting domains (necessary but not differentiating)
- Generic domains (common across many businesses — auth, billing, notifications)

Keep it to 3-5 contexts for a starting domain model. You can always split later.
-->

---

## Entities

### {{Entity Name}}

- **Context**: {{Which bounded context this belongs to}}
- **Description**: {{What this is in business terms — not technical terms}}
- **Key Properties**:
  - {{Property}}: {{What it represents}}
  - {{Property}}: {{What it represents}}
- **Relationships**:
  - {{Relationship description — e.g., "A Tour contains 1..n Stopps"}}
- **Business Rules**:
  - {{Constraint that applies to this entity}}
- **Lifecycle**: {{Created when... → Modified when... → Completed/Archived when...}}

<!--
Repeat for each entity.

Tips:
- Properties are conceptual, not a database schema. "Gewicht" not "weight_kg DECIMAL(10,2)"
- Only include properties that matter for understanding the domain
- Lifecycle helps understand state transitions
- Business rules attached to specific entities are easier to enforce than global rules
-->

---

## Business Rules

<!--
Numbered list of domain constraints. Each rule should be:
- Written in plain language
- Referencing specific entities
- Stating what must be true (invariant) or what must happen (process rule)
-->

1. {{Rule in plain language — e.g., "A Tour's total Gewicht must not exceed the assigned Fahrzeug's Gewichtslimit."}}
2. {{Rule — e.g., "A Fahrer cannot be assigned to overlapping Tours."}}
3. {{Rule — e.g., "When a Tour is completed, a Frachtbrief must be generated for each Auftrag in the Tour."}}

---

## Domain Events

<!--
Key events that happen in the domain. Show the main flow and important side flows.
Format: EventName — what triggers it → what it causes
-->

### Core Flow

1. **{{EventName}}** — {{trigger}} → {{consequence}}
2. **{{EventName}}** — {{trigger}} → {{consequence}}
3. **{{EventName}}** — {{trigger}} → {{consequence}}

### Side Flows

- **{{EventName}}** — {{trigger}} → {{consequence}}

---

## Ubiquitous Language

<!--
The shared vocabulary. Use the terms the business actually uses.
If the domain is German, keep German terms.
Every entity, event, and rule above should use terms from this glossary.
-->

| Term | Definition | Context |
|------|-----------|---------|
| {{Term}} | {{Clear definition in plain language}} | {{Bounded Context}} |

---

## Open Questions

<!--
Things that came up during domain discovery but aren't resolved yet.
These are prompts for future exploration, not blockers.
-->

- {{Question or area that needs deeper exploration}}
- {{Ambiguity that needs clarification from domain experts or users}}

---

## Revision History

<!--
Track significant changes to the domain model.
Not every edit — just meaningful evolutions.
-->

| Date | Change | Trigger |
|------|--------|---------|
| {{date}} | Initial domain model created | `/forge:init` |
