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

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 = "SavingGoalAddDto对象", title = "用户储值添加", description = "用户储值添加")
public class SavingGoalAddDto {

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

    @Schema(name = "statusType", title = "完成状态")
    @NotNull(message = "完成状态不能为空")
    @NotBlank(message = "完成状态不能为空")
    private String statusType;

    @Schema(name = "savingGoalName", title = "储值目标名称")
    @NotNull(message = "储值目标名称不能为空")
    @NotBlank(message = "储值目标名称不能为空")
    private String savingGoalName;

    @Schema(name = "amount", title = "目标金额")
    @NotNull(message = "目标金额不能为空")
    @Min(value = 0, message = "储蓄值不能小于0")
    private BigDecimal amount;

    @Schema(name = "startDuration", title = "开始目标时长")
    @NotNull(message = "开始目标时长不能为空")
    @JsonFormat(locale = "zh", timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime startDuration;

    @Schema(name = "endDuration", title = "结束目标时长")
    @NotNull(message = "结束目标时长不能为空")
    @JsonFormat(locale = "zh", timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime endDuration;

}