diff --git a/src/components/history/HistoricEventsSummary.tsx b/src/components/history/HistoricEventsSummary.tsx index 4913a4fb..45f82328 100644 --- a/src/components/history/HistoricEventsSummary.tsx +++ b/src/components/history/HistoricEventsSummary.tsx @@ -33,7 +33,7 @@ export const HistoricEventsSummary = ({ historicVurderinger }: Props) => { return ( - {getShortDateFormat(item.vurdering.sistVurdert)}:{" "} + {getShortDateFormat(item.vurdering.createdAt)}:{" "} {getHeaderText(item)} diff --git a/src/components/skeleton/AktivitetskravSkeletonComponent.tsx b/src/components/skeleton/AktivitetskravSkeletonComponent.tsx index 27f9d387..713505d4 100644 --- a/src/components/skeleton/AktivitetskravSkeletonComponent.tsx +++ b/src/components/skeleton/AktivitetskravSkeletonComponent.tsx @@ -1,11 +1,14 @@ "use client"; import { Page } from "@/components/page/Page"; import { AktivitetskravInfo } from "@/components/view/aktivitetskravInfo/AktivitetskravInfo"; +import { AktivitetskravBox } from "@/components/box/AktivitetskravBox"; export const AktivitetskravSkeletonComponent = () => { return ( - + + + ); }; diff --git a/src/mocks/fixtures.ts b/src/mocks/fixtures.ts index 6572ddea..36ccbe25 100644 --- a/src/mocks/fixtures.ts +++ b/src/mocks/fixtures.ts @@ -7,7 +7,8 @@ const nyKandidatVurdering = ( ): AktivitetskravVurdering => { return { status: "NY", - sistVurdert: pastDateAsString(dagerSidenHendelse), + vurderingUuid: "12345", + createdAt: pastDateAsString(dagerSidenHendelse), }; }; @@ -16,6 +17,8 @@ const unntakVurdering = ( ): AktivitetskravVurdering => { return { status: "UNNTAK", + vurderingUuid: "12346585686585", + createdAt: pastDateAsString(dagerSidenHendelse), sistVurdert: pastDateAsString(dagerSidenHendelse), arsaker: ["MEDISINSKE_GRUNNER"], }; @@ -26,6 +29,8 @@ const oppfyltVurdering = ( ): AktivitetskravVurdering => { return { status: "OPPFYLT", + vurderingUuid: "244365474", + createdAt: pastDateAsString(dagerSidenHendelse), sistVurdert: pastDateAsString(dagerSidenHendelse), arsaker: ["TILTAK"], }; @@ -36,6 +41,8 @@ const ikkeAktuellVurdering = ( ): AktivitetskravVurdering => { return { status: "IKKE_AKTUELL", + vurderingUuid: "686868", + createdAt: pastDateAsString(dagerSidenHendelse), sistVurdert: pastDateAsString(dagerSidenHendelse), }; }; @@ -45,6 +52,8 @@ const ikkeOppfyltVurdering = ( ): AktivitetskravVurdering => { return { status: "IKKE_OPPFYLT", + vurderingUuid: "55554444", + createdAt: pastDateAsString(dagerSidenHendelse), sistVurdert: pastDateAsString(dagerSidenHendelse), }; }; @@ -54,6 +63,8 @@ const avventVurdering = ( ): AktivitetskravVurdering => { return { status: "AVVENT", + vurderingUuid: "77322357", + createdAt: pastDateAsString(dagerSidenHendelse), sistVurdert: pastDateAsString(dagerSidenHendelse), }; }; @@ -63,6 +74,8 @@ const forhaandsvarselVurdering = ( ): AktivitetskravVurdering => { return { status: "FORHANDSVARSEL", + vurderingUuid: "457474547547", + createdAt: pastDateAsString(dagerSidenHendelse), sistVurdert: pastDateAsString(dagerSidenHendelse), journalpostId: "123", fristDato: addDaysToDate(new Date(), 14).toISOString(), @@ -75,6 +88,8 @@ const forhaandsvarselVurderingWithoutDocument = ( ): AktivitetskravVurdering => { return { status: "FORHANDSVARSEL", + vurderingUuid: "1231231313", + createdAt: pastDateAsString(dagerSidenHendelse), sistVurdert: pastDateAsString(dagerSidenHendelse), journalpostId: null, fristDato: addDaysToDate(new Date(), 14).toISOString(), diff --git a/src/pages/api/aktivitetsplikt/index.ts b/src/pages/api/aktivitetsplikt/historikk/index.ts similarity index 100% rename from src/pages/api/aktivitetsplikt/index.ts rename to src/pages/api/aktivitetsplikt/historikk/index.ts diff --git a/src/pages/index.tsx b/src/pages/index.tsx index f2da05bb..0f17a8b7 100644 --- a/src/pages/index.tsx +++ b/src/pages/index.tsx @@ -11,7 +11,7 @@ const Home: NextPage = () => { queryKey: ["aktivitetskrav"], queryFn: () => get( - process.env.NEXT_PUBLIC_ESYFO_PROXY_API_URL!, + `${process.env.NEXT_PUBLIC_ESYFO_PROXY_API_URL}/historikk`!, ), }); diff --git a/src/schema/aktivitetskravVurderingSchema.ts b/src/schema/aktivitetskravVurderingSchema.ts index 6c7c40c4..0ef9119e 100644 --- a/src/schema/aktivitetskravVurderingSchema.ts +++ b/src/schema/aktivitetskravVurderingSchema.ts @@ -17,39 +17,53 @@ export const aktivitetskravVurderingSchema = union([ object({ status: z.literal("UNNTAK"), arsaker: z.array(unntakArsaker), + createdAt: string().datetime(), sistVurdert: string().datetime(), + vurderingUuid: string(), }), object({ status: z.literal("OPPFYLT"), arsaker: z.array(oppfyltArsaker), + createdAt: string().datetime(), sistVurdert: string().datetime(), + vurderingUuid: string(), }), object({ status: z.literal("NY"), - sistVurdert: string().datetime(), + createdAt: string().datetime(), + vurderingUuid: string(), }), object({ status: z.literal("NY_VURDERING"), - sistVurdert: string().datetime(), + createdAt: string().datetime(), + vurderingUuid: string(), }), object({ status: z.literal("AVVENT"), + createdAt: string().datetime(), sistVurdert: string().datetime(), + vurderingUuid: string(), }), object({ status: z.literal("FORHANDSVARSEL"), journalpostId: string().nullish(), + createdAt: string().datetime(), sistVurdert: string().datetime(), fristDato: string().datetime(), document: z.array(documentComponentSchema).nullable(), + vurderingUuid: string(), }), object({ status: z.literal("IKKE_OPPFYLT"), + createdAt: string().datetime(), sistVurdert: string().datetime(), + vurderingUuid: string(), }), object({ status: z.literal("IKKE_AKTUELL"), + createdAt: string().datetime(), sistVurdert: string().datetime(), + vurderingUuid: string(), }), ]);