Add freemium plans, wallet-billed host notifications, and Pro upgrades.
Deploy Ladill Frontdesk / deploy (push) Successful in 44s
Deploy Ladill Frontdesk / deploy (push) Successful in 44s
Host alerts use email/phone on the host record without requiring a Ladill account link; SMS and over-quota emails debit the org wallet at platform rates. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -0,0 +1,26 @@
|
||||
<?php
|
||||
|
||||
namespace App\Services\Frontdesk;
|
||||
|
||||
class NotificationPricingService
|
||||
{
|
||||
public function emailCostMinor(): int
|
||||
{
|
||||
return (int) round((float) config('frontdesk.billing.email_cost_ghs', 0.0135) * 100);
|
||||
}
|
||||
|
||||
public function smsCostMinor(string $message): int
|
||||
{
|
||||
$segmentLength = max(1, (int) config('frontdesk.billing.sms_segment_length', 160));
|
||||
$segments = max(1, (int) ceil(mb_strlen($message) / $segmentLength));
|
||||
|
||||
return (int) round($segments * (float) config('frontdesk.billing.sms_cost_per_segment_ghs', 0.05) * 100);
|
||||
}
|
||||
|
||||
public function formatMinor(int $minor): string
|
||||
{
|
||||
$currency = (string) config('billing.currency', 'GHS');
|
||||
|
||||
return $currency.' '.number_format($minor / 100, 2);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user