using AyCode.Core.Tests.Internal.Entities;
using AyCode.Database.DbContexts.Users;
using Microsoft.EntityFrameworkCore;

namespace AyCode.Database.Tests.Internal.Users;

public sealed class UserDbContext : AcUserDbContextBase<User, Profile, UserToken, Company, UserToCompany, Address, EmailMessage>
{
    public UserDbContext() //: this(string.Empty)
    {

    }

    public UserDbContext(DbContextOptions<UserDbContext> options) //: this(string.Empty)
    {

    }

    public UserDbContext(string name) : base(name)
    {
    }

    public UserDbContext(DbContextOptions<DbContext> options, string name) : base(options, name)
    {
    }

    protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
    {
        base.OnConfiguring(optionsBuilder);

        optionsBuilder.UseLazyLoadingProxies(true);
        optionsBuilder.EnableDetailedErrors(true);
    }

    protected override void OnModelCreating(ModelBuilder modelBuilder)
    {
        base.OnModelCreating(modelBuilder);

        //new UserEntityTypeDefaultConfiguration().Configure(modelBuilder.Entity<User>());
        //new ProfileEntityTypeConfigurations().Configure(modelBuilder.Entity<Profile>());

        //new EmailMessageEntityTypeDefaultConfigurations().Configure(modelBuilder.Entity<EmailMessage>());
    }
}
