feat: add multi-city representation support and domain context resolution
- Created migration to add representation_cities table and domain, is_global fields to representations. - Implemented SiteContextController to resolve domain to site context (city | representation | unknown). - Developed DomainContext and DomainContextResolver services for domain mapping. - Added tests for DomainContextResolver and commission logic based on domain ownership.
This commit is contained in:
@@ -52,12 +52,17 @@ class CommissionService
|
||||
);
|
||||
}
|
||||
|
||||
/** پورسانت ارتقاء اشتراک: درصد سراسری = upgrade_commission_percent. */
|
||||
public function processSubscription(Payment $payment, ?int $representationId, ?int $doctorId, ?int $clinicId): void
|
||||
/**
|
||||
* پورسانت ارتقاء اشتراک: درصد سراسری = upgrade_commission_percent.
|
||||
* گاردِ دامنه (مثل نوبت): مالک پزشک/کلینیک و نمایندهی دامنهی خرید باید یکی باشند.
|
||||
*/
|
||||
public function processSubscription(Payment $payment, ?int $ownerRepId, ?int $bookingRepId, ?int $doctorId, ?int $clinicId): void
|
||||
{
|
||||
if ($this->configRepo->get('upgrade_commission_enabled') !== '1') return;
|
||||
|
||||
$rep = $this->resolveRep($representationId);
|
||||
if ($ownerRepId === null || $bookingRepId === null || $ownerRepId !== $bookingRepId) return;
|
||||
|
||||
$rep = $this->resolveRep($ownerRepId);
|
||||
if ($rep === null) return;
|
||||
|
||||
$this->settle(
|
||||
|
||||
Reference in New Issue
Block a user