package com.erp.report.dto;

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

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

/**
 * 采购报表响应DTO
 */
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class PurchaseReportResponse {

    private PurchaseSummary summary;

    private List<PurchaseStatItem> list;

    private PaginationInfo pagination;

    @Data
    @Builder
    @NoArgsConstructor
    @AllArgsConstructor
    public static class PurchaseSummary {
        private Long totalCount;
        private Long completedCount;
        private Long underReviewCount;
        private Long approvedCount;
        private Long rejectedCount;
        private BigDecimal totalAmount;
        private BigDecimal totalFreight;
        private BigDecimal completedAmount;
    }

    @Data
    @Builder
    @NoArgsConstructor
    @AllArgsConstructor
    public static class PurchaseStatItem {
        private Long id;
        private String poNo;
        private Long warehouseId;
        private String warehouseName;
        private Long supplierId;
        private String supplierName;
        private String platform;
        private Long brandId;
        private String brandName;
        private LocalDate expectedArrival;
        private String shippingMethod;
        private BigDecimal totalAmount;
        private BigDecimal freight;
        private String status;
        private String statusLabel;
        private LocalDateTime createdAt;
    }

    @Data
    @Builder
    @NoArgsConstructor
    @AllArgsConstructor
    public static class PaginationInfo {
        private Integer currentPage;
        private Integer perPage;
        private Long total;
        private Integer lastPage;
    }
}
