-
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.
Dine pleiepenger - forenkling og zod justering (#1477)
* Justere zod validering på søknader.json * Changeset
- Loading branch information
1 parent
9beda65
commit d356f0b
Showing
13 changed files
with
57 additions
and
76 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
"@navikt/dine-pleiepenger": minor | ||
--- | ||
|
||
Justere ZOD validering og henting av søknadsinformasjon. Gå over til å bruke opprettetDato for visning av mottatt dato. |
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
8 changes: 8 additions & 0 deletions
8
apps/dine-pleiepenger/src/server/api-models/ArbeidsgiverSchema.ts
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,8 @@ | ||
import { z } from 'zod'; | ||
|
||
export const ArbeidsgiverSchema = z.object({ | ||
erAnsatt: z.boolean(), | ||
navn: z.string(), | ||
organisasjonsnummer: z.string(), | ||
sluttetFørSøknadsperiode: z.union([z.undefined(), z.boolean()]), | ||
}); |
12 changes: 12 additions & 0 deletions
12
apps/dine-pleiepenger/src/server/api-models/ArbeidsgivereSchema.ts
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,12 @@ | ||
import { z } from 'zod'; | ||
import { ArbeidsgiverSchema } from './ArbeidsgiverSchema'; | ||
import { OrganisasjonSchema } from './OrganisasjonSchema'; | ||
|
||
export const OrganisasjonerSchema = z.object({ | ||
organisasjoner: z.array(OrganisasjonSchema), | ||
}); | ||
|
||
export const ArbeidsgivereSchema = z.union([z.array(ArbeidsgiverSchema), OrganisasjonerSchema]); | ||
|
||
export type Arbeidsgiver = z.infer<typeof ArbeidsgiverSchema>; | ||
export type Arbeidsgivere = z.infer<typeof ArbeidsgivereSchema>; |
10 changes: 10 additions & 0 deletions
10
apps/dine-pleiepenger/src/server/api-models/OrganisasjonSchema.ts
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,10 @@ | ||
import { z } from 'zod'; | ||
|
||
export const OrganisasjonSchema = z.object({ | ||
navn: z.string(), | ||
skalJobbe: z.boolean(), | ||
skalJobbeProsent: z.number(), | ||
vetIkkeEkstrainfo: z.union([z.string(), z.null(), z.undefined()]), | ||
jobberNormaltTimer: z.number(), | ||
organisasjonsnummer: z.string(), | ||
}); |
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 |
---|---|---|
@@ -1,26 +1,4 @@ | ||
import { z } from 'zod'; | ||
|
||
export const ArbeidsgiverSchema = z.object({ | ||
erAnsatt: z.boolean(), | ||
navn: z.string(), | ||
organisasjonsnummer: z.string(), | ||
sluttetFørSøknadsperiode: z.union([z.undefined(), z.boolean()]), | ||
}); | ||
|
||
const OrganisasjonSchema = z.object({ | ||
navn: z.string(), | ||
skalJobbe: z.string(), | ||
skalJobbeProsent: z.number(), | ||
vetIkkeEkstrainfo: z.union([z.string(), z.null(), z.undefined()]), | ||
jobberNormaltTimer: z.number(), | ||
organisasjonsnummer: z.string(), | ||
}); | ||
|
||
export const OrganisasjonerSchema = z.object({ | ||
organisasjoner: z.array(OrganisasjonSchema), | ||
}); | ||
|
||
export const ArbeidsgivereSchema = z.union([z.array(ArbeidsgiverSchema), OrganisasjonerSchema, z.any()]); | ||
import { ArbeidsgiverSchema } from '../server/api-models/ArbeidsgiverSchema'; | ||
|
||
export type Arbeidsgiver = z.infer<typeof ArbeidsgiverSchema>; | ||
export type Arbeidsgivere = z.infer<typeof ArbeidsgivereSchema>; |
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 |
---|---|---|
@@ -1,5 +1,4 @@ | ||
import { Organisasjon } from './Organisasjon'; | ||
import { z } from 'zod'; | ||
import { ArbeidsgivereSchema } from '../server/api-models/ArbeidsgivereSchema'; | ||
|
||
export interface Arbeidsgivere { | ||
organisasjoner: Organisasjon[]; | ||
} | ||
export type Arbeidsgivere = z.infer<typeof ArbeidsgivereSchema>; |
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 |
---|---|---|
@@ -1,8 +1,4 @@ | ||
export interface Organisasjon { | ||
navn: string; | ||
skalJobbe: string; | ||
skalJobbeProsent: number; | ||
vetIkkeEkstrainfo?: string | null; | ||
jobberNormaltTimer: number; | ||
organisasjonsnummer: string; | ||
} | ||
import { z } from 'zod'; | ||
import { OrganisasjonSchema } from '../server/api-models/OrganisasjonSchema'; | ||
|
||
export type Organisasjon = z.infer<typeof OrganisasjonSchema>; |
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