import { Injectable } from "@angular/core";
import { Observable } from "rxjs";
import { ConnectorService } from "src/app/hmg-common/services/connector/connector.service";
import { AuthenticationService } from "src/app/hmg-common/services/authentication/authentication.service";
import { attendanceSwipeScannerRequest } from '../models/attendanceSwipe.Request';
@Injectable({
  providedIn: "root"
})
export class AttendanceService {
  public AttendanceSwipeURL : string ='Services/SWP.svc/REST/AuthenticateAndSwipeUser';
  constructor(
    public con: ConnectorService,
    public authService: AuthenticationService
  ) {}
  public attendanceSwipeScanner(attendanceSwipeScanner: attendanceSwipeScannerRequest, onError?: any, errorLabel?: string): Observable<any> {
    const request = attendanceSwipeScanner;
    this.authService.authenticateRequest(request);
    return this.con.post(this.AttendanceSwipeURL,request,onError,errorLabel);
  }
}