
using Microsoft.EntityFrameworkCore;
using System.Diagnostics.CodeAnalysis;



namespace DataBase.Entities.Models
{
    [ExcludeFromCodeCoverage]
    public partial class ComputraceqaContext : DbContext
    {
        public ComputraceqaContext()
        {
        }

        public ComputraceqaContext(DbContextOptions<ComputraceqaContext> options)
            : base(options)
        {
        }

        public virtual DbSet<CallDetail> CallDetails { get; set; }
        public virtual DbSet<AuditLog> AuditLog { get; set; }
        public virtual DbSet<EmployeeHir> EmployeeHir { get; set; }
        public virtual DbSet<EmployeeWorkingTime> EmployeeWorkingTimes { get; set; }
        public virtual DbSet<RunningApplicationDetail> RunningApplicationDetails { get; set; }
        public virtual DbSet<SystemLoginDetail> SystemLoginDetails { get; set; }
        public virtual DbSet<SystemSleepDetail> SystemSleepDetails { get; set; }
        public virtual DbSet<GraphDetail> GraphDetail { get; set; }

        public virtual DbSet<DashboardDetails> DashboardDetails { get; set; }

        public virtual DbSet<UserProfile> UserProfile { get; set; }

        public virtual DbSet<ActivityDetails> ActivityDetails { get; set; }

        public virtual DbSet<UserActivityDetails> UserActivityDetails { get; set; }

        public virtual DbSet<ApplicationActivityReport> ApplicationActivityReport { get; set; }

        public virtual DbSet<ApplicationActivityReportResult> ApplicationActivityReportResult { get; set; }

        public virtual DbSet<CallsActivityReport> CallsActivityReport { get; set; }

        public virtual DbSet<CallsActivityReportResult> CallsActivityReportResult { get; set; }

        public virtual DbSet<SessionActivityReport> SessionActivityReport { get; set; }

        public virtual DbSet<SessionActivityReportResult> SessionActivityReportResult { get; set; }

        public virtual DbSet<LogInActivityReport> LogInActivityReport { get; set; }

        public virtual DbSet<LogInActivityReportResult> LogInActivityReportResult { get; set; }

        public virtual DbSet<ReportActivityDetails> ReportActivityDetailsResult { get; set; }

        public virtual DbSet<ReportActivityDetailsResults> ReportActivityDetailsResults { get; set; }

        public virtual DbSet<JsonResultModel> JsonResultModel { get; set; }

        public virtual DbSet<Details> Details { get; set; }

        public virtual DbSet<AllUserDetails> AllUserDetails { get; set; }

        public virtual DbSet<UserActive> UserActives { get; set; }

        public virtual DbSet<DeleteUser> DeleteUsers { get; set; }

        public virtual DbSet<AllUserDetailsResult> AllUserDetailsResults { get; set; }

        public DbSet<TempDataResult> TempDataResult { get; set; }

        public DbSet<SummaryDetails> SummaryDetails { get; set; }

        public DbSet<BrowsingHistoryDetails> BrowsingHistoryDetails { get; set; }

        public DbSet<ApplicationTabDetail> ApplicationTabDetail { get; set; }

        public DbSet<ApplicationTabDetailsView> ApplicationTabDetailsView { get; set; }
        public DbSet<TopBottomDetailsResponseResult> GetSummaryTopBottomDetails { get; set; }
        public DbSet<UserModels> UserModels { get; set; }

        public DbSet<LocationDetails> LocationDetails { get; set; }

        public DbSet<PermissionDetailsResult> PermissionDetailsResult { get; set; }

        public DbSet<PermissionDetails> PermissionDetails { get; set; }

        public DbSet<ManagerRoles> ManagerRoles { get; set; }

        public DbSet<RoleDetails> RoleDetails { get; set; }
        public DbSet<RoleChangeResult> CheckUserRoleChange { get; set; }
        
        public DbSet<CreateRoles> CreateRoles { get; set; }

        public DbSet<UpdateRoles> UpdateRoles { get; set; }

        public DbSet<ApplicationProperties> ApplicationProperties { get; set; }

        public DbSet<MenuList> MenuList { get; set; }

        public DbSet<AllUser> AllUsers{ get; set; }

        public DbSet<EmployeeDetail> EmployeeDetails { get; set; }

        public DbSet<AuditDetails> AuditDetails { get; set; }

        public DbSet<DeleteRole> DeleteRole { get; set; }

        public DbSet<SmartSearch> SmartSearch { get; set; }

        public DbSet<GlobalConfiguration> GlobalConfiguration { get; set; }

        public DbSet<GlobalConfigurationUpdatePropertiesStatusDB> GlobalConfigurationUpdatePropertiesStatusDB { get; set; }

        public DbSet<GlobalConfigurationUpdatePropertiesValueDB> GlobalConfigurationUpdatePropertiesValueDB { get; set; }
        public DbSet<StafflineUser> StafflineUsers { get; set; }

        protected override void OnModelCreating(ModelBuilder modelBuilder)
        {
            modelBuilder.UseCollation("utf8mb4_0900_ai_ci")
                .HasCharSet("utf8mb4");

            modelBuilder.Entity<StafflineUser>(entity =>
            {
                entity.ToTable("staffline_users");

                entity.HasKey(e => e.Id);

                entity.HasIndex(e => e.EmailId)
                      .IsUnique();

                entity.Property(e => e.EmailId)
                      .HasColumnName("email_id")
                      .HasMaxLength(255)
                      .IsRequired();

                entity.Property(e => e.EmployeeId)
                      .HasColumnName("employee_id")
                      .HasMaxLength(50);

                entity.Property(e => e.Country)
                      .HasColumnName("country")
                      .HasMaxLength(100);

                entity.Property(e => e.State)
                      .HasColumnName("state")
                      .HasMaxLength(100);

                entity.Property(e => e.City)
                      .HasColumnName("city")
                      .HasMaxLength(100);

                entity.Property(e => e.Status)
                      .HasColumnName("status")
                      .HasMaxLength(10);

                entity.Property(e => e.StafflineUserFlag)
                      .HasColumnName("staffline_user_flag")
                      .HasMaxLength(20);

                entity.Property(e => e.SyncedOn)
                      .HasColumnName("synced_on");

                entity.Property(e => e.UpdatedOn)
                      .HasColumnName("updated_on");
            });
            modelBuilder.Entity<CallDetail>(entity =>
            {
                entity.ToTable("call_details");

                entity.Property(e => e.Id).HasColumnName("id");

                entity.Property(e => e.CallEndedOn)
                    .HasColumnType("timestamp")
                    .HasColumnName("call_ended_on");

                entity.Property(e => e.CallStartedOn)
                    .HasColumnType("timestamp")
                    .HasColumnName("call_started_on");

                entity.Property(e => e.CallWith)
                    .HasColumnType("text")
                    .HasColumnName("call_with");

                entity.Property(e => e.CreatedOn)
                    .HasColumnType("timestamp")
                    .HasColumnName("created_on")
                    .HasDefaultValueSql("CURRENT_TIMESTAMP");

                entity.Property(e => e.EmpCode)
                    .HasMaxLength(100)
                    .HasColumnName("emp_code");

                entity.Property(e => e.UpdatedOn)
                    .HasColumnType("timestamp")
                    .ValueGeneratedOnAddOrUpdate()
                    .HasColumnName("updated_on")
                    .HasDefaultValueSql("CURRENT_TIMESTAMP");
            });

            modelBuilder.Entity<AuditLog>(entity =>
            {
                entity.ToTable("audit_log");

                entity.Property(e => e.Id).HasColumnName("id");

                entity.Property(e => e.table_name)
                    .HasColumnType("text")
                    .HasColumnName("table_name");

                entity.Property(e => e.operation_type)
                    .HasColumnType("text")
                    .HasColumnName("operation_type");

                entity.Property(e => e.user_id)
                    .HasColumnType("text")
                    .HasColumnName("user_id");

                entity.Property(e => e.IsRoleChanged)
                    .HasColumnType("int")
                    .HasColumnName("IsRoleChanged");

                entity.Property(e => e.updated_on)
                    .HasColumnType("timestamp")
                    .ValueGeneratedOnAddOrUpdate()
                    .HasColumnName("updated_on")
                    .HasDefaultValueSql("CURRENT_TIMESTAMP");
            });

            modelBuilder.Entity<EmployeeDetail>(entity =>
            {
                entity.HasKey(e => e.Id).HasName("PRIMARY");

                entity.HasIndex(e => e.DisplayName, "EmployeeDetails_DisplayName_IDX");

                entity.HasIndex(e => e.EmployeeId, "EmployeeDetails_EmployeeID_IDX").IsUnique();

                entity.Property(e => e.Country).HasMaxLength(100);
                entity.Property(e => e.Department).HasMaxLength(150);
                entity.Property(e => e.DisplayName).HasMaxLength(150);
                entity.Property(e => e.Email).HasMaxLength(150);
                entity.Property(e => e.EmployeeId)
                    .HasMaxLength(100)
                    .HasColumnName("EmployeeID");
                entity.Property(e => e.FirstName).HasMaxLength(100);
                entity.Property(e => e.JobTitle).HasMaxLength(150);
                entity.Property(e => e.LastName).HasMaxLength(100);
                entity.Property(e => e.Manager).HasMaxLength(150);
                entity.Property(e => e.OfficeLocation).HasMaxLength(150);
                entity.Property(e => e.TransferDate)
                    .HasDefaultValueSql("CURRENT_TIMESTAMP")
                    .HasColumnType("datetime");
                entity.Property(e => e.UserType).HasMaxLength(50);
            });

            modelBuilder.Entity<EmployeeWorkingTime>(entity =>
            {
                entity.ToTable("employee_working_time");

                entity.Property(e => e.Id).HasColumnName("id");

                entity.Property(e => e.CreatedOn)
                    .HasColumnType("timestamp")
                    .HasColumnName("created_on")
                    .HasDefaultValueSql("CURRENT_TIMESTAMP");

                entity.Property(e => e.EmpCode)
                    .HasMaxLength(255)
                    .HasColumnName("emp_code");

                entity.Property(e => e.TotalActive).HasColumnName("total_active");

                entity.Property(e => e.TotalIdle).HasColumnName("total_idle");

                entity.Property(e => e.TotalSleep)
                    .HasColumnName("total_sleep")
                    .HasDefaultValueSql("'0'");

                entity.Property(e => e.UpdatedOn)
                    .HasColumnType("timestamp")
                    .ValueGeneratedOnAddOrUpdate()
                    .HasColumnName("updated_on")
                    .HasDefaultValueSql("CURRENT_TIMESTAMP");

                entity.Property(e => e.WorkLoggedOn)
                    .HasColumnType("timestamp")
                    .HasColumnName("work_logged_on");
            });

            modelBuilder.Entity<RunningApplicationDetail>(entity =>
            {
                entity.ToTable("running_application_details");

                entity.Property(e => e.Id).HasColumnName("id");

                entity.Property(e => e.ApplicationName)
                    .HasMaxLength(225)
                    .HasColumnName("application_name");

                entity.Property(e => e.CreatedOn)
                    .HasColumnType("timestamp")
                    .HasColumnName("created_on")
                    .HasDefaultValueSql("CURRENT_TIMESTAMP");

                entity.Property(e => e.EmpCode)
                    .HasMaxLength(100)
                    .HasColumnName("emp_code");

                entity.Property(e => e.StartedOn)
                    .HasColumnType("timestamp")
                    .HasColumnName("started_on");

                entity.Property(e => e.UpdatedOn)
                    .HasColumnType("timestamp")
                    .ValueGeneratedOnAddOrUpdate()
                    .HasColumnName("updated_on")
                    .HasDefaultValueSql("CURRENT_TIMESTAMP");
            });

            modelBuilder.Entity<SystemLoginDetail>(entity =>
            {
                entity.ToTable("system_login_details");

                entity.Property(e => e.Id).HasColumnName("id");

                entity.Property(e => e.AppVersion)
                    .HasMaxLength(255)
                    .HasColumnName("app_version");

                entity.Property(e => e.ComputerName)
                    .HasMaxLength(255)
                    .HasColumnName("computer_name");

                entity.Property(e => e.CreatedOn)
                    .HasColumnType("timestamp")
                    .HasColumnName("created_on")
                    .HasDefaultValueSql("CURRENT_TIMESTAMP");

                entity.Property(e => e.EmpCode)
                    .HasMaxLength(255)
                    .HasColumnName("emp_code");

                entity.Property(e => e.IpAddress)
                    .HasMaxLength(15)
                    .HasColumnName("ip_address");

                entity.Property(e => e.LoginTime)
                    .HasColumnType("datetime")
                    .HasColumnName("login_time");

                entity.Property(e => e.LogoutTime)
                    .HasColumnType("datetime")
                    .HasColumnName("logout_time");

                entity.Property(e => e.SystemStatus)
                    .HasMaxLength(255)
                    .HasColumnName("system_status");

                entity.Property(e => e.UpdatedOn)
                    .HasColumnType("timestamp")
                    .ValueGeneratedOnAddOrUpdate()
                    .HasColumnName("updated_on")
                    .HasDefaultValueSql("CURRENT_TIMESTAMP");
            });

            modelBuilder.Entity<SystemSleepDetail>(entity =>
            {
                entity.ToTable("system_sleep_details");

                entity.Property(e => e.Id).HasColumnName("id");

                entity.Property(e => e.CreatedOn)
                    .HasColumnType("timestamp")
                    .HasColumnName("created_on")
                    .HasDefaultValueSql("CURRENT_TIMESTAMP");

                entity.Property(e => e.Description)
                    .HasMaxLength(50)
                    .HasColumnName("description");

                entity.Property(e => e.EmpCode)
                    .HasMaxLength(255)
                    .HasColumnName("emp_code");

                entity.Property(e => e.TriggeredOn)
                    .HasColumnType("timestamp")
                    .HasColumnName("triggered_on");

                entity.Property(e => e.UpdatedOn)
                    .HasColumnType("timestamp")
                    .ValueGeneratedOnAddOrUpdate()
                    .HasColumnName("updated_on")
                    .HasDefaultValueSql("CURRENT_TIMESTAMP");
            });

            modelBuilder.Entity<DashboardDetails>().HasNoKey();

            modelBuilder.Entity<GraphDetail>().HasNoKey();

            modelBuilder.Entity<UserProfile>().HasNoKey();

            modelBuilder.Entity<UserActivityDetails>().HasNoKey();

            modelBuilder.Entity<ApplicationActivityReport>().HasNoKey();

            modelBuilder.Entity<ApplicationActivityReportResult>().HasNoKey();

            modelBuilder.Entity<CallsActivityReport>().HasNoKey();

            modelBuilder.Entity<CallsActivityReportResult>().HasNoKey();

            modelBuilder.Entity<SessionActivityReport>().HasNoKey();

            modelBuilder.Entity<SessionActivityReportResult>().HasNoKey();

            modelBuilder.Entity<LogInActivityReport>().HasNoKey();

            modelBuilder.Entity<LogInActivityReportResult>().HasNoKey();

            modelBuilder.Entity<ReportActivityDetails>().HasNoKey();

            modelBuilder.Entity<ReportActivityDetailsResults>().HasNoKey();

            modelBuilder.Entity<JsonResultModel>().HasNoKey();

            modelBuilder.Entity<Details>().HasNoKey();

            modelBuilder.Entity<AllUserDetails>().HasNoKey();

            modelBuilder.Entity<DeleteUser>().HasNoKey();

            modelBuilder.Entity<UserActive>().HasNoKey();

            modelBuilder.Entity<AllUserDetailsResult>().HasNoKey();

            modelBuilder.Entity<TempDataResult>().HasNoKey();


            modelBuilder.Entity<SummaryDetails>().HasNoKey();

            modelBuilder.Entity<BrowsingHistoryDetails>().HasNoKey();

            modelBuilder.Entity<ApplicationTabDetail>().HasNoKey();

            modelBuilder.Entity<TopBottomDetailsResponseResult>().HasNoKey();

            modelBuilder.Entity<UserModels>().HasNoKey();

            modelBuilder.Entity<LocationDetails>().HasNoKey();

            modelBuilder.Entity<PermissionDetails>().HasNoKey();

            modelBuilder.Entity<PermissionDetailsResult>().HasNoKey();

            modelBuilder.Entity<PermissionDetails>(entity =>
            {
                entity.HasNoKey();
            });

            modelBuilder.Entity<RoleDetails>().HasNoKey();
            modelBuilder.Entity<ManagerRoles>().HasNoKey();
            modelBuilder.Entity<CreateRoles>().HasNoKey();
            modelBuilder.Entity<UpdateRoles>().HasNoKey();
            modelBuilder.Entity<MenuList>().HasNoKey();
            modelBuilder.Entity<AllUser>().HasNoKey();            
            modelBuilder.Entity<AuditDetails>().HasNoKey();
            modelBuilder.Entity<RoleChangeResult>().HasNoKey();
            modelBuilder.Entity<RoleChangeResult>().HasNoKey();
            modelBuilder.Entity<DeleteRole>().HasNoKey();
            modelBuilder.Entity<SmartSearch>().HasNoKey();
            modelBuilder.Entity<GlobalConfiguration>().HasNoKey();
            modelBuilder.Entity<GlobalConfigurationUpdatePropertiesStatusDB>().HasNoKey();
            modelBuilder.Entity<GlobalConfigurationUpdatePropertiesValueDB>().HasNoKey();
            modelBuilder.Entity<EmployeeHir>().HasNoKey();
            OnModelCreatingPartial(modelBuilder);
        }

        partial void OnModelCreatingPartial(ModelBuilder modelBuilder);
    }
}
