isPlateValid function

bool isPlateValid(
  1. PlateInfo plateInfo,
  2. NormalizedPlate normalizedPlate
)

Checks plate validation

Implementation

bool isPlateValid(PlateInfo plateInfo, NormalizedPlate normalizedPlate) {
  if (!isPlateNumberValid(normalizedPlate.numbers)) return false;
  if (plateInfo.type == 'Car' && plateInfo.category == null) return false;
  if (plateInfo.province == null) return false;
  return true;
}