Skip to content

Commit

Permalink
Merge branch 'DFE-Digital:master' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
RogerHowellDfE authored Jul 11, 2023
2 parents 9a6038b + 6904d3f commit 7d0af8b
Show file tree
Hide file tree
Showing 108 changed files with 5,365 additions and 2,574 deletions.
6 changes: 6 additions & 0 deletions Web/.editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,12 @@ charset = utf-8
[*.{js,scss,vue}]
indent_size = 2

[Web.config]
indent_size = 2

[*.csproj]
indent_size = 2

########################################################################################################################
# .NET Coding Conventions #
# Reference: https://docs.microsoft.com/en-us/visualstudio/ide/editorconfig-code-style-settings-reference?view=vs-2017 #
Expand Down
14 changes: 11 additions & 3 deletions Web/Edubase.Data/Entity/DataQualityStatus.cs
Original file line number Diff line number Diff line change
@@ -1,11 +1,15 @@
using System;
using System;
using System.Runtime.Serialization;
using Microsoft.WindowsAzure.Storage.Table;

namespace Edubase.Data.Entity
{
public class DataQualityStatus : TableEntity
{
/// <summary>
/// Note that the enum indices are important to remain consistent:
/// - Azure Table Storage - table `DataQualityStatus` column `RowKey`
/// </summary>
public enum DataQualityEstablishmentType
{
[EnumMember(Value = "Academy openers")]
Expand All @@ -24,7 +28,11 @@ public enum DataQualityEstablishmentType
IndependentSchools,

[EnumMember(Value = "Pupil referral units")]
PupilReferralUnits
PupilReferralUnits,

[EnumMember(Value = "Secure academy 16-19 openers")]
AcademySecure16to19Openers

}

public DataQualityStatus()
Expand All @@ -41,7 +49,7 @@ public DataQualityEstablishmentType EstablishmentType
set
{
RowKey = ((int)value).ToString();
}
}
}

public DateTime LastUpdated { get; set; }
Expand Down
15 changes: 15 additions & 0 deletions Web/Edubase.Data/Repositories/DataQualityStatusRepository.cs
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,21 @@ public async Task UpdateDataQualityAsync(DataQualityStatus.DataQualityEstablishm
}
}

public async Task UpdateDataQualityDataOwnerDetailsAsync(DataQualityStatus.DataQualityEstablishmentType establishmentType, string dataOwnerName, string dataOwnerEmail)
{
var query = Table.CreateQuery<DataQualityStatus>().Where(d => d.RowKey == ((int)establishmentType).ToString()).AsTableQuery();
var results = await query.ExecuteSegmentedAsync(null);
var dataQualityRecord = results.FirstOrDefault();
if (dataQualityRecord != null)
{
dataQualityRecord.DataOwner = dataOwnerName;
dataQualityRecord.Email = dataOwnerEmail;

var operation = TableOperation.InsertOrReplace(dataQualityRecord);
await Table.ExecuteAsync(operation);
}
}

private void SeedTable()
{
var seedData = new List<DataQualityStatus>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,6 @@ public interface IDataQualityStatusRepository
{
Task<List<DataQualityStatus>> GetAllAsync();
Task UpdateDataQualityAsync(DataQualityStatus.DataQualityEstablishmentType establishmentType, DateTime lastUpdated);
Task UpdateDataQualityDataOwnerDetailsAsync(DataQualityStatus.DataQualityEstablishmentType establishmentType, string dataOwnerName, string dataOwnerEmail);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,9 @@ public Dictionary<ET, EP[]> GetEstabType2EducationPhaseMap()
{ ET.ChildrensCentreLinkedSite, new[] { EP.NotApplicable } },
{ ET.InstitutionFundedByOtherGovernmentDepartment, new[] { EP.NotApplicable } },

{ET.OnlineProvider, new []{ EP.Primary, EP.MiddleDeemedPrimary, EP.Secondary, EP.MiddleDeemedSecondary, EP._16Plus, EP.AllThrough }}
{ET.OnlineProvider, new []{ EP.Primary, EP.MiddleDeemedPrimary, EP.Secondary, EP.MiddleDeemedSecondary, EP._16Plus, EP.AllThrough }},

{ET.AcademySecure16to19, new []{ EP._16Plus } }
};

return retVal;
Expand Down
92 changes: 47 additions & 45 deletions Web/Edubase.Services.Texuna/Lookup/LookupApiService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,53 +13,55 @@ public class LookupApiService : ILookupService
private readonly IHttpClientWrapper _httpClient;
private readonly ISecurityService _securityService;

//Mapping EstablishmentType.id to EstablishmentTypeGroup.id
private readonly Dictionary<int, List<int>> establishmentTypeToGroup = new Dictionary<int, List<int>>
{
{ 39, new List<int> { 2 } },
{ 40, new List<int> { 2 } },
{ 36, new List<int> { 2 } },
{ 37, new List<int> { 2 } },
{ 28, new List<int> { 2 } },
{ 38, new List<int> { 2, 8 } },
{ 27, new List<int> { 2, 8 } },
{ 22, new List<int> { 2 } },
{ 31, new List<int> { 10 } },
{ 41, new List<int> { 4 } },
{ 42, new List<int> { 4 } },
{ 5, new List<int> { 6 } },
{ 1, new List<int> { 7 } },
{ 6, new List<int> { 7, 8 } },
{ 14, new List<int> { 10 } },
{ 16, new List<int> { 10 } },
{ 4, new List<int> { 7 } },
{ 11, new List<int> { 7, 8 } },
{ 29, new List<int> { 3 } },
{ 33, new List<int> { 3 } },
{ 32, new List<int> { 3 } },
{ 30, new List<int> { 3, 8 } },
{ 15, new List<int> { 1 } },
{ 23, new List<int> { 5 } },
{ 8, new List<int> { 8 } },
{ 43, new List<int> { 10 } },
{ 13, new List<int> { 7 } },
{ 44, new List<int> { 10 } },
{ 21, new List<int> { 10 } },
{ 7, new List<int> { 8 } },
{ 19, new List<int> { 10 } },
{ 10, new List<int> { 6 } },
{ 9, new List<int> { 8 } },
{ 24, new List<int> { 9 } },
{ 17, new List<int> { 10 } },
{ 12, new List<int> { 7 } },
{ 18, new List<int> { 10 } },
{ 20, new List<int> { 10 } },
{ 25, new List<int> { 1 } },
{ 26, new List<int> { 10 } },
{ 35, new List<int> { 3 } },
{ 34, new List<int> { 3 } },
{ 2, new List<int> { 7 } },
{ 3, new List<int> { 7 } },
{ 45, new List<int> { 11 } }
{39, new List<int> {2}},
{40, new List<int> {2}},
{36, new List<int> {2}},
{37, new List<int> {2}},
{28, new List<int> {2}},
{38, new List<int> {2, 8}},
{27, new List<int> {2, 8}},
{22, new List<int> {2}},
{31, new List<int> {10}},
{41, new List<int> {4}},
{42, new List<int> {4}},
{5, new List<int> {6}},
{1, new List<int> {7}},
{6, new List<int> {7, 8}},
{14, new List<int> {10}},
{16, new List<int> {10}},
{4, new List<int> {7}},
{11, new List<int> {7, 8}},
{29, new List<int> {3}},
{33, new List<int> {3}},
{32, new List<int> {3}},
{30, new List<int> {3, 8}},
{15, new List<int> {1}},
{23, new List<int> {5}},
{8, new List<int> {8}},
{43, new List<int> {10}},
{13, new List<int> {7}},
{44, new List<int> {10}},
{21, new List<int> {10}},
{7, new List<int> {8}},
{19, new List<int> {10}},
{10, new List<int> {6}},
{9, new List<int> {8}},
{24, new List<int> {9}},
{17, new List<int> {10}},
{12, new List<int> {7}},
{18, new List<int> {10}},
{20, new List<int> {10}},
{25, new List<int> {1}},
{26, new List<int> {10}},
{35, new List<int> {3}},
{34, new List<int> {3}},
{2, new List<int> {7}},
{3, new List<int> {7}},
{45, new List<int> {11}},
{46, new List<int> {2}}
};

public LookupApiService(IHttpClientWrapper httpClient, ISecurityService securityService)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using System;
using System;
using System.Net;
using System.Net.Http;
using System.Net.Http.Headers;
Expand Down
5 changes: 5 additions & 0 deletions Web/Edubase.Services/DataQuality/DataQualityWriteService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,10 @@ public async Task UpdateDataQualityDate(DataQualityStatus.DataQualityEstablishme
{
await Repository.UpdateDataQualityAsync(establishmentType, updateTime);
}

public async Task UpdateDataQualityDataOwner(DataQualityStatus.DataQualityEstablishmentType establishmentType, string dataOwnerName, string dataOwnerEmail)
{
await Repository.UpdateDataQualityDataOwnerDetailsAsync(establishmentType, dataOwnerName, dataOwnerEmail);
}
}
}
3 changes: 2 additions & 1 deletion Web/Edubase.Services/DataQuality/IDataQualityWriteService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,6 @@ namespace Edubase.Services.DataQuality
public interface IDataQualityWriteService : IDataQualityReadService
{
Task UpdateDataQualityDate(DataQualityStatus.DataQualityEstablishmentType establishmentType, DateTime updateTime);
Task UpdateDataQualityDataOwner(DataQualityStatus.DataQualityEstablishmentType establishmentType, string dataOwnerName, string dataOwnerEmail);
}
}
}
5 changes: 3 additions & 2 deletions Web/Edubase.Services/Enums/EnumSets.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using System.Collections.Generic;
using System.Collections.Generic;
using System.Linq;

namespace Edubase.Services.Enums
Expand Down Expand Up @@ -36,7 +36,8 @@ public static class EnumSets
ET.FreeSchoolsAlternativeProvision,
ET.FreeSchoolsSpecial,
ET.StudioSchools,
ET.UniversityTechnicalCollege
ET.UniversityTechnicalCollege,
ET.AcademySecure16to19
}.Cast<int>();

public static IEnumerable<GR> eSingularGovernorRoles { get; } = new[]
Expand Down
3 changes: 2 additions & 1 deletion Web/Edubase.Services/Enums/eLookupEstablishmentType.cs
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ public enum eLookupEstablishmentType
VoluntaryAidedSchool = 2,
VoluntaryControlledSchool = 3,
WelshEstablishment = 24,
OnlineProvider = 45
OnlineProvider = 45,
AcademySecure16to19 = 46
}
}
9 changes: 4 additions & 5 deletions Web/Edubase.Services/Enums/eLookupEstablishmentTypeGroup.cs
Original file line number Diff line number Diff line change
@@ -1,18 +1,17 @@

namespace Edubase.Services.Enums
{
public enum eLookupEstablishmentTypeGroup
{
Academies = 2,
ChildrensCentres = 4,
Colleges = 1,
Academies = 2,
FreeSchools = 3,
ChildrensCentres = 4,
Universities = 5,
IndependentSchools = 6,
LAMaintainedSchools = 7,
OtherTypes = 10,
SpecialSchools = 8,
Universities = 5,
WelshSchools = 9,
OtherTypes = 10,
OnlineProvider = 11
}
}
4 changes: 4 additions & 0 deletions Web/Edubase.Services/Enums/eLookupGroupType.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@

namespace Edubase.Services.Enums
{
/// <summary>
/// This has the same values as the database table EstablishmentGroupType so has a confusing name
/// </summary>
public enum eLookupGroupType
{
ChildrensCentresCollaboration = 9,
Expand All @@ -11,6 +14,7 @@ public enum eLookupGroupType
SingleacademyTrust = 10,
Trust = 2,
UmbrellaTrust = 7,
SecureSingleAcademyTrust = 11
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ public EstablishmentDisplayEditPolicy Initialise(EstablishmentModel establishmen
HeadteacherLabel = "Headteacher/Manager";
HeadPreferredJobTitleLabel = "Headteacher/Manager preferred job title";
HeadEmailAddressLabel = "Headteacher/Manager email address";
EstablishmentTypeLabel = "Establishment type";
}

return this;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ public abstract class EstablishmentFieldListBase<T>

public virtual T CloseDate { get; set; }

public virtual T AccreditationExpiryDate { get; set; }

public virtual T EducationPhaseId { get; set; }

public virtual T StatutoryLowAge { get; set; }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,8 @@ public class EstablishmentModel

public DateTime? CloseDate { get; set; }

public DateTime? AccreditationExpiryDate { get; set; }

public int? EducationPhaseId { get; set; }

public int? StatutoryLowAge { get; set; }
Expand Down
3 changes: 2 additions & 1 deletion Web/Edubase.Services/Nomenclature/NomenclatureService.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using System;
using System;
using System.ComponentModel;
using Edubase.Common;
using Edubase.Common.Text;
Expand Down Expand Up @@ -43,6 +43,7 @@ public static string GetEstablishmentsPluralName(GT groupType, eTextCase textCas
case GT.MultiacademyTrust:
case GT.SingleacademyTrust:
case GT.SchoolSponsor:
case GT.SecureSingleAcademyTrust:
return "academies".ToTextCase(textCase);
case GT.UmbrellaTrust:
default:
Expand Down
4 changes: 3 additions & 1 deletion Web/Edubase.Services/Security/EdubaseRoles.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
namespace Edubase.Services.Security
namespace Edubase.Services.Security
{
public class EdubaseRoles
{
Expand Down Expand Up @@ -28,5 +28,7 @@ public class EdubaseRoles
public const string DUGE = "DUGE";
public const string LSU = "LSU";
public const string UKRLP = "UKRLP";
public const string YCS = "YCS";
public const string SSAT = "SESAT";//this value was taken so we have used SESAT for secure single academy trust
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@
<Name>Edubase.Services</Name>
</ProjectReference>
</ItemGroup>
<ItemGroup />
<Choose>
<When Condition="'$(VisualStudioVersion)' == '10.0' And '$(IsCodedUITest)' == 'True'">
<ItemGroup>
Expand Down
5 changes: 4 additions & 1 deletion Web/Edubase.Web.Resources/Edubase.Web.Resources.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,11 @@
<EmbeddedResource Include="Academy.resx">
<Generator>ResXFileCodeGenerator</Generator>
<LastGenOutput>Academy.Designer.cs</LastGenOutput>
<SubType>Designer</SubType>
</EmbeddedResource>
<EmbeddedResource Include="ApiMessages.resx">
<SubType>Designer</SubType>
</EmbeddedResource>
<EmbeddedResource Include="ApiMessages.resx" />
<EmbeddedResource Include="FileDownloadNames.resx">
<Generator>PublicResXFileCodeGenerator</Generator>
<LastGenOutput>FileDownloadNames.Designer.cs</LastGenOutput>
Expand Down
Loading

0 comments on commit 7d0af8b

Please sign in to comment.