@@ -162,7 +162,7 @@ class RecurringAccountViewModel(
162162 )
163163 }
164164
165- private fun handleInterestCalculationDaysInYearType (action : RecurringAccountAction .RecurringAccountInterestChartAction .OnInterestCalculationDaysInYearType ) {
165+ private fun handleInterestCalculationDaysInYearType (action : RecurringAccountAction .RecurringAccountTermAction .OnInterestCalculationDaysInYearType ) {
166166 mutableStateFlow.update {
167167 it.copy(
168168 recurringDepositAccountInterestChart = it.recurringDepositAccountInterestChart.copy(
@@ -173,7 +173,7 @@ class RecurringAccountViewModel(
173173 }
174174 }
175175
176- private fun handleInterestCalculationType (action : RecurringAccountAction .RecurringAccountInterestChartAction .OnInterestCalculationType ) {
176+ private fun handleInterestCalculationType (action : RecurringAccountAction .RecurringAccountTermAction .OnInterestCalculationType ) {
177177 mutableStateFlow.update {
178178 it.copy(
179179 recurringDepositAccountInterestChart = it.recurringDepositAccountInterestChart.copy(
@@ -183,7 +183,7 @@ class RecurringAccountViewModel(
183183 }
184184 }
185185
186- private fun handleInterestCompoundingPeriodType (action : RecurringAccountAction .RecurringAccountInterestChartAction .OnInterestCompoundingPeriodType ) {
186+ private fun handleInterestCompoundingPeriodType (action : RecurringAccountAction .RecurringAccountTermAction .OnInterestCompoundingPeriodType ) {
187187 mutableStateFlow.update {
188188 it.copy(
189189 recurringDepositAccountInterestChart = it.recurringDepositAccountInterestChart.copy(
@@ -193,7 +193,7 @@ class RecurringAccountViewModel(
193193 }
194194 }
195195
196- private fun handleInterestPostingPeriodType (action : RecurringAccountAction .RecurringAccountInterestChartAction .OnInterestPostingPeriodType ) {
196+ private fun handleInterestPostingPeriodType (action : RecurringAccountAction .RecurringAccountTermAction .OnInterestPostingPeriodType ) {
197197 mutableStateFlow.update {
198198 it.copy(
199199 recurringDepositAccountInterestChart = it.recurringDepositAccountInterestChart.copy(
@@ -670,21 +670,36 @@ class RecurringAccountViewModel(
670670 moveToNextStep()
671671 }
672672
673- is RecurringAccountAction .RecurringAccountInterestChartAction .OnInterestCalculationDaysInYearType -> {
673+ is RecurringAccountAction .RecurringAccountTermAction .OnInterestCalculationDaysInYearType -> {
674674 handleInterestCalculationDaysInYearType(action)
675675 }
676676
677- is RecurringAccountAction .RecurringAccountInterestChartAction .OnInterestCalculationType -> {
677+ is RecurringAccountAction .RecurringAccountTermAction .OnInterestCalculationType -> {
678678 handleInterestCalculationType(action)
679679 }
680680
681- is RecurringAccountAction .RecurringAccountInterestChartAction .OnInterestCompoundingPeriodType -> {
681+ is RecurringAccountAction .RecurringAccountTermAction .OnInterestCompoundingPeriodType -> {
682682 handleInterestCompoundingPeriodType(action)
683683 }
684684
685- is RecurringAccountAction .RecurringAccountInterestChartAction .OnInterestPostingPeriodType -> {
685+ is RecurringAccountAction .RecurringAccountTermAction .OnInterestPostingPeriodType -> {
686686 handleInterestPostingPeriodType(action)
687687 }
688+
689+ RecurringAccountAction .OnDismissDialog -> {
690+ mutableStateFlow.update {
691+ it.copy(
692+ dialogState = null ,
693+ )
694+ }
695+ }
696+ RecurringAccountAction .OnShowRateChartDialog -> {
697+ mutableStateFlow.update {
698+ it.copy(
699+ dialogState = RecurringAccountState .DialogState .RateChartDialog ,
700+ )
701+ }
702+ }
688703 }
689704 }
690705}
@@ -702,12 +717,18 @@ data class RecurringAccountState(
702717 val currencyIndex : Int = -1 ,
703718 val currencyError : String? = null ,
704719 val isOverlayLoading : Boolean = false ,
720+ val dialogState : DialogState ? = null ,
705721) {
706722 sealed interface ScreenState {
707723 data class Error (val message : String ) : ScreenState
708724 data object Loading : ScreenState
709725 data object Success : ScreenState
710726 }
727+ sealed interface DialogState {
728+ data object RateChartDialog : DialogState
729+ }
730+
731+ val isRateChartEmpty = ! template.accountChart?.chartSlabs.isNullOrEmpty()
711732}
712733
713734data class RecurringAccountDetailsState
@@ -798,6 +819,8 @@ sealed class RecurringAccountAction {
798819 object OnBackPress : RecurringAccountAction()
799820 object OnNextPress : RecurringAccountAction()
800821 data object Retry : RecurringAccountAction ()
822+ object OnShowRateChartDialog : RecurringAccountAction()
823+ object OnDismissDialog : RecurringAccountAction()
801824
802825 sealed class RecurringAccountDetailsAction : RecurringAccountAction () {
803826 data class OnProductNameChange (val index : Int ) : RecurringAccountDetailsAction()
@@ -851,18 +874,18 @@ sealed class RecurringAccountAction {
851874 object OnSettingNext : RecurringAccountSettingsAction()
852875 }
853876
854- sealed class RecurringAccountInterestChartAction : RecurringAccountAction () {
877+ sealed class RecurringAccountTermAction : RecurringAccountAction () {
855878 data class OnInterestCalculationDaysInYearType (val interestCalculationTypeDaysInYear : Int ) :
856- RecurringAccountInterestChartAction ()
879+ RecurringAccountTermAction ()
857880
858881 data class OnInterestCompoundingPeriodType (val interestCompoundingPeriodType : Int ) :
859- RecurringAccountInterestChartAction ()
882+ RecurringAccountTermAction ()
860883
861884 data class OnInterestCalculationType (val interestCalculationType : Int ) :
862- RecurringAccountInterestChartAction ()
885+ RecurringAccountTermAction ()
863886
864887 data class OnInterestPostingPeriodType (val interestPostingPeriodType : Int ) :
865- RecurringAccountInterestChartAction ()
888+ RecurringAccountTermAction ()
866889 }
867890}
868891
0 commit comments