Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
AudunSorheim committed Nov 23, 2023
1 parent d4023b4 commit 0c718bb
Show file tree
Hide file tree
Showing 6 changed files with 38 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/components/history/HistoricEventsSummary.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ export const HistoricEventsSummary = ({ historicVurderinger }: Props) => {
return (
<LinkPanel href="#" border as={NextLink} key={index}>
<LinkPanel.Title>
{getShortDateFormat(item.vurdering.sistVurdert)}:{" "}
{getShortDateFormat(item.vurdering.createdAt)}:{" "}
{getHeaderText(item)}
</LinkPanel.Title>
</LinkPanel>
Expand Down
5 changes: 4 additions & 1 deletion src/components/skeleton/AktivitetskravSkeletonComponent.tsx
Original file line number Diff line number Diff line change
@@ -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 (
<Page>
<AktivitetskravInfo harArbeidsgiver={true} displaySkeleton={true} />
<AktivitetskravBox>
<AktivitetskravInfo harArbeidsgiver={true} displaySkeleton={true} />
</AktivitetskravBox>
</Page>
);
};
17 changes: 16 additions & 1 deletion src/mocks/fixtures.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ const nyKandidatVurdering = (
): AktivitetskravVurdering => {
return {
status: "NY",
sistVurdert: pastDateAsString(dagerSidenHendelse),
vurderingUuid: "12345",
createdAt: pastDateAsString(dagerSidenHendelse),
};
};

Expand All @@ -16,6 +17,8 @@ const unntakVurdering = (
): AktivitetskravVurdering => {
return {
status: "UNNTAK",
vurderingUuid: "12346585686585",
createdAt: pastDateAsString(dagerSidenHendelse),
sistVurdert: pastDateAsString(dagerSidenHendelse),
arsaker: ["MEDISINSKE_GRUNNER"],
};
Expand All @@ -26,6 +29,8 @@ const oppfyltVurdering = (
): AktivitetskravVurdering => {
return {
status: "OPPFYLT",
vurderingUuid: "244365474",
createdAt: pastDateAsString(dagerSidenHendelse),
sistVurdert: pastDateAsString(dagerSidenHendelse),
arsaker: ["TILTAK"],
};
Expand All @@ -36,6 +41,8 @@ const ikkeAktuellVurdering = (
): AktivitetskravVurdering => {
return {
status: "IKKE_AKTUELL",
vurderingUuid: "686868",
createdAt: pastDateAsString(dagerSidenHendelse),
sistVurdert: pastDateAsString(dagerSidenHendelse),
};
};
Expand All @@ -45,6 +52,8 @@ const ikkeOppfyltVurdering = (
): AktivitetskravVurdering => {
return {
status: "IKKE_OPPFYLT",
vurderingUuid: "55554444",
createdAt: pastDateAsString(dagerSidenHendelse),
sistVurdert: pastDateAsString(dagerSidenHendelse),
};
};
Expand All @@ -54,6 +63,8 @@ const avventVurdering = (
): AktivitetskravVurdering => {
return {
status: "AVVENT",
vurderingUuid: "77322357",
createdAt: pastDateAsString(dagerSidenHendelse),
sistVurdert: pastDateAsString(dagerSidenHendelse),
};
};
Expand All @@ -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(),
Expand All @@ -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(),
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion src/pages/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ const Home: NextPage = () => {
queryKey: ["aktivitetskrav"],
queryFn: () =>
get<AktivitetskravVurdering[]>(
process.env.NEXT_PUBLIC_ESYFO_PROXY_API_URL!,
`${process.env.NEXT_PUBLIC_ESYFO_PROXY_API_URL}/historikk`!,
),
});

Expand Down
18 changes: 16 additions & 2 deletions src/schema/aktivitetskravVurderingSchema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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(),
}),
]);

Expand Down

0 comments on commit 0c718bb

Please sign in to comment.