Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[CST] [DDL] [Backend] Updated the doctypes for 5103 notices in the DDL #15820

Merged
merged 1 commit into from
Mar 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions app/controllers/v0/claim_letters_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,9 @@ def service
def allowed_doctypes
doctypes = %w[184]
doctypes << '27' if Flipper.enabled?(:cst_include_ddl_boa_letters, @current_user)
doctypes << '65' if Flipper.enabled?(:cst_include_ddl_5103_letters, @current_user)
doctypes << '68' if Flipper.enabled?(:cst_include_ddl_5103_letters, @current_user)
doctypes << '704' if Flipper.enabled?(:cst_include_ddl_5103_letters, @current_user)
Copy link
Contributor

@pmclaren19 pmclaren19 Mar 7, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Im confused on why we are removing 65 and 68 and adding 704, 706, 858. If you could add some information about this to your ticket that'd be really helpful! I took a look at the link you provided here and it looks to me like we should be adding 704, 705 , 706 and 707 so im very confused. Thanks!

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Talked to @jacobworrell in parking lot

  • letter id 704 correlates to 65 and we were just referencing the wrong id#. It is for Standard 5103 Notice
  • letter id 706 correlates to 68 and we were just referencing the wrong id#. It is for 5103/ DTA letter
  • letter id 858 needed to be added and is for Custom 5103 Notice

doctypes << '706' if Flipper.enabled?(:cst_include_ddl_5103_letters, @current_user)
doctypes << '858' if Flipper.enabled?(:cst_include_ddl_5103_letters, @current_user)
doctypes
end
end
Expand Down
23 changes: 19 additions & 4 deletions lib/claim_letters/claim_letter_test_data.rb
Original file line number Diff line number Diff line change
Expand Up @@ -146,8 +146,8 @@ module ClaimLetterTestData
series_id: '{350C072A-90A1-43A7-AD50-A5C9C54C357D}',
version: '1',
type_description: 'Standard 5103 Notice',
type_id: '65',
doc_type: '65',
type_id: '704',
doc_type: '704',
subject: nil,
received_at: Date.new(2022,8,22),
source: 'VBMS',
Expand All @@ -161,15 +161,30 @@ module ClaimLetterTestData
series_id: '{350C072A-90A1-43A7-AD50-A5C9C54C357E}',
version: '1',
type_description: '5103/DTA Letter',
type_id: '68',
doc_type: '68',
type_id: '706',
doc_type: '706',
subject: nil,
received_at: Date.new(2023,1,22),
source: 'VBMS',
mime_type: 'application/pdf',
alt_doc_types: '',
restricted: false,
upload_date: Date.new(2023,1,23)
),
OpenStruct.new(
document_id: '{27832B64-2D88-4DEE-9F6F-DF80E4CAAA92}',
series_id: '{350C072A-90A1-43A7-AD50-A5C9C54C357F}',
version: '1',
type_description: 'Custom 5103 Notice',
type_id: '858',
doc_type: '858',
subject: nil,
received_at: Date.new(2023,1,24),
source: 'VBMS',
mime_type: 'application/pdf',
alt_doc_types: '',
restricted: false,
upload_date: Date.new(2023,1,24)
)
].freeze
end
4 changes: 2 additions & 2 deletions spec/controllers/v0/claim_letters_controller_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
it 'lists correct documents' do
get(:index)
letters = JSON.parse(response.body)
allowed_letters = letters.select { |d| d['doc_type'] == '27' || d['doc_type'] == '184' }
allowed_letters = letters.select { |d| %w[27 184].include?(d['doc_type']) }

expect(allowed_letters.length).to eql(letters.length)
end
Expand All @@ -49,7 +49,7 @@
it 'lists correct documents' do
get(:index)
letters = JSON.parse(response.body)
allowed_letters = letters.select { |d| d['doc_type'] == '65' || d['doc_type'] == '68' || d['doc_type'] == '184' }
allowed_letters = letters.select { |d| %w[704 706 858 184].include?(d['doc_type']) }

expect(allowed_letters.length).to eql(letters.length)
end
Expand Down
Loading