import { State } from "./api/entities/state";
import { Town } from "./api/entities/town";

/**
 * Interface representing a data source for handling town-related operations.
 */
export interface TownDatasourceInf {
  /**
   * Retrieves a list of states.
   * @returns A promise that resolves to an array of State objects.
   */
  getStates(): Promise<State[]>;

  /**
   * Registers a new town.
   * @param form - The town data to register.
   */
  registerTown(form: Town): void;

  /**
   * Retrieves a list of towns by state.
   * @param idState - The ID of the state.
   * @param stateName - The name of the state.
   * @returns A promise that resolves to an array of Town objects.
   */
  getTownsByState(idState: number, stateName: string): Promise<Town[]>;

  /**
   * Retrieves a town by its ID.
   * @param idTown - The ID of the town.
   * @returns A promise that resolves to a Town object.
   */
  getTown(idTown: number): Promise<Town>;

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