package com.seer.teach.pay.api.order.dto;


import com.seer.teach.common.enums.pay.PayOrderSourceEnum;
import lombok.Builder;
import lombok.Data;
import org.hibernate.validator.constraints.Length;

import jakarta.validation.constraints.NotEmpty;
import java.math.BigDecimal;
import java.time.LocalDateTime;

/**
 * 支付单创建 Request DTO
 */
@Builder
@Data
public class PayOrderCreateReqDTO {

    public static final int SUBJECT_MAX_LENGTH = 32;


    /**
     * 用户 IP
     */
    private String userIp;

    /**
     * 订单Sn
     */
    @NotEmpty(message = "商户订单Sn不能为空")
    private String merchantOrderSn;

    /**
     * 用户编号
     */
    private Integer userId;

    /**
     * 订单来源
     */
    private PayOrderSourceEnum orderSourceEnum;

    /**
     * 商户订单编号
     */
    @NotEmpty(message = "商户订单编号不能为空")
    private String merchantOrderId;

    /**
     * 商品标题
     */
    @NotEmpty(message = "商品标题不能为空")
    @Length(max = SUBJECT_MAX_LENGTH, message = "商品标题不能超过 32")
    private String subject;

    /**
     * 商品描述
     */
    private String description;


    /**
     * 支付金额，单位：分
     */
    private BigDecimal totalAmount;

    /**
     * 币种
     */
    private String currency;

    /**
     * 实际支付的学豆
     */
    private BigDecimal totalCoin;

    /**
     * 支付过期时间
     */
    private LocalDateTime expireTime;
    
    /**
     * 渠道编号
     */
    private Long channelId;
    
    /**
     * 渠道编码
     */
    private String channelCode;

}