package com.cool.store.request.xgj;

import com.cool.store.entity.FranchiseFeeDO;
import com.cool.store.entity.LinePayDO;
import com.cool.store.entity.fees.WalletPayInfoDO;
import io.swagger.annotations.ApiModelProperty;
import io.swagger.models.auth.In;
import lombok.Data;

import javax.validation.constraints.DecimalMin;
import java.math.BigDecimal;

/**
 * @Author suzhuhong
 * @Date 2025/6/4 9:33
 * @Version 1.0
 */
@Data
public class ReceiptRequest {

    @ApiModelProperty( "CRM系统门店ID")
    private Long shopId;

    @ApiModelProperty( "账单ID")
    private Integer billId;

    @ApiModelProperty( "收款单ID")
    private String receiptId;

    @ApiModelProperty( "付款人")
    private String payer1;

    @ApiModelProperty("付款金额")
    private BigDecimal paymentAmount;

    @ApiModelProperty("交易流水号")
    private String transactionNumber;

    @ApiModelProperty( "开户行")
    private String bankName;

    @ApiModelProperty( "开户支行")
    private String branchBankName;

    @ApiModelProperty( "付款账号")
    private String payAccount;

    @ApiModelProperty( "付款凭证")
    private String payPic;

    @ApiModelProperty( "付款方式")
    private Integer payWay = 0;

    @ApiModelProperty( "认领状态")
    private Integer claimStatus = 0;

    @ApiModelProperty( "删除标识")
    private Integer deleted = 0;

    @ApiModelProperty("品牌")
    private Integer joinBrand;

    public ReceiptRequest() {
    }

    public ReceiptRequest(Long shopId, Integer billId, LinePayDO payDO){
        this.setShopId(shopId);
        this.setBillId(billId);
        this.setReceiptId(payDO.getPaymentReceiptCode());
        this.setPayer1(payDO.getPayUserName());
        this.setPayAccount(payDO.getPayAccount());
        this.setTransactionNumber(payDO.getPaySerialNumber());
        this.setBankName(payDO.getBankName());
        this.setBranchBankName(payDO.getBranchBankName());
        this.setPaymentAmount(payDO.getAmount());
        this.setPayPic(payDO.getPayPic());
        this.setClaimStatus(payDO.getXgjClaimStatus());
        this.setDeleted(payDO.getDeleted()?1:0);
    }

    public ReceiptRequest(Long shopId, Integer billId, WalletPayInfoDO payDO, Integer joinBrand){
        this.shopId = shopId;
        this.billId = billId;
        this.receiptId = payDO.getPayNo();
        this.payer1 = payDO.getPayUserName();
        this.transactionNumber = payDO.getTradeId();
        this.paymentAmount = payDO.getPayAmount();
        this.claimStatus = payDO.getClaimStatus();
        this.deleted = 0;
        this.payWay = 2;
        this.joinBrand = joinBrand;
    }
    
}
