import { Injectable } from '@angular/core';
import { ConfigService } from '@shared/config/config.service';
import { FleioApiService } from '../../fleio-api.service';
import { HttpClient } from '@angular/common/http';
import { Observable } from 'rxjs/internal/Observable';
import { ICartItemsModel } from '@fleio-api/billing/cart/model/cart-item.model';

@Injectable({
  providedIn: 'root'
})
export class CartApiService extends FleioApiService<ICartItemsModel> {
  constructor(protected httpClient: HttpClient, protected config: ConfigService) {
    super();
    this.setEndpoint(config.getPanelApiUrl('billing/cart'));
  }

  order(params = {}): Observable<any> {
    return this.postAction('order', params);
  }
}
