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;

@Schema(description = "管理后台 - 定额调整设置与明细组合 Response VO")
@Data
public class QuotaAdjustmentCombinedRespVO {

    @Schema(description = "调整设置ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
    private Long id;

    @Schema(description = "定额子目ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
    private Long quotaItemId;

    @Schema(description = "调整名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "人工费调整")
    private String name;

    @Schema(description = "定额值", example = "100.00")
    private BigDecimal quotaValue;

    @Schema(description = "调整内容", example = "冬季施工增加10%")
    private String adjustmentContent;

    @Schema(description = "调整类型（字典）", requiredMode = Schema.RequiredMode.REQUIRED, example = "percentage")
    private String adjustmentType;

    @Schema(description = "调整规则（JSON）")
    private Map<String, Object> adjustmentRules;

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

    @Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED)
    private LocalDateTime createTime;

    @Schema(description = "调整明细列表")
    private List<DetailItem> details;

    @Schema(description = "调整明细项")
    @Data
    public static class DetailItem {

        @Schema(description = "明细ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
        private Long id;

        @Schema(description = "调整设置ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
        private Long adjustmentSettingId;

        @Schema(description = "定额调整编号（引用其他调整设置ID）", example = "2")
        private Long adjustmentCode;

        @Schema(description = "调整内容", example = "增加10%")
        private String adjustment;

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

        @Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED)
        private LocalDateTime createTime;
    }

}
