Skip to main content

attendance

Table: attendance

The attendance table is designed to track employee attendance, including check-in and check-out times, locations, statuses, and metadata for audit and reporting.


Columns

Column NameData TypeConstraintsDescription
mappedIdint(11)NOT NULLLinks to a user or entity in the idmapper table.
workgrouptypeIdint(11)NOT NULLLinks to the workgrouptype table, defining the workgroup type.
checkIntimeTime of check-in.
checkOuttimeTime of check-out.
checkInLatitudevarchar(45)Latitude of check-in location.
checkInLongitudevarchar(45)Longitude of check-in location.
geopointvarchar(45)Combined geolocation data as a single point.
InStatusvarchar(45)Status of check-in (e.g., on-time, late).
locationint(11)Links to the location table.
assignedCheckIntimeScheduled check-in time.
assignedCheckOuttimeScheduled check-out time.
createdByUserIdint(11)User who created the record (foreign key).
editedByUserIdint(11)User who last edited the record (foreign key).
laxTimevarchar(45)Grace period allowed for check-in/out.
attendanceIdint(11)NOT NULL AUTO_INCREMENTUnique identifier for each attendance record.
createdDatedatetimeDate the record was created.
descriptionvarchar(255)Additional notes about the attendance record.
lastEditedDatedatetimeDate the record was last modified.
OutStatusvarchar(45)Status of check-out (e.g., early, late).
attendanceDatedateDate of attendance.
checkOutLatitudevarchar(45)Latitude of check-out location.
checkOutLongitudevarchar(45)Longitude of check-out location.
latitudevarchar(30)General latitude coordinate.
longitudevarchar(30)General longitude coordinate.
isBiometrictinyint(1)Indicates if attendance was recorded using biometrics.
shiftStatusvarchar(20)Status of the shift (e.g., completed, ongoing).

Indexes

  1. Primary Index
  • attendanceId: Ensures unique identification for each record.
  1. Foreign Key Indexes
  • workgrouptype_fk_idx: Links workgrouptypeId to the workgrouptype table.
  • userIdMapper_pk_fk: Links mappedId to the idmapper table.
  • createdByuser_fk_idx: Links createdByUserId to the user table.
  • editedByuser_fk_idx: Links editedByUserId to the user table.
  • location_fk_idx and assignedLocation_fk_idx: Link location to the location table.
  1. Additional Indexes
  • FK7117E2E946A840E5: Supports performance optimization for primary key lookups.

Foreign Key Relations

  1. attendance_location_fk
  • Links location to the location table, representing the associated physical location.
  1. createdByuser_fk and editedByuser_fk
  • Link createdByUserId and editedByUserId to the user table (mappedId), enabling tracking of record creation and updates.
  1. userIdMapper_pk_fk
  • Links mappedId to the idmapper table for user identification.
  1. workgroupId_fk
  • Links workgrouptypeId to the workgrouptype table, identifying the associated workgroup type.

Usage Notes

  • Attendance Tracking: Supports detailed tracking of employee attendance with timestamps and geolocation.
  • Audit Trail: Metadata fields like createdByUserId, editedByUserId, createdDate, and lastEditedDate ensure auditability.
  • Shift Compliance: Includes fields like assignedCheckIn, assignedCheckOut, and laxTime for managing shift schedules.
  • Geolocation Support: Provides detailed location data for check-in and check-out events.