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

MattT/APPEALS-65103: Create Route to Provide Most Recently Entered Cutoff Date #23620

Open
wants to merge 6 commits into
base: feature/APPEALS-57706
Choose a base branch
from

Conversation

ThorntonMatthew
Copy link
Contributor

@ThorntonMatthew ThorntonMatthew commented Nov 25, 2024

Resolves APPEALS-65103

Description

A route and controller action have been added to return the cutoff date utilized to determine if appeals are considered "schedulable".

Acceptance Criteria

  1. A Hearings::NationalHearingQueueController class is created in app/controllers/hearings/
    1. It inherits from the ApplicationController class
    2. A cutoff_date controller action is created that:
      1. Returns a JSON object with the following key-value pairs:
        1. cutoff_date:
        2. Return the value of cutoff_date from the most recently created SchedulableCutoffDate record {}if one exists{}.
        3. If no SchedulableCutoffDate records exist then return "2019-12-31".
      2. usercanupdate: Hardcode to false for now. This will be made dynamic in a later story.
  2. A route is added to routes.rb that allows for GET requests to reach the new controller action
    1. The URL that exposes the controller action is /nationalhearing_queue/cutoffdate
    2. The JSON output will be viewable at this address

Testing Plan

  1. Go to Jira Issue/Test Plan Link or list them below

Backend

Database Changes

Only for Schema Changes

  • Add typical timestamps (created_at, updated_at) for new tables
  • Update column comments; include a "PII" prefix to indicate definite or potential PII data content
  • Have your migration classes inherit from Caseflow::Migration, especially when adding indexes (use add_safe_index) (see Writing DB migrations)
  • Verify that migrate:rollback works as desired (change supported functions)
  • Perform query profiling (eyeball Rails log, check bullet and fasterer output)
  • For queries using raw sql was an explain plan run by System Team
  • Add appropriate indexes (especially for foreign keys, polymorphic columns, unique constraints, and Rails scopes)
  • Run make check-fks; add any missing foreign keys or add to config/initializers/immigrant.rb (see Record associations and Foreign Keys)
  • Add belongs_to for associations to enable the schema diagrams to be automatically updated
  • Document any non-obvious semantics or logic useful for interpreting database data at Caseflow Data Model and Dictionary

Integrations: Adding endpoints for external APIs

  • Check that Caseflow's external API code for the endpoint matches the code in the relevant integration repo
    • Request: Service name, method name, input field names
    • Response: Check expected data structure
    • Check that calls are wrapped in MetricService record block
  • Check that all configuration is coming from ENV variables
    • Listed all new ENV variables in description
    • Worked with or notified System Team that new ENV variables need to be set
  • Update Fakes
  • For feature branches: Was this tested in Caseflow UAT

Best practices

Code Documentation Updates

  • Add or update code comments at the top of the class, module, and/or component.

Tests

Test Coverage

Did you include any test coverage for your code? Check below:

  • RSpec
  • Jest
  • Other

Code Climate

Your code does not add any new code climate offenses? If so why?

  • No new code climate issues added

Monitoring, Logging, Auditing, Error, and Exception Handling Checklist

Monitoring

  • Are performance metrics (e.g., response time, throughput) being tracked?
  • Are key application components monitored (e.g., database, cache, queues)?
  • Is there a system in place for setting up alerts based on performance thresholds?

Logging

  • Are logs being produced at appropriate log levels (debug, info, warn, error, fatal)?
  • Are logs structured (e.g., using log tags) for easier querying and analysis?
  • Are sensitive data (e.g., passwords, tokens) redacted or omitted from logs?
  • Is log retention and rotation configured correctly?
  • Are logs being forwarded to a centralized logging system if needed?

Auditing

  • Are user actions being logged for audit purposes?
  • Are changes to critical data being tracked ?
  • Are logs being securely stored and protected from tampering or exposing protected data?

Error Handling

  • Are errors being caught and handled gracefully?
  • Are appropriate error messages being displayed to users?
  • Are critical errors being reported to an error tracking system (e.g., Sentry, ELK)?
  • Are unhandled exceptions being caught at the application level ?

Exception Handling

  • Are custom exceptions defined and used where appropriate?
  • Is exception handling consistent throughout the codebase?
  • Are exceptions logged with relevant context and stack trace information?
  • Are exceptions being grouped and categorized for easier analysis and resolution?

Add a cutoff_date action to the new controller that returns the most recent cutoff_date.

Add a new scope to SchedulableCutoffDate that returns the most recently added cutoff date if it exists.

Add some YARD doc strings
@ThorntonMatthew ThorntonMatthew marked this pull request as ready for review November 25, 2024 22:40
@ThorntonMatthew ThorntonMatthew changed the title MattT/APPEALS-65103 MattT/APPEALS-65103: Create Route to Provide Most Recently Entered Cutoff Date Nov 25, 2024
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.

1 participant