import { Injectable } from '@angular/core';
import { HttpService } from './http.service';
import { Observable } from 'rxjs';
import { map } from 'rxjs/operators';

@Injectable()
export class CustomerService {

  constructor(
      private httpService: HttpService
      ) {}

  public postCustomer(body, data): Observable<any> {
    const postCustomerUrl = `https://vdzsts-api-dev.apac.bg.corpintra.net/sts-customer/api/v1/Customer`;
    return this.httpService
      .postOrPutRequest(postCustomerUrl,null,null,body,null,false,'post',null,data)
      .pipe(map(responseData => this.transformData(responseData)));
  }

  public transformData(responseData) {
    return responseData;
  }


}
