Skip to content

Commit

Permalink
Merge pull request #1177 from canyongbs/feature/ADVAPP-1058
Browse files Browse the repository at this point in the history
[ADVAPP-1058]: Rename the service management addon to case management in the backend
  • Loading branch information
Orrison authored Dec 13, 2024
2 parents b780acd + 4defa16 commit 50580ac
Show file tree
Hide file tree
Showing 53 changed files with 211 additions and 69 deletions.
3 changes: 2 additions & 1 deletion app-modules/ai/src/Http/Requests/RetryMessageRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@

use Illuminate\Http\Request;
use Illuminate\Foundation\Http\FormRequest;
use Illuminate\Contracts\Validation\ValidationRule;

class RetryMessageRequest extends FormRequest
{
Expand All @@ -52,7 +53,7 @@ public function authorize(): bool
/**
* Get the validation rules that apply to the request.
*
* @return array<string, \Illuminate\Contracts\Validation\ValidationRule|array<mixed>|string>
* @return array<string, ValidationRule|array<mixed>|string>
*/
public function rules(): array
{
Expand Down
3 changes: 2 additions & 1 deletion app-modules/ai/src/Http/Requests/SendMessageRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
namespace AdvisingApp\Ai\Http\Requests;

use Illuminate\Foundation\Http\FormRequest;
use Illuminate\Contracts\Validation\ValidationRule;

class SendMessageRequest extends FormRequest
{
Expand All @@ -51,7 +52,7 @@ public function authorize(): bool
/**
* Get the validation rules that apply to the request.
*
* @return array<string, \Illuminate\Contracts\Validation\ValidationRule|array<mixed>|string>
* @return array<string, ValidationRule|array<mixed>|string>
*/
public function rules(): array
{
Expand Down
3 changes: 2 additions & 1 deletion app-modules/ai/src/Rules/RestrictSuperAdmin.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
use Closure;
use App\Models\User;
use Illuminate\Contracts\Validation\ValidationRule;
use Illuminate\Translation\PotentiallyTranslatedString;

class RestrictSuperAdmin implements ValidationRule
{
Expand All @@ -52,7 +53,7 @@ public function __construct(string $type)
/**
* Run the validation rule.
*
* @param Closure(string): \Illuminate\Translation\PotentiallyTranslatedString $fail
* @param Closure(string): PotentiallyTranslatedString $fail
*/
public function validate(string $attribute, mixed $value, Closure $fail): void
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ class RedirectIfPasswordNotSet
/**
* Handle an incoming request.
*
* @param Closure(\Illuminate\Http\Request): (\Symfony\Component\HttpFoundation\Response) $next
* @param Closure(Request): (Response) $next
*/
public function handle(Request $request, Closure $next): Response
{
Expand Down
2 changes: 1 addition & 1 deletion app-modules/campaign/src/Enums/CampaignActionType.php
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ public static function blocks(): array
SubscriptionBlock::make(),
];

if (app(LicenseSettings::class)->data->addons->serviceManagement) {
if (app(LicenseSettings::class)->data->addons->caseManagement) {
$blocks[] = CaseBlock::make();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ class EnsureCaseManagementFeatureIsActive
{
public function handle(Request $request, Closure $next): Response
{
if (! app(LicenseSettings::class)->data->addons->serviceManagement) {
if (! app(LicenseSettings::class)->data->addons->caseManagement) {
return response()->json(['error' => 'Case Management is not enabled.'], 403);
}

Expand Down
2 changes: 1 addition & 1 deletion app-modules/case-management/src/Models/CaseModel.php
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,7 @@ public function scopeOpen(Builder $query): void

public static function executeFromCampaignAction(CampaignAction $action): bool|string
{
if (app(LicenseSettings::class)->data->addons->serviceManagement) {
if (app(LicenseSettings::class)->data->addons->caseManagement) {
try {
$action
->campaign
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,6 @@ public function forceDelete(Authenticatable $authenticatable, CaseAssignment $ca

protected function requiredFeatures(): array
{
return [Feature::ServiceManagement];
return [Feature::CaseManagement];
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,6 @@ public function forceDelete(Authenticatable $authenticatable, CaseForm $caseForm

protected function requiredFeatures(): array
{
return [Feature::ServiceManagement];
return [Feature::CaseManagement];
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,6 @@ public function forceDelete(Authenticatable $authenticatable, CaseHistory $caseH

protected function requiredFeatures(): array
{
return [Feature::ServiceManagement];
return [Feature::CaseManagement];
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,6 @@ public function forceDelete(Authenticatable $authenticatable, CaseModel $case):

protected function requiredFeatures(): array
{
return [Feature::ServiceManagement];
return [Feature::CaseManagement];
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,6 @@ public function forceDelete(Authenticatable $authenticatable, CasePriority $case

protected function requiredFeatures(): array
{
return [Feature::ServiceManagement];
return [Feature::CaseManagement];
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,6 @@ public function forceDelete(Authenticatable $authenticatable, CaseStatus $caseSt

protected function requiredFeatures(): array
{
return [Feature::ServiceManagement];
return [Feature::CaseManagement];
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,6 @@ public function forceDelete(Authenticatable $authenticatable, CaseType $caseType

protected function requiredFeatures(): array
{
return [Feature::ServiceManagement];
return [Feature::CaseManagement];
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,6 @@ public function forceDelete(Authenticatable $authenticatable, CaseUpdate $caseUp

protected function requiredFeatures(): array
{
return [Feature::ServiceManagement];
return [Feature::CaseManagement];
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,6 @@ public function forceDelete(Authenticatable $authenticatable, ChangeRequest $cha

protected function requiredFeatures(): array
{
return [Feature::ServiceManagement];
return [Feature::CaseManagement];
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,6 @@ public function forceDelete(Authenticatable $authenticatable, ChangeRequestStatu

protected function requiredFeatures(): array
{
return [Feature::ServiceManagement];
return [Feature::CaseManagement];
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,6 @@ public function forceDelete(Authenticatable $authenticatable, ChangeRequestType

protected function requiredFeatures(): array
{
return [Feature::ServiceManagement];
return [Feature::CaseManagement];
}
}
2 changes: 1 addition & 1 deletion app-modules/case-management/src/Policies/SlaPolicy.php
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,6 @@ public function forceDelete(Authenticatable $authenticatable, Sla $sla): Respons

protected function requiredFeatures(): array
{
return [Feature::ServiceManagement];
return [Feature::CaseManagement];
}
}
4 changes: 2 additions & 2 deletions app-modules/case-management/tests/Case/CreateCaseTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@
test('CreateCase is gated with proper feature access control', function () {
$settings = app(LicenseSettings::class);

$settings->data->addons->serviceManagement = false;
$settings->data->addons->caseManagement = false;

$settings->save();

Expand All @@ -212,7 +212,7 @@
livewire(CreateCase::class)
->assertForbidden();

$settings->data->addons->serviceManagement = true;
$settings->data->addons->caseManagement = true;

$settings->save();

Expand Down
4 changes: 2 additions & 2 deletions app-modules/case-management/tests/Case/EditCaseTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@
test('EditCase is gated with proper feature access control', function () {
$settings = app(LicenseSettings::class);

$settings->data->addons->serviceManagement = false;
$settings->data->addons->caseManagement = false;

$settings->save();

Expand All @@ -220,7 +220,7 @@
])
->assertForbidden();

$settings->data->addons->serviceManagement = true;
$settings->data->addons->caseManagement = true;

$settings->save();

Expand Down
4 changes: 2 additions & 2 deletions app-modules/case-management/tests/Case/ListCasesTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@
test('ListCases is gated with proper feature access control', function () {
$settings = app(LicenseSettings::class);

$settings->data->addons->serviceManagement = false;
$settings->data->addons->caseManagement = false;

$settings->save();

Expand All @@ -141,7 +141,7 @@
CaseResource::getUrl()
)->assertForbidden();

$settings->data->addons->serviceManagement = true;
$settings->data->addons->caseManagement = true;

$settings->save();

Expand Down
4 changes: 2 additions & 2 deletions app-modules/case-management/tests/Case/ViewCaseTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@
test('ViewCase is gated with proper feature access control', function () {
$settings = app(LicenseSettings::class);

$settings->data->addons->serviceManagement = false;
$settings->data->addons->caseManagement = false;

$settings->save();

Expand All @@ -122,7 +122,7 @@
])
)->assertForbidden();

$settings->data->addons->serviceManagement = true;
$settings->data->addons->caseManagement = true;

$settings->save();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@
test('CreateCaseStatus is gated with proper feature access control', function () {
$settings = app(LicenseSettings::class);

$settings->data->addons->serviceManagement = false;
$settings->data->addons->caseManagement = false;

$settings->save();

Expand All @@ -146,7 +146,7 @@
livewire(CreateCaseStatus::class)
->assertForbidden();

$settings->data->addons->serviceManagement = true;
$settings->data->addons->caseManagement = true;

$settings->save();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@
test('EditCaseStatus is gated with proper feature access control', function () {
$settings = app(LicenseSettings::class);

$settings->data->addons->serviceManagement = false;
$settings->data->addons->caseManagement = false;

$settings->save();

Expand All @@ -179,7 +179,7 @@
])
->assertForbidden();

$settings->data->addons->serviceManagement = true;
$settings->data->addons->caseManagement = true;

$settings->save();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@
test('ListCaseStatuses is gated with proper feature access control', function () {
$settings = app(LicenseSettings::class);

$settings->data->addons->serviceManagement = false;
$settings->data->addons->caseManagement = false;

$settings->save();

Expand All @@ -129,7 +129,7 @@
CaseStatusResource::getUrl()
)->assertForbidden();

$settings->data->addons->serviceManagement = true;
$settings->data->addons->caseManagement = true;

$settings->save();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@
test('ViewCaseStatus is gated with proper feature access control', function () {
$settings = app(LicenseSettings::class);

$settings->data->addons->serviceManagement = false;
$settings->data->addons->caseManagement = false;

$settings->save();

Expand All @@ -113,7 +113,7 @@
])
)->assertForbidden();

$settings->data->addons->serviceManagement = true;
$settings->data->addons->caseManagement = true;

$settings->save();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@
test('CreateCaseType is gated with proper feature access control', function () {
$settings = app(LicenseSettings::class);

$settings->data->addons->serviceManagement = false;
$settings->data->addons->caseManagement = false;

$settings->save();

Expand All @@ -143,7 +143,7 @@
livewire(CreateCaseType::class)
->assertForbidden();

$settings->data->addons->serviceManagement = true;
$settings->data->addons->caseManagement = true;

$settings->save();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@
test('EditCaseType is gated with proper feature access control', function () {
$settings = app(LicenseSettings::class);

$settings->data->addons->serviceManagement = false;
$settings->data->addons->caseManagement = false;

$settings->save();

Expand All @@ -170,7 +170,7 @@
])
->assertForbidden();

$settings->data->addons->serviceManagement = true;
$settings->data->addons->caseManagement = true;

$settings->save();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@
test('ListCaseTypes is gated with proper feature access control', function () {
$settings = app(LicenseSettings::class);

$settings->data->addons->serviceManagement = false;
$settings->data->addons->caseManagement = false;

$settings->save();

Expand All @@ -119,7 +119,7 @@
CaseTypeResource::getUrl()
)->assertForbidden();

$settings->data->addons->serviceManagement = true;
$settings->data->addons->caseManagement = true;

$settings->save();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@
test('ViewCaseType is gated with proper feature access control', function () {
$settings = app(LicenseSettings::class);

$settings->data->addons->serviceManagement = false;
$settings->data->addons->caseManagement = false;

$settings->save();

Expand All @@ -111,7 +111,7 @@
])
)->assertForbidden();

$settings->data->addons->serviceManagement = true;
$settings->data->addons->caseManagement = true;

$settings->save();

Expand Down
Loading

0 comments on commit 50580ac

Please sign in to comment.