DateTime instead of DateOnly, fixed warnings
This commit is contained in:
		| @@ -1,13 +1,13 @@ | |||||||
| using Domains.ApplicantDomain; | using Domains.ApplicantDomain; | ||||||
| using Domains.VisaApplicationDomain; | using Domains.VisaApplicationDomain; | ||||||
| 
 | 
 | ||||||
| namespace ApplicationLayer; | namespace ApplicationLayer.VisaApplication; | ||||||
| 
 | 
 | ||||||
| /// Model of visa request from user | /// Model of visa request from user | ||||||
| public record CreateVisaApplicationRequest( | public record CreateVisaApplicationRequest( | ||||||
|     Name FullName, |     Name FullName, | ||||||
|     Passport Passport, |     Passport Passport, | ||||||
|     DateOnly BirthDate, |     DateTime BirthDate, | ||||||
|     string BirthCity, |     string BirthCity, | ||||||
|     string BirthCountry, |     string BirthCountry, | ||||||
|     string CitizenShip, |     string CitizenShip, | ||||||
| @@ -16,7 +16,7 @@ namespace Domains.ApplicantDomain | |||||||
|         public Passport Passport { get; set; } = null!; |         public Passport Passport { get; set; } = null!; | ||||||
|  |  | ||||||
|         /// Date of birth of the <see cref="Applicant"/> |         /// Date of birth of the <see cref="Applicant"/> | ||||||
|         public DateOnly BirthDate { get; set; } |         public DateTime BirthDate { get; set; } | ||||||
|  |  | ||||||
|         /// <see cref="Country"/> of birth of the <see cref="Applicant"/> |         /// <see cref="Country"/> of birth of the <see cref="Applicant"/> | ||||||
|         public Country CountryOfBirth { get; set; } = null!; |         public Country CountryOfBirth { get; set; } = null!; | ||||||
|   | |||||||
| @@ -11,9 +11,9 @@ | |||||||
|         public string Issuer { get; set; } = null!; |         public string Issuer { get; set; } = null!; | ||||||
|  |  | ||||||
|         /// Date of issue |         /// Date of issue | ||||||
|         public DateOnly IssueDate { get; set; } |         public DateTime IssueDate { get; set; } | ||||||
|  |  | ||||||
|         /// Date when the <see cref="Passport"/> expires |         /// Date when the <see cref="Passport"/> expires | ||||||
|         public DateOnly ExpirationDate { get; set; } |         public DateTime ExpirationDate { get; set; } | ||||||
|     } |     } | ||||||
| } | } | ||||||
|   | |||||||
| @@ -9,12 +9,12 @@ namespace Domains.VisaApplicationDomain | |||||||
|         public Guid Id { get; private set; } = Guid.NewGuid(); |         public Guid Id { get; private set; } = Guid.NewGuid(); | ||||||
|  |  | ||||||
|         /// Date of issue |         /// Date of issue | ||||||
|         public DateOnly IssueDate { get; set; } |         public DateTime IssueDate { get; set; } | ||||||
|  |  | ||||||
|         /// Name of visa |         /// Name of visa | ||||||
|         public string Name { get; set; } = null!; |         public string Name { get; set; } = null!; | ||||||
|  |  | ||||||
|         /// Date when visa expires |         /// Date when visa expires | ||||||
|         public DateOnly ExpirationDate { get; set; } |         public DateTime ExpirationDate { get; set; } | ||||||
|     } |     } | ||||||
| } | } | ||||||
|   | |||||||
| @@ -9,9 +9,9 @@ namespace Domains.VisaApplicationDomain | |||||||
|         public Guid Id { get; private set; } = Guid.NewGuid(); |         public Guid Id { get; private set; } = Guid.NewGuid(); | ||||||
|  |  | ||||||
|         /// First day of <see cref="PastVisit"/> |         /// First day of <see cref="PastVisit"/> | ||||||
|         public DateOnly StartDate { get; set; } |         public DateTime StartDate { get; set; } | ||||||
|  |  | ||||||
|         /// Last day of <see cref="PastVisit"/> |         /// Last day of <see cref="PastVisit"/> | ||||||
|         public DateOnly EndDate { get; set; } |         public DateTime EndDate { get; set; } | ||||||
|     } |     } | ||||||
| } | } | ||||||
|   | |||||||
| @@ -5,7 +5,7 @@ | |||||||
|     public class PermissionToDestCountry |     public class PermissionToDestCountry | ||||||
|     { |     { | ||||||
|         /// Date when <see cref="PermissionToDestCountry"/> expires |         /// Date when <see cref="PermissionToDestCountry"/> expires | ||||||
|         public DateOnly ExpirationDate { get; set; } |         public DateTime ExpirationDate { get; set; } | ||||||
|  |  | ||||||
|         /// Issuing authority |         /// Issuing authority | ||||||
|         public string Issuer { get; set; } = null!; |         public string Issuer { get; set; } = null!; | ||||||
|   | |||||||
| @@ -8,6 +8,6 @@ | |||||||
|         public string Number { get; set; } = null!; |         public string Number { get; set; } = null!; | ||||||
|  |  | ||||||
|         /// Date when <see cref="ReentryPermit"/> expires |         /// Date when <see cref="ReentryPermit"/> expires | ||||||
|         public DateOnly ExpirationDate { get; set; } |         public DateTime ExpirationDate { get; set; } | ||||||
|     } |     } | ||||||
| } | } | ||||||
|   | |||||||
| @@ -43,7 +43,7 @@ namespace Domains.VisaApplicationDomain | |||||||
|         public RequestedNumberOfEntries RequestedNumberOfEntries { get; set; } |         public RequestedNumberOfEntries RequestedNumberOfEntries { get; set; } | ||||||
|  |  | ||||||
|         /// When application was created |         /// When application was created | ||||||
|         public DateOnly RequestDate { get; set; } |         public DateTime RequestDate { get; set; } | ||||||
|  |  | ||||||
|         /// Valid days requested |         /// Valid days requested | ||||||
|         public int ValidDaysRequested { get; set; } |         public int ValidDaysRequested { get; set; } | ||||||
|   | |||||||
| @@ -4,7 +4,7 @@ using Microsoft.EntityFrameworkCore; | |||||||
|  |  | ||||||
| namespace Infrastructure.Database | namespace Infrastructure.Database | ||||||
| { | { | ||||||
|     public class DbContext(DbContextOptions<Infrastructure.Database.DbContext> opts) |     public class DbContext(DbContextOptions<DbContext> opts) | ||||||
|         : Microsoft.EntityFrameworkCore.DbContext(opts), IGenericWriter, IGenericReader, IUnitOfWork |         : Microsoft.EntityFrameworkCore.DbContext(opts), IGenericWriter, IGenericReader, IUnitOfWork | ||||||
|     { |     { | ||||||
|         protected override void OnModelCreating(ModelBuilder modelBuilder) |         protected override void OnModelCreating(ModelBuilder modelBuilder) | ||||||
|   | |||||||
| @@ -17,7 +17,7 @@ namespace SchengenVisaApi | |||||||
|         } |         } | ||||||
|  |  | ||||||
|         /// Add services needed for Presentation layer |         /// Add services needed for Presentation layer | ||||||
|         private static IServiceCollection AddPresentation(this IServiceCollection services) |         private static void AddPresentation(this IServiceCollection services) | ||||||
|         { |         { | ||||||
|             services.AddControllers(); |             services.AddControllers(); | ||||||
|             services.AddEndpointsApiExplorer(); |             services.AddEndpointsApiExplorer(); | ||||||
| @@ -26,8 +26,6 @@ namespace SchengenVisaApi | |||||||
|                 var xmlFilename = $"{Assembly.GetExecutingAssembly().GetName().Name}.xml"; |                 var xmlFilename = $"{Assembly.GetExecutingAssembly().GetName().Name}.xml"; | ||||||
|                 options.IncludeXmlComments(Path.Combine(AppContext.BaseDirectory, xmlFilename)); |                 options.IncludeXmlComments(Path.Combine(AppContext.BaseDirectory, xmlFilename)); | ||||||
|             }); |             }); | ||||||
|  |  | ||||||
|             return services; |  | ||||||
|         } |         } | ||||||
|     } |     } | ||||||
| } | } | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user