package com.petshop.backend.dto.inventory;

import jakarta.validation.constraints.NotNull;
import jakarta.validation.constraints.PositiveOrZero;
import java.util.Objects;

public class InventoryRequest {
    @NotNull(message = "Product ID is required")
    private Long prodId;

    @NotNull(message = "Quantity is required")
    @PositiveOrZero(message = "Quantity must be zero or positive")
    private Integer quantity;

    private Long storeId;

    public Long getProdId() {
        return prodId;
    }

    public void setProdId(Long prodId) {
        this.prodId = prodId;
    }

    public Integer getQuantity() {
        return quantity;
    }

    public void setQuantity(Integer quantity) {
        this.quantity = quantity;
    }

    public Long getStoreId() {
        return storeId;
    }

    public void setStoreId(Long storeId) {
        this.storeId = storeId;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        InventoryRequest that = (InventoryRequest) o;
        return Objects.equals(prodId, that.prodId) &&
                Objects.equals(quantity, that.quantity) &&
                Objects.equals(storeId, that.storeId);
    }

    @Override
    public int hashCode() {
        return Objects.hash(prodId, quantity, storeId);
    }

    @Override
    public String toString() {
        return "InventoryRequest{" +
                "prodId=" + prodId +
                ", quantity=" + quantity +
                ", storeId=" + storeId +
                '}';
    }
}
