Code Coverage
 
Lines
Functions and Methods
Classes and Traits
Total
0.00% covered (danger)
0.00%
0 / 494
0.00% covered (danger)
0.00%
0 / 2
CRAP
0.00% covered (danger)
0.00%
0 / 1
UserDetailsResource
0.00% covered (danger)
0.00%
0 / 494
0.00% covered (danger)
0.00%
0 / 2
182
0.00% covered (danger)
0.00%
0 / 1
 toArray
0.00% covered (danger)
0.00%
0 / 481
0.00% covered (danger)
0.00%
0 / 1
20
 formatDate
0.00% covered (danger)
0.00%
0 / 13
0.00% covered (danger)
0.00%
0 / 1
90
1<?php
2
3namespace App\Http\Resources;
4
5use Illuminate\Http\Request;
6use Illuminate\Http\Resources\Json\JsonResource;
7use Illuminate\Support\Carbon;
8
9class UserDetailsResource extends JsonResource
10{
11    /**
12     * Transform the resource into an array.
13     *
14     * @return array<string, mixed>
15     */
16    public function toArray(Request $request): array
17    {
18        return [
19            'first_name' => $this->first_name,
20            'last_name' => $this->last_name,
21            'full_name' => $this->full_name,
22            'email' => $this->email,
23            'email_verified_at' => $this->formatDate($this->email_verified_at),
24            'job_role' => $this->job_role,
25            'department' => $this->department,
26            'job_title' => $this->job_title,
27            'company' => $this->company,
28            'phone' => $this->phone,
29            'account_creation_date' => $this->formatDate($this->account_creation_date),
30            'linkedin_url' => $this->linkedin_url,
31            'user_type' => is_array($this->user_type) ? $this->user_type : explode(',', (string) $this->user_type),
32            'user_id' => $this->user_id,
33            'typed_words_per_minute' => $this->typed_words_per_minute,
34            'wage_per_hour' => $this->wage_per_hour,
35            'email_used_for_login' => $this->email_used_for_login,
36            'signin_source' => $this->signin_source,
37            'signup_source' => $this->signup_source,
38            'last_login' => $this->formatDate($this->last_login),
39            'last_login_fly_learning' => $this->formatDate($this->last_login_fly_learning),
40            'status' => $this->status,
41            'status_date' => $this->formatDate($this->status_date),
42            'user_created_at' => $this->formatDate($this->user_created_at),
43            'user_updated_at' => $this->formatDate($this->user_updated_at),
44            'company_id' => $this->company_id,
45            'company_name' => $this->company_name,
46            'avatar' => $this->avatar,
47            'hubspot_id' => $this->hubspot_id,
48            'stripe_id' => $this->stripe_id,
49            'instancy_id' => $this->instancy_id,
50            'group_id' => $this->group_id,
51            'group_name' => $this->group_name,
52            'subgroup_id' => $this->subgroup_id,
53            'subgroup_name' => $this->subgroup_name,
54            'is_beta' => $this->is_beta ?? false,
55            'developer_mode' => $this->developer_mode ?? false,
56            // 'role_ids' => $this->role_ids,
57            'role_names' => is_array($this->role_names) ? $this->role_names : explode(',', (string) $this->role_names),
58            'is_invite' => $this->is_invite,
59            // 'email_domain' => $this->email_domain,
60            // 'email_domain_count' => $this->email_domain_count,
61            'is_any_extension_installed' => $this->is_any_extension_installed,
62            'is_any_extension_uninstalled' => $this->is_any_extension_uninstalled,
63            'signed_into_flymsg_extension' => $this->signed_into_flymsg_extension,
64            'which_browser_has_an_extension_been_installed_on' => is_array($this->which_browser_has_an_extension_been_installed_on) ? $this->which_browser_has_an_extension_been_installed_on : explode(';', (string) $this->which_browser_has_an_extension_been_installed_on),
65            'last_browser_used' => $this->last_browser_used,
66            'total_time_saved_by_flymsg_by_user' => $this->total_time_saved_by_flymsg_by_user,
67            'total_time_saved_summarized_monthly_by_flymsg_by_user' => $this->total_time_saved_summarized_monthly_by_flymsg_by_user,
68            'total_cost_savings_by_flymsg_by_user' => $this->total_cost_savings_by_flymsg_by_user,
69            'total_cost_savings_summarized_monthly_by_flymsg_by_user' => $this->total_cost_savings_summarized_monthly_by_flymsg_by_user,
70            'total___of_characters_typed_by_flymsg_by_user' => $this->total___of_characters_typed_by_flymsg_by_user,
71            'total___of_characters_typed_monthly_by_flymsg_by_user' => $this->total___of_characters_typed_monthly_by_flymsg_by_user,
72            'last_date_user_used_a_flycut' => $this->formatDate($this->last_date_user_used_a_flycut),
73            'number_of_categories_created_last_date' => $this->formatDate($this->number_of_categories_created_last_date),
74            'number_of_categories_created_count' => $this->number_of_categories_created_count,
75            'number_of_flycuts_created_last_date' => $this->formatDate($this->number_of_flycuts_created_last_date),
76            'number_of_flycuts_created_count' => $this->number_of_flycuts_created_count,
77            'number_of_flyplates_in_flycuts_last_date' => $this->formatDate($this->number_of_flyplates_in_flycuts_last_date),
78            'number_of_flyplates_in_flycuts_count' => $this->number_of_flyplates_in_flycuts_count,
79            'clicked_help_last_date' => $this->formatDate($this->clicked_help_last_date),
80            'clicked_help_count' => $this->clicked_help_count,
81            'clicked_settings_last_date' => $this->formatDate($this->clicked_settings_last_date),
82            'clicked_settings_count' => $this->clicked_settings_count,
83            'clicked_download_extension_last_date' => $this->formatDate($this->clicked_download_extension_last_date),
84            'clicked_download_extension_count' => $this->clicked_download_extension_count,
85            'clicked_contact_sales_last_date' => $this->formatDate($this->clicked_contact_sales_last_date),
86            'clicked_contact_sales_count' => $this->clicked_contact_sales_count,
87            'df_stripe_customer_id' => $this->df_stripe_customer_id,
88            'subscription_owner' => $this->subscription_owner,
89            'billing_address_line_1' => $this->billing_address_line_1,
90            'billing_address_line_2' => $this->billing_address_line_2,
91            'billing_city' => $this->billing_city,
92            'billing_state' => $this->billing_state,
93            'billing_zip' => $this->billing_zip,
94            'billing_country' => $this->billing_country,
95            'number_of_completed_payments' => $this->number_of_completed_payments,
96            'number_of_expected_payments' => $this->number_of_expected_payments,
97            'payment_method' => $this->payment_method,
98            'flymsg_last_product_purchased' => $this->flymsg_last_product_purchased,
99            'last_total_invoice_amount' => $this->last_total_invoice_amount,
100            'flymsg_total_sales' => $this->flymsg_total_sales,
101            'coupon_name' => $this->coupon_name,
102            'coupon_code' => $this->coupon_code,
103            'coupon_type' => $this->coupon_type,
104            'duration' => $this->duration,
105            'coupon_value__discount_' => $this->coupon_value__discount_,
106            'coupon_redemption_limits' => $this->coupon_redemption_limits,
107            'productivity_problems' => $this->productivity_problems,
108            'type_here_how_flymsg_will_help_you___' => $this->type_here_how_flymsg_will_help_you___,
109            'flymsg_use_case' => $this->flymsg_use_case,
110            'sign_out_reason' => $this->sign_out_reason,
111            'sign_out_text' => $this->sign_out_text,
112            'subscription_type' => $this->subscription_type,
113            'plan_id' => $this->plan_id,
114            'plan_name' => $this->plan_name,
115            'is_chrome_extension_installed' => $this->is_chrome_extension_installed,
116            'is_chrome_extension_uninstalled' => $this->is_chrome_extension_uninstalled,
117            'flymsg_chrome_extension_installed__date_' => $this->formatDate($this->flymsg_chrome_extension_installed__date_),
118            'flymsg_chrome_extension_uninstalled__date_' => $this->formatDate($this->flymsg_chrome_extension_uninstalled__date_),
119            'flymsg_extension_version_for_chrome' => $this->flymsg_extension_version_for_chrome,
120            'is_edge_extension_installed' => $this->is_edge_extension_installed,
121            'is_edge_extension_uninstalled' => $this->is_edge_extension_uninstalled,
122            'flymsg_edge_extension_installed__date_' => $this->formatDate($this->flymsg_edge_extension_installed__date_),
123            'flymsg_edge_extension_uninstalled__date_' => $this->formatDate($this->flymsg_edge_extension_uninstalled__date_),
124            'flymsg_extension_version_for_edge' => $this->flymsg_extension_version_for_edge,
125            'flymsg_freemium_subscription_status' => $this->flymsg_freemium_subscription_status,
126            'freemium_subscription_start_date' => $this->formatDate($this->freemium_subscription_start_date),
127            'freemium_subscription_status_updated_on' => $this->formatDate($this->freemium_subscription_status_updated_on),
128            'freemium_subscription_churn_date' => $this->formatDate($this->freemium_subscription_churn_date),
129            'freemium_cancel_subscription_date' => $this->formatDate($this->freemium_cancel_subscription_date),
130            'starter_payment_status' => $this->starter_payment_status,
131            'flymsg_starter_subscription_status' => $this->flymsg_starter_subscription_status,
132            'starter_subscription_status_updated_on' => $this->formatDate($this->starter_subscription_status_updated_on),
133            'starter_subscription_start_date' => $this->formatDate($this->starter_subscription_start_date),
134            'flymsg_starter_subscription_frequency' => $this->flymsg_starter_subscription_frequency,
135            'starter_subscription_expiration_date' => $this->formatDate($this->starter_subscription_expiration_date),
136            'starter_cancel_subscription_date' => $this->formatDate($this->starter_cancel_subscription_date),
137            'starter_subscription_churn_date' => $this->formatDate($this->starter_subscription_churn_date),
138            'flymsg_starter_subscription_monthly_recurring_revenue' => $this->flymsg_starter_subscription_monthly_recurring_revenue,
139            'flymsg_starter_subscription_annual_recurring_revenue' => $this->flymsg_starter_subscription_annual_recurring_revenue,
140            'growth_payment_status' => $this->growth_payment_status,
141            'flymsg_growth_subscription_status' => $this->flymsg_growth_subscription_status,
142            'growth_subscription_status_updated_on' => $this->formatDate($this->growth_subscription_status_updated_on),
143            'growth_subscription_start_date' => $this->formatDate($this->growth_subscription_start_date),
144            'flymsg_growth_subscription_frequency' => $this->flymsg_growth_subscription_frequency,
145            'growth_subscription_expiration_date' => $this->formatDate($this->growth_subscription_expiration_date),
146            'growth_cancel_subscription_date' => $this->formatDate($this->growth_cancel_subscription_date),
147            'growth_subscription_churn_date' => $this->formatDate($this->growth_subscription_churn_date),
148            'flymsg_growth_subscription_monthly_recurring_revenue' => $this->flymsg_growth_subscription_monthly_recurring_revenue,
149            'growth_subscription_annual_recurring_revenue' => $this->growth_subscription_annual_recurring_revenue,
150            'professional_payment_status' => $this->professional_payment_status,
151            'professional_subscription_status' => $this->professional_subscription_status,
152            'trail_period_start_date' => $this->formatDate($this->trail_period_start_date),
153            'trail_period_end_date' => $this->formatDate($this->trail_period_end_date),
154            'trail_period_canceled_date' => $this->formatDate($this->trail_period_canceled_date),
155            'professional_subscription_status_updated_on' => $this->formatDate($this->professional_subscription_status_updated_on),
156            'professional_subscription_start_date' => $this->formatDate($this->professional_subscription_start_date),
157            'professional_subscription_frequency' => $this->professional_subscription_frequency,
158            'professional_subscription_expiration_date' => $this->formatDate($this->professional_subscription_expiration_date),
159            'professional_cancel_subscription_date' => $this->formatDate($this->professional_cancel_subscription_date),
160            'professional_subscription_churn_date' => $this->formatDate($this->professional_subscription_churn_date),
161            'professional_subscription_monthly_recurring_revenue' => $this->professional_subscription_monthly_recurring_revenue,
162            'professional_subscription_annual_recurring_revenue' => $this->professional_subscription_annual_recurring_revenue,
163            'sales_pro_teams_subscription_status' => $this->sales_pro_teams_subscription_status,
164            'sales_pro_teams_subscription_status_updated_on' => $this->formatDate($this->formatDate($this->sales_pro_teams_subscription_status_updated_on)),
165            'sales_pro_teams_subscription_start_date' => $this->formatDate($this->sales_pro_teams_subscription_start_date),
166            'sales_pro_teams_subscription_frequency' => $this->sales_pro_teams_subscription_frequency,
167            'sales_pro_teams_subscription_expiration_date' => $this->formatDate($this->sales_pro_teams_subscription_expiration_date),
168            'sales_pro_teams_cancel_subscription_date' => $this->formatDate($this->sales_pro_teams_cancel_subscription_date),
169            'sales_pro_teams_subscription_churn_date' => $this->formatDate($this->sales_pro_teams_subscription_churn_date),
170            'sales_pro_teams_subscription_plan_type' => $this->sales_pro_teams_subscription_plan_type,
171            'sales_pro_teams_user_type' => $this->sales_pro_teams_user_type,
172            'deleted_at' => $this->formatDate($this->deleted_at),
173            'created_at' => $this->formatDate($this->created_at),
174            'updated_at' => $this->formatDate($this->updated_at),
175            'total___of_times_flygrammar_is_used_summarized_monthly_by_user__count_' => $this->total___of_times_flygrammar_is_used_summarized_monthly_by_user__count_,
176            'total___of_times_flygrammar_used__count_' => $this->total___of_times_flygrammar_used__count_,
177            'last_date_user_used_flygrammar' => $this->formatDate($this->last_date_user_used_flygrammar),
178            'total___of_times_flyposts_is_used_summarized_monthly_by_user__count_' => $this->total___of_times_flyposts_is_used_summarized_monthly_by_user__count_,
179            'last_date_user_used_flyposts' => $this->formatDate($this->last_date_user_used_flyposts),
180            'total___of_times_flyposts_used__count_' => $this->total___of_times_flyposts_used__count_,
181            'total___of_times_flyengage_is_used_summarized_monthly_by_user' => $this->total___of_times_flyengage_is_used_summarized_monthly_by_user,
182            'last_date_user_used_flyengage' => $this->formatDate($this->last_date_user_used_flyengage),
183            'total___of_times_flyengage_used__count_' => $this->total___of_times_flyengage_used__count_,
184            'total___of_times_sentence_rewrite_is_used_summarized_monthly_by_user' => $this->total___of_times_sentence_rewrite_is_used_summarized_monthly_by_user,
185            'last_date_user_used_sentence_rewrite' => $this->formatDate($this->last_date_user_used_sentence_rewrite),
186            'total___of_times_sentence_rewrite_used__count_' => $this->total___of_times_sentence_rewrite_used__count_,
187            'total___of_times_paragraph_rewrite_is_used_summarized_monthly_by_user' => $this->total___of_times_paragraph_rewrite_is_used_summarized_monthly_by_user,
188            'last_date_user_used_paragraph_rewrite' => $this->formatDate($this->last_date_user_used_paragraph_rewrite),
189            'total___of_times_paragraph_rewrite_used__count_' => $this->total___of_times_paragraph_rewrite_used__count_,
190
191            'total___of_times_flycut_used__count_' => $this->total___of_times_flycut_used__count_,
192
193            'summary_2022' => [
194                'january' => [
195                    'total_time_saved' => $this->total_time_saved___january_2022,
196                    'total_cost_savings' => $this->total_cost_savings___january_2022,
197                    'of_characters_typed' => $this->of_characters_typed___january_2022,
198                ],
199                'february' => [
200                    'total_time_saved' => $this->total_time_saved___february_2022,
201                    'total_cost_savings' => $this->total_cost_savings___february_2022,
202                    'of_characters_typed' => $this->of_characters_typed___february_2022,
203                ],
204                'march' => [
205                    'total_time_saved' => $this->total_time_saved___march_2022,
206                    'total_cost_savings' => $this->total_cost_savings___march_2022,
207                    'of_characters_typed' => $this->of_characters_typed___march_2022,
208                ],
209                'april' => [
210                    'total_time_saved' => $this->total_time_saved___april_2022,
211                    'total_cost_savings' => $this->total_cost_savings___april_2022,
212                    'of_characters_typed' => $this->of_characters_typed___april_2022,
213                ],
214                'may' => [
215                    'total_time_saved' => $this->total_time_saved___may_2022,
216                    'total_cost_savings' => $this->total_cost_savings___may_2022,
217                    'of_characters_typed' => $this->of_characters_typed___may_2022,
218                ],
219                'june' => [
220                    'total_time_saved' => $this->total_time_saved___june_2022,
221                    'total_cost_savings' => $this->total_cost_savings___june_2022,
222                    'of_characters_typed' => $this->of_characters_typed___june_2022,
223                ],
224                'july' => [
225                    'total_time_saved' => $this->total_time_saved___july_2022,
226                    'total_cost_savings' => $this->total_cost_savings___july_2022,
227                    'of_characters_typed' => $this->of_characters_typed___july_2022,
228                ],
229                'august' => [
230                    'total_time_saved' => $this->total_time_saved___august_2022,
231                    'total_cost_savings' => $this->total_cost_savings___august_2022,
232                    'of_characters_typed' => $this->of_characters_typed___august_2022,
233                ],
234                'september' => [
235                    'total_time_saved' => $this->total_time_saved___september_2022,
236                    'total_cost_savings' => $this->total_cost_savings___september_2022,
237                    'of_characters_typed' => $this->of_characters_typed___september_2022,
238                ],
239                'october' => [
240                    'total_time_saved' => $this->total_time_saved___october_2022,
241                    'total_cost_savings' => $this->total_cost_savings___october_2022,
242                    'of_characters_typed' => $this->of_characters_typed___october_2022,
243                ],
244                'november' => [
245                    'total_time_saved' => $this->total_time_saved___november_2022,
246                    'total_cost_savings' => $this->total_cost_savings___november_2022,
247                    'of_characters_typed' => $this->of_characters_typed___november_2022,
248                ],
249                'december' => [
250                    'total_time_saved' => $this->total_time_saved___december_2022,
251                    'total_cost_savings' => $this->total_cost_savings___december_2022,
252                    'of_characters_typed' => $this->of_characters_typed___december_2022,
253                ],
254            ],
255            'summary_2023' => [
256                'january' => [
257                    'total_time_saved' => $this->total_time_saved___january_2023,
258                    'total_cost_savings' => $this->total_cost_savings___january_2023,
259                    'of_characters_typed' => $this->of_characters_typed___january_2023,
260                ],
261                'february' => [
262                    'total_time_saved' => $this->total_time_saved___february_2023,
263                    'total_cost_savings' => $this->total_cost_savings___february_2023,
264                    'of_characters_typed' => $this->of_characters_typed___february_2023,
265                ],
266                'march' => [
267                    'total_time_saved' => $this->total_time_saved___march_2023,
268                    'total_cost_savings' => $this->total_cost_savings___march_2023,
269                    'of_characters_typed' => $this->of_characters_typed___march_2023,
270                ],
271                'april' => [
272                    'total_time_saved' => $this->total_time_saved___april_2023,
273                    'total_cost_savings' => $this->total_cost_savings___april_2023,
274                    'of_characters_typed' => $this->of_characters_typed___april_2023,
275                ],
276                'may' => [
277                    'total_time_saved' => $this->total_time_saved___may_2023,
278                    'total_cost_savings' => $this->total_cost_savings___may_2023,
279                    'of_characters_typed' => $this->of_characters_typed___may_2023,
280                ],
281                'june' => [
282                    'total_time_saved' => $this->total_time_saved___june_2023,
283                    'total_cost_savings' => $this->total_cost_savings___june_2023,
284                    'of_characters_typed' => $this->of_characters_typed___june_2023,
285                ],
286                'july' => [
287                    'total_time_saved' => $this->total_time_saved___july_2023,
288                    'total_cost_savings' => $this->total_cost_savings___july_2023,
289                    'of_characters_typed' => $this->of_characters_typed___july_2023,
290                ],
291                'august' => [
292                    'total_time_saved' => $this->total_time_saved___august_2023,
293                    'total_cost_savings' => $this->total_cost_savings___august_2023,
294                    'of_characters_typed' => $this->of_characters_typed___august_2023,
295                ],
296                'september' => [
297                    'total_time_saved' => $this->total_time_saved___september_2023,
298                    'total_cost_savings' => $this->total_cost_savings___september_2023,
299                    'of_characters_typed' => $this->of_characters_typed___september_2023,
300                ],
301                'october' => [
302                    'total_time_saved' => $this->total_time_saved___october_2023,
303                    'total_cost_savings' => $this->total_cost_savings___october_2023,
304                    'of_characters_typed' => $this->of_characters_typed___october_2023,
305                ],
306                'november' => [
307                    'total_time_saved' => $this->total_time_saved___november_2023,
308                    'total_cost_savings' => $this->total_cost_savings___november_2023,
309                    'of_characters_typed' => $this->of_characters_typed___november_2023,
310                ],
311                'december' => [
312                    'total_time_saved' => $this->total_time_saved___december_2023,
313                    'total_cost_savings' => $this->total_cost_savings___december_2023,
314                    'of_characters_typed' => $this->of_characters_typed___december_2023,
315                ],
316            ],
317            'summary_2024' => [
318                'january' => [
319                    'total_time_saved' => $this->total_time_saved___january_2024,
320                    'total_cost_savings' => $this->total_cost_savings___january_2024,
321                    'of_characters_typed' => $this->of_characters_typed___january_2024,
322                ],
323                'february' => [
324                    'total_time_saved' => $this->total_time_saved___february_2024,
325                    'total_cost_savings' => $this->total_cost_savings___february_2024,
326                    'of_characters_typed' => $this->of_characters_typed___february_2024,
327                ],
328                'march' => [
329                    'total_time_saved' => $this->total_time_saved___march_2024,
330                    'total_cost_savings' => $this->total_cost_savings___march_2024,
331                    'of_characters_typed' => $this->of_characters_typed___march_2024,
332                ],
333                'april' => [
334                    'total_time_saved' => $this->total_time_saved___april_2024,
335                    'total_cost_savings' => $this->total_cost_savings___april_2024,
336                    'of_characters_typed' => $this->of_characters_typed___april_2024,
337                ],
338                'may' => [
339                    'total_time_saved' => $this->total_time_saved___may_2024,
340                    'total_cost_savings' => $this->total_cost_savings___may_2024,
341                    'of_characters_typed' => $this->of_characters_typed___may_2024,
342                ],
343                'june' => [
344                    'total_time_saved' => $this->total_time_saved___june_2024,
345                    'total_cost_savings' => $this->total_cost_savings___june_2024,
346                    'of_characters_typed' => $this->of_characters_typed___june_2024,
347                ],
348                'july' => [
349                    'total_time_saved' => $this->total_time_saved___july_2024,
350                    'total_cost_savings' => $this->total_cost_savings___july_2024,
351                    'of_characters_typed' => $this->of_characters_typed___july_2024,
352                ],
353                'august' => [
354                    'total_time_saved' => $this->total_time_saved___august_2024,
355                    'total_cost_savings' => $this->total_cost_savings___august_2024,
356                    'of_characters_typed' => $this->of_characters_typed___august_2024,
357                ],
358                'september' => [
359                    'total_time_saved' => $this->total_time_saved___september_2024,
360                    'total_cost_savings' => $this->total_cost_savings___september_2024,
361                    'of_characters_typed' => $this->of_characters_typed___september_2024,
362                ],
363                'october' => [
364                    'total_time_saved' => $this->total_time_saved___october_2024,
365                    'total_cost_savings' => $this->total_cost_savings___october_2024,
366                    'of_characters_typed' => $this->of_characters_typed___october_2024,
367                ],
368                'november' => [
369                    'total_time_saved' => $this->total_time_saved___november_2024,
370                    'total_cost_savings' => $this->total_cost_savings___november_2024,
371                    'of_characters_typed' => $this->of_characters_typed___november_2024,
372                ],
373                'december' => [
374                    'total_time_saved' => $this->total_time_saved___december_2024,
375                    'total_cost_savings' => $this->total_cost_savings___december_2024,
376                    'of_characters_typed' => $this->of_characters_typed___december_2024,
377                ],
378            ],
379            'summary_2025' => [
380                'january' => [
381                    'total_time_saved' => $this->total_time_saved___january_2025,
382                    'total_cost_savings' => $this->total_cost_savings___january_2025,
383                    'of_characters_typed' => $this->of_characters_typed___january_2025,
384                ],
385                'february' => [
386                    'total_time_saved' => $this->total_time_saved___february_2025,
387                    'total_cost_savings' => $this->total_cost_savings___february_2025,
388                    'of_characters_typed' => $this->of_characters_typed___february_2025,
389                ],
390                'march' => [
391                    'total_time_saved' => $this->total_time_saved___march_2025,
392                    'total_cost_savings' => $this->total_cost_savings___march_2025,
393                    'of_characters_typed' => $this->of_characters_typed___march_2025,
394                ],
395                'april' => [
396                    'total_time_saved' => $this->total_time_saved___april_2025,
397                    'total_cost_savings' => $this->total_cost_savings___april_2025,
398                    'of_characters_typed' => $this->of_characters_typed___april_2025,
399                ],
400                'may' => [
401                    'total_time_saved' => $this->total_time_saved___may_2025,
402                    'total_cost_savings' => $this->total_cost_savings___may_2025,
403                    'of_characters_typed' => $this->of_characters_typed___may_2025,
404                ],
405                'june' => [
406                    'total_time_saved' => $this->total_time_saved___june_2025,
407                    'total_cost_savings' => $this->total_cost_savings___june_2025,
408                    'of_characters_typed' => $this->of_characters_typed___june_2025,
409                ],
410                'july' => [
411                    'total_time_saved' => $this->total_time_saved___july_2025,
412                    'total_cost_savings' => $this->total_cost_savings___july_2025,
413                    'of_characters_typed' => $this->of_characters_typed___july_2025,
414                ],
415                'august' => [
416                    'total_time_saved' => $this->total_time_saved___august_2025,
417                    'total_cost_savings' => $this->total_cost_savings___august_2025,
418                    'of_characters_typed' => $this->of_characters_typed___august_2025,
419                ],
420                'september' => [
421                    'total_time_saved' => $this->total_time_saved___september_2025,
422                    'total_cost_savings' => $this->total_cost_savings___september_2025,
423                    'of_characters_typed' => $this->of_characters_typed___september_2025,
424                ],
425                'october' => [
426                    'total_time_saved' => $this->total_time_saved___october_2025,
427                    'total_cost_savings' => $this->total_cost_savings___october_2025,
428                    'of_characters_typed' => $this->of_characters_typed___october_2025,
429                ],
430                'november' => [
431                    'total_time_saved' => $this->total_time_saved___november_2025,
432                    'total_cost_savings' => $this->total_cost_savings___november_2025,
433                    'of_characters_typed' => $this->of_characters_typed___november_2025,
434                ],
435                'december' => [
436                    'total_time_saved' => $this->total_time_saved___december_2025,
437                    'total_cost_savings' => $this->total_cost_savings___december_2025,
438                    'of_characters_typed' => $this->of_characters_typed___december_2025,
439                ],
440            ],
441            'summary_2026' => [
442                'january' => [
443                    'total_time_saved' => $this->total_time_saved__january_2026,
444                    'total_cost_savings' => $this->total_cost_savings__january_2026,
445                    'of_characters_typed' => $this->of_characters_typed__january_2026,
446                ],
447                'february' => [
448                    'total_time_saved' => $this->total_time_saved__february_2026,
449                    'total_cost_savings' => $this->total_cost_savings__february_2026,
450                    'of_characters_typed' => $this->of_characters_typed__february_2026,
451                ],
452                'march' => [
453                    'total_time_saved' => $this->total_time_saved__march_2026,
454                    'total_cost_savings' => $this->total_cost_savings__march_2026,
455                    'of_characters_typed' => $this->of_characters_typed__march_2026,
456                ],
457                'april' => [
458                    'total_time_saved' => $this->total_time_saved__april_2026,
459                    'total_cost_savings' => $this->total_cost_savings__april_2026,
460                    'of_characters_typed' => $this->of_characters_typed__april_2026,
461                ],
462                'may' => [
463                    'total_time_saved' => $this->total_time_saved__may_2026,
464                    'total_cost_savings' => $this->total_cost_savings__may_2026,
465                    'of_characters_typed' => $this->of_characters_typed__may_2026,
466                ],
467                'june' => [
468                    'total_time_saved' => $this->total_time_saved__june_2026,
469                    'total_cost_savings' => $this->total_cost_savings__june_2026,
470                    'of_characters_typed' => $this->of_characters_typed__june_2026,
471                ],
472                'july' => [
473                    'total_time_saved' => $this->total_time_saved__july_2026,
474                    'total_cost_savings' => $this->total_cost_savings__july_2026,
475                    'of_characters_typed' => $this->of_characters_typed__july_2026,
476                ],
477                'august' => [
478                    'total_time_saved' => $this->total_time_saved__august_2026,
479                    'total_cost_savings' => $this->total_cost_savings__august_2026,
480                    'of_characters_typed' => $this->of_characters_typed__august_2026,
481                ],
482                'september' => [
483                    'total_time_saved' => $this->total_time_saved__september_2026,
484                    'total_cost_savings' => $this->total_cost_savings__september_2026,
485                    'of_characters_typed' => $this->of_characters_typed__september_2026,
486                ],
487                'october' => [
488                    'total_time_saved' => $this->total_time_saved__october_2026,
489                    'total_cost_savings' => $this->total_cost_savings__october_2026,
490                    'of_characters_typed' => $this->of_characters_typed__october_2026,
491                ],
492                'november' => [
493                    'total_time_saved' => $this->total_time_saved__november_2026,
494                    'total_cost_savings' => $this->total_cost_savings__november_2026,
495                    'of_characters_typed' => $this->of_characters_typed__november_2026,
496                ],
497                'december' => [
498                    'total_time_saved' => $this->total_time_saved__december_2026,
499                    'total_cost_savings' => $this->total_cost_savings__december_2026,
500                    'of_characters_typed' => $this->of_characters_typed__december_2026,
501                ],
502            ],
503        ];
504    }
505
506    private function formatDate($value): ?string
507    {
508        if (empty($value)) {
509            return '';
510        }
511
512        if ($value instanceof Carbon) {
513            return $value->format('m/d/y H:i:s');
514        }
515
516        if ($value instanceof \MongoDB\BSON\UTCDateTime || (is_numeric($value) && strlen($value) >= 13)) {
517            try {
518                return Carbon::createFromTimestampMs($value)->format('m/d/y H:i:s');
519            } catch (\Exception $e) {
520                return null;
521            }
522        }
523
524        try {
525            return Carbon::parse($value)->format('m/d/y H:i:s');
526        } catch (\Exception $e) {
527            try {
528                return Carbon::createFromTimestamp($value)->format('m/d/y H:i:s');
529            } catch (\Exception $e) {
530                return $value;
531            }
532        }
533    }
534}