package com.czg.order.entity;

import com.mybatisflex.annotation.Column;
import com.mybatisflex.annotation.Id;
import com.mybatisflex.annotation.KeyType;
import com.mybatisflex.annotation.Table;
import lombok.Data;

import java.io.Serial;
import java.io.Serializable;
import java.math.BigDecimal;
import java.time.LocalDateTime;

/**
 * 挂账账单
 *
 * @author Tankaikai tankaikai@aliyun.com
 * @since 1.0 2025-03-04
 */
@Data
@Table("tb_credit_buyer_order")
public class CreditBuyerOrder implements Serializable {

    @Serial
    private static final long serialVersionUID = 1L;

    /**
     * id
     */
    @Id(keyType = KeyType.Auto)
    private Long id;
    /**
     * 订单id
     */
    private Long orderId;
    /**
     * 挂账人编码
     */
    private String creditBuyerId;
    /**
     * 订单金额
     */
    private BigDecimal orderAmount;
    /**
     * 已付金额
     */
    private BigDecimal paidAmount;
    /**
     * 退款金额
     */
    private BigDecimal refundAmount;
    /**
     * 状态 unpaid-未付款 partial-部分支付 paid-已付款
     */
    private String status;
    /**
     * 最近一次付款时间
     */
    private LocalDateTime lastPaymentTime;
    /**
     * 最近一次付款方式
     */
    private String lastPaymentMethod;
    /**
     * 备注
     */
    private String remark;
    @Column(onInsertValue = "now()")
    private LocalDateTime createTime;
}