import { Injectable } from '@angular/core';
import { HttpRequestService } from '../resources/http-request.service';
import { FormReportProblem, FormResolutionIssueTracking } from 'src/app/interfaces/acquisition-management/issue-tracking.interface';
import { map } from 'rxjs';

@Injectable({
  providedIn: 'root'
})
export class IssureTrackingService {

  private _url: string;
  constructor( private _httpRequestService:HttpRequestService ) {
    this._url = 'acquisition-management';
  }

  public reportProblem(objRequestLine:FormReportProblem) {
    return this._httpRequestService.postQuery(`${ this._url }/acquisition/report-problem-order`, objRequestLine).pipe(map((data:any) => data));
  }

  public getIssueTracking() {
    return this._httpRequestService.getQuery(`${ this._url }/dispatch/get-issue-tracking`).pipe(map((data:any) => data));
  }

  public resolutionIssueTracking(objRequestLine:FormResolutionIssueTracking) {
    return this._httpRequestService.postQuery(`${ this._url }/dispatch/resolution-issue-tracking`, objRequestLine).pipe(map((data:any) => data));
  }
  
}
