Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/validate submission #66

Merged
merged 65 commits into from
Nov 26, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
65 commits
Select commit Hold shift + click to select a range
2b07f72
added moment.js as dependency
banders Nov 7, 2023
805eba8
migration to insert data into 'employee_count_range' table
banders Nov 7, 2023
7e56513
added a new route '/codes/employee_count_range'. created a new 'code…
banders Nov 7, 2023
9b74fca
replaced underscores with dashes in the route '/<v>/codes/employee-co…
banders Nov 7, 2023
e24775a
Merge branch 'main' into feature/get-api-employee-range-count
banders Nov 7, 2023
08aeb78
removed debug statement
banders Nov 7, 2023
628ac14
made employee_count_range.expiry_date an optional column with null as…
banders Nov 7, 2023
3f71673
updated column employee_count_range.expiry_date to be optional with n…
banders Nov 7, 2023
125ea89
code cleanup to test for getAllEmployeeCountRanges()
banders Nov 7, 2023
908580e
updated query in getAllEmployeeCountRanges() to include records with …
banders Nov 7, 2023
086e8b3
Merge branch 'main' of https://github.com/bcgov/fin-pay-transparency
banders Nov 8, 2023
3c703ea
fixed merge conflicts
banders Nov 8, 2023
b144aa0
fixed merge conflicts
banders Nov 8, 2023
936dade
fixed merge conflicts
banders Nov 8, 2023
59bd5a5
fixed merge conflicts
banders Nov 8, 2023
a3109a4
Merge branch 'main' of https://github.com/bcgov/fin-pay-transparency
banders Nov 10, 2023
6c24c7e
Merge branch 'main' into feature/populate-input-form
banders Nov 10, 2023
ccd366d
added a new 'store' to manage retrieval and storage of static content…
banders Nov 10, 2023
4c4c6fb
added new functions getEmployeeCountRanges() and getNaicsCodes() to c…
banders Nov 10, 2023
4c53418
added EMPLOYEE_COUNT_RANGES with path to backend endpoint
banders Nov 10, 2023
30e8e57
made InputForm route require auth
banders Nov 10, 2023
214b53b
fixed route from 'Generate Pay Transparency Report' button
banders Nov 10, 2023
3fa4227
integrated employee count ranges and company info
banders Nov 10, 2023
4f2a17d
updated the pinia/testing library to help with mocking stores in comp…
banders Nov 10, 2023
a6bf2d1
updated the pinia/testing library to help with mocking stores in comp…
banders Nov 10, 2023
1d02d82
added 'ref' attributes to some form fields so Vuetify components can …
banders Nov 10, 2023
45e9a87
injected a 'test pinia' into the mounted component to allow testing o…
banders Nov 10, 2023
96fbcd2
bump vuetify version to 3.4.0
banders Nov 11, 2023
50d0e65
add new function to post the file upload submission
banders Nov 11, 2023
34217b3
added form validation.
banders Nov 11, 2023
239fcfb
added 'multer' library to support unpacking of multipart form data
banders Nov 11, 2023
751e4c7
work-in-progress commit to start unpacking and validating the submission
banders Nov 11, 2023
cc82778
added csv-parse library as a dependency
banders Nov 13, 2023
330c2e9
new service with a group of functions to support validation of upload…
banders Nov 13, 2023
49ea385
implemented basic csv file validation
banders Nov 13, 2023
f100680
changed format of error response if validation errors are found
banders Nov 13, 2023
374a588
display validation errors if any are returned
banders Nov 13, 2023
c7e9422
added tests for validate-service. exported the interfaces from valid…
banders Nov 14, 2023
5360775
Merge branch 'main' of https://github.com/bcgov/fin-pay-transparency
banders Nov 14, 2023
ad030bf
Merge branch 'main' into feature/populate-input-form
banders Nov 14, 2023
b5bf559
used more realistic data for naics code test
banders Nov 14, 2023
922a7ff
added endpoint URL for NAICS Code
banders Nov 14, 2023
1c59341
connected method getNaicsCodes() to the backend
banders Nov 14, 2023
4856f79
integrated NAICS codes into UI. The Vuetify Autocomplete component d…
banders Nov 14, 2023
770ec25
show full naicsCodes list
banders Nov 14, 2023
af1142a
added new test
banders Nov 14, 2023
2c4870f
started adding tests for codestore
banders Nov 14, 2023
2dd7667
Merge branch 'feature/populate-input-form' into feature/validate-subm…
banders Nov 14, 2023
9356c16
fixed the path of ApiService import
banders Nov 14, 2023
9b8e647
preliminary unit test
banders Nov 14, 2023
e49bb55
Merge branch 'feature/populate-input-form' into feature/validate-subm…
banders Nov 14, 2023
d68c5a9
50mb limit on fie uploads
banders Nov 14, 2023
cd0c295
Merge branch 'main' of https://github.com/bcgov/fin-pay-transparency
banders Nov 14, 2023
085d190
Merge branch 'main' into feature/validate-submission
banders Nov 15, 2023
d5c4f32
added additional validation checks
banders Nov 22, 2023
fe050ff
added new tests and updated existing tests for better clarity.
banders Nov 22, 2023
46fe7b9
Merge branch 'main' of https://github.com/bcgov/fin-pay-transparency
banders Nov 22, 2023
ff9abed
Merge branch 'main' into feature/validate-submission
banders Nov 22, 2023
40e1114
slightly loosened validation checks on the required header columns to…
banders Nov 22, 2023
4ecf747
fixed a bug in which certain CSV validation errors weren't correctly …
banders Nov 22, 2023
be08b76
add more info to error message
banders Nov 22, 2023
0c345ec
changed maximum value for all 'hours' columns to 8760 hours
banders Nov 22, 2023
76606a0
Merge branch 'main' of https://github.com/bcgov/fin-pay-transparency
banders Nov 22, 2023
b444882
resolved merge conflicts
banders Nov 22, 2023
515ea4a
removed 'N/A' as a valid value for all columns of the uploaded CSV. …
banders Nov 22, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions backend/src/v1/services/validate-service.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@ import {
validateService
} from './validate-service';

const VALID_DOLLAR_AMOUNTS = ["999999999", "1919", "2029.20", "150.4", "N/A", "", "0"];
const INVALID_DOLLAR_AMOUNTS = ["NA", "$399,929.90", "1373385000.50", "-362566.20", "14b", "a", "$14", "-2", "-1", "1000000000", "1000000000.01"];
const VALID_HOUR_AMOUNTS = ["9999", "75", "100.50", "N/A", "", "0"];
const INVALID_HOUR_AMOUNTS = ["1779C", "-1", "10000", "NA", "14b", "a", "$14", "-2"];
const VALID_GENDER_CODES = ["M", "F", "X", "U", "W"];
const VALID_DOLLAR_AMOUNTS = ["999999999", "1919", "2029.20", "150.4", "", "0"];
const INVALID_DOLLAR_AMOUNTS = ["N/A", "NA", "$399,929.90", "1373385000.50", "-362566.20", "14b", "a", "$14", "-2", "-1", "1000000000", "1000000000.01"];
const VALID_HOUR_AMOUNTS = ["8760", "75", "100.50", "", "0"];
const INVALID_HOUR_AMOUNTS = ["1779C", "-1", "8761", "N/A", "NA", "14b", "a", "$14", "-2"];
const VALID_GENDER_CODES = ["M", "F", "W", "X", "U"];
const INVALID_GENDER_CODES = ["H", "N/A", ""]


Expand Down
4 changes: 2 additions & 2 deletions backend/src/v1/services/validate-service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@ const DOLLARS_COLUMNS = [
];
const INVALID_COLUMN_ERROR = "Invalid CSV format. Please ensure the uploaded file contains the following columns: " + EXPECTED_COLUMNS.join(",")
const GENDER_CODES = ["M", "F", "X", "U", "W"];
const ZERO_SYNONYMS = ["N/A", ""];
const MAX_HOURS = 9999;
const ZERO_SYNONYMS = [""];
const MAX_HOURS = 8760; //equal to 24 hours/day x 365 days
const MAX_DOLLARS = 999999999;


Expand Down
Loading