feat: add payment stornation with history-preserving allocations and card layout fixes

This commit is contained in:
Арсентьев Александр
2026-09-27 20:58:19 +03:00
parent 94571f9684
commit ea183854f8
13 changed files with 1365 additions and 34 deletions
+5 -2
View File
@@ -86,20 +86,23 @@ def test_payments_actions_are_nowrap_inline(tmp_path):
s.add(p)
s.flush()
s.add(Payment(project_id=p.id, date=date(2026, 1, 1), amount=Decimal("10"),
currency="RUB", status="active"))
s.add(Payment(project_id=p.id, date=date(2026, 1, 2), amount=Decimal("10"),
currency="RUB", status="cancelled"))
s.commit()
pid = p.id
with TestClient(app) as client:
html = client.get(f"/projects/{pid}/payments").text
# Actions cell keeps all three actions on one line
# Actions cell keeps actions on one line
assert "payments-actions" in html
assert "text-nowrap" in html
assert "d-inline-flex" in html
# Column width reserved
assert re.search(r'<col style="width: 17rem">', html)
# Three actions + storno badge + row-click preserved
# Active payment: three actions; cancelled: view only + status
assert "Просмотр" in html and "Редактировать" in html and "Удалить" in html
assert "Сторнирован" in html
assert "Действия недоступны" in html
assert "clickable-row" in html
finally:
_clear()