refactor: Migrate backend and frontend architecture from a module-based to an app-based structure.
This commit is contained in:
@@ -42,9 +42,9 @@ public class ZentralDbContext : DbContext
|
||||
public DbSet<ReportImage> ReportImages => Set<ReportImage>();
|
||||
public DbSet<VirtualDataset> VirtualDatasets => Set<VirtualDataset>();
|
||||
|
||||
// Module system entities
|
||||
public DbSet<AppModule> AppModules => Set<AppModule>();
|
||||
public DbSet<ModuleSubscription> ModuleSubscriptions => Set<ModuleSubscription>();
|
||||
// App system entities
|
||||
public DbSet<App> Apps => Set<App>();
|
||||
public DbSet<AppSubscription> AppSubscriptions => Set<AppSubscription>();
|
||||
|
||||
// Auto Code system
|
||||
public DbSet<AutoCode> AutoCodes => Set<AutoCode>();
|
||||
@@ -348,8 +348,8 @@ public class ZentralDbContext : DbContext
|
||||
entity.HasIndex(e => e.Categoria);
|
||||
});
|
||||
|
||||
// AppModule
|
||||
modelBuilder.Entity<AppModule>(entity =>
|
||||
// App
|
||||
modelBuilder.Entity<App>(entity =>
|
||||
{
|
||||
entity.HasIndex(e => e.Code).IsUnique();
|
||||
entity.HasIndex(e => e.SortOrder);
|
||||
@@ -361,17 +361,17 @@ public class ZentralDbContext : DbContext
|
||||
.HasPrecision(5, 2);
|
||||
});
|
||||
|
||||
// ModuleSubscription
|
||||
modelBuilder.Entity<ModuleSubscription>(entity =>
|
||||
// AppSubscription
|
||||
modelBuilder.Entity<AppSubscription>(entity =>
|
||||
{
|
||||
entity.HasIndex(e => e.ModuleId).IsUnique();
|
||||
entity.HasIndex(e => e.AppId).IsUnique();
|
||||
|
||||
entity.Property(e => e.PaidPrice)
|
||||
.HasPrecision(18, 2);
|
||||
|
||||
entity.HasOne(e => e.Module)
|
||||
entity.HasOne(e => e.App)
|
||||
.WithOne(m => m.Subscription)
|
||||
.HasForeignKey<ModuleSubscription>(e => e.ModuleId)
|
||||
.HasForeignKey<AppSubscription>(e => e.AppId)
|
||||
.OnDelete(DeleteBehavior.Cascade);
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user