import { PointOfInterest } from "../../data/datasource/api/entities/poi";

/**
 * Interface representing a Point of Interest (POI) model.
 */
export interface POIModel {
  /** Unique identifier for the point of interest */
  idPoint: number;
  /** Unique identifier for the place */
  idPlace: number;
  /** Name of the point of interest */
  name: string;
  /** Image name associated with the point of interest */
  imageName: string;
  /** Content description of the point of interest */
  content: string;
  /** Directions to the point of interest */
  directions: string;
}

/**
 * Converts a POIModel to a PointOfInterest entity.
 * @param model - The POIModel to convert.
 * @returns The converted PointOfInterest entity.
 */
export const POIModelToEntity = (model: POIModel): PointOfInterest => {
  const poi: PointOfInterest = {
    idPoint: model.idPoint,
    idPlace: model.idPlace,
    name: model.name,
    image: model.imageName,
    contentES: model.content,
    contentEN: model.content,
    directionsES: model.directions,
    directionsEN: model.directions,
  };
  return poi;
};
