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


import com.cf.imes.framework.common.pojo.PageParam;
import com.cf.imes.module.system.validation.invoice.InvoiceStatusValid;
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;

@Schema(description = "管理后台 - 组织可开票的数据明细 Request VO")
@Data
@EqualsAndHashCode(callSuper = true)
@ToString(callSuper = true)
public class InvoiceDetailsPageReqVO extends PageParam {


    @Schema(description = "组织ID")
    private Long organId;


    @Schema(description = "发票号")
    private String invoiceNo;


    @Schema(description = "发票状态，1待开票 2已开票 3开票失败")
    @InvoiceStatusValid
    private Integer status;


    @Schema(description = "申请人")
    private String creator;


    @Schema(description = "开票人")
    private String invoicePerson;


    @Schema(description = "发票金额起")
    @DecimalMin(value = "0", message = "{invoice.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 = "{invoice.page.amount.min}")
    @DecimalMax(value = "100000", message = "{invoice.page.amount.max}")
    @Digits(integer = 6, fraction = 2, message = "{invoice.page.amount.format}")
    private BigDecimal invoiceAmountEnd;

    @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[] invoiceTime;


    @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;


}
