import { Injectable } from '@angular/core';
import { HttpRequestService } from '../resources/http-request.service';
import { Observable, map } from 'rxjs';
import { ResponseDataGetLevelAreaWarehouse } from 'src/app/interfaces/inventory-management/warehouse-management.interface';
import { ResponseDataGetExchangeArticles } from 'src/app/interfaces/inventory-management/exchange-articles.interface';

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

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

  public getCurrentLocationArtitles(): Observable<ResponseDataGetExchangeArticles> {
    return this._httpRequestService.getQuery(`${this._url}/get-current-location-artitles`).pipe(map((data:any) => data));
  }

  public moveArticleToWarehouse(requestData: any) {
    return this._httpRequestService.putQuery(`${this._url}/move-article-to-warehouse`, requestData).pipe(map((data:any) => data));
  }
}
