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

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 = "BudgetCategoryUpdateDto对象", title = "预算分类更新", description = "预算分类更新")
public class BudgetCategoryUpdateDto {

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

    @Schema(name = "parentId", title = "父级id")
    @NotNull(message = "父级id不能为空")
    private Long parentId;

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

    @Schema(name = "categoryName", title = "分类名称")
    @NotNull(message = "分类名称不能为空")
    @NotBlank(message = "分类名称不能为空")
    private String categoryName;

    @Schema(name = "budgetName", title = "预算名称")
    @NotNull(message = "预算名称不能为空")
    @NotBlank(message = "预算名称不能为空")
    private String budgetName;

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

    @Schema(name = "amount", title = "预算金额")
    @NotNull(message = "预算金额不能为空")
    @Min(value = 0, message = "不能低于0")
    private BigDecimal amount;

    @Schema(name = "period", title = "预算周期")
    @NotNull(message = "预算周期不能为空")
    @JsonFormat(locale = "zh", timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime startPeriod;

    @Schema(name = "period", title = "预算周期")
    @NotNull(message = "预算周期不能为空")
    @JsonFormat(locale = "zh", timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime endPeriod;

}

