1. 05 Jul, 2026 9 commits
    • Mahmoud Aglan's avatar
      Use env vars for admin/academy in seeder instead of hardcoded values · b157adba
      Mahmoud Aglan authored
      Reads ADMIN_EMAIL, ADMIN_PASSWORD, ADMIN_NAME, ACADEMY_NAME_EN,
      ACADEMY_NAME_AR from env — set by the manager during provisioning.
      Falls back to defaults for dev environments.
      Co-Authored-By: 's avatarClaude Opus 4.6 <noreply@anthropic.com>
      b157adba
    • Mahmoud Aglan's avatar
      Fix entrypoint: ensure APP_KEY= line exists, remove missing command · 02aeadc1
      Mahmoud Aglan authored
      - key:generate needs an APP_KEY= line in .env to write to (even empty)
      - Replace el-captain:setup (doesn't exist) with db:seed
      Co-Authored-By: 's avatarClaude Opus 4.6 <noreply@anthropic.com>
      02aeadc1
    • Mahmoud Aglan's avatar
      Fix entrypoint: dump Docker env vars to .env before config:cache · 718e4270
      Mahmoud Aglan authored
      CapRover passes env vars as container environment, but Laravel's
      config:cache reads from .env file. Must dump env to .env first,
      then generate APP_KEY if missing.
      Co-Authored-By: 's avatarClaude Opus 4.6 <noreply@anthropic.com>
      718e4270
    • Mahmoud Aglan's avatar
      Fix invoice print for tablets/phones: open dedicated print page instead of window.print() · ecdaefbf
      Mahmoud Aglan authored
      - Registration wizard now opens /invoices/{uuid}/print in new tab instead of printing whole page
      - Print view redesigned: mobile-responsive layout, touch-friendly 48px buttons, proper viewport
      - Share button (Web Share API) shows on mobile devices that support it
      - Print-receipt-button component changed from window.open popup to target=_blank link
      - Added min-height 48px to all action buttons for touch accessibility
      Co-Authored-By: 's avatarClaude Opus 4.6 <noreply@anthropic.com>
      ecdaefbf
    • Mahmoud Aglan's avatar
      Remove 23 hardcoded business decisions: all financial/operational behaviors... · 4cb2acc4
      Mahmoud Aglan authored
      Remove 23 hardcoded business decisions: all financial/operational behaviors now configurable per-academy
      
      Every penalty, compensation, auto-invoice, and automation is now guarded by a
      SettingsService toggle (default OFF for financial, ON for operational). Added
      88 system settings across 8 groups with Arabic labels, conditional UI visibility
      for dependent fields, and a new "رواتب وتعويضات" admin tab.
      Co-Authored-By: 's avatarClaude Opus 4.6 <noreply@anthropic.com>
      4cb2acc4
    • Mahmoud Aglan's avatar
      Wire all cross-module integrations: events, enforcement, dashboard, scheduled jobs · 101a0f35
      Mahmoud Aglan authored
      Money flows:
      - Payslip paid → double-entry financial transaction (debit salary expense / credit cash)
      - POS sale → inventory movements for tracked products
      - Enrollment → auto-invoice via PricingService
      - Invoice overdue detection enhanced with balance guard
      
      Operational events (previously empty → now wired):
      - AssignmentCreated → generate trainer attendance expectations
      - AssignmentEnded → remove future trainer attendance
      - FacilityStatusChanged → cancel reservations on maintenance
      - PurchaseOrderReceived → create receiving inventory movements
      - StockCountCompleted → process count adjustments
      - KitAssembled → deduct component stock
      - InventoryMovementCreated → check low stock threshold
      
      Business rule enforcement:
      - Medical certificate enforcement at attendance time (configurable)
      - Group capacity check + auto-waitlist on enrollment
      - Participant status blocking (frozen/suspended can't enroll)
      - Attendance threshold from settings (not hardcoded)
      
      Dashboard rebuilt with actionable data:
      - Today's sessions, trainers present, payments, active participants
      - Needs-attention cards (overdue invoices, pending approvals, expired docs)
      - Today's schedule with take-attendance buttons
      - Recent payments feed + quick action buttons
      
      Scheduled jobs:
      - attendance:auto-absent (hourly)
      - documents:expire (daily 06:00)
      - payments:detect-defaults (daily 08:00)
      - attendance:send-alerts (daily 20:00)
      Co-Authored-By: 's avatarClaude Opus 4.6 <noreply@anthropic.com>
      101a0f35
    • Mahmoud Aglan's avatar
      Add full HR payroll/compensation system: auto-earn on attendance, payslips, advances · 0aa21bd4
      Mahmoud Aglan authored
      Complete trainer compensation lifecycle:
      - 7 migrations (trainer_compensations, payroll_periods, payslips, payslip_items, trainer_advances, trainer_rate_history + make employee_id nullable for freelancers)
      - 7 enums, 6 models with proper relationships
      - CompensationCalculatorService: auto-calculates session/player/revenue/penalty earnings
      - PayrollService: period management, bulk payslip generation, approval workflow, payment recording
      - TrainerAdvanceService: salary advance/loan lifecycle with installment tracking
      - Event listeners: AttendanceMarked → auto-compensation, SessionCancelled → trainer pay
      - 4 Livewire pages: PayrollDashboard, TrainerCompensations, PayslipDetail, TrainerAdvances
      - Sidebar navigation + routes with permission middleware
      Co-Authored-By: 's avatarClaude Opus 4.6 <noreply@anthropic.com>
      0aa21bd4
    • Mahmoud Aglan's avatar
      Fix layout path: components.layouts.app → layouts.app in 11 Livewire components · f9fa8862
      Mahmoud Aglan authored
      The layout file lives at resources/views/layouts/app.blade.php, so the
      correct Livewire attribute is Layout('layouts.app'). 11 components had
      the wrong path 'components.layouts.app' causing MissingLayoutException.
      Co-Authored-By: 's avatarClaude Opus 4.6 <noreply@anthropic.com>
      f9fa8862
    • Mahmoud Aglan's avatar
      Overhaul setup wizard: 12 steps, 30+ business improvements, zero schema mismatches · 1959e8e0
      Mahmoud Aglan authored
      Expanded from 10 shallow steps to 12 deep steps covering ALL organization data:
      - Academy profile: phone, email, address, type, website, WhatsApp
      - Branches: working days (inline toggles), email, city, manager name
      - Programs: age range (age_min/age_max columns), sessions_per_week, registration fee (separate BasePrice), payment frequency
      - Facilities: branch selection per facility, visual grid preview
      - Groups: structured schedule (day + start/end time repeater), segment selection
      - Participants: classification (on Person), skill_level (on Participant), national_id, medical_notes, collapsible extras
      - Staff: phone, specialization (creates linked Person for trainers)
      - NEW Step 9: Financial (tax, invoice/receipt prefix, payment methods, wallet, discounts, family discount, trial period)
      - NEW Step 10: Policies (attendance grace periods, auto-absent, suspension threshold, medical/guardian requirements, waitlist, freeze days, email/SMS toggles)
      - Step 11: General settings (currency, timezone, week start, date/time format, pagination)
      - Step 12: Summary dashboard with stats cards
      
      Schema alignment verified: Branch uses operating_hours (not metadata), Person owns classification/medical_notes, Participant owns skill_level, TrainingProgram uses age_min/age_max/sessions_per_week columns directly, all SettingsService keys match SystemSettings schema exactly.
      Co-Authored-By: 's avatarClaude Opus 4.6 <noreply@anthropic.com>
      1959e8e0
  2. 03 Jul, 2026 4 commits
    • Mahmoud Aglan's avatar
      Add messaging update: 78 notification templates, 14 event listeners, public document links · d3e3030e
      Mahmoud Aglan authored
      - Seed 78 notification templates (26 events × 3 channels: in_app, email, sms) in Arabic
      - Create 14 new listeners for previously unwired events (invoice sent/cancelled, wallet deposit/frozen, cash session closed, enrollment completed, session completed, participant registered/status changed/suspended/frozen, evaluation shared, POS receipt)
      - Wire all listeners in EventServiceProvider
      - Add PublicDocumentController with signed URL routes for invoices, receipts, and POS receipts
      - Add PublicLinkHelper for generating 30-day signed URLs
      - Add 3 standalone RTL Arabic public views (invoice, receipt, pos-receipt)
      - Update existing listeners (SendInvoiceNotification, SendOverdueReminder, SendPaymentConfirmation) to include public_link/receipt_link variables
      - Align all listener variable names with template placeholders
      Co-Authored-By: 's avatarClaude Opus 4.6 <noreply@anthropic.com>
      d3e3030e
    • Mahmoud Aglan's avatar
      Fix dashboard security: redirect roles + hide financial data · e11ab21d
      Mahmoud Aglan authored
      - Trainers/head trainers redirect to /trainer dashboard on login
      - Receptionists redirect to /receptionist dashboard
      - Guardians (parents) redirect to /guardian dashboard
      - Financial data (revenue, invoices, payments) only queried if user
        has 'invoices.list' permission — returns null/empty otherwise
      - Blade sections wrapped in @can('invoices.list') so even direct
        URL access shows no sensitive financial info to unauthorized roles
      Co-Authored-By: 's avatarClaude Opus 4.6 <noreply@anthropic.com>
      e11ab21d
    • Mahmoud Aglan's avatar
      Enhance setup wizard: grid builder, groups, participants import · 38768a29
      Mahmoud Aglan authored
      Setup wizard now covers 10 steps (was 8):
      - Facilities step includes visual grid layout builder (rows×columns)
      - New Groups step: create groups with interactive segment multi-select
      - New Participants step: import existing players with guardian data
      - completeSetup() creates SpaceLayout + SpaceSegments for each facility grid
      - Hint encourages max division for scheduling flexibility
      Co-Authored-By: 's avatarClaude Opus 4.6 <noreply@anthropic.com>
      38768a29
    • Mahmoud Aglan's avatar
      Add document management system + 10 feature wizards · 0c8f5bdb
      Mahmoud Aglan authored
      Document system: polymorphic documents table, upload/approve/reject workflow,
      medical certificate tracking with expiry, system settings toggles, daily expire job.
      
      Feature wizards: Employee, Trainer, Program, Group, Facility, Invoice, Product,
      PricingRule, TransferParticipant, StockAdjustment — all with Arabic UI, step-by-step
      guided creation, and delegation to existing services.
      Co-Authored-By: 's avatarClaude Opus 4.6 <noreply@anthropic.com>
      0c8f5bdb
  3. 02 Jul, 2026 3 commits
  4. 01 Jul, 2026 24 commits