import type { UserRole } from "../../shared/constants/user-roles.js"; export interface UserAccount { id: string; username: string; passwordHash: string; name: string; role: UserRole; active: boolean; mustChangePassword: boolean; createdAt: Date; updatedAt: Date; } export interface CreateUserAccount { username: string; name: string; role: UserRole; passwordHash: string; } export class UsernameAlreadyExistsStoreError extends Error {} export class LastActiveAdminStoreError extends Error {} export interface UserStore { list(): Promise; count(): Promise; findById(userId: string): Promise; findByUsername(username: string): Promise; create(input: CreateUserAccount): Promise; updateRoleAndActive( userId: string, patch: { role?: UserRole; active?: boolean } ): Promise; setPassword( userId: string, passwordHash: string, mustChangePassword: boolean ): Promise; }