package com.yolo.keyboard.controller.admin.productitems.vo;

import io.swagger.v3.oas.annotations.media.Schema;
import lombok.*;
import java.util.*;
import jakarta.validation.constraints.*;
import java.math.BigDecimal;
import org.springframework.format.annotation.DateTimeFormat;
import java.time.LocalDateTime;

@Schema(description = "管理后台 - 内购商品新增/修改 Request VO")
@Data
public class KeyboardProductItemsSaveReqVO {

    @Schema(description = "主键，自增，唯一标识每个产品项", requiredMode = Schema.RequiredMode.REQUIRED, example = "7855")
    private Long id;

    @Schema(description = "产品标识符，唯一标识每个产品（如 com.loveKey.nyx.2month）", requiredMode = Schema.RequiredMode.REQUIRED, example = "15153")
    @NotEmpty(message = "产品标识符，唯一标识每个产品（如 com.loveKey.nyx.2month）不能为空")
    private String productId;

    @Schema(description = "产品类型，区分订阅（subscription）和内购（in-app-purchase）", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
    @NotEmpty(message = "产品类型，区分订阅（subscription）和内购（in-app-purchase）不能为空")
    private String type;

    @Schema(description = "产品名称（如 100, 2）", requiredMode = Schema.RequiredMode.REQUIRED, example = "芋艿")
    @NotEmpty(message = "产品名称（如 100, 2）不能为空")
    private String name;

    @Schema(description = "产品单位（如 金币，个月）")
    private String unit;

    @Schema(description = "订阅时长的数值部分（如 2）")
    private Integer durationValue;

    @Schema(description = "订阅时长的单位部分（如 月，天）")
    private String durationUnit;

    @Schema(description = "产品价格", requiredMode = Schema.RequiredMode.REQUIRED, example = "25376")
    @NotNull(message = "产品价格不能为空")
    private BigDecimal price;

    @Schema(description = "产品的货币单位，如美元（$）", requiredMode = Schema.RequiredMode.REQUIRED)
    @NotEmpty(message = "产品的货币单位，如美元（$）不能为空")
    private String currency;

    @Schema(description = "产品的描述，提供更多细节信息", example = "你说的对")
    private String description;

    @Schema(description = "产品项的创建时间，默认当前时间")
    private LocalDateTime createdAt;

    @Schema(description = "产品项的最后更新时间，更新时自动设置为当前时间")
    private LocalDateTime updatedAt;

    @Schema(description = "订阅时长的具体天数", requiredMode = Schema.RequiredMode.REQUIRED)
    @NotNull(message = "订阅时长的具体天数不能为空")
    private Integer durationDays;

}