package com.yhy.module.core.controller.admin.workbench.vo.audit;

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

/**
 * 差异分部分项 Response VO（送审 - 审定）
 */
@Schema(description = "工作台 - 差异分部分项 Response VO")
@Data
public class AuditDiffDivisionRespVO {

    @Schema(description = "来源分部分项ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
    private Long sourceDivisionId;

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

    @Schema(description = "节点类型", requiredMode = Schema.RequiredMode.REQUIRED, example = "quota")
    private String nodeType;

    @Schema(description = "来源类型", example = "manual")
    private String sourceType;

    @Schema(description = "编码", example = "010101")
    private String code;

    @Schema(description = "名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "土石方工程")
    private String name;

    @Schema(description = "单位", example = "m3")
    private String unit;

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

    @Schema(description = "层级路径")
    private String[] path;

    @Schema(description = "量差（送审-审定）", example = "10.00")
    private BigDecimal diffQty;

    @Schema(description = "价差（送审-审定）", example = "5.50")
    private BigDecimal diffUnitPrice;

    @Schema(description = "费率差（送审-审定）", example = "0.5")
    private BigDecimal diffRate;

    @Schema(description = "合价差（送审-审定）", example = "550.00")
    private BigDecimal diffTotalPrice;

    @Schema(description = "变化类型：none/modify/add/delete", example = "modify")
    private String changeType;

    @Schema(description = "扩展属性")
    private Map<String, Object> attributes;

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

    // 变化类型常量
    public static final String CHANGE_TYPE_NONE = "none";
    public static final String CHANGE_TYPE_MODIFY = "modify";
    public static final String CHANGE_TYPE_ADD = "add";
    public static final String CHANGE_TYPE_DELETE = "delete";
}
