Current section
Files
Jump to
Current section
Files
CHANGELOG
## 1.2.0 (2026-04-15)
### Added
- `BIR121JednLokalnaOsPrawnej` report type — supported as `report_name` for `dane_pobierz_pelny_raport/3`. Dispatches to `Gusex.Types.JednLokalnaOsPrawnej`.
- Schema-drift logging — unknown XML fields returned by the service are logged at `:error` level with the SOAP method and target struct as context (deduped per call; field names only, no value leakage).
### Changed
- **BREAKING:** `dane_pobierz_pelny_raport/3` now returns `{:ok, [struct()]}` on success instead of `{:ok, [map()]}`. The struct type depends on `report_name` (e.g. `"BIR12OsPrawna"` -> `%Gusex.Types.OsPrawna{}`). Code that guards on `when not is_struct(entry)` must be updated.
- `Gusex.Types.JednLokalnaOsPrawnej` gained two optional fields (`:lokpraw_nip`, `:lokpraw_statusNip`). They are `nil` for entries parsed from `BIR12JednLokalnaOsPrawnej` responses and populated for `BIR121JednLokalnaOsPrawnej` responses.
### Fixed
- `Gusex.Types.OsFizycznaDzialalnoscRolnicza.fiz_dataSkresleniaDzialalanosciZRegon` (note the GUS-side typo — extra "a" in "Dzialalanosci") is now parsed as a `Date.t()`. Previously it fell through to the unknown-type branch and arrived as a raw string.
### Migration from 1.1.x
```elixir
# Report return — pattern-match the struct type:
{:ok, [%Gusex.Types.OsPrawna{praw_regon9: regon}]} = Gusex.dane_pobierz_pelny_raport("000331501", "BIR12OsPrawna", session)
```
## 1.1.0 (2026-04-11)
### Added
- `Gusex.find_by_nip/1` — convenience lookup by NIP using a cached session, with NIP validation, normalisation, and automatic retry on session failures.
- `Gusex.SessionCache` — optional GenServer that caches authenticated sessions to avoid redundant logins. Add it to your application's supervision tree to enable the convenience API. Configurable via `:session_ttl` (seconds, default 3000 — a 50-minute margin below the 60-minute server hard limit).
- `Gusex.SessionCache.run_with_session/1` — entry point that runs a given function with a cached session, handling session acquisition, TTL expiry, and one retry on retriable errors (`:empty_response`, `{:http_error, _, _}`). Additional cached-session operations can be built on top of it.
## 1.0.1 (2025-12-14)
### Changed
- Updated HTTPoison dependency from ~> 1.8 to ~> 2.3
## 1.0.0 (2025-09-07)
- Initial release