feat: include LegalAid data in case context for AI assistant
Add getLegalAidData() to CaseContextBuilder so Shira can see existing legal aid information when working on a case. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -27,6 +27,7 @@ class CaseContextBuilder
|
|||||||
return [
|
return [
|
||||||
'case' => $this->getCaseData($case),
|
'case' => $this->getCaseData($case),
|
||||||
'contacts' => $this->getCaseContacts($case),
|
'contacts' => $this->getCaseContacts($case),
|
||||||
|
'legalAid' => $this->getLegalAidData($caseId),
|
||||||
'openTasks' => $this->getOpenTasks($caseId),
|
'openTasks' => $this->getOpenTasks($caseId),
|
||||||
'upcomingMeetings' => $this->getUpcomingMeetings($caseId),
|
'upcomingMeetings' => $this->getUpcomingMeetings($caseId),
|
||||||
'recentCalls' => $this->getRecentCalls($caseId),
|
'recentCalls' => $this->getRecentCalls($caseId),
|
||||||
@@ -80,6 +81,38 @@ class CaseContextBuilder
|
|||||||
return $contacts;
|
return $contacts;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private function getLegalAidData(string $caseId): ?array
|
||||||
|
{
|
||||||
|
$legalAid = $this->entityManager
|
||||||
|
->getRDBRepository('LegalAid')
|
||||||
|
->where(['caseId' => $caseId])
|
||||||
|
->findOne();
|
||||||
|
|
||||||
|
if (!$legalAid) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
return [
|
||||||
|
'id' => $legalAid->get('id'),
|
||||||
|
'status' => $legalAid->get('status'),
|
||||||
|
'legalAidNumber' => $legalAid->get('legalAidNumber'),
|
||||||
|
'contactName' => $legalAid->get('contactName'),
|
||||||
|
'aidType' => $legalAid->get('aidType'),
|
||||||
|
'urgencyLevel' => $legalAid->get('urgencyLevel'),
|
||||||
|
'appointmentDate' => $legalAid->get('appointmentDate'),
|
||||||
|
'filingDeadline' => $legalAid->get('filingDeadline'),
|
||||||
|
'firstContactDate' => $legalAid->get('firstContactDate'),
|
||||||
|
'meetingDate' => $legalAid->get('meetingDate'),
|
||||||
|
'contactStatus' => $legalAid->get('contactStatus'),
|
||||||
|
'proceedingNumber' => $legalAid->get('proceedingNumber'),
|
||||||
|
'courtName' => $legalAid->get('courtName'),
|
||||||
|
'proceedingSubject' => $legalAid->get('proceedingSubject'),
|
||||||
|
'recommendationType' => $legalAid->get('recommendationType'),
|
||||||
|
'additionalAidNeeded' => $legalAid->get('additionalAidNeeded'),
|
||||||
|
'notes' => $legalAid->get('notes'),
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
private function getOpenTasks(string $caseId): array
|
private function getOpenTasks(string $caseId): array
|
||||||
{
|
{
|
||||||
$tasks = [];
|
$tasks = [];
|
||||||
|
|||||||
Reference in New Issue
Block a user