Skip to content

Commit

Permalink
Merge pull request #22 from navikt/feature/bpen068sisteaktivitet
Browse files Browse the repository at this point in the history
La inn en input for å styre stoppe steg i Reguleringen for testing si…
  • Loading branch information
arefsahl authored Oct 25, 2024
2 parents c3fd999 + 06f0720 commit b6ecf37
Show file tree
Hide file tree
Showing 3 changed files with 49 additions and 16 deletions.
47 changes: 36 additions & 11 deletions app/routes/batch-opprett._index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ export default function BatchOpprett_index() {
<div>
<h1>Opprett BPEN005 batchkjøring</h1>
<Form action="bpen005" method="POST">
<div style={{ display: "inline-block" }}>
<div style={{ display: 'inline-block' }}>
<label>Behandlingsmåned</label>
<br />
<input
Expand All @@ -34,14 +34,21 @@ export default function BatchOpprett_index() {
/>
</div>
<br />
<div style={{ display: "inline-block" }}>
<Select label="Begrenset utplukk" size={"small"} name={"begrensetUtplukk"} defaultValue={"false"}>
<div style={{ display: 'inline-block' }}>
<Select
label="Begrenset utplukk"
size={'small'}
name={'begrensetUtplukk'}
defaultValue={'false'}
>
<option value="true">Ja</option>
<option value="false">Nei</option>
</Select>
</div>
<p>
<button type="submit" disabled={isClicked} onClick={handleSubmit}>Opprett</button>
<button type="submit" disabled={isClicked} onClick={handleSubmit}>
Opprett
</button>
</p>
</Form>

Expand All @@ -58,7 +65,9 @@ export default function BatchOpprett_index() {
/>
</p>
<p>
<button type="submit" disabled={isClicked} onClick={handleSubmit}>Opprett</button>
<button type="submit" disabled={isClicked} onClick={handleSubmit}>
Opprett
</button>
</p>
</Form>

Expand Down Expand Up @@ -101,7 +110,19 @@ export default function BatchOpprett_index() {
/>
</p>
<p>
<button type="submit" disabled={isClicked} onClick={handleSubmit}>Opprett</button>
Kjør til og med aktivitet
<input
defaultValue= ""
aria-label="SisteAktivitet"
name="sisteAktivitet"
type="text"
placeholder="SisteAktivitet"
/>
</p>
<p>
<button type="submit" disabled={isClicked} onClick={handleSubmit}>
Opprett
</button>
</p>
</Form>
<h1>Opprett BPEN091 batchkjøring</h1>
Expand All @@ -122,19 +143,23 @@ export default function BatchOpprett_index() {
</Form>

<h1>Opprett BPEN096 batchkjøring</h1>
<Form action='bpen096' method='POST'>
<Form action="bpen096" method="POST">
<p>
<button type='submit'>Opprett</button>
<button type="submit">Opprett</button>
</p>
</Form>

<h1>Opprett RTV Brev Sammenligninger</h1>

<NavLink to={"./rtv-brev-sammenligning"}>Opprett RTV Brev Sammenligninger</NavLink>
<NavLink to={'./rtv-brev-sammenligning'}>
Opprett RTV Brev Sammenligninger
</NavLink>
<h1>Opprett Omsorgsopptjening uttrekk</h1>
<NavLink to={"./omsorgsopptjening-uttrekk"}>Opprett Omsorgsopptjening-uttrekk</NavLink>
<NavLink to={'./omsorgsopptjening-uttrekk'}>
Opprett Omsorgsopptjening-uttrekk
</NavLink>
<h1>Overfør Klager til Kabal</h1>
<NavLink to={"./overfortilkabal"}>Start batch behandling</NavLink>
<NavLink to={'./overfortilkabal'}>Start batch behandling</NavLink>
</div>
)
}
2 changes: 1 addition & 1 deletion app/routes/batch-opprett.bpen068.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ export const action = async ({ request }: ActionFunctionArgs) => {
const updates = Object.fromEntries(formData)
const accessToken = await requireAccessToken(request)

let response = await opprettBpen068(accessToken, updates.satsDato as string, updates.reguleringsDato as string)
let response = await opprettBpen068(accessToken, updates.satsDato as string, updates.reguleringsDato as string, updates.sisteAktivitet as string)

return redirect(`/behandling/${response.behandlingId}`)
}
16 changes: 12 additions & 4 deletions app/services/batch.bpen068.server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,18 @@ export async function opprettBpen068(
accessToken: string,
satsDato: string,
reguleringsDato: string,
sisteAktivitet: string,
): Promise<StartBatchResponse> {

const body: any = {
satsDato: satsDato,
reguleringsDato: reguleringsDato,
}

if(sisteAktivitet !== ''){
body.sisteAktivitet = sisteAktivitet;
}

const response = await fetch(
`${env.penUrl}/api/vedtak/regulering/start`,
{
Expand All @@ -15,10 +26,7 @@ export async function opprettBpen068(
'Content-Type': 'application/json',
'X-Request-ID': crypto.randomUUID(),
},
body: JSON.stringify({
satsDato: satsDato,
reguleringsDato: reguleringsDato,
}),
body: JSON.stringify(body),
},
)

Expand Down

0 comments on commit b6ecf37

Please sign in to comment.