user-service
    Preparing search index...

    Repository interface for managing and retrieving user entities.

    interface UserRepository {
        findAllHouseholdUsers(): Promise<User[]>;
        findHouseholdUserById(id: UserID): Promise<User | null>;
        findUserById(id: UserID): Promise<User | null>;
        findUserByUsername(username: string): Promise<User | null>;
        removeHouseholdUser(id: UserID): Promise<void>;
        saveNewHouseholdUser(user: User): Promise<User>;
        updateUser(user: User): Promise<User>;
    }

    Implemented by

    Index

    Methods

    • Finds a household user by their unique identifier.

      Parameters

      • id: UserID

        The unique household user identifier.

      Returns Promise<User | null>

      A promise that resolves to the household user if found, or null if no user exists with the given ID.

    • Finds a user by their unique identifier.

      Parameters

      • id: UserID

        The unique user identifier.

      Returns Promise<User | null>

      A promise that resolves to the user if found, or null if no user exists with the given ID.

    • Finds a user by their unique username.

      Parameters

      • username: string

        The username to search for.

      Returns Promise<User | null>

      A promise that resolves to the user if found, or null if no user exists with the given username.

    • Removes a household user from the repository.

      Parameters

      • id: UserID

        The id of the user to remove.

      Returns Promise<void>

      A promise that resolves once the user has been removed.