Skip to content

[ADVAPP-1607]: Introduce robust workflow capabilities for online admissions for both students and prospective students #1747

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

Open
wants to merge 62 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
62 commits
Select commit Hold shift + click to select a range
7a9e639
Corrections to models, migrations. Create event, listener
rebecca-canyon Jul 10, 2025
2de8610
chore: fix enforcement of copyright on all files
rebecca-canyon Jul 10, 2025
e31ca86
chore: fix code style
Orrison Jul 10, 2025
529bd14
Utilize existing event
rebecca-canyon Jul 10, 2025
f82a253
Correct model definitions, create workflow job (WIP)
rebecca-canyon Jul 10, 2025
c77c327
Generate helper files
rebecca-canyon Jul 10, 2025
16895ef
Work on job definition (WIP)
rebecca-canyon Jul 11, 2025
c9c01f2
Update WorkflowStep details column to current_details. Turn WorkflowA…
rebecca-canyon Jul 14, 2025
d86f707
chore: fix code style
Orrison Jul 14, 2025
1e95951
Implement action execution (WIP)
rebecca-canyon Jul 15, 2025
9fa3ad7
Create engagement action job
rebecca-canyon Jul 16, 2025
26f8d01
chore: fix enforcement of copyright on all files
rebecca-canyon Jul 16, 2025
2101240
chore: fix code style
Orrison Jul 16, 2025
d570cfd
Create remaining jobs
rebecca-canyon Jul 16, 2025
929e2a4
chore: fix code style
Orrison Jul 16, 2025
3b0d23f
Code cleanup
rebecca-canyon Jul 16, 2025
985974a
chore: fix code style
rebecca-canyon Jul 16, 2025
b9effc1
Create workflow action (WIP)
rebecca-canyon Jul 21, 2025
2e16b7b
chore: fix code style
rebecca-canyon Jul 21, 2025
b797acc
Implemenet UI for creating workflow steps (WIP)
rebecca-canyon Jul 22, 2025
2523abb
chore: fix enforcement of copyright on all files
rebecca-canyon Jul 22, 2025
bd9642a
chore: fix code style
Orrison Jul 22, 2025
f3821d6
Implemenet UI for creating workflow steps
rebecca-canyon Jul 22, 2025
2174d89
chore: fix code style
rebecca-canyon Jul 22, 2025
5325333
Add delay_minutes field to form
rebecca-canyon Jul 22, 2025
0519420
chore: fix code style
rebecca-canyon Jul 22, 2025
e6f4baf
Correct errors (WIP)
rebecca-canyon Jul 23, 2025
4ccc94b
chore: fix code style
rebecca-canyon Jul 23, 2025
870dbf1
Get relation manager working
rebecca-canyon Jul 24, 2025
a7013a5
chore: fix code style
Orrison Jul 24, 2025
d4b38e9
Add previous step id
rebecca-canyon Jul 24, 2025
ad08229
chore: fix code style
rebecca-canyon Jul 24, 2025
1d94952
Cleanup
rebecca-canyon Jul 24, 2025
95aa12e
Include feature flag
rebecca-canyon Jul 24, 2025
03509c5
chore: fix code style
rebecca-canyon Jul 24, 2025
7130198
Remove reference to nonextant feature flag
rebecca-canyon Jul 24, 2025
eb79124
Apply feature flag
rebecca-canyon Jul 24, 2025
9a7b2a4
chore: fix code style
Orrison Jul 24, 2025
6b827b9
Correct feature flag usage
rebecca-canyon Jul 24, 2025
20f84a3
chore: fix code style
rebecca-canyon Jul 24, 2025
e153b28
Address PR feedback
rebecca-canyon Jul 25, 2025
cebbc67
Remove magic methods
rebecca-canyon Jul 25, 2025
cc82a53
Address PR feedback
rebecca-canyon Jul 25, 2025
1924a97
chore: fix code style
rebecca-canyon Jul 25, 2025
9ace41f
Address PR feedback
rebecca-canyon Jul 27, 2025
2cc1bdf
Introduce workflows to applications
rebecca-canyon Jul 27, 2025
ebafebe
chore: fix enforcement of copyright on all files
rebecca-canyon Jul 27, 2025
cd6d2e8
chore: fix code style
Orrison Jul 27, 2025
91da792
Fix linting error
rebecca-canyon Jul 27, 2025
cab1831
Correct import
rebecca-canyon Jul 27, 2025
873d385
Minor correction
rebecca-canyon Jul 27, 2025
b377496
Generate helper files
rebecca-canyon Jul 27, 2025
c5ffe6c
Fix helper model generation
rebecca-canyon Jul 27, 2025
0087df5
chore: fix code style
rebecca-canyon Aug 7, 2025
52821b0
Rebase cleanup
rebecca-canyon Aug 7, 2025
c69876a
Rebase cleanup pt 2
rebecca-canyon Aug 7, 2025
6ac0c8d
Reflect changes in 1606 here
rebecca-canyon Aug 7, 2025
8c8ba1b
Fix breadcrumbs
rebecca-canyon Aug 7, 2025
e97f7d8
chore: fix code style
rebecca-canyon Aug 7, 2025
038a0d5
Modify baseline to ignore WorkflowDetails being a grandchild of Model
rebecca-canyon Aug 7, 2025
4bb560a
Remove unnecessary reference to feature flag
rebecca-canyon Aug 7, 2025
5407060
chore: fix code style
rebecca-canyon Aug 7, 2025
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
171 changes: 171 additions & 0 deletions _ide_helper_models.php
Original file line number Diff line number Diff line change
Expand Up @@ -6479,6 +6479,177 @@ class IdeHelperWorkflowInteractionDetails {}
class IdeHelperWorkflowProactiveAlertDetails {}
}

namespace AdvisingApp\Workflow\Models{
/**
*
*
* @property string $id
* @property \Illuminate\Support\Carbon|null $started_at
* @property string $workflow_trigger_id
* @property string $related_id
* @property string $related_type
* @property \Illuminate\Support\Carbon|null $created_at
* @property \Illuminate\Support\Carbon|null $updated_at
* @property \Illuminate\Support\Carbon|null $deleted_at
* @property-read \Illuminate\Database\Eloquent\Collection<int, \AdvisingApp\Audit\Models\Audit> $audits
* @property-read int|null $audits_count
* @property-read covariant \Illuminate\Database\Eloquent\Model $related
* @property-read \Illuminate\Database\Eloquent\Collection<int, \AdvisingApp\Workflow\Models\WorkflowRunStep> $workflowRunSteps
* @property-read int|null $workflow_run_steps_count
* @property-read \AdvisingApp\Workflow\Models\WorkflowTrigger $workflowTrigger
* @method static \Illuminate\Database\Eloquent\Builder<static>|WorkflowRun newModelQuery()
* @method static \Illuminate\Database\Eloquent\Builder<static>|WorkflowRun newQuery()
* @method static \Illuminate\Database\Eloquent\Builder<static>|WorkflowRun onlyTrashed()
* @method static \Illuminate\Database\Eloquent\Builder<static>|WorkflowRun query()
* @method static \Illuminate\Database\Eloquent\Builder<static>|WorkflowRun whereCreatedAt($value)
* @method static \Illuminate\Database\Eloquent\Builder<static>|WorkflowRun whereDeletedAt($value)
* @method static \Illuminate\Database\Eloquent\Builder<static>|WorkflowRun whereId($value)
* @method static \Illuminate\Database\Eloquent\Builder<static>|WorkflowRun whereRelatedId($value)
* @method static \Illuminate\Database\Eloquent\Builder<static>|WorkflowRun whereRelatedType($value)
* @method static \Illuminate\Database\Eloquent\Builder<static>|WorkflowRun whereStartedAt($value)
* @method static \Illuminate\Database\Eloquent\Builder<static>|WorkflowRun whereUpdatedAt($value)
* @method static \Illuminate\Database\Eloquent\Builder<static>|WorkflowRun whereWorkflowTriggerId($value)
* @method static \Illuminate\Database\Eloquent\Builder<static>|WorkflowRun withTrashed()
* @method static \Illuminate\Database\Eloquent\Builder<static>|WorkflowRun withoutTrashed()
* @mixin \Eloquent
*/
#[\AllowDynamicProperties]
class IdeHelperWorkflowRun {}
}

namespace AdvisingApp\Workflow\Models{
/**
*
*
* @property string $id
* @property \Illuminate\Support\Carbon $execute_at
* @property \Illuminate\Support\Carbon|null $dispatched_at
* @property \Illuminate\Support\Carbon|null $succeeded_at
* @property \Illuminate\Support\Carbon|null $last_failed_at
* @property string $workflow_run_id
* @property string $details_id
* @property \AdvisingApp\Workflow\Enums\WorkflowActionType $details_type
* @property \Illuminate\Support\Carbon|null $created_at
* @property \Illuminate\Support\Carbon|null $updated_at
* @property \Illuminate\Support\Carbon|null $deleted_at
* @property-read \Illuminate\Database\Eloquent\Collection<int, \AdvisingApp\Audit\Models\Audit> $audits
* @property-read int|null $audits_count
* @property-read \Illuminate\Database\Eloquent\Model $details
* @property-read \AdvisingApp\Workflow\Models\WorkflowRun $workflowRun
* @method static \Illuminate\Database\Eloquent\Builder<static>|WorkflowRunStep newModelQuery()
* @method static \Illuminate\Database\Eloquent\Builder<static>|WorkflowRunStep newQuery()
* @method static \Illuminate\Database\Eloquent\Builder<static>|WorkflowRunStep onlyTrashed()
* @method static \Illuminate\Database\Eloquent\Builder<static>|WorkflowRunStep query()
* @method static \Illuminate\Database\Eloquent\Builder<static>|WorkflowRunStep whereCreatedAt($value)
* @method static \Illuminate\Database\Eloquent\Builder<static>|WorkflowRunStep whereDeletedAt($value)
* @method static \Illuminate\Database\Eloquent\Builder<static>|WorkflowRunStep whereDetailsId($value)
* @method static \Illuminate\Database\Eloquent\Builder<static>|WorkflowRunStep whereDetailsType($value)
* @method static \Illuminate\Database\Eloquent\Builder<static>|WorkflowRunStep whereDispatchedAt($value)
* @method static \Illuminate\Database\Eloquent\Builder<static>|WorkflowRunStep whereExecuteAt($value)
* @method static \Illuminate\Database\Eloquent\Builder<static>|WorkflowRunStep whereId($value)
* @method static \Illuminate\Database\Eloquent\Builder<static>|WorkflowRunStep whereLastFailedAt($value)
* @method static \Illuminate\Database\Eloquent\Builder<static>|WorkflowRunStep whereSucceededAt($value)
* @method static \Illuminate\Database\Eloquent\Builder<static>|WorkflowRunStep whereUpdatedAt($value)
* @method static \Illuminate\Database\Eloquent\Builder<static>|WorkflowRunStep whereWorkflowRunId($value)
* @method static \Illuminate\Database\Eloquent\Builder<static>|WorkflowRunStep withTrashed()
* @method static \Illuminate\Database\Eloquent\Builder<static>|WorkflowRunStep withoutTrashed()
* @mixin \Eloquent
*/
#[\AllowDynamicProperties]
class IdeHelperWorkflowRunStep {}
}

namespace AdvisingApp\Workflow\Models{
/**
*
*
* @property string $id
* @property string $workflow_run_step_id
* @property string $related_type
* @property string $related_id
* @property \Illuminate\Support\Carbon|null $created_at
* @property \Illuminate\Support\Carbon|null $updated_at
* @property \Illuminate\Support\Carbon|null $deleted_at
* @property-read \Illuminate\Database\Eloquent\Collection<int, \AdvisingApp\Audit\Models\Audit> $audits
* @property-read int|null $audits_count
* @property-read \Illuminate\Database\Eloquent\Model $related
* @property-read \AdvisingApp\Workflow\Models\WorkflowRunStep $workflowRunStep
* @method static \Illuminate\Database\Eloquent\Builder<static>|WorkflowRunStepRelated newModelQuery()
* @method static \Illuminate\Database\Eloquent\Builder<static>|WorkflowRunStepRelated newQuery()
* @method static \Illuminate\Database\Eloquent\Builder<static>|WorkflowRunStepRelated onlyTrashed()
* @method static \Illuminate\Database\Eloquent\Builder<static>|WorkflowRunStepRelated query()
* @method static \Illuminate\Database\Eloquent\Builder<static>|WorkflowRunStepRelated whereCreatedAt($value)
* @method static \Illuminate\Database\Eloquent\Builder<static>|WorkflowRunStepRelated whereDeletedAt($value)
* @method static \Illuminate\Database\Eloquent\Builder<static>|WorkflowRunStepRelated whereId($value)
* @method static \Illuminate\Database\Eloquent\Builder<static>|WorkflowRunStepRelated whereRelatedId($value)
* @method static \Illuminate\Database\Eloquent\Builder<static>|WorkflowRunStepRelated whereRelatedType($value)
* @method static \Illuminate\Database\Eloquent\Builder<static>|WorkflowRunStepRelated whereUpdatedAt($value)
* @method static \Illuminate\Database\Eloquent\Builder<static>|WorkflowRunStepRelated whereWorkflowRunStepId($value)
* @method static \Illuminate\Database\Eloquent\Builder<static>|WorkflowRunStepRelated withTrashed()
* @method static \Illuminate\Database\Eloquent\Builder<static>|WorkflowRunStepRelated withoutTrashed()
* @mixin \Eloquent
*/
#[\AllowDynamicProperties]
class IdeHelperWorkflowRunStepRelated {}
}

namespace AdvisingApp\Workflow\Models{
/**
*
*
* @property-read \Illuminate\Database\Eloquent\Collection<int, \AdvisingApp\Audit\Models\Audit> $audits
* @property-read int|null $audits_count
* @property-read \AdvisingApp\Workflow\Models\WorkflowTrigger|null $workflowTrigger
* @method static \Illuminate\Database\Eloquent\Builder<static>|WorkflowRun newModelQuery()
* @method static \Illuminate\Database\Eloquent\Builder<static>|WorkflowRun newQuery()
* @method static \Illuminate\Database\Eloquent\Builder<static>|WorkflowRun onlyTrashed()
* @method static \Illuminate\Database\Eloquent\Builder<static>|WorkflowRun query()
* @method static \Illuminate\Database\Eloquent\Builder<static>|WorkflowRun withTrashed()
* @method static \Illuminate\Database\Eloquent\Builder<static>|WorkflowRun withoutTrashed()
* @mixin \Eloquent
*/
#[\AllowDynamicProperties]
class IdeHelperWorkflowRun {}
}

namespace AdvisingApp\Workflow\Models{
/**
*
*
* @property-read \Illuminate\Database\Eloquent\Collection<int, \AdvisingApp\Audit\Models\Audit> $audits
* @property-read int|null $audits_count
* @property-read WorkflowRunStep|null $workflowRunStep
* @method static \Illuminate\Database\Eloquent\Builder<static>|WorkflowRunStep newModelQuery()
* @method static \Illuminate\Database\Eloquent\Builder<static>|WorkflowRunStep newQuery()
* @method static \Illuminate\Database\Eloquent\Builder<static>|WorkflowRunStep onlyTrashed()
* @method static \Illuminate\Database\Eloquent\Builder<static>|WorkflowRunStep query()
* @method static \Illuminate\Database\Eloquent\Builder<static>|WorkflowRunStep withTrashed()
* @method static \Illuminate\Database\Eloquent\Builder<static>|WorkflowRunStep withoutTrashed()
* @mixin \Eloquent
*/
#[\AllowDynamicProperties]
class IdeHelperWorkflowRunStep {}
}

namespace AdvisingApp\Workflow\Models{
/**
*
*
* @property-read \Illuminate\Database\Eloquent\Collection<int, \AdvisingApp\Audit\Models\Audit> $audits
* @property-read int|null $audits_count
* @property-read \AdvisingApp\Workflow\Models\WorkflowRun|null $workflowRun
* @method static \Illuminate\Database\Eloquent\Builder<static>|WorkflowRunStepRelated newModelQuery()
* @method static \Illuminate\Database\Eloquent\Builder<static>|WorkflowRunStepRelated newQuery()
* @method static \Illuminate\Database\Eloquent\Builder<static>|WorkflowRunStepRelated onlyTrashed()
* @method static \Illuminate\Database\Eloquent\Builder<static>|WorkflowRunStepRelated query()
* @method static \Illuminate\Database\Eloquent\Builder<static>|WorkflowRunStepRelated withTrashed()
* @method static \Illuminate\Database\Eloquent\Builder<static>|WorkflowRunStepRelated withoutTrashed()
* @mixin \Eloquent
*/
#[\AllowDynamicProperties]
class IdeHelperWorkflowRunStepRelated {}
}

namespace AdvisingApp\Workflow\Models{
/**
* @property string $id
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@
use AdvisingApp\Application\Filament\Resources\ApplicationResource\Pages\EditApplication;
use AdvisingApp\Application\Filament\Resources\ApplicationResource\Pages\ListApplications;
use AdvisingApp\Application\Filament\Resources\ApplicationResource\Pages\ManageApplicationSubmissions;
use AdvisingApp\Application\Filament\Resources\ApplicationResource\Pages\ManageApplicationWorkflows;
use AdvisingApp\Application\Models\Application;
use Filament\Resources\Pages\Page;
use Filament\Resources\Resource;
Expand Down Expand Up @@ -70,6 +71,7 @@ public static function getRecordSubNavigation(Page $page): array
{
return $page->generateNavigationItems([
EditApplication::class,
ManageApplicationWorkflows::class,
ManageApplicationSubmissions::class,
]);
}
Expand All @@ -80,6 +82,7 @@ public static function getPages(): array
'index' => ListApplications::route('/'),
'create' => CreateApplication::route('/create'),
'edit' => EditApplication::route('/{record}/edit'),
'manage-application-workflows' => ManageApplicationWorkflows::route('/{record}/workflows'),
'manage-submissions' => ManageApplicationSubmissions::route('/{record}/submissions'),
];
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,120 @@
<?php

/*
<COPYRIGHT>

Copyright © 2016-2025, Canyon GBS LLC. All rights reserved.

Advising App™ is licensed under the Elastic License 2.0. For more details,
see https://github.com/canyongbs/advisingapp/blob/main/LICENSE.

Notice:

- You may not provide the software to third parties as a hosted or managed
service, where the service provides users with access to any substantial set of
the features or functionality of the software.
- You may not move, change, disable, or circumvent the license key functionality
in the software, and you may not remove or obscure any functionality in the
software that is protected by the license key.
- You may not alter, remove, or obscure any licensing, copyright, or other notices
of the licensor in the software. Any use of the licensor’s trademarks is subject
to applicable law.
- Canyon GBS LLC respects the intellectual property rights of others and expects the
same in return. Canyon GBS™ and Advising App™ are registered trademarks of
Canyon GBS LLC, and we are committed to enforcing and protecting our trademarks
vigorously.
- The software solution, including services, infrastructure, and code, is offered as a
Software as a Service (SaaS) by Canyon GBS LLC.
- Use of this software implies agreement to the license terms and conditions as stated
in the Elastic License 2.0.

For more information or inquiries please visit our website at
https://www.canyongbs.com or contact us via email at [email protected].

</COPYRIGHT>
*/

namespace AdvisingApp\Application\Filament\Resources\ApplicationResource\Pages;

use AdvisingApp\Application\Filament\Resources\ApplicationResource;
use AdvisingApp\Workflow\Enums\WorkflowTriggerType;
use AdvisingApp\Workflow\Filament\Resources\WorkflowResource;
use AdvisingApp\Workflow\Models\Workflow;
use AdvisingApp\Workflow\Models\WorkflowTrigger;
use Filament\Actions\Action;
use Filament\Resources\Pages\ManageRelatedRecords;
use Filament\Tables\Actions\EditAction;
use Filament\Tables\Columns\IconColumn;
use Filament\Tables\Columns\TextColumn;
use Filament\Tables\Table;
use Illuminate\Support\Facades\DB;
use Throwable;

class ManageApplicationWorkflows extends ManageRelatedRecords
{
protected static string $resource = ApplicationResource::class;

protected static string $relationship = 'workflows';

public static function getNavigationLabel(): string
{
return 'Workflows';
}

public function table(Table $table): Table
{
return $table
->recordTitleAttribute('id')
->columns([
TextColumn::make('name'),
IconColumn::make('is_enabled')
->label('Enabled')
->boolean(),
])
->actions([
EditAction::make()
->url(fn (Workflow $record) => WorkflowResource::getUrl('edit', [$record])),
])
->recordUrl(fn (Workflow $record) => WorkflowResource::getUrl('edit', [$record]));
}

/**
* @return array<Action>
*/
public function getHeaderActions(): array
{
return [
Action::make('create')
->label('Create New Workflow')
->action(function () {
try {
DB::beginTransaction();

$workflowTrigger = new WorkflowTrigger(['type' => WorkflowTriggerType::EventBased]);

$workflowTrigger->related()->associate($this->getOwnerRecord());
$workflowTrigger->createdBy()->associate(auth()->user());

$workflowTrigger->save();

$workflow = new Workflow([
'name' => 'Application Workflow',
'is_enabled' => false,
]);

$workflow->workflowTrigger()->associate($workflowTrigger);

$workflow->save();

DB::commit();
} catch (Throwable $throw) {
DB::rollBack();

throw $throw;
}

redirect(WorkflowResource::getUrl('edit', [$workflow]));
}),
];
}
}
Loading