# Release Hardening v59

## Scope

v59 begins the production-readiness hardening phase. It deliberately adds no
new commercial feature.

### 1. Printing management route security

Every user-facing `/api/v1/printing/*` route must pass through:

- `auth:sanctum`
- `ResolveTenant`
- `EnsureTenantMembership`
- `ResolveOrganizationScope`
- its existing `RequirePermission`

Agent machine endpoints remain separate under `/api/v1/agent/printing/*` and
continue to use the agent-secret authentication contract.

### 2. Sale payment / Accounts Receivable integrity

`SalePaymentStatusUpdater` is now credit-aware.

Coverage is:

`captured payments + sale-linked credit charges`

This prevents a later payment-status refresh from incorrectly downgrading:

- `on_account` → `unpaid`
- `partially_on_account` → `unpaid/partial`

Credit remains Accounts Receivable, not a synthetic payment.

Unknown external payment outcomes still take precedence and keep the sale in
`pending_payment`.

### 3. Canonical status calculation

`ChargeSaleToCreditAction` delegates final status calculation to
`SalePaymentStatusUpdater` rather than maintaining a second copy of the status
algorithm.

## Explicitly not included

- Real thermal printer hardware validation.
- Production infrastructure/deployment.
- Agent-to-printer ownership assignment.
- DPAPI encryption for the local Agent token.
- End-to-end Web POS browser testing.

Those remain release-hardening work, not new feature work.
