From 631dc93e43a3cb137c48a391fe7ec1c077b560cb Mon Sep 17 00:00:00 2001 From: maskarb Date: Wed, 8 Jan 2025 09:25:01 -0500 Subject: [PATCH 1/2] add polling timestamp to masu sources endpoint --- koku/masu/api/sources/serializers.py | 1 + 1 file changed, 1 insertion(+) diff --git a/koku/masu/api/sources/serializers.py b/koku/masu/api/sources/serializers.py index 53da730c8c..ac74bf5dbe 100644 --- a/koku/masu/api/sources/serializers.py +++ b/koku/masu/api/sources/serializers.py @@ -69,6 +69,7 @@ class Meta: setup_complete = serializers.BooleanField() created_timestamp = serializers.DateTimeField() data_updated_timestamp = serializers.DateTimeField() + polling_timestamp = serializers.DateTimeField() active = serializers.BooleanField() paused = serializers.BooleanField() customer = CustomerSerializer() From 012a3266c01706b403a4eb9d152f6e09674c6ad0 Mon Sep 17 00:00:00 2001 From: maskarb Date: Fri, 10 Jan 2025 11:05:20 -0500 Subject: [PATCH 2/2] update tests --- koku/masu/api/sources/serializers.py | 2 +- koku/masu/api/sources/test/test_serializers.py | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/koku/masu/api/sources/serializers.py b/koku/masu/api/sources/serializers.py index ac74bf5dbe..1e52105e63 100644 --- a/koku/masu/api/sources/serializers.py +++ b/koku/masu/api/sources/serializers.py @@ -69,7 +69,7 @@ class Meta: setup_complete = serializers.BooleanField() created_timestamp = serializers.DateTimeField() data_updated_timestamp = serializers.DateTimeField() - polling_timestamp = serializers.DateTimeField() + polling_timestamp = serializers.DateTimeField(allow_null=True) active = serializers.BooleanField() paused = serializers.BooleanField() customer = CustomerSerializer() diff --git a/koku/masu/api/sources/test/test_serializers.py b/koku/masu/api/sources/test/test_serializers.py index d7a34df2ed..dc79fecf3e 100644 --- a/koku/masu/api/sources/test/test_serializers.py +++ b/koku/masu/api/sources/test/test_serializers.py @@ -47,7 +47,7 @@ def setUp(self): def test_serializer(self): """Test the serializer.""" for entry in self.data: - provider = entry.get("provider") + provider: Provider = entry.get("provider") customer = provider.customer infrastructure = provider.infrastructure @@ -61,6 +61,7 @@ def test_serializer(self): "setup_complete": provider.setup_complete, "created_timestamp": provider.created_timestamp, "data_updated_timestamp": provider.data_updated_timestamp, + "polling_timestamp": provider.polling_timestamp, "active": provider.active, "paused": provider.paused, "customer": validated_customer,