<commit_before># Digital Apprenticeships Service
## Employer Apprenticeship Service

|               |               |
| ------------- | ------------- |
|![crest](https://assets.publishing.service.gov.uk/government/assets/crests/org_crest_27px-916806dcf065e7273830577de490d5c7c42f36ddec83e907efe62086785f24fb.png)|Employer Apprenticeship Service|
| Build | ![Build Status](https://sfa-gov-uk.visualstudio.com/_apis/public/build/definitions/c39e0c0b-7aff-4606-b160-3566f3bbce23/101/badge) |
| Web  | https://manage-apprenticeships.service.gov.uk/  |

## Account Api

|               |               |
| ------------- | ------------- |
|![crest](https://assets.publishing.service.gov.uk/government/assets/crests/org_crest_27px-916806dcf065e7273830577de490d5c7c42f36ddec83e907efe62086785f24fb.png)| Account API |
| Client  | [![NuGet Badge](https://buildstats.info/nuget/SFA.DAS.Account.Api.Client)](https://www.nuget.org/packages/SFA.DAS.Account.Api.Client)  |


The Employer Apprenticeships Service provides a REST Api and client for accessing Employer accounts. Nuget link above.

* The API can be found in [src/SFA.DAS.EAS.Api](src/SFA.DAS.EAS.Api)
* The client can be found in [src/SFA.DAS.Account.Api.Client](src/SFA.DAS.Account.Api.Client)


### Developer Setup

#### Requirements
- Install [Visual Studio 2017 Enterprise](https://www.visualstudio.com/downloads/)
- Install [SQL Management Studio](https://docs.microsoft.com/en-us/sql/ssms/download-sql-server-management-studio-ssms)
- Install [Azure Storage Explorer](http://storageexplorer.com/)
- Administator Access

Probably already install Azure SDK 2.9


#### Setup

##### Add certs for https on IIS express (?)

- Open PowerShell as an administrator
- Run src\DevInstall.ps1 

**TODO is this needed?**

##### Open the solution

- Open Visual studio as an administrator
- Open the solution
- Set SFA.DAS.CloudService as the startup project
- Running the solution will launch the site and the API in your browser.

**TODO is administrator acces for HTTPS? and is that needed locally?**

##### Publish the databases
repeat these steps for

1. SFA.DAS.EAS.Employer_Account.Database
2. SFA.DAS.EAS.Employer_Financial.Database

Steps

* right click on the db project in the solution explorer
* click on publish menu item
* click the edit button

![click on the edit button](/docs/img/db1.PNG)

* select Local ProjectsV13

![select Local ProjectsV13](/docs/img/db2.PNG)

* Add the project name in again as the Database name (ie: SFA.DAS.EAS.Employer_Account.Database)
* click publish

![select Local ProjectsV13](/docs/img/db3.PNG)

**TODO replace the publish with a post deploy step on building**

##### Add configuration to Storage Emulator

The configuration is loaded from azure table storage (or file system but it's not supported)

* Open Azure Storage Explorer
* Right click Tables under Storage Accounts > Tables
* Select Create Table from the menu

![right click on Development Tables](/docs/img/config1.PNG)

* Create a table called Configuration
* Click Import from the top buttons
* Select the configuration CSV (ask us for it, it's got secrets so it can't be shared publicly)

**TODO add an internal for the CSV**



**Troubleshooting**

- If you can't connect to the table storage emulator
	- you may have a bit torrent client running

### Feature Toggle

You can limit areas of the site by adding them to a list, in the controller action format, or having a * to denote all actions within that controller. Below is an example of the config required:

```
{   "Data": [     {       "Controller": "EmployerTeam",       "Action": "Invite"     }   ] }
```
This is added to the configuration table of your local azure storage, with the PartiionKey being **LOCAL** and the RowKey being **SFA.DAS.EmployerApprenticeshipsService.Features_1.0**<commit_msg>Updated readme with required Visual Studio workloads<commit_after># Digital Apprenticeships Service
## Employer Apprenticeship Service

|               |               |
| ------------- | ------------- |
|![crest](https://assets.publishing.service.gov.uk/government/assets/crests/org_crest_27px-916806dcf065e7273830577de490d5c7c42f36ddec83e907efe62086785f24fb.png)|Employer Apprenticeship Service|
| Build | ![Build Status](https://sfa-gov-uk.visualstudio.com/_apis/public/build/definitions/c39e0c0b-7aff-4606-b160-3566f3bbce23/101/badge) |
| Web  | https://manage-apprenticeships.service.gov.uk/  |

## Account Api

|               |               |
| ------------- | ------------- |
|![crest](https://assets.publishing.service.gov.uk/government/assets/crests/org_crest_27px-916806dcf065e7273830577de490d5c7c42f36ddec83e907efe62086785f24fb.png)| Account API |
| Client  | [![NuGet Badge](https://buildstats.info/nuget/SFA.DAS.Account.Api.Client)](https://www.nuget.org/packages/SFA.DAS.Account.Api.Client)  |


The Employer Apprenticeships Service provides a REST Api and client for accessing Employer accounts. Nuget link above.

* The API can be found in [src/SFA.DAS.EAS.Api](src/SFA.DAS.EAS.Api)
* The client can be found in [src/SFA.DAS.Account.Api.Client](src/SFA.DAS.Account.Api.Client)


### Developer Setup

#### Requirements
- Install [Visual Studio 2017 Enterprise](https://www.visualstudio.com/downloads/) with these workloads:
    - .NET desktop development
    - ASP.NET and web development
    - Azure development
- Install [SQL Management Studio](https://docs.microsoft.com/en-us/sql/ssms/download-sql-server-management-studio-ssms)
- Install [Azure Storage Explorer](http://storageexplorer.com/)
- Administator Access


#### Setup

##### Add certs for https on IIS express (?)

- Open PowerShell as an administrator
- Run src\DevInstall.ps1 

**TODO is this needed?**

##### Open the solution

- Open Visual studio as an administrator
- Open the solution
- Set SFA.DAS.CloudService as the startup project
- Running the solution will launch the site and the API in your browser.

**TODO is administrator acces for HTTPS? and is that needed locally?**

##### Publish the databases
repeat these steps for

1. SFA.DAS.EAS.Employer_Account.Database
2. SFA.DAS.EAS.Employer_Financial.Database

Steps

* right click on the db project in the solution explorer
* click on publish menu item
* click the edit button

![click on the edit button](/docs/img/db1.PNG)

* select Local ProjectsV13

![select Local ProjectsV13](/docs/img/db2.PNG)

* Add the project name in again as the Database name (ie: SFA.DAS.EAS.Employer_Account.Database)
* click publish

![select Local ProjectsV13](/docs/img/db3.PNG)

**TODO replace the publish with a post deploy step on building**

##### Add configuration to Storage Emulator

The configuration is loaded from azure table storage (or file system but it's not supported)

* Open Azure Storage Explorer
* Right click Tables under Storage Accounts > Tables
* Select Create Table from the menu

![right click on Development Tables](/docs/img/config1.PNG)

* Create a table called Configuration
* Click Import from the top buttons
* Select the configuration CSV (ask us for it, it's got secrets so it can't be shared publicly)

**TODO add an internal for the CSV**



**Troubleshooting**

- If you can't connect to the table storage emulator
	- you may have a bit torrent client running

### Feature Toggle

You can limit areas of the site by adding them to a list, in the controller action format, or having a * to denote all actions within that controller. Below is an example of the config required:

```
{   "Data": [     {       "Controller": "EmployerTeam",       "Action": "Invite"     }   ] }
```
This is added to the configuration table of your local azure storage, with the PartiionKey being **LOCAL** and the RowKey being **SFA.DAS.EmployerApprenticeshipsService.Features_1.0**
{'fraction_non_alphanumeric': 0.1168646694214876, 'fraction_numerical': 0.03409090909090909, 'mean_word_length': 3.843652282676673, 'pattern_counts': {'":': 6, '<': 3, '<?xml version=': 0, '>': 5, 'https://': 16, 'lorem ipsum': 0, 'www.': 4, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 8, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1577894', 'n_tokens_mistral': 2617, 'n_tokens_neox': 2364, 'n_words': 749}