package cn.pluss.platform.dto;

import cn.pluss.platform.entity.MerchantMenber;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.NoArgsConstructor;

/**
 * @author yuchen
 *
 * @Description
 */
@Data
@ApiModel("扫码支付的传入参数")
@NoArgsConstructor
public class MemberScanPayDTO {

    @ApiModelProperty(value = "扫码获得的code", required = true)
    private String memberCode;

    @ApiModelProperty(value = "选中的会员code", required = true)
    private String authCode;

    @ApiModelProperty(value = "当前商户门店id", required = true)
    private String storeId;

    @ApiModelProperty(value = "消费金额", required = true)
    private Double consumeFee;

    @ApiModelProperty(value = "商家Code", required = true)
    private String merchantCode;

    @ApiModelProperty(value = "当前操作用户的id", required = true)
    private String userId;

    @ApiModelProperty("备注")
    private String remark;

    /**
     * 通道切换字段 0 支付宝微信官方通道 1乐刷通道 2：随行付通道 3:瑞银信
     */
    @ApiModelProperty("通道类型")
    private String aisleSwitch;

    @ApiModelProperty("店铺名称")
    private String storeName;

    @ApiModelProperty("商户名称")
    private String merchantName;


    @ApiModelProperty("用户名称")
    private String userName;

    public MemberScanPayDTO(MerChantOrderDTO dto, MerchantMenber menber) {
        this.merchantCode = dto.getMerchantCode();
        this.merchantName = menber.getMerchantName();
        this.storeId = dto.getStoreId();
        this.consumeFee = dto.getConsumeFee();
        this.authCode = menber.getMemberCode();
        this.storeName = menber.getStoreName();
        this.memberCode = dto.getAuthCode();
        this.userId = dto.getUserId();
        this.userName = dto.getStaffName();
    }
}

