-
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.
Refactoring, resctructiring, remodeling
- Loading branch information
1 parent
ff69b2b
commit 338f720
Showing
41 changed files
with
1,817 additions
and
1,027 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
28 changes: 0 additions & 28 deletions
28
src/main/kotlin/no/nav/pensjon/opptjening/omsorgsopptjening/start/innlesning/Innlesing.kt
This file was deleted.
Oops, something went wrong.
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
33 changes: 0 additions & 33 deletions
33
...nav/pensjon/opptjening/omsorgsopptjening/start/innlesning/barnetrygd/Barnetrygdmelding.kt
This file was deleted.
Oops, something went wrong.
119 changes: 0 additions & 119 deletions
119
...ptjening/omsorgsopptjening/start/innlesning/barnetrygd/BarnetrygdmottakerKafkaListener.kt
This file was deleted.
Oops, something went wrong.
84 changes: 84 additions & 0 deletions
84
...on/opptjening/omsorgsopptjening/start/innlesning/barnetrygd/domain/BarnetrygdInnlesing.kt
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,84 @@ | ||
package no.nav.pensjon.opptjening.omsorgsopptjening.start.innlesning.barnetrygd.domain | ||
|
||
import no.nav.pensjon.opptjening.omsorgsopptjening.felles.InnlesingId | ||
import java.time.Instant | ||
|
||
sealed class BarnetrygdInnlesing { | ||
abstract val id: InnlesingId | ||
abstract val år: Int | ||
abstract val forespurtTidspunkt: Instant | ||
open val startTidspunkt: Instant? = null | ||
open val ferdigTidspunkt: Instant? = null | ||
|
||
open fun startet(): Startet = throw UgyldigTilstand( | ||
fra = this::class.java.simpleName, | ||
til = Startet::class.java.simpleName | ||
) | ||
|
||
open fun mottaData(): Startet = throw UgyldigTilstand( | ||
fra = this::class.java.simpleName, | ||
til = Startet::class.java.simpleName | ||
) | ||
|
||
open fun ferdig(): Ferdig = throw UgyldigTilstand( | ||
fra = this::class.java.simpleName, | ||
til = Ferdig::class.java.simpleName | ||
) | ||
|
||
data class Bestilt( | ||
override val id: InnlesingId, | ||
override val år: Int, | ||
override val forespurtTidspunkt: Instant | ||
) : BarnetrygdInnlesing() { | ||
override fun startet(): Startet { | ||
return Startet(id, år, forespurtTidspunkt, Instant.now()) | ||
} | ||
} | ||
|
||
data class Startet( | ||
override val id: InnlesingId, | ||
override val år: Int, | ||
override val forespurtTidspunkt: Instant, | ||
override val startTidspunkt: Instant, | ||
) : BarnetrygdInnlesing() { | ||
|
||
override fun mottaData(): Startet { | ||
return this | ||
} | ||
|
||
override fun ferdig(): Ferdig { | ||
return Ferdig(id, år, forespurtTidspunkt, startTidspunkt, Instant.now()) | ||
} | ||
} | ||
|
||
data class Ferdig( | ||
override val id: InnlesingId, | ||
override val år: Int, | ||
override val forespurtTidspunkt: Instant, | ||
override val startTidspunkt: Instant, | ||
override val ferdigTidspunkt: Instant | ||
) : BarnetrygdInnlesing() | ||
|
||
companion object Factory { | ||
fun of( | ||
id: InnlesingId, | ||
år: Int, | ||
forespurtTidspunkt: Instant, | ||
startTidspunkt: Instant?, | ||
ferdigTidspunkt: Instant? | ||
): BarnetrygdInnlesing { | ||
return if (ferdigTidspunkt != null && startTidspunkt != null) { | ||
Ferdig(id, år, forespurtTidspunkt, startTidspunkt, ferdigTidspunkt) | ||
} else if (ferdigTidspunkt == null && startTidspunkt != null) { | ||
Startet(id, år, forespurtTidspunkt, startTidspunkt) | ||
} else { | ||
Bestilt(id, år, forespurtTidspunkt) | ||
} | ||
} | ||
} | ||
|
||
data class UgyldigTilstand( | ||
val fra: String, | ||
val til: String | ||
) : RuntimeException() | ||
} |
2 changes: 1 addition & 1 deletion
2
...nlesning/barnetrygd/Barnetrygdmottaker.kt → ...g/barnetrygd/domain/Barnetrygdmottaker.kt
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
25 changes: 25 additions & 0 deletions
25
...tjening/omsorgsopptjening/start/innlesning/barnetrygd/domain/BarnetrygdmottakerMelding.kt
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,25 @@ | ||
package no.nav.pensjon.opptjening.omsorgsopptjening.start.innlesning.barnetrygd.domain | ||
|
||
import no.nav.pensjon.opptjening.omsorgsopptjening.felles.CorrelationId | ||
import no.nav.pensjon.opptjening.omsorgsopptjening.felles.InnlesingId | ||
|
||
sealed class BarnetrygdmottakerMelding { | ||
abstract val correlationId: CorrelationId | ||
abstract val innlesingId: InnlesingId | ||
|
||
data class Start( | ||
override val correlationId: CorrelationId, | ||
override val innlesingId: InnlesingId | ||
) : BarnetrygdmottakerMelding() | ||
|
||
data class Data( | ||
val personIdent: String, | ||
override val correlationId: CorrelationId, | ||
override val innlesingId: InnlesingId | ||
) : BarnetrygdmottakerMelding() | ||
|
||
data class Slutt( | ||
override val correlationId: CorrelationId, | ||
override val innlesingId: InnlesingId | ||
) : BarnetrygdmottakerMelding() | ||
} |
Oops, something went wrong.