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 java.math.BigDecimal;
import java.time.LocalDateTime;

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

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


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

    /**
     * 分账规则明细id
     */
    @Schema(description = "分账规则明细id")
    @ExcelProperty(value = "分账规则明细id", order = 3)
    private Long ruleDetailId;

    /**
     * 金额
     */
    @Schema(description = "金额")
    @ExcelProperty(value = "金额", order = 4)
    private BigDecimal money;

    /**
     * 手续费
     */
    @Schema(description = "手续费")
    @ExcelProperty(value = "手续费", order = 5)
    private BigDecimal fee;
    /**
     * 金额占比百分值
     */
    @Schema(description = "金额占比百分值")
    @ExcelProperty(value = "金额占比百分值", order = 5)

    private Integer moneyPercent;
    /**
     * 手续费占比百分值
     */
    @Schema(description = "手续费占比百分值")
    @ExcelProperty(value = "手续费占比百分值", order = 5)

    private Integer feePercent;
    /**
     * 账户类型  1 平台 2 商户 3 代理人
     * */
    private Integer type;

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

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

    /**
     * 分账完成时间
     */
    @Schema(description = "分账完成时间")
    @ExcelProperty(value = "分账完成时间", order = 5)
    private LocalDateTime separateTime;

    @Schema(description = "账户code")
    @ExcelProperty(value = "账户code", order = 6)
    private String accountCode;
    /**
     * 账户名称
     * */
    @Schema(description = "账户名称")
    @ExcelProperty(value = "账户名称", order = 7)
    private String accountName;
    /**
     * 订单id
     * */
    @Schema(description = "订单id")
    @ExcelProperty(value = "订单id", order = 8)
    private Long orderId;

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


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

    /**
     * 账户id
     * */
    private Long accountId;

}
