package com.erp.purchase.dto;

import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.AllArgsConstructor;
import lombok.Builder;

import java.math.BigDecimal;
import java.time.LocalDate;

/**
 * 采购统计DTO
 */
public class PurchaseStatisticsDTO {

    @Data
    @NoArgsConstructor
    @AllArgsConstructor
    @Builder
    public static class QueryRequest {
        private LocalDate startDate;
        private LocalDate endDate;
        private Long supplierId;
        private Long warehouseId;
    }

    @Data
    @NoArgsConstructor
    @AllArgsConstructor
    @Builder
    public static class SummaryVO {
        /** 采购订单数 */
        private Long orderCount;
        /** 采购总金额 */
        private BigDecimal totalAmount;
        /** 采购总税额 */
        private BigDecimal totalTax;
        /** 含税总金额 */
        private BigDecimal totalWithTax;
        /** 已入库金额 */
        private BigDecimal inboundAmount;
        /** 入库率 */
        private BigDecimal inboundRate;
        /** 已付款金额 */
        private BigDecimal paidAmount;
        /** 付款率 */
        private BigDecimal paymentRate;
        /** 采购退货数 */
        private Long returnCount;
        /** 退货金额 */
        private BigDecimal returnAmount;
        /** 退货率 */
        private BigDecimal returnRate;
    }

    @Data
    @NoArgsConstructor
    @AllArgsConstructor
    @Builder
    public static class SupplierStatVO {
        private Long supplierId;
        private String supplierName;
        private Long orderCount;
        private BigDecimal totalAmount;
        private BigDecimal inboundAmount;
        private BigDecimal inboundRate;
        private BigDecimal paidAmount;
    }

    @Data
    @NoArgsConstructor
    @AllArgsConstructor
    @Builder
    public static class DailyStatVO {
        private LocalDate date;
        private Long orderCount;
        private BigDecimal amount;
        private Integer inboundQuantity;
    }
}
