package cn.bunny.dao.vo.financial.admin;

import cn.bunny.dao.common.vo.BaseUserVo;
import com.alibaba.fastjson2.annotation.JSONField;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import com.fasterxml.jackson.datatype.jsr310.deser.LocalDateTimeDeserializer;
import com.fasterxml.jackson.datatype.jsr310.ser.LocalDateTimeSerializer;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.*;

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

@EqualsAndHashCode(callSuper = true)
@Data
@AllArgsConstructor
@NoArgsConstructor
@Builder
@Schema(name = "DebtRepaymentPlanVo对象", title = "债务还款计划返回对象", description = "债务还款计划返回对象")
public class DebtRepaymentPlanVo extends BaseUserVo {

    @Schema(name = "userId", title = "绑定的用户id")
    @JsonFormat(shape = JsonFormat.Shape.STRING)
    @JSONField(serializeUsing = ToStringSerializer.class)
    private Long userId;

    @Schema(name = "username", title = "用户名")
    private String username;

    @Schema(name = "installmentNumber", title = "债务金额")
    private BigDecimal installmentNumber;

    @Schema(name = "installmentAmount", title = "每期应还金额")
    private BigDecimal installmentAmount;

    @Schema(name = "dueDate", title = "还款截止日期")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonSerialize(using = LocalDateTimeSerializer.class)
    @JsonDeserialize(using = LocalDateTimeDeserializer.class)
    private LocalDateTime dueDate;

    @Schema(name = "paidAmount", title = "已还金额")
    private BigDecimal paidAmount;

    @Schema(name = "paymentStatus", title = "还款状态")
    private String paymentStatus;

}