Implement FIN-WP-0006-T01 settlement statement join; mark FIN-WP-0004/0005 blocked
All checks were successful
CI Smoke / host-smoke (push) Successful in 0s
CI Smoke / container-smoke (push) Successful in 6s

Add SettlementStatement schema and a dedicated settlement_statements store
(ingest_settlement_statement, current_settlement_statements) so
resource-control internal transfer settlements join as a referenced
projection without ever entering the booked-cost ledger. exchange_health
now surfaces a current statement with payment_recognition=unknown as a
settlement_awaiting_payment_join residual instead of booked cost. Adds
CLI commands finhub ledger ingest-settlement / settlements.

FIN-WP-0006-T01 is done; the workplan is finished.

Reviewed all other open workplans for closeable work: FIN-WP-0004's only
remaining task (T05) waits on an external provider fact from
resource-control, and every FIN-WP-0005 task waits on operator/Steuerbüro
confirmation or a non-production DATEV tenant. Neither has actionable
in-repo work right now, so both move to status: blocked.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>

Assistant: claude-code
Assistant-Model: sonnet
Assistant-Process: 242919@bnt-lap001
Assistant-Session: 286d235a-1654-40ff-b8fd-eee4e2ff9ea6
This commit is contained in:
tegwick 2026-09-27 21:50:54 +02:00
parent 4ef6fec8ff
commit 91d62f6430
8 changed files with 377 additions and 8 deletions

View file

@ -4,12 +4,12 @@ type: workplan
title: "Establish the resource cost evidence contract"
domain: infotech
repo: fin-hub
status: active
status: blocked
flavor: implementation
owner: codex
topic_slug: financials
created: "2026-08-10"
updated: "2026-08-15"
updated: "2026-09-27"
related:
- FIN-WP-0001
- RESOURCE-WP-0002
@ -208,6 +208,13 @@ reconciles as usage present, `missing_booked_fact: true`,
`docs/evidence/fin-wp-0004-t05-commissioning-2026-08.md`. T05 still
waits on the first Scaleway charge or credit (expected 2026-09).
Status 2026-09-27: reviewed the workplan for closeable work. T05 is the
only open task and remains genuinely blocked on an external event (the
first real `platform:audit-storage` provider charge or credit) that
resource-control has not yet published; there is no remaining code or
contract work in this repo to advance it. Set workplan `status: blocked`
to reflect that nothing here is actionable until that fact arrives.
## T06 — Generalize and operate the contract
```task

View file

@ -4,12 +4,12 @@ type: workplan
title: "DATEV accounting adapter operations"
domain: financials
repo: fin-hub
status: active
status: blocked
flavor: implementation
owner: codex
topic_slug: financials
created: "2026-08-11"
updated: "2026-08-11"
updated: "2026-09-27"
related:
- FIN-WP-0002
state_hub_workstream_id: "58432770-da19-5b72-a946-cacbe1eb24ca"
@ -31,7 +31,7 @@ invoice numbers, execute payments, or perform bookkeeping.
```task
id: FIN-WP-0005-T01
status: todo
status: wait
priority: high
state_hub_task_id: "7cdda85d-cdd6-544c-b873-f27ec7ef448d"
```
@ -42,6 +42,13 @@ retention policy, correction procedure, and required structured fields.
Record which capabilities use Qonto's managed DATEV services and which require
a direct DATEV integration. Route credentials only after this selection.
Status 2026-09-27: reviewed for closeable work. T01 requires a live
confirmation from the operator and Steuerbüro (plan/tenant selection,
master-data ownership, retention and correction policy) that no in-repo
change can substitute for; set to `wait` pending that conversation. T02-T04
already wait on T01 and a non-production DATEV tenant, so no task in this
workplan is actionable from the repo alone right now.
## Implement the selected transport
```task

View file

@ -4,12 +4,12 @@ type: workplan
title: "Consume resource-control internal transfer settlement"
domain: financials
repo: fin-hub
status: proposed
status: finished
flavor: residual
owner: codex
topic_slug: financials
created: "2026-08-14"
updated: "2026-08-14"
updated: "2026-09-27"
related:
- FIN-WP-0004
- RESOURCE-WP-0005
@ -43,7 +43,7 @@ Origin: `RESOURCE-WP-0005-T07`. Terms live in
```task
id: FIN-WP-0006-T01
status: todo
status: done
flavor: residual
priority: high
state_hub_task_id: "9ef3fab5-51a6-57ef-8121-b9714298c502"
@ -57,3 +57,23 @@ a provider invoice.
Done when an inbound fixture can be stored as a referenced projection
and `exchange_health` shows statements lacking a payment join as a
visible residual, not as booked cost.
Completed 2026-09-27: added `SettlementStatement`
(`src/fin_hub/schemas/exchange.py`) matching resource-control's v0.1
`settlement-statement.schema.json`, with a dedicated
`settlement_statements` table (`services/exchange.py`) that never touches
`ledger_entries`. `ingest_settlement_statement` validates and stores each
statement keyed by `financial_entity_id` + `procuring_entity_id` + `period`
+ `statement_date`, idempotent on identical resubmission, and superseding
the prior current statement for the same entity/period pair on a later
`statement_date`. `exchange_health` now emits
`settlement_awaiting_payment_join` (severity `warning`) for any current
statement with `payment_recognition: "unknown"`, listing its outstanding
amount as a residual rather than booked cost.
`current_settlement_statements` exposes the stored projection for
reporting. CLI: `finhub ledger ingest-settlement` and
`finhub ledger settlements`. Fixture:
`tests/fixtures/settlement-statement-2026-08.json`. Tests:
`tests/test_exchange.py::test_settlement_statement_*` and
`::test_exchange_health_surfaces_settlement_without_payment_join_as_residual`.
Full suite: 102 passed.