Commit Graph
387 Commits
Author SHA1 Message Date
hamed 34d8a400b7 feat(doctors): enhance doctor listing with bookable sorting and filtering, add JSON_EXTRACT DQL function 2026-07-14 11:25:39 +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
hamed 9f56f4aa08 feat(migrations): add ownership fields to doctors table for IRIMC import
- Introduced new columns: owner_status, source, source_ref, managed_by, and claimed_at to the doctors table.
- Created indexes for owner_status and source to optimize queries related to unclaimed doctors.

feat(auth): implement SystemOwnerCommand for managing system-owner user

- Added command to create, activate, and deactivate a system-owner user for IRIMC crawler.
- Ensured the user has ROLE_ADMIN to access import endpoints.
- Handled password setting and user status management within the command.
2026-07-11 08:59:36 +03:30
hamed f30bf5dfbd Add scenario documentation for importing doctors from IRIMC and managing profile ownership
- Introduced a new document outlining the process for importing a dataset of 160 doctors from the IRIMC system into Clinic Pro.
- Defined a new ownership model to handle doctors without a user account, allowing for management by a system owner.
- Documented the technical design changes required in the database and API for the import process.
- Included detailed steps for the import command, field mappings, and validation rules.
- Specified the workflow for claiming profiles by real doctors and the admin approval process.
2026-07-11 08:43:26 +03:30
hamed 2cfc516e2c fix(altcha): update attribute from challengeurl to challenge in Altcha component and home template 2026-07-10 12:06:03 +03:30
hamed 3eee6c3886 Update community IDs, enhance CaptchaController caching, and modify home template for Altcha integration
- Changed community IDs for various components in graph.json to reflect updated associations.
- Added Cache-Control headers to the challenge and config methods in CaptchaController to prevent caching by CDNs and proxies.
- Updated the Altcha widget in home.html.twig to include a language attribute for better localization.
- Added a new AST cache file for CaptchaController to improve performance.
- Updated manifest.json with new modification times and AST hashes for several files.
2026-07-10 11:57:16 +03:30
hamed ec184dfcc8 Add AST cache files for AltchaService, API documentation, and AltchaService tests
- Created JSON representation of AltchaService class and its methods, including imports and relationships.
- Added documentation for the Captcha API, detailing endpoints and responses.
- Introduced test cases for AltchaService, covering various functionalities and edge cases.
2026-07-10 11:42:23 +03:30
hamed c3c520801d feat(captcha): add ALTCHA configuration endpoint and integrate into HomeController
- Introduced a new endpoint `/api/v1/altcha/config` in CaptchaController to return the status of the ALTCHA captcha.
- Updated HomeController to inject AltchaService and pass the captcha status to the home page template.
- Modified the home.html.twig template to conditionally render the ALTCHA widget based on the captcha status.
- Updated manifest.json and cache files to reflect changes in the codebase.
2026-07-10 11:18:40 +03:30
hamed 6f2e0ec2f1 feat: add ALTCHA captcha configuration to docker-compose 2026-07-10 11:07:44 +03:30
hamed 8b6d431f61 feat(auth): integrate Captcha validation in PasswordAuthenticator
- Added CaptchaGuard dependency to PasswordAuthenticator.
- Implemented Captcha validation in the authenticate method to enhance security.
- Updated the login modal in home.html.twig to redirect to the admin panel instead of opening a modal.
- Enhanced the Altcha widget with localized strings for better user experience.
- Removed the login modal implementation from home.html.twig to streamline the login process.
- Updated manifest.json and AST cache files to reflect changes in the codebase.
2026-07-10 11:05:59 +03:30
hamed aded526718 feat: implement login modal and altcha captcha for registration
- Added a login modal to the home page with mobile and password fields.
- Integrated altcha captcha for the registration process to enhance security.
- Updated the registration submission logic to include altcha payload.
- Improved error handling and user feedback for both login and registration processes.
2026-07-10 10:55:37 +03:30
hamed 10b0743d9a Implement ALTCHA captcha service with challenge generation and solution verification
- Added AltchaService class for managing ALTCHA captcha challenges and solutions.
- Created CaptchaController to handle API requests for generating challenges.
- Introduced CaptchaGuard for validating captcha solutions on public endpoints.
- Developed unit tests for AltchaService to ensure challenge creation and solution verification functionality.
- Implemented integration tests for the Captcha API endpoint and captcha bypass behavior when disabled.
- Added documentation for the Captcha API in the corresponding markdown file.
2026-07-10 10:31:59 +03:30
hamed 11efed4100 Add AST cache for AdminLogsTest.php with extracted nodes and edges 2026-07-10 09:48:45 +03:30
hamed 9d2023a72f fix: update JSON-LD schema and trust seal links for accuracy 2026-07-10 09:33:20 +03:30
hamed 7f9ef282c0 feat: update worker commands to ensure continuous message consumption with retry logic 2026-07-09 18:15:24 +03:30
hamed 6587b78f48 namd 2026-07-09 12:27:49 +03:30
hamed 3fbdb01add meta 2026-07-09 12:12:43 +03:30
hamed 0ad8487aac feat: add SeedDemoDataCommand for seeding production-like demo data for testing representations, doctors, clinics, users, appointments, and commissions 2026-07-09 08:07:41 +03:30
hamed 0750bc9812 feat: add multi-city representation support and domain context resolution
- Created migration to add representation_cities table and domain, is_global fields to representations.
- Implemented SiteContextController to resolve domain to site context (city | representation | unknown).
- Developed DomainContext and DomainContextResolver services for domain mapping.
- Added tests for DomainContextResolver and commission logic based on domain ownership.
2026-07-09 07:26:58 +03:30
hamed 59559e2e31 feat: enhance diagnostics script and documentation for Redis connection issues 2026-07-08 20:06:45 +03:30
hamed 880648cae8 Add AST JSON files for new documentation and scripts
- Created JSON representation for `collect-diagnostics.sh` including nodes and edges for its structure.
- Added JSON for `ops-restarts.md` detailing various sections and their relationships.
- Introduced JSON for `server-down-oom-diagnosis.md` capturing its content and connections.
2026-07-08 18:00:01 +03:30
hamed a5460cbaa9 fix: reduce memory_limit to 256M and configure PHP-FPM process management settings 2026-07-08 17:54:20 +03:30
hamed c6fa92b9a4 fix: correct phone number format in home.html.twig 2026-07-08 17:40:35 +03:30
hamed 3e98514bda fix: update contact information and WhatsApp numbers in cities.json 2026-07-08 12:25:55 +03:30
hamed ccbb1d0b1f feat: Add City entity methods and migration for title field
- Created a new JSON file for the City entity's AST representation, detailing its methods and properties.
- Added a migration to alter the cities table by adding a nullable title column.
2026-07-08 12:19:06 +03:30
hamed 94541ad609 Add JSON representation of composer.json structure with nodes and edges 2026-07-08 11:27:54 +03:30
hamed 8f4f7fc951 fix: update KavehNegarProvider to use GET requests with query parameters to resolve 431 and idle timeout errors 2026-07-08 09:51:30 +03:30
hamed 5e5455cf8c fix: add ext-soap to Dockerfile and composer.json to resolve SoapClient not found error in production 2026-07-08 09:37:19 +03:30