@@ -774,7 +774,7 @@ class BehandlingService(
774
774
return behandling.modified
775
775
}
776
776
777
- fun setVarsletFrist (
777
+ fun setOpprinneligVarsletFrist (
778
778
behandlingstidUnitType : TimeUnitType ,
779
779
behandlingstidUnits : Int ,
780
780
behandling : Behandling ,
@@ -784,7 +784,7 @@ class BehandlingService(
784
784
// TODO differentiate between mottatt and now.
785
785
val varsletFrist = findDateBasedOnTimeUnitTypeAndUnits(
786
786
timeUnitType = behandlingstidUnitType,
787
- units = behandlingstidUnits.toLong() ,
787
+ units = behandlingstidUnits,
788
788
fromDate = behandling.mottattKlageinstans.toLocalDate()
789
789
)
790
790
@@ -794,7 +794,10 @@ class BehandlingService(
794
794
behandlingstidUnits = behandlingstidUnits,
795
795
behandlingstidUnitType = behandlingstidUnitType,
796
796
behandling = behandling,
797
- mottakere = mottakere
797
+ mottakere = mottakere,
798
+ varselType = VarsletBehandlingstid .VarselType .OPPRINNELIG ,
799
+ doNotSendLetter = false ,
800
+ reasonNoLetter = null ,
798
801
)
799
802
}
800
803
@@ -804,14 +807,20 @@ class BehandlingService(
804
807
behandlingstidUnits : Int? ,
805
808
behandlingstidUnitType : TimeUnitType ? ,
806
809
behandling : Behandling ,
807
- mottakere : List <Mottaker >
810
+ mottakere : List <Mottaker >,
811
+ varselType : VarsletBehandlingstid .VarselType ,
812
+ doNotSendLetter : Boolean ,
813
+ reasonNoLetter : String? ,
808
814
): LocalDateTime {
809
815
val saksbehandlerIdent = if (systemUserContext) systembrukerIdent else tokenUtil.getIdent()
810
816
811
817
val varsletBehandlingstid = VarsletBehandlingstid (
812
818
varsletFrist = varsletFrist,
813
819
varsletBehandlingstidUnits = if (behandlingstidUnitType != null ) behandlingstidUnits else null ,
814
820
varsletBehandlingstidUnitType = if (behandlingstidUnits != null ) behandlingstidUnitType else null ,
821
+ varselType = varselType,
822
+ doNotSendLetter = doNotSendLetter,
823
+ reasonNoLetter = reasonNoLetter,
815
824
)
816
825
817
826
if (behandling is BehandlingWithVarsletBehandlingstid ) {
@@ -836,6 +845,7 @@ class BehandlingService(
836
845
),
837
846
timestamp = behandling.modified,
838
847
varsletFrist = varsletFrist,
848
+ timesPreviouslyExtended = behandling.getTimesPreviouslyExtended(),
839
849
)
840
850
),
841
851
behandlingId = behandling.id,
@@ -846,29 +856,33 @@ class BehandlingService(
846
856
}
847
857
848
858
fun setForlengetBehandlingstid (
849
- newVarsletBehandlingstid : VarsletBehandlingstid ,
859
+ varsletFrist : LocalDate ? ,
860
+ varsletBehandlingstidUnits : Int? ,
861
+ varsletBehandlingstidUnitType : TimeUnitType ,
850
862
behandling : Behandling ,
851
863
systemUserContext : Boolean ,
852
864
mottakere : List <Mottaker >,
865
+ doNotSendLetter : Boolean ,
866
+ reasonNoLetter : String? ,
853
867
): LocalDateTime {
854
- val varsletFrist =
855
- if (newVarsletBehandlingstid.varsletFrist != null ) {
856
- newVarsletBehandlingstid.varsletFrist
857
- } else {
858
- findDateBasedOnTimeUnitTypeAndUnits(
859
- timeUnitType = newVarsletBehandlingstid.varsletBehandlingstidUnitType!! ,
860
- units = newVarsletBehandlingstid.varsletBehandlingstidUnits!! .toLong(),
868
+ val newVarsletFrist =
869
+ (varsletFrist
870
+ ? : findDateBasedOnTimeUnitTypeAndUnits(
871
+ timeUnitType = varsletBehandlingstidUnitType,
872
+ units = varsletBehandlingstidUnits!! ,
861
873
fromDate = LocalDate .now(),
862
- )
863
- }!!
874
+ ))
864
875
865
876
return privateSetVarsletFrist(
866
877
systemUserContext = systemUserContext,
867
- varsletFrist = varsletFrist ,
868
- behandlingstidUnits = newVarsletBehandlingstid. varsletBehandlingstidUnits,
869
- behandlingstidUnitType = newVarsletBehandlingstid. varsletBehandlingstidUnitType,
878
+ varsletFrist = newVarsletFrist ,
879
+ behandlingstidUnits = varsletBehandlingstidUnits,
880
+ behandlingstidUnitType = varsletBehandlingstidUnitType,
870
881
behandling = behandling,
871
- mottakere = mottakere
882
+ mottakere = mottakere,
883
+ varselType = VarsletBehandlingstid .VarselType .FORLENGET ,
884
+ doNotSendLetter = doNotSendLetter,
885
+ reasonNoLetter = reasonNoLetter,
872
886
)
873
887
}
874
888
@@ -2363,7 +2377,11 @@ class BehandlingService(
2363
2377
varsletBehandlingstid = historyService.createVarsletBehandlingstidHistory(
2364
2378
varsletBehandlingstidHistorikk = behandling.varsletBehandlingstidHistorikk,
2365
2379
behandlingCreated = behandling.created,
2366
- )
2380
+ ),
2381
+ forlengetBehandlingstid = historyService.createForlengetBehandlingstidHistory(
2382
+ varsletBehandlingstidHistorikk = behandling.varsletBehandlingstidHistorikk,
2383
+ behandlingCreated = behandling.created,
2384
+ ),
2367
2385
)
2368
2386
}
2369
2387
0 commit comments