package com.cf.imes.module.system.controller.admin.funds.delay.vo;

import com.alibaba.excel.annotation.ExcelIgnore;
import com.alibaba.excel.annotation.ExcelProperty;
import com.cf.imes.framework.excel.core.annotations.EnumFormat;
import com.cf.imes.framework.excel.core.convert.EnumBoolValConvert;
import com.cf.imes.framework.excel.core.convert.EnumConvert;
import com.cf.imes.framework.excel.core.enums.WhetherEnum;
import com.cf.imes.module.system.enums.pay.DurationUnitEnum;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;

import java.time.LocalDate;
import java.time.LocalDateTime;

import static com.cf.imes.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY;
import static com.cf.imes.framework.common.util.date.DateUtils.TIME_ZONE_DEFAULT;

/**
 * @author Gqr
 * @since 2025/9/15 14:45
 */
@Data
@Schema(description = "管理后台 - 产品延期记录 Response VO")
public class ProductDelayRespVO {
    @Schema(description = "延期记录编号")
    @ExcelIgnore
    private Long id;

    @Schema(description = "组织名称")
    @ExcelProperty("excel.export.head.product.delay.orgName")
    private String organName;

    @Schema(description = "产品名称")
    @ExcelProperty("excel.export.head.product.delay.productName")
    private String productName;

    @Schema(description = "延期时长")
    @ExcelProperty("excel.export.head.product.delay.delayDuration")
    private Integer delayDuration;

    @Schema(description = "延期时长单位")
    @ExcelProperty(value = "excel.export.head.product.delay.delayDurationUnit", converter = EnumConvert.class)
    @EnumFormat(value = DurationUnitEnum.class)
    private Integer delayDurationUnit;

    @Schema(description = "产品结束时间")
    @ExcelIgnore
    @JsonFormat(pattern = FORMAT_YEAR_MONTH_DAY, timezone = TIME_ZONE_DEFAULT)
    private LocalDate endTime;

    @Schema(description = "产品有效时间")
    @ExcelProperty("excel.export.head.product.delay.delayTime")
    @JsonFormat(pattern = FORMAT_YEAR_MONTH_DAY, timezone = TIME_ZONE_DEFAULT)
    private LocalDate delayTime;

    @Schema(description = "备注")
    @ExcelProperty("excel.export.head.product.delay.remark")
    private String remark;

    @Schema(description = "操作时间")
    @ExcelProperty("excel.export.head.product.delay.createTime")
    private LocalDateTime createTime;

    @Schema(description = "操作人")
    @ExcelProperty("excel.export.head.product.delay.creator")
    private String creator;

    @Schema(description = "是否支付")
    @ExcelProperty(value = "excel.export.head.product.delay.paid", converter = EnumBoolValConvert.class)
    @EnumFormat(value = WhetherEnum.class)
    private Boolean paid;
}
