Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lago_python_client/models/customer_usage.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ class CustomerUsageResponse(BaseResponseModel):
from_datetime: str
to_datetime: str
issuing_date: str
invoice_id: Optional[str]
lago_invoice_id: Optional[str]
currency: str
amount_cents: int
total_amount_cents: int
Expand Down
2 changes: 1 addition & 1 deletion tests/fixtures/customer_usage.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"from_datetime": "2022-07-01T00:00:00Z",
"to_datetime": "2022-07-31T23:59:59Z",
"issuing_date": "2022-08-01",
"invoice_id": null,
"lago_invoice_id": null,
"currency": "EUR",
"amount_cents": 123,
"total_amount_cents": 123,
Expand Down
2 changes: 2 additions & 0 deletions tests/test_customer_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,7 @@ def test_valid_current_usage(httpx_mock: HTTPXMock):
response = client.customers.current_usage("external_customer_id", "123")

assert response.from_datetime == "2022-07-01T00:00:00Z"
assert response.lago_invoice_id is None
assert len(response.charges_usage) == 1
assert response.charges_usage[0].units == "1.0"
assert len(response.charges_usage[0].filters) == 1
Expand Down Expand Up @@ -272,6 +273,7 @@ def test_valid_past_usage(httpx_mock: HTTPXMock):

assert len(response["usage_periods"]) == 1
assert response["usage_periods"][0].from_datetime == "2022-07-01T00:00:00Z"
assert response["usage_periods"][0].lago_invoice_id == "1a901a90-1a90-1a90-1a90-1a901a901a90"
assert len(response["usage_periods"][0].charges_usage) == 1
assert response["usage_periods"][0].charges_usage[0].units == "1.0"
assert len(response["usage_periods"][0].charges_usage[0].filters) == 1
Expand Down
Loading