import {
  Admin,
  AdminFormValues,
} from "../../data/datasource/api/entities/admin_form_values";
import { ResetPasswordValues } from "../../data/datasource/api/entities/reset_password_values";

/**
 * Interface representing a repository for handling admin-related operations.
 */
export interface AdminRepositoryInf {
  /**
   * Registers a new admin.
   * @param form - The admin data to register.
   * @returns A promise that resolves when the admin is registered.
   */
  registerAdmin(form: AdminFormValues): Promise<void>;

  /**
   * Retrieves admin information based on a token.
   * @param token - The token to authenticate the request.
   * @returns A promise that resolves to an Admin object.
   */
  getAdminInfo(token: string): Promise<Admin>;

  /**
   * Changes the password for an admin.
   * @param token - The token to authenticate the request.
   * @param prevPassword - The previous password.
   * @param newPassword - The new password.
   * @returns A promise that resolves when the password is changed.
   */
  changePassword(
    token: string,
    prevPassword: string,
    newPassword: string
  ): Promise<void>;

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

  /**
   * Generates a reset code for password recovery.
   * @param email - The email address to send the reset code to.
   * @returns A promise that resolves when the reset code is generated.
   */
  generateResetCode(email: string): Promise<void>;

  /**
   * Resets the password using the provided form values.
   * @param form - The reset password form values.
   * @returns A promise that resolves when the password is reset.
   */
  resetPassword(form: ResetPasswordValues): Promise<void>;
}
