diff --git a/go.mod b/go.mod index 88594b861..b8b21464e 100644 --- a/go.mod +++ b/go.mod @@ -32,7 +32,7 @@ require ( github.com/google/uuid v1.6.0 github.com/hashicorp/golang-lru/v2 v2.0.7 github.com/huandu/go-sqlbuilder v1.30.0 - github.com/invopop/gobl v0.115.1 + github.com/invopop/gobl v0.200.1 github.com/invopop/validation v0.8.0 github.com/jackc/pgx/v5 v5.7.1 github.com/lmittmann/tint v1.0.5 diff --git a/go.sum b/go.sum index 658f1bee2..4e0ee6aee 100644 --- a/go.sum +++ b/go.sum @@ -771,8 +771,8 @@ github.com/influxdata/go-syslog/v3 v3.0.0 h1:jichmjSZlYK0VMmlz+k4WeOQd7z745YLsvG github.com/influxdata/go-syslog/v3 v3.0.0/go.mod h1:tulsOp+CecTAYC27u9miMgq21GqXRW6VdKbOG+QSP4Q= github.com/influxdata/influxdb1-client v0.0.0-20220302092344-a9ab5670611c h1:qSHzRbhzK8RdXOsAdfDgO49TtqC1oZ+acxPrkfTxcCs= github.com/influxdata/influxdb1-client v0.0.0-20220302092344-a9ab5670611c/go.mod h1:qj24IKcXYK6Iy9ceXlo3Tc+vtHo9lIhSX5JddghvEPo= -github.com/invopop/gobl v0.115.1 h1:32qjjJn8WAp1evYBKWniJa6yTvtXMPjL6aHIxxuRP90= -github.com/invopop/gobl v0.115.1/go.mod h1:lnlUK1cwjla/EPdxH1O7hKSSBv58DNWLV4/lOCv1vlQ= +github.com/invopop/gobl v0.200.1 h1:kwFioffY3BpLLngMowoem3A7NHJGLt0BGmiNj0EN/wI= +github.com/invopop/gobl v0.200.1/go.mod h1:DmPohPel8b3ta4nDKnXRNzWQlB89cN74e0/WwPUEZUU= github.com/invopop/jsonschema v0.12.0 h1:6ovsNSuvn9wEQVOyc72aycBMVQFKz7cPdMJn10CvzRI= github.com/invopop/jsonschema v0.12.0/go.mod h1:ffZ5Km5SWWRAIN6wbDXItl95euhFz2uON45H2qjYt+0= github.com/invopop/validation v0.8.0 h1:e5hXHGnONHImgJdonIpNbctg1hlWy1ncaHoVIQ0JWuw= @@ -1160,8 +1160,8 @@ github.com/robfig/cron/v3 v3.0.1/go.mod h1:eQICP3HwyT7UooqI/z+Ov+PtYAWygg1TEWWzG github.com/rogpeppe/fastuuid v1.2.0/go.mod h1:jVj6XXZzXRy/MSR5jhDC/2q6DgLz+nrA6LYCDYWNEvQ= github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= github.com/rogpeppe/go-internal v1.6.1/go.mod h1:xXDCJY+GAPziupqXw64V24skbSoqbTEfhy4qGm1nDQc= -github.com/rogpeppe/go-internal v1.12.0 h1:exVL4IDcn6na9z1rAb56Vxr+CgyK3nn3O+epU5NdKM8= -github.com/rogpeppe/go-internal v1.12.0/go.mod h1:E+RYuTGaKKdloAfM02xzb0FW3Paa99yedzYV+kq4uf4= +github.com/rogpeppe/go-internal v1.12.1-0.20240709150035-ccf4b4329d21 h1:igWZJluD8KtEtAgRyF4x6lqcxDry1ULztksMJh2mnQE= +github.com/rogpeppe/go-internal v1.12.1-0.20240709150035-ccf4b4329d21/go.mod h1:RMRJLmBOqWacUkmJHRMiPKh1S1m3PA7Zh4W80/kWPpg= github.com/rs/xid v1.2.1/go.mod h1:+uKXf+4Djp6Md1KODXJxgGQPKngRmWyn10oCKFzNHOQ= github.com/rs/zerolog v1.13.0/go.mod h1:YbFCdg8HfsridGWAh22vktObvhZbQsZXe4/zB0OKkWU= github.com/rs/zerolog v1.15.0/go.mod h1:xYTKnLHcpfU2225ny5qZjxnj9NvkumZYjJHlAThCjNc= diff --git a/openmeter/billing/gobldriver/invoice.go b/openmeter/billing/gobldriver/invoice.go index d2719d557..05b6cbf00 100644 --- a/openmeter/billing/gobldriver/invoice.go +++ b/openmeter/billing/gobldriver/invoice.go @@ -118,8 +118,8 @@ func (d *Driver) invoiceToGOBL(input billing.InvoiceWithValidation) invoiceWithV invoice := &bill.Invoice{ Type: inv.Type.CBCKey(), - Series: inv.InvoiceNumber.Series, - Code: inv.InvoiceNumber.Code, + Series: cbc.Code(inv.InvoiceNumber.Series), + Code: cbc.Code(inv.InvoiceNumber.Code), IssueDate: cal.Date{ Date: civil.DateOf(lo.FromPtrOr(inv.IssuedAt, inv.CreatedAt).In(loc)), }, diff --git a/openmeter/billing/gobldriver/invoice_test.go b/openmeter/billing/gobldriver/invoice_test.go index 018f51c86..3114bdbc2 100644 --- a/openmeter/billing/gobldriver/invoice_test.go +++ b/openmeter/billing/gobldriver/invoice_test.go @@ -79,9 +79,6 @@ func TestValidationErrors(t *testing.T) { expectedOutput := ValidationErrorsComplement{ Fields: map[string][]ValidationErrorJSON{ - "code": { - {Code: "validation_required", Message: "cannot be blank"}, - }, "customer.billingAddress": { {Code: "customer_billing_address_not_found", Message: "missing customer billing address"}, },