import { Injectable } from '@angular/core';
import { MEETING, PROJECT, TEAM, USER_TASKS } from '@core/models/home.model';
import { Observable } from 'rxjs';
import { ApiService } from './api.service';
import { RESPONSE } from '../models/response.model';

@Injectable({
  providedIn: 'root',
})
export class HomeService {
  constructor(private readonly apiService: ApiService) {}

  getMeetings(): Observable<RESPONSE<MEETING[]>> {
    return this.apiService.get<RESPONSE<MEETING[]>>('Meeting/GetAll');
  }

  getUserTasks(): Observable<RESPONSE<USER_TASKS[]>> {
    return this.apiService.get<RESPONSE<USER_TASKS[]>>('UserTask/GetAll');
  }

  getTeam(): Observable<RESPONSE<TEAM[]>> {
    return this.apiService.get<RESPONSE<TEAM[]>>('Team/GetAll');
  }

  getProjects(): Observable<RESPONSE<PROJECT[]>> {
    return this.apiService.get<RESPONSE<PROJECT[]>>('Project/GetAll');
  }
}
