package ru.otus.mobile.config;

import ru.otus.mobile.db.DbClient;

import java.util.function.BiConsumer;

public enum TestAccount {
    WISHLISTS("user1us", "user1us", DbClient::clearWishlistsByUsername),
    GIFTS("user2us", "user2us", DbClient::clearGiftsByUsername),
    RESERVATION("user3us", "user3us", DbClient::doNothing),
    RESERVATION_OWNER("user4us", "user4us", DbClient::clearReservationByUsername);

    private final String username;
    private final String password;
    private final BiConsumer<DbClient, String> dataPreparation;

    TestAccount(String username, String password, BiConsumer<DbClient, String> dataPreparation) {
        this.username = username;
        this.password = password;
        this.dataPreparation = dataPreparation;
    }

    public String username() {
        return username;
    }

    public String password() {
        return password;
    }

    public BiConsumer<DbClient, String> dataPreparation() {
        return dataPreparation;
    }
}
