Skip to content

feat: add client delivery addresses and client_delivery_address_id - #106

Open
justpilot wants to merge 4 commits into
mainfrom
feat/delivery-addresses-e-invoices
Open

justpilot wants to merge 4 commits into
mainfrom
feat/delivery-addresses-e-invoices

Conversation

@justpilot

Copy link
Copy Markdown
Owner

Part of #102 (delivery addresses and the new field; e-invoices follow in a separate PR).

What

  • $billomat->clients->deliveryAddresses (ClientDeliveryAddressesApi) on /client-delivery-addresses: list()/listPage()/iterateAll(), get()/getOrFail(), create(), update(), delete(), built like ContactsApi. Generated read model ClientDeliveryAddress and ClientDeliveryAddressCreateOptions/UpdateOptions.
  • clientDeliveryAddressId on Invoice, Recurring and their create/update options. Only these two document types have the field, in Billomat's docs and in the sandbox responses (checked offers, confirmations, credit notes, delivery notes, reminders, letters).
  • @experimental: Billomat's docs say the endpoints only become binding on 2027-01-01. New "Experimental API" section in docs/concepts/backward-compatibility.md, new definition key experimental that puts the tag on generated classes. The field on invoices/recurrings is a plain ID and covered as usual.
  • Spec refreshed from a complete mirror (75 pages, only the changes from Billomat API docs changed: delivery addresses, e-invoices, client_delivery_address_id #102). The extractor now normalizes paths without a leading slash (Billomat writes api/client-delivery-addresses).
  • Docs: new page docs/resources/client-delivery-addresses.md with generated JSON examples, field rows on the invoice/recurring/client pages, CHANGELOG, AGENTS.md.

Checked against the sandbox (2026-11-22)

  • label, address_line_2, address_line_3 and is_default are only in Billomat's example responses, but the sandbox accepts and returns them, so they are in the options.
  • is_default comes as "0"/"1" → ?bool, sent as 1/0. Only one default per client: setting a new default resets the old one.
  • Billomat rejects duplicate addresses of a client (400, "an equal delivery address already exists"); label doesn't count.
  • No customfield (405), so no getCustomField()/setCustomField().
  • Invalid country_code → 400 → ValidationException.

The sample client "SDK-Beispiel GmbH" now has one sample delivery address (used for the contract fixtures). The integration tests create their own addresses (and a draft invoice that references one) and delete them again.

Tests

  • ClientDeliveryAddressesApiTest (requests, payloads, hydration of a real sandbox response, 404, 400), entries in ListPagingTest, contract fixtures for the new resource, the new field in the invoice/recurring fixtures (added by hand instead of a full re-recording, which would have touched 98 files with renumbered placeholders).
  • GetOrFailTest, CustomFieldTest and generate-json-examples.php derive envelope keys from the path; addresses became addresse, fixed in all three.
  • Fixture anonymizer now also replaces address_line_2/address_line_3.
  • Locally: unit tests (4634), PHPStan, Rector, PHP-CS-Fixer, generate:check, docs:json:check, extract:spec:check against the fresh mirror, docs build, new integration tests against the sandbox.

BC check baseline

New fields land before the last constructor parameter ($extra on models, $items on create options). Roave compares by position and reported 8 "type changes" of $extra/$items. Constructor order isn't part of the BC promise, so .roave-backward-compatibility-check.xml gets a narrow entry for exactly that case (approved by the maintainer). With it, Roave against v4.0.0 reports no BC breaks.

Dimitri Dovgan added 4 commits November 22, 2026 20:53
Billomat's API docs gained a "Lieferadressen" page and a new field on
invoices and recurring invoices (#102). Both already work in the sandbox.

- $billomat->clients->deliveryAddresses (ClientDeliveryAddressesApi):
  list/listPage/iterateAll, get/getOrFail, create, update, delete on
  /client-delivery-addresses, with the generated read model and options.
  label, address_line_2/3 and is_default are only in Billomat's example
  responses; the sandbox accepts and returns them. No customfield (405).
- Marked @experimental: Billomat says the endpoints only become binding on
  2027-01-01. New "Experimental API" section in the BC docs and a
  definition key `experimental` for generated classes.
- clientDeliveryAddressId on Invoice, Recurring and their create/update
  options, appended at the end so existing constructor positions stay.
- Spec refreshed from a full mirror (also adds the e-invoice page, which
  is not implemented yet); the extractor now normalizes paths without a
  leading slash.
- Contract fixtures for the new resource (recorded on the sample client),
  the new field added to the invoice/recurring fixtures; the fixture
  anonymizer now also replaces address_line_2/3.
- Integration tests create, update and delete addresses on the sample
  client and reference one from a draft invoice.
…check

Generated models and options append new fields before their last
parameter ($extra on models, $items on create options). Roave compares
parameters by position and reports this as a type change; constructor
parameter order is not part of the BC promise (named arguments).
Infection runs with strict coverage; the reflection-based wither test
touched the new options classes without a CoversClass attribute.
…API test

Fixes import order in OptionsWithersTest and lets listPage() and the error
paths run under Infection's strict coverage.

This branch has not been deployed

No deployments
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