1. 30 Jun, 2026 9 commits
    • Mahmoud Aglan's avatar
      Enforce no two groups on same cell, allow trainer overlap · 69cb95b2
      Mahmoud Aglan authored
      - Group-to-group segment overlap is blocked (hard error)
      - Trainer-to-group overlap is allowed (trainers supervise areas)
      - Checks pending unsaved assignments, not just DB reservations
      - Proper Arabic error message explaining the constraint
      Co-Authored-By: 's avatarClaude Opus 4.6 <noreply@anthropic.com>
      69cb95b2
    • Mahmoud Aglan's avatar
      Add comprehensive conflict detection + flexible time to schedule builder · 4794a02c
      Mahmoud Aglan authored
      ScheduleConflictService checks ALL sources of trainer/group conflicts:
      - TrainingSchedule (recurring weekly assignments)
      - TrainingSession (specific date overrides)
      - TrainingGroup.head_trainer_id (implied trainer commitment)
      - Assignment model (formal polymorphic assignments)
      
      Schedule Builder improvements:
      - Flexible time picker (any minute interval, not just hourly)
      - Trainer availability indicators (green dot = free, orange = busy)
      - Group availability indicators (red warning if scheduled elsewhere)
      - Implied trainer warnings (group's head trainer conflict = soft warning)
      - New vs existing assignments visually distinct (green = unsaved)
      - Trainer name shown on existing reservations
      - Row/column/all selection helpers
      - Recurring booking checks group + trainer + space conflicts per date
      - Cancel series now deactivates the underlying TrainingSchedule
      - Final validation pass before commit (double-check for race conditions)
      Co-Authored-By: 's avatarClaude Opus 4.6 <noreply@anthropic.com>
      4794a02c
    • Mahmoud Aglan's avatar
      Add Visual Schedule Builder for drag-drop facility scheduling · e0119a1d
      Mahmoud Aglan authored
      Full-featured schedule builder with:
      - Facility selection, date navigation, weekly view
      - Hourly time slot grid showing existing reservations
      - Grid/segment view with drag-drop group assignment
      - Trainer drag-drop with overlap support
      - Collision detection via SpaceCollisionService
      - Single-date save and recurring weekly booking (N weeks, multi-day)
      - Cancel single reservation or entire recurring series
      - RTL Arabic-first UI with Alpine.js interactivity
      Co-Authored-By: 's avatarClaude Opus 4.6 <noreply@anthropic.com>
      e0119a1d
    • Mahmoud Aglan's avatar
      Add financial overview dashboard, enforce setup wizard, fix permission system · 71a6c06f
      Mahmoud Aglan authored
      Financial Overview:
      - New FinancialOverview Livewire component with P&L, break-even gauge,
        facility costs breakdown, revenue sources, collection rate
      - Migration adds monthly_rental_cost to facilities table
      - Monthly cost field added to facility form
      - Sidebar entry under المالية section
      
      Setup Wizard Enforcement:
      - Activities are now mandatory (min 1)
      - Programs are now mandatory with price > 0
      - Facilities are now mandatory with monthly cost field
      - Auto-creates BasePrice records for programs during setup
      - Facility form includes operating hours and monthly cost
      
      Permission System Fix:
      - PermissionSeeder now called from DatabaseSeeder (has correct permission
        names matching route middleware: pos.sell, attendance.mark, etc.)
      - Branch manager gets all relevant module prefixes (inventory, pricing,
        wallets, activities, audit, notifications)
      - Receptionist gets pos.sell, pos.list, cash_sessions.manage
      - Accountant gets reports.view, wallets.view, pricing.list
      - PermissionService falls back to roles() pivot when primaryRole is null
      - SetCurrentAcademy middleware eager-loads roles.permissions as fallback
      Co-Authored-By: 's avatarClaude Opus 4.6 <noreply@anthropic.com>
      71a6c06f
    • Mahmoud Aglan's avatar
      Add copy-all button to error page for clipboard export · 2fc16d13
      Mahmoud Aglan authored
      Big prominent button copies full error report (exception, stack trace,
      request data, SQL queries, session) as formatted text to clipboard.
      Visual feedback with green check animation on success.
      Co-Authored-By: 's avatarClaude Opus 4.6 <noreply@anthropic.com>
      2fc16d13
    • Mahmoud Aglan's avatar
      Add visual Space Assignment system for groups to facility segments · 40d21535
      Mahmoud Aglan authored
      Features:
      - SpaceLayoutManager: full CRUD for facility layouts (grid/lanes/zones/custom)
        with visual segment preview and toggle availability
      - SpaceAssignmentWizard: 5-step wizard for assigning groups to facility segments
        Step 1: Search and select training group
        Step 2: Choose which schedule slot to assign
        Step 3: Pick the facility (if not already linked)
        Step 4: Visual grid/lane/zone selector with real-time collision detection
        Step 5: Success confirmation
      - Visual grid renders as clickable cells showing available/selected/occupied/disabled states
      - Real-time collision checking against existing confirmed reservations
      - Saves space_reservation_template on TrainingSchedule for auto-reservation on session creation
      - Fix: ReservationService.autoReserveForSession() now uses correct field names
        (space_reservation_template instead of segments, segment_ids instead of segments key)
      - Added "التخطيط" action link in facility list table
      - Added "تعيين المساحات" to sidebar navigation
      Co-Authored-By: 's avatarClaude Opus 4.6 <noreply@anthropic.com>
      40d21535
    • Mahmoud Aglan's avatar
      Add full branding settings system with live color theming · 4c209476
      Mahmoud Aglan authored
      - BrandingSettings Livewire component with file uploads (logo, dark logo,
        favicon, signature, login background, invoice header)
      - Color picker for primary/secondary/accent/sidebar/status colors with
        live preview panel and preset palettes
      - Typography settings (Arabic/English font, base font size)
      - Invoice/receipt footer text and terms & conditions
      - Display toggles (logo in sidebar, logo in invoice, signature, compact mode)
      - CSS variables injected into app layout that drive sidebar, buttons, etc.
      - Sidebar now uses --brand-sidebar-bg/text/active variables
      - Logo displays in sidebar when uploaded
      - SystemSettingsSeeder populates all 6 groups with 50+ settings
      Co-Authored-By: 's avatarClaude Opus 4.6 <noreply@anthropic.com>
      4c209476
    • Mahmoud Aglan's avatar
      Fix PermissionSeeder: use correct column names (name not slug, permission_role... · 5fcdb075
      Mahmoud Aglan authored
      Fix PermissionSeeder: use correct column names (name not slug, permission_role not role_permissions)
      Co-Authored-By: 's avatarClaude Opus 4.6 <noreply@anthropic.com>
      5fcdb075
    • Mahmoud Aglan's avatar
      Fix system coherence: RTL layout, DB column mismatches, permissions, global error handler · 4de529eb
      Mahmoud Aglan authored
      - Fix sidebar positioning (end-0 → start-0) so it appears on the RIGHT in RTL
      - Fix main content margin (me-64 → ms-64) to offset sidebar correctly
      - Fix TrainingProgram queries using non-existent is_active column → status
      - Fix User queries using is_active → status
      - Fix invoice type 'invoice' → 'standard' to match CHECK constraint
      - Fix CollectPaymentWizard using balance_due → due_amount + billable morphs
      - Fix notification template Blade parse error (unclosed parenthesis)
      - Align 10+ sidebar permission checks with actual route middleware permissions
      - Add missing permissions to seeder (pos.sell, inventory.list, reports.view, etc.)
      - Add comprehensive global error handler with full stack trace, SQL log, request data
      - Add Arabic error pages (500, 403, 404) with detailed debugging info
      Co-Authored-By: 's avatarClaude Opus 4.6 <noreply@anthropic.com>
      4de529eb
  2. 29 Jun, 2026 13 commits