import { Injectable } from '@angular/core';
import { HttpClient, HttpHeaders } from '@angular/common/http';
import { TranslateService } from '@ngx-translate/core';
import { Observable } from 'rxjs';
import { environment } from '../../environments/environment';
import { TemplateFileMiniModel } from '../model/template-file-mini.model';
import { AlertModel } from '../model/alert.model';

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

  constructor(private http: HttpClient,
    private translateService: TranslateService
  ) { }

  getExcelColumn(body: {
    templateId: string,
    fileName: string,
  }) {
    return this.http.post(environment.url + "customcube/get-excel-column?companyid=eb2f4f30-edaf-11ee-a69a-c7680edc0e47", body)
  }
  getExcelData(body: any) {
    return this.http.post(environment.url + "customcube/get-excel-data?companyid=eb2f4f30-edaf-11ee-a69a-c7680edc0e47", body)
  }
  saveExcelPerspective(body: {
    templateId: string,
    fileName: string,
    dataGridStr: string,
    pivotStr: string,
  }): Observable<AlertModel> {
    return this.http.post<AlertModel>(environment.url + "customcube/save-excel-perspective?companyid=eb2f4f30-edaf-11ee-a69a-c7680edc0e47", body)
  }
  getExcelPerspective(body: {
    templateId: string,
    fileName: string,
  }) {
    return this.http.post(environment.url + "customcube/get-excel-perspective?companyid=eb2f4f30-edaf-11ee-a69a-c7680edc0e47", body)
  }
}