diff --git a/lago_python_client/models/customer_usage.py b/lago_python_client/models/customer_usage.py index 78bf752..cfb01a3 100644 --- a/lago_python_client/models/customer_usage.py +++ b/lago_python_client/models/customer_usage.py @@ -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 diff --git a/tests/fixtures/customer_usage.json b/tests/fixtures/customer_usage.json index a0ad50d..885b2fa 100644 --- a/tests/fixtures/customer_usage.json +++ b/tests/fixtures/customer_usage.json @@ -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, diff --git a/tests/test_customer_client.py b/tests/test_customer_client.py index 4ce3564..9c7ed58 100644 --- a/tests/test_customer_client.py +++ b/tests/test_customer_client.py @@ -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 @@ -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