Skip to content

Indicator Task Syncing

This document outlines the functionality available for synchronising indicator tasks. This is useful for ensuring that all required indicator tasks are created for programme seats, especially when indicator configurations change or seats are created retrospectively.

API Endpoint

An API endpoint is available for super admins to trigger the task syncing process on demand.

  • URL: /sync-indicator-tasks
  • Method: GET
  • Authentication: Requires an authenticated Super Admin user.

Parameters

The following query parameters can be used:

  • seat (integer, optional): The ID of a specific organisation_programme_seats to sync tasks for.
  • programme (integer, optional): The ID of a specific programmes to sync tasks for all its seats.
  • historic (boolean, optional): Use 1 to create historic tasks or 0 to exclude them. Defaults to 0 (false).

Note: You must provide either a seat or a programme ID.

Artisan Command

A corresponding Artisan command is available for manual triggering via the CLI.

php artisan indicators:create-missing-tasks

Options

  • --seat=<id>: The ID of a specific seat to process.
  • --programme=<id>: The ID of a programme to process.
  • --historic=<1|0>: Set to 1 to include historic tasks. Defaults to 0.
  • --tenant=<id>: The tenant ID to process. Defaults to 1.

Scheduled Task

The indicators:create-missing-tasks command is scheduled to run automatically to catch any missing tasks.

  • Schedule: Daily at 20:00.
  • Note: This is intended as a safety net. Any tasks created by this job may indicate an issue elsewhere in the system that needs investigation. There is a TODO in the code to potentially remove this scheduled job once the system has stabilised.