public bool IsPassportValid(ScannedPassportInfo passport) { return(passport.BirthYear != null && passport.ExpirationYear != null && passport.EyeColor != null && passport.HairColor != null && passport.Height != null && passport.IssueYear != null && passport.PassportId != null); }
public bool IsPassportValid(ScannedPassportInfo passport) { return(passport.BirthYear >= 1920 && passport.BirthYear <= 2002 && passport.IssueYear >= 2010 && passport.IssueYear <= 2020 && passport.ExpirationYear >= 2020 && passport.ExpirationYear <= 2030 && passport.Height != null && (passport.Height.Value.Unit == Unit.Cm && passport.Height.Value.Value >= 150 && passport.Height.Value.Value <= 193 || passport.Height.Value.Unit == Unit.In && passport.Height.Value.Value >= 59 && passport.Height.Value.Value <= 76) && passport.HairColor != null && passport.EyeColor > 0 && passport.PassportId != null && PassportIdRegex.IsMatch(passport.PassportId)); }