1. 01 Jul, 2026 2 commits
  2. 30 Jun, 2026 26 commits
    • Mahmoud Aglan's avatar
      Fix 3 bugs: participant branch, layout update, receipt branch · 23c68694
      Mahmoud Aglan authored
      1. ParticipantForm: set branch_id from session in mount() so new
         participants get the active branch (was null, invisible in list)
      2. SpaceLayoutService::update: compare config BEFORE updating the model
         so change detection works (was comparing same value to itself)
      3. ReceiptSettings: use session branch_id instead of user->branch_id
         which could be null, preventing template save
      Co-Authored-By: 's avatarClaude Opus 4.6 <noreply@anthropic.com>
      23c68694
    • Mahmoud Aglan's avatar
      Fix participant import: rename $errors to $importErrors to avoid Livewire conflict · f98f2b2b
      Mahmoud Aglan authored
      Livewire reserves $errors for the validation MessageBag. Using the same
      name as a public property causes a 500 error on render.
      Co-Authored-By: 's avatarClaude Opus 4.6 <noreply@anthropic.com>
      f98f2b2b
    • Mahmoud Aglan's avatar
    • Mahmoud Aglan's avatar
    • Mahmoud Aglan's avatar
      Fix dashboard branch scoping: invoices don't have branch_id column · 88148120
      Mahmoud Aglan authored
      Invoices use billable morph (not direct branch_id). Scope through
      whereHasMorph on the participant's branch_id instead.
      Co-Authored-By: 's avatarClaude Opus 4.6 <noreply@anthropic.com>
      88148120
    • Mahmoud Aglan's avatar
      Add reports, admin tools, print views, guardian portal, and 15+ features · 909a0b40
      Mahmoud Aglan authored
      - Financial report with daily revenue chart and top programs
      - Attendance report with per-participant stats and CSV export
      - Activity log viewer with filters and expandable details
      - System settings page with grouped tabs
      - Guardian portal dashboard (children, attendance, invoices)
      - Payment plan creation UI with installment preview
      - Coupon validator component
      - Invoice, group schedule, participant card, and certificate print views
      - Session rescheduling component
      - Participant freeze/unfreeze, bulk status change, status timeline
      - Enrollment history component
      - Dashboard widgets (revenue, enrollment trends)
      - Dark mode toggle, language switcher, locale middleware
      - API stats endpoint for mobile
      - Parent weekly SMS report command
      - Group capacity alert command
      Co-Authored-By: 's avatarClaude Opus 4.6 <noreply@anthropic.com>
      909a0b40
    • Mahmoud Aglan's avatar
      Add waitlist management, group transfer, quick attendance, import, profile, and more · b4c9f796
      Mahmoud Aglan authored
      New features:
      - Waitlist manager with promote/cancel actions
      - Group transfer (move participant between groups)
      - Quick attendance marking (mobile-friendly trainer view)
      - Participant CSV import with preview and validation
      - User profile page with password change
      - Daily financial report (printable)
      - Reconcile group counts command
      - Deactivate expired enrollments command
      - Overdue invoice reminders (2x weekly)
      - Sidebar navigation updates (waitlist, transfer, quick attendance, import)
      Co-Authored-By: 's avatarClaude Opus 4.6 <noreply@anthropic.com>
      b4c9f796
    • Mahmoud Aglan's avatar
      Add 25+ features: branch scoping, notifications, exports, scheduling, and more · 54175068
      Mahmoud Aglan authored
      Major additions:
      - Branch scoping for all 15 list components via UsesBranchScope trait
      - Payment notification listener (email/SMS on every payment)
      - Print receipt button on POS, payment wizard, and invoice show
      - CSV export for participants, payments, invoices, enrollments
      - Global search in topbar (participants, invoices, groups)
      - Bulk messaging component (SMS/email by group, status, membership)
      - Weekly schedule visual timetable with program/trainer filters
      - Trainer dashboard (today's sessions, assigned groups, attendance links)
      - Duplicate participant detection in registration wizard
      - Enhanced dashboard: today's schedule, overdue invoices, birthdays, recent payments
      - 7 scheduled commands: daily summary, birthdays, low stock, expiring enrollments,
        installment reminders, overdue reminders
      - Health check endpoint (/health)
      - Participant transfer service and group capacity service
      - WhatsApp link helper for quick communication
      - User activity tracking middleware
      Co-Authored-By: 's avatarClaude Opus 4.6 <noreply@anthropic.com>
      54175068
    • Mahmoud Aglan's avatar
      Add member/non-member pricing fields to program form · 22d54f2b
      Mahmoud Aglan authored
      Prices are stored as base_prices with metadata.membership_type.
      Shows two fields: member price and non-member price (EGP).
      Co-Authored-By: 's avatarClaude Opus 4.6 <noreply@anthropic.com>
      22d54f2b
    • Mahmoud Aglan's avatar
      Add branch switcher in topbar with session-based branch scoping · 0618b998
      Mahmoud Aglan authored
      - BranchSwitcher component in topbar: select branch or "all branches"
      - UsesBranchScope trait: all components read active branch from session
      - Dashboard/Reports: filter by selected branch, show all when "all"
      - Receptionist wizards: use session branch instead of user->branch_id
      Co-Authored-By: 's avatarClaude Opus 4.6 <noreply@anthropic.com>
      0618b998
    • Mahmoud Aglan's avatar
      Simplify membership to member/non_member with club membership_id · 4e5b3052
      Mahmoud Aglan authored
      - membership_type now only allows 'member' or 'non_member'
      - Members must provide membership_id (club card number)
      - membership_id is unique per branch (same card can't register twice)
      - Shows membership_id input conditionally when type is 'member'
      Co-Authored-By: 's avatarClaude Opus 4.6 <noreply@anthropic.com>
      4e5b3052
    • Mahmoud Aglan's avatar
    • Mahmoud Aglan's avatar
      Add branch_id to participants/payments and fix error page copy button · 977f178d
      Mahmoud Aglan authored
      Participants and payments are now branch-scoped: migration adds nullable
      branch_id FK to both tables, all creation paths (ParticipantForm,
      receptionist wizards, InvoiceShow, POSService) pass branch_id through.
      
      Error page copy button rewritten to use a hidden textarea rendered
      server-side — eliminates JS string escaping issues with multi-line
      error messages and special characters.
      Co-Authored-By: 's avatarClaude Opus 4.6 <noreply@anthropic.com>
      977f178d
    • Mahmoud Aglan's avatar
      Fix receptionist 403 for super admins without branch_id · 596c3ee3
      Mahmoud Aglan authored
      Super admins and academy owners aren't tied to a branch. Instead of
      aborting, fall back to the first active branch so they can still
      access the receptionist desk.
      Co-Authored-By: 's avatarClaude Opus 4.6 <noreply@anthropic.com>
      596c3ee3
    • Mahmoud Aglan's avatar
      Add platform service fee (3%) on all transactions · d35573dd
      Mahmoud Aglan authored
      Revenue model: 3% fee on every POS transaction, shown as "مصاريف خدمة"
      on receipts and invoices. The percentage is controlled ONLY via the
      PLATFORM_SERVICE_FEE_PERCENT env var — not editable by any admin.
      
      - PlatformFeeService: calculates fee from env var (default 3%)
      - POSService: includes service_fee_amount in transaction + invoice total
      - POS terminal UI: shows fee line before grand total
      - Receipt print: displays "مصاريف خدمة" row
      - Invoice show: displays service fee row
      - System settings: read-only banner showing the current fee percentage
      - Migration: adds service_fee_amount column to pos_transactions + invoices
      Co-Authored-By: 's avatarClaude Opus 4.6 <noreply@anthropic.com>
      d35573dd
    • Mahmoud Aglan's avatar
    • Mahmoud Aglan's avatar
      Add receipt template system, branch-scoped receptionist, and business logic fixes · c314a847
      Mahmoud Aglan authored
      - Receipt templates: configurable per-branch with field toggles, section ordering,
        and appearance settings (paper width, font size, currency symbol)
      - ReceiptController for printing POS/payment receipts via thermal layout
      - Receipt settings UI (Livewire) under Settings for branch managers
      - Branch-scoped receptionist: all 4 wizards enforce user's branch_id
      - Wallet freeze guard: deposit/withdraw now reject frozen wallets
      - Overdue invoice job: daily command transitions sent→overdue past due_date
      - Session generation scheduler: daily command creates upcoming training sessions
      - Default receipt template created during setup wizard
      Co-Authored-By: 's avatarClaude Opus 4.6 <noreply@anthropic.com>
      c314a847
    • 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
  3. 29 Jun, 2026 12 commits