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/dependents_verification/lib
code_files/vets-api-private/modules/dependents_verification/lib/dependents_verification/version.rb
# frozen_string_literal: true module DependentsVerification # version VERSION = '0.1.0' end
0
code_files/vets-api-private/modules/dependents_verification/lib
code_files/vets-api-private/modules/dependents_verification/lib/dependents_verification/notification_email.rb
# frozen_string_literal: true require 'dependents_verification/notification_callback' require 'veteran_facing_services/notification_email/saved_claim' module DependentsVerification # @see VeteranFacingServices::NotificationEmail::SavedClaim class NotificationEmail < ::VeteranFacingServices::NotificationEmail::Sav...
0
code_files/vets-api-private/modules/dependents_verification/lib
code_files/vets-api-private/modules/dependents_verification/lib/dependents_verification/notification_callback.rb
# frozen_string_literal: true require 'dependents_verification/monitor' require 'veteran_facing_services/notification_callback/saved_claim' module DependentsVerification # @see ::VeteranFacingServices::NotificationCallback::SavedClaim class NotificationCallback < ::VeteranFacingServices::NotificationCallback::Sav...
0
code_files/vets-api-private/modules/dependents_verification/lib/dependents_verification
code_files/vets-api-private/modules/dependents_verification/lib/dependents_verification/benefits_intake/submit_claim_job.rb
# frozen_string_literal: true require 'pdf_utilities/datestamp_pdf' require 'dependents_verification/monitor' require 'dependents_verification/notification_email' require 'lighthouse/benefits_intake/metadata' require 'lighthouse/benefits_intake/service' module DependentsVerification module BenefitsIntake # Side...
0
code_files/vets-api-private/modules/dependents_verification/lib/dependents_verification
code_files/vets-api-private/modules/dependents_verification/lib/dependents_verification/benefits_intake/submission_handler.rb
# frozen_string_literal: true require 'lighthouse/benefits_intake/submission_handler/saved_claim' require 'dependents_verification/monitor' require 'dependents_verification/notification_email' module DependentsVerification module BenefitsIntake # @see BenefitsIntake::SubmissionHandler::SavedClaim class Subm...
0
code_files/vets-api-private/modules/dependents_verification/lib/dependents_verification
code_files/vets-api-private/modules/dependents_verification/lib/dependents_verification/pdf_fill/section.rb
# frozen_string_literal: true module DependentsVerification # Individual section of the form to be filled class Section include ::PdfFill::Forms::FormHelper # Hash iterator ITERATOR = ::PdfFill::HashConverter::ITERATOR # Form configuration hash KEY = {}.freeze ## # Generates a unique...
0
code_files/vets-api-private/modules/dependents_verification/lib/dependents_verification
code_files/vets-api-private/modules/dependents_verification/lib/dependents_verification/pdf_fill/va210538.rb
# frozen_string_literal: true require 'pdf_fill/forms/form_base' require 'pdf_fill/forms/form_helper' require 'pdf_fill/hash_converter' require 'dependents_verification/pdf_fill/sections/section0' require 'dependents_verification/pdf_fill/sections/section1' require 'dependents_verification/pdf_fill/sections/section2' ...
0
code_files/vets-api-private/modules/dependents_verification/lib/dependents_verification/pdf_fill
code_files/vets-api-private/modules/dependents_verification/lib/dependents_verification/pdf_fill/sections/section0.rb
# frozen_string_literal: true require 'dependents_verification/pdf_fill/section' module DependentsVerification module PdfFill # Section I: Veteran's Identification Information class Section0 < Section include ::PdfFill::Forms::FormHelper # Section configuration hash KEY = { # 0 ...
0
code_files/vets-api-private/modules/dependents_verification/lib/dependents_verification/pdf_fill
code_files/vets-api-private/modules/dependents_verification/lib/dependents_verification/pdf_fill/sections/section5.rb
# frozen_string_literal: true require 'dependents_verification/pdf_fill/section' module DependentsVerification module PdfFill # Section I: Veteran's Identification Information class Section5 < Section include ::PdfFill::Forms::FormHelper # Section configuration hash KEY = { # 5 ...
0
code_files/vets-api-private/modules/dependents_verification/lib/dependents_verification/pdf_fill
code_files/vets-api-private/modules/dependents_verification/lib/dependents_verification/pdf_fill/sections/section1.rb
# frozen_string_literal: true require 'dependents_verification/pdf_fill/section' module DependentsVerification module PdfFill # Section I: Veteran's Identification Information class Section1 < Section include ::PdfFill::Forms::FormHelper include ::PdfFill::Forms::FormHelper::PhoneNumberFormattin...
0
code_files/vets-api-private/modules/dependents_verification/lib/dependents_verification/pdf_fill
code_files/vets-api-private/modules/dependents_verification/lib/dependents_verification/pdf_fill/sections/section2.rb
# frozen_string_literal: true require 'dependents_verification/pdf_fill/section' module DependentsVerification module PdfFill # Section I: Veteran's Identification Information class Section2 < Section include ::PdfFill::Forms::FormHelper include ::PdfFill::Forms::FormHelper::PhoneNumberFormattin...
0
code_files/vets-api-private/modules
code_files/vets-api-private/modules/accredited_representative_portal/accredited_representative_portal.gemspec
# frozen_string_literal: true $LOAD_PATH.push File.expand_path('lib', __dir__) # Maintain your gem's version: require 'accredited_representative_portal/version' # Describe your gem and declare its dependencies: Gem::Specification.new do |spec| spec.name = 'accredited_representative_portal' spec.version ...
0
code_files/vets-api-private/modules
code_files/vets-api-private/modules/accredited_representative_portal/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 = 'AccreditedRepresentativePortal' rdoc.options << '--line-n...
0
code_files/vets-api-private/modules
code_files/vets-api-private/modules/accredited_representative_portal/Gemfile
# frozen_string_literal: true source 'https://rubygems.org' # Declare your gem's dependencies in accredited_representative_portal.gemspec. # Bundler will treat runtime dependencies like base dependencies, and # development dependencies will be added by default to the :development group. gemspec # Declare any depende...
0
code_files/vets-api-private/modules
code_files/vets-api-private/modules/accredited_representative_portal/README.rdoc
= AccreditedRepresentativePortal The API that powers the Accredited Representative Portal. == Installation Ensure the following line is in the root project's Gemfile: gem 'accredited_representative_portal', path: 'modules/accredited_representative_portal' == License This module is open source under the terms of th...
0
code_files/vets-api-private/modules/accredited_representative_portal/app/uploaders
code_files/vets-api-private/modules/accredited_representative_portal/app/uploaders/accredited_representative_portal/form21a_attachment_uploader.rb
# frozen_string_literal: true module AccreditedRepresentativePortal class Form21aAttachmentUploader < CarrierWave::Uploader::Base include UploaderVirusScan include CarrierWave::MiniMagick before :store, :log_transaction_start after :store, :log_transaction_complete def initialize(guid, _unused =...
0
code_files/vets-api-private/modules/accredited_representative_portal/app/sidekiq
code_files/vets-api-private/modules/accredited_representative_portal/app/sidekiq/accredited_representative_portal/power_of_attorney_request_email_job.rb
# frozen_string_literal: true require 'vets/shared_logging' module AccreditedRepresentativePortal class PowerOfAttorneyRequestEmailJob include Sidekiq::Job include Vets::SharedLogging sidekiq_options retry: 14 # The retry logic here matches VANotify::EmailJob. sidekiq_retries_exhausted do |msg, _ex...
0
code_files/vets-api-private/modules/accredited_representative_portal/app/sidekiq
code_files/vets-api-private/modules/accredited_representative_portal/app/sidekiq/accredited_representative_portal/redact_power_of_attorney_requests_job.rb
# frozen_string_literal: true require 'sidekiq' module AccreditedRepresentativePortal # Job to redact PII from PowerOfAttorneyRequests that meet specific criteria # (stale resolved or expired). Redaction involves removing the associated # form and submission, and nullifying the resolution reason. class Redact...
0
code_files/vets-api-private/modules/accredited_representative_portal/app/sidekiq
code_files/vets-api-private/modules/accredited_representative_portal/app/sidekiq/accredited_representative_portal/expire_power_of_attorney_requests_job.rb
# frozen_string_literal: true require 'sidekiq' module AccreditedRepresentativePortal # Job to find and expire PowerOfAttorneyRequests that are older than # EXPIRY_DURATION (60 days) and remain unresolved. class ExpirePowerOfAttorneyRequestsJob include Sidekiq::Job sidekiq_options retry: 3 def per...
0
code_files/vets-api-private/modules/accredited_representative_portal/app/sidekiq
code_files/vets-api-private/modules/accredited_representative_portal/app/sidekiq/accredited_representative_portal/allow_list_sync_job.rb
# frozen_string_literal: true module AccreditedRepresentativePortal class AllowListSyncJob include Sidekiq::Job sidekiq_options retry: false # To not overload the DB. MAX_RECORD_COUNT = 500 Error = Class.new(RuntimeError) class RecordCountError < Error def initialize(record_count) ...
0
code_files/vets-api-private/modules/accredited_representative_portal/app/sidekiq
code_files/vets-api-private/modules/accredited_representative_portal/app/sidekiq/accredited_representative_portal/submit_benefits_intake_claim_job.rb
# frozen_string_literal: true module AccreditedRepresentativePortal class SubmitBenefitsIntakeClaimJob < Lighthouse::SubmitBenefitsIntakeClaim ## # TODO: Remove this parent class override. # # This is a temporary workaround while there is configuration inconsistency # between two Benefits Intake ...
0
code_files/vets-api-private/modules/accredited_representative_portal/app/sidekiq
code_files/vets-api-private/modules/accredited_representative_portal/app/sidekiq/accredited_representative_portal/email_personalisations.rb
# frozen_string_literal: true module AccreditedRepresentativePortal class EmailPersonalisations class << self def generate(notification) new(notification).generate end end def generate { 'first_name' => first_name } end def initialize(notification) ...
0
code_files/vets-api-private/modules/accredited_representative_portal/app/sidekiq
code_files/vets-api-private/modules/accredited_representative_portal/app/sidekiq/accredited_representative_portal/benefits_intake_configuration.rb
# frozen_string_literal: true require 'common/client/configuration/rest' require 'faraday/multipart' module AccreditedRepresentativePortal ## # HTTP client configuration for the {AccreditedRepresentativePortal::BenefitsIntakeService}, # sets the base path, the base request headers, and a service name for breake...
0
code_files/vets-api-private/modules/accredited_representative_portal/app/sidekiq
code_files/vets-api-private/modules/accredited_representative_portal/app/sidekiq/accredited_representative_portal/power_of_attorney_form_submission_job.rb
# frozen_string_literal: true module AccreditedRepresentativePortal class PowerOfAttorneyFormSubmissionJob class PendingSubmissionError < StandardError; end CRITICAL_STEPS = %w[PDF_SUBMISSION POA_UPDATE POA_ACCESS_UPDATE].freeze include Sidekiq::Job ## # This retry duration follows the retry d...
0
code_files/vets-api-private/modules/accredited_representative_portal/app/models
code_files/vets-api-private/modules/accredited_representative_portal/app/models/accredited_representative_portal/user_account_accredited_individual.rb
# frozen_string_literal: true module AccreditedRepresentativePortal class UserAccountAccreditedIndividual < ApplicationRecord enum( :power_of_attorney_holder_type, PowerOfAttorneyHolder::Types::ALL.index_by(&:itself), validate: true ) validates :accredited_individual_registration_numbe...
0
code_files/vets-api-private/modules/accredited_representative_portal/app/models
code_files/vets-api-private/modules/accredited_representative_portal/app/models/accredited_representative_portal/power_of_attorney_request_resolution.rb
# frozen_string_literal: true module AccreditedRepresentativePortal class PowerOfAttorneyRequestResolution < ApplicationRecord belongs_to :power_of_attorney_request, class_name: 'PowerOfAttorneyRequest', inverse_of: :resolution RESOLVING_TYPES = %w[ PowerOfAttorneyRequest...
0
code_files/vets-api-private/modules/accredited_representative_portal/app/models
code_files/vets-api-private/modules/accredited_representative_portal/app/models/accredited_representative_portal/form21a_attachment.rb
# frozen_string_literal: true module AccreditedRepresentativePortal class Form21aAttachment < ::FormAttachment ATTACHMENT_UPLOADER_CLASS = Form21aAttachmentUploader end end
0
code_files/vets-api-private/modules/accredited_representative_portal/app/models
code_files/vets-api-private/modules/accredited_representative_portal/app/models/accredited_representative_portal/power_of_attorney_request_decision.rb
# frozen_string_literal: true module AccreditedRepresentativePortal class PowerOfAttorneyRequestDecision < ApplicationRecord self.inheritance_column = nil include PowerOfAttorneyRequestResolution::Resolving enum :declination_reason, { HEALTH_RECORDS_WITHHELD: 0, ADDRESS_CHANGE_WITHHELD: 1, ...
0
code_files/vets-api-private/modules/accredited_representative_portal/app/models
code_files/vets-api-private/modules/accredited_representative_portal/app/models/accredited_representative_portal/power_of_attorney_form_submission.rb
# frozen_string_literal: true module AccreditedRepresentativePortal class PowerOfAttorneyFormSubmission < ApplicationRecord module Statuses ALL = [ ENQUEUE_SUCCEEDED = 'enqueue_succeeded', ENQUEUE_FAILED = 'enqueue_failed', SUCCEEDED = 'succeeded', FAILED = 'failed' ]....
0
code_files/vets-api-private/modules/accredited_representative_portal/app/models
code_files/vets-api-private/modules/accredited_representative_portal/app/models/accredited_representative_portal/power_of_attorney_request_notification.rb
# frozen_string_literal: true module AccreditedRepresentativePortal class PowerOfAttorneyRequestNotification < ApplicationRecord self.inheritance_column = nil PERMITTED_TYPES = %w[requested declined expiring expired enqueue_failed submission_failed].freeze PERMITTED_RECIPIENTS = %w[claimant representati...
0
code_files/vets-api-private/modules/accredited_representative_portal/app/models
code_files/vets-api-private/modules/accredited_representative_portal/app/models/accredited_representative_portal/power_of_attorney_form.rb
# frozen_string_literal: true module AccreditedRepresentativePortal class PowerOfAttorneyForm < ApplicationRecord belongs_to :power_of_attorney_request, class_name: 'PowerOfAttorneyRequest', inverse_of: :power_of_attorney_form ## # If we had a regular ID column, we could us...
0
code_files/vets-api-private/modules/accredited_representative_portal/app/models
code_files/vets-api-private/modules/accredited_representative_portal/app/models/accredited_representative_portal/representative_user.rb
# frozen_string_literal: true module AccreditedRepresentativePortal class RepresentativeUser < Common::RedisStore redis_store REDIS_CONFIG[:representative_user_store][:namespace] redis_ttl REDIS_CONFIG[:representative_user_store][:each_ttl] redis_key :uuid # in alphabetical order attribute :auth...
0
code_files/vets-api-private/modules/accredited_representative_portal/app/models
code_files/vets-api-private/modules/accredited_representative_portal/app/models/accredited_representative_portal/power_of_attorney_request_expiration.rb
# frozen_string_literal: true module AccreditedRepresentativePortal class PowerOfAttorneyRequestExpiration < ApplicationRecord include PowerOfAttorneyRequestResolution::Resolving class << self def create_with_resolution!(**resolution_attrs) PowerOfAttorneyRequestResolution.create_with_resolvin...
0
code_files/vets-api-private/modules/accredited_representative_portal/app/models
code_files/vets-api-private/modules/accredited_representative_portal/app/models/accredited_representative_portal/claimant_representative.rb
# frozen_string_literal: true module AccreditedRepresentativePortal class ClaimantRepresentative < Data.define( :claimant_id, :accredited_individual_registration_number, :power_of_attorney_holder ) class << self def find(...) Finder.new(...).perform end end ...
0
code_files/vets-api-private/modules/accredited_representative_portal/app/models
code_files/vets-api-private/modules/accredited_representative_portal/app/models/accredited_representative_portal/power_of_attorney_holder.rb
# frozen_string_literal: true module AccreditedRepresentativePortal class PowerOfAttorneyHolder < Data.define( :type, :poa_code, :name, :can_accept_digital_poa_requests ) module Types ALL = [ VETERAN_SERVICE_ORGANIZATION = 'veteran_service_organization', CLAIMS_AGENT = '...
0
code_files/vets-api-private/modules/accredited_representative_portal/app/models
code_files/vets-api-private/modules/accredited_representative_portal/app/models/accredited_representative_portal/power_of_attorney_holder_memberships.rb
# frozen_string_literal: true module AccreditedRepresentativePortal class PowerOfAttorneyHolderMemberships Membership = Data.define( :registration_number, :power_of_attorney_holder ) Error = Class.new(RuntimeError) InvalidRegistrationsError = Class.new(Error) def initial...
0
code_files/vets-api-private/modules/accredited_representative_portal/app/models
code_files/vets-api-private/modules/accredited_representative_portal/app/models/accredited_representative_portal/saved_claim_claimant_representative.rb
# frozen_string_literal: true module AccreditedRepresentativePortal class SavedClaimClaimantRepresentative < ApplicationRecord belongs_to :saved_claim, class_name: '::SavedClaim' before_validation :set_claimant_type validates :power_of_attorney_holder_type, inclusion: { in: PowerOfAttorneyHolder::Types:...
0
code_files/vets-api-private/modules/accredited_representative_portal/app/models
code_files/vets-api-private/modules/accredited_representative_portal/app/models/accredited_representative_portal/power_of_attorney_request_withdrawal.rb
# frozen_string_literal: true module AccreditedRepresentativePortal class PowerOfAttorneyRequestWithdrawal < ApplicationRecord include PowerOfAttorneyRequestResolution::Resolving self.inheritance_column = nil module Types ALL = [ REPLACEMENT = 'PowerOfAttorneyRequestReplacement' ].f...
0
code_files/vets-api-private/modules/accredited_representative_portal/app/models
code_files/vets-api-private/modules/accredited_representative_portal/app/models/accredited_representative_portal/power_of_attorney_request.rb
# frozen_string_literal: true module AccreditedRepresentativePortal class PowerOfAttorneyRequest < ApplicationRecord EXPIRY_DURATION = 60.days belongs_to :claimant, class_name: 'UserAccount' has_one :power_of_attorney_form, inverse_of: :power_of_attorney_request, required: true ...
0
code_files/vets-api-private/modules/accredited_representative_portal/app/models
code_files/vets-api-private/modules/accredited_representative_portal/app/models/accredited_representative_portal/icn_temporary_identifier.rb
# frozen_string_literal: true module AccreditedRepresentativePortal class IcnTemporaryIdentifier < ApplicationRecord def self.lookup_icn(uuid) find(uuid).icn end def self.save_icn(icn) find_or_create_by(icn:) end end end
0
code_files/vets-api-private/modules/accredited_representative_portal/app/models/accredited_representative_portal
code_files/vets-api-private/modules/accredited_representative_portal/app/models/accredited_representative_portal/saved_claim/benefits_claims.rb
# frozen_string_literal: true module AccreditedRepresentativePortal module SavedClaim class BenefitsClaims class IntentToFile < ::SavedClaim FORM_ID = '21-0966' FORM = '21-0966' # Though ITF submission via Benefits Claims Lighthouse endpoints # does not involve a PDF, this ...
0
code_files/vets-api-private/modules/accredited_representative_portal/app/models/accredited_representative_portal
code_files/vets-api-private/modules/accredited_representative_portal/app/models/accredited_representative_portal/saved_claim/benefits_intake.rb
# frozen_string_literal: true module AccreditedRepresentativePortal module SavedClaim class BenefitsIntake < ::SavedClaim class << self DEFAULT_STATUS_WARNING_THRESHOLD = 10.days ## # Types of Benefits Intake API claims differ only by the value of a # couple attributes. `.d...
0
code_files/vets-api-private/modules/accredited_representative_portal/app/policies
code_files/vets-api-private/modules/accredited_representative_portal/app/policies/accredited_representative_portal/claimant_policy.rb
# frozen_string_literal: true require 'lighthouse/benefits_claims/service' module AccreditedRepresentativePortal class ClaimantPolicy < ApplicationPolicy def search? @user.representative? end end end
0
code_files/vets-api-private/modules/accredited_representative_portal/app/policies
code_files/vets-api-private/modules/accredited_representative_portal/app/policies/accredited_representative_portal/representative_form_upload_policy.rb
# frozen_string_literal: true require 'lighthouse/benefits_claims/service' module AccreditedRepresentativePortal class RepresentativeFormUploadPolicy < ApplicationPolicy def submit? @record.present? end def upload_scanned_form? @user.representative? end def upload_supporting_docume...
0
code_files/vets-api-private/modules/accredited_representative_portal/app/policies
code_files/vets-api-private/modules/accredited_representative_portal/app/policies/accredited_representative_portal/application_policy.rb
# frozen_string_literal: true module AccreditedRepresentativePortal class ApplicationPolicy def initialize(user, record) raise Pundit::NotAuthorizedError, 'must be logged in' unless user @user = user @record = record end def index? override_warning false end def s...
0
code_files/vets-api-private/modules/accredited_representative_portal/app/policies
code_files/vets-api-private/modules/accredited_representative_portal/app/policies/accredited_representative_portal/saved_claim_claimant_representative_policy.rb
# frozen_string_literal: true module AccreditedRepresentativePortal class SavedClaimClaimantRepresentativePolicy < ApplicationPolicy def index? authorize end private def authorize @user.representative? end class Scope < ApplicationPolicy::Scope def resolve @scope....
0
code_files/vets-api-private/modules/accredited_representative_portal/app/policies
code_files/vets-api-private/modules/accredited_representative_portal/app/policies/accredited_representative_portal/power_of_attorney_request_decision_policy.rb
# frozen_string_literal: true module AccreditedRepresentativePortal class PowerOfAttorneyRequestDecisionPolicy < ApplicationPolicy def create? Pundit .policy(@user, PowerOfAttorneyRequest) .create_decision? end end end
0
code_files/vets-api-private/modules/accredited_representative_portal/app/policies
code_files/vets-api-private/modules/accredited_representative_portal/app/policies/accredited_representative_portal/intent_to_file_policy.rb
# frozen_string_literal: true require 'lighthouse/benefits_claims/service' module AccreditedRepresentativePortal class IntentToFilePolicy < ApplicationPolicy def show? claimant_representative.present? end def create? claimant_representative.present? end private def claimant_re...
0
code_files/vets-api-private/modules/accredited_representative_portal/app/policies
code_files/vets-api-private/modules/accredited_representative_portal/app/policies/accredited_representative_portal/power_of_attorney_request_policy.rb
# frozen_string_literal: true module AccreditedRepresentativePortal class PowerOfAttorneyRequestPolicy < ApplicationPolicy def index? authorize end def show? authorize end def create_decision? authorize end private def authorize @user.power_of_attorney_hold...
0
code_files/vets-api-private/modules/accredited_representative_portal/app/policies
code_files/vets-api-private/modules/accredited_representative_portal/app/policies/accredited_representative_portal/authorization_policy.rb
# frozen_string_literal: true module AccreditedRepresentativePortal class AuthorizationPolicy < ApplicationPolicy def self.policy_name 'AccreditedRepresentativePortal::Authorization' end def authorize_as_representative? # Must be logged in is enforced by ApplicationPolicy initialize # ...
0
code_files/vets-api-private/modules/accredited_representative_portal/app/serializers
code_files/vets-api-private/modules/accredited_representative_portal/app/serializers/accredited_representative_portal/claimant_serializer.rb
# frozen_string_literal: true module AccreditedRepresentativePortal class ClaimantSerializer < ApplicationSerializer MILITARY_STATE_CODES = %w[AE AP AA].freeze set_id do |object| object[:claimant_representative].claimant_id end attribute :first_name do |object| object[:claimant_profile]...
0
code_files/vets-api-private/modules/accredited_representative_portal/app/serializers
code_files/vets-api-private/modules/accredited_representative_portal/app/serializers/accredited_representative_portal/power_of_attorney_request_serializer.rb
# frozen_string_literal: true module AccreditedRepresentativePortal class PowerOfAttorneyRequestSerializer < ApplicationSerializer REDACTION_POLICY = { FIELDS: %w[ssn vaFileNumber].freeze, CHARS_VISIBLE: 4 }.freeze attributes :claimant_id, :created_at, :expires_at attribute :power_of_at...
0
code_files/vets-api-private/modules/accredited_representative_portal/app/serializers
code_files/vets-api-private/modules/accredited_representative_portal/app/serializers/accredited_representative_portal/application_serializer.rb
# frozen_string_literal: true module AccreditedRepresentativePortal class ApplicationSerializer include JSONAPI::Serializer set_key_transform :camel_lower # We're not building to JSONAPI. def serializable_hash data = super[:data] case data when Array data.map(&method(:unw...
0
code_files/vets-api-private/modules/accredited_representative_portal/app/serializers
code_files/vets-api-private/modules/accredited_representative_portal/app/serializers/accredited_representative_portal/saved_claim_claimant_representative_serializer.rb
# frozen_string_literal: true module AccreditedRepresentativePortal class SavedClaimClaimantRepresentativeSerializer < ApplicationSerializer STATUSES = { 'pending' => 'awaiting_receipt', 'failure' => 'processing_error', 'vbms' => 'received', 'manually' => 'received' }.freeze def ...
0
code_files/vets-api-private/modules/accredited_representative_portal/app/serializers/accredited_representative_portal
code_files/vets-api-private/modules/accredited_representative_portal/app/serializers/accredited_representative_portal/power_of_attorney_request_serializer/accredited_individual_serializer.rb
# frozen_string_literal: true module AccreditedRepresentativePortal class PowerOfAttorneyRequestSerializer class AccreditedIndividualSerializer < ApplicationSerializer attribute :full_name do |poa_holder| parts = [ poa_holder.first_name, poa_holder.middle_initial, poa_...
0
code_files/vets-api-private/modules/accredited_representative_portal/app/serializers/accredited_representative_portal
code_files/vets-api-private/modules/accredited_representative_portal/app/serializers/accredited_representative_portal/power_of_attorney_request_serializer/expiration_serializer.rb
# frozen_string_literal: true module AccreditedRepresentativePortal class PowerOfAttorneyRequestSerializer class ExpirationSerializer < ResolutionSerializer attribute(:type) { 'expiration' } end end end
0
code_files/vets-api-private/modules/accredited_representative_portal/app/serializers/accredited_representative_portal
code_files/vets-api-private/modules/accredited_representative_portal/app/serializers/accredited_representative_portal/power_of_attorney_request_serializer/decision_serializer.rb
# frozen_string_literal: true module AccreditedRepresentativePortal class PowerOfAttorneyRequestSerializer class DecisionSerializer < ResolutionSerializer attribute(:type) { 'decision' } attribute :decision_type do |resolution| case resolution.resolving.type when PowerOfAttorneyReque...
0
code_files/vets-api-private/modules/accredited_representative_portal/app/serializers/accredited_representative_portal
code_files/vets-api-private/modules/accredited_representative_portal/app/serializers/accredited_representative_portal/power_of_attorney_request_serializer/organization_power_of_attorney_holder_serializer.rb
# frozen_string_literal: true module AccreditedRepresentativePortal class PowerOfAttorneyRequestSerializer class OrganizationPowerOfAttorneyHolderSerializer < ApplicationSerializer attribute :type do 'veteran_service_organization' end attribute :name end end end
0
code_files/vets-api-private/modules/accredited_representative_portal/app/serializers/accredited_representative_portal
code_files/vets-api-private/modules/accredited_representative_portal/app/serializers/accredited_representative_portal/power_of_attorney_request_serializer/resolution_serializer.rb
# frozen_string_literal: true module AccreditedRepresentativePortal class PowerOfAttorneyRequestSerializer class ResolutionSerializer < ApplicationSerializer attributes :created_at end end end
0
code_files/vets-api-private/modules/accredited_representative_portal/app/controllers
code_files/vets-api-private/modules/accredited_representative_portal/app/controllers/accredited_representative_portal/application_controller.rb
# frozen_string_literal: true module AccreditedRepresentativePortal class ApplicationController < SignIn::ApplicationController include SignIn::AudienceValidator include Authenticable include Pundit::Authorization rescue_from Pundit::NotAuthorizedError do |e| log_auth_failure(e) render(...
0
code_files/vets-api-private/modules/accredited_representative_portal/app/controllers/accredited_representative_portal
code_files/vets-api-private/modules/accredited_representative_portal/app/controllers/accredited_representative_portal/v0/claim_submissions_controller.rb
# frozen_string_literal: true module AccreditedRepresentativePortal module V0 class ClaimSubmissionsController < ApplicationController def index authorize nil, policy_class: SavedClaimClaimantRepresentativePolicy serializer = SavedClaimClaimantRepresentativeSerializer.new(claim_submissions)...
0
code_files/vets-api-private/modules/accredited_representative_portal/app/controllers/accredited_representative_portal
code_files/vets-api-private/modules/accredited_representative_portal/app/controllers/accredited_representative_portal/v0/intent_to_file_controller.rb
# frozen_string_literal: true module AccreditedRepresentativePortal module V0 class IntentToFileController < ApplicationController INTENT_TO_FILE_TYPES = %w[compensation pension survivor].freeze before_action :check_feature_toggle before_action :validate_file_type, only: %i[show create] ...
0
code_files/vets-api-private/modules/accredited_representative_portal/app/controllers/accredited_representative_portal
code_files/vets-api-private/modules/accredited_representative_portal/app/controllers/accredited_representative_portal/v0/power_of_attorney_request_decisions_controller.rb
# frozen_string_literal: true module AccreditedRepresentativePortal module V0 class PowerOfAttorneyRequestDecisionsController < ApplicationController include PowerOfAttorneyRequests include AccreditedRepresentativePortal::V0::WithdrawalGuard before_action do authorize PowerOfAttorneyRe...
0
code_files/vets-api-private/modules/accredited_representative_portal/app/controllers/accredited_representative_portal
code_files/vets-api-private/modules/accredited_representative_portal/app/controllers/accredited_representative_portal/v0/form21a_controller.rb
# frozen_string_literal: true module AccreditedRepresentativePortal module V0 class Form21aController < ApplicationController include AccreditedRepresentativePortal::V0::Form21aUploadConcern skip_after_action :verify_pundit_authorization class SchemaValidationError < StandardError attr...
0
code_files/vets-api-private/modules/accredited_representative_portal/app/controllers/accredited_representative_portal
code_files/vets-api-private/modules/accredited_representative_portal/app/controllers/accredited_representative_portal/v0/representative_form_upload_controller.rb
# frozen_string_literal: true require 'lighthouse/benefits_intake/service' require 'simple_forms_api_submission/metadata_validator' require 'accredited_representative_portal/monitor' module AccreditedRepresentativePortal module V0 class RepresentativeFormUploadController < ApplicationController include Ac...
0
code_files/vets-api-private/modules/accredited_representative_portal/app/controllers/accredited_representative_portal
code_files/vets-api-private/modules/accredited_representative_portal/app/controllers/accredited_representative_portal/v0/representative_users_controller.rb
# frozen_string_literal: true module AccreditedRepresentativePortal module V0 class RepresentativeUsersController < ApplicationController skip_after_action :verify_pundit_authorization def show # TODO: Once we figure out how we're handling serialization and which # library we're usin...
0
code_files/vets-api-private/modules/accredited_representative_portal/app/controllers/accredited_representative_portal
code_files/vets-api-private/modules/accredited_representative_portal/app/controllers/accredited_representative_portal/v0/claimant_controller.rb
# frozen_string_literal: true module AccreditedRepresentativePortal module V0 class ClaimantController < ApplicationController def search # rubocop:disable Metrics/MethodLength authorize nil, policy_class: ClaimantPolicy claimant_profile = MPI::Service.new.find_profile_by_attribu...
0
code_files/vets-api-private/modules/accredited_representative_portal/app/controllers/accredited_representative_portal
code_files/vets-api-private/modules/accredited_representative_portal/app/controllers/accredited_representative_portal/v0/power_of_attorney_requests_controller.rb
# frozen_string_literal: true module AccreditedRepresentativePortal module V0 class PowerOfAttorneyRequestsController < ApplicationController include PowerOfAttorneyRequests include AccreditedRepresentativePortal::V0::WithdrawalGuard before_action do authorize PowerOfAttorneyRequest ...
0
code_files/vets-api-private/modules/accredited_representative_portal/app/controllers/accredited_representative_portal
code_files/vets-api-private/modules/accredited_representative_portal/app/controllers/accredited_representative_portal/v0/in_progress_forms_controller.rb
# frozen_string_literal: true module AccreditedRepresentativePortal module V0 class InProgressFormsController < ApplicationController skip_after_action :verify_pundit_authorization before_action :feature_enabled def show form = find_form render json: form&.data_and_metadata || ...
0
code_files/vets-api-private/modules/accredited_representative_portal/app/controllers/concerns
code_files/vets-api-private/modules/accredited_representative_portal/app/controllers/concerns/accredited_representative_portal/power_of_attorney_requests.rb
# frozen_string_literal: true module AccreditedRepresentativePortal module PowerOfAttorneyRequests extend ActiveSupport::Concern ## # TODO: We ought to centralize our exception rendering. Starting here for # now. # concerning :ExceptionRendering do included do rescue_from Activ...
0
code_files/vets-api-private/modules/accredited_representative_portal/app/controllers/concerns
code_files/vets-api-private/modules/accredited_representative_portal/app/controllers/concerns/accredited_representative_portal/authenticable.rb
# frozen_string_literal: true module AccreditedRepresentativePortal module Authenticable extend ActiveSupport::Concern included do prepend SignIn::Authentication end private def load_user_object RepresentativeUserLoader.new(access_token:, request_ip: request.remote_ip).perform ...
0
code_files/vets-api-private/modules/accredited_representative_portal/app/controllers/concerns/accredited_representative_portal
code_files/vets-api-private/modules/accredited_representative_portal/app/controllers/concerns/accredited_representative_portal/v0/withdrawal_guard.rb
# frozen_string_literal: true module AccreditedRepresentativePortal module V0 module WithdrawalGuard extend ActiveSupport::Concern included do private def render_404_if_withdrawn!(poa_request) if poa_request.resolution&.resolving.is_a?( PowerOfAttorneyRequestWi...
0
code_files/vets-api-private/modules/accredited_representative_portal/app/controllers/concerns/accredited_representative_portal
code_files/vets-api-private/modules/accredited_representative_portal/app/controllers/concerns/accredited_representative_portal/v0/form21a_upload_concern.rb
# frozen_string_literal: true module AccreditedRepresentativePortal module V0 module Form21aUploadConcern extend ActiveSupport::Concern DOCUMENT_KEYS = { 'conviction-details' => 'imprisonedDetailsDocuments', 'court-martialed-details' => 'militaryConvictionDetailsDocuments', '...
0
code_files/vets-api-private/modules/accredited_representative_portal/app/controllers/concerns/accredited_representative_portal
code_files/vets-api-private/modules/accredited_representative_portal/app/controllers/concerns/accredited_representative_portal/v0/representative_form_upload_concern.rb
# frozen_string_literal: true module AccreditedRepresentativePortal module V0 module RepresentativeFormUploadConcern extend ActiveSupport::Concern private def attachment_guids guids = [] guids << submit_params[:confirmationCode] if submit_params[:confirmationCode].present? ...
0
code_files/vets-api-private/modules/accredited_representative_portal/app
code_files/vets-api-private/modules/accredited_representative_portal/app/services/accreditation_service.rb
# frozen_string_literal: true # AccreditationService is responsible for handling the submission of Form 21a to the accreditation service. # It provides a single class method `submit_form21a` to send the form data and handle the response. # The service URL is determined based on the current environment (development, te...
0
code_files/vets-api-private/modules/accredited_representative_portal/app/services
code_files/vets-api-private/modules/accredited_representative_portal/app/services/accredited_representative_portal/benefits_intake_service.rb
# frozen_string_literal: true require 'benefits_intake_service/service' module AccreditedRepresentativePortal class BenefitsIntakeService < ::BenefitsIntakeService::Service configuration BenefitsIntakeConfiguration # ARP-specific configuration end end
0
code_files/vets-api-private/modules/accredited_representative_portal/app/services
code_files/vets-api-private/modules/accredited_representative_portal/app/services/accredited_representative_portal/ogc_client.rb
# frozen_string_literal: true module AccreditedRepresentativePortal class OgcClient attr_reader :config def initialize @config = setup_configuration end def find_registration_numbers_for_icn(icn) return nil if icn.blank? begin response = make_reg_numbers_request(icn) ...
0
code_files/vets-api-private/modules/accredited_representative_portal/app/services
code_files/vets-api-private/modules/accredited_representative_portal/app/services/accredited_representative_portal/poa_request_failure_notifier.rb
# frozen_string_literal: true module AccreditedRepresentativePortal class PoaRequestFailureNotifier def initialize(poa_request) @poa_request = poa_request end def call raise ArgumentError, 'PoaRequest is required' unless @poa_request.is_a?(PowerOfAttorneyRequest) recipient_types.each ...
0
code_files/vets-api-private/modules/accredited_representative_portal/app/services
code_files/vets-api-private/modules/accredited_representative_portal/app/services/accredited_representative_portal/email_delivery_status_callback.rb
# frozen_string_literal: true # NOTE: We're not using VANotify::DefaultCallback here because it currently only supports # instrumentation for Zero Silent Failure (ZSF) events—specifically when notification_type == 'error'. # This custom callback expands observability by capturing metrics for all delivery statuses. # #...
0
code_files/vets-api-private/modules/accredited_representative_portal/app/services
code_files/vets-api-private/modules/accredited_representative_portal/app/services/accredited_representative_portal/claimant_lookup_service.rb
# frozen_string_literal: true module AccreditedRepresentativePortal class ClaimantLookupService def initialize(first_name, last_name, ssn, birth_date) @first_name = first_name @last_name = last_name @ssn = ssn.try(:gsub, /\D/, '') @birth_date = birth_date end def claimant_profile...
0
code_files/vets-api-private/modules/accredited_representative_portal/app/services
code_files/vets-api-private/modules/accredited_representative_portal/app/services/accredited_representative_portal/representative_user_loader.rb
# frozen_string_literal: true module AccreditedRepresentativePortal # NOTE: This class currently only supports 21a Unaccredited Representatives. # For 2122, Accredited Representative User Progress, see the below WIP ARP Auth epic: # https://app.zenhub.com/workspaces/accredited-representative-facing-team-65453a97...
0
code_files/vets-api-private/modules/accredited_representative_portal/app/services
code_files/vets-api-private/modules/accredited_representative_portal/app/services/accredited_representative_portal/monitoring.rb
# frozen_string_literal: true module AccreditedRepresentativePortal class Monitoring NAME = 'accredited-representative-portal' def initialize(service = NAME, default_tags: []) @service = service @default_tags = default_tags end def track_count(metric, tags: []) StatsD.increment(me...
0
code_files/vets-api-private/modules/accredited_representative_portal/app/services
code_files/vets-api-private/modules/accredited_representative_portal/app/services/accredited_representative_portal/enable_online_submission_21_22_service.rb
# frozen_string_literal: true module AccreditedRepresentativePortal class EnableOnlineSubmission2122Service def self.call(poa_codes:) codes = normalize_codes(poa_codes) raise ArgumentError, 'POA codes required' if codes.empty? scope = Veteran::Service::Organization .where(poa: co...
0
code_files/vets-api-private/modules/accredited_representative_portal/app/services/accredited_representative_portal
code_files/vets-api-private/modules/accredited_representative_portal/app/services/accredited_representative_portal/saved_claim_service/attach.rb
# frozen_string_literal: true require 'benefits_intake_service/service' module AccreditedRepresentativePortal module SavedClaimService module Attach Error = Class.new(RuntimeError) UnknownError = Class.new(Error) UpstreamInvalidError = Class.new(Error) class RecordInvalidError < Error ...
0
code_files/vets-api-private/modules/accredited_representative_portal/app/services/accredited_representative_portal
code_files/vets-api-private/modules/accredited_representative_portal/app/services/accredited_representative_portal/saved_claim_service/create.rb
# frozen_string_literal: true module AccreditedRepresentativePortal module SavedClaimService module Create Error = Class.new(RuntimeError) UnknownError = Class.new(Error) WrongAttachmentsError = Class.new(Error) TooManyRequestsError = Class.new(Error) class RecordInvalidError < Err...
0
code_files/vets-api-private/modules/accredited_representative_portal/app/services/accredited_representative_portal
code_files/vets-api-private/modules/accredited_representative_portal/app/services/accredited_representative_portal/power_of_attorney_request_service/accept.rb
# frozen_string_literal: true module AccreditedRepresentativePortal module PowerOfAttorneyRequestService class Accept class Error < RuntimeError attr_reader :status def initialize(message, status) @status = status super(message) end end TRANSIENT_ER...
0
code_files/vets-api-private/modules/accredited_representative_portal/app/services/accredited_representative_portal
code_files/vets-api-private/modules/accredited_representative_portal/app/services/accredited_representative_portal/power_of_attorney_request_service/params_schema.rb
# frozen_string_literal: true module AccreditedRepresentativePortal module PowerOfAttorneyRequestService module ParamsSchema # Load extensions needed for schema validation Dry::Schema.load_extensions(:json_schema) Dry::Schema.load_extensions(:hints) module Page module Size ...
0
code_files/vets-api-private/modules/accredited_representative_portal/app/services/accredited_representative_portal
code_files/vets-api-private/modules/accredited_representative_portal/app/services/accredited_representative_portal/power_of_attorney_request_service/create.rb
# frozen_string_literal: true module AccreditedRepresentativePortal module PowerOfAttorneyRequestService class Create ORGANIZATION = PowerOfAttorneyHolder::Types::VETERAN_SERVICE_ORGANIZATION ACCREDITED_ENTITY_ERROR = 'poa_code can not be blank' # @note For the 21-22 pilot: # 1. poa_co...
0
code_files/vets-api-private/modules/accredited_representative_portal/app/services/accredited_representative_portal/power_of_attorney_request_service
code_files/vets-api-private/modules/accredited_representative_portal/app/services/accredited_representative_portal/power_of_attorney_request_service/create/form_data_adapter.rb
# frozen_string_literal: true module AccreditedRepresentativePortal module PowerOfAttorneyRequestService class Create class FormDataAdapter def initialize(data:, dependent: false, service_branch: nil) @data = data.transform_values do |value| value == '' ? nil : value ...
0
code_files/vets-api-private/modules/accredited_representative_portal/app/services/accredited_representative_portal
code_files/vets-api-private/modules/accredited_representative_portal/app/services/accredited_representative_portal/submissions_service/params_schema.rb
# frozen_string_literal: true module AccreditedRepresentativePortal module SubmissionsService module ParamsSchema # Load extensions needed for schema validation Dry::Schema.load_extensions(:json_schema) Dry::Schema.load_extensions(:hints) module Page module Size MIN = 1...
0
code_files/vets-api-private/modules/accredited_representative_portal
code_files/vets-api-private/modules/accredited_representative_portal/bin/rails
#!/usr/bin/env ruby # frozen_string_literal: true require 'pathname' ENGINE_ROOT = Pathname(__dir__).parent ENGINE_PATH = ENGINE_ROOT / 'lib/accredited_representative_portal/engine' BUNDLE_GEMFILE = ENGINE_ROOT / 'Gemfile' # Set up gems listed in the Gemfile. ENV['BUNDLE_GEMFILE'] ||= BUNDLE_GEMFILE.to_path require ...
0
code_files/vets-api-private/modules/accredited_representative_portal
code_files/vets-api-private/modules/accredited_representative_portal/config/routes.rb
# frozen_string_literal: true module AccreditedRepresentativePortal VALID_DETAIL_SLUGS = %w[ conviction-details court-martialed-details under-charges-details resigned-from-education-details withdrawn-from-education-details disciplined-for-dishonesty-details resigned-for-dishonesty-details...
0
code_files/vets-api-private/modules/accredited_representative_portal/config
code_files/vets-api-private/modules/accredited_representative_portal/config/initializers/bypass_olive_branch.rb
# frozen_string_literal: true module AccreditedRepresentativePortal ## # `olive_branch` transforms (a) request and (b) response payloads. # # (a) It deeply transforms request and query param keys. # At times it is convenient for params to act as snake-cased setters at a Ruby # interface, but not always. Fo...
0
code_files/vets-api-private/modules/accredited_representative_portal
code_files/vets-api-private/modules/accredited_representative_portal/spec/spec_helper.rb
# frozen_string_literal: true # Configure Rails Envinronment ENV['RAILS_ENV'] = 'test' require 'rspec/rails' module Faker class Form < Base class << self def id prefix = Faker::Number.number(digits: 4) suffix = Faker::Alphanumeric.alpha(number: 2).upcase "#{prefix}#{suffix}" ...
0
code_files/vets-api-private/modules/accredited_representative_portal
code_files/vets-api-private/modules/accredited_representative_portal/spec/rails_helper.rb
# frozen_string_literal: true require 'rails_helper' require_relative 'spec_helper' require File.expand_path('../../../config/environment', __dir__) module AccreditedRepresentativePortal module RequestHelper def parsed_response JSON.parse(response.body) end end module AuthenticationHelper de...
0
code_files/vets-api-private/modules/accredited_representative_portal/spec/sidekiq
code_files/vets-api-private/modules/accredited_representative_portal/spec/sidekiq/accredited_representative_portal/submit_benefits_intake_claim_job_spec.rb
# frozen_string_literal: true require 'rails_helper' require AccreditedRepresentativePortal::Engine.root / 'spec/spec_helper' RSpec.describe AccreditedRepresentativePortal::SubmitBenefitsIntakeClaimJob do fixture_path = 'form_data/saved_claim/benefits_intake/dependent_claimant.json' dependent_claimant_form =...
0
code_files/vets-api-private/modules/accredited_representative_portal/spec/sidekiq
code_files/vets-api-private/modules/accredited_representative_portal/spec/sidekiq/accredited_representative_portal/expire_power_of_attorney_requests_job_spec.rb
# frozen_string_literal: true require 'rails_helper' require_relative '../../spec_helper' require 'sidekiq/testing' RSpec.describe AccreditedRepresentativePortal::ExpirePowerOfAttorneyRequestsJob, type: :job do include ActiveSupport::Testing::TimeHelpers let(:job) { described_class.new } let(:expiry_duration) ...
0
code_files/vets-api-private/modules/accredited_representative_portal/spec/sidekiq
code_files/vets-api-private/modules/accredited_representative_portal/spec/sidekiq/accredited_representative_portal/email_personalisations_spec.rb
# frozen_string_literal: true require 'rails_helper' RSpec.describe AccreditedRepresentativePortal::EmailPersonalisations do describe '.generate' do context 'when type is requested' do let(:type) { 'requested' } let(:notification) { create(:power_of_attorney_request_notification, type:) } let(...
0
code_files/vets-api-private/modules/accredited_representative_portal/spec/sidekiq
code_files/vets-api-private/modules/accredited_representative_portal/spec/sidekiq/accredited_representative_portal/redact_power_of_attorney_requests_job_spec.rb
# frozen_string_literal: true require 'rails_helper' require 'sidekiq/testing' require_relative '../../spec_helper' Sidekiq::Testing.fake! # rubocop:disable Metrics/ModuleLength module AccreditedRepresentativePortal RSpec.describe RedactPowerOfAttorneyRequestsJob, type: :job do before do allow(Flipper).t...
0
code_files/vets-api-private/modules/accredited_representative_portal/spec/sidekiq
code_files/vets-api-private/modules/accredited_representative_portal/spec/sidekiq/accredited_representative_portal/power_of_attorney_request_email_job_spec.rb
# frozen_string_literal: true require 'rails_helper' RSpec.describe AccreditedRepresentativePortal::PowerOfAttorneyRequestEmailJob, type: :job do let(:power_of_attorney_request_notification) do create(:power_of_attorney_request_notification, :with_resolution, type:) end let(:email) { 'test@example.com' } ...