package com.yolo.keyboard.controller.admin.userpurchaserecords.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 KeyboardUserPurchaseRecordsSaveReqVO {

    @Schema(description = "主键，自增，唯一标识每条购买记录", requiredMode = Schema.RequiredMode.REQUIRED, example = "1239")
    private Integer id;

    @Schema(description = "用户 ID，关联到用户表，表示是哪位用户购买了产品", requiredMode = Schema.RequiredMode.REQUIRED, example = "21782")
    @NotNull(message = "用户 ID，关联到用户表，表示是哪位用户购买了产品不能为空")
    private Integer userId;

    @Schema(description = "购买的产品 ID，关联到产品表", requiredMode = Schema.RequiredMode.REQUIRED, example = "10744")
    @NotEmpty(message = "购买的产品 ID，关联到产品表不能为空")
    private String productId;

    @Schema(description = "购买数量（如内购的金币数量，订阅的时长）", requiredMode = Schema.RequiredMode.REQUIRED)
    @NotNull(message = "购买数量（如内购的金币数量，订阅的时长）不能为空")
    private Integer purchaseQuantity;

    @Schema(description = "实际支付价格", requiredMode = Schema.RequiredMode.REQUIRED, example = "17601")
    @NotNull(message = "实际支付价格不能为空")
    private BigDecimal price;

    @Schema(description = "货币类型（如美元 $）", requiredMode = Schema.RequiredMode.REQUIRED)
    @NotEmpty(message = "货币类型（如美元 $）不能为空")
    private String currency;

    @Schema(description = "购买时间")
    private LocalDateTime purchaseTime;

    @Schema(description = "购买类型（如内购，订阅）", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
    @NotEmpty(message = "购买类型（如内购，订阅）不能为空")
    private String purchaseType;

    @Schema(description = "购买状态（如已支付，待支付，退款）", requiredMode = Schema.RequiredMode.REQUIRED, example = "2")
    @NotEmpty(message = "购买状态（如已支付，待支付，退款）不能为空")
    private String status;

    @Schema(description = "支付方式（如信用卡，支付宝等）")
    private String paymentMethod;

    @Schema(description = "唯一的交易 ID，用于标识该购买操作", requiredMode = Schema.RequiredMode.REQUIRED, example = "14496")
    @NotEmpty(message = "唯一的交易 ID，用于标识该购买操作不能为空")
    private String transactionId;

    @Schema(description = "苹果的原始交易 ID", example = "3666")
    private String originalTransactionId;

    @Schema(description = "购买的产品 ID 列表（JSON 格式或数组）")
    private Object productIds;

    @Schema(description = "苹果返回的购买时间")
    private LocalDateTime purchaseDate;

    @Schema(description = "苹果返回的过期时间（如果有）")
    private LocalDateTime expiresDate;

    @Schema(description = "苹果的环境（如 Sandbox 或 Production）")
    private String environment;

}