import { HttpClient } from '@angular/common/http';
import { Injectable } from '@angular/core';
import { Observable } from 'rxjs';
import { PARTNER_BA_ACCOUNTS_CHARGE_API_ROUTES } from '../constants/apiRoutes/accountsCharge';
import { IPartnerChargeAccountRequest, IPartnerChargeAccountResponse } from '../models';

@Injectable({ providedIn: 'root' })
export class PartnerChargeAccountService {
  constructor(private http: HttpClient) {}

  private apiRoutes = PARTNER_BA_ACCOUNTS_CHARGE_API_ROUTES;

  // getAll(consumerId: string, businessId: string): Observable<IPaginatedResponse<IPartnerChargeAccountRequest>> {
  //   return this.http.get<IPaginatedResponse<IPartnerChargeAccountRequest>>(
  //     this.apiRoutes.single(partnerId),
  //   );
  // }

  charge(
    consumerId: string,
    businessId: string,
    data: IPartnerChargeAccountRequest,
  ): Observable<IPartnerChargeAccountResponse> {
    return this.http.post<IPartnerChargeAccountResponse>(
      this.apiRoutes.single(consumerId, businessId),
      data,
    );
  }
}
