package cn.bunny.dao.dto.financial.debtTracking;

import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.Min;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.NotNull;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

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

@Data
@AllArgsConstructor
@NoArgsConstructor
@Builder
@Schema(name = "DebtTrackingAddDto对象", title = "债务追踪添加", description = "债务追踪")
public class DebtTrackingAddDto {

    @Schema(name = "userId", title = "绑定的用户")
    @NotNull(message = "债务不能为空")
    private Long userId;

    @Schema(name = "debtorName", title = "债务人姓名")
    @NotNull(message = "债务人姓名不能为空")
    @NotBlank(message = "债务人姓名不能为空")
    private String debtorName;

    @Schema(name = "debtAmount", title = "债务金额")
    @NotNull(message = "债务不能为空")
    @Min(value = 0, message = "金额格式不正确")
    private BigDecimal debtAmount;

    @Schema(name = "debtType", title = "债务类型")
    @NotNull(message = "债务类型不能为空")
    @NotBlank(message = "债务类型不能为空")
    private String debtType;

    @Schema(name = "debtStatus", title = "债务状态")
    @NotNull(message = "债务状态不能为空")
    @NotBlank(message = "债务状态不能为空")
    private String debtStatus;

    @Schema(name = "dueDate", title = "还款截止日期")
    @NotNull(message = "债务不能为空")
    @JsonFormat(locale = "zh", timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime dueDate;

}

