Skip to content

GitLab

  • Menu
Projects Groups Snippets
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in
  • GGCE Server GGCE Server
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 35
    • Issues 35
    • List
    • Boards
    • Service Desk
    • Milestones
  • Deployments
    • Deployments
    • Releases
  • Packages & Registries
    • Packages & Registries
    • Container Registry
  • Activity
  • Graph
  • Create a new issue
  • Commits
  • Issue Boards
Collapse sidebar
  • GGCE
  • GGCE ServerGGCE Server
  • Issues
  • #229

Closed
Open
Created Sep 01, 2021 by Matija Obreza@mobrezaOwner

Action schedule

Actions in GG-CE are either:

  • Completed
  • In progress, or
  • Pending (including #227 (closed))

The overview is based on user-selected time period: one day (today, yesterday, tomorrow, pick a date), one week (this week, last week, pick a week), one month (this month, last month, pick a month), one year (this year, last year, pick a year). This sets the date range for querying GG-CE: { fromInclusive: DATE1, toExclusive: DATE2 }.

We are interested in the following categories:

  • Actions completed in the selected period completedDate >= DATE1 and completedDate < DATE2
  • Actions in progress in the selected period startedDate < DATE2 and (completedDate is null or completedDate > DATE2)
  • Actions scheduled in the selected period notBeforeDate >= DATE1 and notBeforeDate < DATE2
  • New actions added in the selected period createdDate >= DATE1 and createdDate < DATE2
  • Overdue actions in the period completedDate IS NULL and (notBeforeDate IS NULL or (notBeforeDate >= DATE1 and notBeforeDate < DATE2))

Note: Apparently SQL BETWEEN returns TRUE if the value of test_expression is greater than or equal to the value of begin_expression and less than or equal to the value of end_expression. This is not what we want.

Each category is basically a list (loooooong list) of InventoryActions, but we are looking for the count of actions in each category grouped by actionNameCode and the API call to actionSchedule(...) returns for the specified period the following response:

{
 "completed": {
   "VIABILITY_TEST": 30,
   "actionNameCode2": 30,
   "actionNameCode4": 10,
 },
 "inProgress": { "VIABILITY_TEST": 4, "actionNameCode2": 4, ... },
 "scheduled": { ... },
 "added": { ... },
 "overdue": { ... }
}

API updates

This is for InventoryAction, but should be abstracted so it works for other AbstractAction types:

// Returns the action schedule summary as described above
@PostMapping("/schedule")
public ActionScheduleOverview actionSchedule(InventoryActionScheduleFilter filter) { ... }

public static class ActionScheduleOverview {
 public Map<String, Number> completed;
 public Map<String, Number> inProgress;
 ...
}

public static class InventoryActionScheduleFilter {
 @NotNull public Date fromInclusive; // x >= DATE1 
 @NotNull public Date toExclusive; // x < DATE2
 public Set<String> actionCode;
 public InventoryFilter inventory; // Filter for inventoryAction.inventory
}

Retrieving Page<InventoryActions>

The ActionScheduleOverview provides the summary numbers, the UI will need to load and display the actions in each category. Please add to AbstractActionController (with no filterCode support):

// List of completed actions for InventoryActionScheduleFilter
@PostMapping(value = "/action/list/completed", produces = { MediaType.APPLICATION_JSON_VALUE })
public Page<T, F> listCompletedActions(@Parameter(hidden = true) final Pagination page, @RequestBody(required = true) final InventoryActionScheduleFilter filter) throws IOException { ... }

// List of ...
@PostMapping(value = "/action/list/inProgress", produces = { MediaType.APPLICATION_JSON_VALUE })
@PostMapping(value = "/action/list/scheduled", produces = { MediaType.APPLICATION_JSON_VALUE })
@PostMapping(value = "/action/list/added", produces = { MediaType.APPLICATION_JSON_VALUE })
@PostMapping(value = "/action/list/overdue", produces = { MediaType.APPLICATION_JSON_VALUE })
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information
Assignee
Assign to
Time tracking