feat: update session payment logic to ensure accurate payable amounts and reflect consumables in cost breakdown
- Adjusted the calculation of payable amounts in PaymentStep to align with server logic, ensuring overpayments are handled correctly. - Enhanced DetailsStep to include consumables in the itemized cost breakdown, ensuring consistency with patient share calculations. - Updated tests for SessionPaymentPage to validate new behavior regarding overpayments and consumable listings. - Modified PatientController to register SessionPayment correctly when settling sessions via wallet, preventing double charges. - Refactored WalletService to remove outdated methods and ensure wallet transactions reflect the correct amounts after discounts. - Improved accessibility in SearchableSelect component by adding aria labels and ensuring proper role attributes for screen readers. - Updated styles to ensure minimum touch targets meet WCAG guidelines for mobile usability.
This commit is contained in:
@@ -3,7 +3,6 @@
|
||||
namespace App\Tests\Audit;
|
||||
|
||||
use App\Auth\Entity\PreRegistration;
|
||||
use App\Doctor\Entity\Doctor;
|
||||
use App\Tests\ApiTestCase;
|
||||
|
||||
/**
|
||||
@@ -15,11 +14,10 @@ class LowTierFixesTest extends ApiTestCase
|
||||
{
|
||||
public function testUpdateSessionEnforcesPatientGate(): void
|
||||
{
|
||||
// a doctor with no subscription → no patient_records feature
|
||||
// ROLE_DOCTOR بدون رکورد Doctor → resolveEntity مقدار entityId=null میدهد
|
||||
// و گیت با ERR_FORBIDDEN_001 رد میکند. (به features پلن وابسته نیست: پلن
|
||||
// free از Version20260705070546 به بعد patient_records را میدهد.)
|
||||
$doctorUser = $this->createUser(['ROLE_DOCTOR']);
|
||||
$doctor = new Doctor($doctorUser, 'دکتر');
|
||||
$this->em->persist($doctor);
|
||||
$this->em->flush();
|
||||
|
||||
// gate fires before the session lookup → 403 (not 404)
|
||||
$this->authJson('PATCH', '/api/v1/session/nonexistent-uuid', $doctorUser, ['notes' => 'x']);
|
||||
|
||||
Reference in New Issue
Block a user