Skip to content

Employee management system setup#1

Merged
Keval5252 merged 1 commit intomasterfrom
cursor/employee-management-system-setup-802b
Dec 13, 2025
Merged

Employee management system setup#1
Keval5252 merged 1 commit intomasterfrom
cursor/employee-management-system-setup-802b

Conversation

@Keval5252
Copy link
Copy Markdown
Owner

@Keval5252 Keval5252 commented Dec 13, 2025

Implement employee shift management, attendance tracking, and overtime calculation with admin and mobile APIs.

The WorkTimeCalculator service handles complex overtime logic, including accurate calculation for overnight shifts and partial shift overlaps, as per the user's requirements.


Open in Cursor Open in Web


Note

Introduce shift management and attendance (clock-in/out) with overtime calculation, admin dashboards/UI, mobile auth/API endpoints, and supporting models/migrations.

  • Backend
    • Models/Migrations: Add Shift, ShiftAssignment, AttendanceRecord with tables and indexes; update users role to employee (was customer).
    • Service: Implement WorkTimeCalculator for regular/overtime and overnight shift handling.
  • API
    • Auth: POST /auth/login, POST /auth/logout (Sanctum tokens).
    • Attendance: GET /me, POST /attendance/clock-in, POST /attendance/clock-out with shift resolution and validations.
  • Admin UI
    • Pages: Dashboard metrics, manage shifts (CRUD), list/create employees, create assignments, view paginated attendance with computed hours.
    • Middleware: Add EnsureAdmin; protect routes under admin prefix.
  • Auth/Routing
    • Web: Admins redirected to /admin; remove customer register routes; update welcome view to show first_name/last_name.
    • API/Web routes wired for new controllers and middleware.
  • Tests
    • Unit tests for WorkTimeCalculator including overnight scenarios.

Written by Cursor Bugbot for commit 097a2bc. This will update automatically on new commits. Configure here.

Co-authored-by: kevalchokhaliya <kevalchokhaliya@gmail.com>
@cursor
Copy link
Copy Markdown

cursor Bot commented Dec 13, 2025

Cursor Agent can help with this pull request. Just @cursor in comments and I'll start working on changes in this branch.
Learn more about Cursor Agents

@Keval5252
Copy link
Copy Markdown
Owner Author

Test

1 similar comment
@Keval5252
Copy link
Copy Markdown
Owner Author

Test

@Keval5252 Keval5252 marked this pull request as ready for review December 13, 2025 06:54
@Keval5252 Keval5252 merged commit 27c3e67 into master Dec 13, 2025
1 check passed
Copy link
Copy Markdown

@cursor cursor Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This PR is being reviewed by Cursor Bugbot

Details

You are on the Bugbot Free tier. On this plan, Bugbot will review limited PRs each billing cycle.

To receive Bugbot reviews on all of your PRs, visit the Cursor dashboard to activate Pro and start your 14-day free trial.

'password' => Hash::make($data['password']),
'role' => 'employee',
'email_verified_at' => now(), // keep onboarding simple
]);
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bug: Employee email verification silently ignored during creation

When creating an employee, email_verified_at is passed to User::create() with the intention of marking the employee as verified. However, email_verified_at is not included in the User model's $fillable array, so Laravel's mass assignment protection silently ignores this field. The employee will be created without email verification, and since the web login checks hasVerifiedEmail(), admin-created employees will be unable to log in.

Additional Locations (1)

Fix in Cursor Fix in Web

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants