mirror of
https://github.com/Hestia-Homes/Model.git
synced 2026-07-12 13:29:04 +00:00
Abri job logging and appointment amendment serialise bookings through one date rule 🟪
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
parent
05bd22269d
commit
b5f7cc3548
1 changed files with 7 additions and 2 deletions
|
|
@ -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:
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue