UNPKG

@tennac-booking/sdk

Version:

OpenAPI client for @tennac-booking/sdk

574 lines (380 loc) 16.1 kB
# BookingsApi All URIs are relative to *http://localhost* |Method | HTTP request | Description| |------------- | ------------- | -------------| |[**createGuestBooking**](#createguestbooking) | **POST** /api/bookings/guest | | |[**estimateOpenBookingJoin**](#estimateopenbookingjoin) | **POST** /api/bookings/{bookingId}/open/estimate-join | | |[**getBookingHistory**](#getbookinghistory) | **GET** /api/bookings/history/{bookingId} | | |[**getBookingPrice**](#getbookingprice) | **POST** /api/bookings/booking-price | | |[**getGuestBookingPrice**](#getguestbookingprice) | **POST** /api/bookings/guest/booking-price | | |[**getOpenBookingBasePrice**](#getopenbookingbaseprice) | **GET** /api/bookings/{bookingId}/open/base-price | | |[**getOpenBookings**](#getopenbookings) | **GET** /api/bookings/open | | |[**getQuickReservationSlots**](#getquickreservationslots) | **GET** /api/bookings/quick-reservations | | |[**joinOpenBooking**](#joinopenbooking) | **POST** /api/bookings/{bookingId}/open/join | | |[**leaveOpenBooking**](#leaveopenbooking) | **DELETE** /api/bookings/{bookingId}/open/leave | | # **createGuestBooking** > BookingResponse createGuestBooking(createGuestBookingRequest) Créer une réservation en tant qu\'invité (guest) Cette route permet à un utilisateur non authentifié de créer une réservation. Un compte guest sera automatiquement créé pour l\'utilisateur. Note: Si le club a activé le no-show (frais de non-présentation), la réponse contiendra un setupNoShowPaymentUrl pour configurer une méthode de paiement. Cette configuration est obligatoire pour les clubs avec no-show activé. ### Example ```typescript import { BookingsApi, Configuration, CreateGuestBookingRequest } from '@tennac-booking/sdk'; const configuration = new Configuration(); const apiInstance = new BookingsApi(configuration); let createGuestBookingRequest: CreateGuestBookingRequest; // const { status, data } = await apiInstance.createGuestBooking( createGuestBookingRequest ); ``` ### Parameters |Name | Type | Description | Notes| |------------- | ------------- | ------------- | -------------| | **createGuestBookingRequest** | **CreateGuestBookingRequest**| | | ### Return type **BookingResponse** ### Authorization No authorization required ### HTTP request headers - **Content-Type**: application/json - **Accept**: application/json ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| |**201** | Réservation guest créée avec succès | - | [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **estimateOpenBookingJoin** > OpenBookingJoinEstimateResponse estimateOpenBookingJoin(estimateOpenBookingJoinRequest) Estime le prix pour rejoindre une réservation ouverte avec détails de paiement. Le mode join open booking est strictement piloté par playerShares. ### Example ```typescript import { BookingsApi, Configuration, EstimateOpenBookingJoinRequest } from '@tennac-booking/sdk'; const configuration = new Configuration(); const apiInstance = new BookingsApi(configuration); let bookingId: string; // (default to undefined) let estimateOpenBookingJoinRequest: EstimateOpenBookingJoinRequest; // const { status, data } = await apiInstance.estimateOpenBookingJoin( bookingId, estimateOpenBookingJoinRequest ); ``` ### Parameters |Name | Type | Description | Notes| |------------- | ------------- | ------------- | -------------| | **estimateOpenBookingJoinRequest** | **EstimateOpenBookingJoinRequest**| | | | **bookingId** | [**string**] | | defaults to undefined| ### Return type **OpenBookingJoinEstimateResponse** ### Authorization [bearerAuth](../README.md#bearerAuth) ### HTTP request headers - **Content-Type**: application/json - **Accept**: application/json ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| |**200** | Prix à payer calculé | - | [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **getBookingHistory** > BookingHistoryPopulated getBookingHistory() Obtenir l\'historique d\'une réservation par ID ### Example ```typescript import { BookingsApi, Configuration } from '@tennac-booking/sdk'; const configuration = new Configuration(); const apiInstance = new BookingsApi(configuration); let bookingId: string; // (default to undefined) const { status, data } = await apiInstance.getBookingHistory( bookingId ); ``` ### Parameters |Name | Type | Description | Notes| |------------- | ------------- | ------------- | -------------| | **bookingId** | [**string**] | | defaults to undefined| ### Return type **BookingHistoryPopulated** ### Authorization [bearerAuth](../README.md#bearerAuth) ### HTTP request headers - **Content-Type**: Not defined - **Accept**: application/json ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| |**200** | Réservation récupérée | - | [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **getBookingPrice** > BookingPriceResponse getBookingPrice(bookingPriceBody) ### Example ```typescript import { BookingsApi, Configuration, BookingPriceBody } from '@tennac-booking/sdk'; const configuration = new Configuration(); const apiInstance = new BookingsApi(configuration); let bookingPriceBody: BookingPriceBody; // const { status, data } = await apiInstance.getBookingPrice( bookingPriceBody ); ``` ### Parameters |Name | Type | Description | Notes| |------------- | ------------- | ------------- | -------------| | **bookingPriceBody** | **BookingPriceBody**| | | ### Return type **BookingPriceResponse** ### Authorization [bearerAuth](../README.md#bearerAuth) ### HTTP request headers - **Content-Type**: application/json - **Accept**: application/json ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| |**200** | Réservations journalières récupérées | - | [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **getGuestBookingPrice** > GetGuestBookingPrice200Response getGuestBookingPrice(getGuestBookingPriceRequest) Calculer le prix d\'une réservation pour un invité (sans authentification) ### Example ```typescript import { BookingsApi, Configuration, GetGuestBookingPriceRequest } from '@tennac-booking/sdk'; const configuration = new Configuration(); const apiInstance = new BookingsApi(configuration); let getGuestBookingPriceRequest: GetGuestBookingPriceRequest; // const { status, data } = await apiInstance.getGuestBookingPrice( getGuestBookingPriceRequest ); ``` ### Parameters |Name | Type | Description | Notes| |------------- | ------------- | ------------- | -------------| | **getGuestBookingPriceRequest** | **GetGuestBookingPriceRequest**| | | ### Return type **GetGuestBookingPrice200Response** ### Authorization No authorization required ### HTTP request headers - **Content-Type**: application/json - **Accept**: application/json ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| |**200** | Prix de réservation calculé | - | [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **getOpenBookingBasePrice** > OpenBookingBasePriceResponse getOpenBookingBasePrice() Obtient le prix de base pour rejoindre une réservation ouverte. Cette route ne prend pas en compte un utilisateur spécifique, elle retourne simplement le prix de base par joueur stocké lors de la création. ### Example ```typescript import { BookingsApi, Configuration } from '@tennac-booking/sdk'; const configuration = new Configuration(); const apiInstance = new BookingsApi(configuration); let bookingId: string; // (default to undefined) const { status, data } = await apiInstance.getOpenBookingBasePrice( bookingId ); ``` ### Parameters |Name | Type | Description | Notes| |------------- | ------------- | ------------- | -------------| | **bookingId** | [**string**] | | defaults to undefined| ### Return type **OpenBookingBasePriceResponse** ### Authorization [bearerAuth](../README.md#bearerAuth) ### HTTP request headers - **Content-Type**: Not defined - **Accept**: application/json ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| |**200** | Prix de base calculé | - | [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **getOpenBookings** > OpenBookingsResponse getOpenBookings() ### Example ```typescript import { BookingsApi, Configuration } from '@tennac-booking/sdk'; const configuration = new Configuration(); const apiInstance = new BookingsApi(configuration); let clubId: string; // (optional) (default to undefined) let sportId: string; // (optional) (default to undefined) const { status, data } = await apiInstance.getOpenBookings( clubId, sportId ); ``` ### Parameters |Name | Type | Description | Notes| |------------- | ------------- | ------------- | -------------| | **clubId** | [**string**] | | (optional) defaults to undefined| | **sportId** | [**string**] | | (optional) defaults to undefined| ### Return type **OpenBookingsResponse** ### Authorization [bearerAuth](../README.md#bearerAuth) ### HTTP request headers - **Content-Type**: Not defined - **Accept**: application/json ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| |**200** | Liste des réservations ouvertes | - | [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **getQuickReservationSlots** > QuickReservationResponse getQuickReservationSlots() Recherche des créneaux disponibles pour une réservation rapide ### Example ```typescript import { BookingsApi, Configuration } from '@tennac-booking/sdk'; const configuration = new Configuration(); const apiInstance = new BookingsApi(configuration); let latitude: number; // (optional) (default to undefined) let longitude: number; // (optional) (default to undefined) let radiusInKm: number; // (optional) (default to undefined) let date: string; // (optional) (default to undefined) let sportId: string; // (optional) (default to undefined) let startTime: string; // (optional) (default to undefined) let minDuration: number; // (optional) (default to undefined) let maxDuration: number; // (optional) (default to undefined) let priceMax: number; // (optional) (default to undefined) let courtTypes: string; // (optional) (default to undefined) let surfaceTypes: string; // (optional) (default to undefined) let limitPerClub: number; // (optional) (default to undefined) let maxClubs: number; // (optional) (default to undefined) const { status, data } = await apiInstance.getQuickReservationSlots( latitude, longitude, radiusInKm, date, sportId, startTime, minDuration, maxDuration, priceMax, courtTypes, surfaceTypes, limitPerClub, maxClubs ); ``` ### Parameters |Name | Type | Description | Notes| |------------- | ------------- | ------------- | -------------| | **latitude** | [**number**] | | (optional) defaults to undefined| | **longitude** | [**number**] | | (optional) defaults to undefined| | **radiusInKm** | [**number**] | | (optional) defaults to undefined| | **date** | [**string**] | | (optional) defaults to undefined| | **sportId** | [**string**] | | (optional) defaults to undefined| | **startTime** | [**string**] | | (optional) defaults to undefined| | **minDuration** | [**number**] | | (optional) defaults to undefined| | **maxDuration** | [**number**] | | (optional) defaults to undefined| | **priceMax** | [**number**] | | (optional) defaults to undefined| | **courtTypes** | [**string**] | | (optional) defaults to undefined| | **surfaceTypes** | [**string**] | | (optional) defaults to undefined| | **limitPerClub** | [**number**] | | (optional) defaults to undefined| | **maxClubs** | [**number**] | | (optional) defaults to undefined| ### Return type **QuickReservationResponse** ### Authorization No authorization required ### HTTP request headers - **Content-Type**: Not defined - **Accept**: application/json ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| |**200** | Créneaux disponibles pour réservation rapide | - | [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **joinOpenBooking** > JoinOpenBookingResponse joinOpenBooking(joinOpenBookingRequest) ### Example ```typescript import { BookingsApi, Configuration, JoinOpenBookingRequest } from '@tennac-booking/sdk'; const configuration = new Configuration(); const apiInstance = new BookingsApi(configuration); let bookingId: string; // (default to undefined) let joinOpenBookingRequest: JoinOpenBookingRequest; // const { status, data } = await apiInstance.joinOpenBooking( bookingId, joinOpenBookingRequest ); ``` ### Parameters |Name | Type | Description | Notes| |------------- | ------------- | ------------- | -------------| | **joinOpenBookingRequest** | **JoinOpenBookingRequest**| | | | **bookingId** | [**string**] | | defaults to undefined| ### Return type **JoinOpenBookingResponse** ### Authorization [bearerAuth](../README.md#bearerAuth) ### HTTP request headers - **Content-Type**: application/json - **Accept**: application/json ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| |**200** | Créneau ouvert rejoint | - | [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **leaveOpenBooking** > LeaveEventWaitList200Response leaveOpenBooking() ### Example ```typescript import { BookingsApi, Configuration } from '@tennac-booking/sdk'; const configuration = new Configuration(); const apiInstance = new BookingsApi(configuration); let bookingId: string; // (default to undefined) const { status, data } = await apiInstance.leaveOpenBooking( bookingId ); ``` ### Parameters |Name | Type | Description | Notes| |------------- | ------------- | ------------- | -------------| | **bookingId** | [**string**] | | defaults to undefined| ### Return type **LeaveEventWaitList200Response** ### Authorization [bearerAuth](../README.md#bearerAuth) ### HTTP request headers - **Content-Type**: Not defined - **Accept**: application/json ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| |**200** | Créneau ouvert quitté | - | [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)