mirror of
https://github.com/Hestia-Homes/Model.git
synced 2026-07-12 13:29:04 +00:00
Abri confirmed time before midday books the morning slot 🟩
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
parent
fcdab30b73
commit
cd29cbb0b8
1 changed files with 7 additions and 1 deletions
|
|
@ -1,7 +1,13 @@
|
|||
from datetime import datetime, time
|
||||
from typing import Optional
|
||||
|
||||
from domain.abri.models import SlotCode
|
||||
|
||||
_MIDDAY = time(12, 0)
|
||||
|
||||
|
||||
def slot_for_confirmed_time(confirmed_time: Optional[str]) -> SlotCode:
|
||||
return "AD"
|
||||
if confirmed_time is None or confirmed_time.strip() == "":
|
||||
return "AD"
|
||||
parsed = datetime.strptime(confirmed_time.strip(), "%H:%M").time()
|
||||
return "AM" if parsed < _MIDDAY else "PM"
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue