|
@@ -21,7 +21,13 @@ namespace Workbench.Entity
|
|
|
public virtual DbSet<Currency> Currencies { get; set; } = null!;
|
|
public virtual DbSet<Currency> Currencies { get; set; } = null!;
|
|
|
public virtual DbSet<Customer> Customers { get; set; } = null!;
|
|
public virtual DbSet<Customer> Customers { get; set; } = null!;
|
|
|
public virtual DbSet<CustomerUser> CustomerUsers { get; set; } = null!;
|
|
public virtual DbSet<CustomerUser> CustomerUsers { get; set; } = null!;
|
|
|
|
|
+ public virtual DbSet<QueueDatum> QueueData { get; set; } = null!;
|
|
|
|
|
+ public virtual DbSet<QueueDone> QueueDones { get; set; } = null!;
|
|
|
|
|
+ public virtual DbSet<QueueFailed> QueueFaileds { get; set; } = null!;
|
|
|
|
|
+ public virtual DbSet<QueuePending> QueuePendings { get; set; } = null!;
|
|
|
|
|
+ public virtual DbSet<QueueProcessing> QueueProcessings { get; set; } = null!;
|
|
|
public virtual DbSet<Setting> Settings { get; set; } = null!;
|
|
public virtual DbSet<Setting> Settings { get; set; } = null!;
|
|
|
|
|
+ public virtual DbSet<StatusHistory> StatusHistories { get; set; } = null!;
|
|
|
public virtual DbSet<Tenant> Tenants { get; set; } = null!;
|
|
public virtual DbSet<Tenant> Tenants { get; set; } = null!;
|
|
|
public virtual DbSet<TenantCountry> TenantCountries { get; set; } = null!;
|
|
public virtual DbSet<TenantCountry> TenantCountries { get; set; } = null!;
|
|
|
public virtual DbSet<TenantCurrency> TenantCurrencies { get; set; } = null!;
|
|
public virtual DbSet<TenantCurrency> TenantCurrencies { get; set; } = null!;
|
|
@@ -249,6 +255,290 @@ namespace Workbench.Entity
|
|
|
.HasConstraintName("REL_CUSTOMETUSER_CUSTOMER_ID");
|
|
.HasConstraintName("REL_CUSTOMETUSER_CUSTOMER_ID");
|
|
|
});
|
|
});
|
|
|
|
|
|
|
|
|
|
+ modelBuilder.Entity<QueueDatum>(entity =>
|
|
|
|
|
+ {
|
|
|
|
|
+ entity.ToTable("QueueData", "Processor");
|
|
|
|
|
+
|
|
|
|
|
+ entity.Property(e => e.Id).HasComment("Record identifier. Primary key");
|
|
|
|
|
+
|
|
|
|
|
+ entity.Property(e => e.Code)
|
|
|
|
|
+ .HasMaxLength(100)
|
|
|
|
|
+ .HasComment("Data code. Main key to search.");
|
|
|
|
|
+
|
|
|
|
|
+ entity.Property(e => e.IsInput).HasComment("Defines if data is input value");
|
|
|
|
|
+
|
|
|
|
|
+ entity.Property(e => e.ParentId).HasComment("Reference to master (or group) record");
|
|
|
|
|
+
|
|
|
|
|
+ entity.Property(e => e.SequenceNo).HasComment("Ordinal sequence number of processing related records");
|
|
|
|
|
+
|
|
|
|
|
+ entity.Property(e => e.Value)
|
|
|
|
|
+ .HasMaxLength(500)
|
|
|
|
|
+ .HasComment("Data value");
|
|
|
|
|
+
|
|
|
|
|
+ entity.Property(e => e.ValueTypeQualified)
|
|
|
|
|
+ .HasMaxLength(500)
|
|
|
|
|
+ .HasComment("Qualified name of value type");
|
|
|
|
|
+
|
|
|
|
|
+ entity.HasOne(d => d.Parent)
|
|
|
|
|
+ .WithMany(p => p.InverseParent)
|
|
|
|
|
+ .HasForeignKey(d => d.ParentId)
|
|
|
|
|
+ .OnDelete(DeleteBehavior.ClientSetNull)
|
|
|
|
|
+ .HasConstraintName("REL_DATA_DATA_ID");
|
|
|
|
|
+ });
|
|
|
|
|
+
|
|
|
|
|
+ modelBuilder.Entity<QueueDone>(entity =>
|
|
|
|
|
+ {
|
|
|
|
|
+ entity.ToTable("QueueDone", "Processor");
|
|
|
|
|
+
|
|
|
|
|
+ entity.Property(e => e.Id).HasComment("Record identifier. Primary key");
|
|
|
|
|
+
|
|
|
|
|
+ entity.Property(e => e.AffinityWorker)
|
|
|
|
|
+ .HasMaxLength(64)
|
|
|
|
|
+ .HasComment("Owner worker identifier who processing task");
|
|
|
|
|
+
|
|
|
|
|
+ entity.Property(e => e.Attempt).HasComment("Attempt counter to process task");
|
|
|
|
|
+
|
|
|
|
|
+ entity.Property(e => e.Created)
|
|
|
|
|
+ .HasColumnType("datetime")
|
|
|
|
|
+ .HasDefaultValueSql("(getdate())")
|
|
|
|
|
+ .HasComment("Record created timestamp");
|
|
|
|
|
+
|
|
|
|
|
+ entity.Property(e => e.DataId).HasComment("Reference to data collection");
|
|
|
|
|
+
|
|
|
|
|
+ entity.Property(e => e.Finished)
|
|
|
|
|
+ .HasColumnType("datetime")
|
|
|
|
|
+ .HasComment("Record finished at");
|
|
|
|
|
+
|
|
|
|
|
+ entity.Property(e => e.LastStatusChanged)
|
|
|
|
|
+ .HasColumnType("datetime")
|
|
|
|
|
+ .HasDefaultValueSql("(getdate())")
|
|
|
|
|
+ .HasComment("Last status change timestamp");
|
|
|
|
|
+
|
|
|
|
|
+ entity.Property(e => e.Owner)
|
|
|
|
|
+ .HasMaxLength(50)
|
|
|
|
|
+ .HasComment("Owner (abstract) key identifier. Usually entity code");
|
|
|
|
|
+
|
|
|
|
|
+ entity.Property(e => e.StartFrom)
|
|
|
|
|
+ .HasColumnType("datetime")
|
|
|
|
|
+ .HasComment("Record processing from datetime");
|
|
|
|
|
+
|
|
|
|
|
+ entity.Property(e => e.StartTo)
|
|
|
|
|
+ .HasColumnType("datetime")
|
|
|
|
|
+ .HasComment("Record processing to datetime. If overflow then record is expired.");
|
|
|
|
|
+
|
|
|
|
|
+ entity.Property(e => e.Started)
|
|
|
|
|
+ .HasColumnType("datetime")
|
|
|
|
|
+ .HasDefaultValueSql("(getdate())")
|
|
|
|
|
+ .HasComment("Record started processing at");
|
|
|
|
|
+
|
|
|
|
|
+ entity.Property(e => e.Status).HasComment("Record status (Pending-0,Assigned-1,Working-2,Success-3,Failed-4,Expired-5)");
|
|
|
|
|
+
|
|
|
|
|
+ entity.Property(e => e.StatusHistoryId).HasComment("Reference to status history collection");
|
|
|
|
|
+
|
|
|
|
|
+ entity.Property(e => e.TenantCode)
|
|
|
|
|
+ .HasMaxLength(20)
|
|
|
|
|
+ .HasComment("Reference to tenant code that queue belongs");
|
|
|
|
|
+
|
|
|
|
|
+ entity.HasOne(d => d.Data)
|
|
|
|
|
+ .WithMany(p => p.QueueDones)
|
|
|
|
|
+ .HasForeignKey(d => d.DataId)
|
|
|
|
|
+ .OnDelete(DeleteBehavior.ClientSetNull)
|
|
|
|
|
+ .HasConstraintName("REL_QDONE_DATA_ID");
|
|
|
|
|
+
|
|
|
|
|
+ entity.HasOne(d => d.StatusHistory)
|
|
|
|
|
+ .WithMany(p => p.QueueDones)
|
|
|
|
|
+ .HasForeignKey(d => d.StatusHistoryId)
|
|
|
|
|
+ .OnDelete(DeleteBehavior.ClientSetNull)
|
|
|
|
|
+ .HasConstraintName("REL_QDONE_STATUSHISTORY_ID");
|
|
|
|
|
+ });
|
|
|
|
|
+
|
|
|
|
|
+ modelBuilder.Entity<QueueFailed>(entity =>
|
|
|
|
|
+ {
|
|
|
|
|
+ entity.ToTable("QueueFailed", "Processor");
|
|
|
|
|
+
|
|
|
|
|
+ entity.Property(e => e.Id).HasComment("Record identifier. Primary key");
|
|
|
|
|
+
|
|
|
|
|
+ entity.Property(e => e.AffinityWorker)
|
|
|
|
|
+ .HasMaxLength(64)
|
|
|
|
|
+ .HasComment("Owner worker identifier who processing task");
|
|
|
|
|
+
|
|
|
|
|
+ entity.Property(e => e.Attempt).HasComment("Attempt counter to process task");
|
|
|
|
|
+
|
|
|
|
|
+ entity.Property(e => e.Created)
|
|
|
|
|
+ .HasColumnType("datetime")
|
|
|
|
|
+ .HasDefaultValueSql("(getdate())")
|
|
|
|
|
+ .HasComment("Record created timestamp");
|
|
|
|
|
+
|
|
|
|
|
+ entity.Property(e => e.DataId).HasComment("Reference to data collection");
|
|
|
|
|
+
|
|
|
|
|
+ entity.Property(e => e.Finished)
|
|
|
|
|
+ .HasColumnType("datetime")
|
|
|
|
|
+ .HasComment("Record finished at");
|
|
|
|
|
+
|
|
|
|
|
+ entity.Property(e => e.LastStatusChanged)
|
|
|
|
|
+ .HasColumnType("datetime")
|
|
|
|
|
+ .HasDefaultValueSql("(getdate())")
|
|
|
|
|
+ .HasComment("Last status change timestamp");
|
|
|
|
|
+
|
|
|
|
|
+ entity.Property(e => e.Owner)
|
|
|
|
|
+ .HasMaxLength(50)
|
|
|
|
|
+ .HasComment("Owner (abstract) key identifier. Usually entity code");
|
|
|
|
|
+
|
|
|
|
|
+ entity.Property(e => e.StartFrom)
|
|
|
|
|
+ .HasColumnType("datetime")
|
|
|
|
|
+ .HasComment("Record processing from datetime");
|
|
|
|
|
+
|
|
|
|
|
+ entity.Property(e => e.StartTo)
|
|
|
|
|
+ .HasColumnType("datetime")
|
|
|
|
|
+ .HasComment("Record processing to datetime. If overflow then record is expired.");
|
|
|
|
|
+
|
|
|
|
|
+ entity.Property(e => e.Started)
|
|
|
|
|
+ .HasColumnType("datetime")
|
|
|
|
|
+ .HasDefaultValueSql("(getdate())")
|
|
|
|
|
+ .HasComment("Record started processing at");
|
|
|
|
|
+
|
|
|
|
|
+ entity.Property(e => e.Status).HasComment("Record status (Pending-0,Assigned-1,Working-2,Success-3,Failed-4,Expired-5)");
|
|
|
|
|
+
|
|
|
|
|
+ entity.Property(e => e.StatusHistoryId).HasComment("Reference to status history collection");
|
|
|
|
|
+
|
|
|
|
|
+ entity.Property(e => e.TenantCode)
|
|
|
|
|
+ .HasMaxLength(20)
|
|
|
|
|
+ .HasComment("Reference to tenant code that queue belongs");
|
|
|
|
|
+
|
|
|
|
|
+ entity.HasOne(d => d.Data)
|
|
|
|
|
+ .WithMany(p => p.QueueFaileds)
|
|
|
|
|
+ .HasForeignKey(d => d.DataId)
|
|
|
|
|
+ .OnDelete(DeleteBehavior.ClientSetNull)
|
|
|
|
|
+ .HasConstraintName("REL_QFAILED_DATA_ID");
|
|
|
|
|
+
|
|
|
|
|
+ entity.HasOne(d => d.StatusHistory)
|
|
|
|
|
+ .WithMany(p => p.QueueFaileds)
|
|
|
|
|
+ .HasForeignKey(d => d.StatusHistoryId)
|
|
|
|
|
+ .OnDelete(DeleteBehavior.ClientSetNull)
|
|
|
|
|
+ .HasConstraintName("REL_QFAILED_STATUSHISTORY_ID");
|
|
|
|
|
+ });
|
|
|
|
|
+
|
|
|
|
|
+ modelBuilder.Entity<QueuePending>(entity =>
|
|
|
|
|
+ {
|
|
|
|
|
+ entity.ToTable("QueuePending", "Processor");
|
|
|
|
|
+
|
|
|
|
|
+ entity.Property(e => e.Id).HasComment("Record identifier. Primary key");
|
|
|
|
|
+
|
|
|
|
|
+ entity.Property(e => e.AffinityWorker)
|
|
|
|
|
+ .HasMaxLength(64)
|
|
|
|
|
+ .HasComment("Owner worker identifier who processing task");
|
|
|
|
|
+
|
|
|
|
|
+ entity.Property(e => e.Created)
|
|
|
|
|
+ .HasColumnType("datetime")
|
|
|
|
|
+ .HasDefaultValueSql("(getdate())")
|
|
|
|
|
+ .HasComment("Record created timestamp");
|
|
|
|
|
+
|
|
|
|
|
+ entity.Property(e => e.DataId).HasComment("Reference to data collection");
|
|
|
|
|
+
|
|
|
|
|
+ entity.Property(e => e.LastStatusChanged)
|
|
|
|
|
+ .HasColumnType("datetime")
|
|
|
|
|
+ .HasDefaultValueSql("(getdate())")
|
|
|
|
|
+ .HasComment("Last status change timestamp");
|
|
|
|
|
+
|
|
|
|
|
+ entity.Property(e => e.Owner)
|
|
|
|
|
+ .HasMaxLength(50)
|
|
|
|
|
+ .HasComment("Owner (abstract) key identifier. Usually entity code");
|
|
|
|
|
+
|
|
|
|
|
+ entity.Property(e => e.StartFrom)
|
|
|
|
|
+ .HasColumnType("datetime")
|
|
|
|
|
+ .HasComment("Record processing from datetime");
|
|
|
|
|
+
|
|
|
|
|
+ entity.Property(e => e.StartTo)
|
|
|
|
|
+ .HasColumnType("datetime")
|
|
|
|
|
+ .HasComment("Record processing to datetime. If overflow then record is expired.");
|
|
|
|
|
+
|
|
|
|
|
+ entity.Property(e => e.Status).HasComment("Record status (Pending-0,Assigned-1,Working-2,Success-3,Failed-4,Expired-5)");
|
|
|
|
|
+
|
|
|
|
|
+ entity.Property(e => e.StatusHistoryId).HasComment("Reference to status history collection");
|
|
|
|
|
+
|
|
|
|
|
+ entity.Property(e => e.TenantCode)
|
|
|
|
|
+ .HasMaxLength(20)
|
|
|
|
|
+ .HasComment("Reference to tenant code that queue belongs");
|
|
|
|
|
+
|
|
|
|
|
+ entity.HasOne(d => d.Data)
|
|
|
|
|
+ .WithMany(p => p.QueuePendings)
|
|
|
|
|
+ .HasForeignKey(d => d.DataId)
|
|
|
|
|
+ .OnDelete(DeleteBehavior.ClientSetNull)
|
|
|
|
|
+ .HasConstraintName("REL_QPENDING_DATA_ID");
|
|
|
|
|
+
|
|
|
|
|
+ entity.HasOne(d => d.StatusHistory)
|
|
|
|
|
+ .WithMany(p => p.QueuePendings)
|
|
|
|
|
+ .HasForeignKey(d => d.StatusHistoryId)
|
|
|
|
|
+ .OnDelete(DeleteBehavior.ClientSetNull)
|
|
|
|
|
+ .HasConstraintName("REL_QPENDING_STATUSHISTORY_ID");
|
|
|
|
|
+ });
|
|
|
|
|
+
|
|
|
|
|
+ modelBuilder.Entity<QueueProcessing>(entity =>
|
|
|
|
|
+ {
|
|
|
|
|
+ entity.ToTable("QueueProcessing", "Processor");
|
|
|
|
|
+
|
|
|
|
|
+ entity.Property(e => e.Id).HasComment("Record identifier. Primary key");
|
|
|
|
|
+
|
|
|
|
|
+ entity.Property(e => e.AffinityWorker)
|
|
|
|
|
+ .HasMaxLength(64)
|
|
|
|
|
+ .HasComment("Owner worker identifier who processing task");
|
|
|
|
|
+
|
|
|
|
|
+ entity.Property(e => e.Attempt).HasComment("Attempt counter to process task");
|
|
|
|
|
+
|
|
|
|
|
+ entity.Property(e => e.Created)
|
|
|
|
|
+ .HasColumnType("datetime")
|
|
|
|
|
+ .HasDefaultValueSql("(getdate())")
|
|
|
|
|
+ .HasComment("Record created timestamp");
|
|
|
|
|
+
|
|
|
|
|
+ entity.Property(e => e.DataId).HasComment("Reference to data collection");
|
|
|
|
|
+
|
|
|
|
|
+ entity.Property(e => e.Finished)
|
|
|
|
|
+ .HasColumnType("datetime")
|
|
|
|
|
+ .HasComment("Record finished at");
|
|
|
|
|
+
|
|
|
|
|
+ entity.Property(e => e.LastStatusChanged)
|
|
|
|
|
+ .HasColumnType("datetime")
|
|
|
|
|
+ .HasDefaultValueSql("(getdate())")
|
|
|
|
|
+ .HasComment("Last status change timestamp");
|
|
|
|
|
+
|
|
|
|
|
+ entity.Property(e => e.Owner)
|
|
|
|
|
+ .HasMaxLength(50)
|
|
|
|
|
+ .HasComment("Owner (abstract) key identifier. Usually entity code");
|
|
|
|
|
+
|
|
|
|
|
+ entity.Property(e => e.StartFrom)
|
|
|
|
|
+ .HasColumnType("datetime")
|
|
|
|
|
+ .HasComment("Record processing from datetime");
|
|
|
|
|
+
|
|
|
|
|
+ entity.Property(e => e.StartTo)
|
|
|
|
|
+ .HasColumnType("datetime")
|
|
|
|
|
+ .HasComment("Record processing to datetime. If overflow then record is expired.");
|
|
|
|
|
+
|
|
|
|
|
+ entity.Property(e => e.Started)
|
|
|
|
|
+ .HasColumnType("datetime")
|
|
|
|
|
+ .HasDefaultValueSql("(getdate())")
|
|
|
|
|
+ .HasComment("Record started processing at");
|
|
|
|
|
+
|
|
|
|
|
+ entity.Property(e => e.Status).HasComment("Record status (Pending-0,Assigned-1,Working-2,Success-3,Failed-4,Expired-5)");
|
|
|
|
|
+
|
|
|
|
|
+ entity.Property(e => e.StatusHistoryId).HasComment("Reference to status history collection");
|
|
|
|
|
+
|
|
|
|
|
+ entity.Property(e => e.TenantCode)
|
|
|
|
|
+ .HasMaxLength(20)
|
|
|
|
|
+ .HasComment("Reference to tenant code that queue belongs");
|
|
|
|
|
+
|
|
|
|
|
+ entity.HasOne(d => d.Data)
|
|
|
|
|
+ .WithMany(p => p.QueueProcessings)
|
|
|
|
|
+ .HasForeignKey(d => d.DataId)
|
|
|
|
|
+ .OnDelete(DeleteBehavior.ClientSetNull)
|
|
|
|
|
+ .HasConstraintName("REL_QPROCESSING_DATA_ID");
|
|
|
|
|
+
|
|
|
|
|
+ entity.HasOne(d => d.StatusHistory)
|
|
|
|
|
+ .WithMany(p => p.QueueProcessings)
|
|
|
|
|
+ .HasForeignKey(d => d.StatusHistoryId)
|
|
|
|
|
+ .OnDelete(DeleteBehavior.ClientSetNull)
|
|
|
|
|
+ .HasConstraintName("REL_QPROCESSING_STATUSHISTORY_ID");
|
|
|
|
|
+ });
|
|
|
|
|
+
|
|
|
modelBuilder.Entity<Setting>(entity =>
|
|
modelBuilder.Entity<Setting>(entity =>
|
|
|
{
|
|
{
|
|
|
entity.ToTable("Setting", "base");
|
|
entity.ToTable("Setting", "base");
|
|
@@ -309,6 +599,34 @@ namespace Workbench.Entity
|
|
|
.HasConstraintName("REL_SETTING_TENANT_ID");
|
|
.HasConstraintName("REL_SETTING_TENANT_ID");
|
|
|
});
|
|
});
|
|
|
|
|
|
|
|
|
|
+ modelBuilder.Entity<StatusHistory>(entity =>
|
|
|
|
|
+ {
|
|
|
|
|
+ entity.ToTable("StatusHistory", "Processor");
|
|
|
|
|
+
|
|
|
|
|
+ entity.Property(e => e.Id).HasComment("Record identifier. Primary key");
|
|
|
|
|
+
|
|
|
|
|
+ entity.Property(e => e.Attempt)
|
|
|
|
|
+ .HasDefaultValueSql("((0))")
|
|
|
|
|
+ .HasComment("Actual attempt counter to process task");
|
|
|
|
|
+
|
|
|
|
|
+ entity.Property(e => e.Created)
|
|
|
|
|
+ .HasColumnType("datetime")
|
|
|
|
|
+ .HasDefaultValueSql("(getdate())")
|
|
|
|
|
+ .HasComment("Record created timestamp");
|
|
|
|
|
+
|
|
|
|
|
+ entity.Property(e => e.ErrorMessage).HasComment("Last error message");
|
|
|
|
|
+
|
|
|
|
|
+ entity.Property(e => e.ParentId).HasComment("Reference to master (or group) record");
|
|
|
|
|
+
|
|
|
|
|
+ entity.Property(e => e.Status).HasComment("Record status (Pending-0,Assigned-1,Working-2,Success-3,Failed-4,Expired-5)");
|
|
|
|
|
+
|
|
|
|
|
+ entity.HasOne(d => d.Parent)
|
|
|
|
|
+ .WithMany(p => p.InverseParent)
|
|
|
|
|
+ .HasForeignKey(d => d.ParentId)
|
|
|
|
|
+ .OnDelete(DeleteBehavior.ClientSetNull)
|
|
|
|
|
+ .HasConstraintName("REL_STATUSHISTORY_STATUSHISTORY_ID");
|
|
|
|
|
+ });
|
|
|
|
|
+
|
|
|
modelBuilder.Entity<Tenant>(entity =>
|
|
modelBuilder.Entity<Tenant>(entity =>
|
|
|
{
|
|
{
|
|
|
entity.ToTable("Tenant", "base");
|
|
entity.ToTable("Tenant", "base");
|