Skip to content

Commit

Permalink
feat(mdm): use current year instead of 2022 for sfd creation
Browse files Browse the repository at this point in the history
  • Loading branch information
jpn-geo6 committed Jan 29, 2024
1 parent 71a9a86 commit de31d90
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion geosyspy/services/master_data_management_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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)
Expand Down

0 comments on commit de31d90

Please sign in to comment.