package com.petshop.backend.dto.refund;

import java.math.BigDecimal;
import java.time.LocalDateTime;
import java.util.List;
import java.util.Objects;

public class RefundResponse {
    private Long id;
    private Long saleId;
    private Long customerId;
    private BigDecimal amount;
    private String reason;
    private String status;
    private List<RefundItemResponse> items;
    private LocalDateTime createdAt;
    private LocalDateTime updatedAt;

    public RefundResponse() {
    }

    public RefundResponse(Long id, Long saleId, Long customerId, BigDecimal amount, String reason, String status, List<RefundItemResponse> items, LocalDateTime createdAt, LocalDateTime updatedAt) {
        this.id = id;
        this.saleId = saleId;
        this.customerId = customerId;
        this.amount = amount;
        this.reason = reason;
        this.status = status;
        this.items = items;
        this.createdAt = createdAt;
        this.updatedAt = updatedAt;
    }
// ...
    public List<RefundItemResponse> getItems() {
        return items;
    }

    public void setItems(List<RefundItemResponse> items) {
        this.items = items;
    }

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public Long getSaleId() {
        return saleId;
    }

    public void setSaleId(Long saleId) {
        this.saleId = saleId;
    }

    public Long getCustomerId() {
        return customerId;
    }

    public void setCustomerId(Long customerId) {
        this.customerId = customerId;
    }

    public BigDecimal getAmount() {
        return amount;
    }

    public void setAmount(BigDecimal amount) {
        this.amount = amount;
    }

    public String getReason() {
        return reason;
    }

    public void setReason(String reason) {
        this.reason = reason;
    }

    public String getStatus() {
        return status;
    }

    public void setStatus(String status) {
        this.status = status;
    }

    public LocalDateTime getCreatedAt() {
        return createdAt;
    }

    public void setCreatedAt(LocalDateTime createdAt) {
        this.createdAt = createdAt;
    }

    public LocalDateTime getUpdatedAt() {
        return updatedAt;
    }

    public void setUpdatedAt(LocalDateTime updatedAt) {
        this.updatedAt = updatedAt;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        RefundResponse that = (RefundResponse) o;
        return Objects.equals(id, that.id) &&
                Objects.equals(saleId, that.saleId) &&
                Objects.equals(customerId, that.customerId) &&
                Objects.equals(amount, that.amount) &&
                Objects.equals(reason, that.reason) &&
                Objects.equals(status, that.status) &&
                Objects.equals(createdAt, that.createdAt) &&
                Objects.equals(updatedAt, that.updatedAt);
    }

    @Override
    public int hashCode() {
        return Objects.hash(id, saleId, customerId, amount, reason, status, createdAt, updatedAt);
    }

    @Override
    public String toString() {
        return "RefundResponse{" +
                "id=" + id +
                ", saleId=" + saleId +
                ", customerId=" + customerId +
                ", amount=" + amount +
                ", reason='" + reason + '\'' +
                ", status='" + status + '\'' +
                ", createdAt=" + createdAt +
                ", updatedAt=" + updatedAt +
                '}';
    }
}
