package com.fusi24.rfid.data;

import com.fusi24.rfid.data.api.RestService;
import com.fusi24.rfid.data.entity.DataAuth;
import com.fusi24.rfid.data.entity.DataDetail;
import com.fusi24.rfid.data.entity.DataDevice;
import com.fusi24.rfid.data.entity.DataEntryPermit;
import com.fusi24.rfid.data.entity.DataResultRfid;
import com.fusi24.rfid.data.entity.DataUser;

import java.util.List;

import io.reactivex.Observable;

public class DataManager {

    private RestService restService;

    public DataManager(RestService restService) {
        this.restService = restService;
    }

    public Observable<DataUser> userLogin(DataAuth dataAuth) {
        return restService.userLogin(dataAuth);
    }

    public Observable<List<DataEntryPermit>> getEntryPermit() {
        return restService.getEntryPermit();
    }

    public Observable<List<DataDetail>> getStatusScan(String code) {
        return restService.getLookUp(code);
    }

    public Observable<List<DataDevice>> getDataDevice(String deviceId, String[] expand) {
        return restService.getDataDevice(deviceId, expand);
    }

    public Observable<DataResultRfid> checkRfidCard(String numberRfid, Integer permitId, String rfidDeviceId, Integer checkTypeId, String longLat, String[] expand) {
        return restService.checkRfidCard(numberRfid, permitId, rfidDeviceId, checkTypeId, longLat, expand);
    }

}
