package cn.novalon.gym.manage.member.entity;

import cn.novalon.gym.manage.member.enums.RefundStatus;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import org.springframework.data.relational.core.mapping.Column;
import org.springframework.data.relational.core.mapping.Table;

import java.math.BigDecimal;
import java.time.LocalDateTime;

/**
 * 退款申请实体 - 对应 refund_application 表
 * 
 * @author 付嘉
 * @date 2026-05-27
 */
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
@EqualsAndHashCode(callSuper = true)
@Table("refund_application")
public class RefundApplication extends BaseEntity {

    // 会员卡记录ID
    @Column("record_id")
    private Long recordId;

    // 会员ID
    @Column("member_id")
    private Long memberId;

    // 状态：PENDING-待审核, APPROVED-已批准, REJECTED-已拒绝, PROCESSING-处理中, SUCCESS-成功, FAILED-失败
    @Column("status")
    private RefundStatus status;

    // 退款原因
    @Column("reason")
    private String reason;

    // 申请时间
    @Column("apply_time")
    private LocalDateTime applyTime;

    // 审核时间
    @Column("audit_time")
    private LocalDateTime auditTime;

    // 审核人ID
    @Column("auditor_id")
    private Long auditorId;

    // 审核备注
    @Column("audit_remark")
    private String auditRemark;

    // 退款金额
    @Column("refund_amount")
    private BigDecimal refundAmount;

}
