Incident Processor

All about the endpoints

This file deals with processing the incidents from EventScheduler and checkUnprocessedAudits().

Global Vars:

datacorrection - email address portalrequest - email address

Methods:

processRow

Switch case checks for the actions - I (Insert), U (Update), D (Delete).

INSERT Case

Fetches the incident id from IDAO.

  1. If incident type is newProgramSignUp -> processNewProgramSignup(id)
  2. If incident type is newAgencySignUp -> processNewAgencySignUp(id)
  3. If incident type is add/change attribute -> processAddNewAttribute(id)
  4. If incident type is add current user to program ->processAddUsertoProgram(id)
  5. If incident type is portalProblem -> processPortalProblems(id)
  6. If incident type is other ->processOtherProblems(id)
  7. If incident type is newAccountSignUp
    1. If organization exists -> processNewHelplineUserAccountOrg(id)
    2. Else add newHelpline Account->processNewHelplineUserAccount(id)
  8. If the incident type needs Agent support (HRIA) send notification to agent ->processNotificationtoAgent(id,incident.getIncidentrefno(), incident.getIncidenttype())

UPDATE Case

Fetches the incident id from IDAO.

  1. If incident type is related to call center search
    1. Without reference->processCallCenterSearch(id,false, inc.getIncidenttype(),inc.getRef(),inc.getSource())
    2. With reference->processCallCenterSearch(id,true, inc.getIncidenttype(),inc.getRef(),inc.getSource())
  2. If incident type is new program signup and status is approved-> updatePrograms(inc),processNewProgramApproved(id)
  3. If incident type is newAgencySignUp and status is approved ->updatePrograms(inc), processNewAgencyApproved(id).
  4. If incident type is cloneProgramRequest and status is approved ->processCloneProgram(inc).
  5. If incident type is add/change Attributes

DELETE Case

If delete is required, query is run from the utils file

processNotificationToAgent()

If incident type is dataCorrection then -> , else [fetchIncidentDetails()] Fetch all details and add to ObjectNode, and ThreadDetails to ArrayNode.

  1. If incident type is dataCorrection template used is data_correction_email_notification_to_agent and email is sent via sendEmail.
  2. else email_notification_to_agent template is used and email is sent via sendEmail.

processRejectedNewAttribute()

-> IDAO.updateRejectedOpportunity() where opportunity is not active and approval status is 424.

updatePrograms() :

Fetches OrgDetails from IDAO and will get the details of Program and agency If program is not null and has Id ->[updateOrganizations(program.getId())] where org is active and provider status is approved. If agency is not null and has Id->[updateOrganizations(agency.getId())] where org is active and provider status is approved. If attribute map is notnull and has attributes->updateAttributes(attributeids) where opportunity is active and approval status is 422.

processNewHelplineUserAccount()

Create an ObjectNode to store the details of the user like name, tokenId and email. If user account is: Citizen use template new_cittizen_account_signup Helpline use template new_provider_account_signup Finally send email via sendEmail

processNewHelplineUserAccountOrg()

Create ObjectNode to store the values. If the user is Citizen save name, email and tokenId Helpline User - save all required details refer to code If user account is: Citizen use template new_cittizen_account_signup Helpline use template new_provider_account_signup Finally send an email.

processCloneProgram()

Clone the program and send email regarding the same.

processOtherProblems()

Get all the threads from the given ID and send email with threadlist as the payload with other_problem as template.

processPortalProblems()

Get all the threads from the given ID and send email with threadlist as the payload with portal_problemas template.

processAddUserToProgram()

Get userProgramDetails from IDAO and use template add_user_to_the_program, create a arraynode to save the user details and add to object node and send it as payload via sendEmail()

processAddNewAttribute()

Sends email to raise a Add New Attribute Request uses add_new_attribute_request processApproveNewAttributeRequest() ->idao.updateApprovedOpportunity() if approved sends an email regarding the same using the template treatment_is_added_to_the_program.

processApproveNewAttributeRequest():

  • idao.updateApprovedOpportunity() if approved sends an email regarding the same using the template treatment_is_added_to_the_program.

processNewAgencySignUp()

Fetches the [newAgencySignUp] details and and emails regarding the same using the email template new_agency_signup processNewAgencyApproved() Fetches the [newAgencySignUp] details of the approved agency and emails regarding the same using the email template new_agency_approved.

processNewAgencyApproved()

Fetches the newAgencySignUp details of the approved agency and emails regarding the same using the email template new_agency_approved.

processNewProgramSignUp()

Fetches the newProgramSignUp details and emails regarding the same using the email template new_program_signup [processNewProgramApproved()] Fetches the newProgramSignUp details of the approved program and emails regarding the same using the email template new_program_approved.

processNewProgramApproved():

Fetches the newProgramSignUp details of the approved program and emails regarding the same using the email template “new_program_approved”.

processCallCenterSearch()

Fetches selectedServices from IDAO and if incident type is call center search is referred collect the call center referral Program Data else collect programDetails. Else If incident Source is PG screener or PG Search: Use template pg_search_results_template Else use search_result template if the incident is referred get referralProgramDetails Else get allProgramDetails Send the email based on the above data, refer to code for more clarification.

Top