# Domain Project

The [Shopfoo.Product](https://github.com/rdeneau/shopfoo/tree/main/src/Shopfoo.Product) project implements domain workflows using the V4 [Program](/safe-clean-architecture/domain-workflows/2-program.md).

Here is a simplified view from the solution explorer:

```txt
📂 src/
├──📂 Core/
│  ├──🗃️ Shopfoo.Common
│  ├──🗃️ Shopfoo.Domain.Types
│  └──🗃️ Shopfoo.Program
├──📂 Feat/
│  ├──🗃️ Shopfoo.Home
│  └──🗃️ Shopfoo.Product 👈👈
│     ├──📂 Model/
│     │  ├──📄 Product.fs       👈 Validation logic
│     │  ├──📄 Prices.fs
│     │  └──📄 Stock.fs
│     ├──📂 Workflows/
│     │  ├──📄 Prelude.fs       👈 Instructions + helpers
│     │  ├──📄 AddProduct.fs
│     │  ├──📄 DetermineStock.fs
│     │  ├──📄 MarkAsSoldOut.fs
│     │  ├──📄 RemoveListPrice.fs
│     │  ├──📄 SavePrices.fs
│     │  ├──📄 SaveProduct.fs
│     │  └──📄 ...
│     ├──📂 Data/
│     ├──📄 Api.fs
│     ├──📄 DependencyInjection.fs
│     └──📄 Manifest.fs
└──📂 UI/
   ├──🗃️ Shopfoo.Client
   ├──🗃️ Shopfoo.Server
   └──🗃️ Shopfoo.Shared
```

We will examine each part separately:

* [Domain Model](/safe-clean-architecture/domain-workflows/3-domain-workflow/0-domain-model.md) explains how the domain model is split between shared types (`Domain.Types`) and aggregates (`Model/`) following DDD principles.
* [Instructions](/safe-clean-architecture/domain-workflows/3-domain-workflow/1-instructions.md) describes how the instruction interface is defined, along with the ergonomic helpers for composing programs.
* [Workflows](/safe-clean-architecture/domain-workflows/3-domain-workflow/2-workflows.md) presents how to write domain workflows by analyzing typical use cases, including parallel execution and workflow cancellation with undo (saga pattern).
* [Data](/safe-clean-architecture/domain-workflows/3-domain-workflow/3-data.md) indicates a way to organize the data access layer, whether it is to access a database or call an external API.
* [Api](/safe-clean-architecture/domain-workflows/3-domain-workflow/4-api.md) describes how to define the project entry point, wire instructions to the data layer with undo strategies, and run workflows through the saga runner.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://rdeneau.gitbook.io/safe-clean-architecture/domain-workflows/3-domain-workflow.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
