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 = "SavingGoalVo对象", title = "用户储值返回内容", description = "用户储值返回内容")
public class SavingGoalVo 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 = "statusType", title = "完成状态")
    private String statusType;

    @Schema(name = "savingGoalName", title = "储值目标名称")
    private String savingGoalName;

    @Schema(name = "amount", title = "目标金额")
    private BigDecimal amount;

    @Schema(name = "startDuration", title = "开始目标时长")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonSerialize(using = LocalDateTimeSerializer.class)
    @JsonDeserialize(using = LocalDateTimeDeserializer.class)
    private LocalDateTime startDuration;

    @Schema(name = "endDuration", title = "结束目标时长")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonSerialize(using = LocalDateTimeSerializer.class)
    @JsonDeserialize(using = LocalDateTimeDeserializer.class)
    private LocalDateTime endDuration;

}