package com.sonic.lion.domain.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.time.LocalDateTime;

/**
 * 订阅回调记录表
 */
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
@TableName(value = "user_subscription_notify", autoResultMap = true)
public class UserSubscriptionNotify {
    @TableId(type = IdType.AUTO)
    private Long id;
    private Platform platform;
    private String messageId;
    /**
     * 苹果退款表的主键ID
     */
    private Long appleRefundRecordId;
    private String content;
    private String type;
    private STATUS status;
    private String subscriptionId;
    private LocalDateTime createTime;
    private LocalDateTime editTime;
    private String extend;

    public enum Platform {
        STRIPE, IOS, GOOGLE
    }

    public enum STATUS {
        PROCESSING, FINISHED, FAIL
    }
}
