diff --git a/geosyspy/services/master_data_management_service.py b/geosyspy/services/master_data_management_service.py index 5fd1597..5a02793 100644 --- a/geosyspy/services/master_data_management_service.py +++ b/geosyspy/services/master_data_management_service.py @@ -4,6 +4,7 @@ from geosyspy.utils.constants import * from geosyspy.utils.helper import Helper from geosyspy.utils.http_client import * +from datetime import datetime class MasterDataManagementService: @@ -26,10 +27,12 @@ def create_season_field_id(self, polygon: str) -> object: A response object. """ + + year = datetime.now().year payload = { "Geometry": polygon, "Crop": {"Id": "CORN"}, - "SowingDate": "2022-01-01", + "SowingDate": f"{year}-01-01", } mdm_url: str = urljoin(self.base_url, GeosysApiEndpoints.MASTER_DATA_MANAGEMENT_ENDPOINT.value+"/seasonfields") return self.http_client.post(mdm_url, payload)