diff --git a/app/mailers/verification_mailer.rb b/app/mailers/verification_mailer.rb index 2f8c9f5..b6a01b5 100644 --- a/app/mailers/verification_mailer.rb +++ b/app/mailers/verification_mailer.rb @@ -23,8 +23,8 @@ class VerificationMailer < ApplicationMailer reason_line = @verification.try(:rejection_reason_name)&.downcase || @verification.rejection_reason.humanize.downcase reason_line += " (#{@verification.rejection_reason_details})" if @verification.rejection_reason_details.present? - if @verification.rejection_reason == "under_11" - reason_line += ". You can resubmit your application once you turn 11 years old" + if @verification.rejection_reason == "under_13" + reason_line += ". You can resubmit your application once you turn 13 years old" end @datavariables = { diff --git a/app/models/identity.rb b/app/models/identity.rb index aab1b3b..72fe9a7 100644 --- a/app/models/identity.rb +++ b/app/models/identity.rb @@ -259,7 +259,7 @@ class Identity < ApplicationRecord needs_resubmission? end - def under_11? = age <= 11 + def under_13? = age <= 13 def age = (Date.today - birthday).days.in_years diff --git a/app/models/verification/aadhaar_verification.rb b/app/models/verification/aadhaar_verification.rb index fb717c7..1278686 100644 --- a/app/models/verification/aadhaar_verification.rb +++ b/app/models/verification/aadhaar_verification.rb @@ -111,7 +111,7 @@ class Verification::AadhaarVerification < Verification # Retry-able issues invalid_format: "invalid_format", service_unavailable: "service_unavailable", - under_11: "under_11", + under_13: "under_13", other: "other", # Fatal issues info_mismatch: "info_mismatch", @@ -119,7 +119,7 @@ class Verification::AadhaarVerification < Verification } # Define retry-able vs fatal rejection reasons - RETRYABLE_REJECTION_REASONS = %w[invalid_format service_unavailable under_11 other].freeze + RETRYABLE_REJECTION_REASONS = %w[invalid_format service_unavailable 13 other].freeze FATAL_REJECTION_REASONS = %w[info_mismatch duplicate].freeze # Friendly names for rejection reasons @@ -127,7 +127,7 @@ class Verification::AadhaarVerification < Verification # Retry-able issues "invalid_format" => "Invalid Aadhaar format", "service_unavailable" => "Aadhaar verification service unavailable", - "under_11" => "Submitter is under 11 years old", + "under_13" => "Submitter is under 13 years old", "other" => "Other fixable issue", # Fatal issues "info_mismatch" => "Aadhaar information doesn't match profile", diff --git a/app/models/verification/document_verification.rb b/app/models/verification/document_verification.rb index d837183..588939e 100644 --- a/app/models/verification/document_verification.rb +++ b/app/models/verification/document_verification.rb @@ -94,7 +94,7 @@ class Verification::DocumentVerification < Verification not_readable: "not_readable", wrong_type: "wrong_type", expired: "expired", - under_11: "under_11", + under_13: "under_13", other: "other", # Fatal issues info_mismatch: "info_mismatch", @@ -103,7 +103,7 @@ class Verification::DocumentVerification < Verification } # Define retry-able vs fatal rejection reasons - RETRYABLE_REJECTION_REASONS = %w[poor_quality not_readable wrong_type expired under_11 other].freeze + RETRYABLE_REJECTION_REASONS = %w[poor_quality not_readable wrong_type expired under_13 other].freeze FATAL_REJECTION_REASONS = %w[info_mismatch altered duplicate].freeze # Friendly names for rejection reasons @@ -113,7 +113,7 @@ class Verification::DocumentVerification < Verification "not_readable" => "Document not readable", "wrong_type" => "Wrong document type", "expired" => "Expired document", - "under_11" => "Submitter is under 11 years old", + "under_13" => "Submitter is under 13 years old", "other" => "Other fixable issue", # Fatal issues "info_mismatch" => "Information doesn't match profile", diff --git a/app/views/backend/verifications/show.html.erb b/app/views/backend/verifications/show.html.erb index 2988c4c..02db7db 100644 --- a/app/views/backend/verifications/show.html.erb +++ b/app/views/backend/verifications/show.html.erb @@ -95,16 +95,16 @@

❌ Reject Document

<%= form_with url: reject_backend_verification_path(@verification), method: :patch, local: true do |form| %> - <% if @verification.identity.under_11? %> + <% if @verification.identity.under_13? %>
- ⚠️ Warning: The submitted identity is under 11 years old (age <%= @verification.identity.age.round(2) %>). Consider selecting "Submitter is under 11 years old" as the rejection reason. + ⚠️ Warning: The submitted identity is under 13 years old (age <%= @verification.identity.age.round(2) %>). Consider selecting "Submitter is under 13 years old" as the rejection reason.
<% end %> <%= form.label :rejection_reason, "Rejection Reason:" %> <% if @verification.is_a?(Verification::AadhaarVerification) %> <% - default_selection = if @verification.identity.under_11? - "under_11" + default_selection = if @verification.identity.under_13? + "under_13" elsif @verification.identity.resemblances.any? "duplicate" else @@ -126,8 +126,8 @@ required: true, style: "width: 100%; margin-bottom: 1rem;" } %> <% elsif @verification.is_a?(Verification::DocumentVerification) %> <% - default_selection = if @verification.identity.under_11? - "under_11" + default_selection = if @verification.identity.under_13? + "under_13" elsif @verification.identity.resemblances.any? "duplicate" else