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

Commit e3da303

Browse files
committed
fix(enrolling): change email address as required field
Also improve some logging and update nuget package dependency
1 parent 0ac94ec commit e3da303

4 files changed

Lines changed: 7 additions & 3 deletions

File tree

src/Services/Enrolling/Enrolling.API/Application/Validations/EnrollmentApplicationCommandValidator.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ public class EnrollmentApplicationCommandValidator
99
public EnrollmentApplicationCommandValidator()
1010
{
1111
RuleFor(application => application.Name).NotEmpty();
12-
RuleFor(application => application.Email).EmailAddress();
12+
RuleFor(application => application.Email).NotEmpty().EmailAddress();
1313
RuleFor(application => application.Mobile).NotEmpty();
1414
}
1515
}

src/Services/Enrolling/Enrolling.API/Enrolling.API.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
<PackageReference Include="Serilog.Sinks.Seq" Version="4.0.0" />
3333

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

3737
<!-- Need this package for generating migration files -->
3838
<PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="3.1.5">

src/Services/Enrolling/Enrolling.API/IWebHostExtensions.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ public static IHost MigrateDbContext<TContext>(this IHost webHost, Action<TConte
2121

2222
try
2323
{
24-
logger.LogInformation($"Migrating database associated with context { typeof(TContext).Name}");
24+
logger.LogInformation("Migrating database associated with context {ContextName}", typeof(TContext).Name);
2525

2626
var retry = Policy.Handle<SqlException>()
2727
.WaitAndRetry(new TimeSpan[]

src/Services/Enrolling/Enrolling.API/Startup.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,10 @@ public void ConfigureServices(IServiceCollection services)
4646
});
4747

4848
services.AddControllers()
49+
.AddJsonOptions(options =>
50+
{
51+
options.JsonSerializerOptions.IgnoreNullValues = true;
52+
})
4953
.AddFluentValidation(fv =>
5054
fv.RegisterValidatorsFromAssemblyContaining<EnrollmentApplicationCommandValidator>());
5155

0 commit comments

Comments
 (0)