feat: redesign insurance pricing page with tabbed navigation for basic and supplementary insurance, expandable rows for contract details, and move free visit price card to appointment settings

This commit is contained in:
hamed
2026-07-15 14:55:16 +03:30
parent 3e5dee0ad5
commit 9f75aeedf5
8 changed files with 495 additions and 96 deletions
@@ -31,4 +31,16 @@ describe('AppointmentSettingsPage', () => {
expect((await screen.findAllByText('مدیریت نوبت دهی')).length).toBeGreaterThan(1);
expect(screen.getByText('خرید اشتراک')).toBeInTheDocument(); // shell menu
});
it('renders the free-visit price card (moved here from insurance page)', async () => {
renderWithProviders(<AppointmentSettingsPage />, { route: '/admin/appointment-settings' });
expect(await screen.findByText('قیمت ویزیت آزاد')).toBeInTheDocument();
});
it('shows the free-visit price card even when no doctor uuid is present', async () => {
useAuthStore.setState({ primaryRole: 'clinic', doctorUuid: null, dbUuid: null });
renderWithProviders(<AppointmentSettingsPage />, { route: '/admin/appointment-settings' });
expect(await screen.findByText('قیمت ویزیت آزاد')).toBeInTheDocument();
expect(screen.getByText('این بخش فقط برای پزشک در دسترس است.')).toBeInTheDocument();
});
});
@@ -3,6 +3,7 @@ import { api } from '../lib/api';
import type { ApiResponse } from '../lib/api';
import { useAuthStore } from '../stores/authStore';
import SettingsLayout from '../components/layout/SettingsLayout';
import FreeVisitPrice from '../components/FreeVisitPrice';
import { WeeklyScheduleTab, type AddressData } from './DoctorDetailPage';
/**
@@ -29,6 +30,8 @@ export default function AppointmentSettingsPage() {
<div className="fade-in">
<h1 className="section-title" style={{ marginBottom: 16 }}>مدیریت نوبت دهی</h1>
<FreeVisitPrice />
{!uuid ? (
<div className="card" style={{ padding: 32, textAlign: 'center', color: 'var(--text-3)', fontSize: 14 }}>
این بخش فقط برای پزشک در دسترس است.
+2 -4
View File
@@ -1,6 +1,5 @@
import PageHeader from '../components/ui/PageHeader';
import TenantInsuranceContracts from '../components/TenantInsuranceContracts';
import FreeVisitPrice from '../components/FreeVisitPrice';
import FeatureGate from '../components/ui/FeatureGate';
import SettingsLayout from '../components/layout/SettingsLayout';
@@ -10,10 +9,9 @@ export default function InsurancePricingPage() {
<FeatureGate feature="insurance">
<div className="fade-in">
<PageHeader
title="بیمه و قیمت‌گذاری"
description=یمت ویزیت آزاد و قراردادهای بیمه (پایه و تکمیلی)"
title="مدیریت بیمه"
description="قراردادهای بیمه پایه و تکمیلی"
/>
<FreeVisitPrice />
<TenantInsuranceContracts />
</div>
</FeatureGate>