package com.wzj.soopin.transaction.domain.po;


import com.alibaba.excel.annotation.ExcelProperty;
import com.baomidou.mybatisplus.annotation.*;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Builder;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.apache.ibatis.type.JdbcType;
import org.dromara.common.core.domain.model.BaseAudit;
import org.dromara.common.mybatis.core.domain.BaseEntity;

import java.math.BigDecimal;

/**
 * 订单分账
 *
 * @author wzj
 * @date 2023-03-07
 */
@EqualsAndHashCode(callSuper = true)
@Schema(description = "订单分账")
@Data
@Builder(toBuilder = true)
@TableName("trans_divide")
public class Divide extends BaseAudit {

    /**
     * 主键
     */
    @Schema(description = "主键")
    @ExcelProperty(value = "主键", order = 1)
    @TableId
    private Long id;

    /**
     * 分账规则id
     */
    @Schema(description = "分账规则id")
    @ExcelProperty(value = "分账规则id", order = 2)
    private Long ruleId;

    /**
     * 订单id
     * */
    @Schema(description = "订单id")
    @ExcelProperty(value = "订单id", order = 8)
    private Long orderId;

    /**
     * 订单编号
     * */
    @Schema(description = "订单编号")
    @ExcelProperty(value = "订单编号", order = 9)
    private String orderSn;

    /**
     * 订单明细id
     * */
    @Schema(description = "订单明细id")
    @ExcelProperty(value = "订单明细id", order = 8)
    private Long orderItemId;

    /**
     * 订单明细金额
     */
    @Schema(description = "订单明细金额")
    @ExcelProperty(value = "订单明细金额", order = 4)
    private BigDecimal orderItemMoney;

    /**
     * 手续费
     */
    @Schema(description = "手续费")
    @ExcelProperty(value = "手续费", order = 5)
    private BigDecimal fee;
    /**
     * 金额分配比例
     */
    @Schema(description = "实际分账金额")
    @ExcelProperty(value = "实际分账金额", order = 5)
    private BigDecimal actualMoney;

    /**
     * 状态
     * 枚举类型见 {@link com.wzj.soopin.transaction.enums.DivideStatus}
     */
    @Schema(description = "状态")
    @ExcelProperty(value = "状态", order = 5)
    private Integer status;

    /**
     * 分账总单流水号
     */
    @Schema(description = "分账总单流水号")
    @ExcelProperty(value = "分账总单流水号", order = 5)
    private String separateBatchTrace;

    @TableLogic(value = "0", delval = "1")
    @TableField(value = "del_flag", fill = FieldFill.INSERT, jdbcType = JdbcType.CHAR)
    private String delFlag;


}
