Skip to content

Repository files navigation

Register of Apprenticeship Training Providers (RoATP v2) Course Management API

UK Government logo

Build Status Quality Gate Status License

About

The API encapsulates ROATP course management data which is mainly for managing the courses delivery details for all the providers. This solution has two main projects:

API

There are two sets of endpoints:

Jobs

The SFA.DAS.Roatp.Jobs project that contains functions to reload standards, reload provider details, update provider address and coordinates and import provider achievement rates.

Functions summary

Function Name Trigger Description
DeleteExpiredShortlistsFunction Timer Removes expired shortlists via the outer API.
ImportAnnualFeedbackSummariesFunction Timer Imports annual apprentice and employer feedback summaries when data for the configured period is not already present.
RefreshAllProviderDetailsFromUkrlpFunction Http Request Updates all the providers details from UKRLP. This function is triggered manually to refresh all provider details when needed.
RefreshProviderDetailsFromUkrlpFunction Timer Updates details for providers updated since the last run.
UpdateProviderAddressCoordinatesFunction Timer Updates stored provider address coordinates. This function has to run after RefreshProviderDetailsFromUkrlpFunction so any address changes can be picked up.
ReloadProviderRegistrationDetailsFunction Timer Reloads provider registration details from Roatp V1, Updates coordinates for any new provider addresses.
ReloadStandardsCacheFunction Timer Refreshes the standards cache from course api.
SendInitialForecastEmailsFunction Timer Sends initial forecast reminder emails for recently added short courses.
SendForecastsReminderEmailsFunction Timer Sends periodic forecast reminder emails to providers with short courses that have missing or out-of-date forecasts.

Developer Setup

Pre-requisites

You will need following on your local:

  • A clone of this repository
  • Visual studio or similar IDE
  • .Net 10.0 SDK
  • Azurite or similar local storage emulator
  • SQL Database

Dependencies

  • Setup RoatpCourseManagement outer api solution in das-apim-endpoints. This has its own dependencies which will be required to be setup as well, see its readme for further instructions.

Configuration

  • Create a Configuration table in your (Development) local storage account.

  • Obtain the SFA.DAS.Roatp.Api.json from the das-employer-config and adjust the SqlConnectionString property to match your local setup.

  • Add a row to the Configuration table with fields:

    • PartitionKey: LOCAL
    • RowKey: SFA.DAS.Roatp.Api_1.0
    • Data: {The contents of the SFA.DAS.Roatp.Api.json file}
  • Obtain the SFA.DAS.Roatp.Jobs.json from the das-employer-config for roatp-api repo

  • Add a row to the Configuration table with fields:

    • PartitionKey: LOCAL
    • RowKey: SFA.DAS.Roatp.Jobs_1.0
    • Data: {The contents of the SFA.DAS.Roatp.Jobs.json file}
  • In the SFA.DAS.Roatp.Api project, add appSettings.Development.json file with following content:

{
  "Logging": {
    "LogLevel": {
      "Default": "Information",
      "Microsoft": "Warning",
      "Microsoft.Hosting.Lifetime": "Information",
      "Microsoft.EntityFrameworkCore.Database.Command": "Information"
    }
  },
  "AllowedHosts": "*",
  "ConfigurationStorageConnectionString": "UseDevelopmentStorage=true;",
  "ConfigNames": "SFA.DAS.Roatp.Api",
  "Environment": "LOCAL",
  "Version": "1.0",
  "APPINSIGHTS_INSTRUMENTATIONKEY": ""
}
  • In the SFA.DAS.Roatp.Jobs project, add local.settings.json file with following content:
{
  "Logging": {
    "LogLevel": {
      "Default": "Information",
      "Microsoft": "Warning",
      "Microsoft.Hosting.Lifetime": "Information"
    }
  },
  "IsEncrypted": false,
  "Values": {
    "AzureWebJobsStorage": "UseDevelopmentStorage=true;",
    "FUNCTIONS_WORKER_RUNTIME": "dotnet-isolated",
    "ConfigurationStorageConnectionString": "UseDevelopmentStorage=true;",
    "EnvironmentName": "LOCAL",
    "LoggingRedisConnectionString": "localhost",
    "QarTimePeriod": "202223",
    "QarOverallImportFileName": "app-narts-subject-and-level-detailed.csv",
    "QarProviderLevelImportFileName": "app-narts-provider-level-fwk-std.csv",
    "DeleteExpiredShortlistsSchedule": "0 0 2 * * *",
    "ImportAnnualFeedbackSummariesFunctionSchedule": "0 0 4 1-10 8 *",
    "ReloadStandardsCacheSchedule": "0 0 20 * * 1-5",
    "ReloadProviderRegistrationDetailsSchedule": "0 0 21 * * 1-5",
    "SendInitialForecastEmailsFunctionSchedule": "0 0 3 * * *",
    "SendForecastsReminderEmailsFunctionSchedule": "0 0 0 15 3,6,9,12 *",
    "UpdateUkrlpDataSchedule": "0 0 23 * * 1-5",
    "UpdateProviderAddressCoordinatesSchedule": "0 30 23 * * 1-5",
    "AzureWebJobs.DeleteExpiredShortlistsFunction.Disabled": true,
    "AzureWebJobs.ImportAnnualFeedbackSummariesFunction.Disabled": true,
    "AzureWebJobs.ReloadStandardsCacheFunction.Disabled": true,
    "AzureWebJobs.ReloadProviderRegistrationDetailsFunction.Disabled": true,
    "AzureWebJobs.SendInitialForecastEmailsFunction.Disabled": true,
    "AzureWebJobs.SendForecastsReminderEmailsFunction.Disabled": true,
    "AzureWebJobs.RefreshAllProviderDetailsFromUkrlpFunction.Disabled": true,
    "AzureWebJobs.RefreshProviderDetailsFromUkrlpFunction.Disabled": true,
    "AzureWebJobs.UpdateProviderAddressCoordinatesFunction.Disabled": true
  }
}

Initializing the data

  • Publish the database project SFA.DAS.RoATP.Database to your local SQL Server instance.
  • Seed following tables via manual scripts or by running respective jobs
  1. Standard: run job ReloadStandardsCacheFunction
  2. ProviderRegistrationDetail: run jobs in this order ReloadProviderRegistrationDetailsFunction, LoadAllProviderAddressesFunction

Releases

Packages

Used by

Contributors

Languages