user-service
    Preparing search index...

    Service interface for managing users.

    interface UserService {
        createHouseholdUser(username: string, password: string): Promise<User>;
        deleteHouseholdUser(id: UserID): Promise<void>;
        getHouseholdUsers(): Promise<User[]>;
        getUser(id: UserID): Promise<User | null>;
        getUserByUsername(username: string): Promise<User | null>;
        resetAdminPassword(resetCode: string, password: string): Promise<User>;
        updateHouseholdUsername(id: UserID, username: string): Promise<User>;
        updatePassword(id: UserID, password: string): Promise<User>;
    }

    Implemented by

    Index

    Methods

    • Creates a new household user with the given username and password.

      Parameters

      • username: string

        The username of the new user.

      • password: string

        The password of the new user.

      Returns Promise<User>

      A promise that resolves to the newly created user.

    • Deletes an existing household user by their unique identifier.

      Parameters

      • id: UserID

        The unique identifier of the household user to delete.

      Returns Promise<void>

      A promise that resolves once the household user has been removed.

    • Retrieves a single user by their unique identifier.

      Parameters

      • id: UserID

        The unique identifier of the user.

      Returns Promise<User | null>

      A promise that resolves to the user if found, or null otherwise.

    • Retrieves a single user by their unique username.

      Parameters

      • username: string

        The unique username of the user.

      Returns Promise<User | null>

      A promise that resolves to the user if found, or null otherwise.

    • Resets the admin's password using a valid reset code.

      Parameters

      • resetCode: string

        The reset code issued for password recovery.

      • password: string

        The new password to assign to the admin.

      Returns Promise<User>

      A promise that resolves to the updated admin user.

    • Updates the username of a household user.

      Parameters

      • id: UserID

        The unique identifier of the household user.

      • username: string

        The new username to assign.

      Returns Promise<User>

      A promise that resolves to the updated user.

    • Updates the password of a user.

      Parameters

      • id: UserID

        The unique identifier of the user.

      • password: string

        The new password to set.

      Returns Promise<User>

      A promise that resolves to the updated user.