Commit Graph
134 Commits
Author SHA1 Message Date
hamed 6084dc5d6b feat: add comprehensive tests for UI components, hooks, and API interactions
- Implement tests for Pagination, StatusBadge, ConfirmDialog, and MobileInput components.
- Add tests for useSubscription, usePaymentConfig, and usePwaInstall hooks.
- Create tests for API requests in the api module, including success and error handling.
- Add utility function tests for formatting and validating Iranian mobile numbers.
- Implement tests for BlogFormPage and BlogsPage to validate form submissions and data fetching.
- Add tests for LoginPage to ensure proper validation and state management.
- Create tests for authStore and uiStore to validate state management and functionality.
- Set up Vitest configuration and testing utilities for consistent testing environment.
2026-06-28 22:58:15 +03:30
hamedandClaude Opus 4.8 2f3f25f48e fix(admin): paginate claims & settlement lists for backend-audit 50-cap
GET /billing/claims and GET /settlement now return only the first 50 rows by
default (data.data unchanged, data.meta added). ClaimsPage and
RepresentationSettlementPage read the full array with no pager, so rows beyond 50
were unreachable. Add page state + ?page/limit + the existing <Pagination>
(reading data.meta.totalRecords).

No change needed for: 422 on claim approve/pay (api.ts already surfaces the
backend message via toast; the admin UI sends no amount so it's unreachable),
the owner-only appointment-settings endpoints (admin user bypasses), and refresh
rotation (authStore.refresh already persists the rotated refresh_token).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-28 21:49:44 +03:30
hamed 1997b78d11 feat(calendar): add year picker functionality to PersianDatePicker and PersianCalendar 2026-06-25 20:00:13 +03:30
hamed 60b2224ec3 Add AST cache files for representation API and ApiIrService
- Created a new JSON file for the representation API documentation, including nodes and edges that describe the API structure and relationships.
- Added another JSON file for the ApiIrService class, detailing its methods, imports, and relationships with other components.
2026-06-25 19:42:42 +03:30
hamed c2c6ae4d02 feat(migrations): add national_code_verified flag to users and normalize bank_account representation
- Added a new column `national_code_verified` to the `users` table.
- Normalized the `bank_account` field in the `representations` table from a single object to an array of IBANs with a default `verified` status of false.

feat(ApiIrService): implement identity verification client for api.ir

- Created `ApiIrService` to handle identity verification via api.ir.
- Implemented methods for matching national code with mobile and IBAN with national code and birth date.
- Added error handling and logging for external API requests.
2026-06-25 19:38:47 +03:30
hamed 9b608aaeac feat(auth): implement refresh token handling and update login method 2026-06-25 17:37:55 +03:30
hamed 694ee28787 feat(settlement): add receipt handling and detail view for settlements 2026-06-25 17:34:39 +03:30
hamed b1a43b7740 feat(sms): add log viewing functionality for SMS messages 2026-06-25 14:20:59 +03:30
hamed 41b435bb88 feat(clinic): allow representation role to view clinic details without edit permissions 2026-06-25 09:42:41 +03:30
hamed e65e506dae feat(representation): add welcome SMS notification for newly added doctors and clinics by representatives 2026-06-25 09:37:20 +03:30
hamed 763ad82b69 feat(settings): add appointment fee configuration and update payment logic 2026-06-24 20:25:58 +03:30
hamed 93fa0fc2c9 feat(representation): enhance finance page with summary cards and improved table styling 2026-06-24 20:16:10 +03:30
hamed 9603b702c1 feat: implement domain guard for commission calculation and enhance representation dashboard
- Added domain guard in CommissionService to ensure commission is calculated only when the appointment is booked under the same representation as the doctor.
- Updated RepresentationController to filter statistics by representation, ensuring accurate data is shown for each representative.
- Introduced new endpoints for the representation dashboard to provide summary statistics, doctor performance, and financial reports.
- Created new pages for RepresentationFinance and RepresentationSettlement to display financial data and allow for settlement requests.
- Added migration to include booking_representation_id in appointments for tracking the representative under which the appointment was booked.
2026-06-24 16:14:41 +03:30
hamed 89e4a424f8 feat(tax): implement tax rate history tracking and API endpoints 2026-06-24 13:17:08 +03:30
hamed 148d033114 feat: Implement financial engine for commission and tax calculations
- Added new configuration keys for appointment and upgrade commissions, tax settings, and SMS panel fee in SiteConfigController and SiteConfigRepository.
- Introduced CommissionService to handle commission calculations for appointments and subscriptions, including tax deductions and SMS fees.
- Created FinancialBreakdown entity and repository to log financial transactions.
- Updated PaymentController to process commissions upon successful payments for appointments and subscriptions.
- Developed FinancialReportPage in the admin panel to display financial breakdowns and summaries.
- Added database migration for the new financial_breakdowns table.
2026-06-24 13:06:17 +03:30
hamed b7df8cf9ee feat(representation): add endpoints for doctor statistics and toggling doctor status 2026-06-24 12:24:53 +03:30
hamed 3eb82ffa7d feat(claims): replace PersianDateInput with PersianDatePicker and add quick date range buttons 2026-06-24 06:24:22 +03:30
hamed 91fb55258a feat(claims): enhance claims filtering with insurance, date range, and patient search 2026-06-24 06:19:25 +03:30
hamed 69beb7b944 feat(insurance): add insurance coverage flag to selected services and update coverage logic 2026-06-24 06:09:05 +03:30
hamed 17f41117f1 feat(tariffs): automate current year tariff registration and sync service price 2026-06-24 04:54:56 +03:30
hamed c189daa860 feat(claims): enrich claims with insurance details and item specifics 2026-06-24 04:48:11 +03:30
hamed 27840da78d feat: integrate insurance coverage management for clinic services
- Updated NewSessionPage to calculate patient share based on insurance coverage rules.
- Refactored billing calculations to utilize new patientShareOf function for service items.
- Enhanced API documentation to reflect changes in service coverage structure.
- Implemented ServiceInsuranceModal for managing insurance coverage per service.
- Added UI components for displaying and editing insurance coverage details.
- Removed obsolete toggle switch styles and adjusted CSS for new components.
- Ensured backend endpoints support both service_item_id and service_item_uuid for flexibility.
2026-06-24 04:23:50 +03:30
hamed 253414ef3e feat(subscription): add switch toggle component and update plan terminology 2026-06-24 03:32:50 +03:30
hamedandClaude Opus 4.8 15e7d92fc1 feat(subscription): gate insurance pages behind "insurance" plan feature
Wrap InsurancePricingPage and ClaimsPage in <FeatureGate feature="insurance">
so direct-URL access is blocked without an active subscription that enables
the feature. Add feature: "insurance" to the sidebar links (doctor/clinic/
secretary sections) so the menu items hide when the plan lacks it.

Make AdminSubscriptionPage feature controls dynamic: derive the plan feature
checkboxes from FEATURE_LABELS (now including "insurance") and switch the Zod
schema to z.record, so adding a feature only touches the label map.

No backend/migration change: plan.features is free-form JSON; existing plans
default to insurance:false and admins enable it per plan.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-24 03:21:52 +03:30
hamed fc87e4a04e feat(schedule): enhance time selection with separate hour and minute dropdowns 2026-06-24 02:43:05 +03:30
hamed fbfe25c3c6 feat(claims): add insurance_name field to claims and update API responses 2026-06-24 02:11:16 +03:30
hamedandClaude Opus 4.8 14c6dd6456 feat(patients): prefill visit price from free-visit price
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-24 01:55:19 +03:30
hamedandClaude Opus 4.8 115690d81a feat(insurance): free-visit price field on pricing page
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-23 22:21:25 +03:30
hamedandClaude Opus 4.8 43e8822db5 feat(patients): visit insurance options from tenant contracts + auto coverage%
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-23 22:17:37 +03:30
hamedandClaude Opus 4.8 0e6111f1be feat(patients): service quantity in visit session
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-23 22:13:51 +03:30
hamedandClaude Opus 4.8 f41314a3ad refactor(ui): unify remaining native selects (claims/sms/wallet/secretaries)
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-23 21:06:45 +03:30
hamedandClaude Opus 4.8 0bc1b4a2e9 refactor(ui): unify selects via SearchableSelect (session form + contracts)
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-23 21:00:19 +03:30
hamedandClaude Opus 4.8 c556f3a53d refactor(insurance): merge pricing into contracts (basic+supp groups)
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-23 20:55:56 +03:30
hamedandClaude Opus 4.8 18ae55ac30 feat(patients): standalone new-session page with sectioned UX
Dedicated route /admin/my-patients/:recordUuid/session/new replacing the
modal: insurance & price section (auto-fill from pricing), services,
payment/notes, sticky live summary. New-visit buttons navigate to it.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-23 20:41:22 +03:30
hamedandClaude Opus 4.8 d049e42ddc feat(insurance): edit tenant insurance contracts
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-23 20:32:34 +03:30
hamedandClaude Opus 4.8 2ef38f082d fix(insurance): pricing section only basic insurances
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-23 20:23:35 +03:30
hamedandClaude Opus 4.8 6ff79b9998 feat(ui-kit): patient detail tab bar (info / sessions)
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-23 20:09:31 +03:30
hamedandClaude Opus 4.8 06d1f1d39b feat(ui-kit): patient card tauri layout + grid/list toggle
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-23 20:05:01 +03:30
hamed 3c867d1e09 feat(caveman): add new caveman communication mode with intensity levels 2026-06-23 19:10:00 +03:30
hamedandClaude Opus 4.8 2b00443af7 feat(ui-kit): orange accent avatar on patient cards (tauri match)
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-23 18:50:43 +03:30
hamedandClaude Opus 4.8 0cef1518d7 feat(ui-kit): tauri pastel stat cards on doctor/clinic dashboards
Exact tauri stat-card palette tokens; doctor and clinic dashboards now
render 4 pastel StatCards (amber/violet/green/pink) matching the
clinic-pro-tauri reference.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-23 17:41:18 +03:30
hamedandClaude Opus 4.8 0bd18d74b7 feat(ui-kit): design tokens + StatCard + button variants (foundation)
Add accent (orange) + pastel stat-card tokens (light/dark), button
accent/outline/lg/block variants, and a pastel StatCard primitive,
aligning the admin design system with the clinic-pro-tauri reference.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-23 17:34:34 +03:30
hamedandClaude Opus 4.8 2206f02396 feat: enrich patient record with full profile
GET /api/v1/patient/{uuid} now returns a `profile` object from UserProfile
(demographics, contact, insurance names resolved). Admin record detail shows
a "patient info" section. Empty fields render as "ثبت نشده".

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-23 17:21:33 +03:30
hamedandClaude Opus 4.8 51d7e24e04 feat: create patient record without prior signup
Extend POST /api/v1/patient to resolve user by uuid or mobile, and
create a new ROLE_USER (name + optional national code, no password)
when no user exists. Admin modal shows a new-patient form on lookup miss.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-23 15:20:56 +03:30
hamedandClaude Opus 4.8 59fb590d65 feat: redesign new-visit modal with insurance selects and live breakdown
Sectioned layout (insurance & price / services / payment / summary),
base+supplementary insurance selects auto-filling visit price and
discount from insurance-pricing, live cost breakdown, unified تومان unit.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-23 15:15:12 +03:30
hamedandClaude Opus 4.8 89191eee57 feat: insurance & medical billing system (6 phases)
Multi-tenant insurance contracts, service coverage, versioned tariffs,
invoice calculation, and insurance claims with debt reporting.

- TenantInsurance: per-tenant insurance contracts (coverage/franchise/ceiling,
  versioning, soft-deactivate) + active guard
- ServiceItem.insuranceCovered + TenantServiceCoverage per-service overrides
- Tariff: versioned yearly tariffs with fallback to ServiceItem price
- Billing domain: Money/ShareBreakdown VOs, BillingCalculator (unit-tested),
  Invoice/InvoiceItem aggregate, InvoiceService.createFromSession
- Claim/ClaimItem with state machine (pending->submitted->approved/rejected->paid),
  ClaimService, insurance-debt report
- ClaimSubmitterInterface + ManualClaimSubmitter (future insurance API ready)
- Admin UI: insurance-pricing page, claims page, service tariff modal,
  service insurance toggle; routes + sidebar entries
- Architecture doc + billing/insurance/clinic-services API docs

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-23 15:05:24 +03:30
hamed 5b1dfe9b40 feat: add national code to patient records and user entity, update related functionality 2026-06-22 19:44:17 +03:30
hamed 3c103bc51e feat: update SMS settings review functionality
- Changed the tab name from 'post-visit-review' to 'post-visit-approved' in SmsPage.
- Introduced a new query for fetching approved post-visit texts.
- Updated the UI to display approved post-visit texts and their details.
- Enhanced the API endpoint to filter SMS settings based on status (pending/approved).
- Added entity name resolution for doctors and clinics in the SMS settings.
- Updated the SmsWalletPage to include new post-visit text variables for SMS templates.
- Improved type definitions in index.ts for better clarity and consistency.
2026-06-22 10:30:46 +03:30
hamed 8b9130011a feat: add export functionality for JSON data in CategoriesPage and update TabActions component 2026-06-21 15:37:24 +03:30
hamed 57965f184d feat: add social media fields to Clinic entity and update API documentation 2026-06-21 13:26:47 +03:30