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 = "DebtTrackingVo对象", title = "债务追踪返回内容", description = "债务追踪返回内容")
public class DebtTrackingVo extends BaseUserVo {

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

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

    @Schema(name = "debtorName", title = "债务人姓名")
    private String debtorName;

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

    @Schema(name = "debtType", title = "债务类型")
    private String debtType;

    @Schema(name = "debtStatus", title = "债务状态")
    private String debtStatus;

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

}