-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #417 from DFE-Digital/feature/trust-v4-endpoint
Feature/trust v4 endpoint
- Loading branch information
Showing
19 changed files
with
24,603 additions
and
28 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
23 changes: 23 additions & 0 deletions
23
Dfe.Academies.Api.Infrastructure/Repositories/CensusDataRepository.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
using CsvHelper; | ||
using Dfe.Academies.Domain.Census; | ||
using System.Globalization; | ||
|
||
namespace Dfe.Academies.Infrastructure.Repositories | ||
{ | ||
public class CensusDataRepository : ICensusDataRepository | ||
{ | ||
private readonly IEnumerable<CensusData> records; | ||
|
||
public CensusDataRepository() | ||
{ | ||
var reader = new StreamReader("CensusData/2022-2023_england_census.csv"); | ||
var csv = new CsvReader(reader, CultureInfo.InvariantCulture); | ||
records = csv.GetRecords<CensusData>().ToList(); | ||
} | ||
|
||
public CensusData GetCensusDataByURN(int urn) | ||
{ | ||
return records.FirstOrDefault(censusData => censusData.URN == urn.ToString()); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
namespace Dfe.Academies.Domain.Census | ||
{ | ||
public class CensusData | ||
{ | ||
public string URN { get; set; } | ||
public string LA { get; set; } | ||
public string ESTAB { get; set; } | ||
public string SCHOOLTYPE { get; set; } | ||
public string NOR { get; set; } | ||
public string NORG { get; set; } | ||
public string NORB { get; set; } | ||
public string PNORG { get; set; } | ||
public string PNORB { get; set; } | ||
public string TSENELSE { get; set; } | ||
public string PSENELSE { get; set; } | ||
public string TSENELK { get; set; } | ||
public string PSENELK { get; set; } | ||
public string NUMEAL { get; set; } | ||
public string NUMENGFL { get; set; } | ||
public string NUMUNCFL { get; set; } | ||
public string PNUMEAL { get; set; } | ||
public string PNUMENGFL { get; set; } | ||
public string PNUMUNCFL { get; set; } | ||
public string NUMFSM { get; set; } | ||
public string NUMFSMEVER { get; set; } | ||
public string PNUMFSMEVER { get; set; } | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
namespace Dfe.Academies.Domain.Census | ||
{ | ||
public interface ICensusDataRepository | ||
{ | ||
public CensusData GetCensusDataByURN(int urn); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.