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

Art/poa requests/custom sorting #21345

Draft
wants to merge 1 commit into
base: art/poa-requests/pagination
Choose a base branch
from

Conversation

ojbucao
Copy link
Contributor

@ojbucao ojbucao commented Mar 19, 2025

Note: Delete the description statements, complete each step. None are optional, but can be justified as to why they cannot be completed as written. Provide known gaps to testing that may raise the risk of merging to production.

Summary

  • This work is behind a feature toggle (flipper): YES/NO
  • (Summarize the changes that have been made to the platform)
  • (If bug, how to reproduce)
  • (What is the solution, why is this the solution?)
  • (Which team do you work for, does your team own the maintenance of this component?)
  • (If introducing a flipper, what is the success criteria being targeted?)

Related issue(s)

department-of-veterans-affairs/va.gov-team#105523
department-of-veterans-affairs/va.gov-team#105524

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?

Screenshots

Note: Optional

What areas of the site does it impact?

(Describe what parts of the site are impacted andifcode touched other areas)

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 (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?

@va-vfs-bot va-vfs-bot temporarily deployed to art/poa-requests/custom-sorting/main/main March 19, 2025 17:05 Inactive
@ojbucao ojbucao force-pushed the art/poa-requests/pagination branch from dd115f6 to 9c094ff Compare March 20, 2025 06:04
@ojbucao ojbucao force-pushed the art/poa-requests/custom-sorting branch from 6cf72b4 to 1a59580 Compare March 20, 2025 22:01
@va-vfs-bot va-vfs-bot temporarily deployed to art/poa-requests/custom-sorting/main/main March 20, 2025 22:02 Inactive
Copy link

1 Warning
⚠️ This PR changes 332 LoC (not counting whitespace/newlines).

In order to ensure each PR receives the proper attention it deserves, we recommend not exceeding
200. Expect some delays getting reviews.

File Summary

Files

  • modules/accredited_representative_portal/app/controllers/accredited_representative_portal/v0/power_of_attorney_requests_controller.rb (+22/-25)

  • modules/accredited_representative_portal/app/models/accredited_representative_portal/power_of_attorney_request.rb (+18/-5)

  • modules/accredited_representative_portal/app/services/accredited_representative_portal/power_of_attorney_request_service/params_schema.rb (+20/-0)

  • modules/accredited_representative_portal/spec/models/accredited_representative_portal/power_of_attorney_request_spec.rb (+85/-15)

  • modules/accredited_representative_portal/spec/requests/accredited_representative_portal/v0/power_of_attorney_requests_spec.rb (+42/-1)

  • modules/accredited_representative_portal/spec/services/accredited_representative_portal/power_of_attorney_request_service/params_schema_spec.rb (+96/-3)

    Note: We exclude files matching the following when considering PR size:

    *.csv, *.json, *.tsv, *.txt, *.md, Gemfile.lock, app/swagger, modules/mobile/docs, spec/fixtures/, spec/support/vcr_cassettes/, modules/mobile/spec/support/vcr_cassettes/, db/seeds, modules/vaos/app/docs, modules/meb_api/app/docs, modules/appeals_api/app/swagger/, *.bru, *.pdf
    

Big PRs are difficult to review, often become stale, and cause delays.

Generated by 🚫 Danger

- Refactored `index` method in `PowerOfAttorneyRequestsController` to improve parameter handling and validation.
- Introduced sorting support (`sorted_by`) for `PowerOfAttorneyRequest` model.
- Moved `Statuses` constants to `ParamsSchema` for centralized validation.
- Updated `ParamsSchema` to enforce allowed sort fields and default sorting behavior.
- Improved `decisioned` scope with `left_outer_joins` for better query handling.
- Added comprehensive RSpec tests for sorting, status filtering, and schema validation.
- Ensured proper handling of invalid parameters with meaningful error messages.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants