-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Hent spørreundersøkelse med innhold
* Refaktorer type Co-authored-by: Christian Klem <[email protected]> Co-authored-by: Thomas Dufourd <[email protected]> Co-authored-by: Sverre Stensby <[email protected]>
- Loading branch information
1 parent
4eba05b
commit de0b561
Showing
8 changed files
with
116 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
import { z } from "zod"; | ||
import { datoSchema, spørreundersøkelseStatusEnum } from "./domenetyper"; | ||
|
||
const SPØRREUNDERSØKELSE_TYPE = ["Behovsvurdering", "Evaluering"] as const; | ||
export const SpørreundersøkelseTypeEnum = z.enum(SPØRREUNDERSØKELSE_TYPE); | ||
export type SpørreundersøkelseType = z.infer<typeof SpørreundersøkelseTypeEnum>; | ||
|
||
export const SvaralternativSchema = z.object({ | ||
svarId: z.string(), | ||
svartekst: z.string(), | ||
}); | ||
|
||
export const SpørsmålSchema = z.object({ | ||
id: z.string(), | ||
undertemanavn: z.string(), | ||
spørsmål: z.string(), | ||
svaralternativer: z.array(SvaralternativSchema), | ||
flervalg: z.boolean(), | ||
}); | ||
|
||
export const TemaSchema = z.object({ | ||
temaId: z.number(), | ||
navn: z.string(), | ||
spørsmålOgSvaralternativer: z.array(SpørsmålSchema), | ||
}); | ||
|
||
export const SpørreundersøkelseMedInnholdSchema = z.object({ | ||
id: z.string(), | ||
samarbeidId: z.number(), | ||
status: spørreundersøkelseStatusEnum, | ||
temaer: z.array(TemaSchema), | ||
opprettetAv: z.string(), | ||
type: SpørreundersøkelseTypeEnum, | ||
opprettetTidspunkt: datoSchema, | ||
endretTidspunkt: datoSchema.nullable(), | ||
påbegyntTidspunkt: datoSchema.nullable(), | ||
fullførtTidspunkt: datoSchema.nullable(), | ||
}); | ||
|
||
export type SpørreundersøkelseMedInnhold = z.infer< | ||
typeof SpørreundersøkelseMedInnholdSchema | ||
>; |