Class TeamShiftDataHelper
java.lang.Object
overit.geocallapp.wfm.teams.bl.team.shift.TeamShiftDataHelper
Helper for retrieving team shift data, including foreman (leader) by team and team composition.
This helper provides methods to:
- Retrieve the foreman (team leader) for each team on a specific day
- Retrieve the team composition (list of resource IDs) for each team on a specific day
- Search team shifts by team IDs and day
- Search team shift resources by team shift IDs
This is a customizable helper that can be instantiated via Factory.
- Since:
- 22.0
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetForemanByTeam(List<Long> teamIds, Date day, PoolKit poolKit) Retrieves the foreman (team leader) by team ID for a specific day.getTeamCompositionByTeamId(List<Long> teamIds, Date day, PoolKit poolKit) Retrieves the team composition (resource IDs) by team ID for a specific day.protected List<BOTeamShiftResource> getTeamShiftResources(List<Long> teamShiftIds, PoolKit poolKit) Retrieves team shift resources for the specified team shift IDs.protected List<BOTeamShift> getTeamShifts(List<Long> teamIds, Date day, PoolKit poolKit) Retrieves team shifts for the specified team IDs on a specific day.static TeamShiftDataHelperFactory method to create a new instance of the helper.
-
Constructor Details
-
TeamShiftDataHelper
public TeamShiftDataHelper()
-
-
Method Details
-
makeHelper
Factory method to create a new instance of the helper.- Returns:
- a new instance of
TeamShiftDataHelper
-
getForemanByTeam
public Map<Long,Long> getForemanByTeam(List<Long> teamIds, Date day, PoolKit poolKit) throws DAException, DAValidateException Retrieves the foreman (team leader) by team ID for a specific day.This method searches for team shifts on the specified day and builds a map of team ID to leader (foreman) resource ID.
- Parameters:
teamIds- the list of team IDsday- the day to search for (will be used as range: day to day+1)poolKit- the pool kit- Returns:
- a map where key is team ID and value is foreman (leader) resource ID
- Throws:
DAException- if a database error occursDAValidateException- if validation fails
-
getTeamCompositionByTeamId
public Map<Long,List<Long>> getTeamCompositionByTeamId(List<Long> teamIds, Date day, PoolKit poolKit) throws DAException, DAValidateException Retrieves the team composition (resource IDs) by team ID for a specific day.This method:
- Gets all team shifts for the specified teams on the given day
- Searches for all team shift resources in a single query
- Builds a map of team ID to list of resource IDs
- Parameters:
teamIds- the list of team IDsday- the day to search for (will be used as range: day to day+1)poolKit- the pool kit- Returns:
- a map where key is team ID and value is list of resource IDs
- Throws:
DAException- if a database error occursDAValidateException- if validation fails
-
getTeamShifts
protected List<BOTeamShift> getTeamShifts(List<Long> teamIds, Date day, PoolKit poolKit) throws DAException, DAValidateException Retrieves team shifts for the specified team IDs on a specific day.This is a protected helper method used by
getForemanByTeam(List, Date, PoolKit)andgetTeamCompositionByTeamId(List, Date, PoolKit).- Parameters:
teamIds- the list of team IDsday- the day to search for (will be used as range: day to day+1)poolKit- the pool kit- Returns:
- the list of team shifts
- Throws:
DAException- if a database error occursDAValidateException- if validation fails
-
getTeamShiftResources
protected List<BOTeamShiftResource> getTeamShiftResources(List<Long> teamShiftIds, PoolKit poolKit) throws DAException, DAValidateException Retrieves team shift resources for the specified team shift IDs.This is a protected helper method used by
getTeamCompositionByTeamId(List, Date, PoolKit).- Parameters:
teamShiftIds- the list of team shift IDspoolKit- the pool kit- Returns:
- the list of team shift resources
- Throws:
DAException- if a database error occursDAValidateException- if validation fails
-