# MVP-TASK-027 — Sales exclusions and restart persistence

**Status:** In progress  
**Parent:** MVP-SALES-001-S05–S07, S09

## Objective and required behavior

Prove non-commercial, failed, and unknown checkouts add no sales; fulfillment changes add/remove
nothing; reload/process restart reconstructs today's figures from durable data.

## Scope, areas, and non-goals

Expected aggregation policy/integration/E2E or Docker restart evidence. No offline caching, external
reconciliation, refunds, or session-local fallback presented as authoritative.

## Evidence and acceptance

Use all four IDs in integration plus representative journey/restart evidence. Accept when every
excluded/change/restart path is deterministic and no double count occurs, traceability is current,
and inherited DoD passes. Handoff notes what restart layer was actually verified.

## Implementation evidence

- `postgres-order-repository.integration.test.ts` carries all four scenario IDs in one real-
  PostgreSQL case. It establishes a confirmed baseline, proves a persisted non-commercial order and
  both rejected and unknown checkout outcomes leave that baseline unchanged, then exercises every
  forward and backward fulfillment transition through delivery without changing the aggregate.
- The integration case closes its repository and connection pool, constructs a fresh repository, and
  reads the exact same gross and product count twice. This proves reconstruction from durable
  PostgreSQL facts and guards against process-local reset or double counting; it is a repository/
  pool restart, not a whole-container or operating-system process restart.
- `kds.spec.ts` proves a non-commercial finalization leaves the authenticated sales response byte-
  equivalent and a confirmed sale remains exact after a browser reload in both desktop and mobile
  Chromium. The full Docker run executes those same journeys through the packaged stack after its
  backend lifecycle stop/start check. A data-bearing whole-process restart remains deliberately
  assigned to MVP-TASK-032.
