package com.example.petstoremobile.viewmodels;

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

import com.example.petstoremobile.dtos.PurchaseOrderDTO;
import com.example.petstoremobile.repositories.PurchaseOrderRepository;
import com.example.petstoremobile.utils.Resource;

import javax.inject.Inject;

import dagger.hilt.android.lifecycle.HiltViewModel;

@HiltViewModel
public class PurchaseOrderDetailViewModel extends ViewModel {
    private final PurchaseOrderRepository repository;

    @Inject
    public PurchaseOrderDetailViewModel(PurchaseOrderRepository repository) {
        this.repository = repository;
    }

    public LiveData<Resource<PurchaseOrderDTO>> loadPurchaseOrder(long id) {
        return repository.getPurchaseOrderById(id);
    }
}
