TaskActivitiesDataService

public interface TaskActivitiesDataService extends MotechDataService<TaskActivity>

Data service for task activities.

Fields

ACTIVITY_TYPE

String ACTIVITY_TYPE

DATE

String DATE

TASK

String TASK

Methods

byActivityTypes

List<TaskActivity> byActivityTypes(Set<TaskActivityType> activityTypes, QueryParams queryParams)

Returns the list of activities of specified type and with QueryParams for pagination support.

Parameters:
  • activityTypes – the set of activity types
  • queryParams – the query parameters to use
Returns:

the list of matching task activities

byActivityTypesAndDate

List<TaskActivity> byActivityTypesAndDate(Set<TaskActivityType> activityTypes, Range<DateTime> dateRange, QueryParams queryParams)

Returns the list of activities of specified type and with QueryParams for pagination support.

Parameters:
  • activityTypes – the set of activity types
  • dateRange – the range of date
  • queryParams – the query parameters to use
Returns:

the list of matching task activities

byTask

List<TaskActivity> byTask(Long task)

Returns the list of activities for the given task id.

Parameters:
  • task – the id of the task, null returns empty list
Returns:

the list of matching task activities

byTaskAndActivityTypes

List<TaskActivity> byTaskAndActivityTypes(Long task, Set<TaskActivityType> activityTypes, QueryParams queryParams)

Returns the list of activities for the given task id, of specified type and with QueryParams for pagination support.

Parameters:
  • task – the id of the task
  • activityTypes – the set of activity types
  • queryParams – the query parameters to use
Returns:

the list of matching task activities

byTaskAndActivityTypesAndDate

List<TaskActivity> byTaskAndActivityTypesAndDate(Long task, Set<TaskActivityType> activityTypes, Range<DateTime> dateRange, QueryParams queryParams)

Returns the list of activities for the given task id, of specified type, the given date range and with QueryParams for pagination support.

Parameters:
  • task – the id of the task
  • activityTypes – the set of activity types
  • dateRange – the range of date
  • queryParams – the query parameters to use
Returns:

the list of matching task activities

countByActivityTypes

long countByActivityTypes(Set<TaskActivityType> activityTypes)

Returns the count of all the task activities

Returns:the count of all task activities

countByActivityTypesAndDate

long countByActivityTypesAndDate(Set<TaskActivityType> activityTypes, Range<DateTime> dateRange)

Returns the count of all the task activities based on the given activity types and date range

Returns:the count of task activities

countByTaskAndActivityTypes

long countByTaskAndActivityTypes(Long task, Set<TaskActivityType> activityTypes)

Returns the count of activities for the given task id and of specified type.

Parameters:
  • task – the id of the task
  • activityTypes – the set of activity types
Returns:

the count of matching task activities

countByTaskAndActivityTypesAndDate

long countByTaskAndActivityTypesAndDate(Long task, Set<TaskActivityType> activityTypes, Range<DateTime> dateRange)

Returns the count of activities for the given task id, of specified type and the given date range.

Parameters:
  • task – the id of the task
  • activityTypes – the set of activity types
  • dateRange – the range of date
Returns:

the count of matching task activities