import { IPaginatedResponse } from '@/core/models/service.model';
import { HttpClient } from '@angular/common/http';
import { Injectable } from '@angular/core';
import { Observable } from 'rxjs';
import { PARTNER_ACTIVATED_LICENSES_API_ROUTES } from '../constants/apiRoutes/activatedLicenses';
import { IPartnerActivatedLicenseRawResponse, IPartnerActivatedLicenseResponse } from '../models';

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

  private apiRoutes = PARTNER_ACTIVATED_LICENSES_API_ROUTES;

  getAll(partnerId: string): Observable<IPaginatedResponse<IPartnerActivatedLicenseResponse>> {
    return this.http.get<IPaginatedResponse<IPartnerActivatedLicenseRawResponse>>(
      this.apiRoutes.list(partnerId),
    );
  }
}
