feat: Implement financial engine for commission and tax calculations

- Added new configuration keys for appointment and upgrade commissions, tax settings, and SMS panel fee in SiteConfigController and SiteConfigRepository.
- Introduced CommissionService to handle commission calculations for appointments and subscriptions, including tax deductions and SMS fees.
- Created FinancialBreakdown entity and repository to log financial transactions.
- Updated PaymentController to process commissions upon successful payments for appointments and subscriptions.
- Developed FinancialReportPage in the admin panel to display financial breakdowns and summaries.
- Added database migration for the new financial_breakdowns table.
This commit is contained in:
hamed
2026-06-24 13:06:17 +03:30
parent e0abaf5c0c
commit 148d033114
16 changed files with 1119 additions and 0 deletions
@@ -18,6 +18,13 @@ class SiteConfigController extends BaseController
private const ALLOWED_KEYS = [
'commission_enabled',
'commission_percent',
// financial engine
'appointment_commission_enabled',
'upgrade_commission_enabled',
'upgrade_commission_percent',
'tax_enabled',
'tax_percent',
'sms_panel_fee_rials',
'site_name',
'support_phone',
'max_cancel_hours_before',
@@ -12,6 +12,13 @@ class SiteConfigRepository extends ServiceEntityRepository
private const DEFAULTS = [
'commission_enabled' => '0',
'commission_percent' => '0',
// financial engine
'appointment_commission_enabled' => '0',
'upgrade_commission_enabled' => '0',
'upgrade_commission_percent' => '20',
'tax_enabled' => '0',
'tax_percent' => '10',
'sms_panel_fee_rials' => '1500000',
'site_name' => 'ClinicPro',
'support_phone' => '',
'max_cancel_hours_before' => '24',