Skip to content

Commit

Permalink
Merge branch 'trunk' into 188072189_fix_contacts_demographic_mapping
Browse files Browse the repository at this point in the history
  • Loading branch information
saikumar9 authored Aug 9, 2024
2 parents bad56c6 + d277781 commit 096adda
Show file tree
Hide file tree
Showing 53 changed files with 3,026 additions and 8,796 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
---
asyncapi: 2.0.0
info:
title: Enroll App Private Family Events Publisher
version: 0.1.0
description: AMQP Publish configuration for the Enroll App services to publish private family events
contact:
name: IdeaCrew
url: https://ideacrew.com
email: [email protected]
license:
name: MIT
url: https://opensource.org/licenses/MIT

servers:
development:
url: 'amqp://rabbitmq:5672/event_source'
protocol: :amqp
protocolVersion: '0.9.2'
description: RabbitMQ Test Server
production:
url: 'amqp://rabbitmq:5672/event_source'
protocol: :amqp
protocolVersion: '0.9.2'
description: RabbitMQ Production Server
test:
url: 'amqp://rabbitmq:5672/event_source'
protocol: :amqp
protocolVersion: '0.9.2'
description: RabbitMQ Test Server

channels:
enroll.private.families.validate_cv_requested:
bindings:
amqp:
is: :routing_key
exchange:
name: enroll.private.families
type: topic
content_type: application/json
durable: true
auto_delete: false
vhost: event_source
binding_version: '0.2.0'
publish:
bindings:
amqp:
app_id: enroll
type: enroll.private.families
routing_key: enroll.private.families.validate_cv_requested
deliveryMode: 2
mandatory: true
timestamp: true
content_type: application/json
bindingVersion: 0.2.0
description: Events - Publishes private family event for CV validation
operationId: enroll.private.families.validate_cv_requested

tags:
- name: linter_tag
description: placeholder that satisfies the linter
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
---
asyncapi: 2.0.0
info:
title: Enroll App
version: 0.1.0
description: AMQP Subscribe configuration for Enroll Private Family services
contact:
name: IdeaCrew
url: https://ideacrew.com
email: [email protected]
license:
name: MIT
url: https://opensource.org/licenses/MIT

servers:
development:
url: amqp://rabbitmq:5672/event_source
protocol: amqp
protocolVersion: 0.9.2
description: RabbitMQ Development Server
production:
url: amqp://rabbitmq:5672/event_source
protocol: amqp
protocolVersion: 0.9.2
description: RabbitMQ Production Server
test:
url: amqp://rabbitmq:5672/event_source
protocol: amqp
protocolVersion: 0.9.2
description: RabbitMQ Test Server

defaultContentType: application/json

channels:
on_enroll.enroll.private.families:
bindings:
amqp:
is: queue
queue:
name: on_enroll.enroll.private.families
durable: true
exclusive: false
auto_delete: false
vhost: event_source
subscribe:
bindings:
amqp:
ack: true
exclusive: false
routing_key: enroll.private.families.validate_cv_requested
prefetch: 1
block: false
bindingVersion: '0.2.0'
operationId: on_enroll.enroll.private.families
description: placeholder that satisfies the linter

tags:
- name: linter_tag
description: placeholder that satisfies the linter
19 changes: 18 additions & 1 deletion lib/aca_entities/atp/functions/applicant_builder.rb
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,30 @@ def call(cache)
enrolled_non_esi_indicator = get_enrolled_non_esi_indicator(enrolled_non_esi_benfits)
esi_coverage_indicators = get_esi_coverage_indicators(esi_benefits)
non_esi_policies = get_non_esi_policies(enrolled_non_esi_benfits)
referral_activity_hash = referral_activity(applicant)

insurance_applicant = AcaEntities::Atp::Transformers::Aces::Applicant.transform(applicant)
insurance_applicant.merge!(enrolled_non_esi_indicator, esi_associations: esi_coverage_indicators, non_esi_policies: non_esi_policies)

insurance_applicant.merge!(enrolled_non_esi_indicator, referral_activity: referral_activity_hash,
esi_associations: esi_coverage_indicators, non_esi_policies: non_esi_policies)
collector << insurance_applicant
end
end

def referral_activity(applicant)
additional_reason_codes = applicant[:additional_reason_codes]&.flat_map {|e| e[:additional_reason_codes]}
reason_code = applicant[:reason_code].blank? ? "FullDetermination" : applicant[:reason_code]
{
activity_id: { identification_id: ["SBM", DateTime.now.strftime("%Y%m%d%H%M%S"), "pe#{applicant[:person_hbx_id]}"&.slice(-3..-1)].join },
activity_date: { date_time: DateTime.now },
sender_reference: { :ref => "Sender" }, # TODO
receiver_reference: { :ref => "medicaidReceiver" }, # TODO
status: { :status_code => "Initiated" }, # TODO
reason_code: reason_code, # TODO
additional_reason_codes: additional_reason_codes
}
end

def get_enrolled_non_esi_indicator(enrolled_non_esi_benfits)
if enrolled_non_esi_benfits.present?
{ non_esi_coverage_indicators: [true] }
Expand Down
24 changes: 23 additions & 1 deletion lib/aca_entities/atp/functions/expense_builder.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,29 @@ def call(cache)
deductions = applicants_hash[member_id.to_sym][:deductions]

deductions.each_with_object([]) do |deduction, collect|
collect << ::AcaEntities::Atp::Transformers::Aces::Expense.transform(deduction)
result = ::AcaEntities::Atp::Transformers::Aces::Expense.transform(deduction)
category_text = construct_category_text(deduction)
result.merge!(category_text: category_text) if category_text.present?
collect << result
end
end

def construct_category_text(deduction)
return if deduction[:start_on].blank? && deduction[:end_on].blank?

category_text = []
category_text << "start:#{format_date(deduction[:start_on])}" if deduction[:start_on].present?
category_text << "end:#{format_date(deduction[:end_on])}" if deduction[:end_on].present?
category_text.join(',')
end

def format_date(date)
case date
when String
parsed_date = Date.parse(date)
parsed_date.iso8601
when Date, DateTime
date.to_date.iso8601
end
end
end
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,9 @@ def call(cache) # rubocop:disable Metrics/CyclomaticComplexity, Metrics/MethodLe
doc = i20_doc
when 'DS2019 (Certificate of Eligibility for Exchange Visitor (J-1) Status)'
doc = ds2019_doc
when 'Other (with alien number)'
when 'Other (With Alien Number)'
doc = other_with_alien_number_doc
when 'Other (with I-94 number)'
when 'Other (With I-94 Number)'
doc = other_with_i94_doc
end

Expand Down Expand Up @@ -190,7 +190,7 @@ def other_with_i94_doc
@document_person_ids << passport_number if passport_number
@document_person_ids << sevis_id if sevis_id
{
category_text: 'Other (with I-94 number)',
category_text: 'Other (With I-94 Number)',
expiration_date: expiration_date,
document_person_ids: @document_person_ids
}
Expand All @@ -201,7 +201,7 @@ def other_with_alien_number_doc
@document_person_ids << passport_number if passport_number
@document_person_ids << sevis_id if sevis_id
{
category_text: 'Other (with alien number)',
category_text: 'Other (With Alien Number)',
expiration_date: expiration_date,
document_person_ids: @document_person_ids
}
Expand Down
15 changes: 0 additions & 15 deletions lib/aca_entities/atp/schema/aces/atp_service.xsd

This file was deleted.

Loading

0 comments on commit 096adda

Please sign in to comment.