vets-api
vets-api copied to clipboard
add models and unit test
Summary
This repository contains the implementation of the PegaTable model in Ruby on Rails. The PegaTable model is designed to represent data related to a Pega table in a Rails application. It includes validations to ensure the presence of essential fields such as UUID, veteran first name, veteran last name, and response. Additionally, it validates the format of the response field to ensure it contains a valid HTTP status code (200, 403, 500) and is in JSON format.
Key Features:
Validates presence of essential fields. Validates format of the response field to ensure it contains a valid HTTP status code and is in JSON format. Utilizes exceptions handling to gracefully handle JSON parsing errors.
Related issue(s)
https://github.com/department-of-veterans-affairs/vets-api/pull/16311
Testing done
- [ ] New code is covered by unit tests
- Describe what the old behavior was prior to the change
- Describe the steps required to verify your changes are working as expected. Exclusively stating 'Specs run' is NOT acceptable as appropriate testing
-
If this work is behind a flipper:
- Tests need to be written for both the flipper on and flipper off scenarios. Docs.
- What is the testing plan for rolling out the feature?
What areas of the site does it impact?
Non so far. It is only in staging. not in production
Acceptance criteria
- [ ] I fixed|updated|added unit tests and integration tests for each feature (if applicable).
- [ ] No error nor warning in the console.
- [ ] Events are being sent to the appropriate logging solution
- [ ] Documentation has been updated (link to documentation)
- [ ] No sensitive information (i.e. PII/credentials/internal URLs/etc.) is captured in logging, hardcoded, or specs
- [ ] Feature/bug has a monitor built into Datadog or Grafana (if applicable)
- [ ] If app impacted requires authentication, did you login to a local build and verify all authenticated routes work as expected
- [ ] I added a screenshot of the developed feature
Requested Feedback
(OPTIONAL)What should the reviewers know in addition to the above. Is there anything specific you wish the reviewer to assist with. Do you have any concerns with this PR, why?
Hi @cloudmagic80, you'll need to update the CODEOWNERS file since you're adding new files. We have an automated CI check for that but i just learned (thanks to your PR! 😄) that it passes (falsely) if you add more than one new file. I have a pr to fix this, but you don't need to wait on that–the CI check would just tell you to add those files to CODEOWNERS.
Error: A file (or its parent directories) does not have a CODEOWNERS entry. Please update the .github/CODEOWNERS file and add the entry for the Offending file: app/models/pega_table.rb
@rmtolmach Are the @department-of-veterans-affairs/va-api-engineers @department-of-veterans-affairs/backend-review-group the code reviewers?
@cloudmagic80 You'll want to add @department-of-veterans-affairs/backend-review-group AND your team as the code reviewers for all three of those files.
I thought we discussed changes for this yesterday that made more sense to do @cloudmagic80
This PR is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 7 days.
This PR has been closed because it has had no activity for 37 days