From b5f7cc35489eb7f9d6f3e9ae953855211de84603 Mon Sep 17 00:00:00 2001 From: Daniel Roth Date: Fri, 3 Jul 2026 16:24:48 +0000 Subject: [PATCH] =?UTF-8?q?Abri=20job=20logging=20and=20appointment=20amen?= =?UTF-8?q?dment=20serialise=20bookings=20through=20one=20date=20rule=20?= =?UTF-8?q?=F0=9F=9F=AA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Claude Fable 5 --- infrastructure/abri/abri_client.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/infrastructure/abri/abri_client.py b/infrastructure/abri/abri_client.py index 8ebd3ac2e..3c95c2766 100644 --- a/infrastructure/abri/abri_client.py +++ b/infrastructure/abri/abri_client.py @@ -1,4 +1,5 @@ import xml.etree.ElementTree as ET +from datetime import date from typing import List, Tuple, Union import requests @@ -21,6 +22,10 @@ CLIENT_CODE = "HSG" RESOURCE_GROUP = "Surveyors" +def _format_appointment_date(appointment_date: date) -> str: + return appointment_date.strftime("%d/%m/%Y") + + class AbriClient: def __init__(self, config: AbriConfig) -> None: self._config = config @@ -36,7 +41,7 @@ class AbriClient: ("short_description", request.short_description), ("long_description", request.long_description), ("client_ref", request.client_ref), - ("appointment_date", request.appointment_date.strftime("%d/%m/%Y")), + ("appointment_date", _format_appointment_date(request.appointment_date)), ("appointment_time", request.appointment_time), ("resource", self._config.default_resource), ("resource_group", RESOURCE_GROUP), @@ -52,7 +57,7 @@ class AbriClient: parameters = [ ("job_no", request.job_no), ("action", "amend"), - ("appointment_date", request.appointment_date.strftime("%d/%m/%Y")), + ("appointment_date", _format_appointment_date(request.appointment_date)), ("appointment_time", request.appointment_time), ] if request.resource is not None: