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

Conversation

banders
Copy link
Contributor

@banders banders commented Nov 8, 2023

Description

Added a new API endpoint to get employee count ranges (/api/v1/codes/employee-count-ranges). The new endpoint requires users to be authenticated and expects a valid "frontend token" in the HTTP Authorization header.

The new API endpoint is defined in src/v1/routes/code-routes.ts. It is suggested that the same file be used to define other endpoints used to access static content (such as NAICS codes).

"Under the hood" the implementation of the new API endpoint makes a query to the database table pay_transparency.employee_count_range. The PR includes a database migration to insert preliminary data into this table.

Fixes # (issue)

Type of change

Please delete options that are not relevant.

  • New feature (non-breaking change which adds functionality)

How Has This Been Tested?

Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration

  • New unit test (in code-service.spec.ts) for new function codeService.getAllEmployeeCountRanges()
  • New unit test (in app.spec.ts) for the API endpoint itself

Checklist

  • I have read the CONTRIBUTING doc
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • Any dependent changes have already been accepted and merged

…service' to support the implementation of this route. added a test case for the new service.
…unt-range' to be consistent with the '/file-upload' endpoint.
… the default value. removed the 'expiry_date' column from insert statements (so nulls are inserted)
…null expiry_date (if effective_date is valid)
…employee-count-ranges endpoint with auth steps
…d some initial tests for the /employee-count-ranges endpoint
Copy link

sonarcloud bot commented Nov 8, 2023

[Pay Transparency Backend] Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

92.9% 92.9% Coverage
0.0% 0.0% Duplication

warning The version of Java (11.0.17) you have used to run this analysis is deprecated and we will stop accepting it soon. Please update to at least Java 17.
Read more here

Copy link

sonarcloud bot commented Nov 8, 2023

[Pay Transparency Frontend] Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
No Duplication information No Duplication information

warning The version of Java (11.0.17) you have used to run this analysis is deprecated and we will stop accepting it soon. Please update to at least Java 17.
Read more here

@sukanya-rath sukanya-rath merged commit bb0ba5a into main Nov 8, 2023
12 checks passed
@sukanya-rath sukanya-rath deleted the feature/get-api-employee-range-count branch November 8, 2023 21:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants