# Changelog

All notable changes to **documented API V3 endpoints** are documented in this file.
Internal tooling, local setup, and MCP are out of scope.

The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [3.0.6] - 2026-08-21

### Added
- Allow appending article lines on assistant documents with `mode=append` (`POST /api/v3/assistant/documents/{type}/{id}/positions`).
- Filter open tasks to JWT owner or responsible with `owner_or_responsible=me` on `GET /api/v3/open-tasks`.

### Fixed
- Allow partial updates (`PATCH`) for customers, contacts, projects, customer-contacts, users, and reference-data resources that previously only defined `PUT`.
- Enforce document-type permissions on assistant documents (add/edit/view per offer|order|invoice; `view_my_*` limited to the JWT owner's records).
- Ignore client-supplied `user_id_owner` / `user_id_responsible` on open-task create/update; set owner and responsible from JWT on create.
- Enforce row-level open-task access for `view_my_open_tasks` / `edit_my_open_task` / `edit_assigned_open_task` on list, show, update, and delete.
- Require `state_id` when finalizing an assistant document (`confirm` alone no longer returns success without a state change).

### Changed
- Default `open_task_state_id` on new open tasks to the Offen state when omitted.
- Ignore `user_id` on `GET /api/v3/my-time-reports`; the list is always the JWT user, including with `view_time_report_from_all_users`.
- Ignore `user_id` on assistant queries `my_hours_by_period` and `my_flextime_balance` (always the JWT user).
- Omit `my_*` info-query types from `GET /api/v3/assistant/info-query/catalog` unless the caller is a JWT user; executing them without JWT stays `401`.
- Reject API keys on `GET /api/v3/my-time-reports` with `403` (JWT only).
- Require JWT user permissions for assistant document type checks (API keys no longer inherit all document types from the route OR).

## [3.0.5] - 2026-08-19

### Added
- Email the customer from API when a support ticket is answered. Optionally also on assign or complete, if the tenant settings allow it (same mail path as the UI).
- Convert an offer to an order and an order to an invoice via API V3. Orders now show which offer they came from.
- Filter offers, orders, invoices, outgoings, and open tasks by a day or date range.
- Add assistant KPIs for hours (including flextime), open tickets and tasks, project budget, and customer revenue. Hour KPIs can be limited to a day or date range.
- Expose custom fields (`custom_input_1`–`10`, `custom_select_1`–`10`, `custom_text_1`–`5`) on API V3 offers, orders, and invoices. OpenAPI was updated.

### Changed
- Answering a support ticket via the API now always sends a customer email (previously the answer was stored only).

### Fixed
- Keep the existing time-report duration when an update does not send new times.
- Keep invoice cancel status in sync with the invoice state (including after a payment), show it in responses, and reject invalid state changes.
- Let users with time, support, task, or project rights use assistant KPIs. “My” hour and count queries stay limited to the current user; pauses are not counted as work.
- Allow partial updates of support tickets (`PATCH`). Clients can no longer change creator or done/email workflow fields via create/update.
- Let read-only API keys run assistant KPIs.

## [3.0.4] - 2026-07-23

### Added
- List payments for an invoice via API V3.

### Fixed
- Use 30 days as invoice payment terms when the customer value is missing or zero.

## [3.0.3] - 2026-07-22

### Changed
- Fill invoice payment terms from the customer on create (fallback: 30 days).

### Added
- Add assistant endpoints for KPIs and for creating or updating offers, orders, and invoices.
- Show deadline text on offers, orders, and invoices, and default order texts on projects.
- Add API V3 outgoings and distributors, including PDF archive upload/download (one PDF per outgoing, max 2 MB).

## [3.0.2] - 2026-07-15

### Added
- Add VAT ID on customers and e-invoice fields on invoices.
- Add e-invoicing codes on taxes, units, bank accounts (BIC), and payment methods.

## [3.0.1] - 2026-07-15

### Added
- Baseline release notes established (this changelog).
