Skip to content

Commit 47e4bdd

Browse files
authored
Merge pull request #28 from smekcio/feat/api-2-2-1-alignment
docs: align SDK docs and CLI tests with KSeF API 2.2.1
2 parents 270da6a + f9554c9 commit 47e4bdd

4 files changed

Lines changed: 69 additions & 2 deletions

File tree

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ Projekt odwzorowuje oficjalne przepływy KSeF i zapewnia spójny model pracy w d
1212

1313
## 🔄 Kompatybilność
1414

15-
Aktualna kompatybilność: **KSeF API `v2.2.0`** ([api-changelog.md](https://github.com/CIRFMF/ksef-docs/blob/2.2.0/api-changelog.md)).
15+
Aktualna kompatybilność: **KSeF API `v2.2.1`** ([api-changelog.md](https://github.com/CIRFMF/ksef-docs/blob/2.2.1/api-changelog.md)).
1616

1717
## 🧭 Spis treści
1818

docs/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ Dokumentacja opisuje **publiczne API** biblioteki `ksef-client-python` (import:
44

55
Opis kontraktu API (OpenAPI) oraz dokumenty procesowe i ograniczenia systemu znajdują się w `ksef-docs/`.
66

7-
Kompatybilność SDK: **KSeF API `v2.2.0`**.
7+
Kompatybilność SDK: **KSeF API `v2.2.1`**.
88

99
## Wymagania
1010

tests/cli/integration/test_send_batch.py

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,39 @@ def _fake_send(**kwargs):
5050
assert seen["save_upo_overwrite"] is False
5151

5252

53+
def test_send_batch_rr_form_code_override(runner, monkeypatch, tmp_path) -> None:
54+
seen: dict[str, object] = {}
55+
56+
def _fake_send(**kwargs):
57+
seen.update(kwargs)
58+
return {"session_ref": "BATCH-RR"}
59+
60+
monkeypatch.setattr(send_cmd, "send_batch_invoices", _fake_send)
61+
batch_dir = tmp_path / "batch"
62+
batch_dir.mkdir()
63+
64+
result = runner.invoke(
65+
app,
66+
[
67+
"send",
68+
"batch",
69+
"--dir",
70+
str(batch_dir),
71+
"--system-code",
72+
"FA_RR (1)",
73+
"--schema-version",
74+
"1-1E",
75+
"--form-value",
76+
"RR",
77+
],
78+
)
79+
80+
assert result.exit_code == 0
81+
assert seen["system_code"] == "FA_RR (1)"
82+
assert seen["schema_version"] == "1-1E"
83+
assert seen["form_value"] == "RR"
84+
85+
5386
def test_send_batch_save_upo_overwrite_flag(runner, monkeypatch, tmp_path) -> None:
5487
seen: dict[str, object] = {}
5588

tests/cli/integration/test_send_online.py

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,40 @@ def _fake_send(**kwargs):
5454
assert seen["save_upo_overwrite"] is False
5555

5656

57+
def test_send_online_rr_form_code_override(runner, monkeypatch, tmp_path) -> None:
58+
seen: dict[str, object] = {}
59+
60+
def _fake_send(**kwargs):
61+
seen.update(kwargs)
62+
return {"session_ref": "SES-RR", "invoice_ref": "INV-RR"}
63+
64+
monkeypatch.setattr(send_cmd, "send_online_invoice", _fake_send)
65+
66+
invoice_path = tmp_path / "rr.xml"
67+
invoice_path.write_text("<rr/>", encoding="utf-8")
68+
69+
result = runner.invoke(
70+
app,
71+
[
72+
"send",
73+
"online",
74+
"--invoice",
75+
str(invoice_path),
76+
"--system-code",
77+
"FA_RR (1)",
78+
"--schema-version",
79+
"1-1E",
80+
"--form-value",
81+
"RR",
82+
],
83+
)
84+
85+
assert result.exit_code == 0
86+
assert seen["system_code"] == "FA_RR (1)"
87+
assert seen["schema_version"] == "1-1E"
88+
assert seen["form_value"] == "RR"
89+
90+
5791
def test_send_online_save_upo_overwrite_flag(runner, monkeypatch, tmp_path) -> None:
5892
seen: dict[str, object] = {}
5993

0 commit comments

Comments
 (0)