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

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

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

  /**
   * Changes the password for an admin.
   * @param token - The authentication token.
   * @param prevPassword - The previous password.
   * @param newPassword - The new password.
   * @returns A promise that resolves when the password change is complete.
   */
  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 the given email.
   * @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 reset form values.
   * @param form - The reset password form values.
   * @returns A promise that resolves when the password reset is complete.
   */
  resetPassword(form: ResetPasswordValues): Promise<void>;
}
