package com.ruoyi.project.business.domain;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableLogic;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.ruoyi.framework.aspectj.lang.annotation.Excel;
import com.ruoyi.framework.web.domain.BaseEntity;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;
import org.springframework.format.annotation.DateTimeFormat;

import javax.validation.constraints.Max;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.math.BigDecimal;
import java.time.LocalDateTime;

/**
 * 【请填写功能名称】对象 tb_currency
 *
 * @author ruoyi
 * @date 2024-05-14
 */
@EqualsAndHashCode(callSuper = true)
@Data
//@Accessors
@AllArgsConstructor
@NoArgsConstructor
@Builder
public class TbCurrency extends BaseEntity {
    private static final long serialVersionUID = 1L;

    /**
     * 币种ID
     */
    @TableId(type = IdType.AUTO)
    private Long currencyId;

    /**
     * 币种名称
     */
    @Excel(name = "币种名称")
    // TODO i18n
    @NotBlank(message = "币种名称不能为空")
    @Max(value = 50, message = "币种名称长度不能超过50个字符")
    private String currencyName;

    /**
     * 汇率
     */
    @Excel(name = "汇率")
    @NotNull(message = "汇率不能为空")
    private BigDecimal exchangeRate;

    /**
     * 生效日期
     */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime effectiveDate;

    /**
     * 失效日期
     */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime expirationDate;

    /**
     * 删除标记（0：启用  1：停用）
     */
    @TableLogic(delval = "1", value = "0")
    private String delFlag;

}
