feat(representation): add welcome SMS notification for newly added doctors and clinics by representatives

This commit is contained in:
hamed
2026-06-25 09:37:20 +03:30
parent 763ad82b69
commit e65e506dae
8 changed files with 191 additions and 102 deletions
+18 -14
View File
@@ -629,6 +629,8 @@ export default function AppointmentsPage() {
// ── Handle slot click → open booking modal
function handleSlotClick(slot: SlotItem) {
// نماینده اجازه‌ی ثبت نوبت ندارد؛ صفحه برای او فقط مشاهده است.
if (isRepresentation) return;
const doctorName = doctors.find(d => d.uuid === selectedDoctorUuid)?.name ?? '';
setBookingHint(false);
setBookingSlot({
@@ -677,19 +679,21 @@ export default function AppointmentsPage() {
padding: '12px 16px', borderBottom: '1px solid var(--border)',
display: 'flex', alignItems: 'center', gap: 10, flexWrap: 'wrap',
}}>
{/* New appointment button */}
<button
className="btn primary sm"
onClick={() => {
if (!selectedDoctorUuid) { toast.error('ابتدا یک پزشک انتخاب کنید'); return; }
setViewMode('schedule');
setBookingHint(true);
}}
style={{ display: 'flex', alignItems: 'center', gap: 5 }}
>
<PlusIcon style={{ width: 15, height: 15 }} />
نوبت جدید
</button>
{/* New appointment button — نماینده اجازه‌ی ثبت ندارد */}
{!isRepresentation && (
<button
className="btn primary sm"
onClick={() => {
if (!selectedDoctorUuid) { toast.error('ابتدا یک پزشک انتخاب کنید'); return; }
setViewMode('schedule');
setBookingHint(true);
}}
style={{ display: 'flex', alignItems: 'center', gap: 5 }}
>
<PlusIcon style={{ width: 15, height: 15 }} />
نوبت جدید
</button>
)}
{/* View toggle */}
<div style={{
@@ -752,7 +756,7 @@ export default function AppointmentsPage() {
/>
) : (
<>
{bookingHint && (
{bookingHint && !isRepresentation && (
<div style={{
display: 'flex', alignItems: 'center', gap: 10, marginBottom: 12,
padding: '10px 16px', borderRadius: 'var(--r-sm)',