package com.yd.csf.feign.response.expectedfortune;

import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;

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

@Data
public class ApiExpectedFortunePageResponse {

    /**
     * 主键ID
     */
    @Schema(description = "expected fortune id")
    private Long id;

    /**
     * 是否实际出账：1-预计出账 2-实际出账
     */
    @Schema(description = "是否实际出账：1-预计出账 2-实际出账")
    private Integer type;

    /**
     * 预计出账表唯一业务id
     */
    @Schema(description = "expected fortune biz id")
    private String expectedFortuneBizId;

    /**
     * 应付款类型 R-关联保单应付款 U-非关联保单应付款
     */
    @Schema(description = "应付款类型 R-关联保单应付款 U-非关联保单应付款")
    private String fortuneBizType;

    /**
     * 应付款编号
     */
    @Schema(description = "应付款编号（业务编号）")
    private String payableNo;

    /**
     * 保单号
     */
    @Schema(description = "policy no")
    private String policyNo;

    /**
     * 期交保费
     */
    @Schema(description = "期交保费")
    private BigDecimal premium;

    /**
     * 保险公司 ID
     */
    @Schema(description = "保险公司 ID")
    private String insuranceCompanyBizId;

    /**
     * 保险公司
     */
    @Schema(description = "保险公司")
    private String insuranceCompany;

    /**
     * 产品计划 ID
     */
    @Schema(description = "产品计划 ID")
    private String productLaunchBizId;

    /**
     * 产品计划
     */
    @Schema(description = "产品计划")
    private String productName;

    /**
     * 出账期数(1=第一年; 2=第二年; 3=第三年; 4=第四年; 5=第五年)
     */
    @Schema(description = "出账期数")
    private Integer fortunePeriod;

    /**
     * 总期数
     */
    @Schema(description = "总期数")
    private Integer fortuneTotalPeriod;

    /**
     * 转介人
     */
    @Schema(description = "转介人")
    private String broker;

    /**
     * 转介人业务ID
     */
    @Schema(description = "转介人业务ID")
    private String brokerBizId;

    /**
     * 转介人等级名称
     */
    @Schema(description = "转介人等级名称")
    private String brokerGradeName;

    /**
     * 团队名称
     */
    @Schema(description = "团队名称")
    private String team;

    /**
     * 所属团队业务ID
     */
    @Schema(description = "所属团队业务ID")
    private String teamBizId;

    /**
     * 出账项目
     */
    @Schema(description = "出账项目")
    private String fortuneName;

    /**
     * 出账项目类型
     */
    @Schema(description = "出账项目类型 字典值: csf_fortune_type")
    private String fortuneType;

    /**
     * 持有比例
     */
    @Schema(description = "持有比例")
    private String brokerRatio;


    // ========== 保单币种及金额（基本法币种） ==========
    /**
     * 保单币种金额（保单币种金额 = 标准发佣金额 * 转介人介绍费占比）
     */
    @Schema(description = "保单币种金额（保单币种金额 = 标准发佣金额 * 转介人介绍费占比）")
    private BigDecimal ruleAmount;

    /**
     * 保单币种
     */
    @Schema(description = "保单币种")
    private String ruleCurrency;

    /**
     * 预计出账-默认保单币种汇率（保单币种 -> 港币汇率）
     */
    @Schema(description = "预计出账-默认保单币种汇率（保单币种 -> 港币汇率）")
    private BigDecimal defaultExchangeRate;

    /**
     * 预计出账-HKD应出账金额
     */
    @Schema(description = "预计出账-HKD应出账金额")
    private BigDecimal hkdAmount;


    // ========== 原币种及金额 ==========
    @Schema(description = "原币种")
    private String originalCurrency;

    @Schema(description = "原币种金额")
    private BigDecimal originalAmount;

    @Schema(description = "原币→港币汇率")
    private BigDecimal originalToHkdRate;


    // ========== 发放币种及金额 ==========
    @Schema(description = "发放币种")
    private String payoutCurrency;
    @Schema(description = "发放币种金额")
    private BigDecimal payoutAmount;
    @Schema(description = "港币→发放币汇率")
    private BigDecimal hkdToPayoutRate;


    /**
     * 实际出账-本次出账金额（HKD）
     */
    @Schema(description = "实际出账-本次出账金额（HKD）")
    private BigDecimal currentPaymentHkdAmount;

    /**
     * 实际出账-本期结算汇率
     */
    @Schema(description = "实际出账-本期结算汇率")
    private BigDecimal exchangeRate;

    /**
     * 出账币种名称
     */
    @Schema(description = "出账币种名称")
    private String currencyName;

    /**
     * 出账状态
     */
    @Schema(description = "出账状态 0=待出账 1=可出帐，待检核 2=完成出账 3=部分出账 4=保留 5=已失效 6=可出账, 已检核 7=未找到当前预计出账对应的来佣 字典值: csf_expected_fortune_status")
    private String status;

    /**
     * 出账状态-修改理由
     */
    @Schema(description = "出账状态-修改理由")
    private String statusDesc;

    /**
     * 出账年月（估）
     */
    @Schema(description = "出账年月（估）")
    @JsonFormat(pattern = "yyyy-MM", timezone = "GMT+8")
    private LocalDate payoutDate;

    /**
     * 出账年月（实）
     */
    @Schema(description = "出账年月（实）")
    @JsonFormat(pattern = "yyyy-MM", timezone = "GMT+8")
    private LocalDate actualPayoutDate;

    /**
     * 预计出账-已出账金额（HKD）
     */
    @Schema(description = "预计出账-已出账金额（HKD）")
    private BigDecimal paidAmount;

    /**
     * 预计出账-待出账金额
     */
    @Schema(description = "预计出账-待出账金额")
    private BigDecimal unpaidAmount;

    /**
     * 预计出账-已出账金额比例 已出账金额/应出账金额
     */
    @Schema(description = "预计出账-已出账金额比例 已出账金额/应出账金额")
    private BigDecimal paidRatio;

    /**
     * 预计出账-待出账比例 待出账金额/应出账金额
     */
    @Schema(description = "预计出账-待出账比例 待出账金额/应出账金额")
    private BigDecimal unpaidRatio;

    /**
     * 备注
     */
    @Schema(description = "备注")
    private String remark;

    /**
     * 创建人
     */
    @Schema(description = "创建人")
    private String creatorName;

    /**
     * 创建时间
     */
    @Schema(description = "创建时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private LocalDateTime createTime;

    /**
     * 更新时间（操作时间）
     */
    @Schema(description = "更新时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private LocalDateTime updateTime;

    /**
     * 发佣率(对应职级)
     */
    @Schema(description = "发佣率(对应职级)")
    private String commissionRatio;
}
