Changes to documents able to edit them now, also support for auto mail attechemnts

This commit is contained in:
Simon Pocrnjič
2025-10-18 19:04:10 +02:00
parent 761799bdbe
commit 3b1a24287a
19 changed files with 820 additions and 108 deletions
+11 -1
View File
@@ -175,7 +175,17 @@ public function showCase(\App\Models\ClientCase $clientCase, Request $request)
'documents' => $documents,
'types' => $types,
'account_types' => \App\Models\AccountType::all(),
'actions' => \App\Models\Action::with('decisions')->get(),
// Provide decisions with linked email template metadata (entity_types, allow_attachments)
'actions' => \App\Models\Action::query()
->with([
'decisions' => function ($q) {
$q->select('decisions.id', 'decisions.name', 'decisions.color_tag', 'decisions.auto_mail', 'decisions.email_template_id');
},
'decisions.emailTemplate' => function ($q) {
$q->select('id', 'name', 'entity_types', 'allow_attachments');
},
])
->get(['id', 'name', 'color_tag', 'segment_id']),
'activities' => $activities,
'completed_mode' => (bool) $request->boolean('completed'),
]);