Remove UserReceiver repository and related entities

This commit removes the `IUserReceiverRepository` service registration from `DIExtensions`, indicating it is no longer needed. The `UserReceiver` and `Config` DbSet properties have been eliminated from the `EGDbContext`, along with their initialization in the constructor. Additionally, the `UserReceiver` entity has been removed from the model builder configuration and the associated trigger has been deleted. These changes reflect a refactoring of the data model to simplify the architecture and improve maintainability.
This commit is contained in:
tekh 2025-06-30 14:23:00 +02:00
parent 425d21084b
commit 35f46d3182
2 changed files with 0 additions and 6 deletions

View File

@ -53,7 +53,6 @@ public static class DIExtensions
services.TryAddScoped<IEnvelopeReceiverRepository, EnvelopeReceiverRepository>();
services.TryAddScoped<IEnvelopeTypeRepository, EnvelopeTypeRepository>();
services.TryAddScoped<IReceiverRepository, ReceiverRepository>();
services.TryAddScoped<IUserReceiverRepository, UserReceiverRepository>();
services.TryAddScoped<IEnvelopeReceiverReadOnlyRepository, EnvelopeReceiverReadOnlyRepository>();
services.AddDbRepository<EGDbContext, Config>(context => context.Configs).UseAutoMapper();

View File

@ -17,8 +17,6 @@ namespace EnvelopeGenerator.Infrastructure;
//TODO: Adding EmailOut instead of EmailOut.Abst is not correct for the arch. Re-design EmailPut consedering this. IMailDbContext shoud move to Abstraction layer (hint: in this case using DBSet in abst. will be problem because entity framework will have to be added.
public class EGDbContext : DbContext, IUserManagerDbContext, IMailDbContext
{
public DbSet<UserReceiver> UserReceivers { get; set; }
public DbSet<Config> Configs { get; set; }
public DbSet<EnvelopeReceiver> EnvelopeReceivers { get; set; }
@ -68,7 +66,6 @@ public class EGDbContext : DbContext, IUserManagerDbContext, IMailDbContext
_triggers = triggerParamOptions.Value;
_logger = logger;
UserReceivers = Set<UserReceiver>();
Configs = Set<Config>();
EnvelopeReceivers = Set<EnvelopeReceiver>();
Envelopes = Set<Envelope>();
@ -106,7 +103,6 @@ public class EGDbContext : DbContext, IUserManagerDbContext, IMailDbContext
modelBuilder.Entity<EnvelopeHistory>();
modelBuilder.Entity<EnvelopeType>();
modelBuilder.Entity<Receiver>();
modelBuilder.Entity<UserReceiver>();
modelBuilder.Entity<EmailOut>();
// Configure the one-to-many relationship of Envelope
@ -171,7 +167,6 @@ public class EGDbContext : DbContext, IUserManagerDbContext, IMailDbContext
AddTrigger<EnvelopeReceiverReadOnly>();
AddTrigger<EnvelopeType>();
AddTrigger<Receiver>();
AddTrigger<UserReceiver>();
AddTrigger<EmailOut>();
//configure model builder for user manager tables