1+ <?php
2+
3+ namespace App \DTOs ;
4+
5+ class EnrollmentFormDTO
6+ {
7+ public function __construct (
8+ // Meta (not PDF fields, used for file generation)
9+ public readonly int $ id ,
10+ public readonly string $ first_name ,
11+ public readonly string $ last_name ,
12+
13+ // Page 1
14+ public readonly string $ title_region ,
15+ public readonly string $ full_name ,
16+ public readonly string $ entered_date ,
17+ public readonly string $ address ,
18+ public readonly string $ employer ,
19+ public readonly string $ tshirt_size , // matches PDF field name exactly
20+ public readonly string $ phone ,
21+ public readonly string $ work_phone ,
22+ public readonly string $ other_phone ,
23+ public readonly string $ email ,
24+ public readonly string $ case_worker_name ,
25+ public readonly string $ case_worker_phone ,
26+ public readonly string $ monthly_child_support ,
27+ public readonly string $ marital_status ,
28+ public readonly string $ ethnicity ,
29+ public readonly string $ contact_with_children ,
30+ public readonly string $ children_custody ,
31+ public readonly string $ children_visitation ,
32+ public readonly string $ children_phone ,
33+
34+ /** @var ChildDTO[] */
35+ public readonly array $ children ,
36+ public readonly DisclosureDTO $ disclosure ,
37+ public readonly AssessmentDTO $ assessment ,
38+ public readonly SurveyDTO $ survey ,
39+ public readonly ServicePlanDTO $ servicePlan ,
40+ ) {}
41+
42+ /**
43+ * Flattens all nested DTOs into a key => value array for pdftk.
44+ * Keys match PDF field names exactly from getDataFields() output.
45+ */
46+ public function toPdfArray (): array
47+ {
48+ return [
49+ // Page 1 - Enrollment
50+ 'title_region ' => $ this ->title_region ,
51+ 'full_name ' => $ this ->full_name ,
52+ 'entered_date ' => $ this ->entered_date ,
53+ 'address ' => $ this ->address ,
54+ 'employer ' => $ this ->employer ,
55+ 'tshirt_size ' => $ this ->tshirt_size ,
56+ 'phone ' => $ this ->phone ,
57+ 'work_phone ' => $ this ->work_phone ,
58+ 'other_phone ' => $ this ->other_phone ,
59+ 'email ' => $ this ->email ,
60+ 'case_worker_name ' => $ this ->case_worker_name ,
61+ 'case_worker_phone ' => $ this ->case_worker_phone ,
62+ 'monthly_child_support ' => $ this ->monthly_child_support ,
63+ 'marital_status ' => $ this ->marital_status ,
64+ 'ethnicity ' => $ this ->ethnicity ,
65+ 'contact_with_children ' => $ this ->contact_with_children ,
66+ 'children_custody ' => $ this ->children_custody ,
67+ 'children_visitation ' => $ this ->children_visitation ,
68+ 'children_phone ' => $ this ->children_phone ,
69+
70+ // Children
71+ 'child_name_1 ' => $ this ->children [0 ]->name ?? '' ,
72+ 'child_age_1 ' => $ this ->children [0 ]->age ?? '' ,
73+ 'child_dob_1 ' => $ this ->children [0 ]->dob ?? '' ,
74+ 'child_name_2 ' => $ this ->children [1 ]->name ?? '' ,
75+ 'child_age_2 ' => $ this ->children [1 ]->age ?? '' ,
76+ 'child_dob_2 ' => $ this ->children [1 ]->dob ?? '' ,
77+ 'child_name_3 ' => $ this ->children [2 ]->name ?? '' ,
78+ 'child_age_3 ' => $ this ->children [2 ]->age ?? '' ,
79+ 'child_dob_3 ' => $ this ->children [2 ]->dob ?? '' ,
80+ 'child_name_4 ' => $ this ->children [3 ]->name ?? '' ,
81+ 'child_age_4 ' => $ this ->children [3 ]->age ?? '' ,
82+ 'child_dob_4 ' => $ this ->children [3 ]->dob ?? '' ,
83+ 'child_name_5 ' => $ this ->children [4 ]->name ?? '' ,
84+ 'child_age_5 ' => $ this ->children [4 ]->age ?? '' ,
85+ 'child_dob_5 ' => $ this ->children [4 ]->dob ?? '' ,
86+
87+ // Page 2 - Disclosure
88+ 'authorize_full_name ' => $ this ->full_name ,
89+ 'authorize_dys ' => $ this ->disclosure ->authorize_dys ,
90+ 'authorize_mhd ' => $ this ->disclosure ->authorize_mhd ,
91+ 'authorize_dfas ' => $ this ->disclosure ->authorize_dfas ,
92+ 'authorize_mmac ' => $ this ->disclosure ->authorize_mmac ,
93+ 'authorize_other ' => $ this ->disclosure ->authorize_other ,
94+ 'authorize_discloser_form_other ' => $ this ->disclosure ->authorize_discloser_form_other ?? '' ,
95+ 'authorize_cd ' => $ this ->disclosure ->authorize_cd ,
96+ 'authorize_dls ' => $ this ->disclosure ->authorize_dls ,
97+ 'disclose_full_name ' => $ this ->disclosure ->full_name ,
98+ 'disclose_phone ' => $ this ->disclosure ->phone ,
99+ 'disclose_dob ' => $ this ->disclosure ->dob ,
100+ ### Removed - we should not collect this information
101+ // 'disclose_ssn' => $this->disclosure->ssn ?? '',
102+ 'disclose_address ' => $ this ->disclosure ->address ,
103+ 'disclose_email ' => $ this ->disclosure ->email ,
104+ // 'select_disclose_to_attorney' => $this->disclosure->select_disclose_to_attorney,
105+ 'disclose_to_attorney ' => $ this ->disclosure ->disclose_to_attorney ,
106+ 'disclose_to_legislator ' => $ this ->disclosure ->disclose_to_legislator ,
107+ 'disclose_to_employer ' => $ this ->disclosure ->disclose_to_employer ,
108+ 'disclose_to_governors_staff ' => $ this ->disclosure ->disclose_to_governors_staff ,
109+ ## Removed - pre-filled
110+ // 'other_discloser' => $this->disclosure->other_discloser,
111+ ## Removed - pre-filled
112+ // 'disclosure_purpose_eligibility_determination' => $this->disclosure->purpose_eligibility_determination,
113+ ## Removed - pre-filled
114+ // 'disclosure_purpose_employment' => $this->disclosure->purpose_employment,
115+ 'disclosure_purpose_continuity_of_services_care ' => $ this ->disclosure ->purpose_continuity_of_services_care ,
116+ 'disclosure_purpose_legal_consultation_representation ' => $ this ->disclosure ->purpose_legal_consultation_representation ,
117+ 'disclosure_purpose_complaint_investigation_resolution ' => $ this ->disclosure ->purpose_complaint_investigation_resolution ,
118+ 'disclosure_purpose_background_investigation ' => $ this ->disclosure ->purpose_background_investigation ,
119+ 'disclosure_purpose_legal_proceedings ' => $ this ->disclosure ->purpose_legal_proceedings ,
120+ 'disclosure_purpose_treatment_planning ' => $ this ->disclosure ->purpose_treatment_planning ,
121+ 'disclosure_purpose_at_consumers_request ' => $ this ->disclosure ->purpose_at_consumers_request ,
122+ 'disclosure_purpose_to_share_or_refer ' => $ this ->disclosure ->purpose_to_share_or_refer ,
123+ ## Removed - pre-filled
124+ // 'disclosure_purpose_other' => $this->disclosure->purpose_other,
125+ 'disclosure_licensure_information ' => $ this ->disclosure ->licensure_information ,
126+ 'disclosure_medical ' => $ this ->disclosure ->disclosure_medical ,
127+ 'disclose_hotline_investigations ' => $ this ->disclosure ->hotline_investigations ,
128+ 'disclosure_home_studies ' => $ this ->disclosure ->home_studies ,
129+ 'disclosure_eligibility_determinations ' => $ this ->disclosure ->eligibility_determinations ,
130+ 'disclosure_substance_abuse_treatment ' => $ this ->disclosure ->substance_abuse_treatment ,
131+ 'disclosure_client_employment_records ' => $ this ->disclosure ->client_employment_records ,
132+
133+ // Page 3
134+ 'accept_text_messages ' => $ this ->disclosure ->accept_text_messages ,
135+
136+ // Page 4 - Assessment
137+ 'participant_full_name ' => $ this ->assessment ->full_name ,
138+ 'participant_dob ' => $ this ->assessment ->dob ,
139+ ## Removed - we should not collect this information
140+ // 'participant_ssn' => $this->assessment->ssn ?? '',
141+ 'eligibility_missouri_resident ' => $ this ->assessment ->eligibility_missouri_resident ,
142+ 'eligibility_child_under_18 ' => $ this ->assessment ->eligibility_child_under_18 ,
143+ 'financial_assessment_eligibility ' => $ this ->assessment ->financial_eligibility ,
144+ 'financial_assessment_drivers_licence ' => $ this ->assessment ->financial_drivers_licence ,
145+ 'financial_assessment_utility_bill ' => $ this ->assessment ->financial_utility_bill ,
146+ 'financial_assessment_written_employer_statement ' => $ this ->assessment ->financial_written_employer_statement ,
147+ 'financial_assessment_ss_benefits_statement ' => $ this ->assessment ->financial_ss_benefits_statement ,
148+ 'financial_assessment_no_employment_income ' => $ this ->assessment ->financial_no_employment_income ,
149+ 'financial_assessment_unemployment_compensation ' => $ this ->assessment ->financial_unemployment_compensation ,
150+ 'financial_assessment_other ' => $ this ->assessment ->financial_other ,
151+ 'financial_assessment_other_description ' => $ this ->assessment ->financial_other_description ?? '' ,
152+ 'poverty_level_monthly_income ' => $ this ->assessment ->poverty_monthly_income ,
153+ 'poverty_level_number_of_household_members ' => $ this ->assessment ->poverty_household_members ,
154+ 'poverty_level_percentage_fpl ' => $ this ->assessment ->poverty_percentage_fpl ,
155+
156+ // Page 5 - Survey
157+ 'survey_client_dob ' => $ this ->survey ->client_dob ,
158+ 'survey_delivery_method ' => $ this ->survey ->delivery_method ,
159+ 'survey_why ' => $ this ->survey ->why ,
160+ 'survey_other_description ' => $ this ->survey ->why_other ,
161+ 'survey_how ' => $ this ->survey ->how ,
162+ 'survey_how_other_description ' => $ this ->survey ->how_other ,
163+ 'survey_gain ' => $ this ->survey ->gain ,
164+ 'survey_gain_other_description ' => $ this ->survey ->gain_other ,
165+
166+ // Page 6 - Service Plan
167+ 'service_plan_participant_full_name ' => $ this ->servicePlan ->participant_full_name ,
168+ 'service_plan_client_number ' => $ this ->servicePlan ->client_number ,
169+ 'service_plan_goal ' => $ this ->servicePlan ->goal ,
170+ 'service_plan_service_identified ' => $ this ->servicePlan ->service_identified ,
171+ 'service_plan_strategies_1 ' => $ this ->servicePlan ->strategies_1 ,
172+ 'service_plan_person_responsible_1 ' => $ this ->servicePlan ->person_responsible_1 ,
173+ 'service_plan_timeline_1 ' => $ this ->servicePlan ->timeline_1 ,
174+ 'service_plan_measure_of_success_1 ' => $ this ->servicePlan ->measure_of_success_1 ,
175+ 'service_plan_strategies_2 ' => $ this ->servicePlan ->strategies_2 ,
176+ 'service_plan_person_responsible_2 ' => $ this ->servicePlan ->person_responsible_2 ,
177+ 'service_plan_timeline_2 ' => $ this ->servicePlan ->timeline_2 ,
178+ 'service_plan_measure_of_success_2 ' => $ this ->servicePlan ->measure_of_success_2 ,
179+ 'service_plan_strategies_3 ' => $ this ->servicePlan ->strategies_3 ,
180+ 'service_plan_person_responsible_3 ' => $ this ->servicePlan ->person_responsible_3 ,
181+ 'service_plan_timeline_3 ' => $ this ->servicePlan ->timeline_3 ,
182+ 'service_plan_measure_of_success_3 ' => $ this ->servicePlan ->measure_of_success_3 ,
183+ ];
184+ }
185+ }
186+ ?>
0 commit comments