package com.zhongshu.card.client.model.devices;

import com.github.microservice.models.type.DeviceType;
import com.zhongshu.card.client.model.base.SuperModel;
import com.zhongshu.card.client.model.org.OrganizationSimpleModel;
import com.zhongshu.card.client.model.school.AreaModel;
import com.zhongshu.card.client.type.DataState;
import com.zhongshu.card.client.type.OnLineState;
import com.zhongshu.card.client.type.PaymentModeType;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;

/**
 * @author TRX
 * @date 2024/7/2
 */
@Data
public class DeviceBindModel extends SuperModel {
    @Schema(description = "设备信息")
    private DeviceInfoModel deviceInfo;

    @Schema(description = "设备ID、设备号")
    private String deviceId;

    @Schema(description = "设备名称")
    private String deviceName;

    @Schema(description = "设备类型，如 消费机 门禁机")
    private DeviceType deviceType;

    private String deviceTypeStr;

    public String getDeviceTypeStr() {
        if (deviceType != null) {
            return deviceType.getRemark();
        }
        return "";
    }

    @Schema(description = "是否在线")
    private OnLineState onLineState = OnLineState.OnLine;

    private String onLineStateStr;

    public String getOnLineStateStr() {
        if (onLineState != null) {
            return onLineState.getRemark();
        }
        return "";
    }

    @Schema(description = "数据状态")
    private DataState state;

    public String stateStr;

    public String getStateStr() {
        if (state != null) {
            return state.getRemark();
        }
        return "";
    }

    @Schema(description = "网关")
    private String gateWayId;

    @Schema(description = "学校信息")
    private OrganizationSimpleModel schoolInfo;

    @Schema(description = "学校信息Oid")
    private String schoolInfoOid;

    @Schema(description = "商户信息")
    private OrganizationSimpleModel shopInfo;

    @Schema(description = "商户Oid")
    private String shopInfoOid;

    @Schema(description = "区域信息")
    private AreaModel area;

    @Schema(description = "付费模式")
    private PaymentModeType paymentModeType;

    private String paymentModeTypeStr;

    public String getPaymentModeTypeStr() {
        if (paymentModeType != null) {
            return paymentModeType.getRemark();
        }
        return "";
    }

    @Schema(description = "收款账号")
    private String receivingAccount;
}
