import { HttpClient } from '@angular/common/http';
import { Injectable } from '@angular/core';
import { Observable } from 'rxjs';
import { PARTNER_API_ROUTES } from '../constants';
import {
  IPartnerInfoRawResponse,
  IPartnerInfoResponse,
  IPartnerRawResponse,
  IPartnerResponse,
} from '../models';

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

  private apiRoutes = PARTNER_API_ROUTES;

  getMe(): Observable<IPartnerResponse> {
    return this.http.get<IPartnerRawResponse>(this.apiRoutes.me());
  }

  getInfo(): Observable<IPartnerInfoResponse> {
    return this.http.get<IPartnerInfoRawResponse>(this.apiRoutes.info());
  }
}
