package com.erp.tenant.dto;

import jakarta.validation.constraints.*;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.math.BigDecimal;

/**
 * 创建/更新套餐请求DTO
 */
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class CreatePackageRequest {
    
    @NotBlank(message = "套餐名称不能为空")
    @Size(max = 100, message = "套餐名称不能超过100字符")
    private String name;
    
    @NotBlank(message = "套餐编码不能为空")
    @Size(max = 50, message = "套餐编码不能超过50字符")
    @Pattern(regexp = "^[a-zA-Z0-9_]+$", message = "套餐编码只能包含字母、数字和下划线")
    private String code;
    
    @NotBlank(message = "套餐类型不能为空")
    @Pattern(regexp = "^(month|year|perpetual)$", message = "套餐类型必须是：month, year, 或 perpetual")
    private String type;
    
    @NotNull(message = "价格不能为空")
    @DecimalMin(value = "0.00", message = "价格不能为负数")
    private BigDecimal price;
    
    @NotNull(message = "周期天数不能为空")
    @Min(value = 1, message = "周期天数至少为1")
    private Integer periodDays;
    
    private Integer sort;
    
    private Boolean isDefault;
    
    @Min(value = 0, message = "试用天数不能为负数")
    private Integer trialDays;
    
    @NotNull(message = "状态不能为空")
    private Integer status;
    
    /**
     * 功能列表
     */
    private String features;
    
    /**
     * 限制列表
     */
    private String limits;
    
    @Size(max = 500, message = "备注不能超过500字符")
    private String remark;
}
