package com.petshop.backend.dto.service;

import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.NotNull;
import jakarta.validation.constraints.Positive;
import java.math.BigDecimal;
import java.util.HashSet;
import java.util.Objects;
import java.util.Set;

public class ServiceRequest {
    @NotBlank(message = "Service name is required")
    private String serviceName;

    private String serviceDesc;

    @NotNull(message = "Service price is required")
    @Positive(message = "Price must be positive")
    private BigDecimal servicePrice;

    @NotNull(message = "Service duration is required")
    @Positive(message = "Duration must be positive")
    private Integer serviceDuration;

    private Set<String> species = new HashSet<>();

    public String getServiceName() {
        return serviceName;
    }

    public void setServiceName(String serviceName) {
        this.serviceName = serviceName;
    }

    public String getServiceDesc() {
        return serviceDesc;
    }

    public void setServiceDesc(String serviceDesc) {
        this.serviceDesc = serviceDesc;
    }

    public BigDecimal getServicePrice() {
        return servicePrice;
    }

    public void setServicePrice(BigDecimal servicePrice) {
        this.servicePrice = servicePrice;
    }

    public Integer getServiceDuration() {
        return serviceDuration;
    }

    public void setServiceDuration(Integer serviceDuration) {
        this.serviceDuration = serviceDuration;
    }

    public Set<String> getSpecies() {
        return species;
    }

    public void setSpecies(Set<String> species) {
        this.species = species;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        ServiceRequest that = (ServiceRequest) o;
        return Objects.equals(serviceName, that.serviceName) &&
                Objects.equals(serviceDesc, that.serviceDesc) &&
                Objects.equals(servicePrice, that.servicePrice) &&
                Objects.equals(serviceDuration, that.serviceDuration) &&
                Objects.equals(species, that.species);
    }

    @Override
    public int hashCode() {
        return Objects.hash(serviceName, serviceDesc, servicePrice, serviceDuration, species);
    }

    @Override
    public String toString() {
        return "ServiceRequest{" +
                "serviceName='" + serviceName + '\'' +
                ", serviceDesc='" + serviceDesc + '\'' +
                ", servicePrice=" + servicePrice +
                ", serviceDuration=" + serviceDuration +
                ", species=" + species +
                '}';
    }
}
