Add branch count control to Queue plans page.
Deploy Ladill Queue / deploy (push) Successful in 33s

Match Care/Frontdesk: branches stepper next to billing period, live
totals, and checkout charges for the selected seat count.
This commit is contained in:
isaacclad
2026-07-16 09:36:36 +00:00
parent 8892316664
commit 8be3eaeb4b
4 changed files with 121 additions and 46 deletions
+20 -5
View File
@@ -84,9 +84,7 @@ class PlanService
public function proPriceMinor(Organization $organization): int
{
$branches = max(1, $this->activeBranchCount($organization));
return $branches * $this->proPricePerBranchMinor();
return $this->priceForBranches('pro', $this->activeBranchCount($organization));
}
public function enterprisePricePerBranchMinor(): int
@@ -96,9 +94,26 @@ class PlanService
public function enterprisePriceMinor(Organization $organization): int
{
$branches = max(1, $this->activeBranchCount($organization));
return $this->priceForBranches('enterprise', $this->activeBranchCount($organization));
}
return $branches * $this->enterprisePricePerBranchMinor();
/** Fixed branch count × per-branch rate (checkout when the user picks seats). */
public function priceForBranches(string $plan, int $branches): int
{
$branches = max(1, $branches);
$rate = $plan === 'enterprise'
? $this->enterprisePricePerBranchMinor()
: $this->proPricePerBranchMinor();
return $branches * $rate;
}
public function resolveCheckoutBranches(Organization $organization, int $requested): int
{
$branches = max(1, min(999, $requested));
$active = max(1, $this->activeBranchCount($organization));
return max($branches, $active);
}
public function canSubscribeEnterprise(Organization $organization): bool