No description
  • Go 95.7%
  • Makefile 2.5%
  • Dockerfile 1.1%
  • Go Template 0.7%
Find a file
Zamir Amir d2e9ff5d3d
All checks were successful
CI / test (push) Successful in 1m23s
CI / chart (push) Successful in 12s
CI / specification (push) Successful in 32s
CI / image (push) Successful in 14s
CI / chart-release (push) Has been skipped
Release 0.2.1
2026-11-25 13:15:56 +01:00
.forgejo/workflows Scan the rendered chart with KICS on every push and pull request 2026-11-25 10:34:12 +01:00
api Keep the afzender per zendingReferentie for retours 2026-11-23 23:56:01 +01:00
cmd/dispatch-service Turn the copy of dispatch-process into the verzenddienst's data layer 2026-11-23 22:03:01 +01:00
helm Release 0.2.1 2026-11-25 13:15:56 +01:00
internal Keep the afzender per zendingReferentie for retours 2026-11-23 23:56:01 +01:00
.dockerignore Forward shipments from allowed senders as verzenddienst 2026-11-23 11:13:02 +01:00
Dockerfile Turn the copy of dispatch-process into the verzenddienst's data layer 2026-11-23 22:03:01 +01:00
go.mod Turn the copy of dispatch-process into the verzenddienst's data layer 2026-11-23 22:03:01 +01:00
go.sum Turn the copy of dispatch-process into the verzenddienst's data layer 2026-11-23 22:03:01 +01:00
LICENSE License under EUPL-1.2 2026-11-23 20:10:32 +01:00
Makefile Release dispatch-service with a version, chart and image together 2026-11-24 19:02:13 +01:00
README.md Release dispatch-service with a version, chart and image together 2026-11-24 19:02:13 +01:00

dispatch-service

The data layer of the verzenddienst in Notificatie voor Burgers. It holds no business logic: it does not decide who may dispatch and forwards nothing. It stores and returns what dispatch-process and dispatch-management-process give and ask, in the database of dispatch-db (CloudNativePG).

Internal only: no Ingress or HTTPRoute points at it.

What it stores

  • the senders that may dispatch, as dispatch-process puts them in from its configuration;
  • the last 200 events: time, sender, chosen bezorgdienst, result and the size of the bezorgenvelop;
  • the number of forwarded shipments per sender per day, apart from the capped log.

Never anything about the recipient: no functional address and no content. The verzenddienst knows the sender, never the recipient.

API

Dutch, OpenAPI 3.1, following the NL API Design Rules. The source is api/openapi.yaml; api/openapi.json is generated from it and committed (npx -y js-yaml@4 api/openapi.yaml > api/openapi.json). Both are served as they are at /v1/openapi.json and /v1/openapi.yaml.

Every /v1 path except the specification needs a service key (Authorization: Bearer <key>), one per calling process. Errors are application/problem+json, every response carries API-Version.

  • GET /v1/afzenders, PUT and DELETE /v1/afzenders/{afzenderId}
  • GET /v1/gebeurtenissen?aantal=1..200, POST /v1/gebeurtenissen
  • GET /v1/statistieken → {zendingenPerAfzenderVandaag}
  • PUT/GET/DELETE /v1/zendingen/{zendingReferentie}, DELETE /v1/zendingen?aangebodenVoor=…: which afzender offered which zending, so a retour finds its way back; nothing about the recipient

Configuration

  • DATABASE_URL: from the Secret dispatch-db-app that CloudNativePG creates
  • DISPATCH_PROCESS_API_KEY, DISPATCH_MANAGEMENT_PROCESS_API_KEY: from the Secret dispatch-api-keys

Development

go test ./...        # starts a throwaway Postgres with docker, or uses TEST_DATABASE_URL
golangci-lint run ./...

CI

.forgejo/workflows/ci.yml runs the tests against a Postgres service container, checks that openapi.json matches openapi.yaml, lints the spec with Redocly and the ADR checker, lints the chart and on main pushes the image code.digitaledienst.overheid.nl/mijn-betaaloverzicht/dispatch-service:<commit>.

Release

make release VERSION=1.2.3   # on an up-to-date main: writes helm/Chart.yaml, commits, tags v1.2.3
git push --follow-tags

The tag pipeline tags the image 1.2.3 and v1.2.3 and publishes the chart at 1.2.3 to the Forgejo Helm registry (see the charts repository). The environments repository pins that version.

License

EUPL-1.2, see LICENSE.