package com.yhy.module.core.controller.admin.quota.vo;

import io.swagger.v3.oas.annotations.media.Schema;
import java.math.BigDecimal;
import java.time.LocalDateTime;
import java.util.List;
import java.util.Map;
import lombok.Data;

/**
 * 定额取费项（含费率项信息）响应 VO
 * 
 * 用于展示费率项一级节点与取费项的一对一关系
 */
@Schema(description = "管理后台 - 定额取费项（含费率项信息）响应")
@Data
public class QuotaFeeItemWithRateRespVO {

    // ==================== 费率项信息 ====================

    @Schema(description = "费率项ID（任意层级节点）", example = "5001")
    private Long rateItemId;

    @Schema(description = "费率项名称", example = "分部分项工程费")
    private String rateItemName;

    @Schema(description = "费率项自定义序号", example = "1")
    private String rateItemCustomCode;

    @Schema(description = "费率代号", example = "FBFX")
    private String rateCode;

    @Schema(description = "父节点ID", example = "5000")
    private Long parentId;

    @Schema(description = "节点类型", example = "directory")
    private String nodeType;

    @Schema(description = "子节点列表")
    private List<QuotaFeeItemWithRateRespVO> children;

    // ==================== 取费项信息 ====================

    @Schema(description = "取费项ID", example = "6001")
    private Long feeItemId;

    @Schema(description = "取费项名称", example = "企业管理费")
    private String feeItemName;

    @Schema(description = "取费项自定义序号", example = "一")
    private String feeItemCustomCode;

    @Schema(description = "计算基数")
    private Map<String, Object> calcBase;

    @Schema(description = "费率百分比", example = "15")
    private String ratePercentage;

    @Schema(description = "代号", example = "QYGLF")
    private String code;

    @Schema(description = "费用归属", example = "间接费")
    private String feeCategory;

    @Schema(description = "基数说明", example = "按除税基价和含税基价之和计算")
    private String baseDescription;

    @Schema(description = "排序字段", example = "1")
    private Integer sortOrder;

    @Schema(description = "是否隐藏", example = "false")
    private Boolean hidden;

    @Schema(description = "是否为变量", example = "false")
    private Boolean variable;

    // ==================== 关联信息 ====================

    @Schema(description = "模式节点ID", example = "1002")
    private Long catalogItemId;

    @Schema(description = "是否已配置取费项", example = "true")
    private Boolean hasFeeItem;

    @Schema(description = "系统行标识（ZHDJ=综合单价）", example = "ZHDJ")
    private String systemCode;

    // ==================== 计算结果（虚拟字段） ====================

    @Schema(description = "计算基数值（虚拟字段）", example = "100.00")
    private BigDecimal calcBaseValue;

    @Schema(description = "子单价（虚拟字段）", example = "15.00")
    private BigDecimal subPrice;

    @Schema(description = "费率实际值（虚拟字段，费率代号转换后的数值）", example = "15.00")
    private BigDecimal rateValue;

    // ==================== 时间信息 ====================

    @Schema(description = "创建时间")
    private LocalDateTime createTime;

    @Schema(description = "更新时间")
    private LocalDateTime updateTime;
}
