package com.yd.csf.service.vo;

import com.baomidou.mybatisplus.annotation.TableField;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.yd.csf.service.model.FortuneAccount;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import org.springframework.beans.BeanUtils;

import java.math.BigDecimal;
import java.util.Date;
import java.util.List;
import java.util.Map;

@Data
public class FortuneAccountVO {
    /**
     * fortuneAccount id
     */
    @Schema(description = "fortuneAccount id")
    private Long id;

    /**
     * 出账记录业务id
     */
    @Schema(description = "出账记录业务id")
    private String fortuneAccountBizId;

    /**
     * 出账业务编号（出账年月 + 转介人内部编号（后6位）（如无，用0补齐）+流水号（6位））
     */
    @Schema(description = "出账业务编号")
    private String businessNo;

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

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

    /**
     * 所属团队
     */
    @Schema(description = "所属团队")
    private String team;

    /**
     * 发放币种
     */
    @Schema(description = "发放币种")
    private String payoutCurrency;

    /**
     * 发放金额
     */
    @Schema(description = "发放金额")
    private BigDecimal payoutAmount;

    /**
     * 港币出账金额
     */
    @Schema(description = "港币出账金额")
    private BigDecimal hkdAmount;

    /**
     * 出账状态
     */
    @Schema(description = "出账状态 1=可出账 2=已出账")
    private String status;

    /**
     * 出账日期
     */
    @Schema(description = "出账日期")
    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
    private Date fortuneAccountDate;

    /**
     * 出账月
     */
    @Schema(description = "出账月")
    @JsonFormat(pattern = "yyyyMM", timezone = "GMT+8")
    private Date fortuneAccountMonth;

    /**
     * 出账信息
     */
    @Schema(description = "出账信息")
    private List<Map<String, Object>> fortuneList;

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


    /**
     * 对象转封装类
     *
     * @param fortuneAccount
     * @return
     */
    public static FortuneAccountVO objToVo(FortuneAccount fortuneAccount) {
        if (fortuneAccount == null) {
            return null;
        }
        FortuneAccountVO fortuneAccountVO = new FortuneAccountVO();
        BeanUtils.copyProperties(fortuneAccount, fortuneAccountVO);

        return fortuneAccountVO;
    }
}
