fix: align diary diet row and hide terminal cancel

- show only the personal diet name in the diary and keep the plan day chip
- hide consultation cancellation for terminal and non-cancellable states
- enable the refund form only for paid, started and in-progress plans
- cover diary rows and order info cancel visibility with tests
This commit is contained in:
2026-11-06 13:33:44 +03:00
parent 57536aba06
commit 0241265b3c
7 changed files with 105 additions and 29 deletions

View File

@@ -62,6 +62,32 @@ enum ChosenPlanStateEnum {
}
}
bool get canShowCancelAction {
switch (this) {
case ChosenPlanStateEnum.stateInited:
case ChosenPlanStateEnum.stateInCoordination:
case ChosenPlanStateEnum.stateStartDateHasBeenSet:
case ChosenPlanStateEnum.statePendingPayment:
case ChosenPlanStateEnum.statePaid:
case ChosenPlanStateEnum.stateStarted:
case ChosenPlanStateEnum.stateInProgress:
return true;
default:
return false;
}
}
bool get isCancelAfterPaidState {
switch (this) {
case ChosenPlanStateEnum.statePaid:
case ChosenPlanStateEnum.stateStarted:
case ChosenPlanStateEnum.stateInProgress:
return true;
default:
return false;
}
}
static List<ChosenPlanStateEnum> getActiveStates() {
return [
ChosenPlanStateEnum.statePaid,