package com.erp.tenant.dto.finance;

import com.erp.common.core.model.PageResponse;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.math.BigDecimal;
import java.util.List;

/**
 * 财务记录分页响应DTO
 */
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class FinancePageResponse {

    private FinanceSummary summary;
    private PageResponse<FinanceItemDTO> records;

    @Data
    @Builder
    @NoArgsConstructor
    @AllArgsConstructor
    public static class FinanceSummary {
        private BigDecimal totalIncome;
        private BigDecimal totalExpense;
        private BigDecimal netProfit;
        private Long orderCount;
        private Long poCount;
        private BigDecimal freightIncome;
        private BigDecimal freightExpense;
    }

    @Data
    @Builder
    @NoArgsConstructor
    @AllArgsConstructor
    public static class FinanceItemDTO {
        private Long id;
        private String recordNo;
        private String type;
        private String typeText;
        private String sourceType;
        private String sourceNo;
        private BigDecimal amount;
        private BigDecimal verifiedAmount;
        private BigDecimal discountAmount;
        private String counterpartyName;
        private String paymentMethod;
        private String paymentSerial;
        private String paymentTime;
        private Integer status;
        private String statusText;
        private String summary;
        private String remark;
        private String createdAt;
    }
}
