forked from codeforamerica/vita-min
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconsent_pdf.rb
47 lines (42 loc) · 1.48 KB
/
consent_pdf.rb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
module PdfFiller
class ConsentPdf
include PdfHelper
def source_pdf_name
"2021-GYR-Consent"
end
def output_filename
"F14446 - GYR Consent Form.pdf"
end
def document_type
DocumentTypes::Form14446
end
def initialize(intake)
@intake = intake
end
def hash_for_pdf
return {} unless @intake.primary_consented_to_service_at.present?
data = {
primary_name: @intake.primary.first_and_last_name,
primary_signature: @intake.primary.first_and_last_name,
primary_consented_at: strftime_date(@intake.primary_consented_to_service_at),
primary_consented_ip: @intake.primary_consented_to_service_ip,
primary_dob: strftime_date(@intake.primary.birth_date),
primary_email: @intake.email_address,
primary_phone: @intake.formatted_phone_number,
primary_ssn_last_four: @intake.primary_last_four_ssn,
}
if @intake.spouse_consented_to_service_at.present?
data.merge!(
spouse_name: @intake.spouse.first_and_last_name,
spouse_signature: @intake.spouse.first_and_last_name,
spouse_consented_at: strftime_date(@intake.spouse_consented_to_service_at),
spouse_consented_ip: @intake.spouse_consented_to_service_ip,
spouse_dob: strftime_date(@intake.spouse.birth_date),
spouse_ssn_last_four: @intake.spouse_last_four_ssn,
spouse_email: @intake.spouse_email_address
)
end
data
end
end
end