Merge pull request #257 in TEA/mina-sidor-fa-web from feature/TV-884-informativ-rapport-vy to develop
Squashed commit of the following: commit ea4f6c986785bd5d038c6e634bba52b750d8165e Author: Erik Tiekstra <erik.tiekstra@arbetsformedlingen.se> Date: Wed Nov 10 10:55:22 2021 +0100 Added informativ rapport view
This commit is contained in:
@@ -5,4 +5,6 @@ export enum ReportType {
|
||||
Avvikelse = 'Avvikelserapport (avvikelse)',
|
||||
Franvaro = 'Avvikelserapport (frånvaro)',
|
||||
PeriodiskRedovisning = 'Periodisk redovisning',
|
||||
InformativRapport = 'Informativ rapport',
|
||||
InformativRedovisning = 'Informativ rapport',
|
||||
}
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
import { InformativRapportCategoryKey } from '@msfa-enums/informativ-rapport-category.enum';
|
||||
|
||||
export interface InformativRapportResponse {
|
||||
genomforandeReferens: number;
|
||||
category: InformativRapportCategoryKey;
|
||||
comment: string;
|
||||
}
|
||||
|
||||
@@ -2,14 +2,16 @@ import { InformativRapportCategory } from '@msfa-enums/informativ-rapport-catego
|
||||
import { InformativRapportResponse } from './api/informativ-rapport.response.model';
|
||||
|
||||
export interface InformativRapport {
|
||||
genomforandeReferens: number;
|
||||
category: InformativRapportCategory;
|
||||
comment: string;
|
||||
}
|
||||
|
||||
export function mapResponseToInformativRapport(data: InformativRapportResponse): InformativRapport {
|
||||
const { category, comment } = data;
|
||||
const { genomforandeReferens, category, comment } = data;
|
||||
|
||||
return {
|
||||
genomforandeReferens,
|
||||
category: InformativRapportCategory[category] as InformativRapportCategory,
|
||||
comment: comment,
|
||||
};
|
||||
|
||||
@@ -4,6 +4,7 @@ import { environment } from '@msfa-environment';
|
||||
import { AvvikelseReportResponse } from '@msfa-models/api/avvikelse-response.model';
|
||||
import { FranvaroReportResponse } from '@msfa-models/api/franvaro-response.model';
|
||||
import { GemensamPlaneringResponse } from '@msfa-models/api/gemensam-planering.response.model';
|
||||
import { InformativRapportResponse } from '@msfa-models/api/informativ-rapport.response.model';
|
||||
import { Observable } from 'rxjs';
|
||||
|
||||
@Injectable({
|
||||
@@ -20,6 +21,12 @@ export class HandlingarApiService {
|
||||
);
|
||||
}
|
||||
|
||||
public fetchInformativRapport$(handlingId: string): Observable<{ data: InformativRapportResponse }> {
|
||||
return this.httpClient.get<{ data: InformativRapportResponse }>(
|
||||
`${this._apiBaseUrl}/informativ-rapport/${handlingId}`
|
||||
);
|
||||
}
|
||||
|
||||
public fetchFranvaroReport$(handlingId: string): Observable<{ data: FranvaroReportResponse }> {
|
||||
return this.httpClient.get<{ data: FranvaroReportResponse }>(`${this._apiBaseUrl}/franvaro/${handlingId}`);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user