package com.hotwj.platform.pay.domain.bo;

import com.hotwj.platform.pay.domain.PayOrder;
import org.dromara.common.mybatis.core.domain.BaseEntity;
import org.dromara.common.core.validate.AddGroup;
import org.dromara.common.core.validate.EditGroup;
import io.github.linpeilie.annotations.AutoMapper;
import lombok.Data;
import lombok.EqualsAndHashCode;
import jakarta.validation.constraints.*;

import java.math.BigDecimal;
import java.util.Date;

import com.fasterxml.jackson.annotation.JsonFormat;

/**
 * 支付订单
 * 业务对象 pay_order
 *
 * @author shihongwei
 * @date 2026-05-08
 */
@Data
@EqualsAndHashCode(callSuper = true)
@AutoMapper(target = PayOrder.class, reverseConvertGenerate = false)
public class PayOrderBo extends BaseEntity {

    /**
     * 支付订单编号
     */
    @NotNull(message = "支付订单编号不能为空", groups = {EditGroup.class})
    private Long id;

    /**
     * 应用编号
     */
    @NotNull(message = "应用编号不能为空", groups = {AddGroup.class, EditGroup.class})
    private Long appId;

    /**
     * 业务订单号
     */
    private String merchantOrderNo;

    /**
     * 业务类型
     */
    private String bizOrderType;

    /**
     * 业务主键
     */
    private Long bizOrderId;

    /**
     * 订单标题
     */
    private String subject;

    /**
     * 订单描述
     */
    private String body;

    /**
     * 渠道编号
     */
    private Long channelId;

    /**
     * 渠道编码
     */
    private String channelCode;

    /**
     * 异步通知地址
     */
    @NotBlank(message = "异步通知地址不能为空", groups = {AddGroup.class, EditGroup.class})
    private String notifyUrl;

    /**
     * 同步跳转地址
     */
    private String returnUrl;

    /**
     * 支付金额
     */
    @NotNull(message = "支付金额不能为空", groups = {AddGroup.class, EditGroup.class})
    private BigDecimal price;

    /**
     * 支付状态
     */
    @NotNull(message = "支付状态不能为空", groups = {AddGroup.class, EditGroup.class})
    private Long status;

    /**
     * 用户 IP
     */
    @NotBlank(message = "用户 IP不能为空", groups = {AddGroup.class, EditGroup.class})
    private String userIp;

    /**
     * 订单失效时间
     */
    @NotNull(message = "订单失效时间不能为空", groups = {AddGroup.class, EditGroup.class})
    private Date expireTime;

    /**
     * 订单支付成功时间
     */
    private Date successTime;

    /**
     * 支付成功的订单拓展单编号
     */
    private Long extensionId;

    /**
     * 支付订单号
     */
    private String no;

    /**
     * 渠道用户编号
     */
    private String channelUserId;

    /**
     * 渠道订单号
     */
    private String channelOrderNo;

    /**
     * 0=正常, 1=已删除
     */
    private Long isDeleted;


}
