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

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 = "DebtRepaymentPlanUpdateDto对象", title = "债务还款计划更新", description = "债务还款计划更新")
public class DebtRepaymentPlanUpdateDto {

    @Schema(name = "id", title = "主键")
    @NotNull(message = "id不能为空")
    private Long id;

    @Schema(name = "userId", title = "绑定的用户id")
    private Long userId;

    @Schema(name = "installmentNumber", title = "债务金额")
    @NotNull(message = "债务金额不能为空")
    private BigDecimal installmentNumber;

    @Schema(name = "installmentAmount", title = "每期应还金额")
    @NotNull(message = "每期应还金额不能为空")
    @Min(value = 0, message = "金额格式不正确")
    private BigDecimal installmentAmount;

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

    @Schema(name = "paidAmount", title = "已还金额")
    @NotNull(message = "已还金额不能为空")
    private BigDecimal paidAmount;

    @Schema(name = "paymentStatus", title = "还款状态")
    @NotNull(message = "还款状态不能为空")
    @NotBlank(message = "还款状态不能为空")
    private String paymentStatus;

}