import { Place } from "./api/entities/place";

/**
 * Interface representing a data source for handling place-related operations.
 */
export interface PlaceDatasourceInf {
  /**
   * Registers a new place.
   * @param form - The place data to register.
   * @returns A promise that resolves when the registration is complete.
   */
  registerPlace(form: Place): Promise<void>;

  /**
   * Retrieves a list of places by town.
   * @param idTown - The ID of the town.
   * @returns A promise that resolves to an array of Place objects.
   */
  getPlacesByTown(idTown: number): Promise<Place[]>;

  /**
   * Retrieves a place by its ID.
   * @param idPlace - The ID of the place.
   * @returns A promise that resolves to a Place object.
   */
  getPlaceById(idPlace: number): Promise<Place>;

  /**
   * Updates an existing place.
   * @param place - The updated place data.
   * @returns A promise that resolves when the update is complete.
   */
  updatePlace(place: Place): Promise<void>;
}
