import { Injectable } from '@angular/core'; import { HttpRestService } from '@core/services/http-rest.service'; import { PaginatedResponse, PaginationOptions, SimpleStringMap } from '@yourcause/common'; import { MyWorkspaceCardView, MyWorkspaceDeadline, MyWorkspacePayload, MyWorkspaceSummary } from './my-workspace.typing'; @Injectable({ providedIn: 'root' }) export class MyWorkspaceResources { constructor ( private httpRestService: HttpRestService ) { } getTodaysView ( paginationOptions: PaginationOptions, data: MyWorkspacePayload ): Promise { const endpoint = 'api/manager/today'; return this.httpRestService.post(endpoint, { paginationOptions, ...data }); } getSummary (): Promise { return this.httpRestService.get('api/manager/today/summary'); } getDeadlines (): Promise { return this.httpRestService.get('api/manager/today/programdeadlines'); } getProgramsAndWorkflowsForMyWorkspace (): Promise<{ programs: SimpleStringMap; workflowLevels: SimpleStringMap; }> { const endpoint = 'api/manager/today/summaryFacets'; return this.httpRestService.get(endpoint); } }