import { IRepository } from "@/contexts/common/domain";
import { Email, ICollection, IQueryCriteria, Name, UniqueID } from "@shared/contexts";
import { User } from "../entities";

export interface IUserRepository extends IRepository<any> {
  create(user: User): Promise<void>;
  update(user: User): Promise<void>;

  getById(id: UniqueID): Promise<User | null>;
  findUserByEmail(email: Email): Promise<User | null>;
  findAll(queryCriteria?: IQueryCriteria): Promise<ICollection<User>>;

  removeById(id: UniqueID): Promise<void>;

  existsAdminUser(): Promise<boolean>;
  existsUserWithId(id: UniqueID): Promise<boolean>;
  existsUserWithName(name: Name): Promise<boolean>;
  existsUserWithEmail(email: Email): Promise<boolean>;
}
