feat: add Logs

This commit is contained in:
2026-09-20 16:21:15 +07:00
parent 637ca51f47
commit d3c3ecd5e6
62 changed files with 1577 additions and 66 deletions
@@ -22,6 +22,104 @@ namespace mws.backend.dotnet.infrastructure.Migrations
NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder);
modelBuilder.Entity("mws.backend.dotnet.domain.Audit.ActionLog", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("uuid");
b.Property<string>("Action")
.IsRequired()
.HasMaxLength(100)
.HasColumnType("character varying(100)");
b.Property<Guid>("ActorUserId")
.HasColumnType("uuid");
b.Property<string>("ActorUsername")
.IsRequired()
.HasMaxLength(100)
.HasColumnType("character varying(100)");
b.Property<DateTimeOffset>("CreatedAt")
.HasColumnType("timestamp with time zone");
b.Property<Guid?>("EntityId")
.HasColumnType("uuid");
b.Property<string>("EntityName")
.HasMaxLength(255)
.HasColumnType("character varying(255)");
b.Property<string>("EntityType")
.IsRequired()
.HasMaxLength(50)
.HasColumnType("character varying(50)");
b.Property<string>("IpAddress")
.HasMaxLength(45)
.HasColumnType("character varying(45)");
b.Property<string>("UserAgent")
.HasMaxLength(512)
.HasColumnType("character varying(512)");
b.HasKey("Id");
b.HasIndex("Action");
b.HasIndex("ActorUserId");
b.HasIndex("CreatedAt");
b.HasIndex("EntityType");
b.ToTable("action_logs", (string)null);
});
modelBuilder.Entity("mws.backend.dotnet.domain.Audit.LoginLog", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("uuid");
b.Property<DateTimeOffset>("CreatedAt")
.HasColumnType("timestamp with time zone");
b.Property<string>("FailureReason")
.HasMaxLength(100)
.HasColumnType("character varying(100)");
b.Property<string>("IpAddress")
.HasMaxLength(45)
.HasColumnType("character varying(45)");
b.Property<bool>("Success")
.HasColumnType("boolean");
b.Property<string>("UserAgent")
.HasMaxLength(512)
.HasColumnType("character varying(512)");
b.Property<Guid?>("UserId")
.HasColumnType("uuid");
b.Property<string>("Username")
.IsRequired()
.HasMaxLength(100)
.HasColumnType("character varying(100)");
b.HasKey("Id");
b.HasIndex("CreatedAt");
b.HasIndex("Success");
b.HasIndex("Username");
b.ToTable("login_logs", (string)null);
});
modelBuilder.Entity("mws.backend.dotnet.domain.Documents.Document", b =>
{
b.Property<Guid>("Id")