using GozareshgirProgramManager.Application._Common.Interfaces; using GozareshgirProgramManager.Domain.CheckoutAgg.Entities; using GozareshgirProgramManager.Domain.CustomerAgg; using GozareshgirProgramManager.Application._Common.Interfaces; using GozareshgirProgramManager.Domain.CustomerAgg; using GozareshgirProgramManager.Domain.ProjectAgg.Entities; using GozareshgirProgramManager.Domain.RoleAgg.Entities; using GozareshgirProgramManager.Domain.RoleUserAgg; using GozareshgirProgramManager.Domain.SalaryPaymentSettingAgg.Entities; using GozareshgirProgramManager.Domain.UserAgg.Entities; using GozareshgirProgramManager.Domain.SkillAgg.Entities; using Microsoft.EntityFrameworkCore; namespace GozareshgirProgramManager.Infrastructure.Persistence.Context; public class ProgramManagerDbContext : DbContext, IProgramManagerDbContext { public ProgramManagerDbContext(DbContextOptions options) : base(options) { } public DbSet Customers { get; set; } = null!; public DbSet TaskSections { get; set; } = null!; public DbSet ProjectSections { get; set; } = null!; public DbSet PhaseSections { get; set; } = null!; // New Hierarchy entities public DbSet Projects { get; set; } = null!; public DbSet ProjectPhases { get; set; } = null!; public DbSet ProjectTasks { get; set; } = null!; public DbSet TaskSectionActivities { get; set; } = null!; public DbSet TaskSectionAdditionalTimes { get; set; } = null!; public DbSet Users { get; set; } = null!; public DbSet RefreshTokens { get; set; } = null!; public DbSet Checkouts { get; set; } = null!; public DbSet SalaryPaymentSettings { get; set; } = null!; public DbSet Roles { get; set; } = null!; public DbSet Skills { get; set; } = null!; protected override void OnModelCreating(ModelBuilder modelBuilder) { modelBuilder.ApplyConfigurationsFromAssembly(typeof(ProgramManagerDbContext).Assembly); base.OnModelCreating(modelBuilder); } public async Task SeedSkillsIfEmptyAsync() { if (!Skills.Any()) { Skills.AddRange( new Skill("UI/UX Design"), new Skill("Frontend"), new Skill("Backend") ); await SaveChangesAsync(); } } }