Skip to content

Commit

Permalink
[Automated] Merged master into target k8s
Browse files Browse the repository at this point in the history
  • Loading branch information
va-vsp-bot authored Apr 17, 2024
2 parents b94edf6 + 1d6b924 commit 381d22e
Show file tree
Hide file tree
Showing 17 changed files with 151 additions and 98 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -36,13 +36,21 @@ def zip_code_is_us_based
@data.dig('address', 'country') == 'USA'
end

def submission_date_config
{
should_stamp_date?: true,
page_number: 1,
title_coords: [460, 710],
text_coords: [460, 690]
}
def submission_date_stamps
[
{
coords: [460, 710],
text: 'Application Submitted:',
page: 1,
font_size: 12
},
{
coords: [460, 690],
text: Time.current.in_time_zone('UTC').strftime('%H:%M %Z %D'),
page: 1,
font_size: 12
}
]
end

def track_user_identity(confirmation_number)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,10 +93,8 @@ def desired_stamps
[{ coords:, text: data['statement_of_truth_signature'], page: 4 }]
end

def submission_date_config
{
should_stamp_date?: false
}
def submission_date_stamps
[]
end

def track_user_identity(confirmation_number); end
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,13 +41,21 @@ def desired_stamps
[{ coords: [50, 240], text: data['statement_of_truth_signature'], page: 2 }]
end

def submission_date_config
{
should_stamp_date?: true,
page_number: 1,
title_coords: [460, 710],
text_coords: [460, 690]
}
def submission_date_stamps
[
{
coords: [460, 710],
text: 'Application Submitted:',
page: 1,
font_size: 12
},
{
coords: [460, 690],
text: Time.current.in_time_zone('UTC').strftime('%H:%M %Z %D'),
page: 1,
font_size: 12
}
]
end

def track_user_identity(confirmation_number)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,13 +63,21 @@ def desired_stamps
[{ coords: [50, 415], text: data['statement_of_truth_signature'], page: 1 }]
end

def submission_date_config
{
should_stamp_date?: true,
page_number: 0,
title_coords: [460, 710],
text_coords: [460, 690]
}
def submission_date_stamps
[
{
coords: [460, 710],
text: 'Application Submitted:',
page: 0,
font_size: 12
},
{
coords: [460, 690],
text: Time.current.in_time_zone('UTC').strftime('%H:%M %Z %D'),
page: 0,
font_size: 12
}
]
end

def track_user_identity(confirmation_number)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,21 @@ def desired_stamps
[{ coords: [50, 465], text: data['statement_of_truth_signature'], page: 2 }]
end

def submission_date_config
{
should_stamp_date?: true,
page_number: 1,
title_coords: [440, 690],
text_coords: [440, 670]
}
def submission_date_stamps
[
{
coords: [440, 690],
text: 'Application Submitted:',
page: 1,
font_size: 12
},
{
coords: [440, 670],
text: Time.current.in_time_zone('UTC').strftime('%H:%M %Z %D'),
page: 1,
font_size: 12
}
]
end

def track_user_identity(confirmation_number)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,13 +37,21 @@ def desired_stamps
[{ coords: [50, 160], text: data['statement_of_truth_signature'], page: 2 }]
end

def submission_date_config
{
should_stamp_date?: true,
page_number: 0,
title_coords: [460, 710],
text_coords: [460, 690]
}
def submission_date_stamps
[
{
coords: [460, 710],
text: 'Application Submitted:',
page: 0,
font_size: 12
},
{
coords: [460, 690],
text: Time.current.in_time_zone('UTC').strftime('%H:%M %Z %D'),
page: 0,
font_size: 12
}
]
end

def track_user_identity(confirmation_number)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,13 +36,8 @@ def desired_stamps
[{ coords: [50, 560], text: data['statement_of_truth_signature'], page: 1 }]
end

def submission_date_config
{
should_stamp_date?: true,
page_number: 0,
title_coords: [440, 710],
text_coords: [440, 690]
}
def submission_date_stamps
[submission_date_stamps_first_page, submission_date_stamps_fourth_page].flatten
end

def track_user_identity(confirmation_number)
Expand Down Expand Up @@ -98,5 +93,39 @@ def veteran_email
data.dig('veteran', 'email')&.[](15..)
]
end

def submission_date_stamps_first_page
[
{
coords: [440, 710],
text: 'Application Submitted:',
page: 0,
font_size: 12
},
{
coords: [440, 690],
text: Time.current.in_time_zone('UTC').strftime('%H:%M %Z %D'),
page: 0,
font_size: 12
}
]
end

def submission_date_stamps_fourth_page
[
{
coords: [440, 710],
text: 'Application Submitted:',
page: 3,
font_size: 12
},
{
coords: [440, 690],
text: Time.current.in_time_zone('UTC').strftime('%H:%M %Z %D'),
page: 3,
font_size: 12
}
]
end
end
end
Original file line number Diff line number Diff line change
Expand Up @@ -35,13 +35,21 @@ def desired_stamps
[{ coords: [50, 190], text: data['statement_of_truth_signature'], page: 1 }]
end

def submission_date_config
{
should_stamp_date?: true,
page_number: 1,
title_coords: [460, 710],
text_coords: [460, 690]
}
def submission_date_stamps
[
{
coords: [460, 710],
text: 'Application Submitted:',
page: 1,
font_size: 12
},
{
coords: [460, 690],
text: Time.current.in_time_zone('UTC').strftime('%H:%M %Z %D'),
page: 1,
font_size: 12
}
]
end

def track_user_identity(confirmation_number)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,8 @@ def desired_stamps
end.compact
end

def submission_date_config
{ should_stamp_date?: false }
def submission_date_stamps
[]
end

def track_user_identity(confirmation_number); end
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,8 @@ def words_to_remove
veteran_ssn_and_file_number + veteran_dates_of_birth_and_death + applicant_zip + applicant_phone
end

def submission_date_config
{ should_stamp_date?: false }
def submission_date_stamps
[]
end

def track_user_identity(confirmation_number); end
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -221,8 +221,8 @@ def handle_attachments(file_path)

def track_user_identity(confirmation_number); end

def submission_date_config
{ should_stamp_date?: false }
def submission_date_stamps
[]
end

private
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,8 @@ def handle_attachments(file_path)
file_paths
end

def submission_date_config
{ should_stamp_date?: false }
def submission_date_stamps
[]
end

def track_user_identity(confirmation_number)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,8 @@ def metadata
}
end

def submission_date_config
{
should_stamp_date?: false,
page_number: 1,
title_coords: [440, 690],
text_coords: [440, 670]
}
def submission_date_stamps
[]
end
end
end
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@ def desired_stamps
[{ coords: [26, 82.5], text: data['statement_of_truth_signature'], page: 0 }]
end

def submission_date_config
{ should_stamp_date?: false }
def submission_date_stamps
[]
end

def track_user_identity(confirmation_number); end
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,8 @@ def handle_attachments(file_path)
file_paths
end

def submission_date_config
{ should_stamp_date?: false }
def submission_date_stamps
[]
end

def track_user_identity(confirmation_number); end
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ def self.stamp_pdf(stamped_template_path, form, current_loa)

stamp_auth_text(stamped_template_path, current_loa)

stamp_submission_date(stamped_template_path, form.submission_date_config)
stamp_submission_date(stamped_template_path, form.submission_date_stamps)
end

def self.stamp_signature(stamped_template_path, form)
Expand Down Expand Up @@ -81,11 +81,12 @@ def self.stamp(desired_stamp, stamped_template_path, append_to_stamp: false, tex
coords = desired_stamp[:coords]
text = desired_stamp[:text]
page = desired_stamp[:page]
font_size = desired_stamp[:font_size]
x = coords[0]
y = coords[1]
if page
page_configuration = get_page_configuration(page, coords)
verified_multistamp(stamped_template_path, text, page_configuration)
verified_multistamp(stamped_template_path, text, page_configuration, font_size)
else
datestamp_instance = CentralMail::DatestampPdf.new(current_file_path, append_to_stamp:)
current_file_path = datestamp_instance.run(text:, x:, y:, text_only:, size: 9)
Expand All @@ -104,20 +105,9 @@ def self.perform_multistamp(stamped_template_path, stamp_path)
raise
end

def self.stamp_submission_date(stamped_template_path, config)
if config[:should_stamp_date?]
date_title_stamp_position = config[:title_coords]
date_text_stamp_position = config[:text_coords]
page_configuration = default_page_configuration
page_configuration[config[:page_number]] = { type: :text, position: date_title_stamp_position }

verified_multistamp(stamped_template_path, SUBMISSION_DATE_TITLE, page_configuration, 12)

page_configuration = default_page_configuration
page_configuration[config[:page_number]] = { type: :text, position: date_text_stamp_position }

current_time = Time.current.in_time_zone('UTC').strftime('%H:%M %Z %D')
verified_multistamp(stamped_template_path, current_time, page_configuration, 12)
def self.stamp_submission_date(stamped_template_path, desired_stamps)
desired_stamps.each do |desired_stamp|
stamp(desired_stamp, stamped_template_path)
end
end

Expand All @@ -139,20 +129,12 @@ def self.verified_multistamp(stamped_template_path, stamp_text, page_configurati
verify(stamped_template_path) { multistamp(stamped_template_path, stamp_text, page_configuration, *) }
end

def self.default_page_configuration
[
{ type: :new_page },
{ type: :new_page },
{ type: :new_page },
{ type: :new_page }
]
end

def self.get_page_configuration(page, position)
[
{ type: :new_page },
{ type: :new_page },
{ type: :new_page },
{ type: :new_page },
{ type: :new_page }
].tap do |config|
config[page] = { type: :text, position: }
Expand Down
Loading

0 comments on commit 381d22e

Please sign in to comment.