Removed location entities, fixed configurations and controllers' comments
This commit is contained in:
		| @@ -10,6 +10,6 @@ public static class PastVisaConfiguration<T> where T : class, IEntity | ||||
|     { | ||||
|         entity.Property(p => p.Name) | ||||
|             .IsUnicode(false) | ||||
|             .HasMaxLength(70); | ||||
|             .HasMaxLength(ConfigurationConstraints.VisaNameLength); | ||||
|     } | ||||
| } | ||||
|   | ||||
| @@ -1,6 +1,5 @@ | ||||
| using Domains; | ||||
| using Domains.VisaApplicationDomain; | ||||
| using Microsoft.EntityFrameworkCore; | ||||
| using Microsoft.EntityFrameworkCore.Metadata.Builders; | ||||
|  | ||||
| namespace Infrastructure.Database.VisaApplications.Configuration | ||||
| @@ -9,7 +8,9 @@ namespace Infrastructure.Database.VisaApplications.Configuration | ||||
|     { | ||||
|         public static void Configure(OwnedNavigationBuilder<T, PastVisit> entity) | ||||
|         { | ||||
|             entity.HasOne(p => p.DestinationCountry).WithMany().OnDelete(DeleteBehavior.Restrict); | ||||
|             entity.Property(pv => pv.DestinationCountry) | ||||
|                 .IsUnicode(false) | ||||
|                 .HasMaxLength(ConfigurationConstraints.CountryNameLength); | ||||
|         } | ||||
|     } | ||||
| } | ||||
|   | ||||
| @@ -10,6 +10,6 @@ public static class PermissionToDestCountryConfiguration<T> where T : class, IEn | ||||
|     { | ||||
|         entity.Property(p => p.Issuer) | ||||
|             .IsUnicode(false) | ||||
|             .HasMaxLength(200); | ||||
|             .HasMaxLength(ConfigurationConstraints.IssuerNameLength); | ||||
|     } | ||||
| } | ||||
|   | ||||
| @@ -10,6 +10,6 @@ public static class ReentryPermitConfiguration<T> where T : class, IEntity | ||||
|     { | ||||
|         entity.Property(p => p.Number) | ||||
|             .IsUnicode(false) | ||||
|             .HasMaxLength(25); | ||||
|             .HasMaxLength(ConfigurationConstraints.ReentryPermitNumberLength); | ||||
|     } | ||||
| } | ||||
|   | ||||
| @@ -1,4 +1,5 @@ | ||||
| using Domains.VisaApplicationDomain; | ||||
| using Domains.ApplicantDomain; | ||||
| using Domains.VisaApplicationDomain; | ||||
| using Microsoft.EntityFrameworkCore; | ||||
| using Microsoft.EntityFrameworkCore.Metadata.Builders; | ||||
|  | ||||
| @@ -11,11 +12,13 @@ public class VisaApplicationConfiguration : IEntityTypeConfiguration<VisaApplica | ||||
|         entity.OwnsOne(va => va.ReentryPermit, ReentryPermitConfiguration<VisaApplication>.Configure); | ||||
|         entity.OwnsOne(va => va.PermissionToDestCountry, PermissionToDestCountryConfiguration<VisaApplication>.Configure); | ||||
|         entity.OwnsMany(va => va.PastVisits, PastVisitConfiguration<VisaApplication>.Configure); | ||||
|         entity.OwnsMany(va => va.PastVisas); | ||||
|         entity.OwnsMany(va => va.PastVisas, PastVisaConfiguration<VisaApplication>.Configure); | ||||
|  | ||||
|         entity.HasOne(va => va.DestinationCountry).WithMany().OnDelete(DeleteBehavior.Restrict); | ||||
|         entity.Property(va => va.DestinationCountry) | ||||
|             .IsUnicode(false) | ||||
|             .HasMaxLength(ConfigurationConstraints.CountryNameLength); | ||||
|  | ||||
|         entity.HasOne(va => va.Applicant) | ||||
|         entity.HasOne<Applicant>() | ||||
|             .WithMany() | ||||
|             .HasForeignKey(va => va.ApplicantId) | ||||
|             .IsRequired(); | ||||
|   | ||||
| @@ -10,7 +10,6 @@ public sealed class VisaApplicationsRepository(IGenericReader reader, IGenericWr | ||||
| { | ||||
|     protected override IQueryable<VisaApplication> LoadDomain() | ||||
|         => base.LoadDomain() | ||||
|             .Include(va => va.DestinationCountry) | ||||
|             .Include(va => va.PastVisas) | ||||
|             .Include(va => va.PastVisits); | ||||
|  | ||||
|   | ||||
		Reference in New Issue
	
	Block a user