Skip to content

EXP-4396: fix DSFinV-K cash point closing error field deserialization (38.1.1) - #323

Merged
abdallahbeshi merged 4 commits into
masterfrom
fix/EXP-4396-dsfinvk-closing-error-deserialization
Jun 26, 2026
Merged

EXP-4396: fix DSFinV-K cash point closing error field deserialization (38.1.1)#323
abdallahbeshi merged 4 commits into
masterfrom
fix/EXP-4396-dsfinvk-closing-error-deserialization

Conversation

@andresgrobastrigo

Copy link
Copy Markdown
Contributor

What

Fixes a JsonException thrown by DsfinvkClosingSynchronizerJob when Fiskaly returns a cash point closing in ERROR state.

Fiskaly API v1.27.6 (2026-06-16) started setting closings with incorrect use of SLAVE_WITHOUT_TSS cash registers to ERROR state. In that case the 200 response body includes an error object ({ code, message }), but CashPointClosingResponse had public string Error — causing the deserializer to throw at $.error.

Changes

  • CashPointClosingResponse — change Error from string to a new CashPointClosingError DTO ({ Code, Message }).
  • CashPointClosingMapper — map error object to string using Error?.Message ?? Error?.Code, preserving the public CashPointClosingResult.Error: string API contract.
  • Versions — Fiskaly 2.5.0 → 2.5.1, All 38.1.0 → 38.1.1.

Notes

DsfinvkErrorResponse (used for HTTP 4xx/5xx) keeps error: string — that is correct per the Fiskaly spec (HTTP error responses use a plain string like "Bad Request").

🤖 Generated with Claude Code

… (38.1.1)

Fiskaly API v1.27.6 changed closings with incorrect SLAVE_WITHOUT_TSS
cash registers to ERROR state. The 200 response now includes an `error`
object ({ code, message }) instead of a string, causing a JsonException
at $.error during deserialization.

- CashPointClosingResponse: change Error from string to CashPointClosingError
- CashPointClosingMapper: map error object to string (Message ?? Code)
- Versions: Fiskaly 2.5.0 → 2.5.1, All 38.1.0 → 38.1.1
@moxly

moxly commented Jun 26, 2026

Copy link
Copy Markdown

Review posted. View review · run

@moxly

moxly commented Jun 26, 2026

Copy link
Copy Markdown

The pull request was updated while this review was being prepared, so it is posted as a comment rather than a formal review.

Risk Assessment

Score: 2/10 — low

Targeted hotfix for an external API contract change with no logic errors, no API surface breakage, and correct null-safety in the mapping. The only minor gap is the absent PR template checklist (no test file in the diff).

Review Summary

APPROVE — 0 findings. Clean fix.

The PR template's Checklist section (type of change, breaking-change flag, test coverage) was not included in the PR body. The "Tests included" item is the most relevant omission: no unit test was added to cover the new CashPointClosingError deserialization path or the Message ?? Code fallback logic. Given this is a hotfix driven by an upstream API change and the mapping logic is straightforward, this is a minor gap rather than a blocker — but a regression test for the ERROR state response would make future Fiskaly spec changes easier to catch.

abdallahbeshi
abdallahbeshi previously approved these changes Jun 26, 2026
@abdallahbeshi
abdallahbeshi enabled auto-merge (squash) June 26, 2026 10:33
@abdallahbeshi
abdallahbeshi merged commit 8c55dcd into master Jun 26, 2026
11 checks passed
@abdallahbeshi
abdallahbeshi deleted the fix/EXP-4396-dsfinvk-closing-error-deserialization branch June 26, 2026 10:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants