Skip to content

Commit

Permalink
fix: recovery school validity start
Browse files Browse the repository at this point in the history
* feature/refactor abstract factory

- WIP Refactor Validators

* feature/refactor abstract factory

- Refactor Validator Factory

* fix: minor ui glitches

- Fixed minor UI glitches as per request
- Added animated auto scroll on custom option selected

* fix: minor ui glitches

- Fix Faq link

* fix: recovery school validity start

- Use `df` rather than `fr` for special recoveries in school scan mode

Co-authored-by: Johnny Bueti <[email protected]>
  • Loading branch information
eapuzzo and Fehniix authored Mar 21, 2022
1 parent 0d170bd commit 97534ca
Showing 1 changed file with 8 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -193,8 +193,15 @@ class RecoveryBoosterValidator: RecoveryReinforcedValidator {
class RecoverySchoolValidator: RecoveryBaseValidator {

override func validate(hcert: HCert) -> Status {
var validityFrom: Date? = nil

guard let validityFrom = hcert.recoveryDateFirstPositive?.toRecoveryDate else { return .notValid }
if self.isSpecialRecovery(hcert: hcert) {
validityFrom = hcert.recoveryDateFrom?.toRecoveryDate
} else {
validityFrom = hcert.recoveryDateFirstPositive?.toRecoveryDate
}

guard let validityFrom = validityFrom else { return .notValid }

guard let recoveryStartDays = getStartDays(from: hcert) else { return .notValid }
guard let recoveryEndDays = getEndDays(from: hcert) else { return .notValid }
Expand Down

0 comments on commit 97534ca

Please sign in to comment.