feat(contractdocs): release the AVV 1.0.0 master
The owner released the AVV on 19.11.2026: Arbeitsstand 06, without a signature block (it is concluded with the main contract, § 12(1)), Stand 17.11.2026. The PDF is byte for byte the one in its release record FREIGABE_1.0.0.json (sha256 623aa518…). It is listed between AGB and TOM for every workspace; a workspace's own filled AVV still takes its place. The AVV contract status stays "not_concluded": listing the master concludes nothing. Tests: released set and order, the master in the overview and as PDF, and the own-AVV-without-master path now on a catalogue without the master. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
9d6b5d48cf
commit
116bb83ddf
4 files changed
+45
-28
No files matched your search
@@ -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())
|
||||
|
||||
Reference in new issue
Block a user