package com.yolo.keyboard.controller.admin.tenantwithdraworder.vo;

import io.swagger.v3.oas.annotations.media.Schema;
import lombok.*;

import java.math.BigDecimal;
import java.util.*;
import org.springframework.format.annotation.DateTimeFormat;
import java.time.LocalDateTime;
import cn.idev.excel.annotation.*;

@Schema(description = "管理后台 - 租户提现订单表（申请-审核-打款-完成/失败） Response VO")
@Data
@ExcelIgnoreUnannotated
public class KeyboardTenantWithdrawOrderRespVO {

    @Schema(description = "主键", requiredMode = Schema.RequiredMode.REQUIRED, example = "20442")
    @ExcelProperty("主键")
    private Long id;

    @Schema(description = "提现单号（业务唯一）", requiredMode = Schema.RequiredMode.REQUIRED)
    @ExcelProperty("提现单号（业务唯一）")
    private String withdrawNo;

    @Schema(description = "业务幂等号（防重复提交）")
    @ExcelProperty("业务幂等号（防重复提交）")
    private String bizNo;

    @Schema(description = "币种（默认 CNY）", requiredMode = Schema.RequiredMode.REQUIRED)
    @ExcelProperty("币种（默认 CNY）")
    private String currency;

    @Schema(description = "提现申请金额（单位：元）", requiredMode = Schema.RequiredMode.REQUIRED)
    @ExcelProperty("提现申请金额（单位：元）")
    private BigDecimal amount;

    @Schema(description = "手续费金额（单位：元）", requiredMode = Schema.RequiredMode.REQUIRED)
    @ExcelProperty("手续费金额（单位：元）")
    private BigDecimal feeAmount;

    @Schema(description = "实际到账金额（单位：元 = amount - fee_amount）", requiredMode = Schema.RequiredMode.REQUIRED)
    @ExcelProperty("实际到账金额（单位：元 = amount - fee_amount）")
    private BigDecimal actualAmount;

    @Schema(description = "打款渠道：BANK/ALIPAY/WECHAT/PAYPAL 等", requiredMode = Schema.RequiredMode.REQUIRED)
    @ExcelProperty("打款渠道：BANK/ALIPAY/WECHAT/PAYPAL 等")
    private String payChannel;

    @Schema(description = "收款方类型：PERSON（个人）/COMPANY（企业）", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
    @ExcelProperty("收款方类型：PERSON（个人）/COMPANY（企业）")
    private String payeeType;

    @Schema(description = "收款人姓名或公司名称（快照）", example = "张三")
    @ExcelProperty("收款人姓名或公司名称（快照）")
    private String payeeName;

    @Schema(description = "收款账号（银行卡/支付宝等，建议加密或脱敏）", example = "5425")
    @ExcelProperty("收款账号（银行卡/支付宝等，建议加密或脱敏）")
    private String payeeAccount;

    @Schema(description = "收款银行名称", example = "芋艿")
    @ExcelProperty("收款银行名称")
    private String payeeBankName;

    @Schema(description = "银行编码（可选）")
    @ExcelProperty("银行编码（可选）")
    private String payeeBankCode;

    @Schema(description = "银行支行名称（可选）")
    @ExcelProperty("银行支行名称（可选）")
    private String payeeBankBranch;

    @Schema(description = "提现状态：APPLIED/APPROVED/REJECTED/PAYING/PAID/FAILED/CANCELED", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
    @ExcelProperty("提现状态：APPLIED/APPROVED/REJECTED/PAYING/PAID/FAILED/CANCELED")
    private String status;

    @Schema(description = "审核状态：PENDING/PASSED/REJECTED", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
    @ExcelProperty("审核状态：PENDING/PASSED/REJECTED")
    private String auditStatus;

    @Schema(description = "拒绝原因或打款失败原因", example = "不香")
    @ExcelProperty("拒绝原因或打款失败原因")
    private String reason;

    @Schema(description = "提现申请时间", requiredMode = Schema.RequiredMode.REQUIRED)
    @ExcelProperty("提现申请时间")
    private LocalDateTime applyTime;

    @Schema(description = "审核完成时间")
    @ExcelProperty("审核完成时间")
    private LocalDateTime auditTime;

    @Schema(description = "发起打款时间（请求第三方）")
    @ExcelProperty("发起打款时间（请求第三方）")
    private LocalDateTime payTime;

    @Schema(description = "打款成功时间（第三方确认）")
    @ExcelProperty("打款成功时间（第三方确认）")
    private LocalDateTime paidTime;

    @Schema(description = "业务终态时间（成功/失败/取消）")
    @ExcelProperty("业务终态时间（成功/失败/取消）")
    private LocalDateTime finishTime;

    @Schema(description = "打款批次号（内部使用）")
    @ExcelProperty("打款批次号（内部使用）")
    private String payerBatchNo;

    @Schema(description = "第三方打款交易号/流水号（对账用）")
    @ExcelProperty("第三方打款交易号/流水号（对账用）")
    private String channelTradeNo;

    @Schema(description = "第三方返回的原始报文（用于排查）")
    @ExcelProperty("第三方返回的原始报文（用于排查）")
    private Object channelRaw;

    @Schema(description = "关联余额流水ID（冻结/扣减/返还）", example = "30641")
    @ExcelProperty("关联余额流水ID（冻结/扣减/返还）")
    private Long balanceTxnId;

    @Schema(description = "乐观锁版本号", requiredMode = Schema.RequiredMode.REQUIRED)
    @ExcelProperty("乐观锁版本号")
    private Integer version;

    @Schema(description = "提现申请人ID", example = "6858")
    @ExcelProperty("提现申请人ID")
    private Long creatorId;

    @Schema(description = "审核人ID", example = "15039")
    @ExcelProperty("审核人ID")
    private Long auditorId;

    @Schema(description = "打款操作人ID", example = "8850")
    @ExcelProperty("打款操作人ID")
    private Long payerId;

    @Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED)
    @ExcelProperty("创建时间")
    private LocalDateTime createdAt;

    @Schema(description = "更新时间", requiredMode = Schema.RequiredMode.REQUIRED)
    @ExcelProperty("更新时间")
    private LocalDateTime updatedAt;

    @Schema(description = "租户编号", example = "1")
    @ExcelProperty("租户编号")
    private Long tenantId;

    @Schema(description = "租户名称", example = "芋道源码")
    @ExcelProperty("租户名称")
    private String tenantName;

}