package com.erp.finance.dto;

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

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

/**
 * 财务报表响应
 */
@Data
@NoArgsConstructor
@AllArgsConstructor
@Builder
public class FinanceReportResponse {

    /** 时间范围 */
    private LocalDate startDate;
    private LocalDate endDate;

    // ========== 收入概况 ==========
    /** 订单收款总额 */
    private BigDecimal totalIncome;

    /** 退款总额 */
    private BigDecimal totalRefund;

    /** 净收入 */
    private BigDecimal netIncome;

    /** 收款笔数 */
    private Long incomeCount;

    /** 退款笔数 */
    private Long refundCount;

    // ========== 采购付款概况 ==========
    /** 应付账款总额 */
    private BigDecimal totalAccountsPayable;

    /** 已付款总额 */
    private BigDecimal totalPaid;

    /** 未付款总额 */
    private BigDecimal totalUnpaid;

    /** 逾期总额 */
    private BigDecimal overdueAmount;

    // ========== 趋势数据 ==========
    /** 每日收款金额列表 */
    private Map<String, BigDecimal> dailyIncome;

    /** 每日退款金额列表 */
    private Map<String, BigDecimal> dailyRefund;

    /** 每日付款金额列表 */
    private Map<String, BigDecimal> dailyPayment;

    // ========== 按平台/店铺统计 ==========
    /** 按平台收款统计 */
    private Map<String, BigDecimal> incomeByPlatform;

    /** 按店铺收款统计 */
    private Map<String, BigDecimal> incomeByShop;
}
