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

import com.cf.imes.framework.common.pojo.PageParam;
import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.DecimalMax;
import jakarta.validation.constraints.DecimalMin;
import jakarta.validation.constraints.Digits;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.ToString;
import org.springframework.format.annotation.DateTimeFormat;

import java.math.BigDecimal;
import java.time.LocalDateTime;

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

/**
 * @author Gqr
 * @since 2025/8/21 16:11
 */
@Data
@Schema(description = "管理后台 - 组织开票金额和可开票列表 Req VO")
@EqualsAndHashCode(callSuper = true)
@ToString(callSuper = true)
public class InvoiceAmountAndAvailablePageReqVO extends PageParam {
    @Schema(description = "费用账期", example = "[2022-07-01 01:01:01 ,2022-07-01 01:01:01]")
    @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
    private LocalDateTime[] createTime;

    @Schema(description = "开票金额起")
    @DecimalMin(value = "0", message = "{invoce.page.amount.min}")
    @DecimalMax(value = "100000", message = "{invoice.page.amount.max}")
    @Digits(integer = 6, fraction = 2, message = "{invoice.page.amount.format}")
    private BigDecimal invoiceAmountStart;

    @Schema(description = "开票金额止")
    @DecimalMin(value = "0", message = "{invoce.page.amount.min}")
    @DecimalMax(value = "100000", message = "{invoice.page.amount.max}")
    @Digits(integer = 6, fraction = 2, message = "{invoice.page.amount.format}")
    private BigDecimal invoiceAmountEnd;
}
