dodil/erp-brick-pos

DODIL ERP brick: point of sale

README.md

erp-brick-pos - Point of sale (shops and tills)

Sell over the counter in every shop: open the till with a float, ring up drinks and food, take cash or card, print a receipt, and at closing count the drawer blind with a second person for any difference, while stock, books and bank catch up from pending rows.

A brick on erp-platform (>=0.9.13, <0.10), built from the signed pos module spec v1 (erp-method modules/pos). Version 0.2.0 is slices A and B: the session and the sale, then closing the day, void and refund, vouchers and card timeouts, recipes, the register snapshot and the shop setup checks. What is built and what is left is in AGENTS.md.

src/brick_pos/
  domain/          the rules, plain Python: session.py, receipt.py, pricing.py, refund.py, voucher.py, recipe.py, snapshot.py, journal.py, deposit.py, outbox.py, money.py, businessday.py, values.py
  application/     the use cases, each declared once and served as an API route AND an MCP tool (+ process.yaml, the signed workflows)
  infrastructure/  tables.py (the tables and their repositories), seams.py (product, tax, inventory, gl, payments, manufacturing: one adapter each)
  roles.yaml       the default roles (module.yaml actors, permission for permission)
  schema.sql, migrations/{00001_init,00002_slice_b}/{up,down}.sql      journal `pos_schema_migrations`; scripts/gen_schema.py writes them from tables.py
tests/             stories, invariants, domain, seams (contract-checked against the callees' specs), doors, budget, process, schema
python3 -m venv .venv && .venv/bin/pip install -e ../erp-platform -e '.[test]'
.venv/bin/pytest -q --tb=short            # no bucket needed; needs ../erp-method (or ERP_METHOD_DIR)
BUCKET=my-bucket erp-migrate --schema src/brick_pos/schema.sql --brick pos=0.2.0

GET /process/bpmn serves the signed process; tests/test_process.py holds it equal to the spec and to the signed hashes.