feat(export): send reviewed positions to the ERP (contract 1.1.0) (#46) - #54
Merged
Merged
Conversation
… position values block approval (#46, test-first) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01DJ5vaKvTYiMvdngT4d3xo1
Adds the optional lineItems array to the ERP contract, builds it from the latest run's positions with item corrections, and refuses the approval when a position value, the position count or the body size would break the contract. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01DJ5vaKvTYiMvdngT4d3xo1
…r stale item corrections (#46 review) Too many positions or a too large body cannot be fixed by a correction, so the clerk gets export_too_large instead of value_too_long. The export test now checks the refusal codes and that the exported positions equal what the review shows after a newer run. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01DJ5vaKvTYiMvdngT4d3xo1
Owner
Author
Frischer Review (read-only Subagent) – Ergebnis und UmgangNichts blockierend. Geprüft: Export = Prüfansicht (gleicher Lauf, gleiche Reihenfolge, gleiche Korrekturregel), deterministischer Body bei Retries, Exactly-once unverändert (Row-Lock, Export-Zeile, Idempotency-Key), Vertrag yaml = zod = Typen, Mock validiert mit dem gemeinsamen
Generated by Claude Code |
Fluory
marked this pull request as ready for review
September 24, 2026 11:19
…items-46 # Conflicts: # CHANGELOG.md
8 of 15 tasks
4 tasks done
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Warum
Fixes #46 · Bisher bekam das ERP nur die Kopfdaten (Firma, Ansprechperson, Liefertermin) – die geprüften Positionen fehlten. Ohne Positionen ist der Export für ein echtes Angebot wertlos.
Arbeitsstand
/v2.lineItems, Grenzprüfung bei der Freigabe, Tests (test-first), Doku, CHANGELOG, frischer Review eingearbeitet (eigener Ablehnungscodeexport_too_large, Test gegen veraltete Korrekturen),verifygrün.Was ist passiert (Klartext)
Das ERP bekommt jetzt nicht nur „wer fragt an und bis wann“, sondern auch „was genau“: jede Position mit Beschreibung, Menge, Einheit, Werkstoff und Maßen – so, wie die Sachbearbeitung sie geprüft und ggf. korrigiert hat. Der Vertrag mit dem ERP wird dafür nur erweitert (Version 1.1.0): Anfragen ohne Positionen sehen exakt aus wie vorher, ein alter Empfänger merkt also nichts. Ist ein Wert zu lang, sind es mehr als 200 Positionen oder würde die Nachricht zu groß, wird die Freigabe verweigert – dann kann die Sachbearbeitung noch korrigieren. Nichts wird stillschweigend abgeschnitten. Hat eine Anfrage mehr als 200 Positionen, sagt die Meldung ehrlich, dass sie zu groß für den Export ist und direkt im ERP erfasst werden muss.
Plan-Pflicht (SYSTEM.md §4)
Impact Manifest
export(Vertrag, Payload, Job-Deps),review(currentLineItemValues, Freigabeprüfung),worker(Verdrahtung).contracts/erp-export.openapi.yaml1.0.0 → 1.1.0: optionaleslineItems(1–200 ×LineItem{position ≥ 1, description, quantity, unit, material, dimensions: string|null ≤ 500},additionalProperties: false). Keine Migration.ExportDepsbekommtlineItemValues(intern).export.test(Positionen mit Korrektur, keinlineItemsohne Positionen,value_too_longbei überlangem Positionswert,export_too_largebei 201 Positionen, Export = Prüfansicht nach neuerem Lauf), Unitpayload.test.ts(Grenzen: Feld, Anzahl, Body-Größe), Drift-Tests des Vertrags.Geändert
contracts/erp-export.openapi.yaml,src/features/export/erp-export.contract.ts(generiert),contract.ts:LineItem,lineItemssrc/features/export/payload.ts:toLineItems,ERP_LIMITS,exportLimitViolationsmit Positionen und Body-Schätzung,buildQuoteRequestmitlineItemValuessrc/features/export/export-job.ts,index.ts,src/worker.ts: Verdrahtungsrc/features/review/review.ts:currentLineItemValues, Grenzprüfung inapproveRequest(value_too_long/export_too_large)src/app/requests/[id]/messages.ts: Meldung fürexport_too_largetests/integration/export.test.ts, neusrc/features/export/payload.test.ts, Deps induplicates/request-list/log-privacydocs/technical/api.md,CHANGELOG.mdNachweis (SYSTEM.md §11)
verify:changed: grün –export.test11/11 (Mutationsprobe: ohne die Laufregel rot),payload.test.ts5/5verify: grün nach den Review-Änderungen – unit 159, integration 118 (lint, typecheck, unit, integration gegen Postgres + S3, depcruise, build, audit high)verify:full/ E2E-Spec: nicht betroffen (keine UI-Änderung außer einem Meldungstext)Doku-Entscheidung (genau eine)
docs/technical/api.md[Unreleased](sichtbares Feature oder Verhalten – im selben PR, nie „später")Entferntes oder Umbenanntes:
docs/+ README gegrept, Treffer bereinigt: nichts entferntDateigrößen und neue Bausteine (SYSTEM.md §7)
Dateien über 500 Zeilen im Diff (Ausnahmen: generierter Code, Lockfiles, Fixtures, Migrationen, Schemas, Ressourcen, Doku, Konfiguration):
Über 800 Zeilen mit neuer Fachlogik oder über 1000 Zeilen (P1/P2): nicht betroffen
Neue Shared-Komponente, Utility-Datei, Adapter oder fachlicher Service:
Subagent-Einsätze
Risiken / offene Punkte
ExportDeps.lineItemValuesist Pflicht: Worker und alle Test-Deps sind angepasst.🤖 Generated with Claude Code
https://claude.ai/code/session_01DJ5vaKvTYiMvdngT4d3xo1