index
int64
0
0
repo_id
stringclasses
829 values
file_path
stringlengths
34
254
content
stringlengths
6
5.38M
0
code_files/vets-api-private/modules/claims_evidence_api/lib/claims_evidence_api
code_files/vets-api-private/modules/claims_evidence_api/lib/claims_evidence_api/validation/search_file_request.rb
# frozen_string_literal: true require 'claims_evidence_api/json_schema' module ClaimsEvidenceApi module Validation # validation and transformation specific to the available filters and sort for files:search module SearchFileRequest class << self # assemble the list of valid filter fields to be...
0
code_files/vets-api-private/modules/claims_evidence_api/lib/claims_evidence_api
code_files/vets-api-private/modules/claims_evidence_api/lib/claims_evidence_api/validation/field.rb
# frozen_string_literal: true module ClaimsEvidenceApi module Validation # parent class for containing field level validations class BaseField # valid types of fields TYPES = %i[string integer number boolean].freeze attr_reader :type, :validations # create a field validator of `type...
0
code_files/vets-api-private/modules/claims_evidence_api/db
code_files/vets-api-private/modules/claims_evidence_api/db/migrate/20250610154822_create_claim_evidence_api_submission_status_enum.rb
# frozen_string_literal: true # create status enum class CreateClaimEvidenceApiSubmissionStatusEnum < ActiveRecord::Migration[7.2] # create the enum def change create_enum :claims_evidence_api_submission_status, %w[pending accepted failed] end end
0
code_files/vets-api-private/modules/claims_evidence_api/db
code_files/vets-api-private/modules/claims_evidence_api/db/migrate/20250610160901_add_needs_kms_rotation_indices_claim_evidence_api_tables.rb
# frozen_string_literal: true # add kms rotation indexes class AddNeedsKmsRotationIndicesClaimEvidenceApiTables < ActiveRecord::Migration[7.2] disable_ddl_transaction! # add the index def change add_index :claims_evidence_api_submissions, :needs_kms_rotation, algorithm: :concurrently, if_not_exists: true ...
0
code_files/vets-api-private/modules/claims_evidence_api/db
code_files/vets-api-private/modules/claims_evidence_api/db/migrate/20250610154823_create_claim_evidence_api_submissions.rb
# frozen_string_literal: true # create submissions table class CreateClaimEvidenceApiSubmissions < ActiveRecord::Migration[7.2] # create the table def change create_table :claims_evidence_api_submissions do |t| t.string :form_id, null: false, comment: 'form type of the submission' t.enum :latest_s...
0
code_files/vets-api-private/modules/claims_evidence_api/db
code_files/vets-api-private/modules/claims_evidence_api/db/migrate/20250610154842_create_claim_evidence_api_submission_attempts.rb
# frozen_string_literal: true # create submission attempts table class CreateClaimEvidenceApiSubmissionAttempts < ActiveRecord::Migration[7.2] # create the table def change create_table :claims_evidence_api_submission_attempts do |t| t.references :claims_evidence_api_submissions, null: false, foreign_ke...
0
code_files/vets-api-private/modules
code_files/vets-api-private/modules/representation_management/representation_management.gemspec
# frozen_string_literal: true $LOAD_PATH.push File.expand_path('lib', __dir__) # Maintain your gem's version: require 'representation_management/version' # Describe your gem and declare its dependencies: Gem::Specification.new do |spec| spec.name = 'representation_management' spec.version = Representa...
0
code_files/vets-api-private/modules
code_files/vets-api-private/modules/representation_management/Rakefile
# frozen_string_literal: true begin require 'bundler/setup' rescue LoadError puts 'You must `gem install bundler` and `bundle install` to run rake tasks' end require 'rdoc/task' RDoc::Task.new(:rdoc) do |rdoc| rdoc.rdoc_dir = 'rdoc' rdoc.title = 'RepresentationManagement' rdoc.options << '--line-numbers...
0
code_files/vets-api-private/modules
code_files/vets-api-private/modules/representation_management/Gemfile
# frozen_string_literal: true source 'https://rubygems.org' # Declare your gem's dependencies in representationmanagement.gemspec. # Bundler will treat runtime dependencies like base dependencies, and # development dependencies will be added by default to the :development group. gemspec # Declare any dependencies th...
0
code_files/vets-api-private/modules
code_files/vets-api-private/modules/representation_management/README.rdoc
= RepresentationManagement TODO: Short description and motivation. == Installation Ensure the following line is in the root project's Gemfile: gem 'representationmanagement', path: 'modules/representationmanagement' == License This module is open source under the terms of the [MIT License](https://opensource.org/l...
0
code_files/vets-api-private/modules/representation_management/app/sidekiq
code_files/vets-api-private/modules/representation_management/app/sidekiq/representation_management/accredited_entities_queue_updates.rb
# frozen_string_literal: true require 'sidekiq' module RepresentationManagement # This is the first job in a two job process for updating accredited entities. # Processes and updates accredited entities (agents and attorneys) from the GCLAWS API # # This Sidekiq job fetches data about accredited agents and at...
0
code_files/vets-api-private/modules/representation_management/app/sidekiq
code_files/vets-api-private/modules/representation_management/app/sidekiq/representation_management/README.md
# Representation Management Sidekiq Jobs This directory contains Sidekiq background jobs that handle the synchronization and updating of accredited entities (attorneys, agents, VSOs, and representatives) from the GCLAWS API to the local database. ## Overview The synchronization process consists of two main jobs that...
0
code_files/vets-api-private/modules/representation_management/app/sidekiq
code_files/vets-api-private/modules/representation_management/app/sidekiq/representation_management/accredited_individuals_update.rb
# frozen_string_literal: true require 'sidekiq' module RepresentationManagement # This is the second job in a two job process for updating accredited entities. # Processes address validation for AccreditedIndividual records by ID. # This class finds AccreditedIndividual records and calls their validate_address ...
0
code_files/vets-api-private/modules/representation_management/app/sidekiq
code_files/vets-api-private/modules/representation_management/app/sidekiq/power_of_attorney_requests/send_expiration_reminder_email_job.rb
# frozen_string_literal: true require 'sidekiq' module PowerOfAttorneyRequests class SendExpirationReminderEmailJob include Sidekiq::Job def perform requests_to_remind = fetch_requests_to_remind return unless requests_to_remind.any? requests_to_remind.each do |request| notificati...
0
code_files/vets-api-private/modules/representation_management/app/sidekiq
code_files/vets-api-private/modules/representation_management/app/sidekiq/power_of_attorney_requests/send_expired_email_job.rb
# frozen_string_literal: true require 'sidekiq' module PowerOfAttorneyRequests class SendExpiredEmailJob # This may change to a job that expires requests then sends an email include Sidekiq::Job def perform requests_to_inform_of_expiration = fetch_requests_to_inform_of_expiration return unl...
0
code_files/vets-api-private/modules/representation_management/app/swagger
code_files/vets-api-private/modules/representation_management/app/swagger/v0/swagger.json
{ "openapi": "3.0.1", "info": { "title": "va.gov Representation Management API", "version": "0.1.0", "termsOfService": "https://developer.va.gov/terms-of-service", "description": "A set of APIs powering the POA Widget, Find a Representative, and Appoint a Representative." }, "tags": [ { ...
0
code_files/vets-api-private/modules/representation_management/app/models
code_files/vets-api-private/modules/representation_management/app/models/representation_management/accreditation_data_ingestion_log.rb
# frozen_string_literal: true module RepresentationManagement # Tracks the progress and status of accreditation data ingestion processes # # This class monitors data ingestion from various sources (Accreditation API or Trexler file) # and tracks the status of each entity type (agents, attorneys, representative...
0
code_files/vets-api-private/modules/representation_management/app/models
code_files/vets-api-private/modules/representation_management/app/models/representation_management/form_2122_base.rb
# frozen_string_literal: true module RepresentationManagement class Form2122Base include ActiveModel::Model NINE_DIGIT_NUMBER = /\A\d{9}\z/ TEN_DIGIT_NUMBER = /\A\d{10}\z/ SERVICE_NUMBER = /\A[A-Z]{0,2}\d{5,8}\z/ LIMITATIONS_OF_CONSENT = %w[ALCOHOLISM DRUG_ABUSE HIV SICKLE_CELL].freeze vete...
0
code_files/vets-api-private/modules/representation_management/app/models
code_files/vets-api-private/modules/representation_management/app/models/representation_management/form_2122_data.rb
# frozen_string_literal: true module RepresentationManagement class Form2122Data < RepresentationManagement::Form2122Base attr_accessor :organization_id validates :organization_id, presence: true validate :organization_exists? def organization @organization ||= find_organization end ...
0
code_files/vets-api-private/modules/representation_management/app/models
code_files/vets-api-private/modules/representation_management/app/models/representation_management/form_2122_digital_submission.rb
# frozen_string_literal: true module RepresentationManagement class Form2122DigitalSubmission < RepresentationManagement::Form2122Base BLANK_ICN = 'ICN value is missing' BLANK_PARTICIPANT_ID = 'Corp Participant ID value is blank' DEPENDENT_SUBMITTER = 'must submit as the Veteran for digital Power of Atto...
0
code_files/vets-api-private/modules/representation_management/app/models
code_files/vets-api-private/modules/representation_management/app/models/representation_management/accredited_individual_search.rb
# frozen_string_literal: true module RepresentationManagement class AccreditedIndividualSearch include ActiveModel::Model PERMITTED_MAX_DISTANCES = %w[5 10 25 50 100 200].freeze # in miles, no distance provided will default to "all" PERMITTED_SORTS = %w[distance_asc first_name_asc first_name_desc last_n...
0
code_files/vets-api-private/modules/representation_management/app/models
code_files/vets-api-private/modules/representation_management/app/models/representation_management/form_2122a_data.rb
# frozen_string_literal: true module RepresentationManagement class Form2122aData < RepresentationManagement::Form2122Base REPRESENTATIVE_TYPES = %w[ATTORNEY AGENT INDIVIDUAL VSO_REPRESENTATIVE].freeze VETERAN_SERVICE_BRANCHES = %w[ARMY NAVY AIR_FORCE MARINE_CORPS COAST_GUARD SPACE_FORCE NOAA ...
0
code_files/vets-api-private/modules/representation_management/app/models
code_files/vets-api-private/modules/representation_management/app/models/representation_management/accreditation_api_entity_count.rb
# frozen_string_literal: true module RepresentationManagement # Tracks and validates counts of accredited entities from the GCLAWS API # # This class stores historical count data for different types of accredited # entities (agents, attorneys, representatives, veteran service organizations) # and enforces va...
0
code_files/vets-api-private/modules/representation_management/app/models
code_files/vets-api-private/modules/representation_management/app/models/representation_management/next_steps_email_data.rb
# frozen_string_literal: true module RepresentationManagement class NextStepsEmailData include ActiveModel::Model next_steps_email_attrs = %i[ email_address first_name form_name form_number entity_type entity_id ] attr_accessor(*next_steps_email_attrs) valid...
0
code_files/vets-api-private/modules/representation_management/app/models
code_files/vets-api-private/modules/representation_management/app/models/representation_management/flagged_veteran_representative_contact_data.rb
# frozen_string_literal: true module RepresentationManagement class FlaggedVeteranRepresentativeContactData < ApplicationRecord self.table_name = 'flagged_veteran_representative_contact_data' enum :flag_type, { phone_number: 'phone_number', email: 'email', address: 'address', other: 'other' }, suffix: true ...
0
code_files/vets-api-private/modules/representation_management/app/docs/representation_management
code_files/vets-api-private/modules/representation_management/app/docs/representation_management/v0/power_of_attorney.yaml
openapi: '3.0.0' info: version: 1.0.0 title: Power of Attorney API description: This API returns the Power of Attorney for veterans. contact: name: va.gov tags: - name: power_of_attorney description: Retrieve Power of Attorney details for a veteran. servers: - url: http://localhost:3000/representati...
0
code_files/vets-api-private/modules/representation_management/app/adapters
code_files/vets-api-private/modules/representation_management/app/adapters/representation_management/veteran_representative_adapter.rb
# frozen_string_literal: true module RepresentationManagement # Adapter to make Veteran::Service::Representative compatible with AccreditedIndividual serializers # # This adapter wraps a Veteran::Service::Representative record and provides the same interface # as AccreditedIndividual, allowing both models to u...
0
code_files/vets-api-private/modules/representation_management/app/serializers
code_files/vets-api-private/modules/representation_management/app/serializers/representation_management/power_of_attorney_request_serializer.rb
# frozen_string_literal: true module RepresentationManagement class PowerOfAttorneyRequestSerializer include JSONAPI::Serializer attributes :created_at, :expires_at end end
0
code_files/vets-api-private/modules/representation_management/app/serializers
code_files/vets-api-private/modules/representation_management/app/serializers/representation_management/flagged_veteran_representative_contact_data_serializer.rb
# frozen_string_literal: true module RepresentationManagement class FlaggedVeteranRepresentativeContactDataSerializer include JSONAPI::Serializer attributes :ip_address, :representative_id, :flag_type, :flagged_value end end
0
code_files/vets-api-private/modules/representation_management/app/serializers/representation_management
code_files/vets-api-private/modules/representation_management/app/serializers/representation_management/accredited_entities/individual_serializer.rb
# frozen_string_literal: true module RepresentationManagement module AccreditedEntities class IndividualSerializer include JSONAPI::Serializer attributes :first_name, :last_name, :full_name, :address_line1, :address_line2, :address_line3, :address_type, ...
0
code_files/vets-api-private/modules/representation_management/app/serializers/representation_management
code_files/vets-api-private/modules/representation_management/app/serializers/representation_management/accredited_individuals/organization_serializer.rb
# frozen_string_literal: true module RepresentationManagement module AccreditedIndividuals class OrganizationSerializer include JSONAPI::Serializer attributes :poa_code, :name, :address_line1, :address_line2, :address_line3, :address_type, :city, :country_name, :country_code_iso3, :...
0
code_files/vets-api-private/modules/representation_management/app/serializers/representation_management
code_files/vets-api-private/modules/representation_management/app/serializers/representation_management/accredited_individuals/individual_serializer.rb
# frozen_string_literal: true module RepresentationManagement module AccreditedIndividuals class IndividualSerializer include JSONAPI::Serializer attributes :individual_type, :registration_number, :first_name, :last_name, :address_line1, :address_line2, :address_line3, :address_type...
0
code_files/vets-api-private/modules/representation_management/app/serializers/representation_management
code_files/vets-api-private/modules/representation_management/app/serializers/representation_management/power_of_attorney/organization_serializer.rb
# frozen_string_literal: true module RepresentationManagement module PowerOfAttorney class OrganizationSerializer < BaseSerializer include JSONAPI::Serializer attribute :type do 'organization' end attribute :name end end end
0
code_files/vets-api-private/modules/representation_management/app/serializers/representation_management
code_files/vets-api-private/modules/representation_management/app/serializers/representation_management/power_of_attorney/representative_serializer.rb
# frozen_string_literal: true module RepresentationManagement module PowerOfAttorney class RepresentativeSerializer < BaseSerializer include JSONAPI::Serializer attribute :type do 'representative' end attribute :individual_type do |object| object.user_types.first e...
0
code_files/vets-api-private/modules/representation_management/app/serializers/representation_management
code_files/vets-api-private/modules/representation_management/app/serializers/representation_management/power_of_attorney/base_serializer.rb
# frozen_string_literal: true module RepresentationManagement module PowerOfAttorney class BaseSerializer include JSONAPI::Serializer attributes :address_line1, :address_line2, :address_line3, :address_type, :city, :country_name, :country_code_iso3, :province, :inte...
0
code_files/vets-api-private/modules/representation_management/app/serializers/representation_management
code_files/vets-api-private/modules/representation_management/app/serializers/representation_management/original_entities/organization_serializer.rb
# frozen_string_literal: true module RepresentationManagement module OriginalEntities class OrganizationSerializer include JSONAPI::Serializer attributes :name, :address_line1, :address_line2, :address_line3, :address_type, :city, :country_name, :country_code_iso3, :province, :inter...
0
code_files/vets-api-private/modules/representation_management/app/serializers/representation_management
code_files/vets-api-private/modules/representation_management/app/serializers/representation_management/original_entities/representative_serializer.rb
# frozen_string_literal: true module RepresentationManagement module OriginalEntities class RepresentativeSerializer include JSONAPI::Serializer attributes :first_name, :last_name, :full_name, :address_line1, :address_line2, :address_line3, :address_type, ...
0
code_files/vets-api-private/modules/representation_management/app/controllers/representation_management
code_files/vets-api-private/modules/representation_management/app/controllers/representation_management/v0/flag_accredited_representatives_controller.rb
# frozen_string_literal: true module RepresentationManagement module V0 class FlagAccreditedRepresentativesController < ApplicationController service_tag 'representation-management' before_action :feature_enabled skip_before_action :authenticate def create flags = nil be...
0
code_files/vets-api-private/modules/representation_management/app/controllers/representation_management
code_files/vets-api-private/modules/representation_management/app/controllers/representation_management/v0/power_of_attorney_request_base_controller.rb
# frozen_string_literal: true module RepresentationManagement module V0 class PowerOfAttorneyRequestBaseController < ApplicationController service_tag 'representation-management' before_action :feature_enabled private def params_permitted [ :representative_submission_m...
0
code_files/vets-api-private/modules/representation_management/app/controllers/representation_management
code_files/vets-api-private/modules/representation_management/app/controllers/representation_management/v0/accredited_entities_for_appoint_controller.rb
# frozen_string_literal: true module RepresentationManagement module V0 class AccreditedEntitiesForAppointController < ApplicationController service_tag 'representation-management' skip_before_action :authenticate before_action :feature_enabled def index data = RepresentationMana...
0
code_files/vets-api-private/modules/representation_management/app/controllers/representation_management
code_files/vets-api-private/modules/representation_management/app/controllers/representation_management/v0/pdf_generator_2122_controller.rb
# frozen_string_literal: true module RepresentationManagement module V0 class PdfGenerator2122Controller < RepresentationManagement::V0::PowerOfAttorneyRequestBaseController skip_before_action :authenticate before_action :load_user def create form = RepresentationManagement::Form2122Da...
0
code_files/vets-api-private/modules/representation_management/app/controllers/representation_management
code_files/vets-api-private/modules/representation_management/app/controllers/representation_management/v0/apidocs_controller.rb
# frozen_string_literal: true module RepresentationManagement module V0 class ApidocsController < ApplicationController service_tag 'representation-management' skip_before_action :authenticate def index swagger = JSON.parse(File.read(RepresentationManagement::Engine.root.join('app/swa...
0
code_files/vets-api-private/modules/representation_management/app/controllers/representation_management
code_files/vets-api-private/modules/representation_management/app/controllers/representation_management/v0/next_steps_email_controller.rb
# frozen_string_literal: true module RepresentationManagement module V0 class NextStepsEmailController < ApplicationController service_tag 'representation-management' skip_before_action :authenticate before_action :feature_enabled # Creates and enqueues an email with the provided "next s...
0
code_files/vets-api-private/modules/representation_management/app/controllers/representation_management
code_files/vets-api-private/modules/representation_management/app/controllers/representation_management/v0/pdf_generator_2122a_controller.rb
# frozen_string_literal: true module RepresentationManagement module V0 class PdfGenerator2122aController < RepresentationManagement::V0::PowerOfAttorneyRequestBaseController skip_before_action :authenticate before_action :load_user def create form = RepresentationManagement::Form2122a...
0
code_files/vets-api-private/modules/representation_management/app/controllers/representation_management
code_files/vets-api-private/modules/representation_management/app/controllers/representation_management/v0/power_of_attorney_requests_controller.rb
# frozen_string_literal: true module RepresentationManagement module V0 class PowerOfAttorneyRequestsController < RepresentationManagement::V0::PowerOfAttorneyRequestBaseController service_tag 'representation-management' before_action :feature_enabled def create if !form.valid? ...
0
code_files/vets-api-private/modules/representation_management/app/controllers/representation_management
code_files/vets-api-private/modules/representation_management/app/controllers/representation_management/v0/power_of_attorney_controller.rb
# frozen_string_literal: true require 'lighthouse/benefits_claims/service' module RepresentationManagement module V0 class PowerOfAttorneyController < ApplicationController service_tag 'representation-management' before_action { authorize :power_of_attorney, :access? } def index @acti...
0
code_files/vets-api-private/modules/representation_management/app/controllers/representation_management
code_files/vets-api-private/modules/representation_management/app/controllers/representation_management/v0/original_entities_controller.rb
# frozen_string_literal: true module RepresentationManagement module V0 class OriginalEntitiesController < ApplicationController service_tag 'representation-management' skip_before_action :authenticate before_action :feature_enabled def index data = RepresentationManagement::Orig...
0
code_files/vets-api-private/modules/representation_management/app/controllers/representation_management
code_files/vets-api-private/modules/representation_management/app/controllers/representation_management/v0/accredited_individuals_controller.rb
# frozen_string_literal: true module RepresentationManagement module V0 class AccreditedIndividualsController < ApplicationController service_tag 'representation-management' skip_before_action :authenticate before_action :feature_enabled DEFAULT_PAGE = 1 DEFAULT_PER_PAGE = 10 ...
0
code_files/vets-api-private/modules/representation_management/app/services
code_files/vets-api-private/modules/representation_management/app/services/representation_management/original_entity_query.rb
# frozen_string_literal: true module RepresentationManagement class OriginalEntityQuery MAXIMUM_RESULT_COUNT = 10 WORD_SIMILARITY_THRESHOLD = 0.7 # Initializes a new instance of OriginalEntityQuery. # # @param query_string [String] the string to be used for querying veteran_x entities. def i...
0
code_files/vets-api-private/modules/representation_management/app/services
code_files/vets-api-private/modules/representation_management/app/services/representation_management/address_validation_service.rb
# frozen_string_literal: true require 'va_profile/models/validation_address' require 'va_profile/address_validation/v3/service' module RepresentationManagement # Service class responsible for validating addresses using VAProfile Address Validation API # # This service handles: # - Building VAProfile Validatio...
0
code_files/vets-api-private/modules/representation_management/app/services
code_files/vets-api-private/modules/representation_management/app/services/representation_management/address_preprocessor.rb
# frozen_string_literal: true module RepresentationManagement module AddressPreprocessor PO_BOX_REGEX = /P\.?O\.?\s*BOX\s*\d+/i ROOM_SUITE_REGEX = /,?\s*(Room|Rm|Suite|Ste?)\.?\s*\d+/i module_function # Mutates a shallow copy of the address hash and returns it def clean(address) return ad...
0
code_files/vets-api-private/modules/representation_management/app/services
code_files/vets-api-private/modules/representation_management/app/services/representation_management/data_comparison_service.rb
# frozen_string_literal: true require 'roo' require 'octokit' # rubocop:disable Rails/Output module RepresentationManagement # Service to compare representative and organization data from the Excel file source # against database models. # # This service downloads the Excel file and compares identifiers to rep...
0
code_files/vets-api-private/modules/representation_management/app/services
code_files/vets-api-private/modules/representation_management/app/services/representation_management/accredited_entity_query.rb
# frozen_string_literal: true module RepresentationManagement class AccreditedEntityQuery MAXIMUM_RESULT_COUNT = 10 WORD_SIMILARITY_THRESHOLD = 0.7 # Initializes a new instance of AccreditedEntityQuery. # # @param query_string [String] the string to be used for querying accredited entities. ...
0
code_files/vets-api-private/modules/representation_management/app/services/representation_management
code_files/vets-api-private/modules/representation_management/app/services/representation_management/gclaws/client.rb
# frozen_string_literal: true # This client is responsible for retrieving accreditation data from the GCLAWS API. module RepresentationManagement module GCLAWS class Client ALLOWED_TYPES = %w[agents attorneys representatives veteran_service_organizations].freeze DEFAULT_PAGE = 1 DEFAULT_PAGE_S...
0
code_files/vets-api-private/modules/representation_management/app/services/representation_management
code_files/vets-api-private/modules/representation_management/app/services/representation_management/gclaws/configuration.rb
# frozen_string_literal: true # HTTP client configuration for the RepresentationManagement::GCLAWS::Client # module RepresentationManagement module GCLAWS class Configuration DEFAULT_SORT_PARAMS = { 'agents' => { 'sortColumn' => 'LastName', 'sortOrder' => 'ASC' }, ...
0
code_files/vets-api-private/modules/representation_management/app/services/representation_management
code_files/vets-api-private/modules/representation_management/app/services/representation_management/power_of_attorney_request_service/orchestrate.rb
# frozen_string_literal: true module RepresentationManagement module PowerOfAttorneyRequestService class Orchestrate def initialize(data:, dependent:, service_branch:, user:) @data = data @dependent = dependent @service_branch = service_branch @user = user @errors =...
0
code_files/vets-api-private/modules/representation_management
code_files/vets-api-private/modules/representation_management/bin/rails
#!/usr/bin/env ruby # frozen_string_literal: true ENGINE_ROOT = File.expand_path('../..', __dir__) ENGINE_PATH = File.expand_path('../../lib/representationmanagement/engine', __dir__) # Set up gems listed in the Gemfile. ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile', __dir__) require 'bundler/setup' if F...
0
code_files/vets-api-private/modules/representation_management
code_files/vets-api-private/modules/representation_management/config/routes.rb
# frozen_string_literal: true RepresentationManagement::Engine.routes.draw do namespace :v0, defaults: { format: 'json' } do resources :accredited_entities_for_appoint, only: %i[index] resources :accredited_individuals, only: %i[index] resources :flag_accredited_representatives, only: %i[create] reso...
0
code_files/vets-api-private/modules/representation_management
code_files/vets-api-private/modules/representation_management/spec/spec_helper.rb
# frozen_string_literal: true # Configure Rails Envinronment ENV['RAILS_ENV'] = 'test' require 'rspec/rails' RSpec.configure { |config| config.use_transactional_fixtures = true }
0
code_files/vets-api-private/modules/representation_management/spec/sidekiq
code_files/vets-api-private/modules/representation_management/spec/sidekiq/representation_management/accredited_entities_queue_updates_spec.rb
# frozen_string_literal: true require 'rails_helper' RSpec.describe RepresentationManagement::AccreditedEntitiesQueueUpdates, type: :job do include ActiveSupport::Testing::TimeHelpers subject(:job) { described_class.new } let(:client) { RepresentationManagement::GCLAWS::Client } let(:batch) { instance_double...
0
code_files/vets-api-private/modules/representation_management/spec/sidekiq
code_files/vets-api-private/modules/representation_management/spec/sidekiq/representation_management/accredited_individuals_update_spec.rb
# frozen_string_literal: true require 'rails_helper' RSpec.describe RepresentationManagement::AccreditedIndividualsUpdate do describe '#perform' do let(:raw_address_data) do { 'address_line1' => '123 Main St', 'address_line2' => 'Suite 100', 'city' => 'Brooklyn', 'state_cod...
0
code_files/vets-api-private/modules/representation_management/spec/sidekiq
code_files/vets-api-private/modules/representation_management/spec/sidekiq/power_of_attorney_requests/send_expired_email_job_spec.rb
# frozen_string_literal: true require 'rails_helper' require 'sidekiq/testing' Sidekiq::Testing.fake! RSpec.describe PowerOfAttorneyRequests::SendExpiredEmailJob, type: :job do describe 'modules and initialization' do it 'includes Sidekiq::Job' do expect(described_class.included_modules).to include(Sideki...
0
code_files/vets-api-private/modules/representation_management/spec/sidekiq
code_files/vets-api-private/modules/representation_management/spec/sidekiq/power_of_attorney_requests/send_expiration_reminder_email_job_spec.rb
# frozen_string_literal: true require 'rails_helper' require 'sidekiq/testing' Sidekiq::Testing.fake! RSpec.describe PowerOfAttorneyRequests::SendExpirationReminderEmailJob, type: :job do describe 'modules and initialization' do it 'includes Sidekiq::Job' do expect(described_class.included_modules).to inc...
0
code_files/vets-api-private/modules/representation_management/spec/models
code_files/vets-api-private/modules/representation_management/spec/models/representation_management/accreditation_api_entity_count_spec.rb
# frozen_string_literal: true require 'rails_helper' RSpec.describe RepresentationManagement::AccreditationApiEntityCount, type: :model do let(:model) { create(:accreditation_api_entity_count) } before do # Mock log_error method to prevent actual logging during tests allow(model).to receive(:log_error) ...
0
code_files/vets-api-private/modules/representation_management/spec/models
code_files/vets-api-private/modules/representation_management/spec/models/representation_management/next_steps_email_data_spec.rb
# frozen_string_literal: true require 'rails_helper' RSpec.describe RepresentationManagement::NextStepsEmailData, type: :model do describe 'validations' do subject { described_class.new } it { expect(subject).to validate_presence_of(:email_address) } it { expect(subject).to validate_presence_of(:first_...
0
code_files/vets-api-private/modules/representation_management/spec/models
code_files/vets-api-private/modules/representation_management/spec/models/representation_management/form_2122_data_spec.rb
# frozen_string_literal: true require 'rails_helper' RSpec.describe RepresentationManagement::Form2122Data, type: :model do describe '#limitations_of_consent_checkbox' do context 'when record_consent is false' do it 'returns 0' do form_2122_data = described_class.new(record_consent: false, consent...
0
code_files/vets-api-private/modules/representation_management/spec/models
code_files/vets-api-private/modules/representation_management/spec/models/representation_management/flagged_veteran_representative_contact_data_spec.rb
# frozen_string_literal: true require 'rails_helper' RSpec.describe RepresentationManagement::FlaggedVeteranRepresentativeContactData, type: :model do describe 'validations' do context 'ip_address' do it 'is valid when ip_address is present' do flag = described_class.new(ip_address: '192.168.1.1',...
0
code_files/vets-api-private/modules/representation_management/spec/models
code_files/vets-api-private/modules/representation_management/spec/models/representation_management/form_2122_base_spec.rb
# frozen_string_literal: true require 'rails_helper' RSpec.describe RepresentationManagement::Form2122Base, type: :model do describe 'validations' do subject { described_class.new } subject_with_claimant = described_class.new(claimant_first_name: 'John') it { expect(subject).to validate_presence_of(:v...
0
code_files/vets-api-private/modules/representation_management/spec/models
code_files/vets-api-private/modules/representation_management/spec/models/representation_management/form_2122a_data_spec.rb
# frozen_string_literal: true require 'rails_helper' RSpec.describe RepresentationManagement::Form2122aData, type: :model do describe 'validations' do subject { described_class.new } it { expect(subject).to validate_inclusion_of(:veteran_service_branch) .in_array(described_class::VETERAN_SERV...
0
code_files/vets-api-private/modules/representation_management/spec/models
code_files/vets-api-private/modules/representation_management/spec/models/representation_management/accredited_individual_search_spec.rb
# frozen_string_literal: true require 'rails_helper' RSpec.describe RepresentationManagement::AccreditedIndividualSearch, type: :model do describe 'validations' do subject { described_class.new } it { expect(subject).to validate_inclusion_of(:distance).in_array(described_class::PERMITTED_MAX_DISTANCES) } ...
0
code_files/vets-api-private/modules/representation_management/spec/models
code_files/vets-api-private/modules/representation_management/spec/models/representation_management/accreditation_data_ingestion_log_spec.rb
# frozen_string_literal: true require 'rails_helper' RSpec.describe RepresentationManagement::AccreditationDataIngestionLog, type: :model do describe 'enums' do it { is_expected.to define_enum_for(:dataset).with_values(accreditation_api: 0, trexler_file: 1) } it { is_expected.to define_enum_for(:status).wit...
0
code_files/vets-api-private/modules/representation_management/spec/models
code_files/vets-api-private/modules/representation_management/spec/models/representation_management/form_2122_digital_submission_spec.rb
# frozen_string_literal: true require 'rails_helper' RSpec.describe RepresentationManagement::Form2122DigitalSubmission, type: :model do describe '#normalized_limitations_of_consent' do context 'when record_consent is true' do context 'when consent_limits is empty' do it 'returns an empty array' d...
0
code_files/vets-api-private/modules/representation_management/spec/requests
code_files/vets-api-private/modules/representation_management/spec/requests/v0/next_steps_email_spec.rb
# frozen_string_literal: true require 'rails_helper' RSpec.describe 'NextStepsEmailController', type: :request do describe 'POST #create' do let(:base_path) { '/representation_management/v0/next_steps_email' } let(:accredited_individual) do create(:accredited_individual, individual_type: 'attorney', f...
0
code_files/vets-api-private/modules/representation_management/spec/requests
code_files/vets-api-private/modules/representation_management/spec/requests/v0/next_steps_email_swagger_spec.rb
# frozen_string_literal: true require 'swagger_helper' require Rails.root.join('spec', 'rswag_override.rb').to_s require_relative '../../support/swagger_shared_components/v0' RSpec.describe 'Next Steps Email', openapi_spec: 'modules/representation_management/app/swagger/v0/swagger.json', ...
0
code_files/vets-api-private/modules/representation_management/spec/requests/representation_management
code_files/vets-api-private/modules/representation_management/spec/requests/representation_management/v0/power_of_attorney_controller_spec.rb
# frozen_string_literal: true require 'rails_helper' RSpec.describe 'RepresentationManagement::V0::PowerOfAttorney', type: :request do let(:index_path) { '/representation_management/v0/power_of_attorney' } let(:user) { create(:user, :loa3) } describe 'index' do context 'with a signed in user' do befo...
0
code_files/vets-api-private/modules/representation_management/spec/requests/representation_management
code_files/vets-api-private/modules/representation_management/spec/requests/representation_management/v0/accredited_individuals_spec.rb
# frozen_string_literal: true require 'rails_helper' RSpec.describe 'RepresentationManagement::V0::AccreditedIndividuals', type: :request do let(:path) { '/representation_management/v0/accredited_individuals' } let(:type) { 'representative' } let(:distance) { 50 } let(:lat) { 38.9072 } let(:long) { -77.0369...
0
code_files/vets-api-private/modules/representation_management/spec/requests/representation_management
code_files/vets-api-private/modules/representation_management/spec/requests/representation_management/v0/power_of_attorney_swagger_spec.rb
# frozen_string_literal: true require 'swagger_helper' require Rails.root.join('spec', 'rswag_override.rb').to_s RSpec.describe 'Power of Attorney API', openapi_spec: 'modules/representation_management/app/swagger/v0/swagger.json', type: :request do let(:user) { create(:user,...
0
code_files/vets-api-private/modules/representation_management/spec/requests/representation_management
code_files/vets-api-private/modules/representation_management/spec/requests/representation_management/v0/pdf_generator_2122a_swagger_spec.rb
# frozen_string_literal: true require 'swagger_helper' require Rails.root.join('spec', 'rswag_override.rb').to_s require_relative '../../../support/swagger_shared_components/v0' RSpec.describe 'PDF Generator 21-22a', openapi_spec: 'modules/representation_management/app/swagger/v0/swagger.json', ...
0
code_files/vets-api-private/modules/representation_management/spec/requests/representation_management
code_files/vets-api-private/modules/representation_management/spec/requests/representation_management/v0/pdf_generator_2122a_spec.rb
# frozen_string_literal: true require 'rails_helper' RSpec.describe 'RepresentationManagement::V0::PdfGenerator2122a', type: :request do describe 'POST #create' do let(:base_path) { '/representation_management/v0/pdf_generator2122a' } let(:representative) do create(:accredited_individual, ...
0
code_files/vets-api-private/modules/representation_management/spec/requests/representation_management
code_files/vets-api-private/modules/representation_management/spec/requests/representation_management/v0/pdf_generator_2122_spec.rb
# frozen_string_literal: true require 'rails_helper' RSpec.describe 'RepresentationManagement::V0::PdfGenerator2122', type: :request do describe 'POST #create' do let(:base_path) { '/representation_management/v0/pdf_generator2122' } let(:organization) { create(:organization) } # This is the legacy organizat...
0
code_files/vets-api-private/modules/representation_management/spec/requests/representation_management
code_files/vets-api-private/modules/representation_management/spec/requests/representation_management/v0/accredited_entities_for_appoint_swagger_spec.rb
# frozen_string_literal: true require 'swagger_helper' require Rails.root.join('spec', 'rswag_override.rb').to_s require_relative '../../../support/swagger_shared_components/v0' RSpec.describe 'Accredited Entities for Appoint', openapi_spec: 'modules/representation_management/app/swagger/v0/swagger.jso...
0
code_files/vets-api-private/modules/representation_management/spec/requests/representation_management
code_files/vets-api-private/modules/representation_management/spec/requests/representation_management/v0/accredited_individuals_swagger_spec.rb
# frozen_string_literal: true require 'swagger_helper' require Rails.root.join('spec', 'rswag_override.rb').to_s require_relative '../../../support/swagger_shared_components/v0' RSpec.describe 'Accredited Individuals', openapi_spec: 'modules/representation_management/app/swagger/v0/swagger.json', ...
0
code_files/vets-api-private/modules/representation_management/spec/requests/representation_management
code_files/vets-api-private/modules/representation_management/spec/requests/representation_management/v0/accredited_entities_for_appoint_spec.rb
# frozen_string_literal: true require 'rails_helper' RSpec.describe 'RepresentationManagement::V0::AccreditedEntitiesForAppoint', type: :request do let(:path) { '/representation_management/v0/accredited_entities_for_appoint' } let!(:bob_law) { create(:accredited_individual, :with_location, first_name: 'Bob', last...
0
code_files/vets-api-private/modules/representation_management/spec/requests/representation_management
code_files/vets-api-private/modules/representation_management/spec/requests/representation_management/v0/pdf_generator_2122_swagger_spec.rb
# frozen_string_literal: true require 'swagger_helper' require Rails.root.join('spec', 'rswag_override.rb').to_s require_relative '../../../support/swagger_shared_components/v0' RSpec.describe 'PDF Generator 21-22', openapi_spec: 'modules/representation_management/app/swagger/v0/swagger.json', ...
0
code_files/vets-api-private/modules/representation_management/spec/requests/representation_management
code_files/vets-api-private/modules/representation_management/spec/requests/representation_management/v0/power_of_attorney_requests_swagger_spec.rb
# frozen_string_literal: true require 'swagger_helper' require Rails.root.join('spec', 'rswag_override.rb').to_s require_relative '../../../support/swagger_shared_components/v0' RSpec.describe 'Power of Attorney Requests', openapi_spec: 'modules/representation_management/app/swagger/v0/swagger.json', ...
0
code_files/vets-api-private/modules/representation_management/spec/requests/representation_management
code_files/vets-api-private/modules/representation_management/spec/requests/representation_management/v0/power_of_attorney_requests_controller_spec.rb
# frozen_string_literal: true require 'rails_helper' RSpec.describe 'RepresentationManagement::V0::PowerOfAttorneyRequests', type: :request do describe 'POST #create' do let(:user) { create(:user, :loa3) } let(:base_path) { '/representation_management/v0/power_of_attorney_requests' } let(:organization) ...
0
code_files/vets-api-private/modules/representation_management/spec/requests/representation_management
code_files/vets-api-private/modules/representation_management/spec/requests/representation_management/v0/flag_accredited_representatives_spec.rb
# frozen_string_literal: true require 'rails_helper' RSpec.describe 'RepresentationManagement::V0::FlagAccreditedRepresentatives', type: :request do describe 'POST #create' do let(:base_path) { '/representation_management/v0/flag_accredited_representatives' } context 'when submitting a single valid flag' d...
0
code_files/vets-api-private/modules/representation_management/spec/requests/representation_management
code_files/vets-api-private/modules/representation_management/spec/requests/representation_management/v0/original_entities_spec.rb
# frozen_string_literal: true require 'rails_helper' RSpec.describe 'RepresentationManagement::V0::OriginalEntities', type: :request do let(:path) { '/representation_management/v0/original_entities' } let!(:bob_law) do create(:representative, :with_address, representative_id: '00001', first_name: 'Bob', last_...
0
code_files/vets-api-private/modules/representation_management/spec/requests/representation_management
code_files/vets-api-private/modules/representation_management/spec/requests/representation_management/v0/original_entities_swagger_spec.rb
# frozen_string_literal: true require 'swagger_helper' require Rails.root.join('spec', 'rswag_override.rb').to_s require_relative '../../../support/swagger_shared_components/v0' RSpec.describe 'Original Entities', openapi_spec: 'modules/representation_management/app/swagger/v0/swagger.json', ...
0
code_files/vets-api-private/modules/representation_management/spec
code_files/vets-api-private/modules/representation_management/spec/serializers/flagged_veteran_representative_contact_data_serializer_spec.rb
# frozen_string_literal: true require 'rails_helper' describe RepresentationManagement::FlaggedVeteranRepresentativeContactDataSerializer, type: :serializer do subject { serialize(contact_data, serializer_class: described_class) } let(:contact_data) { build_stubbed(:flagged_veteran_representative_contact_data) }...
0
code_files/vets-api-private/modules/representation_management/spec
code_files/vets-api-private/modules/representation_management/spec/serializers/power_of_attorney_request_serializer_spec.rb
# frozen_string_literal: true require 'rails_helper' describe RepresentationManagement::PowerOfAttorneyRequestSerializer, type: :serializer do subject { serialize(example, serializer_class: described_class) } let(:example) do OpenStruct.new(id: 'efd18b43-4421-4539-941a-7397fadfe5dc', creat...
0
code_files/vets-api-private/modules/representation_management/spec/serializers
code_files/vets-api-private/modules/representation_management/spec/serializers/accredited_entities/individual_serializer_spec.rb
# frozen_string_literal: true require 'rails_helper' describe RepresentationManagement::AccreditedEntities::IndividualSerializer, type: :serializer do subject { described_class.new(individual) } let(:individual) do create( :accredited_individual, :with_organizations, individual_type: 'repre...
0
code_files/vets-api-private/modules/representation_management/spec/serializers
code_files/vets-api-private/modules/representation_management/spec/serializers/accredited_individuals/organization_serializer_spec.rb
# frozen_string_literal: true require 'rails_helper' describe RepresentationManagement::AccreditedIndividuals::OrganizationSerializer, type: :serializer do subject { described_class.new(organization) } let(:organization) do create(:accredited_organization, poa_code: 'XYZ', name: 'Very G...
0
code_files/vets-api-private/modules/representation_management/spec/serializers
code_files/vets-api-private/modules/representation_management/spec/serializers/accredited_individuals/individual_serializer_spec.rb
# frozen_string_literal: true require 'rails_helper' describe RepresentationManagement::AccreditedIndividuals::IndividualSerializer, type: :serializer do subject { described_class.new(individual) } before do create(:accredited_individual, :with_organizations, individual_type: 'represent...
0
code_files/vets-api-private/modules/representation_management/spec/serializers
code_files/vets-api-private/modules/representation_management/spec/serializers/power_of_attorney/representative_serializer_spec.rb
# frozen_string_literal: true require 'rails_helper' require_relative 'shared_base_power_of_attorney' describe RepresentationManagement::PowerOfAttorney::RepresentativeSerializer, type: :serializer do subject { serialize(object, serializer_class: described_class) } let(:object) { build_stubbed(:representative) }...
0
code_files/vets-api-private/modules/representation_management/spec/serializers
code_files/vets-api-private/modules/representation_management/spec/serializers/power_of_attorney/organization_serializer_spec.rb
# frozen_string_literal: true require 'rails_helper' require_relative 'shared_base_power_of_attorney' describe RepresentationManagement::PowerOfAttorney::OrganizationSerializer, type: :serializer do subject { serialize(object, serializer_class: described_class) } let(:object) { build_stubbed(:organization) } l...
0
code_files/vets-api-private/modules/representation_management/spec/serializers
code_files/vets-api-private/modules/representation_management/spec/serializers/power_of_attorney/shared_base_power_of_attorney.rb
# frozen_string_literal: true require 'rails_helper' RSpec.shared_examples 'power_of_attorney' do it 'includes :address_line1' do expect(attributes['address_line1']).to eq object.address_line1 end it 'includes :address_line2' do expect(attributes['address_line2']).to eq object.address_line2 end it...
0
code_files/vets-api-private/modules/representation_management/spec/serializers
code_files/vets-api-private/modules/representation_management/spec/serializers/original_entities/representative_serializer_spec.rb
# frozen_string_literal: true require 'rails_helper' describe RepresentationManagement::OriginalEntities::RepresentativeSerializer, type: :serializer do subject { described_class.new(representative) } let(:representative) do create( :representative, :vso, representative_id: '00001', p...
0
code_files/vets-api-private/modules/representation_management/spec/serializers
code_files/vets-api-private/modules/representation_management/spec/serializers/original_entities/organization_serializer_spec.rb
# frozen_string_literal: true require 'rails_helper' describe RepresentationManagement::OriginalEntities::OrganizationSerializer, type: :serializer do subject { described_class.new(organization) } let(:organization) do create(:organization, poa: 'XYZ', name: 'Very Good Org', ...
0
code_files/vets-api-private/modules/representation_management/spec
code_files/vets-api-private/modules/representation_management/spec/support/pdf_fill_helper.rb
# frozen_string_literal: true module PdfFillHelper # Given two paths to (non-flattened) PDFs this will return true # if the PDFs have the same values for every field. def pdfs_fields_match?(pdf_1_path, pdf_2_path) fields = [] [pdf_1_path, pdf_2_path].each do |pdf| fields << simplify_fields( ...