package com.jeesharp.business.modules.member.entity;

import com.baomidou.mybatisplus.annotation.TableName;
import com.jeesharp.framework.mybatis.core.dataobject.BaseEntity;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;

import java.time.LocalDateTime;

/**
 * 华为 IAP 业务订单
 *
 * @author jeesharp
 */
@Data
@EqualsAndHashCode(callSuper = true)
@TableName("app_iap_order")
@Schema(description = "华为IAP业务订单")
public class AppIapOrder extends BaseEntity<AppIapOrder> {

    @Schema(description = "业务订单号")
    private String orderNo;

    @Schema(description = "会员ID")
    private String memberId;

    @Schema(description = "套餐：0-月卡 1-季卡 2-年卡")
    private Integer planId;

    @Schema(description = "华为 IAP 商品 ID")
    private String skuProductId;

    @Schema(description = "套餐名称")
    private String skuName;

    @Schema(description = "付费等级编码")
    private String levelCode;

    @Schema(description = "华为订单号 purchaseOrderId")
    private String huaweiPurchaseOrderId;

    @Schema(description = "华为 purchaseToken")
    private String huaweiPurchaseToken;

    @Schema(description = "验单/JWS 摘要")
    private String purchasePayload;

    @Schema(description = "支付状态：0-待确认 1-已支付 2-失败 3-关闭")
    private Integer payStatus;

    @Schema(description = "发货状态：0-待发货 1-已发货 2-失败 3-已冲正")
    private Integer fulfillStatus;

    @Schema(description = "退款状态：0-无 1-处理中 2-成功 3-失败")
    private Integer refundStatus;

    @Schema(description = "支付确认时间")
    private LocalDateTime payTime;

    @Schema(description = "发货完成时间")
    private LocalDateTime fulfillTime;

    @Schema(description = "关联 app_member_vip.id")
    private String memberVipId;
}
