# ERP_<MODULE>.md — template

Copy to the root of the customer's repo as `ERP_<MODULE>.md` (e.g. `ERP_CRM.md`). Keep every
section, in this order, even when one is empty ("none — because …"), so any agent can read any
module's file without learning a new layout. Write the content in the customer's words.

```markdown
# <What the customer calls it> — <module id>

> **Agents: before acting on this file, read `dodil://build` (or `dodil guide`, or
> https://blog.dodil.io/modules/lifecycle.md).** Start every session with Status, People and
> Change requests below — this file, not your memory, is the project's state. Changes to what is
> written here go through the change-request steps: questions → impact → yes → CR → work.
> Template v2 — sections: Status · People · Environments · Frame · Actors · Stories · Workflows ·
> Entities · Master data · Jobs · Seams · Screens · Reference diff · Change requests · Decisions.
> If any is missing, add it from https://blog.dodil.io/modules/template.md before other work.

Reference: /modules/<id>/spec.yaml v<n>

## Status
- Phase: <0–9>   Design: draft | signed off <YYYY-MM-DD> by <name>
- Live: <what is live, version, date — or "nothing yet">
- In progress: <CR-n / build step — on the test copy>
- Waiting on the customer: <question, or "nothing">
- Next step: <one line>

## People
| Who | Role in the business | Involvement | Words they use | Since |
|---|---|---|---|---|
| <name> | <owner / office manager / developer> | decides technical calls / weighs in on <process, screens, data, setup> | <"app", "the list"> | <YYYY-MM-DD> |

## Environments
| | Test copy | Live |
|---|---|---|
| Bucket | <customer>-dev | <customer> |
| App | localhost:<port> / <customer>-dev | <customer> — <url> |
| Sign-in pool | <customer>-dev | <customer> |
Local `.env` → test copy only. Live credentials: secret references in `.dodil/deploy.yaml`.

## Frame
- The system this belongs to: <customer's name for it>
- Repo: <repo>     (pool, bucket and app: see Environments)
- Reused from existing modules: <pool, bucket, business partner, ...>
- Other modules on the roadmap, in order: <...>

## Actors
| Actor | Does | Sees | Permissions |
|---|---|---|---|

## Stories
### Person
- **<ID>** · As a <actor>, I want <...>, so that <...>.
  Given <...> · When <...> · Then <...> · Screen: <...>
### System
- **<ID>** · <Trigger>, the system <...>, so that <...>.
  Given <...> · When <...> · Then <...> (incl. what happens on a re-run)
### Integration
- **<ID>** · When <...>, <...> in <other module>. Owner: <module>.

## Workflows
### <entity>
States: <...>
| From | To | Who | Gate / requires | Effect |
|---|---|---|---|---|

## Entities
| Entity | Meaning | Natural key | Key attributes | Relationships | Table |
|---|---|---|---|---|---|

## Master data
- Owns (sole writer): <entity — table>
- References: <entity — owner module — join column>

## Jobs
| Story | Trigger | What runs | Where it runs | Idempotent how |
|---|---|---|---|---|

## Seams
| Story | Other module | Owner | Rule |
|---|---|---|---|

## Screens
| Screen | Stories | Actors |
|---|---|---|

## Reference diff
- Kept: <...>
- Changed: <what, and why — in the customer's terms>
- Dropped: <...>
- Added: <...>

## Change requests
| CR | Date | Asked by | What | Touches | Status |
|---|---|---|---|---|---|
| CR-1 | <YYYY-MM-DD> | <name> | <in their words> | <S-03, Deal workflow, crm_deals.visit_at> | agreed / on test copy / live <date> |

## Decisions
- <YYYY-MM-DD> <decision> — <reason> — <who>
```
