Commit Graph
413 Commits
Author SHA1 Message Date
hamedandClaude Opus 4.8 9e4ee11831 feat(services): match Figma خدمات page in settings shell + multi-staff
Render the clinic services page (sections → services) inside the settings
sub-navigation shell (SettingsLayout, "خدمات" active) to match the Figma
settings design. Restyle section cards to show the service count and a
status toggle with edit/delete actions, and service cards with labelled
price/duration and personnel chips.

A service can now have multiple personnel: add an additive many-to-many
ServiceItem↔ClinicStaff (staffMembers, EAGER) while keeping the legacy
single `staff` column mirrored for backward compatibility. Endpoints accept
`staff_uuids[]` (falling back to the legacy single `staff_uuid`) and return
`staff_members[]`; the section list now reports `items_count`.

Backfill-safe: pre-migration rows fall back to the single staff in toArray.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-13 13:28:51 +03:30
hamed 5e59785854 Update manifest.json with new file metadata and add new components and pages 2026-07-13 12:47:26 +03:30
hamedandClaude Opus 4.8 174ecfa8fb feat(admin): subscription purchase flow under settings shell
Add a doctor/clinic settings sub-navigation shell (SettingsLayout) with
"خرید اشتراک" as its first section, plus a mobile settings-list page.
Rebuild the plan-selection page with a per-plan billing-period toggle,
single price, most-popular badge and a current-plan status banner.
Add a payment-success page that reads the gateway return params
(?payment_uuid&status), shows the transaction receipt and the newly
active plan, and redirects to the plans page with a toast on any
non-success status.

Frontend only — reuses the existing /api/v1/subscription/* and
/api/v1/subscription-payment endpoints; no backend or API-doc changes.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-13 12:45:57 +03:30
hamed 272da4ad9d Add JSON files for skill and patient update profile test data
- Created a new JSON file for skills related to Figma features, including nodes and edges representing the structure and relationships of skills.
- Added another JSON file for the PatientUpdateProfileTest, detailing the test structure, methods, and their relationships with other components in the codebase.
2026-07-13 11:52:36 +03:30
hamedandClaude Opus 4.8 dda7d74b84 docs(skill): add close-out step to figma-to-feature (commit, then graphify)
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-13 11:51:27 +03:30
hamedandClaude Opus 4.8 580bc983b3 feat(patient): complete "اطلاعات پرونده" demographic form
Backend:
- Add profile columns field_of_study, province_id, city_id, postal_code,
  referral_source (UserProfile + migration).
- Extend PATCH /api/v1/patient/{uuid} to persist all demographic fields
  and return them in the patient profile payload.
- Support editable mobile (login identifier): validation, uniqueness,
  User.setMobileNumber, new ERR_PROFILE_002.
- Update docs/api/patient.md.

Frontend:
- New reusable Input, Field, and PatientRecordInfoForm (RHF + Zod).
- usePatient/useUpdatePatient hooks and patientForm mapping helpers.
- Extend the existing "info" tab in MyPatientsPage to the full field set
  via the shared form (province/city/insurance options, Jalali date).

Tests: Patient entity + PATCH integration (PHPUnit); form, hooks, and
mapping helpers (Vitest).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-13 11:51:18 +03:30
hamed 9d8de9bc33 feat: add Figma token mapping and guidelines for project implementation 2026-07-13 10:57:20 +03:30
hamed 43e057040f chore: remove obsolete Figma mapping and skill documentation 2026-07-13 10:54:26 +03:30
hamed 7d81a14b72 feat: enhance Figma integration guidelines with detailed auditing steps and TODO requirements 2026-07-13 10:48:00 +03:30
hamed c16ebd4be3 feat: add Figma token mapping and guidelines for project implementation 2026-07-13 10:47:01 +03:30
hamed 44b168bb9b docs: update CLAUDE.md for improved project guidance and structure 2026-07-13 10:42:08 +03:30
hamed c1e22f01ba style(admin): reorder patient tabs to match Figma design 2026-07-13 10:16:30 +03:30
hamed 960ac72f6e Refactor code structure for improved readability and maintainability 2026-07-13 10:15:49 +03:30
hamed a4a17bf8c7 feat: add patient appointment interface and endpoints
- Introduced `PatientAppointment` interface to define appointment structure.
- Implemented `findByUserAndDoctorIds` method in `AppointmentRepository` to retrieve appointments for a user filtered by doctor IDs.
- Added `acceptedDoctorIdsByClinic` method in `ClinicDoctorInvitationRepository` to get accepted doctor IDs for a clinic.
- Created new endpoint in `PatientController` to fetch appointments for a patient, ensuring only relevant doctors' appointments are displayed.
2026-07-13 10:15:44 +03:30
hamed 5c09fe8ac3 feat(admin): implement ServiceVisitCard component for improved session display 2026-07-13 09:57:28 +03:30
hamedandClaude Opus 4.8 3cf27aa8e4 style(admin): patient record cards match Figma patients-card
Restyle PatientCard to the Figma patient card: overflow menu (edit/view),
name + orange user avatar, dividers, file number + phone rows, tags row.
Avatar now a solid accent circle with user icon.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-13 09:33:31 +03:30
hamedandClaude Opus 4.8 599382fae4 feat(dashboard): doctor/clinic dashboard matching Figma layout
Restructure to Figma: 4 stat cards (today appts, today/week payments,
total patients) -> two charts (revenue area + patient-count vertical
bars) -> today appointments table. Add today/week payments, total
patients, and 7-day revenue/appointments series to doctor + clinic
dashboard endpoints. Add SvgVBars chart. Update dashboard.md.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-13 09:23:38 +03:30
hamedandClaude Opus 4.8 9e491ae6b9 feat(clinic-services): two-page section→services flow matching Figma
Restructure clinic-services from two-pane to Figma two-view flow:
sections card grid (name, edit, activate/deactivate, 'بخش جدید' modal) →
click a section → its services card grid with breadcrumb back. Service
card matches Figma: overflow menu, active badge, base price, average
time badge, staff chip. Add duration_minutes to ServiceItem (migration
+ create/update + form field). Update clinic-services.md.

(Version20260713050014 syncs pre-existing entity/schema drift.)

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-13 08:41:29 +03:30
hamedandClaude Opus 4.8 5852890819 style(admin): match clinic-services cards exactly to Figma service card
Replicate the Figma patient-service card chrome for catalog items:
overflow menu top-start, status square (active/inactive), name + section
subtitle, label:value rows, price, full-width primary action. Adapts the
frame's fields to catalog data (staff, insurance, price).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-12 22:26:04 +03:30
hamedandClaude Opus 4.8 f26c80040d style(admin): card-grid redesign for clinic-services items
Convert clinic service items from rows to a Figma-style card grid using
cp-card/tokens; drop hardcoded oklch tint. Functionality unchanged.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-12 22:15:03 +03:30
hamedandClaude Opus 4.8 a954a0389d feat(patient): services tab with billing (services, debt, pay, invoice)
Expose session services + per-session billing summary (invoice_uuid,
invoice_status, patient_debt_rials, is_paid) on the sessions endpoint.
Add 'سرویس‌ها' card tab in my-patients: cost, remaining debt, complete
payment (PATCH session), and invoice view modal. Grant secretary access
in BillingController.resolveEntity. Update patient.md + billing.md.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-12 22:13:14 +03:30
hamed f15c57d73c feat(patient): enhance session management with billing details and service tracking 2026-07-12 22:09:13 +03:30
hamedandClaude Opus 4.8 fdce888e0e feat(patient): edit patient basic info (doctor/clinic/secretary)
Add PATCH /api/v1/patient/{uuid} to update User.realName + UserProfile
demographic/insurance fields (mobile stays immutable, national_code
uniqueness enforced). Expose name/family separately in profile payload.
Add edit modal in my-patients. Update patient.md.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-12 22:00:33 +03:30
hamedandClaude Opus 4.8 d3d09fe0f4 style(admin): 8px control radius + 40px control height (tauri)
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-12 21:41:44 +03:30
hamedandClaude Opus 4.8 af2e1179f9 style(admin): tauri sidebar/header dimensions + hover-expand
Sidebar 243px, collapsed 90px, desktop hover-expand overlay.
Responsive topbar height 56/72/82. Transparent sidebar/header borders in dark.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-12 21:40:21 +03:30
hamedandClaude Opus 4.8 02d53cbab4 style(admin): default brand hue to Figma purple
Move purple (h277 c0.177 = #5559CE) to first HUES entry so fresh users
get the tauri purple by default; color picker retained.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-12 21:37:15 +03:30
hamedandClaude Opus 4.8 9023ecc36f style(admin): align color tokens to Figma purple (#5559CE)
Set primary to tauri purple, bg #fafafa/#1f1d2b, dark surface #222433,
text #D7D8ED/#A1A1A1. Sync sRGB fallbacks and @supports oklch block.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-12 21:19:24 +03:30
hamed d2372d4d21 feat(doctors): add city and province filters for doctor listing 2026-07-12 14:59:02 +03:30
hamed bb5884d6bd feat(financial-report): replace PersianDateInput with PersianDatePicker for improved date selection 2026-07-12 14:49:09 +03:30
hamed 147ea0c318 feat(financial-report): add filters for representation, date range, and improve data fetching 2026-07-12 14:47:53 +03:30
hamed 0ec0b92705 feat(representation): add KPI tiles and enhance doctor representation details in admin view 2026-07-12 14:39:03 +03:30
hamed c1e4cd7f94 feat(representation): add representation management for doctors, including attach and update functionality 2026-07-12 14:20:42 +03:30
hamed 1a8b3bfa53 feat(representation): expose doctor representation details and add counts in admin views 2026-07-12 13:00:49 +03:30
hamed 476d5bb80e Refactor code structure for improved readability and maintainability 2026-07-12 09:54:44 +03:30
hamed ca66b86cf9 feat(icons): replace PNG icons with SVG logo for improved scalability and performance 2026-07-12 09:12:13 +03:30
hamed 393408aa92 Merge branch 'feature/irimc-doctor-import' 2026-07-11 20:12:06 +03:30
hamed 23590370b2 feat(doctor): prevent duplicate doctor imports based on medical system code 2026-07-11 19:56:58 +03:30
hamed 6c67d522ba feat(doctor): ensure default office address creation during doctor import 2026-07-11 19:21:24 +03:30
hamed e578deef50 Implement code changes to enhance functionality and improve performance 2026-07-11 17:02:37 +03:30
hamedandClaude Opus 4.8 1508d38daa feat(representation profile): Iranian national-code + IBAN validation, English digits
- national code: full Iranian checksum (control digit + reject all-same),
  not just length 10 → "کد ملی نامعتبر است" on failure
- IBAN (شبا): validate IR + 24 digits + mod-97; input forces uppercase,
  strips to IR/digits, maxLength 26
- Persian/Arabic digits converted to Latin on input and before validation
  so the field behaves with an English/numeric keyboard

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-11 15:20:08 +03:30
hamedandClaude Opus 4.8 2f0131171d feat(doctor): claim captcha+mobile, owner profile delete, admin map zoom fix
- DoctorClaimController: ALTCHA CaptchaGuard on /claim (dev no-op via
  ALTCHA_ENABLED=false); optional `mobile` field must match the logged-in
  user's number (422 ERR_CONFLICT_001 on mismatch)
- DoctorController::delete: now IS_AUTHENTICATED_FULLY — admin (any) or the
  owner of a claimed profile (IDOR-guarded); FK appointment guard kept
- DoctorDetailPage address map: MapController calls map.invalidateSize()
  before flyTo (fixes needing to pick a city twice on a freshly-mounted map);
  geocode retries once (nominatim empty/429 on first hit)
- tests: mobile mismatch, owner-delete allowed + others 403, unclaimed not
  deletable by random user
- docs: doctor-claim.md (mobile+captcha), doctor.md (delete permission)

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-11 14:57:41 +03:30
hamedandClaude Opus 4.8 3dcd4f3b26 feat(doctor): imported IRIMC doctors are active by default
Per request, doctors created via import now set active_doctor_appointment
= true (was false). DoctorImportTest updated to assert active.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-11 14:20:42 +03:30
hamedandClaude Opus 4.8 51432c7bb9 fix(doctor): strip «دکتر» prefix on IRIMC import + name-fix & purge commands
Root cause of "دکتر دکتر …" (and ellipsis-truncated "…نی") in admin: IRIMC
names already contain the «دکتر» title, while the panel renders «دکتر {name}».
Convention is to store the bare name.

- DoctorImportService: normalize name via PersianText::stripDoctorTitle
  (also fixes ي/ی, ك/ک, half-space)
- PersianText::stripDoctorTitle now strips consecutive «دکتر دکتر …» prefixes
- app:doctors:fix-irimc-names: one-off backfill for existing source='irimc'
  rows (dry-run supported) — fixed 340 rows
- app:doctors:purge: FK-safe full wipe of doctors + all dependent tables +
  orphan surrogate users, for a clean test DB (dry-run default, --force to
  apply, prod-guarded)
- tests: PersianTextTest cases for the title stripping; DoctorImportTest
  asserts stored name has no «دکتر» prefix
- docs/api/doctor-import.md: name convention + the two new commands

Verified: import "دکتر صفورا حجازی نیا" → stored "صفورا حجازی نیا" → panel
shows single «دکتر صفورا حجازی نیا».

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-11 14:07:18 +03:30
hamed 0b49b03a1e Refactor code structure for improved readability and maintainability 2026-07-11 13:26:22 +03:30
hamedandClaude Opus 4.8 958105694a feat(admin): doctor claims audit page + owner_status visibility in doctors list
- DoctorClaimsPage: paginated claim requests (status filter, verification
  method, masked mobile, human-readable failure reason, Jalali dates) +
  manual-transfer modal calling POST /api/v1/admin/doctors/{uuid}/transfer
- DoctorsPage: owner_status filter segment (بدون‌مالک/تصاحب‌شده) + badges
  for unclaimed / pending_transfer rows
- doctorsList API mapping now returns owner_status + source
- route /admin/doctor-claims (admin-only) + sidebar entry

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-11 11:49:04 +03:30
hamedandClaude Opus 4.8 af125572c9 feat(doctor): complete IRIMC import feature — claim flow, least-privilege importer, unique import key
- Extract import logic from AdminApiController into DoctorImportService
  (thin DoctorImportController keeps the same route/contract)
- Surrogate users get marker role ROLE_UNCLAIMED_DOCTOR (+ backfill command
  app:doctors:backfill-surrogate-role) enabling safe deletion after claim
- DB-level UNIQUE (source, medical_system_code) + concurrent-import retry
- Doctor profile claim flow (climed.md): shahkar + PersonInfo identity checks
  via existing ApiIrService, Persian name normalization (PersianText),
  pessimistic-lock race protection, DoctorClaimRequest audit table
  (national code hashed, mobile masked), doctor_claim rate limiter,
  public claim-info endpoint, welcome SMS
- Admin support tools: manual transfer endpoint + paginated doctor-claims
  audit list + owner_status filter/fields in admin doctors list
- Least privilege: system owner now gets ROLE_IMPORTER (ROLE_ADMIN stripped),
  import endpoint accepts ADMIN|IMPORTER, isStaff includes IMPORTER
- Headless crawler login: X-Service-Token header bypasses captcha only
  (rate limit + password checks intact; empty env = no bypass)
- docs: doctor-claim.md (new), doctor-import.md, admin.md, doctor.md
- tests: DoctorImportTest (6), DoctorClaimTest (11), PersianTextTest (5)

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-11 11:39:15 +03:30
hamed 83c872bb78 feat: implement doctor import completion feature and crawler enhancements
- Added the remaining components for the doctor import feature in the backend, including role management, ownership transfer endpoint, and captcha bypass for crawler service login.
- Created detailed scenarios for the doctor claim process, ensuring proper identity verification and mobile validation.
- Established a crawler interface for token management and state tracking using SQLite, enabling a resume capability for the crawling process.
2026-07-11 10:55:20 +03:30
hamed 7868577c57 feat(docs): add scenario documentation for importing doctors from IRIMC and managing profile ownership 2026-07-11 10:16:14 +03:30
hamed 744a40c0f6 feat: add ClinicInvitationWebController and related templates for handling clinic invitations
- Implemented ClinicInvitationWebController to manage the invitation process via web.
- Added view and respond methods to handle invitation display and responses.
- Created result.html.twig and view.html.twig templates for rendering invitation results and views.
- Integrated CSRF protection for form submissions.
- Established routes for invitation viewing and responding.
2026-07-11 09:33:55 +03:30
hamed a5e3408e85 feat(docs): add API documentation for doctor import from IRIMC 2026-07-11 09:03:21 +03:30