Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[AIDAPP-16]: Research and refactor functionality for Aiding App | Caseload Management #6

Merged
merged 2 commits into from
Mar 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@ Our student service CRM is designed to support the management of enrolled studen
* Record Mangement
* Email and SMS
* Service Management
* Caseload Management
* Task Management
* Interaction Tracking
* Files and Documents
Expand Down
76 changes: 2 additions & 74 deletions _ide_helper_models.php
Original file line number Diff line number Diff line change
Expand Up @@ -444,8 +444,6 @@ class IdeHelperTenant {}
* @property-read \AdvisingApp\MeetingCenter\Models\Calendar|null $calendar
* @property-read \Illuminate\Database\Eloquent\Collection<int, \AdvisingApp\CareTeam\Models\CareTeam> $careTeams
* @property-read int|null $care_teams_count
* @property-read \Illuminate\Database\Eloquent\Collection<int, \AdvisingApp\CaseloadManagement\Models\Caseload> $caseloads
* @property-read int|null $caseloads_count
* @property-read \Illuminate\Database\Eloquent\Collection<int, \AdvisingApp\ServiceManagement\Models\ChangeRequestResponse> $changeRequestResponses
* @property-read int|null $change_request_responses_count
* @property-read \Illuminate\Database\Eloquent\Collection<int, \AdvisingApp\ServiceManagement\Models\ChangeRequestType> $changeRequestTypes
Expand Down Expand Up @@ -1144,76 +1142,6 @@ class IdeHelperRoleGroup {}
class IdeHelperCareTeam {}
}

namespace AdvisingApp\CaseloadManagement\Models{
/**
* AdvisingApp\CaseloadManagement\Models\Caseload
*
* @property string $id
* @property string $name
* @property string|null $description
* @property array|null $filters
* @property \AdvisingApp\CaseloadManagement\Enums\CaseloadModel $model
* @property \AdvisingApp\CaseloadManagement\Enums\CaseloadType $type
* @property string $user_id
* @property \Illuminate\Support\Carbon|null $created_at
* @property \Illuminate\Support\Carbon|null $updated_at
* @property string|null $deleted_at
* @property-read \Illuminate\Database\Eloquent\Collection<int, \AdvisingApp\CaseloadManagement\Models\CaseloadSubject> $subjects
* @property-read int|null $subjects_count
* @property-read \App\Models\User $user
* @method static \AdvisingApp\CaseloadManagement\Database\Factories\CaseloadFactory factory($count = null, $state = [])
* @method static \Illuminate\Database\Eloquent\Builder|Caseload model(\AdvisingApp\CaseloadManagement\Enums\CaseloadModel $model)
* @method static \Illuminate\Database\Eloquent\Builder|Caseload newModelQuery()
* @method static \Illuminate\Database\Eloquent\Builder|Caseload newQuery()
* @method static \Illuminate\Database\Eloquent\Builder|Caseload query()
* @method static \Illuminate\Database\Eloquent\Builder|Caseload whereCreatedAt($value)
* @method static \Illuminate\Database\Eloquent\Builder|Caseload whereDeletedAt($value)
* @method static \Illuminate\Database\Eloquent\Builder|Caseload whereDescription($value)
* @method static \Illuminate\Database\Eloquent\Builder|Caseload whereFilters($value)
* @method static \Illuminate\Database\Eloquent\Builder|Caseload whereId($value)
* @method static \Illuminate\Database\Eloquent\Builder|Caseload whereModel($value)
* @method static \Illuminate\Database\Eloquent\Builder|Caseload whereName($value)
* @method static \Illuminate\Database\Eloquent\Builder|Caseload whereType($value)
* @method static \Illuminate\Database\Eloquent\Builder|Caseload whereUpdatedAt($value)
* @method static \Illuminate\Database\Eloquent\Builder|Caseload whereUserId($value)
* @mixin \Eloquent
*/
#[\AllowDynamicProperties]
class IdeHelperCaseload {}
}

namespace AdvisingApp\CaseloadManagement\Models{
/**
* AdvisingApp\CaseloadManagement\Models\CaseloadSubject
*
* @property string $id
* @property string $subject_id
* @property string $subject_type
* @property string $caseload_id
* @property \Illuminate\Support\Carbon|null $created_at
* @property \Illuminate\Support\Carbon|null $updated_at
* @property \Illuminate\Support\Carbon|null $deleted_at
* @property-read \AdvisingApp\CaseloadManagement\Models\Caseload $caseload
* @property-read \Illuminate\Database\Eloquent\Model|\Eloquent $subject
* @method static \Illuminate\Database\Eloquent\Builder|CaseloadSubject newModelQuery()
* @method static \Illuminate\Database\Eloquent\Builder|CaseloadSubject newQuery()
* @method static \Illuminate\Database\Eloquent\Builder|CaseloadSubject onlyTrashed()
* @method static \Illuminate\Database\Eloquent\Builder|CaseloadSubject query()
* @method static \Illuminate\Database\Eloquent\Builder|CaseloadSubject whereCaseloadId($value)
* @method static \Illuminate\Database\Eloquent\Builder|CaseloadSubject whereCreatedAt($value)
* @method static \Illuminate\Database\Eloquent\Builder|CaseloadSubject whereDeletedAt($value)
* @method static \Illuminate\Database\Eloquent\Builder|CaseloadSubject whereId($value)
* @method static \Illuminate\Database\Eloquent\Builder|CaseloadSubject whereSubjectId($value)
* @method static \Illuminate\Database\Eloquent\Builder|CaseloadSubject whereSubjectType($value)
* @method static \Illuminate\Database\Eloquent\Builder|CaseloadSubject whereUpdatedAt($value)
* @method static \Illuminate\Database\Eloquent\Builder|CaseloadSubject withTrashed()
* @method static \Illuminate\Database\Eloquent\Builder|CaseloadSubject withoutTrashed()
* @mixin \Eloquent
*/
#[\AllowDynamicProperties]
class IdeHelperCaseloadSubject {}
}

namespace AdvisingApp\Consent\Models{
/**
* AdvisingApp\Consent\Models\ConsentAgreement
Expand Down Expand Up @@ -4067,7 +3995,7 @@ class IdeHelperEnrollment {}
* @property int $cum_att
* @property int $cum_ern
* @property int $pct_ern
* @property float $cum_gpa
* @property string $cum_gpa
* @property \Illuminate\Support\Carbon $max_dt
* @property-read \AdvisingApp\StudentDataModel\Models\Student|null $student
* @method static \AdvisingApp\StudentDataModel\Database\Factories\PerformanceFactory factory($count = null, $state = [])
Expand Down Expand Up @@ -4099,7 +4027,7 @@ class IdeHelperPerformance {}
* @property string $division
* @property string $acad_plan
* @property string $prog_status
* @property float $cum_gpa
* @property string $cum_gpa
* @property string $semester
* @property string $descr
* @property string $foi
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@
use Filament\Forms\Components\Textarea;
use Filament\Tables\Actions\ViewAction;
use Filament\Tables\Columns\TextColumn;
use Illuminate\Database\Eloquent\Model;
use AdvisingApp\Alert\Enums\AlertStatus;
use App\Filament\Tables\Columns\IdColumn;
use Filament\Resources\Pages\ListRecords;
Expand All @@ -58,11 +57,9 @@
use Filament\Tables\Actions\BulkActionGroup;
use Filament\Tables\Actions\DeleteBulkAction;
use AdvisingApp\StudentDataModel\Models\Student;
use AdvisingApp\CaseloadManagement\Models\Caseload;
use App\Filament\Forms\Components\EducatableSelect;
use AdvisingApp\Alert\Filament\Resources\AlertResource;
use AdvisingApp\StudentDataModel\Models\Scopes\EducatableSearch;
use AdvisingApp\CaseloadManagement\Actions\TranslateCaseloadFilters;
use AdvisingApp\Contact\Filament\Resources\ContactResource\Pages\ManageContactAlerts;
use AdvisingApp\StudentDataModel\Filament\Resources\StudentResource\Pages\ManageStudentAlerts;

Expand Down Expand Up @@ -132,24 +129,6 @@ public function table(Table $table): Table
callback: fn (Builder $query) => $query->whereRelation('careTeam', 'user_id', auth()->id())
)
),
SelectFilter::make('my_caseloads')
->label('My Caseloads')
->options(
auth()->user()->caseloads()
->pluck('name', 'id'),
)
->searchable()
->optionsLimit(20)
->query(fn (Builder $query, array $data) => $this->caseloadFilter($query, $data)),
SelectFilter::make('all_caseloads')
->label('All Caseloads')
->options(
Caseload::all()
->pluck('name', 'id'),
)
->searchable()
->optionsLimit(20)
->query(fn (Builder $query, array $data) => $this->caseloadFilter($query, $data)),
SelectFilter::make('severity')
->options(AlertSeverity::class),
SelectFilter::make('status')
Expand Down Expand Up @@ -201,23 +180,4 @@ protected function getHeaderActions(): array
]),
];
}

protected function caseloadFilter(Builder $query, array $data): void
{
if (blank($data['value'])) {
return;
}

$caseload = Caseload::find($data['value']);

/** @var Model $model */
$model = resolve($caseload->model->class());

$query->whereIn(
'concern_id',
app(TranslateCaseloadFilters::class)
->handle($data['value'])
->pluck($model->getQualifiedKeyName()),
);
}
}
26 changes: 0 additions & 26 deletions app-modules/caseload-management/composer.json

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

Loading