-
Notifications
You must be signed in to change notification settings - Fork 7
Attendance Management
Organizations need a robust system to track and manage the attendance of individuals across various contexts (e.g., events, classes). This system must handle diverse scenarios, ensure accuracy, and support contextual data.
To address these needs, we propose a centralized database to record attendance, which accommodates a variety of data points including user details, attendance status, and related metadata. This system will be designed to support scalability and flexibility in terms of different attendance contexts.
The solution involves the implementation of a comprehensive attendance management system encapsulated within a microservice architecture. This system will allow for real-time tracking of attendance data, provide insights through analytics, and offer the flexibility to integrate with other systems via APIs.
The Attendance
table is designed to store attendance records with contextual data and user information. Here is the schema for managing the database:
Column Name | Data Type | Description | Default Value | Constraints | Indexes |
---|---|---|---|---|---|
attendanceId | uuid | Unique identifier for the attendance record | gen_random_uuid() | Unique | Unique Index on attendanceId
|
attendance | character varying | Status of attendance (e.g., 'present', 'absent') | None | None | None |
remark | character varying | Optional remarks about the attendance record | None | None | None |
image | character varying | Optional field to store image data or references | None | None | None |
contextId | uuid | Context ID associated with the attendance | None | None | None |
contextType | character varying | Type of context (e.g., 'class', 'event') | None | None | None |
createdAt | timestamp with time zone | Timestamp when the record was created | now() | None | None |
updatedAt | timestamp with time zone | Timestamp when the record was last updated | now() | None | None |
tenantId | uuid | Tenant's ID, foreign key | None | Foreign Key referencing Tenants table |
None |
userId | uuid | User's ID marked for attendance, foreign key, NOT NULL | None | Foreign Key referencing Users table, Part of PK, NOT NULL |
None |
attendanceDate | date | Date of attendance, NOT NULL | now() | None | |
latitude | double precision | Geographical latitude where the attendance was recorded | None | None | None |
longitude | double precision | Geographical longitude where the attendance was recorded | None | None | None |
createdBy | uuid | ID of the user who created the attendance record | None | ||
updatedBy | uuid | ID of the user who last updated the attendance record | None | None | None |