import { Injectable } from '@angular/core';
import { Activity } from '@msfa-models/activity.model';
import { GemensamPlaneringPostRequest } from '@msfa-models/api/gemensam-planering.request.model';
import { DeltagareAvrop } from '@msfa-models/avrop.model';
import { DeltagareApiService } from '@msfa-services/api/deltagare.api.service';
import { GemensamPlaneringApiService } from '@msfa-services/api/gemensam-planering.api.service';
import { Observable } from 'rxjs';

@Injectable()
export class GemensamPlaneringFormService {
  public activities$: Observable<Activity[]> = this.gemensamPlaneringApiService.fetchActivities$();

  constructor(
    private gemensamPlaneringApiService: GemensamPlaneringApiService,
    private deltagareApiService: DeltagareApiService
  ) {}

  public fetchAvropInformation$(genomforandeReferens: number): Observable<DeltagareAvrop> {
    return this.deltagareApiService.fetchAvropInformation$(genomforandeReferens);
  }

  public postGemensamPlanering$(requestData: GemensamPlaneringPostRequest): Observable<void> {
    return this.gemensamPlaneringApiService.postGemensamPlanering$(requestData);
  }
}
