components/financial_assistance/app/models/financial_assistance/factories/application_factory.rb
#match number of  active family members with active applicants
# should only sync draft application
match number of  active family members with active applicants
should only sync draft application
match number of active family members with active applicants should only sync draft application
def sync_family_members_with_applicants
        result = ::Operations::Families::ApplyForFinancialAssistance.new.call(family_id: @new_application.family_id)
        return if result.failure?
        members_attributes = result.success
        changed_members = detect_applicant_changes(members_attributes)
        drop_inactive_applicants(changed_members[:drop_members]) if changed_members[:drop_members].present?
        return if changed_members[:add_members].blank?
        add_new_applicants(changed_members[:add_members], members_attributes)
      end
def sync_family_members_with_applicants result = :: Operations :: Families :: ApplyForFinancialAssistance . new . call ( family_id : @new_application . family_id ) return if result . failure? members_attributes = result . success changed_members = detect_applicant_changes ( members_attributes ) drop_inactive_applicants ( changed_members [ :drop_members ] ) if changed_members [ :drop_members ] . present? return if changed_members [ :add_members ] . blank? add_new_applicants ( changed_members [ :add_members ] , members_attributes ) end
match number of  active family members with active applicants
should only sync draft application
match number of active family members with active applicants should only sync draft application