/* Front end Requirement [ provided by FE naveena ]: PARAMETERS: EmployeeLevel - team members for that employee id -1,1,0,.. 0 ---> first level that below the employeeid 1 ---> employee below the first level employee -1 ---> All the level ShowAllEmployees - true -->Show all employee in which login user as access right OU false -->show only junior team based on level Team - true ---> attendance data need to show for multiple employee that is for team false --->only for one employee EmployeeStatus - active and inactive filter OUId - OU access rights filter */ /******************************************************************** BACKEND CODE ********************************************************************/ /* GetFiltersTeamCalendar — Service Documentation Overview The GetFiltersTeamCalendar service provides attendance calendar data for employees based on various filter combinations. It supports both single employee and multi-employee (team) views with flexible filtering by organizational unit, hierarchy level, and employment status. Endpoint POST /TeamCalendar/GetFiltersTeamCalendar Parameters ParameterTypeRequiredDescriptionEmployeeIdlong ✅The ID of the logged-in or selected employeeEmployeeLevelint ✅Hierarchy depth level for team filteringFromDatestring ✅Start date of calendar range (format: yyyy - MM - dd)ToDatestring ✅End date of calendar range (format: yyyy - MM - dd)ShowAllEmployeesbool ✅Controls how team members are resolved when Team=trueOUIdstring ✅Comma-separated OU IDs the employee has access toEmployeeStatusbyte ✅Filter by active or inactive employeesTeambool ✅Controls single vs multi-employee calendar viewLoginstring ✅Login token passed in request header Parameter Details 1. EmployeeId The primary employee identifier — typically the logged-in user's employee ID. Example: -1499999998 2.EmployeeLevel Controls how deep the hierarchy tree is traversed when Team=true and ShowAllEmployees=false. ValueMeaning0Only the EmployeeId himself1EmployeeId + his direct reports (level 1 juniors)2EmployeeId + level 1 + level 2 juniors-1EmployeeId + ALL levels of juniors Example: -1(show all levels) 3.FromDate and ToDate Date range for the calendar data. Both are required. Example: FromDate = 2026 - 03 - 01 & ToDate = 2026 - 03 - 31 4.Team The primary routing parameter that determines which service path is taken. ValueBehaviourtrueMulti-employee team calendar — all other filters applyfalseSingle employee yearly calendar — only EmployeeId, FromDate, ToDate apply. All other filters are ignored Example: Team = true 5.ShowAllEmployees Only applies when Team=true. Controls how the employee list is resolved. ValueBehaviourtrueShow all employees in the OUs passed via OUId parameter — OU access rights basedfalseShow EmployeeId himself + his junior team members based on EmployeeLevel — hierarchy based Example: ShowAllEmployees = true 6.OUId Only applies when Team=true AND ShowAllEmployees=true. Comma-separated list of Organization Unit IDs the employee has access to. All employees whose WORKOUID matches any of the passed OUIDs will be included. Example: OUId = -1500000000,-1499999987 7.EmployeeStatus Filters employees by their active/inactive status. Applies to all team paths when Team=true. ValueMeaningDB Value0Active employees onlyEMPLOYEESTATUS = 01Inactive employees onlyEMPLOYEESTATUS = 1 Example: EmployeeStatus = 0(active only) Filter Flow Diagram Request │ ├── Team = false │ └── GetYearlyCalendar(EmployeeId, FromDate, ToDate) │ → Returns single employee calendar only │ → All other parameters ignored │ └── Team = true │ ├── ShowAllEmployees = true │ └── GET_EMPLOYEES_BY_OU │ → Filter: WORKOUID IN(OUId list) │ → Filter: EMPLOYEESTATUS = EmployeeStatus │ → Returns all employees in given OUs │ └── ShowAllEmployees = false └── GET_EMPLOYEE_BASED_ON_LEVEL → Start from EmployeeId (himself included) → Traverse hierarchy up to EmployeeLevel depth → Filter: EMPLOYEESTATUS = EmployeeStatus → Returns EmployeeId +his juniors by level │ └── Both paths → GET_TEAM_CALENDAR → Calendar data for all resolved employees → Returns per-employee monthly pivot data Day Type Values in Response ValueMeaning- 1No data (future working day / past unprocessed / non-existent day like Feb 30) 0Full Working Day 1Half Working Day 2Weekly Off 3others 4Full Leave 5Half Leave 6Compensate Working 7Compensate Off 8Absent 9Holiday 10Half Leave - Half Absent 11Comp Half Working - Half Leave 12Comp Half Working - Half Absent 13Resigned 14Two Half Leaves Response Structure json[ { "EmployeeId": -1499999998, "EmployeeCode": "E162", "EmployeeName": "Parthiban D", "Months": [ { "Year": 2026, "MonthNumber": 3, "Month": "Mar", "D1": 2, "D2": -1, "D3": -1, ... "D31": -1, "LeaveId1": -1, ... "LeaveId31": -1, "LeaveCode1": "NONE", ... "LeaveCode31": "NONE", "LeaveName1": "NONE", ... "LeaveName31": "NONE" } ] } ] Response Fields FieldTypeDescriptionEmployeeIdlongEmployee identifierEmployeeCodestringEmployee codeEmployeeNamestringEmployee full nameMonthsarrayList of monthly calendar objectsYearintCalendar yearMonthNumberintMonth number (1-12)MonthstringMonth short name (Jan, Feb, Mar...)D1 to D31intDay type value for each day (-1 if no data)LeaveId1 to LeaveId31longLeave ID for each day (-1 if no leave)LeaveCode1 to LeaveCode31stringLeave code for each day ("NONE" if no leave)LeaveName1 to LeaveName31stringLeave name for each day ("NONE" if no leave) Example URL Combinations Single employee calendar (Team=false): POST / TeamCalendar / GetFiltersTeamCalendar ? EmployeeId = -1499999998 & EmployeeLevel = -1 & FromDate = 2026 - 03 - 01 & ToDate = 2026 - 03 - 31 & ShowAllEmployees = true & OUId = -1500000000 & EmployeeStatus = 0 & Team = false Team calendar — OU based all employees (Team=true, ShowAllEmployees = true): POST / TeamCalendar / GetFiltersTeamCalendar ? EmployeeId = -1499999998 & EmployeeLevel = -1 & FromDate = 2026 - 03 - 01 & ToDate = 2026 - 03 - 31 & ShowAllEmployees = true & OUId = -1500000000,-1499999987 & EmployeeStatus = 0 & Team = true Team calendar — hierarchy based juniors only (Team=true, ShowAllEmployees = false): POST / TeamCalendar / GetFiltersTeamCalendar ? EmployeeId = -1499999998 & EmployeeLevel = 1 & FromDate = 2026 - 03 - 01 & ToDate = 2026 - 03 - 31 & ShowAllEmployees = false & OUId = -1500000000 & EmployeeStatus = 0 & Team = true Architecture LayerClassResponsibilitySL(Endpoint)GetFiltersTeamCalendarAccepts HTTP request, parses parameters, calls BLLBLLTeamCalendarBLLRoutes between TeamCalendarDAL (Team=true) and YearlyCalendarBLL (Team=false)DALTeamCalendarDALResolves employee list, fetches calendar data, builds responseQBTeamCalendarQBHolds SQL queries: GET_EMPLOYEES_BY_OU, GET_EMPLOYEE_BASED_ON_LEVEL, GET_TEAM_CALENDAR Notes When Team=false, only EmployeeId, FromDate, and ToDate are used. All other parameters are ignored. OUId is only used when Team=true AND ShowAllEmployees=true. EmployeeLevel is only used when Team=true AND ShowAllEmployees=false. EmployeeStatus applies to all team paths when Team=true. Days that don't exist in a month (e.g. Feb 29, 30, 31) return -1. Future dates with no special designation return -1. Past dates with no attendance record return -1. Holidays, WeekOffs, and approved future Leaves are shown with their correct day type values even for future dates. */