Skip to content

Commit

Permalink
R2-2642 Adding comments to ruby files
Browse files Browse the repository at this point in the history
  • Loading branch information
aespinoza-quoin committed Oct 19, 2023
1 parent 8f9cc40 commit d893ba6
Show file tree
Hide file tree
Showing 1,021 changed files with 1,744 additions and 1 deletion.
2 changes: 2 additions & 0 deletions app/auth/idp_token.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# frozen_string_literal: true

# Copyright (c) 2014 - 2023 UNICEF. All rights reserved.

# Encapsulates the logic to decode and validate a JWT token
# generated by an external identity provider.
class IdpToken
Expand Down
2 changes: 2 additions & 0 deletions app/auth/idp_token_strategy.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# frozen_string_literal: true

# Copyright (c) 2014 - 2023 UNICEF. All rights reserved.

require 'warden'

# This strategy is used when Primero needs to authorize a JWT token from an external identity provider.
Expand Down
2 changes: 2 additions & 0 deletions app/controllers/api/v2/activity_log_controller.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# frozen_string_literal: true

# Copyright (c) 2014 - 2023 UNICEF. All rights reserved.

# API to fetch the list of activities
class Api::V2::ActivityLogController < ApplicationApiController
include Api::V2::Concerns::Pagination
Expand Down
2 changes: 2 additions & 0 deletions app/controllers/api/v2/agencies_controller.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# frozen_string_literal: true

# Copyright (c) 2014 - 2023 UNICEF. All rights reserved.

# API endpoint for Agency CRUD
class Api::V2::AgenciesController < ApplicationApiController
include Api::V2::Concerns::Pagination
Expand Down
2 changes: 2 additions & 0 deletions app/controllers/api/v2/alerts_controller.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# frozen_string_literal: true

# Copyright (c) 2014 - 2023 UNICEF. All rights reserved.

# Class for Alert Controller
class Api::V2::AlertsController < Api::V2::RecordResourceController
def bulk_index
Expand Down
2 changes: 2 additions & 0 deletions app/controllers/api/v2/approvals_controller.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# frozen_string_literal: true

# Copyright (c) 2014 - 2023 UNICEF. All rights reserved.

# Create, approve, or deny an approval request
class Api::V2::ApprovalsController < Api::V2::RecordResourceController
before_action :approval_params, only: [:update]
Expand Down
2 changes: 2 additions & 0 deletions app/controllers/api/v2/assigns_controller.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# frozen_string_literal: true

# Copyright (c) 2014 - 2023 UNICEF. All rights reserved.

# API endpoints that handle record reassignment
class Api::V2::AssignsController < Api::V2::RecordResourceController
def index
Expand Down
2 changes: 2 additions & 0 deletions app/controllers/api/v2/attachments_controller.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# frozen_string_literal: true

# Copyright (c) 2014 - 2023 UNICEF. All rights reserved.

# API endpoints for adding and removing attachments on Primero resources (usually records)
class Api::V2::AttachmentsController < Api::V2::RecordResourceController
before_action { authorize!(:update, @record) }
Expand Down
2 changes: 2 additions & 0 deletions app/controllers/api/v2/audit_logs_controller.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# frozen_string_literal: true

# Copyright (c) 2014 - 2023 UNICEF. All rights reserved.

# Audit logs query API
class Api::V2::AuditLogsController < ApplicationApiController
include Api::V2::Concerns::Pagination
Expand Down
2 changes: 2 additions & 0 deletions app/controllers/api/v2/bulk_exports_controller.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# frozen_string_literal: true

# Copyright (c) 2014 - 2023 UNICEF. All rights reserved.

# API endpoint for generating exports, in bulk or for individual records
class Api::V2::BulkExportsController < ApplicationApiController
include Api::V2::Concerns::Pagination
Expand Down
2 changes: 2 additions & 0 deletions app/controllers/api/v2/children_controller.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# frozen_string_literal: true

# Copyright (c) 2014 - 2023 UNICEF. All rights reserved.

# Main API controller for Case records
class Api::V2::ChildrenController < ApplicationApiController
include Api::V2::Concerns::Pagination
Expand Down
2 changes: 2 additions & 0 deletions app/controllers/api/v2/children_incidents_controller.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# frozen_string_literal: true

# Copyright (c) 2014 - 2023 UNICEF. All rights reserved.

# API endpoint for listing the incidents associated with a case
class Api::V2::ChildrenIncidentsController < Api::V2::RecordResourceController
before_action :permit_fields
Expand Down
2 changes: 2 additions & 0 deletions app/controllers/api/v2/codes_of_conduct_controller.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# frozen_string_literal: true

# Copyright (c) 2014 - 2023 UNICEF. All rights reserved.

# API endpoint for code of conduct
class Api::V2::CodesOfConductController < ApplicationApiController
include Api::V2::Concerns::JsonValidateParams
Expand Down
2 changes: 2 additions & 0 deletions app/controllers/api/v2/concerns/export.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# frozen_string_literal: true

# Copyright (c) 2014 - 2023 UNICEF. All rights reserved.

# Enpoint for triggering an export of records
module Api::V2::Concerns::Export
extend ActiveSupport::Concern
Expand Down
2 changes: 2 additions & 0 deletions app/controllers/api/v2/concerns/import.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# frozen_string_literal: true

# Copyright (c) 2014 - 2023 UNICEF. All rights reserved.

# Enpoint for triggering an import of records
module Api::V2::Concerns::Import
extend ActiveSupport::Concern
Expand Down
2 changes: 2 additions & 0 deletions app/controllers/api/v2/concerns/json_validate_params.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# frozen_string_literal: true

# Copyright (c) 2014 - 2023 UNICEF. All rights reserved.

# Module for Json Validate Params
module Api::V2::Concerns::JsonValidateParams
extend ActiveSupport::Concern
Expand Down
2 changes: 2 additions & 0 deletions app/controllers/api/v2/concerns/jwt_tokens.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# frozen_string_literal: true

# Copyright (c) 2014 - 2023 UNICEF. All rights reserved.

# Set the DeviseJwt tokens into cookies
module Api::V2::Concerns::JwtTokens
extend ActiveSupport::Concern
Expand Down
2 changes: 2 additions & 0 deletions app/controllers/api/v2/concerns/pagination.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# frozen_string_literal: true

# Copyright (c) 2014 - 2023 UNICEF. All rights reserved.

# Pagination helpers for parsing the controller params
module Api::V2::Concerns::Pagination
extend ActiveSupport::Concern
Expand Down
2 changes: 2 additions & 0 deletions app/controllers/api/v2/concerns/record.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# frozen_string_literal: true

# Copyright (c) 2014 - 2023 UNICEF. All rights reserved.

# Shared code for all record-type controllers.
# This will be a long module, by it's nature,
# but we'll need to be careful to extract as much code as possible into services
Expand Down
2 changes: 2 additions & 0 deletions app/controllers/api/v2/contact_information_controller.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# frozen_string_literal: true

# Copyright (c) 2014 - 2023 UNICEF. All rights reserved.

# Unprotected API endpoint for public system info
class Api::V2::ContactInformationController < ApplicationApiController
include Api::V2::Concerns::JsonValidateParams
Expand Down
2 changes: 2 additions & 0 deletions app/controllers/api/v2/dashboards_controller.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# frozen_string_literal: true

# Copyright (c) 2014 - 2023 UNICEF. All rights reserved.

# API for fetching the aggregate statistics backing the dashboards
class Api::V2::DashboardsController < ApplicationApiController
def index
Expand Down
2 changes: 2 additions & 0 deletions app/controllers/api/v2/families_controller.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# frozen_string_literal: true

# Copyright (c) 2014 - 2023 UNICEF. All rights reserved.

# Main API controller for Families
class Api::V2::FamiliesController < ApplicationApiController
include Api::V2::Concerns::Pagination
Expand Down
2 changes: 2 additions & 0 deletions app/controllers/api/v2/flags_controller.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# frozen_string_literal: true

# Copyright (c) 2014 - 2023 UNICEF. All rights reserved.

# Endpoint for managing flags for a record
class Api::V2::FlagsController < Api::V2::RecordResourceController
before_action { authorize! :flag, model_class }
Expand Down
2 changes: 2 additions & 0 deletions app/controllers/api/v2/flags_owners_controller.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# frozen_string_literal: true

# Copyright (c) 2014 - 2023 UNICEF. All rights reserved.

# API to fetch the list of flags given a user
class Api::V2::FlagsOwnersController < ApplicationApiController
include Api::V2::Concerns::Pagination
Expand Down
2 changes: 2 additions & 0 deletions app/controllers/api/v2/form_sections_controller.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# frozen_string_literal: true

# Copyright (c) 2014 - 2023 UNICEF. All rights reserved.

# Forms CRUD API.
class Api::V2::FormSectionsController < ApplicationApiController
include Api::V2::Concerns::Export
Expand Down
2 changes: 2 additions & 0 deletions app/controllers/api/v2/identity_providers_controller.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# frozen_string_literal: true

# Copyright (c) 2014 - 2023 UNICEF. All rights reserved.

# List all enabled identity providers
class Api::V2::IdentityProvidersController < ApplicationApiController
skip_before_action :authenticate_user!, only: [:index]
Expand Down
2 changes: 2 additions & 0 deletions app/controllers/api/v2/incidents_controller.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# frozen_string_literal: true

# Copyright (c) 2014 - 2023 UNICEF. All rights reserved.

# Main API controller for Incident records
class Api::V2::IncidentsController < ApplicationApiController
include Api::V2::Concerns::Pagination
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# frozen_string_literal: true

# Copyright (c) 2014 - 2023 UNICEF. All rights reserved.

# KeyPerformanceIndicatorsController
#
# Handles requests for Kpis
Expand Down
2 changes: 2 additions & 0 deletions app/controllers/api/v2/locations_controller.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# frozen_string_literal: true

# Copyright (c) 2014 - 2023 UNICEF. All rights reserved.

# Locations CRUD API
class Api::V2::LocationsController < ApplicationApiController
include Api::V2::Concerns::Pagination
Expand Down
2 changes: 2 additions & 0 deletions app/controllers/api/v2/lookups_controller.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# frozen_string_literal: true

# Copyright (c) 2014 - 2023 UNICEF. All rights reserved.

# Lookups CRUD API
class Api::V2::LookupsController < ApplicationApiController
include Api::V2::Concerns::Pagination
Expand Down
2 changes: 2 additions & 0 deletions app/controllers/api/v2/managed_reports_controller.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# frozen_string_literal: true

# Copyright (c) 2014 - 2023 UNICEF. All rights reserved.

# ManagedReports CRUD API
class Api::V2::ManagedReportsController < ApplicationApiController
include Api::V2::Concerns::Export
Expand Down
2 changes: 2 additions & 0 deletions app/controllers/api/v2/password_reset_controller.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# frozen_string_literal: true

# Copyright (c) 2014 - 2023 UNICEF. All rights reserved.

# Custom Devise controller that handles requests for email-based password resets,
# and adapts it to the Primero API scheme
class Api::V2::PasswordResetController < Devise::PasswordsController
Expand Down
2 changes: 2 additions & 0 deletions app/controllers/api/v2/permissions_controller.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# frozen_string_literal: true

# Copyright (c) 2014 - 2023 UNICEF. All rights reserved.

# Expose the fiull list of permissions to the front end via the API
class Api::V2::PermissionsController < ApplicationApiController
def index; end
Expand Down
2 changes: 2 additions & 0 deletions app/controllers/api/v2/potential_matches_controller.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# frozen_string_literal: true

# Copyright (c) 2014 - 2023 UNICEF. All rights reserved.

# API endpoint for listing potential matches for either cases or tracing requests
class Api::V2::PotentialMatchesController < Api::V2::RecordResourceController
def index
Expand Down
2 changes: 2 additions & 0 deletions app/controllers/api/v2/primero_configurations_controller.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# frozen_string_literal: true

# Copyright (c) 2014 - 2023 UNICEF. All rights reserved.

# Configuration API to create and apply Primero configuration states
class Api::V2::PrimeroConfigurationsController < ApplicationApiController
include Api::V2::Concerns::Pagination
Expand Down
2 changes: 2 additions & 0 deletions app/controllers/api/v2/primero_controller.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# frozen_string_literal: true

# Copyright (c) 2014 - 2023 UNICEF. All rights reserved.

# Unprotected API endpoint for public system info
class Api::V2::PrimeroController < ApplicationApiController
skip_before_action :authenticate_user!, only: [:index]
Expand Down
2 changes: 2 additions & 0 deletions app/controllers/api/v2/primero_modules_controller.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# frozen_string_literal: true

# Copyright (c) 2014 - 2023 UNICEF. All rights reserved.

# Class for PrimeroModules Controller
class Api::V2::PrimeroModulesController < ApplicationApiController
before_action :load_primero_module, only: %i[show update]
Expand Down
2 changes: 2 additions & 0 deletions app/controllers/api/v2/record_histories_controller.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# frozen_string_literal: true

# Copyright (c) 2014 - 2023 UNICEF. All rights reserved.

# API READ endpoint for Record Histories
class Api::V2::RecordHistoriesController < Api::V2::RecordResourceController
include Api::V2::Concerns::Pagination
Expand Down
2 changes: 2 additions & 0 deletions app/controllers/api/v2/record_resource_controller.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# frozen_string_literal: true

# Copyright (c) 2014 - 2023 UNICEF. All rights reserved.

# Superclass for controllers that modify a dependent resource on a record
# The REST url is something like /api/v2/:records/:record-id/:resources
class Api::V2::RecordResourceController < ApplicationApiController
Expand Down
2 changes: 2 additions & 0 deletions app/controllers/api/v2/referrals_controller.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# frozen_string_literal: true

# Copyright (c) 2014 - 2023 UNICEF. All rights reserved.

# API for creating referrals for record types
class Api::V2::ReferralsController < Api::V2::RecordResourceController
def index
Expand Down
2 changes: 2 additions & 0 deletions app/controllers/api/v2/registry_records_controller.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# frozen_string_literal: true

# Copyright (c) 2014 - 2023 UNICEF. All rights reserved.

# Main API controller for Registry records
class Api::V2::RegistryRecordsController < ApplicationApiController
include Api::V2::Concerns::Pagination
Expand Down
2 changes: 2 additions & 0 deletions app/controllers/api/v2/reports_controller.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# frozen_string_literal: true

# Copyright (c) 2014 - 2023 UNICEF. All rights reserved.

# Reports CRUD API
class Api::V2::ReportsController < ApplicationApiController
include Api::V2::Concerns::Pagination
Expand Down
2 changes: 2 additions & 0 deletions app/controllers/api/v2/roles_controller.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# frozen_string_literal: true

# Copyright (c) 2014 - 2023 UNICEF. All rights reserved.

# Roles CRUD API
class Api::V2::RolesController < ApplicationApiController
include Api::V2::Concerns::Pagination
Expand Down
2 changes: 2 additions & 0 deletions app/controllers/api/v2/saved_searches_controller.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# frozen_string_literal: true

# Copyright (c) 2014 - 2023 UNICEF. All rights reserved.

# Saved searches API for saving of record list filters
class Api::V2::SavedSearchesController < ApplicationApiController
include Api::V2::Concerns::Pagination
Expand Down
2 changes: 2 additions & 0 deletions app/controllers/api/v2/system_settings_controller.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# frozen_string_literal: true

# Copyright (c) 2014 - 2023 UNICEF. All rights reserved.

# API to fetch the settings driving Primero
class Api::V2::SystemSettingsController < ApplicationApiController
def index
Expand Down
2 changes: 2 additions & 0 deletions app/controllers/api/v2/tasks_controller.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# frozen_string_literal: true

# Copyright (c) 2014 - 2023 UNICEF. All rights reserved.

# API to fetch the list of tasks given a user
class Api::V2::TasksController < ApplicationApiController
include Api::V2::Concerns::Pagination
Expand Down
2 changes: 2 additions & 0 deletions app/controllers/api/v2/tokens_controller.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# frozen_string_literal: true

# Copyright (c) 2014 - 2023 UNICEF. All rights reserved.

# The endpoint used to authenticate a user when native authentication is enabled in Primero
class Api::V2::TokensController < Devise::SessionsController
include AuditLogActions
Expand Down
2 changes: 2 additions & 0 deletions app/controllers/api/v2/traces_controller.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# frozen_string_literal: true

# Copyright (c) 2014 - 2023 UNICEF. All rights reserved.

# API controller for Trace records. Normally Traces will be CRUDed via the TracingRequest API.
class Api::V2::TracesController < ApplicationApiController
def show
Expand Down
2 changes: 2 additions & 0 deletions app/controllers/api/v2/tracing_requests_controller.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# frozen_string_literal: true

# Copyright (c) 2014 - 2023 UNICEF. All rights reserved.

# Main API controller for Tracing Request records
class Api::V2::TracingRequestsController < ApplicationApiController
include Api::V2::Concerns::Pagination
Expand Down
2 changes: 2 additions & 0 deletions app/controllers/api/v2/transfer_requests_controller.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# frozen_string_literal: true

# Copyright (c) 2014 - 2023 UNICEF. All rights reserved.

# API for creating transfer requests
class Api::V2::TransferRequestsController < Api::V2::RecordResourceController
def index
Expand Down
Loading

0 comments on commit d893ba6

Please sign in to comment.