diff --git a/lago_python_client/models/subscription.py b/lago_python_client/models/subscription.py index f567b1ae..c3fa4cc7 100644 --- a/lago_python_client/models/subscription.py +++ b/lago_python_client/models/subscription.py @@ -12,6 +12,7 @@ class Subscription(BaseModel): external_id: Optional[str] subscription_date: Optional[str] billing_time: Optional[str] + ending_at: Optional[str] class SubscriptionResponse(BaseResponseModel): @@ -27,6 +28,7 @@ class SubscriptionResponse(BaseResponseModel): external_id: Optional[str] billing_time: Optional[str] terminated_at: Optional[str] + ending_at: Optional[str] subscription_date: Optional[str] previous_plan_code: Optional[str] next_plan_code: Optional[str] diff --git a/tests/fixtures/subscription.json b/tests/fixtures/subscription.json index 9db7e5a3..dea74c15 100644 --- a/tests/fixtures/subscription.json +++ b/tests/fixtures/subscription.json @@ -7,6 +7,7 @@ "created_at": "2022-04-29T08:59:51Z", "plan_code": "eartha lynch", "started_at": "2022-04-29T08:59:51Z", + "ending_at": "2022-08-29T08:59:51Z", "status": "active", "billing_time": "anniversary", "terminated_at": null, diff --git a/tests/fixtures/subscription_index.json b/tests/fixtures/subscription_index.json index efabee4f..35437453 100644 --- a/tests/fixtures/subscription_index.json +++ b/tests/fixtures/subscription_index.json @@ -8,6 +8,7 @@ "created_at": "2022-04-29T08:59:51Z", "plan_code": "eartha lynch", "started_at": "2022-04-29T08:59:51Z", + "ending_at": "2022-08-29T08:59:51Z", "status": "active", "terminated_at": null } diff --git a/tests/test_subscription_client.py b/tests/test_subscription_client.py index 0b64ff48..852fa0b1 100644 --- a/tests/test_subscription_client.py +++ b/tests/test_subscription_client.py @@ -10,7 +10,8 @@ def create_subscription(): return Subscription(external_customer_id='5eb02857-a71e-4ea2-bcf9-57d3a41bc6ba', plan_code='eartha lynch', - external_id='code', billing_time='anniversary', subscription_date='2022-04-29') + external_id='code', billing_time='anniversary', subscription_date='2022-04-29', + ending_at='2022-08-29T08:59:51Z') def mock_response(): @@ -46,6 +47,7 @@ def test_valid_create_subscriptions_request(httpx_mock: HTTPXMock): assert response.plan_code == 'eartha lynch' assert response.billing_time == 'anniversary' assert response.subscription_date == '2022-04-29' + assert response.ending_at == '2022-08-29T08:59:51Z' def test_invalid_create_subscriptions_request(httpx_mock: HTTPXMock):