@kirjapro/mcp-server 0.12.0 → 0.14.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,75 @@
1
1
  # Changelog
2
2
 
3
+ ## [Unreleased]
4
+
5
+ ## [0.14.0] - 2026-10-05
6
+
7
+ Prepared, not yet published. Publish only after (1) `db:deploy` of the round-3
8
+ migrations `20261005170000`–`20261005200000` (AI-työtila 2.0 batches 10–13;
9
+ `kirjapro_send_invoice` needs `20261005180100`, the delivery intents), (2)
10
+ `npm run functions:deploy -- dispatch-invoice` from the same main, which resumes a
11
+ delivery under its intent, and (3) a commit of `src/database.types.ts` regenerated
12
+ from production with `--schema public`, so `check:types-drift` passes. Until then
13
+ 0.13.0 keeps working unchanged against the current database.
14
+
15
+ - `kirjapro_get_ar_aging` shares its result shaping with Kirjapro; an unexpected
16
+ report payload now returns a sanitized error instead of an internal exception.
17
+ - `kirjapro_create_invoice`: `paymentTermDays` has no schema default any more, so
18
+ the customer's own payment term applies before 14 days (0.13.0 always used 14).
19
+ `vatRate` defaults to `25.5` only when a line has no `vatTreatmentCode`; an
20
+ explicit rate that contradicts the code is refused as `VAT_RATE_MISMATCH`
21
+ instead of the code winning silently. Lines take `discountPercent` (0–100, two
22
+ decimals, before VAT), and the historical `24`/`14` rates
23
+ (`legacy_standard_24` until 31.8.2024, `legacy_standard_14` until 31.12.2025)
24
+ are accepted inside their windows. Fingerprint changes.
25
+ - `kirjapro_send_invoice` caches only a confirmed result. A lost transport, relay
26
+ error, 5xx or a delivery whose provider outcome is still pending returns
27
+ `IDEMPOTENCY_OUTCOME_UNKNOWN` and leaves the claim pending; 0.13.0 cached it as a
28
+ failure, which invited a retry with a new key. A confirmed refusal returns
29
+ `CODE: viesti` and a send returns `delivery_id`. Needs the database migration
30
+ `20261005180100` and the matching `dispatch-invoice` deploy (delivery intents).
31
+ - The generated copies `src/compliance/purchase-vat-allocation.ts`,
32
+ `src/compliance/date-local.ts` and the new `src/shared/invoice-delivery.ts` are
33
+ byte-guarded by the test suite like `src/shared/invoice-draft.ts`.
34
+ - `kirjapro_search_transactions` with `minAmount` or `maxAmount` returns
35
+ `FILTER_TOO_BROAD: …` when more than 1 000 transactions (or an unknown number)
36
+ match the other filters, instead of filtering only the first 1 000 and
37
+ reporting that sample's size as `total_count`. Up to 1 000 matches the count
38
+ stays exact. Narrow `dateFrom`/`dateTo` or `query` to search further.
39
+
40
+ ## [0.13.0] - 2026-10-04
41
+
42
+ No database prerequisite: every function, rule and VAT treatment it uses was
43
+ already live with 0.12.0, and 0.12.0 remains compatible with the same database.
44
+
45
+ - `kirjapro_create_invoice` runs on the invoice-draft core that Kirjapro's AI
46
+ Chat also uses (`src/shared/invoice-draft.ts`, generated from the repository's
47
+ `src/lib/invoice-draft.ts`). Line amounts round like the database (numeric
48
+ `ROUND`, half away from zero), so 3 × 1.255 € returns 3.77 €, as stored;
49
+ 0.12.0 returned 3.76 €.
50
+ - The database allocates the invoice and reference number in the creation
51
+ transaction. The server no longer reads `get_next_invoice_number` first, and
52
+ the success message names the stored number.
53
+ - Errors are a stable code with a Finnish explanation, `CODE: viesti` (for
54
+ example `VAT_REQUIRES_EU_VAT_NUMBER: …` or `FISCAL_YEAR_CLOSED: …`), like the
55
+ existing `IDEMPOTENCY_*:` errors. Other tools keep their English messages.
56
+ - A lost database response returns `IDEMPOTENCY_OUTCOME_UNKNOWN` and leaves the
57
+ idempotency claim pending, so a retry with the same key never creates a
58
+ second invoice. 0.12.0 cached it as an ordinary failure.
59
+ - When the invoice is created but reading it back fails, the result is a
60
+ success with a `warning` and the invoice id, cached like any success.
61
+ - `paymentTermDays` must be a whole number of days (0–365). It still defaults
62
+ to 14, so the customer's own payment term applies only when it is passed.
63
+ - Returned `lines` no longer echo `reverse_charge_confirmation_text`; the
64
+ database sets the invoice's confirmation text.
65
+ - `kirjapro_send_invoice` declares `openWorldHint: true`: email and e-invoice
66
+ delivery are external effects. Only its fingerprint changes; the
67
+ `kirjapro_create_invoice` input schema and fingerprint are unchanged.
68
+ - `kirjapro://compliance/vat`: the reverse-charge `implementation_limits` now
69
+ says that `kirjapro_book_purchase` takes `deductionPercent` 0–100 with a
70
+ documented reason, also for reverse charge. 0.12.0 still said that the
71
+ parameter did not exist.
72
+
3
73
  ## [0.12.0] - 2026-10-04
4
74
 
5
75
  Requires deployment of all seven migrations in the compliance batch before release: