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

import lombok.*;
import java.util.*;
import io.swagger.v3.oas.annotations.media.Schema;
import com.yolo.keyboard.framework.common.pojo.PageParam;
import java.math.BigDecimal;
import org.springframework.format.annotation.DateTimeFormat;
import java.time.LocalDateTime;

import static com.yolo.keyboard.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;

@Schema(description = "管理后台 - 用户内购记录分页 Request VO")
@Data
public class KeyboardUserPurchaseRecordsPageReqVO extends PageParam {

    @Schema(description = "用户 ID，关联到用户表，表示是哪位用户购买了产品", example = "21782")
    private Integer userId;

    @Schema(description = "购买的产品 ID，关联到产品表", example = "10744")
    private String productId;

    @Schema(description = "购买数量（如内购的金币数量，订阅的时长）")
    private Integer purchaseQuantity;

    @Schema(description = "实际支付价格", example = "17601")
    private BigDecimal price;

    @Schema(description = "货币类型（如美元 $）")
    private String currency;

    @Schema(description = "购买时间")
    @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
    private LocalDateTime[] purchaseTime;

    @Schema(description = "购买类型（如内购，订阅）", example = "1")
    private String purchaseType;

    @Schema(description = "购买状态（如已支付，待支付，退款）", example = "2")
    private String status;

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

    @Schema(description = "唯一的交易 ID，用于标识该购买操作", example = "14496")
    private String transactionId;

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

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

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

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

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

}