package com.example.petstoremobile.viewmodels;

import androidx.lifecycle.LiveData;
import androidx.lifecycle.ViewModel;

import com.example.petstoremobile.dtos.PetDTO;
import com.example.petstoremobile.repositories.PetRepository;
import com.example.petstoremobile.utils.Resource;

import javax.inject.Inject;

import dagger.hilt.android.lifecycle.HiltViewModel;
import okhttp3.MultipartBody;

@HiltViewModel
public class PetProfileViewModel extends ViewModel {
    private final PetRepository repository;

    @Inject
    public PetProfileViewModel(PetRepository repository) {
        this.repository = repository;
    }

    public LiveData<Resource<PetDTO>> getPetById(Long id) {
        return repository.getPetById(id);
    }

    public LiveData<Resource<Void>> uploadPetImage(Long id, MultipartBody.Part image) {
        return repository.uploadPetImage(id, image);
    }

    public LiveData<Resource<Void>> deletePetImage(Long id) {
        return repository.deletePetImage(id);
    }
}
