MT-LMS Employee Docs

MT-LMS User Manual

Reference Guide for Employee, Manager, and System Administrator

1. System Overview & Access

The MT-LMS uses separated portals to ensure security and specific functionality for each user type.

Employee

/employee/login

Employer Admin

/employer/login

Super Admin

/cockpit/login

2. Employee Portal Guide (Livewire)

Dashboard View

The dashboard provides a real-time summary of your current leave entitlements, calculated based on accrual rules and pending requests.

  • Detailed Balance Cards: Show specific entitlement details (Total Allowed, Earned, Spent, Balance) for Annual, Casual, and Sick Leave.

  • Actionable History: Lists all requests with current status. Only **Pending** requests can be edited.

  • Upcoming Leaves: Displays all requests that have been **Approved** and have a future start date.

Applying for Leave (Form Logic)

The application form utilizes intelligent validation to guide you before submission.

  • Eligibility Filter: Only shows leave types for which you meet the min_service_years and gender criteria.

  • Date Constraints: Prevents requests that start or end more than 15 days from the current date.

  • Action Plan Feedback: A notification toast appears dynamically, informing you of the system's plan:

    • Green/Success: Balance is sufficient.
    • Yellow/Warning: Adjustment is required (e.g., Casual deficit covered by Annual balance).
    • Red/Danger: LWP is required (All entitlements exhausted).

3. Manager Action Panel (Filament)

Managers use the central 'Take Action' modal to approve or reject requests only after verifying the financial impact.

Action Flow and Data Context

  • Full Context: The modal displays the Request Details side-by-side with the employee's Current Available Balances (Earned/Spent/Remaining).

  • Adjustment Audit: The manager can clearly see the System's Action Plan (e.g., "Adjust 2 days from Annual, 0 days LWP").

  • Approval Execution: Clicking 'Approve Request' triggers a single atomic transaction:

    • Updates supervisor_status to Approved.
    • Recalculates and overwrites the LeaveBalances table (Source of Truth principle).
    • Calculates the final salary_deduction_amount and saves it to the request log.

  • Rejection: Requires entering a Rejection Reason before submission, which is saved to supervisor_notes.

4. Employer Admin Panel (Filament)

This panel is strictly multi-tenant. Admins only manage data for the company they are linked to.

Policy Management

  • Automated Setup: Mandatory leave types (Annual, Sick, Casual, Maternity) are automatically seeded upon company creation.

  • Customization: Admins customize parameters like max_days and min_service_years (e.g., set Annual to require 1 year).

  • Protection: Critical, seeded types are protected from deletion (is_deletable = false).

5. Core Logic & Rules Summary

Leave Earning (Accrual)

  • Pro-Rata: Calculated based on days worked within the current year, starting from Jan 1st or the joining date.

  • Vesting: The employee must meet the min_service_years threshold defined for the leave type before earning begins.

Adjustment Priority (M2.3 / M3.2)

  1. Primary Balance Check: Is the employee's Casual/Sick balance sufficient?
  2. Adjustment (Transfer): If insufficient, deduct from Available Annual Leave Balance (up to the required deficit amount).
  3. Final LWP: Any remaining deficit is marked as LWP, triggering salary deduction.