package com.gpf.pethospital.entity;

import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableLogic;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.annotation.IdType;
import lombok.Data;
import lombok.experimental.Accessors;

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

/**
 * 订单实体
 */
@Data
@Accessors(chain = true)
@TableName("order_info")
public class Order {

    @TableId(type = IdType.AUTO)
    private Long id;

    /**
     * 订单编号
     */
    private String orderNo;

    /**
     * 关联处方ID
     */
    private Long prescriptionId;

    /**
     * 就诊记录ID
     */
    private Long visitId;

    /**
     * 顾客ID
     */
    private Long customerId;

    /**
     * 订单金额
     */
    private BigDecimal amount;

    /**
     * 订单状态：UNPAID-未支付, PAID-已支付, CANCELLED-已取消, REFUNDING-退款中, REFUNDED-已退款
     */
    private String status;

    /**
     * 支付方式：OFFLINE-线下支付, ALIPAY-支付宝, WECHAT-微信支付
     */
    private String paymentMethod;

    /**
     * 支付时间
     */
    private LocalDateTime paymentTime;

    /**
     * 备注
     */
    private String remark;

    /**
     * 创建时间
     */
    @TableField(fill = FieldFill.INSERT)
    private LocalDateTime createTime;

    /**
     * 更新时间
     */
    @TableField(fill = FieldFill.INSERT_UPDATE)
    private LocalDateTime updateTime;

    /**
     * 删除标记：0-未删除, 1-已删除
     */
    @TableLogic
    private Integer deleted;
}
