package com.zhongshu.card.server.core.domain.payment;

import com.github.microservice.types.payment.PaymentType;
import com.zhongshu.card.server.core.domain.base.SuperMain;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.checkerframework.common.aliasing.qual.NonLeaked;
import org.springframework.data.mongodb.core.index.Indexed;
import org.springframework.data.mongodb.core.mapping.DBRef;
import org.springframework.data.mongodb.core.mapping.Document;

/**
 * @author TRX
 * @date 2024/11/13
 */
@Data
@Document
@AllArgsConstructor
@NoArgsConstructor
@NonLeaked
public class PaymentProcess extends SuperMain {

    @Schema(description = "订单数据")
    @DBRef(lazy = true)
    private ExpenseFlow expenseFlow;

    @Indexed
    @Schema(description = "订单号")
    private String paymentNo;

    @Indexed
    @Schema(description = "支付渠道")
    private PaymentType paymentType;

    @Schema(description = "是否在支付中")
    private Boolean isPaying = Boolean.FALSE;

    @Schema(description = "支付是否成功")
    private Boolean isPaySuccess;

    @Schema(description = "支付结果备注，返回给设备展示")
    private String payRemark;

    @Schema(description = "支付开始时间")
    private Long payStartTime;

    @Schema(description = "支付结束时间")
    private Long payEndTime;

    @Schema(description = "支付耗用的时间")
    private Long payMillis = 0L;

    @Schema(description = "可度时间")
    private String timeStr;
}
