app/services/c100_app/permission/application_rules.rb
# We check if any of the non-parent questions was answered `yes` and if so,
# we also check that all the orders for this child are allowed to apply.
#
We check if any of the non-parent questions was answered `yes` and if so,
we also check that all the orders for this child are allowed to apply.
We check if any of the non - parent questions was answered ` yes ` and if so we also check that all the orders for this child are allowed to apply .
def can_apply_for?(config, relationship:, child_orders:)
        questions = config.fetch(:questions)
        allowed_orders = config.fetch(:allowed_orders).map(&:to_s)
        relationship.slice(questions).values.any?(GenericYesNo::YES.to_s) &&
          (child_orders - allowed_orders).empty?
      end
def can_apply_for? ( config , relationship : , child_orders : ) questions = config . fetch ( :questions ) allowed_orders = config . fetch ( :allowed_orders ) . map ( & :to_s ) relationship . slice ( questions ) . values . any? ( GenericYesNo :: YES . to_s ) && ( child_orders - allowed_orders ) . empty? end
We check if any of the non-parent questions was answered `yes` and if so,
we also check that all the orders for this child are allowed to apply.
We check if any of the non - parent questions was answered ` yes ` and if so we also check that all the orders for this child are allowed to apply .
config
relationship
child_orders