refactored code to place the booking specific actions inside a gestion-sports element

This commit is contained in:
Stanislas Jouffroy 2024-02-21 23:49:33 +01:00
parent 1ec148e866
commit 552db2aa8a
3 changed files with 11 additions and 12 deletions

View file

@ -2,7 +2,7 @@ import asyncio
import logging
import config
from gestion_sports.gestion_sports_operations import GestionSportsOperations
from gestion_sports.gestion_sports_platform import GestionSportsPlatform
from models import BookingFilter, Club, User
LOGGER = logging.getLogger(__name__)
@ -17,7 +17,7 @@ async def book(club: Club, user: User, booking_filter: BookingFilter) -> int | N
:param booking_filter: the information related to the booking
:return: the id of the booked court, or None if no court was booked
"""
async with GestionSportsOperations(club) as platform:
async with GestionSportsPlatform(club) as platform:
return await platform.book(user, booking_filter)