Skip to content

feat: rework BO Vertrag (draft for AG)#1087

Draft
lord-haffi wants to merge 4 commits into
feat/bo-produkt-tarif-comfrom
feat/bo-vertrag-rework
Draft

feat: rework BO Vertrag (draft for AG)#1087
lord-haffi wants to merge 4 commits into
feat/bo-produkt-tarif-comfrom
feat/bo-vertrag-rework

Conversation

@lord-haffi

Copy link
Copy Markdown
Collaborator

Draft — second of two PRs for the new Vertrag/Produkt model (AG HackMD spec). Stacked on #1086 (feat/bo-produkt-tarif-com); review/merge that first. The diff here is only the Vertrag rework.

Changes

  • BO Vertrag: renamed vertragspartner1/vertragspartner2vertragsaussteller/vertragsempfaenger; removed the Unterschrift lists (unterzeichnervp1/unterzeichnervp2); added vertragsabschluss_datum, kuendigungsgrund, and produkt (references the new BO Produkt).
  • Removed BO Buendelvertrag and COM Unterschrift (source + tests + discriminators BoTyp.BUENDELVERTRAG, ComTyp.UNTERSCHRIFT). A bundle is now modelled as a Vertrag with Vertragsart.BUENDELVERTRAG + multiple vertragsteile.
  • ENUM Vertragsstatus reduced from 9 to 4 (AKTIV, GEKUENDIGT, STORNIERT, WIDERRUFEN). The Angebot-phase states drop (they belong to Angebot); BEENDET drops (an active contract with vertragsende expresses the same).
  • COM Vertragsteil: lokation: strlokationszuordnung: Optional[Lokationszuordnung] (embedded BO).
  • COM Vertragskonditionen: removed vertragslaufzeit; anzahl_abschlaege Decimalint.

Verification

  • pytest: 109 passed
  • pylint src/bo4e: 10.00/10 · mypy: clean (282 files)
  • pre-commit (black 25.1.0, isort): passed
  • JSON-schema generate + validate: both exit 0

Open questions for the AG

  1. Breaking removals/reductions: BoTyp.BUENDELVERTRAG, ComTyp.UNTERSCHRIFT, Vertragsstatus 9→4.
  2. STORNIERT/WIDERRUFEN docstrings attribute the action (durch den Vertragsaussteller / Vertragsempfänger) — please confirm.
  3. AKTIV ("Beendigung wird über das Vertragsende modelliert"): confirm end-of-contract is modelled via vertragsende (no BEENDET), coexisting with GEKUENDIGT + the new kuendigungsgrund.
  4. Vertragsteil now embeds a full Lokationszuordnung (heavier payload) — acceptable vs. an id reference?
  5. kuendigungsgrund as a free str vs. a future enum.

Incidental / discovered

tests/test_adresse.py is a pre-existing mis-named file that actually contains a TestVertrag class (not Adresse tests). It was updated to mirror the Vertrag rename so the suite stays green. Renaming it — and whether COM Adresse has real test coverage — is left as a separate cleanup.

Out of scope

BO Produkt and the TarifCOM degradation are in #1086.

…schluss_datum, add kuendigungsgrund and produkt
…ertragskonditionen (drop vertragslaufzeit, anzahl_abschlaege -> int)
… drop migration note from schema description
@lord-haffi lord-haffi self-assigned this Jul 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant