From 89a429c61c6243c0851c3311950590d7e5a6dd3d Mon Sep 17 00:00:00 2001 From: Andrew Herzberg Date: Fri, 25 Oct 2024 11:52:26 -0700 Subject: [PATCH] mobile efolder fix (#19041) --- .../app/models/mobile/v0/adapters/efolder.rb | 8 +- .../adapters/lighthouse_individual_claims.rb | 6 +- .../app/models/mobile/v0/claim_document.rb | 1 + .../models/mobile/v0/claim_event_timeline.rb | 1 + modules/mobile/docs/index.html | 36 ++++---- modules/mobile/docs/openapi.json | 87 +++++++++++-------- modules/mobile/docs/schemas/Efolder.yml | 64 +++++++------- modules/mobile/docs/schemas/claimDocument.yml | 3 + .../docs/schemas/claimEventTimeline.yml | 7 +- ...ghthouse_individual_claims_adapter_spec.rb | 7 +- .../spec/requests/mobile/v0/efolder_spec.rb | 17 ++-- spec/requests/swagger_spec.rb | 4 +- spec/requests/v0/efolder_spec.rb | 18 +++- spec/support/stub_efolder_documents.rb | 47 ++++++---- 14 files changed, 182 insertions(+), 124 deletions(-) diff --git a/modules/mobile/app/models/mobile/v0/adapters/efolder.rb b/modules/mobile/app/models/mobile/v0/adapters/efolder.rb index 9ab43e943df..375c74e909b 100644 --- a/modules/mobile/app/models/mobile/v0/adapters/efolder.rb +++ b/modules/mobile/app/models/mobile/v0/adapters/efolder.rb @@ -7,10 +7,10 @@ class Efolder def self.parse(documents) documents.map do |document| Mobile::V0::Efolder.new( - id: document['document_id'], - doc_type: document['doc_type'], - type_description: document['type_description'], - received_at: document['received_at'] + id: document[:document_id], + doc_type: document[:doc_type], + type_description: document[:type_description], + received_at: document[:received_at] ) end end diff --git a/modules/mobile/app/models/mobile/v0/adapters/lighthouse_individual_claims.rb b/modules/mobile/app/models/mobile/v0/adapters/lighthouse_individual_claims.rb index 45ca2750fe1..c10a2778381 100644 --- a/modules/mobile/app/models/mobile/v0/adapters/lighthouse_individual_claims.rb +++ b/modules/mobile/app/models/mobile/v0/adapters/lighthouse_individual_claims.rb @@ -135,7 +135,8 @@ def create_events_for_documents(attributes) tracked_item_id: document['trackedItemId'], upload_date: document['uploadDate'], file_type: document['documentTypeLabel'], - filename: document['originalFileName'] + filename: document['originalFileName'], + document_id: document['documentId'] ) end end @@ -173,7 +174,8 @@ def create_documents(documents) # no document type field available document_type: nil, filename: document['originalFileName'], - upload_date: document['uploadDate'] + upload_date: document['uploadDate'], + document_id: document['documentId'] } ClaimDocument.new(document_hash) end diff --git a/modules/mobile/app/models/mobile/v0/claim_document.rb b/modules/mobile/app/models/mobile/v0/claim_document.rb index 62dd677ae78..c5650b9e677 100644 --- a/modules/mobile/app/models/mobile/v0/claim_document.rb +++ b/modules/mobile/app/models/mobile/v0/claim_document.rb @@ -10,6 +10,7 @@ class ClaimDocument < Common::Resource attribute :document_type, Types::Nil attribute :filename, Types::String attribute :upload_date, Types::Date + attribute :document_id, Types::String end end end diff --git a/modules/mobile/app/models/mobile/v0/claim_event_timeline.rb b/modules/mobile/app/models/mobile/v0/claim_event_timeline.rb index 278cba8018d..0fdb63aa897 100644 --- a/modules/mobile/app/models/mobile/v0/claim_event_timeline.rb +++ b/modules/mobile/app/models/mobile/v0/claim_event_timeline.rb @@ -24,6 +24,7 @@ class ClaimEventTimeline < Common::Resource attribute :file_type, Types::String.optional.default(nil) attribute :document_type, Types::String.optional.default(nil) attribute :filename, Types::String.optional.default(nil) + attribute :document_id, Types::String.optional.default(nil) end end end diff --git a/modules/mobile/docs/index.html b/modules/mobile/docs/index.html index a005c77e4a4..21b961a325f 100755 --- a/modules/mobile/docs/index.html +++ b/modules/mobile/docs/index.html @@ -12,7 +12,7 @@ margin: 0; } -