Skip to content

Tags: ksefuj/ksefuj

Tags

validator-v0.4.0

Toggle validator-v0.4.0's commit message
@ksefuj/validator v0.4.0

validator-v0.2.1

Toggle validator-v0.2.1's commit message
fix(validator): correct Polish IBAN length check from 26 to 28 chars

Polish IBAN is PL (2 chars) + 26 digits = 28 total, not 26.
The previous check incorrectly flagged valid IBANs as errors and
silently accepted wrong-length ones. Bare NRB (without PL prefix)
remains 26 digits.

Fixes the check in semantic.ts (Rule 40), updates error-codes.ts
description, all three i18n messages (PL/EN/UK), README, SKILL.md,
adds 4 dedicated tests, and bumps the package to 0.2.1.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

v0.3.0

Toggle v0.3.0's commit message

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
feat(validator): optional NBP exchange rate validation layer (#59)

* Initial plan

* feat(validator): add optional NBP exchange rate validation rule CURRENCY_RATE_MISMATCH

Agent-Logs-Url: https://github.com/ksefuj/ksefuj/sessions/55094113-db6c-4676-9e9e-f1aa466660dd

Co-authored-by: witekbobrowski <18266391+witekbobrowski@users.noreply.github.com>

* feat(web): add NBP rate client, i18n messages, CHANGELOG, and README updates

Agent-Logs-Url: https://github.com/ksefuj/ksefuj/sessions/55094113-db6c-4676-9e9e-f1aa466660dd

Co-authored-by: witekbobrowski <18266391+witekbobrowski@users.noreply.github.com>

* fix(content): remove hardcoded canonical URLs from checklist MDX

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

* fix(content): translate slugs for checklist blog post

EN: ksef-preparation-checklist
UK: ksef-cheklist-pidhotovky
Update translations cross-references in all three locale files.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

* fix(validator): fix CURRENCY_RATE_MISMATCH rule and NBP rate lookup

- KursWaluty lives in FaWiersz (line items), not directly in Fa — the XPath
  was wrong so the check silently skipped all real invoices
- NBP rate lookup now queries P_1 minus one business day per Art. 31a VAT Act
  (previously queried the invoice date itself, which is one day too late)
- Rate values formatted to 4 decimal places in messages and fix suggestions
- {date} interpolation param was missing from translateValidationIssue,
  causing the translation to fall back to the raw key
- Fix fabricated citation "FA(3) §4.3.4" → "Art. 31a ustawy o VAT"

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

* fix(web): add {currency} and {invoiceDate} to currency rate translations

Added currency code and invoice date interpolation to CURRENCY_RATE_MISMATCH
and CURRENCY_RATE_UNVERIFIABLE messages across PL/EN/UK locales, and wired
up the corresponding metadata fields in validation-utils.ts so placeholders
are actually populated at render time.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

* feat(validator): redesign currency rates as per-currency rate table

Breaking change: ValidateOptions.currencyRates is now
Record<string, CurrencyRate[] | null> (full rate table per currency)
instead of Record<string, CurrencyRate> (single rate).

- Validator selects the correct NBP rate from the table based on P_1
  invoice date via findRateForInvoiceDate(), enforcing Art. 31a VAT Act
- New CURRENCY_RATE_UNVERIFIABLE warning when rate table is null (API
  failure) or no rate falls within the 10-day stale window
- nbp.ts rewritten: fetchCurrencyRateTable() fetches one date range per
  unique currency in parallel instead of one call per invoice
- validator.tsx pre-scans all files upfront, extracts (currency, date)
  pairs, fetches the shared rate table once for the entire batch —
  O(currencies) API calls instead of O(files)
- Test suite updated: migrated to array format, added tests for null
  table, empty array, stale rates, same-day rates, multi-rate selection

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

* docs(validator): update README and CHANGELOG for v0.3.0 currency changes

Documents the new currencyRates three-state table API (array | null | absent),
CURRENCY_RATE_UNVERIFIABLE warning, batch NBP fetch strategy, and
Art. 31a ustawy o VAT rate selection logic.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

* fix(validator): address Copilot review feedback on NBP validation layer

- Fix timezone off-by-one in subtractDays() — use UTC arithmetic instead
  of local getDate/setDate to avoid wrong rangeStart/rangeEnd in non-UTC zones
- Fix unquoted XPath predicate NrWierszaFa='${nrWiersza}' and add lineNumber
  to location context in checkCurrencyRateMismatch, matching other FaWiersz rules
- Add missing 0.2.1 entry to CHANGELOG for clean version traceability
- Wrap KursWaluty in backticks in i18n messages (EN/PL/UK) for consistency
  with other XML field name formatting in the same files

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

* fix(changelog): correct 0.2.1 entry with actual public changes

0.2.1 was a public release fixing the IBAN length check and excluding
test files from npm — not an internal patch.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

* docs: correct rule count to 44 (42 + 2 new NBP rules)

CURRENCY_RATE_MISMATCH and CURRENCY_RATE_UNVERIFIABLE are two distinct
rules — Payment & Transaction group goes from 6 to 8, total from 42 to 44.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: witekbobrowski <18266391+witekbobrowski@users.noreply.github.com>
Co-authored-by: Witek Bobrowski <witek@bobrowski.com.pl>
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>

validator-v0.2.0

Toggle validator-v0.2.0's commit message
fix(web): disable locale detection, remove feed.xml from sitemap

Google Search Console flagged pages as redirects. Two causes:
- next-intl middleware was redirecting Googlebot (English Accept-Language)
  from Polish URLs like / to /en/ — fixed by setting localeDetection: false
- /feed.xml was listed in sitemap.xml but RSS feeds are not indexable pages