package com.example.petstoremobile.repositories;

import androidx.lifecycle.LiveData;

import com.example.petstoremobile.api.UserApi;
import com.example.petstoremobile.dtos.PageResponse;
import com.example.petstoremobile.dtos.UserDTO;
import com.example.petstoremobile.utils.Resource;

import javax.inject.Inject;
import javax.inject.Singleton;

@Singleton
public class UserRepository extends BaseRepository {
    private final UserApi userApi;

    @Inject
    public UserRepository(UserApi userApi) {
        super("UserRepository");
        this.userApi = userApi;
    }

    public LiveData<Resource<PageResponse<UserDTO>>> getUsers(String role, int page, int size) {
        return executeCall(userApi.getUsers(role, page, size));
    }
}
