Skip to content

Commit

Permalink
Merge pull request #329 from UKGovernmentBEIS/develop
Browse files Browse the repository at this point in the history
Merge dev to staging
  • Loading branch information
AiswaryaBEIS authored Dec 17, 2024
2 parents 9c113fe + 4bea87e commit 24d46f3
Show file tree
Hide file tree
Showing 56 changed files with 7,724 additions and 527 deletions.
6 changes: 5 additions & 1 deletion DVSRegister.BusinessLogic/Services/Consent/ConsentService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,13 @@ public async Task<bool> RemoveProceedApplicationConsentToken(string token, strin
return null ;
}
}
public async Task<GenericResponse> UpdateServiceStatus(int serviceId, string providerEmail)
public async Task<GenericResponse> UpdateServiceStatus(int serviceId, string providerEmail, string companyName, string serviceName)
{
GenericResponse genericResponse = await consentRepository.UpdateServiceStatus(serviceId, ServiceStatusEnum.Received, providerEmail);
if(genericResponse.Success)
{
await emailSender.SendAgreementToProceedApplicationToDSIT(companyName, serviceName);
}
return genericResponse;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ public interface IConsentService
//opening loop
public Task<bool> RemoveConsentToken(string token, string tokenId, string loggedInUserEmail);
public Task<ServiceDto?> GetProviderAndCertificateDetailsByToken(string token, string tokenId);
public Task<GenericResponse> UpdateServiceStatus(int serviceId, string providerEmail);
public Task<GenericResponse> UpdateServiceStatus(int serviceId, string providerEmail, string companyName, string serviceName);


//closing loop
Expand Down
21 changes: 21 additions & 0 deletions DVSRegister.CommonUtility/Email/GovUkNotifyApi.cs
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,27 @@ public async Task<bool> SendCertificateInfoSubmittedToDSIT()
return await SendEmail(emailModel);
}


#region openong the loop
public async Task<bool> SendAgreementToProceedApplicationToDSIT(string companyName, string serviceName)
{
var template = govUkNotifyConfig.AgreementToProceedApplicationToDSIT;

var personalisation = new Dictionary<string, dynamic>
{
{ template.CompanyName, companyName},
{ template.ServiceName, serviceName}
};
var emailModel = new GovUkNotifyEmailModel
{
EmailAddress = govUkNotifyConfig.OfDiaEmailId,
TemplateId = template.Id,
Personalisation = personalisation
};
return await SendEmail(emailModel);
}
#endregion

#region closing the loop
public async Task<bool> SendAgreementToPublishToDIP(string companyName, string serviceName, string recipientName, string emailAddress)
{
Expand Down
3 changes: 3 additions & 0 deletions DVSRegister.CommonUtility/Email/IEmailSender.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@ public interface IEmailSender
public Task<bool> SendEmailCabInformationSubmitted(string emailAddress, string recipientName);
public Task<bool> SendCertificateInfoSubmittedToDSIT();

//opening the loop
public Task<bool> SendAgreementToProceedApplicationToDSIT(string companyName, string serviceName);

//closing the loop
public Task<bool> SendAgreementToPublishToDSIT(string companyName, string serviceName);
public Task<bool> SendAgreementToPublishToDIP(string companyName, string serviceName, string recipientName, string emailAddress);
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
namespace DVSRegister.CommonUtility.Models
{
public class AgreementToProceedApplicationToDSIT
{
public string Id { get; set; }
public string CompanyName { get; set; }
public string ServiceName { get; set; }
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -20,5 +20,6 @@ public class GovUkNotifyConfiguration

public AgreementToPublishTemplate AgreementToPublishTemplate { get; set; }
public AgreementToPublishToDSITTemplate AgreementToPublishToDSITTemplate { get; set; }
public AgreementToProceedApplicationToDSIT AgreementToProceedApplicationToDSIT { get; set; }
}
}
9 changes: 4 additions & 5 deletions DVSRegister.Data/CAB/CabRepository.cs
Original file line number Diff line number Diff line change
Expand Up @@ -76,13 +76,12 @@ public async Task<List<ProviderProfile>> GetProviders(int cabId, string searchTe
.OrderBy(p => p.ModifiedTime != null ? p.ModifiedTime : p.CreatedTime);
if (!string.IsNullOrEmpty(searchText))
{
searchText = searchText.Trim().ToLower();
providerQuery = providerQuery.Where(p => p.SearchVector.Matches(searchText) ||
p.Services.Any(s => s.SearchVector.Matches(searchText)));
}
searchText = searchText.Trim().ToLower();
providerQuery = providerQuery.Where(p => p.Services.Any(s => EF.Functions.TrigramsSimilarity(s.ServiceName.ToLower(), searchText.ToLower()) > .1));
}
var searchResults = await providerQuery.ToListAsync();
return searchResults;
}
}

public async Task<ProviderProfile> GetProvider(int providerId,int cabId)
{
Expand Down
9 changes: 0 additions & 9 deletions DVSRegister.Data/DVSRegisterDbContext.cs
Original file line number Diff line number Diff line change
Expand Up @@ -124,15 +124,6 @@ protected override void OnModelCreating(ModelBuilder modelBuilder)
modelBuilder.Entity<TrustmarkNumber>()
.ToTable(b => b.HasCheckConstraint("CK_ServiceNumber", "\"ServiceNumber\" BETWEEN 1 AND 99"));

modelBuilder.Entity<ProviderProfile>()
.HasGeneratedTsVectorColumn(p => p.SearchVector, "english", p => new { p.RegisteredName, p.TradingName })
.HasIndex(p => p.SearchVector)
.HasMethod("GIN");

modelBuilder.Entity<Service>()
.HasGeneratedTsVectorColumn(p => p.SearchVector, "english", p => new { p.ServiceName })
.HasIndex(p => p.SearchVector)
.HasMethod("GIN");

modelBuilder.Entity<QualityLevel>().HasData(
new QualityLevel { Id =1, Level = "Low", QualityType = QualityTypeEnum.Authentication },
Expand Down
30 changes: 15 additions & 15 deletions DVSRegister.Data/Entities/CertificateReview.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,21 +19,21 @@ public CertificateReview() { }
public int ProviProviderProfileId { get; set; }
public ProviderProfile ProviderProfile { get; set; }

public bool IsCabLogoCorrect { get; set; }
public bool IsCabDetailsCorrect { get; set; }
public bool IsProviderDetailsCorrect { get; set; }
public bool IsServiceNameCorrect { get; set; }
public bool IsRolesCertifiedCorrect { get; set; }
public bool IsCertificationScopeCorrect { get; set; }
public bool IsServiceSummaryCorrect { get; set; }
public bool IsURLLinkToServiceCorrect { get; set; }
public bool IsGPG44Correct { get; set; }
public bool IsGPG45Correct { get; set; }
public bool IsServiceProvisionCorrect { get; set; }
public bool IsLocationCorrect { get; set; }
public bool IsDateOfIssueCorrect { get; set; }
public bool IsDateOfExpiryCorrect { get; set; }
public bool IsAuthenticyVerifiedCorrect { get; set; }
public bool? IsCabLogoCorrect { get; set; }
public bool? IsCabDetailsCorrect { get; set; }
public bool? IsProviderDetailsCorrect { get; set; }
public bool? IsServiceNameCorrect { get; set; }
public bool? IsRolesCertifiedCorrect { get; set; }
public bool? IsCertificationScopeCorrect { get; set; }
public bool? IsServiceSummaryCorrect { get; set; }
public bool? IsURLLinkToServiceCorrect { get; set; }
public bool? IsGPG44Correct { get; set; }
public bool? IsGPG45Correct { get; set; }
public bool? IsServiceProvisionCorrect { get; set; }
public bool? IsLocationCorrect { get; set; }
public bool? IsDateOfIssueCorrect { get; set; }
public bool? IsDateOfExpiryCorrect { get; set; }
public bool? IsAuthenticyVerifiedCorrect { get; set; }
public string? Comments { get; set; }
public bool? InformationMatched { get; set; }
public string CommentsForIncorrect { get; set; }
Expand Down
3 changes: 1 addition & 2 deletions DVSRegister.Data/Entities/ProviderProfile.cs
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,7 @@ public class ProviderProfile
public int CabUserId { get; set; }
public CabUser CabUser { get; set; }
public ProviderStatusEnum ProviderStatus { get; set; }
public ICollection<Service>? Services { get; set; }
public NpgsqlTsVector SearchVector { get; set; }
public ICollection<Service>? Services { get; set; }
public DateTime? CreatedTime { get; set; }
public DateTime? ModifiedTime { get; set; }
public DateTime? PublishedTime { get; set; }
Expand Down
20 changes: 10 additions & 10 deletions DVSRegister.Data/Entities/PublicInterestCheck.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,16 +18,16 @@ public PublicInterestCheck() { }
[ForeignKey("ProviderProfile")]
public int ProviderProfileId { get; set; }
public ProviderProfile Provider { get; set; }
public bool IsCompanyHouseNumberApproved { get; set; }
public bool IsDirectorshipsApproved { get; set; }
public bool IsDirectorshipsAndRelationApproved { get; set; }
public bool IsTradingAddressApproved { get; set; }
public bool IsSanctionListApproved { get; set; }
public bool IsUNFCApproved { get; set; }
public bool IsECCheckApproved { get; set; }
public bool IsTARICApproved { get; set; }
public bool IsBannedPoliticalApproved { get; set; }
public bool IsProvidersWebpageApproved { get; set; }
public bool? IsCompanyHouseNumberApproved { get; set; }
public bool? IsDirectorshipsApproved { get; set; }
public bool? IsDirectorshipsAndRelationApproved { get; set; }
public bool? IsTradingAddressApproved { get; set; }
public bool? IsSanctionListApproved { get; set; }
public bool? IsUNFCApproved { get; set; }
public bool? IsECCheckApproved { get; set; }
public bool? IsTARICApproved { get; set; }
public bool? IsBannedPoliticalApproved { get; set; }
public bool? IsProvidersWebpageApproved { get; set; }
public PublicInterestCheckEnum PublicInterestCheckStatus { get; set; }
public RejectionReasonEnum? RejectionReason { get; set; }
public string? RejectionReasons { get; set; }
Expand Down
3 changes: 1 addition & 2 deletions DVSRegister.Data/Entities/Service.cs
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,7 @@ public Service() { }
public CabUser CabUser { get; set; }
public int ServiceNumber { get;set; }

public ServiceStatusEnum ServiceStatus { get; set; }
public NpgsqlTsVector SearchVector { get; set; }
public ServiceStatusEnum ServiceStatus { get; set; }
public DateTime? CreatedTime { get; set; }
public DateTime? ModifiedTime { get; set; }
public DateTime? PublishedTime { get; set; }
Expand Down
Loading

0 comments on commit 24d46f3

Please sign in to comment.