Skip to content
This repository has been archived by the owner on Nov 21, 2024. It is now read-only.

SkillsFundingAgency/das-employerdemand-api

Repository files navigation

⛔ Never push sensitive information such as client id's, secrets or keys into repositories including in the README file ⛔

Employer Demand API

UK Government logo

Build Status Quality Gate Status Jira Project Confluence Project License

The Employer Demand API is responsible for storing an Employers request for training in an unavailable area for a Training Provider to pick up. The demand is created against a particular course taken from the courses-api and a location, which then a number of providers can then enquire about providing training for that employer

How It Works

The Employer Demand API is a inner API consumed by das-apim-endpoints. All data is stored in a SQL database using EF Core and configuration is read from Azure Storage Configuration table.

🚀 Installation

Pre-Requisites

  • A clone of this repository
  • A code editor that supports Azure functions and .Net 6.0
  • Azure Storage Emulator if not running in DEV mode
  • SQL Database if not running DEV mode

Config

AppSettings.json file

{
    "Logging": {
      "LogLevel": {
        "Default": "Information",
        "Microsoft": "Warning",
        "Microsoft.Hosting.Lifetime": "Information"
      }
    },
    "ConfigurationStorageConnectionString": "UseDevelopmentStorage=true;",
    "ConfigNames": "SFA.DAS.EmployerDemand.Api",
    "EnvironmentName": "LOCAL",
    "Version": "1.0",
    "APPINSIGHTS_INSTRUMENTATIONKEY": ""
  }  

Azure Table Storage config

Row Key: SFA.DAS.EmployerDemand.Api._1.0

Partition Key: LOCAL

Data:

{
  "EmployerDemandConfiguration": {
    "ConnectionString": "Data Source=.;Initial Catalog=SFA.DAS.EmployerDemand;Integrated Security=True;Pooling=False;Connect Timeout=30"
  },
  "AzureAd": {
    "tenant": "",
    "identifier": ""
  }
}

Local Running

In memory database

It is possible to run the whole of the API using the InMemory database. To do this the environment variable in appsettings.json should be set to DEV. Once done, start the application as normal. You will then be able to query the API as per the operations listed in swagger.

SQL Server database

You are able to run the API by doing the following:

  • Run the database deployment publish command to create the database SFA.DAS.EmployerDemand or create the database manually and run in the table creation scripts
  • In your Azure Storage Account, create the configuration as detailed above.
  • Start the API project - this will load the swagger definition with all endpoints defined.

🔗 External Dependencies

Authentication is managed via Azure Managed Identity when not running locally.

Technologies

  • .NetCore 6.0
  • EF Core
  • SQL Server
  • NLog
  • Azure Table Storage
  • NUnit
  • Moq
  • FluentAssertions

🐛 Known Issues

  • Do not run in IISExpress

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published