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/representation_management/spec | code_files/vets-api-private/modules/representation_management/spec/support/rswag_config.rb | # frozen_string_literal: true
class RepresentationManagement::RswagConfig
def config
{
'modules/representation_management/app/swagger/v0/swagger.json' => {
openapi: '3.0.1',
info:,
tags:,
components: {
schemas:
},
paths: {},
servers: [localh... |
0 | code_files/vets-api-private/modules/representation_management/spec | code_files/vets-api-private/modules/representation_management/spec/support/pdf_matcher.rb | # frozen_string_literal: true
require 'rspec/expectations'
RSpec::Matchers.define :match_pdf_content_of do |expected|
match do |actual|
actual_reader = PDF::Reader.new(actual)
actual_pages = actual_reader.pages.size
actual_text = actual_reader.pages.map(&:text)
expected_reader = PDF::Reader.new(exp... |
0 | code_files/vets-api-private/modules/representation_management/spec/support | code_files/vets-api-private/modules/representation_management/spec/support/swagger_shared_components/v0.rb | # frozen_string_literal: true
module SwaggerSharedComponents
class V0
def self.body_examples
{
accredited_entities_for_appoint:,
accredited_entities_for_appoint_parameter:,
next_steps_email:,
next_steps_email_parameter:,
pdf_generator2122:,
pdf_generator2122_... |
0 | code_files/vets-api-private/modules/representation_management/spec | code_files/vets-api-private/modules/representation_management/spec/factories/flagged_veteran_representative_contact_datas.rb | # frozen_string_literal: true
FactoryBot.define do
factory :flagged_veteran_representative_contact_data,
class: 'RepresentationManagement::FlaggedVeteranRepresentativeContactData' do
ip_address { '192.168.1.1' }
representative_id { '1' }
flag_type { 'phone_number' }
flagged_value { '1234567... |
0 | code_files/vets-api-private/modules/representation_management/spec | code_files/vets-api-private/modules/representation_management/spec/factories/form_2122_datas.rb | # frozen_string_literal: true
FactoryBot.define do
factory :form_2122_base, class: 'RepresentationManagement::Form2122Base' do
veteran_first_name { 'Vet' }
veteran_middle_initial { 'M' }
veteran_last_name { 'Veteran' }
veteran_social_security_number { '123456789' }
veteran_va_file_number { '12345... |
0 | code_files/vets-api-private/modules/representation_management/spec/factories | code_files/vets-api-private/modules/representation_management/spec/factories/representation_management/accreditation_api_entity_counts.rb | # frozen_string_literal: true
FactoryBot.define do
factory :accreditation_api_entity_count, class: 'RepresentationManagement::AccreditationApiEntityCount' do
agents { 10 }
attorneys { 10 }
representatives { 10 }
veteran_service_organizations { 10 }
end
end
|
0 | code_files/vets-api-private/modules/representation_management/spec/factories | code_files/vets-api-private/modules/representation_management/spec/factories/representation_management/accreditation_data_ingestion_logs.rb | # frozen_string_literal: true
FactoryBot.define do
factory :accreditation_data_ingestion_log, class: 'RepresentationManagement::AccreditationDataIngestionLog' do
dataset { :accreditation_api }
status { :running }
agents_status { :not_started }
attorneys_status { :not_started }
representatives_sta... |
0 | code_files/vets-api-private/modules/representation_management/spec/lib/representation_management/v0 | code_files/vets-api-private/modules/representation_management/spec/lib/representation_management/v0/pdf_constructor/form_2122a_spec.rb | # frozen_string_literal: true
require 'rails_helper'
require_relative '../../../../support/pdf_matcher'
require_relative '../../../../support/pdf_fill_helper'
describe RepresentationManagement::V0::PdfConstructor::Form2122a do
include PdfFillHelper
let(:representative) do
create(:accredited_individual,
... |
0 | code_files/vets-api-private/modules/representation_management/spec/lib/representation_management/v0 | code_files/vets-api-private/modules/representation_management/spec/lib/representation_management/v0/pdf_constructor/form_2122_spec.rb | # frozen_string_literal: true
require 'rails_helper'
require_relative '../../../../support/pdf_matcher'
require_relative '../../../../support/pdf_fill_helper'
describe RepresentationManagement::V0::PdfConstructor::Form2122 do
include PdfFillHelper
let(:accredited_organization) { create(:accredited_organization, n... |
0 | code_files/vets-api-private/modules/representation_management/spec/lib/representation_management | code_files/vets-api-private/modules/representation_management/spec/lib/representation_management/tasks/reprocess_accredited_entities_rake_spec.rb | # frozen_string_literal: true
require 'rails_helper'
require 'rake'
RSpec.describe 'representation_management:accreditation:reprocess rake task', type: :task do
before do
# Provide both task name and directory to search
rake_file_path = Rails.root.join('modules', 'representation_management', 'lib', 'tasks')... |
0 | code_files/vets-api-private/modules/representation_management/spec/fixtures/21-22A | code_files/vets-api-private/modules/representation_management/spec/fixtures/21-22A/v0/2122a_conditions_and_limitations_no_claimant_request_body.json | {
"record_consent": true,
"consent_address_change": true,
"consent_limits": [
"ALCOHOLISM",
"DRUG_ABUSE"
],
"consent_inside_access": true,
"consent_outside_access": true,
"consent_team_members": [
"Jane M Representative",
"John M Representative",
"Jane M Doe",
"John M Doe",
"Bo... |
0 | code_files/vets-api-private/modules/representation_management/spec/fixtures/21-22A | code_files/vets-api-private/modules/representation_management/spec/fixtures/21-22A/v0/2122a_conditions_and_limitations_request_body.json | {
"record_consent": true,
"consent_address_change": true,
"consent_limits": [
"ALCOHOLISM",
"DRUG_ABUSE"
],
"consent_inside_access": true,
"consent_outside_access": true,
"consent_team_members": [
"Jane M Representative",
"John M Representative",
"Jane M Doe",
"John M Doe",
"Bo... |
0 | code_files/vets-api-private/modules/representation_management/spec/fixtures/21-22 | code_files/vets-api-private/modules/representation_management/spec/fixtures/21-22/v0/2122_with_limitations_no_claimant_request_body.json | {
"record_consent": true,
"consent_address_change": true,
"consent_limits": [
"DRUG_ABUSE",
"HIV",
"SICKLE_CELL"
],
"veteran": {
"ssn": "123456789",
"va_file_number": "123456789",
"date_of_birth": "1980-12-31",
"service_number": "AA12345",
"service_branch": "ARMY",
"phone":... |
0 | code_files/vets-api-private/modules/representation_management/spec/fixtures/21-22 | code_files/vets-api-private/modules/representation_management/spec/fixtures/21-22/v0/2122_with_limitations_request_body.json | {
"record_consent": true,
"consent_address_change": true,
"consent_limits": [
"DRUG_ABUSE",
"HIV",
"SICKLE_CELL"
],
"claimant": {
"date_of_birth": "1980-12-31",
"relationship": "Spouse",
"phone": "5555555555",
"email": "claimant@example.com",
"name": {
"first": "John",
... |
0 | code_files/vets-api-private/modules/representation_management/spec/services | code_files/vets-api-private/modules/representation_management/spec/services/representation_management/accredited_entity_query_spec.rb | # frozen_string_literal: true
require 'rails_helper'
RSpec.describe RepresentationManagement::AccreditedEntityQuery, type: :model do
let!(:individual1) { create(:accredited_individual, :with_location, first_name: 'Bob', last_name: 'Law') }
let!(:individual2) { create(:accredited_individual, :with_location, first_... |
0 | code_files/vets-api-private/modules/representation_management/spec/services | code_files/vets-api-private/modules/representation_management/spec/services/representation_management/original_entity_query_spec.rb | # frozen_string_literal: true
require 'rails_helper'
RSpec.describe RepresentationManagement::OriginalEntityQuery, type: :model do
let!(:individual1) do
create(:representative, :with_address, :vso, first_name: 'Bob', last_name: 'Law', representative_id: '00000')
end
let!(:individual2) do
create(:represe... |
0 | code_files/vets-api-private/modules/representation_management/spec/services | code_files/vets-api-private/modules/representation_management/spec/services/representation_management/address_preprocessor_spec.rb | # frozen_string_literal: true
require 'rails_helper'
RSpec.describe RepresentationManagement::AddressPreprocessor do
describe '.clean' do
it 'extracts room into address_line2' do
addr = { 'address_line1' => '11000 Wilshire Blvd., Rm 509', 'address_line2' => nil }
cleaned = described_class.clean(addr... |
0 | code_files/vets-api-private/modules/representation_management/spec/services | code_files/vets-api-private/modules/representation_management/spec/services/representation_management/data_comparison_service_spec.rb | # frozen_string_literal: true
require 'rails_helper'
RSpec.describe RepresentationManagement::DataComparisonService do
let(:service) { described_class.new }
let(:mock_github_client) { instance_double(Octokit::Client) }
let(:mock_file_info) { double('file_info', download_url: 'https://raw.githubusercontent.com/t... |
0 | code_files/vets-api-private/modules/representation_management/spec/services | code_files/vets-api-private/modules/representation_management/spec/services/representation_management/address_validation_service_spec.rb | # frozen_string_literal: true
require 'rails_helper'
RSpec.describe RepresentationManagement::AddressValidationService do
let(:service) { described_class.new }
let(:mock_validation_service) { instance_double(VAProfile::AddressValidation::V3::Service) }
let(:service_with_mock) { described_class.new(validation_se... |
0 | code_files/vets-api-private/modules/representation_management/spec/services/representation_management | code_files/vets-api-private/modules/representation_management/spec/services/representation_management/gclaws/client_spec.rb | # frozen_string_literal: true
require 'rails_helper'
require 'faraday'
require 'json'
RSpec.describe RepresentationManagement::GCLAWS::Client do
subject { described_class }
before do
# Mock the Slack client instead of the subject method
slack_client = instance_double(SlackNotify::Client)
allow(SlackN... |
0 | code_files/vets-api-private/modules/representation_management/spec/services/representation_management | code_files/vets-api-private/modules/representation_management/spec/services/representation_management/gclaws/configuration_spec.rb | # frozen_string_literal: true
require 'rails_helper'
describe RepresentationManagement::GCLAWS::Configuration do
subject { described_class.new(type:, page:, page_size:) }
let(:type) { 'agents' }
let(:page) { 1 }
let(:page_size) { 10 }
describe '#connection' do
it 'creates a Faraday connection' do
... |
0 | code_files/vets-api-private/modules/representation_management/spec/services | code_files/vets-api-private/modules/representation_management/spec/services/power_of_attorney_request_service/orchestrate_spec.rb | # frozen_string_literal: true
require 'rails_helper'
RSpec.describe RepresentationManagement::PowerOfAttorneyRequestService::Orchestrate do
describe '#call' do
subject do
described_class.new(data:, dependent:, service_branch:, user:)
end
let(:user) { create(:user, :loa3) }
let(:organization) ... |
0 | code_files/vets-api-private/modules/representation_management | code_files/vets-api-private/modules/representation_management/lib/representation_management.rb | # frozen_string_literal: true
require 'representation_management/engine'
module RepresentationManagement
AGENTS = 'agents'
ATTORNEYS = 'attorneys'
REPRESENTATIVES = 'representatives'
VSOS = 'veteran_service_organizations'
# rubocop:disable Layout/LineLength
ENTITY_CONFIG = OpenStruct.new({
... |
0 | code_files/vets-api-private/modules/representation_management/lib | code_files/vets-api-private/modules/representation_management/lib/tasks/reprocess_accredited_entities.rake | # frozen_string_literal: true
namespace :representation_management do
namespace :accreditation do
desc 'Manually reprocess specific Accredited Entity types after validation failure'
# IMPORTANT: Representatives and VSOs must be processed together to maintain data integrity.
# If you want to process eithe... |
0 | code_files/vets-api-private/modules/representation_management/lib | code_files/vets-api-private/modules/representation_management/lib/representation_management/engine.rb | # frozen_string_literal: true
module RepresentationManagement
class Engine < ::Rails::Engine
isolate_namespace RepresentationManagement
config.generators.api_only = true
initializer 'model_core.factories', after: 'factory_bot.set_factory_paths' do
FactoryBot.definition_file_paths << File.expand_pa... |
0 | code_files/vets-api-private/modules/representation_management/lib | code_files/vets-api-private/modules/representation_management/lib/representation_management/version.rb | # frozen_string_literal: true
module RepresentationManagement
VERSION = '0.1.0'
end
|
0 | code_files/vets-api-private/modules/representation_management/lib/representation_management/v0 | code_files/vets-api-private/modules/representation_management/lib/representation_management/v0/pdf_constructor/base.rb | # frozen_string_literal: true
require 'pdf_fill/filler'
module RepresentationManagement
module V0
module PdfConstructor
class Base
def initialize(tempfile)
@tempfile = tempfile
@template_path = nil
end
#
# This method is the entry point for constructing... |
0 | code_files/vets-api-private/modules/representation_management/lib/representation_management/v0 | code_files/vets-api-private/modules/representation_management/lib/representation_management/v0/pdf_constructor/form_2122a.rb | # frozen_string_literal: true
module RepresentationManagement
module V0
module PdfConstructor
class Form2122a < RepresentationManagement::V0::PdfConstructor::Base
PAGE1_KEY = 'form1[0].#subform[0]'
PAGE2_KEY = 'form1[0].#subform[1]'
PAGE3_KEY = 'form1[0].#subform[2]'
protec... |
0 | code_files/vets-api-private/modules/representation_management/lib/representation_management/v0 | code_files/vets-api-private/modules/representation_management/lib/representation_management/v0/pdf_constructor/form_2122.rb | # frozen_string_literal: true
module RepresentationManagement
module V0
module PdfConstructor
class Form2122 < RepresentationManagement::V0::PdfConstructor::Base
PAGE1_KEY = 'form1[0].#subform[0]'
PAGE2_KEY = 'form1[0].#subform[1]'
protected
def next_steps_page?
... |
0 | code_files/vets-api-private/modules | code_files/vets-api-private/modules/facilities_api/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 = 'FacilitiesApi'
rdoc.options << '--line-numbers'
rdoc.rd... |
0 | code_files/vets-api-private/modules | code_files/vets-api-private/modules/facilities_api/Gemfile | # frozen_string_literal: true
source 'https://rubygems.org'
# Declare your gem's dependencies in facilitiesapi.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 that are stil... |
0 | code_files/vets-api-private/modules | code_files/vets-api-private/modules/facilities_api/.rubocop.yml | inherit_from:
- ../../.rubocop.yml
AllCops:
Exclude:
- 'bin/*'
- bin/rails
Metrics/ModuleLength:
Exclude:
- app/swagger/**/*.rb
- spec/**/*_spec.rb
Metrics/BlockLength:
Exclude:
- app/swagger/**/*.rb
- spec/**/*_spec.rb
- spec/factories/**/*.rb
Metrics/ClassLength:
Exclude:
... |
0 | code_files/vets-api-private/modules | code_files/vets-api-private/modules/facilities_api/facilities_api.gemspec | # frozen_string_literal: true
$LOAD_PATH.push File.expand_path('lib', __dir__)
# Maintain your gem's version:
require 'facilities_api/version'
# Describe your gem and declare its dependencies:
Gem::Specification.new do |spec|
spec.name = 'facilities_api'
spec.version = FacilitiesApi::VERSION
spec.au... |
0 | code_files/vets-api-private/modules | code_files/vets-api-private/modules/facilities_api/README.rdoc | = FacilitiesApi
TODO: Short description and motivation.
== Installation
Ensure the following line is in the root project's Gemfile:
gem 'facilitiesapi', path: 'modules/facilitiesapi'
== License
This module is open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
|
0 | code_files/vets-api-private/modules/facilities_api/app/swagger/facilities_api/v2 | code_files/vets-api-private/modules/facilities_api/app/swagger/facilities_api/v2/schemas/errors.rb | # frozen_string_literal: true
module FacilitiesApi
class V2::Schemas::Errors
include Swagger::Blocks
swagger_schema :Errors do
key :required, [:errors]
property :errors do
key :type, :array
items do
key :$ref, :Error
end
end
end
swagger_schema :E... |
0 | code_files/vets-api-private/modules/facilities_api/app/swagger/facilities_api/v2 | code_files/vets-api-private/modules/facilities_api/app/swagger/facilities_api/v2/schemas/facilities.rb | # frozen_string_literal: true
module FacilitiesApi
class V2::Schemas::Facilities
include Swagger::Blocks
swagger_schema :Facilities do
key :required, [:data]
property :data do
key :type, :array
items do
key :$ref, :Facility
end
end
end
swagger_sch... |
0 | code_files/vets-api-private/modules/facilities_api/app/swagger/facilities_api/v2 | code_files/vets-api-private/modules/facilities_api/app/swagger/facilities_api/v2/requests/facilities.rb | # frozen_string_literal: true
module FacilitiesApi
class V2::Requests::Facilities
include Swagger::Blocks
# rubocop:disable Layout/LineLength
swagger_path '/facilities_api/v2/va' do
operation :post do
key :description, 'Get facilities within a geographic bounding box'
key :operation... |
0 | code_files/vets-api-private/modules/facilities_api/app | code_files/vets-api-private/modules/facilities_api/app/models/std_institution_facility.rb | # frozen_string_literal: true
class StdInstitutionFacility < ApplicationRecord
self.table_name = 'std_institution_facilities'
scope :active, -> { where(deactivation_date: nil) }
belongs_to :street_state, class_name: 'StdState', optional: true
belongs_to :mailing_state, class_name: 'StdState', optional: true
... |
0 | code_files/vets-api-private/modules/facilities_api/app/models/facilities_api/v2 | code_files/vets-api-private/modules/facilities_api/app/models/facilities_api/v2/lighthouse/facility.rb | # frozen_string_literal: true
require 'vets/model'
module FacilitiesApi
class V2::Lighthouse::Facility
include Vets::Model
attribute :access, Hash
attribute :address, Hash
attribute :classification, String
attribute :distance, Float
attribute :facility_type, String
attribute :facility_t... |
0 | code_files/vets-api-private/modules/facilities_api/app/models/facilities_api/v2 | code_files/vets-api-private/modules/facilities_api/app/models/facilities_api/v2/lighthouse/service.rb | # frozen_string_literal: true
require 'vets/model'
module FacilitiesApi
class V2::Lighthouse::Service
include Vets::Model
attribute :serviceName, String
attribute :service, String
attribute :serviceType, String
attribute :new, Float
attribute :established, Float
attribute :effectiveDate... |
0 | code_files/vets-api-private/modules/facilities_api/app/models/facilities_api/v2 | code_files/vets-api-private/modules/facilities_api/app/models/facilities_api/v2/ppms/specialty.rb | # frozen_string_literal: true
require 'vets/model'
module FacilitiesApi
class V2::PPMS::Specialty
include Vets::Model
attribute :classification, String
attribute :grouping, String
attribute :name, String
attribute :specialization, String
attribute :specialty_code, String
attribute :spec... |
0 | code_files/vets-api-private/modules/facilities_api/app/models/facilities_api/v2 | code_files/vets-api-private/modules/facilities_api/app/models/facilities_api/v2/ppms/provider.rb | # frozen_string_literal: true
require 'vets/model'
module FacilitiesApi
class V2::PPMS::Provider
include Vets::Model
attribute :acc_new_patients, String
attribute :address_city, String
attribute :address_postal_code, String
attribute :address_state_province, String
attribute :address_street... |
0 | code_files/vets-api-private/modules/facilities_api/app/serializers/facilities_api/v2 | code_files/vets-api-private/modules/facilities_api/app/serializers/facilities_api/v2/lighthouse/facility_serializer.rb | # frozen_string_literal: true
module FacilitiesApi
class V2::Lighthouse::FacilitySerializer
include JSONAPI::Serializer
set_key_transform :camel_lower
attributes :classification, :distance, :facility_type, :id, :lat, :long, :mobile, :name,
:operational_hours_special_instructions, :unique... |
0 | code_files/vets-api-private/modules/facilities_api/app/serializers/facilities_api/v2 | code_files/vets-api-private/modules/facilities_api/app/serializers/facilities_api/v2/ppms/provider_serializer.rb | # frozen_string_literal: true
module FacilitiesApi
class V2::PPMS::ProviderSerializer
include JSONAPI::Serializer
set_key_transform :camel_lower
attribute :acc_new_patients
attribute :address do |object|
addr = {
street: object.address_street,
city: object.address_city,
... |
0 | code_files/vets-api-private/modules/facilities_api/app/serializers/facilities_api/v2 | code_files/vets-api-private/modules/facilities_api/app/serializers/facilities_api/v2/ppms/specialty_serializer.rb | # frozen_string_literal: true
module FacilitiesApi
class V2::PPMS::SpecialtySerializer
include JSONAPI::Serializer
set_id :specialty_code
set_key_transform :camel_lower
attributes :classification,
:grouping,
:name,
:specialization,
:specia... |
0 | code_files/vets-api-private/modules/facilities_api/app/controllers | code_files/vets-api-private/modules/facilities_api/app/controllers/facilities_api/application_controller.rb | # frozen_string_literal: true
module FacilitiesApi
class ApplicationController < ::ApplicationController
service_tag 'facility-locator'
skip_before_action :authenticate
PAGINATED_CLASSES = [
WillPaginate::Collection,
ActiveRecord::Relation
].freeze
private
def render_json(seria... |
0 | code_files/vets-api-private/modules/facilities_api/app/controllers/facilities_api | code_files/vets-api-private/modules/facilities_api/app/controllers/facilities_api/v2/ccp_controller.rb | # frozen_string_literal: true
module FacilitiesApi
class V2::CcpController < ApplicationController
# Provider supports the following query parameters:
# @param bbox - Bounding box in form "xmin,ymin,xmax,ymax" in Lat/Long coordinates
# @param services - Optional specialty services filter
def index
... |
0 | code_files/vets-api-private/modules/facilities_api/app/controllers/facilities_api | code_files/vets-api-private/modules/facilities_api/app/controllers/facilities_api/v2/va_controller.rb | # frozen_string_literal: true
module FacilitiesApi
class V2::VAController < ApplicationController
skip_before_action :verify_authenticity_token
def search
params[:facilityIds] = params[:ids] if params[:ids].present?
api_results = api.get_facilities(lighthouse_params)
render_json(serialize... |
0 | code_files/vets-api-private/modules/facilities_api/app/controllers/facilities_api | code_files/vets-api-private/modules/facilities_api/app/controllers/facilities_api/v2/apidocs_controller.rb | # frozen_string_literal: true
module FacilitiesApi
module V2
class ApidocsController < ApplicationController
include Swagger::Blocks
service_tag 'facility-locator'
swagger_root do
key :swagger, '2.0'
info do
key :version, '2.0.0'
key :title, 'va.gov API'
... |
0 | code_files/vets-api-private/modules/facilities_api/app/services/facilities_api/v2 | code_files/vets-api-private/modules/facilities_api/app/services/facilities_api/v2/mobile_covid/response.rb | # frozen_string_literal: true
require 'vets/model'
module FacilitiesApi
module V2
module MobileCovid
class Response
include Vets::Model
attribute :body, String
attribute :core_settings, Hash, array: true
attribute :id, String
attribute :parsed_body, Hash
at... |
0 | code_files/vets-api-private/modules/facilities_api/app/services/facilities_api/v2 | code_files/vets-api-private/modules/facilities_api/app/services/facilities_api/v2/mobile_covid/client.rb | # frozen_string_literal: true
require 'common/client/base'
require_relative 'configuration'
require_relative 'response'
module FacilitiesApi
module V2
module MobileCovid
class Client < Common::Client::Base
configuration V2::MobileCovid::Configuration
def direct_booking_eligibility_criteri... |
0 | code_files/vets-api-private/modules/facilities_api/app/services/facilities_api/v2 | code_files/vets-api-private/modules/facilities_api/app/services/facilities_api/v2/mobile_covid/configuration.rb | # frozen_string_literal: true
require 'common/client/configuration/rest'
module FacilitiesApi
module V2
module MobileCovid
class Configuration < Common::Client::Configuration::REST
def base_path
Settings.lighthouse.facilities.hqva_mobile.url
end
def service_name
... |
0 | code_files/vets-api-private/modules/facilities_api/app/services/facilities_api/v2 | code_files/vets-api-private/modules/facilities_api/app/services/facilities_api/v2/lighthouse/response.rb | # frozen_string_literal: true
require 'vets/model'
module FacilitiesApi
module V2
module Lighthouse
class Response
include Vets::Model
attribute :body, String
attribute :current_page, Integer
attribute :data, Hash, array: true
attribute :links, Hash
attribu... |
0 | code_files/vets-api-private/modules/facilities_api/app/services/facilities_api/v2 | code_files/vets-api-private/modules/facilities_api/app/services/facilities_api/v2/lighthouse/client.rb | # frozen_string_literal: true
require 'common/client/base'
require_relative 'response'
require_relative 'configuration'
module FacilitiesApi
module V2
module Lighthouse
# Documentation located at:
# https://developer.va.gov/explore/api/va-facilities/docs
class Client < Common::Client::Base
... |
0 | code_files/vets-api-private/modules/facilities_api/app/services/facilities_api/v2 | code_files/vets-api-private/modules/facilities_api/app/services/facilities_api/v2/lighthouse/configuration.rb | # frozen_string_literal: true
require 'common/client/configuration/rest'
require 'common/client/middleware/response/raise_custom_error'
require_relative 'middleware/errors'
module FacilitiesApi
module V2
module Lighthouse
class Configuration < Common::Client::Configuration::REST
def base_path
... |
0 | code_files/vets-api-private/modules/facilities_api/app/services/facilities_api/v2/lighthouse | code_files/vets-api-private/modules/facilities_api/app/services/facilities_api/v2/lighthouse/middleware/errors.rb | # frozen_string_literal: true
module FacilitiesApi
module V2
module Lighthouse
module Middleware
class Errors < Faraday::Middleware
def on_complete(env)
return if env.success?
env.body = parse_body(env)
end
private
def parse_body(en... |
0 | code_files/vets-api-private/modules/facilities_api/app/services/facilities_api/v2 | code_files/vets-api-private/modules/facilities_api/app/services/facilities_api/v2/ppms/response.rb | # frozen_string_literal: true
require 'vets/model'
module FacilitiesApi
module V2
module PPMS
class Response
include Vets::Model
attribute :body, Hash, array: true
attribute :current_page, Integer
attribute :per_page, Integer
attribute :offset, Integer
attr... |
0 | code_files/vets-api-private/modules/facilities_api/app/services/facilities_api/v2 | code_files/vets-api-private/modules/facilities_api/app/services/facilities_api/v2/ppms/client.rb | # frozen_string_literal: true
require 'common/client/base'
module FacilitiesApi
module V2
module PPMS
# Core class responsible for api interface operations
# Web forum and documentation (latest version of the ICD) located at:
# https://vaww.oed.portal.va.gov/pm/iehr/vista_evolution/RA/CCP_PPMS... |
0 | code_files/vets-api-private/modules/facilities_api/app/services/facilities_api/v2 | code_files/vets-api-private/modules/facilities_api/app/services/facilities_api/v2/ppms/configuration.rb | # frozen_string_literal: true
require 'common/client/configuration/rest'
require 'common/client/middleware/response/raise_custom_error'
require_relative 'middleware/ppms_parser'
module FacilitiesApi
module V2
module PPMS
class Configuration < Common::Client::Configuration::REST
self.open_timeout =... |
0 | code_files/vets-api-private/modules/facilities_api/app/services/facilities_api/v2/ppms | code_files/vets-api-private/modules/facilities_api/app/services/facilities_api/v2/ppms/middleware/ppms_parser.rb | # frozen_string_literal: true
module FacilitiesApi
module V2
module PPMS
module Middleware
class PPMSParser < Faraday::Middleware
def on_complete(env)
env.body = parse_body(env)
end
private
def parse_body(env)
hsh = JSON.parse(env.bo... |
0 | code_files/vets-api-private/modules/facilities_api | code_files/vets-api-private/modules/facilities_api/bin/rails | #!/usr/bin/env ruby
# frozen_string_literal: true
ENGINE_ROOT = File.expand_path('..', __dir__)
ENGINE_PATH = File.expand_path('../lib/facilities_api/engine', __dir__)
# Set up gems listed in the Gemfile.
ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile', __dir__)
require 'bundler/setup' if File.exist?(ENV['... |
0 | code_files/vets-api-private/modules/facilities_api | code_files/vets-api-private/modules/facilities_api/config/routes.rb | # frozen_string_literal: true
FacilitiesApi::Engine.routes.draw do
namespace :v2, defaults: { format: 'json' } do
resources :ccp, only: :index do
collection do
get 'urgent_care', to: 'ccp#urgent_care'
get 'provider', to: 'ccp#provider'
get 'pharmacy', to: 'ccp#pharmacy'
... |
0 | code_files/vets-api-private/modules/facilities_api | code_files/vets-api-private/modules/facilities_api/spec/spec_helper.rb | # frozen_string_literal: true
# Configure Rails Envinronment
ENV['RAILS_ENV'] = 'test'
require 'rspec/rails'
RSpec.configure do |config|
config.use_transactional_fixtures = true
end
|
0 | code_files/vets-api-private/modules/facilities_api/spec | code_files/vets-api-private/modules/facilities_api/spec/models/std_institution_facility_spec.rb | # frozen_string_literal: true
require 'rails_helper'
RSpec.describe StdInstitutionFacility, type: :model do
describe 'associations' do
it { is_expected.to belong_to(:street_state).class_name('StdState').optional }
it { is_expected.to belong_to(:mailing_state).class_name('StdState').optional }
end
descr... |
0 | code_files/vets-api-private/modules/facilities_api/spec/models/facilities_api/v2 | code_files/vets-api-private/modules/facilities_api/spec/models/facilities_api/v2/lighthouse/facility_spec.rb | # frozen_string_literal: true
require 'rails_helper'
describe FacilitiesApi::V2::Lighthouse::Facility, team: :facilities, type: :model do
context 'Creating' do
let(:attributes) do
{
'attributes' => {
'satisfaction' => {
health: {
primary_care_urgent: 0.870000004... |
0 | code_files/vets-api-private/modules/facilities_api/spec/models/facilities_api/v2 | code_files/vets-api-private/modules/facilities_api/spec/models/facilities_api/v2/lighthouse/service_spec.rb | # frozen_string_literal: true
require 'rails_helper'
describe FacilitiesApi::V2::Lighthouse::Service, team: :facilities, type: :model do
context 'Creating' do
let(:attributes) do
{
'serviceInfo' => {
'name' => 'Audiology and speech',
'serviceId' => 'audiology',
'servi... |
0 | code_files/vets-api-private/modules/facilities_api/spec/models/facilities_api/v2 | code_files/vets-api-private/modules/facilities_api/spec/models/facilities_api/v2/ppms/specialty_spec.rb | # frozen_string_literal: true
require 'rails_helper'
describe FacilitiesApi::V2::PPMS::Specialty, team: :facilities, type: :model do
it 'defaults to nil' do
specialty = FacilitiesApi::V2::PPMS::Specialty.new
expect(specialty.attributes).to match(
{
classification: nil,
grouping: nil,
... |
0 | code_files/vets-api-private/modules/facilities_api/spec/models/facilities_api/v2 | code_files/vets-api-private/modules/facilities_api/spec/models/facilities_api/v2/ppms/provider_spec.rb | # frozen_string_literal: true
require 'rails_helper'
RSpec.describe FacilitiesApi::V2::PPMS::Provider, team: :facilities, type: :model do
shared_examples 'transforms param into attribute' do |param, attribute, value|
it "transforms #{param} into #{attribute}" do
provider = FacilitiesApi::V2::PPMS::Provide... |
0 | code_files/vets-api-private/modules/facilities_api/spec/requests/facilities_api | code_files/vets-api-private/modules/facilities_api/spec/requests/facilities_api/v2/ccp_spec.rb | # frozen_string_literal: true
require 'rails_helper'
vcr_options = {
cassette_name: 'facilities/ppms/ppms',
match_requests_on: %i[path query],
allow_playback_repeats: true
}
RSpec.describe 'FacilitiesApi::V2::Ccp', team: :facilities, type: :request, vcr: vcr_options do
before(:all) do
get facilities_api.... |
0 | code_files/vets-api-private/modules/facilities_api/spec/requests/facilities_api | code_files/vets-api-private/modules/facilities_api/spec/requests/facilities_api/v2/va_spec.rb | # frozen_string_literal: true
require 'rails_helper'
RSpec.shared_examples 'paginated response from request body with expected IDs' do
|request_params, ids, distances = [], mobile = nil|
let(:params) { request_params }
let(:request_host) { 'http://www.example.com' }
context request_params do
before do
... |
0 | code_files/vets-api-private/modules/facilities_api/spec/requests/facilities_api | code_files/vets-api-private/modules/facilities_api/spec/requests/facilities_api/v2/apidoc_spec.rb | # frozen_string_literal: true
require 'rails_helper'
RSpec.describe 'FacilitiesApi::V2::Apidocs', type: :request do
describe 'GET `index`' do
it 'is successful' do
get '/facilities_api/v2/apidocs'
expect(response).to have_http_status(:ok)
end
it 'is a hash' do
get '/facilities_api/v2... |
0 | code_files/vets-api-private/modules/facilities_api/spec/serializers/facilities_api/v2 | code_files/vets-api-private/modules/facilities_api/spec/serializers/facilities_api/v2/lighthouse/facility_serializer_spec.rb | # frozen_string_literal: true
require 'rails_helper'
describe FacilitiesApi::V2::Lighthouse::FacilitySerializer, team: :facilities, type: :serializer do
subject { described_class.new(facility) }
let(:facility) { build(:facilities_api_v2_lighthouse_facility) }
let(:data) { subject.serializable_hash.with_indiffe... |
0 | code_files/vets-api-private/modules/facilities_api/spec | code_files/vets-api-private/modules/facilities_api/spec/factories/std_institution_facilities.rb | # frozen_string_literal: true
FactoryBot.define do
factory :std_institution_facility do
name { 'Fake facility name' }
station_number { '123' }
street_state_id { 'OH' }
end
end
|
0 | code_files/vets-api-private/modules/facilities_api/spec/factories/facilities_api/v2 | code_files/vets-api-private/modules/facilities_api/spec/factories/facilities_api/v2/lighthouse/facilities.rb | # frozen_string_literal: true
require 'lighthouse/facilities/facility'
FactoryBot.define do
factory :facilities_api_v2_lighthouse_facility, class: 'FacilitiesApi::V2::Lighthouse::Facility' do
transient do
access do
{
health: [],
effective_date: ''
}
end
addr... |
0 | code_files/vets-api-private/modules/facilities_api/spec/factories/facilities_api/v2 | code_files/vets-api-private/modules/facilities_api/spec/factories/facilities_api/v2/ppms/providers.rb | # frozen_string_literal: true
FactoryBot.define do
factory :facilities_api_v2_ppms_provider, class: 'FacilitiesApi::V2::PPMS::Provider' do
provider_identifier { Faker::Number.number(digits: 6) }
provider_name { Faker::Name.name }
care_site { Faker::Company.name }
gender { Faker::Gender.binary_type }
... |
0 | code_files/vets-api-private/modules/facilities_api/spec/services/facilities_api/v2 | code_files/vets-api-private/modules/facilities_api/spec/services/facilities_api/v2/mobile_covid/client_spec.rb | # frozen_string_literal: true
require 'rails_helper'
vcr_options = {
cassette_name: 'facilities/mobile/covid',
match_requests_on: %i[path query],
allow_playback_repeats: true
}
RSpec.describe FacilitiesApi::V2::MobileCovid::Client, team: :facilities, vcr: vcr_options do
let(:mobile_client) { described_class.... |
0 | code_files/vets-api-private/modules/facilities_api/spec/services/facilities_api/v2 | code_files/vets-api-private/modules/facilities_api/spec/services/facilities_api/v2/lighthouse/client_spec.rb | # frozen_string_literal: true
require 'rails_helper'
vcr_options = {
cassette_name: '/facilities/va/lighthouse',
match_requests_on: %i[path query],
allow_playback_repeats: true
}
RSpec.describe FacilitiesApi::V2::Lighthouse::Client, team: :facilities, vcr: vcr_options do
let(:facilities_client) { described_c... |
0 | code_files/vets-api-private/modules/facilities_api/spec/services/facilities_api/v2 | code_files/vets-api-private/modules/facilities_api/spec/services/facilities_api/v2/ppms/client_spec.rb | # frozen_string_literal: true
require 'rails_helper'
vcr_options = {
cassette_name: 'facilities/ppms/ppms',
match_requests_on: %i[path query],
allow_playback_repeats: true
}
RSpec.describe FacilitiesApi::V2::PPMS::Client, team: :facilities, vcr: vcr_options do
let(:client) { FacilitiesApi::V2::PPMS::Client.n... |
0 | code_files/vets-api-private/modules/facilities_api/spec/services/facilities_api/v2 | code_files/vets-api-private/modules/facilities_api/spec/services/facilities_api/v2/ppms/response_spec.rb | # frozen_string_literal: true
require 'rails_helper'
describe FacilitiesApi::V2::PPMS::Response, team: :facilities do
let(:response) { double('response', status: 200, body: { 'value' => body }) }
let(:body) do
build_list(
:facilities_api_v2_ppms_provider, 10, :from_provider_locator
).collect do |x|... |
0 | code_files/vets-api-private/modules/facilities_api | code_files/vets-api-private/modules/facilities_api/lib/facilities_api.rb | # frozen_string_literal: true
require 'facilities_api/engine'
module FacilitiesApi
# Your code goes here...
end
|
0 | code_files/vets-api-private/modules/facilities_api/lib | code_files/vets-api-private/modules/facilities_api/lib/facilities_api/engine.rb | # frozen_string_literal: true
module FacilitiesApi
class Engine < ::Rails::Engine
isolate_namespace FacilitiesApi
config.generators do |g|
g.api_only = true
g.test_framework :rspec, view_specs: false
g.fixture_replacement :factory_bot
g.factory_bot dir: 'spec/factories'
end
... |
0 | code_files/vets-api-private/modules/facilities_api/lib | code_files/vets-api-private/modules/facilities_api/lib/facilities_api/version.rb | # frozen_string_literal: true
module FacilitiesApi
VERSION = '0.1.0'
end
|
0 | code_files/vets-api-private/modules | code_files/vets-api-private/modules/vre/vre.gemspec | # frozen_string_literal: true
$LOAD_PATH.push File.expand_path('lib', __dir__)
# Maintain your gem's version:
require 'vre/version'
# Describe your gem and declare its dependencies:
Gem::Specification.new do |spec|
spec.name = 'vre'
spec.version = VRE::VERSION
spec.authors = ['Kyle Henson']
sp... |
0 | code_files/vets-api-private/modules | code_files/vets-api-private/modules/vre/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 = 'VRE'
rdoc.options << '--line-numbers'
rdoc.rdoc_files.i... |
0 | code_files/vets-api-private/modules | code_files/vets-api-private/modules/vre/Gemfile | # frozen_string_literal: true
source 'https://rubygems.org'
# Declare your gem's dependencies in vre.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 that are still in devel... |
0 | code_files/vets-api-private/modules | code_files/vets-api-private/modules/vre/README.rdoc | = VRE
TODO: Short description and motivation.
== Installation
Ensure the following line is in the root project's Gemfile:
gem 'vre', path: 'modules/vre'
== License
This module is open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
|
0 | code_files/vets-api-private/modules/vre/app/mailers | code_files/vets-api-private/modules/vre/app/mailers/vre/veteran_readiness_employment_mailer.rb | # frozen_string_literal: true
module VRE
class VeteranReadinessEmploymentMailer < ApplicationMailer
def build(pid, email_addr, routed_to_cmp)
email_addr = 'kcrawford@governmentcio.com' if FeatureFlipper.staging_email?
@submission_date = Time.current.in_time_zone('America/New_York').strftime('%m/%d/%Y... |
0 | code_files/vets-api-private/modules/vre/app/models | code_files/vets-api-private/modules/vre/app/models/vre/vre_veteran_readiness_employment_claim.rb | # frozen_string_literal: true
require 'vets/shared_logging'
module VRE
class VREVeteranReadinessEmploymentClaim < ::SavedClaim
include Vets::SharedLogging
FORM = Constants::FORM
def initialize(args)
@sent_to_lighthouse = false
super
end
def add_claimant_info(user)
if form.bl... |
0 | code_files/vets-api-private/modules/vre/app/models | code_files/vets-api-private/modules/vre/app/models/vre/constants.rb | # frozen_string_literal: true
module VRE
class Constants
FORM = '28-1900'
# We will be adding numbers here and eventually completeley removing this and the caller to open up VRE submissions
# to all vets
PERMITTED_OFFICE_LOCATIONS = %w[].freeze
REGIONAL_OFFICE_EMAILS = {
'301' => 'VRC.VBAB... |
0 | code_files/vets-api-private/modules/vre/app/models/vre | code_files/vets-api-private/modules/vre/app/models/vre/ch31_eligibility/veteran_profile.rb | # frozen_string_literal: true
module VRE
module Ch31Eligibility
class VeteranProfile
include Vets::Model
attribute :first_name, String
attribute :last_name, String
attribute :dob, String
attribute :character_of_discharge, String
attribute :service_period, ServicePeriod, array... |
0 | code_files/vets-api-private/modules/vre/app/models/vre | code_files/vets-api-private/modules/vre/app/models/vre/ch31_eligibility/entitlement_details.rb | # frozen_string_literal: true
module VRE
module Ch31Eligibility
class EntitlementDetails
include Vets::Model
attribute :max_ch31_entitlement, Entitlement
attribute :ch31_entitlement_remaining, Entitlement
attribute :entitlement_used, Entitlement
end
end
end
|
0 | code_files/vets-api-private/modules/vre/app/models/vre | code_files/vets-api-private/modules/vre/app/models/vre/ch31_eligibility/scd_detail.rb | # frozen_string_literal: true
module VRE
module Ch31Eligibility
class ScdDetail
include Vets::Model
attribute :code, String
attribute :name, String
attribute :percentage, String
end
end
end
|
0 | code_files/vets-api-private/modules/vre/app/models/vre | code_files/vets-api-private/modules/vre/app/models/vre/ch31_eligibility/disability_rating.rb | # frozen_string_literal: true
module VRE
module Ch31Eligibility
class DisabilityRating
include Vets::Model
attribute :combined_scd, Integer
attribute :scd_details, ScdDetail, array: true
end
end
end
|
0 | code_files/vets-api-private/modules/vre/app/models/vre | code_files/vets-api-private/modules/vre/app/models/vre/ch31_eligibility/service_period.rb | # frozen_string_literal: true
module VRE
module Ch31Eligibility
class ServicePeriod
include Vets::Model
attribute :service_began_date, String
attribute :service_end_date, String
attribute :character_of_discharge, String
end
end
end
|
0 | code_files/vets-api-private/modules/vre/app/models/vre | code_files/vets-api-private/modules/vre/app/models/vre/ch31_eligibility/entitlement.rb | # frozen_string_literal: true
module VRE
module Ch31Eligibility
class Entitlement
include Vets::Model
attribute :month, Integer
attribute :days, Integer
end
end
end
|
0 | code_files/vets-api-private/modules/vre/app/serializers | code_files/vets-api-private/modules/vre/app/serializers/vre/ch31_eligibility_serializer.rb | # frozen_string_literal: true
module VRE
class Ch31EligibilitySerializer
include JSONAPI::Serializer
set_id { '' }
attributes :veteran_profile,
:disability_rating,
:irnd_date,
:eligibility_termination_date,
:entitlement_details,
... |
0 | code_files/vets-api-private/modules/vre/app/serializers | code_files/vets-api-private/modules/vre/app/serializers/vre/ch31_case_details_serializer.rb | # frozen_string_literal: true
module VRE
class Ch31CaseDetailsSerializer
include JSONAPI::Serializer
set_id { '' }
attributes :res_case_id,
:is_transfered_to_cwnrs,
:external_status
end
end
|
0 | code_files/vets-api-private/modules/vre/app/jobs | code_files/vets-api-private/modules/vre/app/jobs/vre/vre_submit1900_job.rb | # frozen_string_literal: true
require 'vre/vre_monitor'
require 'vre/monitor'
module VRE
class VRESubmit1900Job
include Sidekiq::Job
STATSD_KEY_PREFIX = 'worker.vre.vre_submit_1900_job'
# retry for 2d 1h 47m 12s
# https://github.com/sidekiq/sidekiq/wiki/Error-Handling
RETRY = 16
FORM_TYPE... |
0 | code_files/vets-api-private/modules/vre/app/controllers/vre | code_files/vets-api-private/modules/vre/app/controllers/vre/v0/ch31_eligibility_statuses_controller.rb | # frozen_string_literal: true
module VRE
module V0
class Ch31EligibilityStatusesController < ApplicationController
service_tag 'vre-application'
def show
response = eligibility_service.get_details
render json: VRE::Ch31EligibilitySerializer.new(response)
end
private
... |
0 | code_files/vets-api-private/modules/vre/app/controllers/vre | code_files/vets-api-private/modules/vre/app/controllers/vre/v0/claims_controller.rb | # frozen_string_literal: true
module VRE
module V0
class ClaimsController < ::ClaimsBaseController
service_tag 'vre-application'
before_action :authenticate
skip_before_action :load_user
def create
claim = VRE::VREVeteranReadinessEmploymentClaim.new(form: filtered_params[:form])
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.