Initial Ladill Queue release — enterprise QMS standalone app.
Deploy Ladill Queue / deploy (push) Successful in 56s
Deploy Ladill Queue / deploy (push) Successful in 56s
Phases 1–6: tickets, counters, displays, appointments, workflows, rules, analytics, reports, feedback, admin, device API, and Gitea deploy workflow for queue.ladill.com. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -0,0 +1,42 @@
|
||||
<?php
|
||||
|
||||
namespace App\Services\Qms;
|
||||
|
||||
use App\Models\Organization;
|
||||
|
||||
class PlanService
|
||||
{
|
||||
public function plan(Organization $organization): string
|
||||
{
|
||||
return (string) data_get($organization->settings, 'plan', 'free');
|
||||
}
|
||||
|
||||
public function isPro(Organization $organization): bool
|
||||
{
|
||||
return $this->plan($organization) === 'pro';
|
||||
}
|
||||
|
||||
public function maxBranches(Organization $organization): ?int
|
||||
{
|
||||
return config('qms.plans.'.$this->plan($organization).'.max_branches');
|
||||
}
|
||||
|
||||
public function maxQueues(Organization $organization): ?int
|
||||
{
|
||||
return config('qms.plans.'.$this->plan($organization).'.max_queues');
|
||||
}
|
||||
|
||||
public function canAddBranch(Organization $organization, int $currentCount): bool
|
||||
{
|
||||
$max = $this->maxBranches($organization);
|
||||
|
||||
return $max === null || $currentCount < $max;
|
||||
}
|
||||
|
||||
public function canAddQueue(Organization $organization, int $currentCount): bool
|
||||
{
|
||||
$max = $this->maxQueues($organization);
|
||||
|
||||
return $max === null || $currentCount < $max;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user