Attendance Revamp

Overview

The attendance revamp feature adds a tagging system to the attendance module. Tags help categorise and group attendees (e.g., by Skill, Project, Shift) and make it easier to search or filter attendance records. To support this, new APIs, search options, validation rules, and database changes have been introduced.


Key Features

1. Tagging Capability for Attendees

  • Tag Field: A new tag field is added to attendees, allowing teams to organise and filter data.

  • Bulk Tag Update API (POST /attendee/v1/_updateTag):

    • Allows you to update tags for multiple attendees at once.

    • Validates attendees, tenant IDs, and tag values to ensure data integrity.

  • Tag Enrichment:

    • Only updates the tag field while keeping audit info (createdBy, createdTime) intact.

    • Supports idempotent and partial updates.

  • Validation Rules:

    • Requires tenantId in requests.

    • Attendees must exist in the system before updates.

    • Tags must be valid (non-empty).

    • Prevents cross-tenant updates or invalid inputs.

2. Tag-Based Attendee Search Enhancements

  • Search with Tags:

    • Tags can be used as an optional filter in /attendee/v1/_search.

    • Multiple tags supported, with AND/OR filtering.

  • Model Update:

    • AttendeeSearchCriteria now includes a tags field (List<String>).

    • tenantId is mandatory when searching with tags.

3. Database & Persistence Layer Changes

  • Schema:

    • Added a tag column to eg_wms_attendance_attendee.

    • Indexed for faster searches.

  • Persister Config:

    • Updated attendance-service-persister.yml to handle tags in insert, update, and mapping queries.

4. Service, Repository & Model Enhancements

  • Service Layer:

    • New method updateAttendeeTag() in AttendeeService for bulk updates.

  • Repository:

    • Extended to support tag-based search and updates.

  • Model / DTOs:

    • Added tag field to IndividualEntry, Attendee, AttendeeUpdateTagRequest, AttendeeUpdateTagResponse, and AttendeeSearchCriteria.

    • Ensures tags flow consistently from request → service → DB → response.

5. Code Cleanups & Improvements

  • Added new error messages for invalid tags, tenant mismatches, and missing attendees.

  • Removed unused constants/imports.

  • Updated version to 1.3.0 in pom.xml to reflect the new feature.


Sequence Diagram

Mobile User Flow

Supervisor Flow

Last updated

Was this helpful?