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/app/swagger/swagger/requests | code_files/vets-api-private/app/swagger/swagger/requests/gibct/institution_programs.rb | # frozen_string_literal: true
module Swagger
module Requests
module Gibct
class InstitutionPrograms
include Swagger::Blocks
swagger_path '/v0/gi/institution_programs/autocomplete' do
operation :get do
key :description, 'Retrieves institution programs beginning with a ... |
0 | code_files/vets-api-private/app/swagger/swagger/requests | code_files/vets-api-private/app/swagger/swagger/requests/gibct/yellow_ribbon_programs.rb | # frozen_string_literal: true
module Swagger
module Requests
module Gibct
class YellowRibbonPrograms
include Swagger::Blocks
swagger_path '/v0/gi/yellow_ribbon_programs' do
operation :get do
key :description, 'Retrieves Yellow Ribbon Programs with partial match'
... |
0 | code_files/vets-api-private/app/swagger/swagger/requests | code_files/vets-api-private/app/swagger/swagger/requests/contact_us/inquiries.rb | # frozen_string_literal: true
module Swagger
module Requests
module ContactUs
class Inquiries
include Swagger::Blocks
swagger_path '/v0/contact_us/inquiries' do
operation :post do
extend Swagger::Responses::ValidationError
key :description, 'Create an inq... |
0 | code_files/vets-api-private/app/swagger/swagger/requests | code_files/vets-api-private/app/swagger/swagger/requests/contact_us/inquiries_list.rb | # frozen_string_literal: true
module Swagger
module Requests
module ContactUs
class InquiriesList
include Swagger::Blocks
swagger_path '/v0/contact_us/inquiries' do
operation :get do
extend Swagger::Responses::AuthenticationError
key :description, 'Get a ... |
0 | code_files/vets-api-private/app/swagger/swagger/requests | code_files/vets-api-private/app/swagger/swagger/requests/mdot/supplies.rb | # frozen_string_literal: true
# app/controllers/v0/mdot/suppliesc_controller.rb
module Swagger
module Requests
module MDOT
class Supplies
include Swagger::Blocks
swagger_path '/v0/mdot/supplies' do
operation :post do
key :description, 'Create a MDOT supply order'
... |
0 | code_files/vets-api-private/app/swagger/swagger/requests | code_files/vets-api-private/app/swagger/swagger/requests/my_va/submission_statuses.rb | # app/controllers/v0/my_va/submission_statuses_controller.rb
# frozen_string_literal: true
module Swagger
module Requests
module MyVA
class SubmissionStatuses
include Swagger::Blocks
swagger_path '/v0/my_va/submission_statuses' do
operation :get do
key :description, ... |
0 | code_files/vets-api-private/app/swagger/swagger/requests | code_files/vets-api-private/app/swagger/swagger/requests/appeals/appeals.rb | # frozen_string_literal: true
require 'decision_review/schemas'
module Swagger
module Requests
module Appeals
class Appeals
include Swagger::Blocks
swagger_path '/v0/appeals' do
operation :get do
extend Swagger::Responses::AuthenticationError
key :descrip... |
0 | code_files/vets-api-private/app/swagger/swagger/requests | code_files/vets-api-private/app/swagger/swagger/requests/form1010cg/attachments.rb | # frozen_string_literal: true
module Swagger
module Requests
module Form1010cg
class Attachments
include Swagger::Blocks
swagger_path '/v0/form1010cg/attachments' do
operation :post do
extend Swagger::Responses::ValidationError
extend Swagger::Responses::B... |
0 | code_files/vets-api-private/app | code_files/vets-api-private/app/models/form_email_matches_profile_log.rb | # frozen_string_literal: true
class FormEmailMatchesProfileLog < ApplicationRecord
end
|
0 | code_files/vets-api-private/app | code_files/vets-api-private/app/models/old_email.rb | # frozen_string_literal: true
require 'common/models/concerns/cache_aside'
class OldEmail < Common::RedisStore
redis_store REDIS_CONFIG[:old_email][:namespace]
redis_ttl REDIS_CONFIG[:old_email][:each_ttl]
redis_key :transaction_id
attribute :transaction_id, String
attribute :email, String
validates(:tr... |
0 | code_files/vets-api-private/app | code_files/vets-api-private/app/models/personal_information_log.rb | # frozen_string_literal: true
class PersonalInformationLog < ApplicationRecord
scope :last_week, -> { where('created_at >= :date', date: 1.week.ago) }
has_kms_key
has_encrypted :data, type: :json, key: :kms_key, **lockbox_options
validates :error_class, presence: true
end
|
0 | code_files/vets-api-private/app | code_files/vets-api-private/app/models/form526_submission.rb | # frozen_string_literal: true
require 'evss/disability_compensation_form/form526_to_lighthouse_transform'
require 'sidekiq/form526_backup_submission_process/submit'
require 'logging/third_party_transaction'
require 'lighthouse/poll_form526_pdf'
require 'scopes/form526_submission_state'
class Form526Submission < Appli... |
0 | code_files/vets-api-private/app | code_files/vets-api-private/app/models/prescription_preference.rb | # frozen_string_literal: true
require 'vets/model'
require 'va_profile/models/email'
##
# Models Prescription notification preference
#
# @!attribute email_address
# @return [String]
# @!attribute rx_flag
# @return [Boolean]
#
class PrescriptionPreference
include Vets::Model
attribute :email_address, String
... |
0 | code_files/vets-api-private/app | code_files/vets-api-private/app/models/evss_claims_sync_status_tracker.rb | # frozen_string_literal: true
class EVSSClaimsSyncStatusTracker < Common::RedisStore
redis_store REDIS_CONFIG[:evss_claims_store][:namespace]
redis_ttl REDIS_CONFIG[:evss_claims_store][:each_ttl]
redis_key :user_uuid
attribute :user_uuid, String
attribute :status_hash, Hash
attr_accessor :claim_id
def ... |
0 | code_files/vets-api-private/app | code_files/vets-api-private/app/models/lighthouse526_document_upload.rb | # frozen_string_literal: true
require 'lighthouse/benefits_documents/form526/polled_document_failure_handler'
class Lighthouse526DocumentUpload < ApplicationRecord
include AASM
POLLING_WINDOW = 1.hour
VETERAN_UPLOAD_DOCUMENT_TYPE = 'Veteran Upload'
BDD_INSTRUCTIONS_DOCUMENT_TYPE = 'BDD Instructions'
FORM_0... |
0 | code_files/vets-api-private/app | code_files/vets-api-private/app/models/form_profile.rb | # frozen_string_literal: true
require 'string_helpers'
require 'va_profile/configuration'
require 'va_profile/prefill/military_information'
require 'vets/model'
require 'vets/shared_logging'
# TODO(AJD): Virtus POROs for now, will become ActiveRecord when the profile is persisted
class FormFullName
include Vets::Mo... |
0 | code_files/vets-api-private/app | code_files/vets-api-private/app/models/id_card_attributes.rb | # frozen_string_literal: true
class IdCardAttributes
attr_accessor :user
def self.for_user(user)
id_attributes = IdCardAttributes.new
id_attributes.user = user
id_attributes
end
# Return dict of traits in canonical order
def traits
{
'edipi' => @user.edipi,
'firstname' => @user.... |
0 | code_files/vets-api-private/app | code_files/vets-api-private/app/models/form1095_b.rb | # frozen_string_literal: true
class Form1095B < ApplicationRecord
has_kms_key
has_encrypted :form_data, key: :kms_key, **lockbox_options
validates :veteran_icn, :tax_year, presence: true
validates :veteran_icn, uniqueness: { scope: :tax_year }
validate :proper_form_data_schema
def txt_file
unless Fi... |
0 | code_files/vets-api-private/app | code_files/vets-api-private/app/models/gi_bill_feedback.rb | # frozen_string_literal: true
class GIBillFeedback < Common::RedisStore
include RedisForm
FORM_ID = 'FEEDBACK-TOOL'
FEEDBACK_MAPPINGS = {
'post9::11 ch 33' => 'Post-9/11 Ch 33',
'chapter33' => 'Post-9/11 Ch 33',
'mGIBAd ch 30' => 'MGIB-AD Ch 30',
'chapter30' => 'MGIB-AD Ch 30',
'mGIBSr ch 1... |
0 | code_files/vets-api-private/app | code_files/vets-api-private/app/models/category.rb | # frozen_string_literal: true
require 'vets/model'
# Category model
class Category
include Vets::Model
def category_id
0
end
attribute :message_category_type, String, array: true, default: -> { [] }
# Categories are simply an array and have no id.
def <=>(other)
category_id <=> other.category_i... |
0 | code_files/vets-api-private/app | code_files/vets-api-private/app/models/prescription.rb | # frozen_string_literal: true
require 'vets/model'
##
# Models a Prescription
#
# @see https://github.com/department-of-veterans-affairs/vets.gov-team/blob/master/Products/Rx%20Refills/API/sample_mvh_api_calls
#
# @!attribute prescription_id
# @return [Integer]
# @!attribute refill_status
# @return [String]
# @!a... |
0 | code_files/vets-api-private/app | code_files/vets-api-private/app/models/event_bus_gateway_notification.rb | # frozen_string_literal: true
class EventBusGatewayNotification < ApplicationRecord
belongs_to :user_account, optional: true
validates :va_notify_id, presence: true
validates :template_id, presence: true
validates :attempts, numericality: { only_integer: true, greater_than_or_equal_to: 1 }
end
|
0 | code_files/vets-api-private/app | code_files/vets-api-private/app/models/appeal_submission_upload.rb | # frozen_string_literal: true
class AppealSubmissionUpload < ApplicationRecord
validates :decision_review_evidence_attachment_guid, presence: true
belongs_to :appeal_submission
has_one :decision_review_evidence_attachment,
primary_key: 'decision_review_evidence_attachment_guid',
foreign_key:... |
0 | code_files/vets-api-private/app | code_files/vets-api-private/app/models/user_action.rb | # frozen_string_literal: true
class UserAction < ApplicationRecord
belongs_to :acting_user_verification, class_name: 'UserVerification', optional: true
belongs_to :subject_user_verification, class_name: 'UserVerification'
belongs_to :user_action_event
enum :status, { initial: 'initial', success: 'success', er... |
0 | code_files/vets-api-private/app | code_files/vets-api-private/app/models/hca_attachment.rb | # frozen_string_literal: true
class HCAAttachment < FormAttachment
ATTACHMENT_UPLOADER_CLASS = HCAAttachmentUploader
end
|
0 | code_files/vets-api-private/app | code_files/vets-api-private/app/models/debt_transaction_log.rb | # frozen_string_literal: true
class DebtTransactionLog < ApplicationRecord
belongs_to :transactionable, polymorphic: true
enum :state, pending: 'pending', submitted: 'submitted', completed: 'completed', failed: 'failed'
# Override polymorphic lookup for DigitalDisputeSubmission which stores guid (not id)
# i... |
0 | code_files/vets-api-private/app | code_files/vets-api-private/app/models/maintenance_window.rb | # frozen_string_literal: true
class MaintenanceWindow < ApplicationRecord
scope :end_after, ->(time) { where('end_time > ?', time) }
end
|
0 | code_files/vets-api-private/app | code_files/vets-api-private/app/models/saved_claim.rb | # frozen_string_literal: true
require 'pdf_fill/filler'
# Base class to hold common functionality for Claim submissions.
# Subclasses need to several constants and methods defined:
# * `FORM` should align with the identifier of the form as found in
# the vets-json-schema struct so that validations can be run on su... |
0 | code_files/vets-api-private/app | code_files/vets-api-private/app/models/saml_request_tracker.rb | # frozen_string_literal: true
require 'common/models/redis_store'
# Temporarily store SAML request details, so that on a return SAML response
# we can lookup associated information.
#
# For example, one use case would be for users logging in via SSOe that need
# to be redirected back to an external application after ... |
0 | code_files/vets-api-private/app | code_files/vets-api-private/app/models/tracking.rb | # frozen_string_literal: true
require 'vets/model'
# Tracking Model
class Tracking
include Vets::Model
attribute :prescription_id, Integer
attribute :prescription_name, String
attribute :prescription_number, String
attribute :facility_name, String
attribute :rx_info_phone_number, String
attribute :ndc_n... |
0 | code_files/vets-api-private/app | code_files/vets-api-private/app/models/central_mail_claim.rb | # frozen_string_literal: true
class CentralMailClaim < SavedClaim
has_one(:central_mail_submission, inverse_of: :central_mail_claim, foreign_key: 'saved_claim_id', dependent: :destroy)
before_create(:build_central_mail_submission)
end
|
0 | code_files/vets-api-private/app | code_files/vets-api-private/app/models/intent_to_file_queue_exhaustion.rb | # frozen_string_literal: true
class IntentToFileQueueExhaustion < ApplicationRecord
# class used to log and process ITF POST requests that have
# failed to exhaustion. The exact details of what kind of
# processing that will be done for retry attempts will be
# specified in the future.
validates :veteran_icn... |
0 | code_files/vets-api-private/app | code_files/vets-api-private/app/models/form1010_ezr_attachment.rb | # frozen_string_literal: true
class Form1010EzrAttachment < FormAttachment
ATTACHMENT_UPLOADER_CLASS = HCAAttachmentUploader
end
|
0 | code_files/vets-api-private/app | code_files/vets-api-private/app/models/nod_notification.rb | # frozen_string_literal: true
require 'json_marshal/marshaller'
class NodNotification < ApplicationRecord
serialize :payload, coder: JsonMarshal::Marshaller
has_kms_key
has_encrypted :payload, key: :kms_key, **lockbox_options
validates(:payload, presence: true)
before_save :serialize_payload
private
... |
0 | code_files/vets-api-private/app | code_files/vets-api-private/app/models/expiry_scanner.rb | # frozen_string_literal: true
require 'common/client/base'
require 'find'
require 'openssl'
require 'date'
# Adding comment to trigger manifest deployment
class ExpiryScanner
REMAINING_DAYS = 60
URGENT_REMAINING_DAYS = 30
API_PATH = 'https://slack.com/api/chat.postMessage'
def self.scan_certs
result = f... |
0 | code_files/vets-api-private/app | code_files/vets-api-private/app/models/prescription_details.rb | # frozen_string_literal: true
require 'vets/model'
class PrescriptionDetails < Prescription
attribute :cmop_division_phone, String
attribute :in_cerner_transition, Bool
attribute :not_refillable_display_message, String
attribute :cmop_ndc_number, String
attribute :user_id, Integer
attribute :provider_firs... |
0 | code_files/vets-api-private/app | code_files/vets-api-private/app/models/saved_claim_group.rb | # frozen_string_literal: true
require 'json_marshal/marshaller'
# create_table :saved_claim_group do |t|
# t.uuid :claim_group_guid, null: false
# t.integer :parent_claim_id, null: false, comment: 'ID of the saved claim in vets-api'
# t.integer :saved_claim_id, null: false, comment: 'ID of the saved claim in ve... |
0 | code_files/vets-api-private/app | code_files/vets-api-private/app/models/event_bus_gateway_push_notification.rb | # frozen_string_literal: true
class EventBusGatewayPushNotification < ApplicationRecord
belongs_to :user_account, optional: true
validates :template_id, presence: true
end
|
0 | code_files/vets-api-private/app | code_files/vets-api-private/app/models/message_search.rb | # frozen_string_literal: true
require 'vets/model'
# MessageSearch model
class MessageSearch
include Vets::Model
attribute :exact_match, Bool, default: false
attribute :sender, String
attribute :subject, String
attribute :category, String
attribute :recipient, String
attribute :from_date, Vets::Type::D... |
0 | code_files/vets-api-private/app | code_files/vets-api-private/app/models/payment_history.rb | # frozen_string_literal: true
require 'vets/model'
class PaymentHistory
include Vets::Model
attribute :payments, Hash, array: true
attribute :return_payments, Hash, array: true
end
|
0 | code_files/vets-api-private/app | code_files/vets-api-private/app/models/evidence_submission.rb | # frozen_string_literal: true
require 'lighthouse/benefits_documents/constants'
class EvidenceSubmission < ApplicationRecord
belongs_to :user_account
has_kms_key
has_encrypted :template_metadata, key: :kms_key, **lockbox_options
# Internal Upload statuses:
# CREATED: (Internal status) - the evidence submis... |
0 | code_files/vets-api-private/app | code_files/vets-api-private/app/models/form526_submission_remediation.rb | # frozen_string_literal: true
class Form526SubmissionRemediation < ApplicationRecord
belongs_to :form526_submission
validates :lifecycle, presence: true, if: :new_or_changed?
validate :validate_context_on_create_update
validate :ensure_success_if_ignored_as_duplicate
before_create :initialize_lifecycle
... |
0 | code_files/vets-api-private/app | code_files/vets-api-private/app/models/decision_review_evidence_attachment.rb | # frozen_string_literal: true
require 'decision_review/utilities/pdf_validation/service'
# Files uploaded as part of a Notice of Disagreement submission that will be sent to Lighthouse upon form submission.
# inherits from ApplicationRecord
class DecisionReviewEvidenceAttachment < FormAttachment
ATTACHMENT_UPLOADER... |
0 | code_files/vets-api-private/app | code_files/vets-api-private/app/models/invalid_letter_address_edipi.rb | # frozen_string_literal: true
class InvalidLetterAddressEdipi < ApplicationRecord
validates :edipi, presence: true, uniqueness: true
end
|
0 | code_files/vets-api-private/app | code_files/vets-api-private/app/models/form_attachment.rb | # frozen_string_literal: true
require 'vets/shared_logging'
class FormAttachment < ApplicationRecord
include SetGuid
include Vets::SharedLogging
has_kms_key
has_encrypted :file_data, key: :kms_key, **lockbox_options
validates(:file_data, :guid, presence: true)
before_destroy { |record| record.get_file.... |
0 | code_files/vets-api-private/app | code_files/vets-api-private/app/models/health_facility.rb | # frozen_string_literal: true
class HealthFacility < ApplicationRecord
end
|
0 | code_files/vets-api-private/app | code_files/vets-api-private/app/models/rate_limited_search.rb | # frozen_string_literal: true
class RateLimitedSearch < Common::RedisStore
COUNT_LIMIT = 3
redis_store(name.underscore)
redis_ttl(86_400)
redis_key(:search_params)
attribute(:count, Integer, default: 1)
attribute(:search_params, String)
class RateLimitedError < Common::Exceptions::TooManyRequests
en... |
0 | code_files/vets-api-private/app | code_files/vets-api-private/app/models/in_progress_form.rb | # frozen_string_literal: true
require 'json_marshal/marshaller'
class InProgressForm < ApplicationRecord
belongs_to :user_account, dependent: nil, optional: false
class CleanUUID < ActiveRecord::Type::String
def cast(value)
super(value.to_s.delete('-'))
end
alias serialize cast
end
attr_a... |
0 | code_files/vets-api-private/app | code_files/vets-api-private/app/models/iam_session.rb | # frozen_string_literal: true
# Subclasses the `Session` model. Adds a unique redis namespace for IAM sessions.
#
class IAMSession < Session
redis_store REDIS_CONFIG[:iam_session][:namespace]
redis_ttl REDIS_CONFIG[:iam_session][:each_ttl]
redis_key :token
end
|
0 | code_files/vets-api-private/app | code_files/vets-api-private/app/models/ivc_champva_form.rb | # frozen_string_literal: true
class IvcChampvaForm < ApplicationRecord
validates :form_uuid, presence: true
has_kms_key
has_encrypted :ves_request_data, key: :kms_key, **lockbox_options
end
|
0 | code_files/vets-api-private/app | code_files/vets-api-private/app/models/evss_claim_document.rb | # frozen_string_literal: true
require 'vets/model'
require 'pdf_info'
require 'vets/shared_logging'
class EVSSClaimDocument
include Vets::Model
include ActiveModel::Validations::Callbacks
include Vets::SharedLogging
attribute :evss_claim_id, Integer
attribute :tracked_item_id, Integer
attribute :document... |
0 | code_files/vets-api-private/app | code_files/vets-api-private/app/models/evss_claim.rb | # frozen_string_literal: true
require 'evss/documents_service'
class EVSSClaim < ApplicationRecord
belongs_to :user_account, dependent: nil, optional: true
def self.for_user(user)
claim_for_user_uuid(user.uuid).or(claim_for_user_account(user.user_account))
end
def self.claim_for_user_uuid(user_uuid)
... |
0 | code_files/vets-api-private/app | code_files/vets-api-private/app/models/form_submission_attempt.rb | # frozen_string_literal: true
require 'logging/call_location'
require 'zero_silent_failures/monitor'
class FormSubmissionAttempt < ApplicationRecord
include AASM
belongs_to :form_submission
has_one :saved_claim, through: :form_submission
has_one :in_progress_form, through: :form_submission
has_one :user_ac... |
0 | code_files/vets-api-private/app | code_files/vets-api-private/app/models/form526_job_status.rb | # frozen_string_literal: true
class Form526JobStatus < ApplicationRecord
belongs_to :form526_submission
alias submission form526_submission
FAILURE_STATUSES = {
non_retryable_error: 'non_retryable_error',
exhausted: 'exhausted'
}.freeze
SUCCESS_STATUSES = {
success: 'success',
pdf_found_lat... |
0 | code_files/vets-api-private/app | code_files/vets-api-private/app/models/decision_review_notification_audit_log.rb | # frozen_string_literal: true
require 'json_marshal/marshaller'
class DecisionReviewNotificationAuditLog < ApplicationRecord
serialize :payload, coder: JsonMarshal::Marshaller
has_kms_key
has_encrypted :payload, key: :kms_key, **lockbox_options
validates(:payload, presence: true)
before_save :serialize_p... |
0 | code_files/vets-api-private/app | code_files/vets-api-private/app/models/lighthouse_document.rb | # frozen_string_literal: true
require 'vets/model'
require 'pdf_info'
require 'common/pdf_helpers'
class LighthouseDocument
include Vets::Model
include ActiveModel::Validations::Callbacks
include Vets::SharedLogging
attribute :first_name, String
attribute :claim_id, Integer
attribute :document_type, Stri... |
0 | code_files/vets-api-private/app | code_files/vets-api-private/app/models/attachment.rb | # frozen_string_literal: true
require 'vets/model'
# Attachment model
class Attachment
include Vets::Model
attribute :id, Integer
attribute :message_id, Integer
attribute :name, String
attribute :attachment_size, Integer
attribute :metadata, Hash, default: -> { {} }
end
|
0 | code_files/vets-api-private/app | code_files/vets-api-private/app/models/spool_file_event.rb | # frozen_string_literal: true
class SpoolFileEvent < ApplicationRecord
validates(:rpo, inclusion: EducationForm::EducationFacility::FACILITY_IDS.values)
validates :filename, uniqueness: { scope: %i[rpo filename] }
# Look for an existing row with same filename and RPO
# and increase retry attempt if wasn't suc... |
0 | code_files/vets-api-private/app | code_files/vets-api-private/app/models/persistent_attachment.rb | # frozen_string_literal: true
require 'common/convert_to_pdf'
# Persistent backing of a Shrine file upload, primarily used by SavedClaim
# at the moment.
# create_table "persistent_attachments", id: :serial, force: :cascade do |t|
# t.uuid "guid"
# t.string "type"
# t.string "form_id"
# t.datetime "created_a... |
0 | code_files/vets-api-private/app | code_files/vets-api-private/app/models/education_stem_automated_decision.rb | # frozen_string_literal: true
class EducationStemAutomatedDecision < ApplicationRecord
INIT = 'init'
PROCESSED = 'processed'
DENIED = 'denied'
DECISION_STATES = [INIT, PROCESSED, DENIED].freeze
has_kms_key
has_encrypted :auth_headers_json, key: :kms_key, **lockbox_options
validates(:automated_decision... |
0 | code_files/vets-api-private/app | code_files/vets-api-private/app/models/message.rb | # frozen_string_literal: true
require 'vets/model'
##
# Models a secure message
#
# @!attribute id
# @return [Integer]
# @!attribute category
# @return [String]
# @!attribute subject
# @return [String]
# @!attribute body
# @return [String]
# @!attribute attachment
# @return [Boolean]
# @!attribute sent_date... |
0 | code_files/vets-api-private/app | code_files/vets-api-private/app/models/gids_redis.rb | # frozen_string_literal: true
require 'common/models/concerns/cache_aside'
require 'gi/client'
require 'gi/search_client'
require 'gi/lcpe/client'
# Facade for GIDS.
class GIDSRedis < Common::RedisStore
include Common::CacheAside
redis_config_key :gids_response
# @return [Symbol] the GI::Client method to cal... |
0 | code_files/vets-api-private/app | code_files/vets-api-private/app/models/session.rb | # frozen_string_literal: true
require 'common/models/redis_store'
class Session < Common::RedisStore
redis_store REDIS_CONFIG[:session_store][:namespace]
redis_ttl REDIS_CONFIG[:session_store][:each_ttl]
redis_key :token
DEFAULT_TOKEN_LENGTH = 40
MAX_SESSION_LIFETIME = 12.hours
attribute :token
attrib... |
0 | code_files/vets-api-private/app | code_files/vets-api-private/app/models/all_triage_teams.rb | # frozen_string_literal: true
require 'vets/model'
# AllTriageTeams model
class AllTriageTeams
include Vets::Model
include RedisCaching
redis_config REDIS_CONFIG[:secure_messaging_store]
attribute :triage_team_id, Integer
attribute :name, String
attribute :station_number, String
attribute :blocked_sta... |
0 | code_files/vets-api-private/app | code_files/vets-api-private/app/models/deprecated_user_account.rb | # frozen_string_literal: true
class DeprecatedUserAccount < ApplicationRecord
belongs_to :user_verification, dependent: nil
belongs_to :user_account, dependent: :destroy
end
|
0 | code_files/vets-api-private/app | code_files/vets-api-private/app/models/gibs_not_found_user.rb | # frozen_string_literal: true
class GibsNotFoundUser < ApplicationRecord
# :nocov:
has_kms_key
has_encrypted :ssn, key: :kms_key, **lockbox_options
validates :edipi, presence: true, uniqueness: true
validates :first_name, :last_name, :ssn_ciphertext, :dob, presence: true
def self.log(user)
create_wit... |
0 | code_files/vets-api-private/app | code_files/vets-api-private/app/models/iam_user.rb | # frozen_string_literal: true
require 'digest'
require 'active_support/core_ext/digest/uuid'
require 'common/client/errors'
# Subclasses the `User` model. Adds a unique redis namespace for IAM users.
# Adds IAM sourced versions of ICN, EDIPI, and SEC ID and methods to use them
# or hit MPI via the mpi_profile.
#
clas... |
0 | code_files/vets-api-private/app | code_files/vets-api-private/app/models/onsite_notification.rb | # frozen_string_literal: true
class OnsiteNotification < ApplicationRecord
validates :template_id, :va_profile_id, presence: true
validates :template_id, inclusion: Settings.onsite_notifications.template_ids
def self.for_user(user, include_dismissed: false)
notifications = where(va_profile_id: user.vet360_i... |
0 | code_files/vets-api-private/app | code_files/vets-api-private/app/models/power_of_attorney.rb | # frozen_string_literal: true
require 'vets/model'
# PowerOfAttorney model
class PowerOfAttorney
include Vets::Model
attribute :social_security_number, String
attribute :code, String
attribute :name, String
attribute :organization, String
attribute :begin_date, String
attribute :end_date, String
end
|
0 | code_files/vets-api-private/app | code_files/vets-api-private/app/models/message_draft.rb | # frozen_string_literal: true
##
# Models Message draft
# @note drafts are essentially messages with an implied folder (drafts), and if a reply, an implied message
#
# @!attribute has_message
# @return [Boolean]
#
class MessageDraft < Message
validate :check_as_replydraft, if: proc { reply? }
validate :check_as_... |
0 | code_files/vets-api-private/app | code_files/vets-api-private/app/models/tooltip.rb | # frozen_string_literal: true
class Tooltip < ApplicationRecord
belongs_to :user_account, inverse_of: :tooltips
validates :tooltip_name, presence: true, uniqueness: { scope: :user_account_id }
validates :last_signed_in, presence: true
end
|
0 | code_files/vets-api-private/app | code_files/vets-api-private/app/models/supporting_evidence_attachment.rb | # frozen_string_literal: true
# Files uploaded as part of a form526 submission that will be sent to EVSS upon form submission.
# inherits from ApplicationRecord
class SupportingEvidenceAttachment < FormAttachment
ATTACHMENT_UPLOADER_CLASS = SupportingEvidenceAttachmentUploader
FILENAME_EXTENSION_MATCHER = /\.\w*$/... |
0 | code_files/vets-api-private/app | code_files/vets-api-private/app/models/folder.rb | # frozen_string_literal: true
require 'vets/model'
# Folder model
class Folder
include Vets::Model
include RedisCaching
redis_config REDIS_CONFIG[:secure_messaging_store]
attribute :id, Integer
attribute :name, String
attribute :count, Integer
attribute :unread_count, Integer
attribute :system_folde... |
0 | code_files/vets-api-private/app | code_files/vets-api-private/app/models/education_benefits_claim.rb | # frozen_string_literal: true
class EducationBenefitsClaim < ApplicationRecord
FORM_TYPES = %w[
1990
1995
5490
5495
0993
0994
10203
10282
10216
10215
10297
1919
0839
10275
8794
0976
0803
].freeze
APPLICATION_TYPES = %w[
chapter33
chapte... |
0 | code_files/vets-api-private/app | code_files/vets-api-private/app/models/excel_file_event.rb | # frozen_string_literal: true
class ExcelFileEvent < ApplicationRecord
validates :filename, uniqueness: true
# Look for an existing row with same filename
# and increase retry attempt if wasn't successful from previous attempt
# Otherwise create a new event
def self.build_event(filename)
filename_date =... |
0 | code_files/vets-api-private/app | code_files/vets-api-private/app/models/form_submission.rb | # frozen_string_literal: true
class FormSubmission < ApplicationRecord
has_kms_key
has_encrypted :form_data, key: :kms_key, **lockbox_options
has_many :form_submission_attempts, dependent: :destroy
belongs_to :saved_claim, optional: true
belongs_to :user_account, optional: true
validates :form_type, pres... |
0 | code_files/vets-api-private/app | code_files/vets-api-private/app/models/dependents_application.rb | # frozen_string_literal: true
require 'string_helpers'
class DependentsApplication < Common::RedisStore
include RedisForm
validates(:user, presence: true, unless: :persisted?)
validate(:user_can_access_evss, unless: :persisted?)
FORM_ID = '21-686C'
SEPARATION_TYPES = {
'Death' => 'DEATH',
'Divorce... |
0 | code_files/vets-api-private/app | code_files/vets-api-private/app/models/submission.rb | # frozen_string_literal: true
require 'json_marshal/marshaller'
# Concern to add encryption columns to Submission class
module SubmissionEncryption
extend ActiveSupport::Concern
included do
serialize :reference_data, coder: JsonMarshal::Marshaller
has_kms_key
has_encrypted :reference_data, key: :kms... |
0 | code_files/vets-api-private/app | code_files/vets-api-private/app/models/submission_attempt.rb | # frozen_string_literal: true
require 'json_marshal/marshaller'
# Concern to add encryption columns to SubmissionAttempt class
module SubmissionAttemptEncryption
extend ActiveSupport::Concern
included do
serialize :metadata, coder: JsonMarshal::Marshaller
serialize :error_message, coder: JsonMarshal::Mar... |
0 | code_files/vets-api-private/app | code_files/vets-api-private/app/models/user_account.rb | # frozen_string_literal: true
class UserAccount < ApplicationRecord
has_many :form_submissions, dependent: :nullify
has_many :user_verifications, dependent: :destroy
has_many :terms_of_use_agreements, dependent: :destroy
has_many :tooltips, dependent: :destroy
has_one :user_acceptable_verified_credential, de... |
0 | code_files/vets-api-private/app | code_files/vets-api-private/app/models/accredited_individual.rb | # frozen_string_literal: true
require 'accredited_representation/constants'
class AccreditedIndividual < ApplicationRecord
# Represents an accredited individual (attorney, claims agent, representative) as defined by the OGC accreditation
# APIs. Until a form of soft deletion is implemented, these records will onl... |
0 | code_files/vets-api-private/app | code_files/vets-api-private/app/models/feature_toggle_event.rb | # frozen_string_literal: true
class FeatureToggleEvent < ApplicationRecord
end
|
0 | code_files/vets-api-private/app | code_files/vets-api-private/app/models/messaging_preference.rb | # frozen_string_literal: true
require 'vets/model'
require 'va_profile/models/email'
# Secure Messaging Notification Preference Model
class MessagingPreference
include Vets::Model
FREQUENCY_UPDATE_MAP = {
'none' => 0,
'each_message' => 1,
'daily' => 2
}.freeze
FREQUENCY_GET_MAP = {
'None' =>... |
0 | code_files/vets-api-private/app | code_files/vets-api-private/app/models/user_identity.rb | # frozen_string_literal: true
require 'common/models/base'
require 'common/models/redis_store'
require 'saml/user'
# Stores attributes used to identify a user. Serves as a set of inputs to an MVI lookup. Also serves
# as the receiver of identity attributes received from alternative sources during the SSO flow.
class ... |
0 | code_files/vets-api-private/app | code_files/vets-api-private/app/models/education_benefits_submission.rb | # frozen_string_literal: true
class EducationBenefitsSubmission < ApplicationRecord
# don't delete this table, we need to keep the data for a report
validates(:region, presence: true)
validates(:region, inclusion: EducationForm::EducationFacility::REGIONS.map(&:to_s))
validates(:status, inclusion: %w[processed... |
0 | code_files/vets-api-private/app | code_files/vets-api-private/app/models/user_profile_attributes.rb | # frozen_string_literal: true
require 'common/models/base'
require 'common/models/redis_store'
# Stores attributes used to identify a user. Serves as a set of inputs to an MVI lookup. Also serves
# as the receiver of identity attributes received from alternative sources during the SSO flow.
class UserProfileAttribute... |
0 | code_files/vets-api-private/app | code_files/vets-api-private/app/models/disability_contention.rb | # frozen_string_literal: true
class DisabilityContention < ApplicationRecord
validates :code, presence: true, uniqueness: true
validates :medical_term, presence: true
def self.suggested(name_part)
DisabilityContention.where('medical_term ILIKE ? OR lay_term ILIKE ?', "%#{name_part}%", "%#{name_part}%")
en... |
0 | code_files/vets-api-private/app | code_files/vets-api-private/app/models/accreditation.rb | # frozen_string_literal: true
class Accreditation < ApplicationRecord
# Acts as the join between AccreditedIndividual and AccreditedOrganization and is meant to store information that
# lives at the grain between the two models. For example, can_accept_reject_poa is a permission that needs to be
# set for each o... |
0 | code_files/vets-api-private/app | code_files/vets-api-private/app/models/message_thread.rb | # frozen_string_literal: true
require 'vets/model'
class MessageThread
include Vets::Model
attribute :thread_id, Integer
attribute :folder_id, Integer
attribute :message_id, Integer
attribute :thread_page_size, Integer
attribute :message_count, Integer
attribute :category, String
attribute :subject, S... |
0 | code_files/vets-api-private/app | code_files/vets-api-private/app/models/central_mail_submission.rb | # frozen_string_literal: true
class CentralMailSubmission < ApplicationRecord
belongs_to(:central_mail_claim, inverse_of: :central_mail_submission, foreign_key: 'saved_claim_id')
validates(:state, presence: true, inclusion: %w[success failed pending])
end
|
0 | code_files/vets-api-private/app | code_files/vets-api-private/app/models/accredited_organization.rb | # frozen_string_literal: true
require 'accredited_representation/constants'
class AccreditedOrganization < ApplicationRecord
# Represents an accredited organization as defined by the OGC accreditation APIs. Until a form of soft deletion is
# implemented, these records will only reflect organization with active ac... |
0 | code_files/vets-api-private/app | code_files/vets-api-private/app/models/user_action_event.rb | # frozen_string_literal: true
class UserActionEvent < ApplicationRecord
has_many :user_actions, dependent: :restrict_with_exception
validates :details, presence: true
validates :identifier, presence: true, uniqueness: true
validates :event_type, presence: true
def self.ransackable_attributes(_auth_object =... |
0 | code_files/vets-api-private/app | code_files/vets-api-private/app/models/claim_va_notification.rb | # frozen_string_literal: true
class ClaimVANotification < ApplicationRecord
belongs_to :saved_claim
validates :form_type, presence: true
validates :email_template_id, presence: true
validates :email_sent, inclusion: { in: [true, false] }
end
|
0 | code_files/vets-api-private/app | code_files/vets-api-private/app/models/veteran_onboarding.rb | # frozen_string_literal: true
# The VeteranOnboarding model represents the onboarding status of a veteran.
# Each instance corresponds to a veteran who is in the process of onboarding.
#
# == Schema Information
#
# Table name: veteran_onboardings
#
# id :bigint not null, primary key
# ... |
0 | code_files/vets-api-private/app | code_files/vets-api-private/app/models/user_acceptable_verified_credential.rb | # frozen_string_literal: true
class UserAcceptableVerifiedCredential < ApplicationRecord
belongs_to :user_account, dependent: nil, optional: false
scope :with_avc, -> { where.not(acceptable_verified_credential_at: nil) }
scope :with_ivc, -> { where.not(idme_verified_credential_at: nil) }
scope :... |
0 | code_files/vets-api-private/app | code_files/vets-api-private/app/models/identifier_index.rb | # frozen_string_literal: true
require 'common/models/base'
require 'common/models/redis_store'
class IdentifierIndex < Common::RedisStore
redis_store REDIS_CONFIG[:identifier_store][:namespace]
redis_ttl REDIS_CONFIG[:identifier_store][:each_ttl]
redis_key :identifier
attribute :identifier
attribute :email... |
0 | code_files/vets-api-private/app | code_files/vets-api-private/app/models/mhv_metrics_unique_user_event.rb | # frozen_string_literal: true
# Unique User Metrics event tracking model for MHV Portal
#
# This model tracks unique user events for analytics purposes. Each record represents
# the first time a specific user performed a specific event (e.g., viewed MHV landing page,
# accessed secure messages, etc.).
#
# Design notes... |
0 | code_files/vets-api-private/app | code_files/vets-api-private/app/models/terms_of_use_agreement.rb | # frozen_string_literal: true
class TermsOfUseAgreement < ApplicationRecord
CURRENT_VERSION = IdentitySettings.terms_of_use.current_version
belongs_to :user_account
validates :agreement_version, :response, presence: true
enum :response, { declined: 0, accepted: 1 }
default_scope { order(created_at: :asc) ... |
0 | code_files/vets-api-private/app | code_files/vets-api-private/app/models/id_card_announcement_subscription.rb | # frozen_string_literal: true
class IdCardAnnouncementSubscription < ApplicationRecord
validates :email,
uniqueness: true,
length: { maximum: 255 },
format: { with: /\A[^@\s]+@([^@\s]+\.)+[^@\s]+\z/ } # Devise::email_regexp
scope :va, -> { where("split_part(email, '@', 2) = 'va... |
0 | code_files/vets-api-private/app | code_files/vets-api-private/app/models/average_days_for_claim_completion.rb | # frozen_string_literal: true
class AverageDaysForClaimCompletion < ApplicationRecord
end
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.