Commit Graph
69 Commits
Author SHA1 Message Date
hamedandClaude Opus 4.8 b60dbdadba fix(profile): persist & expose birthday as a single Unix field
Birthday was never saved (hydrate forced null) and not returned in a form the
clients use. Now:
- hydrate stores the incoming `birthday` (Unix) into date_of_birth; `birthday`
  takes priority over a stray `date_of_birth: null` in the same payload so it
  can't be wiped.
- toArray exposes a single `birthday` (Unix) key — drop the duplicate
  `date_of_birth` output to avoid overlap.
- admin UserDetailPage reads profile.birthday (formatDate renders Jalali).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-16 11:42:31 +03:30
hamedandClaude Opus 4.8 a348dcae5f fix(admin): render medical history with each section's real shape
The medical sections in other are structured objects, not flat strings:
allergies {substance,reaction,severity}, medications {name,dose,frequency},
surgeries {type,year,hospital}, family_history {relation,disease}, disease
{id,name,status}. The admin view printed raw JSON for all but disease.
Give each section a formatter, and for disease show only entries marked
active (status true) instead of the full 30-item checklist.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-15 22:27:42 +03:30
hamedandClaude Opus 4.8 d9c0729fbb feat(admin): show user profile on the user detail page
Add a read-only پروفایل کاربر section to UserDetailPage that fetches
GET /api/v1/user-profile/{uuid} (admins are authorized) and renders the
patient profile — personal fields, insurance, and medical history from
other — with loading skeleton and an empty state when the user has no
profile. Response is double-nested (data.data).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-15 22:08:18 +03:30
hamedandClaude Opus 4.8 874125c4e1 feat(admin): online-booking window UI in doctor weekly schedule
Add a نوبت‌دهی آنلاین card to the weekly-schedule tab: a toggle for
online_booking_enabled and a value+unit (هفته/ماه) booking window.
Hydrated from the schedule meta and sent in the weekly-schedule
POST/PATCH payload. Uses existing .input/.btn classes, RTL.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-15 16:26:03 +03:30
hamed e95c5c12d1 feat: update UI components to use CSS variables for dark mode compatibility 2026-06-15 14:50:45 +03:30
hamed df7a784701 feat: implement realistic data seeding for doctors, clinics, and secretaries
- Added seed_realistic_data.php to clean existing data and populate the database with realistic entries for doctors, clinics, and secretaries.
- Created a structured approach to generate 100 doctors per city with diverse specialties and services.
- Implemented database cleanup routines to ensure a fresh start for data seeding.
- Enhanced the DoctorSecretaryRepository with improved comments for clarity.
2026-06-15 14:18:25 +03:30
hamed 68dfe613a2 feat(payment): add test mode check for payment callback IP validation 2026-06-15 13:17:28 +03:30
hamed 5fd45b429e feat(subscription): include amount_rials in subscription payment mutation 2026-06-15 13:02:06 +03:30
hamed 3763c83471 feat(payment): refactor payment configuration retrieval into a custom hook 2026-06-15 12:56:43 +03:30
hamed d13d8436ab feat(patient): add search user functionality by mobile number 2026-06-15 12:52:45 +03:30
hamed 95f5918118 feat(secretary): enhance secretary management with name input and toggle activation feature 2026-06-15 12:23:07 +03:30
hamed fa6656df48 feat(subscription): implement feature gating for subscription-based access in admin panel 2026-06-15 12:00:36 +03:30
hamed 3d33cf09b8 feat(auth): enhance access control in PrivateRoute and display error message in LoginPage 2026-06-15 11:41:52 +03:30
hamed 8c0b3d8282 feat(payment): add endpoint for payment configuration and update UI for test mode 2026-06-15 11:35:23 +03:30
hamed 5f5b0fa548 fix: update permissions structure for secretary API interactions 2026-06-15 11:25:14 +03:30
hamed 5cdcec23a9 feat: enhance staff management and payment gateway features
- Fix national code handling in staff creation and updates to support Persian digits.
- Update ClinicStaff entity to allow longer national codes (up to 15 characters).
- Implement support for clinic secretaries in SecretaryController, allowing creation without a doctor UUID.
- Add a new endpoint to retrieve doctors associated with a clinic for secretary management.
- Improve appointment management by ensuring doctors are selectable even when no appointments exist.
- Extend PatientController to allow secretaries to create patient records if they have the appropriate permissions.
- Introduce a PriceInput component for better price formatting in forms, supporting Persian digits.
- Add a MockGateway for testing payment processes without real transactions.
- Enhance SMS settings management with an approval flow for post-visit text messages, including new fields for pending text and status.
- Update migrations to reflect changes in database schema for national codes and SMS settings.
2026-06-15 11:03:56 +03:30
hamed 55f646e2d4 feat: redesign StaffPage with KPI bar, improved table layout, and enhanced form fields 2026-06-14 23:36:37 +03:30
hamedandClaude Sonnet 4.6 5be63a23b6 feat: redesign SubscriptionPage with improved UI/UX
- Active subscription card: colored gradient bg, icon, progress bar, expiry warning badge
- Trial banner: shown when no subscription and trial not used yet
- Plan cards: icon header, feature checklist (✓/✗), per-period buy buttons inline
- Free plan card shows "شما اکنون در این پنل هستید" when current
- Payment modal: order summary card + gateway selector with styled radio buttons
- Loading skeleton for plan cards
- Footer with trust signals

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-14 23:16:04 +03:30
hamedandClaude Sonnet 4.6 ab9d078bf0 fix: fix SubscriptionPage crash — align with API response structure
API returns { subscription: {...}|null, used_trial: bool } not flat MySubscription.
- Added MySubscriptionData interface with correct nested shape
- Extract my = myRaw.subscription and usedTrial = myRaw.used_trial separately
- Replace my.used_trial references with usedTrial variable

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-14 23:12:22 +03:30
hamedandClaude Sonnet 4.6 94580894c8 feat: add MySecretariesPage and AdminSubscriptionPage (PRD completion)
- MySecretariesPage: doctor/clinic can manage their own secretaries
  with add/permissions-matrix/deactivate; uses GET /api/v1/secretaries/{doctorUuid}
- AdminSubscriptionPage: admin can create/edit plans and periods,
  view subscription sales report; tabs: پنل‌ها / گزارش فروش
- Sidebar: add منشیان link for doctor+clinic roles, add اشتراک‌ها link for admin
- App.tsx: add /my-secretaries and /admin-subscription routes

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-14 22:57:30 +03:30
hamedandClaude Sonnet 4.6 5a4116fee0 feat: add date range filter and new stats to dashboard (TASK-16)
- AdminDashboard: adds this_week/this_month/3_months preset buttons; charts query now passes from/to params; renamed appointments_30d→appointments_by_day and revenue_30d→revenue_by_day; adds subscription_sales_by_plan table
- ClinicDashboard: adds preset filter; query passes from/to; adds sms_wallet_balance, unique_patients_count, revenue_period_rials KPI cards
- DoctorDashboard: adds preset filter; query passes from/to; adds unique_patients_count, revenue_period_rials KPI cards
- Shared: getRange() helper and DatePreset type extracted at module level

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-14 22:33:56 +03:30
hamedandClaude Sonnet 4.6 69df9947a9 feat: rewrite MyPatientsPage with patient records and sessions (TASK-15)
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-14 22:27:15 +03:30
hamedandClaude Sonnet 4.6 ed18c260ca feat: add Staff, Subscription, ClinicServices, SmsWallet pages (TASK-10,11,13,14)
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-14 22:23:30 +03:30
hamed ab5dca4fb6 feat: add doctor_uuid support in authStore and update DoctorDetailPage to prioritize doctorUuid 2026-06-13 19:19:50 +03:30
hamed 09c393a574 feat: update primaryRole handling in authStore and adjust context role for clinics 2026-06-13 18:47:26 +03:30
hamed d05c070661 feat: enhance doctor address management by including clinic addresses and enforcing required fields 2026-06-13 18:30:06 +03:30
hamed c1c57df4ff feat: add clinic role support to doctor profile access and update API endpoint for clinic owners 2026-06-13 18:10:44 +03:30
hamed 5c2e9fae3f feat: add EyeIcon button to view doctor profile in ClinicDetailPage 2026-06-13 18:03:41 +03:30
hamed aa15addcb9 feat: implement doctor invitation acceptance logic to add doctors to clinic_doctors 2026-06-13 17:53:27 +03:30
hamed 5c167b5d39 feat: add owner mobile information to ClinicsPage and update API to fetch owner mobile 2026-06-13 17:39:56 +03:30
hamed d50fb96542 pwa setting 2026-06-13 13:28:39 +03:30
hamed 0b5d017b14 feat: enhance DoctorDetailPage with edit form helpers and gender selection options 2026-06-12 22:58:28 +03:30
hamed 87966a90fa feat: update ClinicDetailPage and ClinicsPage for address handling and UI improvements 2026-06-12 22:39:11 +03:30
hamed 960ff1ab29 feat: enhance DoctorFormPage with searchable specialties and improved UI components
- Refactored DoctorFormPage to use Controller from react-hook-form for better form handling.
- Added a new Field component for consistent input styling and error handling.
- Implemented a SpecialtyPicker component with improved selection logic for specialties.
- Updated the layout and styling of the form sections for better user experience.
- Integrated SearchableSelect for selecting specialties and roles in DoctorsPage and UsersPage.
- Added createClinic API endpoint to handle clinic creation with validation for mobile and name fields.
2026-06-12 20:43:47 +03:30
hamed 9e8064e101 feat: enhance SpecialtyPicker to support parent-child relationship for specialties 2026-06-12 19:32:56 +03:30
hamed 34ba1b781c fix: update clinicAddresses assignment for improved data handling 2026-06-12 14:52:50 +03:30
hamed 0333b24071 feat: enhance DoctorAddress entity to support clinic addresses and types
- Added `clinic_id` and `type` fields to `DoctorAddress` entity to differentiate between personal and clinic addresses.
- Updated constructor to support creation of addresses for both doctors and clinics.
- Modified repository methods to handle new address types and added methods for counting and finding addresses by clinic.
- Implemented migration to update the database schema accordingly.
- Removed deprecated endpoint for creating addresses from clinics and updated related controller methods.
- Added new endpoints for managing clinic addresses, including CRUD operations.
- Updated frontend components to handle new address types and display accordingly.
2026-06-12 13:39:37 +03:30
hamed 63073c6a42 feat: implement OTP login and password reset functionality with corresponding API endpoints and frontend updates 2026-06-12 12:54:29 +03:30
hamed 8ad983310c feat: add clinic management and financial reporting features
- Implemented ClinicFormPage for adding new clinics with validation.
- Created MyFinancialPage to display financial summaries and charts.
- Developed MyPatientsPage for managing patient data with search and pagination.
- Added PreRegistrationsPage for handling pre-registration requests with approval and rejection functionalities.
- Introduced database migration for pre_registrations table.
- Built PreRegistrationController for managing pre-registration logic, including submission, approval, and rejection.
- Created PreRegistration entity and repository for handling pre-registration data.
2026-06-12 12:31:27 +03:30
hamed 484d3024c1 Refactor code structure for improved readability and maintainability 2026-06-12 11:00:24 +03:30
hamed c05ac7ca51 feat: add past slot validation to appointment controllers and update SlotCard component 2026-06-11 20:00:02 +03:30
hamed c1df5b73e7 feat: add appointment time and patient name display to CancelledBadge component 2026-06-11 19:57:53 +03:30
hamed 5a7df22eda feat: enhance appointment scheduling with session management and availability checks 2026-06-11 19:56:27 +03:30
hamed 0b31eb7812 fix: resolve calendar crash and enhance appointment management
- Fixed calendar crash due to invalid array length in PersianCalendar.tsx by changing locale to 'en-u-ca-persian'.
- Added Persian weekday display in DateNavigator with appropriate styling and logic.
- Updated empty slot message to indicate when a day is off.
- Made patient name a required field in appointment creation and implemented find-or-create logic for patients in both admin and user endpoints.
- Corrected mobile number display to show the patient's number instead of the doctor's in appointment listings.
- Ensured booked appointments are displayed correctly in the schedule view.
- Removed unnecessary operations column from the appointments table view.
2026-06-11 19:35:12 +03:30
hamed 277922d4ae feat: add doctor profile page with sidebar integration and routing 2026-06-11 19:06:59 +03:30
hamed 704075770b feat(api): enhance appointment retrieval and add today stats endpoint 2026-06-11 14:32:10 +03:30
hamed 45ee725820 feat: update appointment management API and frontend components
- Added new endpoint to get today's appointment statistics with optional date filter.
- Enhanced appointment listing API to support filtering by date and doctor UUID.
- Updated Appointment model to include new fields and modified status values.
- Implemented AppointmentStatusDropdown component for status management with visual feedback.
- Created PersianCalendar component for date selection in Jalali format.
- Updated API documentation to reflect changes in appointment management.
2026-06-11 14:13:42 +03:30
hamed 82e1c264a1 feat: add doctor invitation modal and appointment creation API
- Implemented InviteDoctorModal component for inviting doctors to clinics.
- Updated ClinicDashboard to include a button for inviting doctors and handle modal state.
- Added createAppointment API endpoint in AdminApiController for scheduling appointments.
- Enhanced ClinicInvitationController to check user access when inviting doctors.
- Updated MyAppointmentsController to ensure unique appointment records.
- Added seed_test_data.php for populating test data including doctors, clinics, and appointments.
- Refactored styles to include new appointment status badges and updated font imports.
2026-06-11 13:36:54 +03:30
hamed e7b90a6399 feat(api): add dashboard endpoints for clinic, doctor, and secretary roles
- Implemented GET /api/v1/dashboard/clinic to return clinic stats and today's schedule for clinic owners.
- Implemented GET /api/v1/dashboard/doctor to return doctor's stats and today's schedule for doctors.
- Implemented GET /api/v1/dashboard/secretary to return stats and conditional appointments for secretaries.

feat(migrations): create user_active_context and mobile_verification_otp tables

- Added migration to create user_active_context table for tracking active user sessions.
- Added migration to create mobile_verification_otp table for handling mobile number verification.

feat(migrations): create site_config table for application settings

- Added migration to create site_config table to store various site configuration settings.

feat(appointments): create MyAppointmentsController for user-specific appointments

- Added MyAppointmentsController to handle fetching user-specific appointments with pagination and filtering.

feat(auth): implement NotificationMobileController for mobile number verification

- Added NotificationMobileController to handle OTP requests and verification for mobile number changes.

feat(auth): create MobileVerificationOtp entity for OTP management

- Created MobileVerificationOtp entity to manage OTP records for mobile verification.

feat(auth): create UserActiveContext entity for user session management

- Created UserActiveContext entity to manage user active sessions.

feat(config): implement SiteConfigController for managing site settings

- Added SiteConfigController to handle fetching and updating site configuration settings.

feat(config): create SiteConfig entity and repository for configuration management

- Created SiteConfig entity and repository to manage site configuration data.
2026-06-11 12:20:12 +03:30
hamed e88ae9bf9c feat: enhance ClinicDetailPage with dynamic tab management in EditModal
- Added initialTab prop to EditModal for setting the active tab on open.
- Updated state management in ClinicDetailPage to handle initial tab for editing.
- Refactored openEdit function to set the initial tab before opening the edit modal.
- Combined specialties, insurances, and services sections in the sidebar for better organization.
- Improved modal rendering using createPortal for better context handling.

style: increase z-index for modal overlay

- Updated the z-index of the overlay class in styles.css to ensure modals appear above other elements.

feat: implement multi-role dashboard functionality

- Created a new prompt for multi-role dashboard implementation.
- Defined roles and their access levels in the admin panel.
- Updated backend to support user role identification and context retrieval.
- Enhanced frontend to dynamically render components based on user roles.
- Added new routes and components for role-specific dashboards.

chore: add skills for admin endpoint and page creation

- Created SKILL.md files for adding admin endpoints and pages.
- Provided templates and guidelines for implementing new admin features.

chore: sync database after entity changes

- Added a new skill for syncing the database after any entity modifications.
2026-06-11 09:28:51 +03:30