You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We need to define and align on the validation rules that need to be applied on the csv files used in creating tallies.
Proposed validation rules
General validation rules applied across all files:
Check if the CSV file has all the required column headers. If any headers are missing, then the file should be rejected.
Check if the CSV file has any missing data. If any required fields are empty, then the file should be rejected.
Check if the CSV file has any invalid data. For example, if a column is expected to contain numbers, but some values are strings, then the file should be rejected.
Check if the CSV file has any duplicated rows. If any rows are duplicated, then the file should be rejected.
Check if the CSV file has any invalid characters. If any characters are not allowed, such as special characters or emojis, then the file should be rejected.
Check if the CSV file has any inconsistent data types. For example, if a column is expected to contain dates, but some values are strings or numbers, then the file should be rejected.
Specific validation rules applicable per file type:
Sub Constituency file:
Validation rules:
sub_constituency_code column should only contain positive integer values.
number_of_ballots column values should match with the expected number of ballot types. For example, if a row in the sub constituency file has number_of_ballots column value as 2 then it can only have two ballot types e.g. ballot_number_presidential and ballot_number_general.
field_office_name column should only contain string/varchar values.
constituency_name column should only contain string/varchar values.
If a constituency was not found with the provided constituency_name, fail with an error.
ballot types columns ( ballot_number_presidential, ballot_number_general e.t.c.) should only contain positive integer values.
Required fields/columns:
sub_constituency_code
field_office_name
number_of_ballots
constituency_name
Center file:
Validation rules:
center_id column should only contain positive integer values.
name column should only contain string/varchar values.
region_name column should only contain string/varchar values.
If a region was not found with the provided region_name, fail with an error.
office_id column should only contain positive integer values.
office_name column should only contain string/varchar values.
If an office was not found with the provided office_name, 'regionandoffice_id`, fail with an error.
constituency_name column should only contain string/varchar values.
If a constituency was not found with the provided constituency_name, fail with an error.
subconstituency_id column should only contain positive integer values. Is there a code for no constituency?, because I have seen a center file that has the subconstituency_id value of 999 with the corresponding sub constituency name as No Sub Constituency.
If a sub constituency was not found with the provided subconstituency_id, fail with an error.
Required fields/columns:
center_id
name
office_id
office_name
subconstituency_id
constituency_name
region_name
Stations file:
Validation rules:
station_number column should only contain positive integer values.
station_gender column should only contain string/varchar values.
station_registrants column should only contain positive integer values unless the gender type is neither male or female.
sub_constituency_code column should only contain positive integer values.
If a subconstiency was not found with the provided sub_constituency_code, fail with an error.
center_code column should only contain positive integer values.
center_name column should only contain string/varchar values.
If a center was not found with the provided center_name/center_code, fail with an error.
Required fields/columns:
station_number
station_gender
sub_constituency_code
center_code
center_name
Candidates file:
Validation rules:
candidate_id column should only contain positive integer values.
ballot_number column should only contain positive integer values.
candidate_full_name column should only contain string/varchar values.
If a ballot was not found with the provided ballot_number, fail with an error.
Required fields/columns:
candidate_id
candidate_full_name
ballot_number
Result form file:
Validation rules:
barcode column should only contain string/varchar values.
ballot_number column should only contain positive integer values.
If the ballot retrieved via the ballot_number is not active, fail with an error.
If a ballot was not found with the provided ballot_number, fail with an error.
center_code column should only contain positive integer values.
If the center retrieved via the center_code is not active, fail with an error.
If the center was not found with the provided center_code, fail with an error.
station_number column should only contain positive integer values.
If the station retrieved via the station_number and center is not active, fail with an error.
If the station was not found with the provided station_number and center, fail with an error.
office_name column should only contain string/varchar values.
If an office was not found with the provided office_name, fail with an error.
name column should only contain string/varchar values.
User story
We need to define and align on the validation rules that need to be applied on the csv files used in creating tallies.
Proposed validation rules
General validation rules applied across all files:
Specific validation rules applicable per file type:
sub_constituency_code
column should only contain positive integer values.number_of_ballots
column values should match with the expected number of ballot types. For example, if a row in the sub constituency file hasnumber_of_ballots
column value as2
then it can only have two ballot types e.g.ballot_number_presidential
andballot_number_general
.field_office_name
column should only contain string/varchar values.constituency_name
column should only contain string/varchar values.constituency
was not found with the providedconstituency_name
, fail with an error.ballot_number_presidential
,ballot_number_general
e.t.c.) should only contain positive integer values.center_id
column should only contain positive integer values.name
column should only contain string/varchar values.region_name
column should only contain string/varchar values.region
was not found with the providedregion_name
, fail with an error.office_id
column should only contain positive integer values.office_name
column should only contain string/varchar values.office
was not found with the providedoffice_name
, 'regionand
office_id`, fail with an error.constituency_name
column should only contain string/varchar values.constituency
was not found with the providedconstituency_name
, fail with an error.subconstituency_id
column should only contain positive integer values. Is there a code forno constituency
?, because I have seen a center file that has thesubconstituency_id
value of999
with the corresponding sub constituency name asNo Sub Constituency
.sub constituency
was not found with the providedsubconstituency_id
, fail with an error.station_number
column should only contain positive integer values.station_gender
column should only contain string/varchar values.station_registrants
column should only contain positive integer values unless the gender type is neither male or female.sub_constituency_code
column should only contain positive integer values.subconstiency
was not found with the providedsub_constituency_code
, fail with an error.center_code
column should only contain positive integer values.center_name
column should only contain string/varchar values.center
was not found with the providedcenter_name/center_code
, fail with an error.candidate_id
column should only contain positive integer values.ballot_number
column should only contain positive integer values.candidate_full_name
column should only contain string/varchar values.ballot
was not found with the providedballot_number
, fail with an error.barcode
column should only contain string/varchar values.ballot_number
column should only contain positive integer values.ballot
retrieved via theballot_number
is not active, fail with an error.ballot
was not found with the providedballot_number
, fail with an error.center_code
column should only contain positive integer values.center
retrieved via thecenter_code
is not active, fail with an error.center
was not found with the providedcenter_code
, fail with an error.station_number
column should only contain positive integer values.station
retrieved via thestation_number
andcenter
is not active, fail with an error.station
was not found with the providedstation_number
andcenter
, fail with an error.office_name
column should only contain string/varchar values.office
was not found with the providedoffice_name
, fail with an error.name
column should only contain string/varchar values.Related to:
#372
The text was updated successfully, but these errors were encountered: