app/workers/education_form/process10203_submissions.rb
def perform(
      records: EducationBenefitsClaim.joins(:education_stem_automated_decision).includes(:saved_claim).where(
        saved_claims: {
          form_id: '22-10203'
        }
      ).order('education_benefits_claims.created_at')
    )
      return false unless evss_is_healthy?

      init_count = records.filter do |r|
        r.education_stem_automated_decision.automated_decision_state == EducationStemAutomatedDecision::INIT
      end.count

      if init_count.zero?
        log_info('No records with init status to process.')
        return true
      else
        log_info("Processing #{init_count} application(s) with init status")
      end

      user_submissions = group_user_uuid(records)
      process_user_submissions(user_submissions)
    end
# Get all 10203 submissions that have a row in education_stem_automated_decisions
Get all 10203 submissions that have a row in education_stem_automated_decisions
Get all 10203 submissions that have a row in education_stem_automated_decisions
def perform(
      records: EducationBenefitsClaim.joins(:education_stem_automated_decision).includes(:saved_claim).where(
        saved_claims: {
          form_id: '22-10203'
        }
      ).order('education_benefits_claims.created_at')
    )
      return false unless evss_is_healthy?
      init_count = records.filter do |r|
        r.education_stem_automated_decision.automated_decision_state == EducationStemAutomatedDecision::INIT
      end.count
      if init_count.zero?
        log_info('No records with init status to process.')
        return true
      else
        log_info("Processing #{init_count} application(s) with init status")
      end
      user_submissions = group_user_uuid(records)
      process_user_submissions(user_submissions)
    end
def perform ( records : EducationBenefitsClaim . joins ( :education_stem_automated_decision ) . includes ( :saved_claim ) . where ( saved_claims : { form_id : '22-10203' } ) . order ( 'education_benefits_claims.created_at' ) ) return false unless evss_is_healthy? init_count = records . filter do | r | r . education_stem_automated_decision . automated_decision_state == EducationStemAutomatedDecision :: INIT end . count if init_count . zero? log_info ( 'No records with init status to process.' ) return true else log_info ( "Processing #{init_count} application(s) with init status" ) end user_submissions = group_user_uuid ( records ) process_user_submissions ( user_submissions ) end
Get all 10203 submissions that have a row in education_stem_automated_decisions
Get all 10203 submissions that have a row in education_stem_automated_decisions
records
joins
includes
where
order