diff --git a/internal/legal/contractdocs/contractdocs.go b/internal/legal/contractdocs/contractdocs.go index a48807f..2a72a2d 100644 --- a/internal/legal/contractdocs/contractdocs.go +++ b/internal/legal/contractdocs/contractdocs.go @@ -53,14 +53,16 @@ type Doc struct { // released is the table of released documents, in the order the overview // lists them. Title is the title shown in the portal (the Plattform LB's PDF // is headed "Leistungsbeschreibung Breakpilot"). AGB and TOM were released by -// the owner on 16.11.2026 (AGB SaaS AS06 and TOM AS08, each byte for byte as in -// its release record FREIGABE_1.0.0.json). Not released yet (on hold; add it -// here with its PDF once it is): -// -// {ID: "avv", Kind: KindAVV, Title: "Auftragsverarbeitungsvertrag", Version: "1.0.0", Date: "TT.MM.JJJJ", File: "Breakpilot_AVV_1.0.0.pdf", SHA256: "…"}, +// the owner on 16.11.2026 (AGB SaaS AS06 and TOM AS08), the AVV on 19.11.2026 +// (AS06: no signature block, it is concluded with the main contract), each +// byte for byte as in its release record FREIGABE_1.0.0.json. The AVV is the +// master with blank lines for the customer's details; a workspace's own filled +// AVV takes its place in that workspace's overview. var released = []Doc{ {ID: "agb", Kind: KindAGB, Title: "Allgemeine Geschäftsbedingungen", Version: "1.0.0", Date: "09.11.2026", File: "Breakpilot_AGB_SaaS_1.0.0.pdf", SHA256: "7014a6fb5d0386f07df6a50162af3eea68196e1f585ea6c80414f018f03bc40e"}, + {ID: "avv", Kind: KindAVV, Title: "Auftragsverarbeitungsvertrag", Version: "1.0.0", Date: "17.11.2026", + File: "Breakpilot_AVV_1.0.0.pdf", SHA256: "623aa518fdaaa3c8a7e5aa2f15a97ac3b853c8d49d83e41f371b8cf2370a4040"}, {ID: "tom", Kind: KindTOM, Title: "Technische und organisatorische Maßnahmen", Version: "1.0.0", Date: "09.11.2026", File: "Breakpilot_TOM_1.0.0.pdf", SHA256: "71eb02c884329facf16b8f98e247d579fe17c072e6736b6397d3bfa0952516b9"}, {ID: "lb-plattform", Kind: KindLB, Title: "Leistungsbeschreibung Breakpilot Plattform", Version: "1.0.0", Date: "06.11.2026", diff --git a/internal/legal/contractdocs/contractdocs_test.go b/internal/legal/contractdocs/contractdocs_test.go index f8a63df..b465994 100644 --- a/internal/legal/contractdocs/contractdocs_test.go +++ b/internal/legal/contractdocs/contractdocs_test.go @@ -28,11 +28,11 @@ func TestCommittedDocumentsMatchTheirPins(t *testing.T) { } } -// The released set as of 16.11.2026: AGB and TOM, then the seven -// Leistungsbeschreibungen; the AVV master is not released yet. +// The released set as of 19.11.2026: AGB, AVV (the master) and TOM, then the +// seven Leistungsbeschreibungen. func TestReleasedSet(t *testing.T) { want := map[string]string{ - "agb": "1.0.0", "tom": "1.0.0", + "agb": "1.0.0", "avv": "1.0.0", "tom": "1.0.0", "lb-plattform": "1.0.0", "lb-pruefwerk": "1.0.3", "lb-werkpilot": "1.0.0", "lb-firmwerk": "1.0.0", "lb-werkmeister": "1.0.0", "lb-managed-git": "1.0.0", "lb-build-runner": "1.0.0", } @@ -42,7 +42,8 @@ func TestReleasedSet(t *testing.T) { } for _, d := range all { lb := d.Kind == KindLB && strings.HasPrefix(d.Title, "Leistungsbeschreibung ") - top := (d.ID == KindAGB || d.ID == KindTOM) && d.Kind == d.ID && d.Title == Title(d.Kind) && d.Date == "09.11.2026" + stand := map[string]string{KindAGB: "09.11.2026", KindAVV: "17.11.2026", KindTOM: "09.11.2026"}[d.ID] + top := stand != "" && d.Kind == d.ID && d.Title == Title(d.Kind) && d.Date == stand if want[d.ID] != d.Version || (!lb && !top) { t.Errorf("%+v", d) } @@ -50,11 +51,11 @@ func TestReleasedSet(t *testing.T) { t.Errorf("get %s", d.ID) } } - if all[2].Title != "Leistungsbeschreibung Breakpilot Plattform" { - t.Errorf("platform title %q", all[2].Title) + if all[3].Title != "Leistungsbeschreibung Breakpilot Plattform" { + t.Errorf("platform title %q", all[3].Title) } - if all[0].ID != "agb" || all[1].ID != "tom" || all[2].ID != "lb-plattform" || Default().Get("avv") != nil || Default().Get("lb-pruefwerk").Date != "09.11.2026" { - t.Error("order, absent AVV or Stand") + if all[0].ID != "agb" || all[1].ID != "avv" || all[2].ID != "tom" || all[3].ID != "lb-plattform" || Default().Get("lb-pruefwerk").Date != "09.11.2026" { + t.Error("order or Stand") } } @@ -71,13 +72,13 @@ func TestApplicability(t *testing.T) { h Holdings want string }{ - "nothing booked": {Holdings{}, "agb,tom,lb-plattform"}, - "pruefwerk": {Holdings{Products: map[string]bool{"pruefwerk": true}}, "agb,tom,lb-plattform,lb-pruefwerk"}, + "nothing booked": {Holdings{}, "agb,avv,tom,lb-plattform"}, + "pruefwerk": {Holdings{Products: map[string]bool{"pruefwerk": true}}, "agb,avv,tom,lb-plattform,lb-pruefwerk"}, "all products": {Holdings{Products: map[string]bool{"pruefwerk": true, "werkpilot": true, "firmwerk": true, "werkmeister": true, "compliance": true}}, - "agb,tom,lb-plattform,lb-pruefwerk,lb-werkpilot,lb-firmwerk,lb-werkmeister"}, - "managed git": {Holdings{ManagedServices: map[string]bool{"git": true}}, "agb,tom,lb-plattform,lb-managed-git"}, - "git and runner": {Holdings{ManagedServices: map[string]bool{"git": true, "ci-runner": true}}, "agb,tom,lb-plattform,lb-managed-git,lb-build-runner"}, - "service named as product": {Holdings{Products: map[string]bool{"git": true}}, "agb,tom,lb-plattform"}, + "agb,avv,tom,lb-plattform,lb-pruefwerk,lb-werkpilot,lb-firmwerk,lb-werkmeister"}, + "managed git": {Holdings{ManagedServices: map[string]bool{"git": true}}, "agb,avv,tom,lb-plattform,lb-managed-git"}, + "git and runner": {Holdings{ManagedServices: map[string]bool{"git": true, "ci-runner": true}}, "agb,avv,tom,lb-plattform,lb-managed-git,lb-build-runner"}, + "service named as product": {Holdings{Products: map[string]bool{"git": true}}, "agb,avv,tom,lb-plattform"}, } { if got := ids(c.h); got != c.want { t.Errorf("%s: %s, want %s", name, got, c.want) diff --git a/internal/legal/contractdocs/files/Breakpilot_AVV_1.0.0.pdf b/internal/legal/contractdocs/files/Breakpilot_AVV_1.0.0.pdf new file mode 100644 index 0000000..806183f Binary files /dev/null and b/internal/legal/contractdocs/files/Breakpilot_AVV_1.0.0.pdf differ diff --git a/internal/server/contract_documents_test.go b/internal/server/contract_documents_test.go index 392029c..0b105bb 100644 --- a/internal/server/contract_documents_test.go +++ b/internal/server/contract_documents_test.go @@ -61,8 +61,8 @@ func docIDs(docs []contractDocument) string { return strings.Join(ids, ",") } -// A synthetic catalogue with a released AVV master, for what the committed -// table does not hold yet. +// A synthetic catalogue with an AVV master and one Leistungsbeschreibung, so +// the AVV paths are tested apart from the committed table. func catalogueWithAVV() (*contractdocs.Catalogue, []byte) { avv := []byte("%PDF-1.7 synthetic AVV master") lb := []byte("%PDF-1.7 synthetic platform LB") @@ -141,15 +141,18 @@ func TestContractDocuments_leistungsbeschreibungen(t *testing.T) { ctx := context.Background() // The seed tenant has Prüfwerk and Firmwerk booked. v, _ := f.contracts(t) - // AGB and TOM (released 16.11.2026) come first for every workspace. - if got := docIDs(v.Documents); got != "agb,tom,lb-plattform,lb-pruefwerk,lb-firmwerk" { + // AGB, AVV master and TOM come first for every workspace. + if got := docIDs(v.Documents); got != "agb,avv,tom,lb-plattform,lb-pruefwerk,lb-firmwerk" { t.Fatalf("documents: %s", got) } + if a := v.Documents[1]; a.TenantSpecific || a.Version != "1.0.0" || a.Date != "17.11.2026" || a.SHA256 != contractdocs.Default().Get("avv").SHA256 { + t.Errorf("avv master: %+v", a) + } // With the TOM listed, the TOMs are available rather than pending. if v.TOMs.Status != "available" { t.Errorf("toms status %q", v.TOMs.Status) } - pw := v.Documents[3] + pw := v.Documents[4] if pw.Kind != "lb" || pw.Version != "1.0.3" || pw.Date != "09.11.2026" || pw.Product != "pruefwerk" || pw.TenantSpecific || pw.SHA256 != contractdocs.Default().Get("lb-pruefwerk").SHA256 || pw.Title != "Leistungsbeschreibung Prüfwerk" { t.Errorf("pruefwerk: %+v", pw) @@ -166,11 +169,11 @@ func TestContractDocuments_leistungsbeschreibungen(t *testing.T) { } } v, _ = f.contracts(t) - if got := docIDs(v.Documents); got != "agb,tom,lb-plattform,lb-pruefwerk,lb-werkpilot,lb-firmwerk,lb-managed-git,lb-build-runner" { + if got := docIDs(v.Documents); got != "agb,avv,tom,lb-plattform,lb-pruefwerk,lb-werkpilot,lb-firmwerk,lb-managed-git,lb-build-runner" { t.Fatalf("documents: %s", got) } - if v.Documents[6].ManagedService != "git" || v.Documents[6].Product != "" { - t.Errorf("managed git: %+v", v.Documents[6]) + if v.Documents[7].ManagedService != "git" || v.Documents[7].Product != "" { + t.Errorf("managed git: %+v", v.Documents[7]) } // The PDF: the committed bytes, digest in the headers. @@ -181,8 +184,12 @@ func TestContractDocuments_leistungsbeschreibungen(t *testing.T) { !strings.Contains(hdr.Get("Content-Disposition"), want.File) { t.Fatalf("pdf: %d %v", code, hdr) } + // The AVV master is served byte for byte like the others. + if code, _, body := f.contractPDF(t, "avv.pdf"); code != 200 || !bytes.Equal(body, contractdocs.Default().Get("avv").PDF) { + t.Errorf("avv master pdf: %d", code) + } // Only what the overview lists, only as .pdf. - for _, file := range []string{"lb-werkmeister.pdf", "lb-pruefwerk", "avv.pdf", "..%2Fx.pdf", "nope.pdf"} { + for _, file := range []string{"lb-werkmeister.pdf", "lb-pruefwerk", "avv", "..%2Fx.pdf", "nope.pdf"} { if code, _, _ := f.contractPDF(t, file); code != 404 { t.Errorf("%s: %d", file, code) } @@ -282,6 +289,13 @@ func TestContractDocuments_avvMasterThenOwn(t *testing.T) { // Without a released master, a filled AVV is listed on its own. func TestContractDocuments_ownAVVWithoutMaster(t *testing.T) { f := newContractFixture(t, true) + var noMaster []contractdocs.Doc + for _, d := range contractdocs.Default().All() { + if d.Kind != contractdocs.KindAVV { + noMaster = append(noMaster, *d) + } + } + f.s.Contracts = contractdocs.NewCatalogue(noMaster...) filled := []byte("%PDF-1.7 synthetic") if rr := f.raw(t, "PUT", "/v1/admin/tenants/"+f.tenant.ID+"/contract-documents/avv", "application/pdf", filled, avvHeaders("1.0.0", strings.Repeat("d", 64))); rr.Code != 201 { t.Fatalf("upload: %d %s", rr.Code, rr.Body.String())