Skip to content

Commit

Permalink
implement coderabbit suggestions
Browse files Browse the repository at this point in the history
  • Loading branch information
kristinmerbach committed Dec 13, 2023
1 parent c9a59fe commit 5af0d8b
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ def publish(event)
status_result = update_status({ job: @job }, :succeeded, "successfully sent response to EA")
return status_result if status_result.failure?

Success('Initial REST XML verificattion response published successfully')
Success('Initial REST XML verification response published successfully')
end

def add_errors(transmittable_objects, message, error_key)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@ class ProcessInitialVerificationResponse
# @return [Dry::Monads::Result]
def call(xml_response)
parsed_xml = yield process_xml(xml_response)
# we should move all the construction into aca_entities rather than having it in FDSH
# TODO: we should move all the construction into aca_entities rather than having it in FDSH
params = yield construct_params(parsed_xml)
# we should move all the validation into aca_entities rather than having it in FDSH
# TODO: we should move all the validation into aca_entities rather than having it in FDSH
valid_response = yield validate_initial_response(params)
primary_response = yield create_primary_response(valid_response)

Expand All @@ -31,7 +31,7 @@ def call(xml_response)
private

def process_xml(xml_body)
# switch this out for the new operation when ready
# TODO: switch this out for the new operation when ready
result = AcaEntities::Serializers::Xml::Fdsh::Vlp::H92::InitialVerificationResponse.parse(xml_body, :single => true)
Success(result)
end
Expand Down Expand Up @@ -136,7 +136,7 @@ def construct_error_response_metadata(error_metadata_array)

# Validate input object
def validate_initial_response(payload)
# switch this out to use the new operation when ready
# TODO: switch this out to use the new operation when ready
result = ::AcaEntities::Fdsh::Vlp::H92::InitialVerificationResponseContract.new.call(payload)

if result.success?
Expand All @@ -147,7 +147,7 @@ def validate_initial_response(payload)
end

def create_primary_response(value)
# switch this out to use the new operation when ready
# TODO: switch this out to use the new operation when ready
Success(::AcaEntities::Fdsh::Vlp::H92::InitialVerificationResponse.new(value.to_h))
end
end
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
module Fdsh
module Vlp
module Rx92
# This class takes a json representing a person as input and invokes RIDP.
# This class takes a json representing a person as input and returns an excoded XML.
class TransformPersonToXmlRequest
include Dry::Monads[:result, :do, :try]
include EventSource::Command
Expand All @@ -14,7 +14,7 @@ def call(params)
json_hash = yield parse_json(params)
person_hash = yield validate_person_json_hash(json_hash)
person = yield build_person(person_hash)
initial_verification_request = yield TransformPersonToInitialRequest.new.call(person)
initial_verification_request = yield Fdsh::Vlp::Rx92::TransformPersonToInitialRequest.new.call(person)
xml_string = yield encode_xml_and_schema_validate(initial_verification_request)
encode_request_xml(xml_string)
end
Expand All @@ -26,7 +26,7 @@ def parse_json(json_string)
JSON.parse(json_string, :symbolize_names => true)
end
parsing_result.or do
Failure(:invalid_json)
Failure("Failed to parse JSON for VLP request due to #{e}")
end
end

Expand Down

0 comments on commit 5af0d8b

Please sign in to comment.