package com.yida.data.mall.dto;

import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.format.annotation.DateTimeFormat;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotEmpty;
import java.io.Serializable;
import java.time.LocalDateTime;
import java.util.List;

/**
 * 保存缴费单请求类
 *
 * @author ZYJ
 * @date 2021/12/29
 */
@Data
@NoArgsConstructor
@AllArgsConstructor
@ApiModel(value = "BillSaveDTO", description = "保存缴费单请求类")
public class BillSaveDTO implements Serializable {

    private static final long serialVersionUID = -5657700973352522163L;

    @ApiModelProperty(value = "主键id")
    private Long id;

    @NotBlank
    @ApiModelProperty(value = "缴费单标题")
    private String billTitle;

    @NotBlank
    @ApiModelProperty(value = "缴费说明")
    private String billInstruction;

    @ApiModelProperty(value = "缴费单开始时间(编辑前的开始时间)")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime oldBillStartDate;

    @ApiModelProperty(value = "缴费单开始时间")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime billStartDate;

    @ApiModelProperty(value = "缴费单结束时间")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime billEndDate;

    @NotEmpty(message = "缴费项目列表不能为空")
    @ApiModelProperty(value = "缴费项目列表")
    private List<BillItemSaveDTO> itemList;

    @ApiModelProperty(value = "选择的学生列表")
    private List<BillChooseStudentDTO> achieveList;
}