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

Commit

Permalink
fix(enrolling): change email address as required field
Browse files Browse the repository at this point in the history
Also improve some logging and update nuget package dependency
  • Loading branch information
ratanparai committed Jun 27, 2020
1 parent 0ac94ec commit e3da303
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 3 deletions.
Expand Up @@ -9,7 +9,7 @@ public class EnrollmentApplicationCommandValidator
public EnrollmentApplicationCommandValidator()
{
RuleFor(application => application.Name).NotEmpty();
RuleFor(application => application.Email).EmailAddress();
RuleFor(application => application.Email).NotEmpty().EmailAddress();
RuleFor(application => application.Mobile).NotEmpty();
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/Services/Enrolling/Enrolling.API/Enrolling.API.csproj
Expand Up @@ -32,7 +32,7 @@
<PackageReference Include="Serilog.Sinks.Seq" Version="4.0.0" />

<!-- Swagger -->
<PackageReference Include="Swashbuckle.AspNetCore" Version="5.5.0" />
<PackageReference Include="Swashbuckle.AspNetCore" Version="5.5.1" />

<!-- Need this package for generating migration files -->
<PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="3.1.5">
Expand Down
2 changes: 1 addition & 1 deletion src/Services/Enrolling/Enrolling.API/IWebHostExtensions.cs
Expand Up @@ -21,7 +21,7 @@ public static IHost MigrateDbContext<TContext>(this IHost webHost, Action<TConte

try
{
logger.LogInformation($"Migrating database associated with context { typeof(TContext).Name}");
logger.LogInformation("Migrating database associated with context {ContextName}", typeof(TContext).Name);

var retry = Policy.Handle<SqlException>()
.WaitAndRetry(new TimeSpan[]
Expand Down
4 changes: 4 additions & 0 deletions src/Services/Enrolling/Enrolling.API/Startup.cs
Expand Up @@ -46,6 +46,10 @@ public void ConfigureServices(IServiceCollection services)
});

services.AddControllers()
.AddJsonOptions(options =>
{
options.JsonSerializerOptions.IgnoreNullValues = true;
})
.AddFluentValidation(fv =>
fv.RegisterValidatorsFromAssemblyContaining<EnrollmentApplicationCommandValidator>());

Expand Down

0 comments on commit e3da303

Please sign in to comment.