Skip to content

Commit

Permalink
⚰️ Fjerner på vent frist
Browse files Browse the repository at this point in the history
- Vi bestemte oss for å ta en annen løype

This reverts commit a61fbe7.

Co-authored-by: Jakob Havstein Eriksen <[email protected]>
  • Loading branch information
trinelinderud and havstein committed Jul 1, 2024
1 parent 71230fd commit bafd253
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 9 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
DROP TABLE pa_vent_frist
Original file line number Diff line number Diff line change
Expand Up @@ -260,10 +260,8 @@ internal class PersonRepository(private val dataSource: DataSource) {

private fun TransactionalSession.slettPåVent(personRef: Int) {
@Language("PostgreSQL")
val query = "DELETE FROM pa_vent_frist pvf USING pa_vent pv, vedtak v WHERE pvf.pa_vent_ref = pv.id AND pv.vedtaksperiode_id = v.vedtaksperiode_id AND v.person_ref = ? RETURNING pvf.pa_vent_ref"
val query2 = "DELETE FROM pa_vent pv USING vedtak v WHERE pv.vedtaksperiode_id = v.vedtaksperiode_id AND v.person_ref = ?"
val query = "DELETE FROM pa_vent pv USING vedtak v WHERE pv.vedtaksperiode_id = v.vedtaksperiode_id AND v.person_ref = ?"
run(queryOf(query, personRef).asExecute)
run(queryOf(query2, personRef).asExecute)
}

private fun TransactionalSession.slettVedtaksperiodegenerasjoner(personRef: Int) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,6 @@ internal class PersonRepositoryTest : AbstractDatabaseTest() {

@Test
fun `antall tabeller - du må antakelig rette opp i sletting i dev dersom du har lagt til eller fjernet tabeller`() {
assertEquals(77, finnTabeller().size)
assertEquals(76, finnTabeller().size)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,9 @@ VALUES ('${saksbehandler_oid}', ${sequence_number});
INSERT INTO reserver_person(saksbehandler_ref, person_ref, gyldig_til)
VALUES ('${saksbehandler_oid}', ${sequence_number}, now());

INSERT INTO pa_vent(id, vedtaksperiode_id, saksbehandler_ref, frist, begrunnelse, opprettet)
VALUES (${sequence_number}, '${vedtaksperiode_id}', '${saksbehandler_oid}', now(), '', now());

INSERT INTO opptegnelse(person_id, sekvensnummer, payload, type)
VALUES (${sequence_number}, 1, '{}'::json, 'TESTTYPE');
INSERT INTO abonnement_for_opptegnelse(saksbehandler_id, person_id)
Expand All @@ -80,11 +83,6 @@ VALUES (${sequence_number}, 'TEST_TEXT', now(), '${saksbehandler_oid}', '${vedta
INSERT INTO kommentarer(tekst, notat_ref, feilregistrert_tidspunkt, saksbehandlerident)
VALUES ('EN_KOMMENTAR', ${sequence_number}, null, '${saksbehandler_oid}');

INSERT INTO pa_vent(id, vedtaksperiode_id, saksbehandler_ref, frist, begrunnelse, opprettet)
VALUES (${sequence_number}, '${vedtaksperiode_id}', '${saksbehandler_oid}', now(), '', now());
INSERT INTO pa_vent_frist(id, pa_vent_ref, frist, notat_ref, opprettet)
VALUES (${sequence_number}, ${sequence_number}, now(), ${sequence_number}, now());

INSERT INTO overstyring(id, tidspunkt, person_ref, hendelse_ref, saksbehandler_ref, vedtaksperiode_id)
VALUES (${sequence_number}, now(), ${sequence_number}, '${hendelse_id}',
'${saksbehandler_oid}', '${vedtaksperiode_id}');
Expand Down

0 comments on commit bafd253

Please sign in to comment.