Added new modules and updated existing logic

This commit is contained in:
Dieter Neumann
2026-02-24 13:32:01 +01:00
parent 2a4b4ed5fe
commit ad734273ce
694 changed files with 27935 additions and 610 deletions

View File

@@ -0,0 +1,38 @@
using Microsoft.EntityFrameworkCore;
using HotlinePlanner.Models;
namespace HotlinePlanner.Data
{
public class HotlinePlannerDbContext : DbContext
{
public HotlinePlannerDbContext(DbContextOptions<HotlinePlannerDbContext> options)
: base(options)
{
}
public DbSet<Token> Tokens { get; set; } = null!;
public DbSet<UserProfile> UserProfiles { get; set; } = null!;
public DbSet<EventLog> EventLogs { get; set; } = null!;
protected override void OnModelCreating(ModelBuilder modelBuilder)
{
base.OnModelCreating(modelBuilder);
modelBuilder.Entity<Token>(entity =>
{
entity.HasKey(e => e.Id);
entity.Property(e => e.Tenant).IsRequired();
entity.Property(e => e.UserId).IsRequired();
entity.Property(e => e.EncryptedToken).IsRequired();
});
modelBuilder.Entity<EventLog>(entity =>
{
entity.HasKey(e => e.Id);
entity.Property(e => e.Level).IsRequired();
entity.Property(e => e.Category).IsRequired();
entity.Property(e => e.Message).IsRequired();
});
}
}
}