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

Implemented API endpoint for getting employee count ranges #52

Merged
merged 26 commits into from
Nov 8, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 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
501ed6b
work in progress test
banders Nov 7, 2023
81e649f
added supertest as dependency to help with unit testing for api endpo…
banders Nov 7, 2023
69db42f
changed export format of codeRouter
banders Nov 7, 2023
e8ab1b9
changed the export format of the codeService module. implemented the…
banders Nov 8, 2023
e32bf6f
new module mainly intended for unit tests against API endpoints. add…
banders Nov 8, 2023
cfc4924
improved documentation of mocks within the file
banders Nov 8, 2023
086e8b3
Merge branch 'main' of https://github.com/bcgov/fin-pay-transparency
banders Nov 8, 2023
44ab7df
Merge branch 'main' into feature/get-api-employee-range-count
banders Nov 8, 2023
c6f5a18
mocked the config object so it will work even when no .env file is pr…
banders Nov 8, 2023
553f067
add public key as env variable for unit tests
banders Nov 8, 2023
8f97d15
replaced hard-coded frontend token with a value generated from the au…
banders Nov 8, 2023
16023a6
added debug statements to check environment variables are correctly set
banders Nov 8, 2023
9d17d43
fixed typo
banders Nov 8, 2023
fdb869e
fixed env variable reference
banders Nov 8, 2023
ce8efcd
removed debug statements
banders Nov 8, 2023
424417c
fixed code smell
banders Nov 8, 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
7 changes: 6 additions & 1 deletion .github/workflows/unittests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ jobs:
sonar_projectKey: fin-pay-transparency_frontend
token: SONAR_TOKEN_FRONTEND
steps:
- name: expose private key as env var
- name: expose private and public key as env var
shell: bash
run: |
EOF=" "
Expand All @@ -56,6 +56,11 @@ jobs:
echo "$PRIVATE_KEY_VAL" >> $GITHUB_ENV
echo "$EOF" >> $GITHUB_ENV
echo $PRIVATE_KEY # test the env var was set or not
PUBLIC_KEY_VAL="${{ vars.PUBLIC_KEY }}"
echo "PUBLIC_KEY<<$EOF" >> $GITHUB_ENV
echo "$PUBLIC_KEY_VAL" >> $GITHUB_ENV
echo "$EOF" >> $GITHUB_ENV
echo $PUBLIC_KEY # test the env var was set or not
- uses: bcgov-nr/[email protected]
with:
commands: |
Expand Down
48 changes: 48 additions & 0 deletions backend/db/migrations/V1.0.2__employee_count_range.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
/*
Update Summary:
- drops a not null constraint on pay_transparency.employee_count_range.expiry_date and changes
the default value to null.
- inserts initial data into the 'employee_count_range' table
*/

alter table pay_transparency.employee_count_range alter column expiry_date drop not null;
alter table pay_transparency.employee_count_range alter column expiry_date set default null;

insert into pay_transparency.employee_count_range (
employee_count_range_id,
employee_count_range,
create_user,
update_user
)
values (
gen_random_uuid(),
'50-299',
user,
user
);

insert into pay_transparency.employee_count_range (
employee_count_range_id,
employee_count_range,
create_user,
update_user
)
values (
gen_random_uuid(),
'300-999',
user,
user
);

insert into pay_transparency.employee_count_range (
employee_count_range_id,
employee_count_range,
create_user,
update_user
)
values (
gen_random_uuid(),
'1000 or more',
user,
user
);
131 changes: 131 additions & 0 deletions backend/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions backend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
"jsonwebtoken": "^9.0.1",
"lodash": "^4.17.21",
"memory-cache": "^0.2.0",
"moment": "^2.29.4",
"morgan": "^1.10.0",
"nconf": "^0.12.0",
"nocache": "^3.0.4",
Expand All @@ -42,6 +43,7 @@
"lint-staged": "^13.1.0",
"nodemon": "^3.0.1",
"prisma": "^5.2.0",
"supertest": "^6.3.3",
"ts-jest": "^29.0.5",
"ts-loader": "^9.4.2",
"ts-node": "^10.9.1",
Expand Down
Loading
Loading