diff --git a/api/src/Kurs.Platform.Domain/Entities/Host/LogEntry.cs b/api/src/Kurs.Platform.Domain/Entities/Host/LogEntry.cs new file mode 100644 index 00000000..4b42875b --- /dev/null +++ b/api/src/Kurs.Platform.Domain/Entities/Host/LogEntry.cs @@ -0,0 +1,14 @@ +using System; +using Volo.Abp.Domain.Entities; + +namespace Kurs.Platform.Entities; + +public class LogEntry : Entity +{ + public string? Message { get; set; } + public string? MessageTemplate { get; set; } + public string? Level { get; set; } + public DateTime? TimeStamp { get; set; } + public string? Exception { get; set; } + public string? Properties { get; set; } +} diff --git a/api/src/Kurs.Platform.EntityFrameworkCore/EntityFrameworkCore/PlatformDbContext.cs b/api/src/Kurs.Platform.EntityFrameworkCore/EntityFrameworkCore/PlatformDbContext.cs index 21f50af2..233426de 100644 --- a/api/src/Kurs.Platform.EntityFrameworkCore/EntityFrameworkCore/PlatformDbContext.cs +++ b/api/src/Kurs.Platform.EntityFrameworkCore/EntityFrameworkCore/PlatformDbContext.cs @@ -38,6 +38,7 @@ public class PlatformDbContext : ITenantManagementDbContext { #region Saas + public DbSet LogEntries { get; set; } public DbSet Tenants { get; set; } public DbSet TenantConnectionStrings { get; set; } public DbSet AiBots { get; set; } @@ -2391,5 +2392,11 @@ public class PlatformDbContext : .HasForeignKey(x => x.PartnerId) .OnDelete(DeleteBehavior.Restrict); }); + + builder.Entity(b => + { + b.ToTable(TableNameResolver.GetFullTableName(nameof(TableNameEnum.LogEntry)), Prefix.DbSchema); + b.ConfigureByConvention(); + }); } } diff --git a/api/src/Kurs.Platform.EntityFrameworkCore/Migrations/20251103110012_Initial.Designer.cs b/api/src/Kurs.Platform.EntityFrameworkCore/Migrations/20251103131643_Initial.Designer.cs similarity index 99% rename from api/src/Kurs.Platform.EntityFrameworkCore/Migrations/20251103110012_Initial.Designer.cs rename to api/src/Kurs.Platform.EntityFrameworkCore/Migrations/20251103131643_Initial.Designer.cs index 96df44ad..9730c324 100644 --- a/api/src/Kurs.Platform.EntityFrameworkCore/Migrations/20251103110012_Initial.Designer.cs +++ b/api/src/Kurs.Platform.EntityFrameworkCore/Migrations/20251103131643_Initial.Designer.cs @@ -13,7 +13,7 @@ using Volo.Abp.EntityFrameworkCore; namespace Kurs.Platform.Migrations { [DbContext(typeof(PlatformDbContext))] - [Migration("20251103110012_Initial")] + [Migration("20251103131643_Initial")] partial class Initial { /// @@ -5509,6 +5509,34 @@ namespace Kurs.Platform.Migrations b.ToTable("Sas_H_ListFormImportExecute", (string)null); }); + modelBuilder.Entity("Kurs.Platform.Entities.LogEntry", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("Exception") + .HasColumnType("nvarchar(max)"); + + b.Property("Level") + .HasColumnType("nvarchar(max)"); + + b.Property("Message") + .HasColumnType("nvarchar(max)"); + + b.Property("MessageTemplate") + .HasColumnType("nvarchar(max)"); + + b.Property("Properties") + .HasColumnType("nvarchar(max)"); + + b.Property("TimeStamp") + .HasColumnType("datetime2"); + + b.HasKey("Id"); + + b.ToTable("Plat_H_LogEntry", (string)null); + }); + modelBuilder.Entity("Kurs.Platform.Entities.MaterialGroup", b => { b.Property("Id") diff --git a/api/src/Kurs.Platform.EntityFrameworkCore/Migrations/20251103110012_Initial.cs b/api/src/Kurs.Platform.EntityFrameworkCore/Migrations/20251103131643_Initial.cs similarity index 99% rename from api/src/Kurs.Platform.EntityFrameworkCore/Migrations/20251103110012_Initial.cs rename to api/src/Kurs.Platform.EntityFrameworkCore/Migrations/20251103131643_Initial.cs index 3f6106ba..0801e401 100644 --- a/api/src/Kurs.Platform.EntityFrameworkCore/Migrations/20251103110012_Initial.cs +++ b/api/src/Kurs.Platform.EntityFrameworkCore/Migrations/20251103131643_Initial.cs @@ -1634,6 +1634,23 @@ namespace Kurs.Platform.Migrations table.UniqueConstraint("AK_Plat_H_LanguageKey_ResourceName_Key", x => new { x.ResourceName, x.Key }); }); + migrationBuilder.CreateTable( + name: "Plat_H_LogEntry", + columns: table => new + { + Id = table.Column(type: "uniqueidentifier", nullable: false), + Message = table.Column(type: "nvarchar(max)", nullable: true), + MessageTemplate = table.Column(type: "nvarchar(max)", nullable: true), + Level = table.Column(type: "nvarchar(max)", nullable: true), + TimeStamp = table.Column(type: "datetime2", nullable: true), + Exception = table.Column(type: "nvarchar(max)", nullable: true), + Properties = table.Column(type: "nvarchar(max)", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_Plat_H_LogEntry", x => x.Id); + }); + migrationBuilder.CreateTable( name: "Plat_H_NotificationRule", columns: table => new @@ -6216,6 +6233,9 @@ namespace Kurs.Platform.Migrations migrationBuilder.DropTable( name: "Plat_H_LanguageText"); + migrationBuilder.DropTable( + name: "Plat_H_LogEntry"); + migrationBuilder.DropTable( name: "Plat_H_Notification"); diff --git a/api/src/Kurs.Platform.EntityFrameworkCore/Migrations/PlatformDbContextModelSnapshot.cs b/api/src/Kurs.Platform.EntityFrameworkCore/Migrations/PlatformDbContextModelSnapshot.cs index e9f1c43d..498cc42f 100644 --- a/api/src/Kurs.Platform.EntityFrameworkCore/Migrations/PlatformDbContextModelSnapshot.cs +++ b/api/src/Kurs.Platform.EntityFrameworkCore/Migrations/PlatformDbContextModelSnapshot.cs @@ -5506,6 +5506,34 @@ namespace Kurs.Platform.Migrations b.ToTable("Sas_H_ListFormImportExecute", (string)null); }); + modelBuilder.Entity("Kurs.Platform.Entities.LogEntry", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("Exception") + .HasColumnType("nvarchar(max)"); + + b.Property("Level") + .HasColumnType("nvarchar(max)"); + + b.Property("Message") + .HasColumnType("nvarchar(max)"); + + b.Property("MessageTemplate") + .HasColumnType("nvarchar(max)"); + + b.Property("Properties") + .HasColumnType("nvarchar(max)"); + + b.Property("TimeStamp") + .HasColumnType("datetime2"); + + b.HasKey("Id"); + + b.ToTable("Plat_H_LogEntry", (string)null); + }); + modelBuilder.Entity("Kurs.Platform.Entities.MaterialGroup", b => { b.Property("Id")