diff --git a/Marco.Pms.DataAccess/Marco.Pms.DataAccess.csproj b/Marco.Pms.DataAccess/Marco.Pms.DataAccess.csproj index a6bfd37..0a1fc83 100644 --- a/Marco.Pms.DataAccess/Marco.Pms.DataAccess.csproj +++ b/Marco.Pms.DataAccess/Marco.Pms.DataAccess.csproj @@ -32,4 +32,8 @@ + + + + diff --git a/Marco.Pms.DataAccess/Migrations/20250124111814_initiateapp.Designer.cs b/Marco.Pms.DataAccess/Migrations/20250124111814_initiateapp.Designer.cs deleted file mode 100644 index cb83819..0000000 --- a/Marco.Pms.DataAccess/Migrations/20250124111814_initiateapp.Designer.cs +++ /dev/null @@ -1,1541 +0,0 @@ -// -using System; -using Marco.Pms.DataAccess.Data; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Metadata; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; - -#nullable disable - -namespace Marco.Pms.DataAccess.Migrations -{ - [DbContext(typeof(ApplicationDbContext))] - [Migration("20250124111814_initiateapp")] - partial class initiateapp - { - /// - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasAnnotation("ProductVersion", "8.0.12") - .HasAnnotation("Relational:MaxIdentifierLength", 64); - - //MySqlModelBuilderExtensions.AutoIncrementColumns(modelBuilder); - - modelBuilder.Entity("Marco.Pms.Model.Activities.TaskAllocation", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - - b.Property("AllocationDate") - .HasColumnType("datetime(6)"); - - b.Property("BuildingId") - .HasColumnType("int"); - - b.Property("EmployeeId") - .HasColumnType("int"); - - b.Property("EmployeeRole") - .HasColumnType("int"); - - b.Property("ProjectId") - .HasColumnType("int"); - - b.Property("ReAllocationDate") - .HasColumnType("datetime(6)"); - - b.Property("TenantId") - .HasColumnType("int"); - - b.Property("WorkAreaId") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("BuildingId"); - - b.HasIndex("EmployeeId"); - - b.HasIndex("ProjectId"); - - b.HasIndex("TenantId"); - - b.HasIndex("WorkAreaId"); - - b.ToTable("TaskAllocations"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Activities.WorkItem", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - - b.Property("ActivityId") - .HasColumnType("int"); - - b.Property("CompletedWork") - .HasColumnType("int"); - - b.Property("PlannedWork") - .HasColumnType("int"); - - b.Property("TaskDate") - .HasColumnType("datetime(6)"); - - b.Property("TenantId") - .HasColumnType("int"); - - b.Property("WorkAreaId") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("ActivityId"); - - b.HasIndex("TenantId"); - - b.HasIndex("WorkAreaId"); - - b.ToTable("WorkItems"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Activities.WorkItemMapping", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - - b.Property("TenantId") - .HasColumnType("int"); - - b.Property("WorkAreaId") - .HasColumnType("int"); - - b.Property("WorkItemId") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("TenantId"); - - b.HasIndex("WorkAreaId"); - - b.HasIndex("WorkItemId"); - - b.ToTable("WorkItemMapping"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Authentication.RefreshToken", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - - b.Property("CreatedAt") - .HasColumnType("datetime(6)"); - - b.Property("ExpiryDate") - .HasColumnType("datetime(6)"); - - b.Property("IsRevoked") - .HasColumnType("tinyint(1)"); - - b.Property("IsUsed") - .HasColumnType("tinyint(1)"); - - b.Property("RevokedAt") - .HasColumnType("datetime(6)"); - - b.Property("Token") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("UserId") - .IsRequired() - .HasColumnType("varchar(255)"); - - b.HasKey("Id"); - - b.HasIndex("UserId"); - - b.ToTable("RefreshTokens"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Employees.Attendance", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - - b.Property("ApprovedBy") - .HasColumnType("longtext"); - - b.Property("Comment") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("Date") - .HasColumnType("datetime(6)"); - - b.Property("EmployeeID") - .HasColumnType("int"); - - b.Property("InTimeID") - .HasColumnType("int"); - - b.Property("IsApproved") - .HasColumnType("tinyint(1)"); - - b.Property("OutTimeID") - .HasColumnType("int"); - - b.Property("TenantId") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("EmployeeID"); - - b.HasIndex("InTimeID"); - - b.HasIndex("OutTimeID"); - - b.HasIndex("TenantId"); - - b.ToTable("Attendances"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Employees.AttendanceLog", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - - b.Property("CheckTime") - .HasColumnType("datetime(6)"); - - b.Property("Comment") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("EmployeeID") - .HasColumnType("int"); - - b.Property("IsCheckIn") - .HasColumnType("tinyint(1)"); - - b.Property("Latitude") - .HasColumnType("longtext"); - - b.Property("Longitude") - .HasColumnType("longtext"); - - b.Property("Photo") - .HasColumnType("longblob"); - - b.Property("TenantId") - .HasColumnType("int"); - - b.Property("UpdatedBy") - .HasColumnType("longtext"); - - b.HasKey("Id"); - - b.HasIndex("EmployeeID"); - - b.HasIndex("TenantId"); - - b.ToTable("AttendanceLogs"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Employees.Employee", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - - b.Property("AadharNumber") - .HasColumnType("longtext"); - - b.Property("ApplicationUserId") - .HasColumnType("varchar(255)"); - - b.Property("BirthDate") - .HasColumnType("datetime(6)"); - - b.Property("CurrentAddress") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("Email") - .HasColumnType("longtext"); - - b.Property("EmergencyPhoneNumber") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("FirstName") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("Gender") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("LastName") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("MiddleName") - .HasColumnType("longtext"); - - b.Property("PanNumber") - .HasColumnType("longtext"); - - b.Property("PeramnentAddress") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("PhoneNumber") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("Photo") - .HasColumnType("longblob"); - - b.Property("RoleId") - .HasColumnType("char(36)"); - - b.Property("TenantId") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("ApplicationUserId"); - - b.HasIndex("RoleId"); - - b.HasIndex("TenantId"); - - b.ToTable("Employees"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Employees.WorkShift", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - - b.Property("EndTime") - .HasColumnType("time(6)"); - - b.Property("Name") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("StartTime") - .HasColumnType("time(6)"); - - b.Property("TenantId") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("TenantId"); - - b.ToTable("WorkShifts"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Entitlements.ActivityMaster", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - - b.Property("ActivityName") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("TaskAllocationId") - .HasColumnType("int"); - - b.Property("TenantId") - .HasColumnType("int"); - - b.Property("UnitOfMeasurement") - .IsRequired() - .HasColumnType("longtext"); - - b.HasKey("Id"); - - b.HasIndex("TaskAllocationId"); - - b.HasIndex("TenantId"); - - b.ToTable("ActivityMasters"); - - b.HasData( - new - { - Id = 1, - ActivityName = "Core Cutting", - TenantId = 1, - UnitOfMeasurement = "Number" - }, - new - { - Id = 2, - ActivityName = "Fabrication", - TenantId = 1, - UnitOfMeasurement = "Meter" - }, - new - { - Id = 3, - ActivityName = "Lifting", - TenantId = 1, - UnitOfMeasurement = "Meter" - }, - new - { - Id = 4, - ActivityName = "Hanging", - TenantId = 1, - UnitOfMeasurement = "Meter" - }, - new - { - Id = 5, - ActivityName = "Tapping", - TenantId = 1, - UnitOfMeasurement = "Meter" - }, - new - { - Id = 6, - ActivityName = "Welding", - TenantId = 1, - UnitOfMeasurement = "Meter" - }, - new - { - Id = 7, - ActivityName = "Testing", - TenantId = 1, - UnitOfMeasurement = "Area" - }, - new - { - Id = 8, - ActivityName = "Painting", - TenantId = 1, - UnitOfMeasurement = "Meter" - }, - new - { - Id = 9, - ActivityName = "Marking Area", - TenantId = 1, - UnitOfMeasurement = "Meter" - }, - new - { - Id = 10, - ActivityName = "Drilling", - TenantId = 1, - UnitOfMeasurement = "Number" - }, - new - { - Id = 11, - ActivityName = "MS Support Fabrication", - TenantId = 1, - UnitOfMeasurement = "Number" - }, - new - { - Id = 12, - ActivityName = "MS Support Hanging", - TenantId = 1, - UnitOfMeasurement = "Number" - }, - new - { - Id = 13, - ActivityName = "Hydrant Volve", - TenantId = 1, - UnitOfMeasurement = "Number" - }, - new - { - Id = 14, - ActivityName = "Sprinkler Installation", - TenantId = 1, - UnitOfMeasurement = "Number" - }); - }); - - modelBuilder.Entity("Marco.Pms.Model.Entitlements.EmployeeRole", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("char(36)"); - - b.Property("Role") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("TenantId") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("TenantId"); - - b.ToTable("EmployeeRoles"); - - b.HasData( - new - { - Id = new Guid("2c8d0808-c421-11ef-9b93-0242ac110002"), - Role = "Admin", - TenantId = 1 - }, - new - { - Id = new Guid("62e0918d-c421-11ef-9b93-0242ac110002"), - Role = "Welder", - TenantId = 1 - }, - new - { - Id = new Guid("68823f1f-c421-11ef-9b93-0242ac110002"), - Role = "Helper", - TenantId = 1 - }, - new - { - Id = new Guid("6d3a7c72-c421-11ef-9b93-0242ac110002"), - Role = "Site Engineer", - TenantId = 1 - }, - new - { - Id = new Guid("6d3aad72-c421-11ef-9b93-0242ac110002"), - Role = "Project Manager", - TenantId = 1 - }); - }); - - modelBuilder.Entity("Marco.Pms.Model.Entitlements.Feature", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("char(36)"); - - b.Property("Description") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("Name") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("TenantId") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("TenantId"); - - b.ToTable("Feature"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Entitlements.FeaturePermission", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("char(36)"); - - b.Property("FeatureId") - .HasColumnType("char(36)"); - - b.Property("IsEnabled") - .HasColumnType("tinyint(1)"); - - b.Property("RoleId") - .HasColumnType("char(36)"); - - b.Property("TenantId") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("FeatureId"); - - b.HasIndex("RoleId"); - - b.HasIndex("TenantId"); - - b.ToTable("FeaturePermission"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Entitlements.StatusMaster", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - - b.Property("Status") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("TenantId") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("TenantId"); - - b.ToTable("StatusMasters"); - - b.HasData( - new - { - Id = 1, - Status = "Active", - TenantId = 1 - }, - new - { - Id = 2, - Status = "In Progress", - TenantId = 1 - }, - new - { - Id = 3, - Status = "On Hold", - TenantId = 1 - }, - new - { - Id = 4, - Status = "Completed", - TenantId = 1 - }); - }); - - modelBuilder.Entity("Marco.Pms.Model.Entitlements.Tenant", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - - b.Property("ContactName") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("ContactNumber") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("Description") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("DomainName") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("Name") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("OnBoardingDate") - .HasColumnType("datetime(6)"); - - b.HasKey("Id"); - - b.ToTable("Tenants"); - - b.HasData( - new - { - Id = 1, - ContactName = "Admin", - ContactNumber = "123456789", - Description = "", - DomainName = "www.marcobms.org", - Name = "MarcoBMS", - OnBoardingDate = new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified) - }); - }); - - modelBuilder.Entity("Marco.Pms.Model.Projects.Building", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - - b.Property("Description") - .HasColumnType("longtext"); - - b.Property("Name") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("ProjectId") - .HasColumnType("int"); - - b.Property("TenantId") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("TenantId"); - - b.ToTable("Buildings"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Projects.Floor", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - - b.Property("BuildingId") - .HasColumnType("int"); - - b.Property("FloorName") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("TenantId") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("BuildingId"); - - b.HasIndex("TenantId"); - - b.ToTable("Floor"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Projects.Project", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - - b.Property("ContactPerson") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("EndDate") - .HasColumnType("datetime(6)"); - - b.Property("Name") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("ProjectAddress") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("ProjectStatusId") - .HasColumnType("int"); - - b.Property("StartDate") - .HasColumnType("datetime(6)"); - - b.Property("TenantId") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("ProjectStatusId"); - - b.HasIndex("TenantId"); - - b.ToTable("Projects"); - - b.HasData( - new - { - Id = 1, - ContactPerson = "Project 1 Contact Person", - Name = "Project 1", - ProjectAddress = "Project 1 Address", - ProjectStatusId = 1, - TenantId = 1 - }, - new - { - Id = 2, - ContactPerson = "Project 2 Contact Person", - Name = "Project 2", - ProjectAddress = "Project 2 Address", - ProjectStatusId = 2, - TenantId = 1 - }, - new - { - Id = 3, - ContactPerson = "Project 3 Contact Person", - Name = "Project 3", - ProjectAddress = "Project 3 Address", - ProjectStatusId = 3, - TenantId = 1 - }); - }); - - modelBuilder.Entity("Marco.Pms.Model.Projects.ProjectAllocation", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - - b.Property("AllocationDate") - .HasColumnType("datetime(6)"); - - b.Property("EmployeeId") - .HasColumnType("int"); - - b.Property("EmployeeRoleId") - .HasColumnType("char(36)"); - - b.Property("ProjectId") - .HasColumnType("int"); - - b.Property("ReAllocationDate") - .HasColumnType("datetime(6)"); - - b.Property("TenantId") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("EmployeeId"); - - b.HasIndex("ProjectId"); - - b.HasIndex("TenantId"); - - b.ToTable("ProjectAllocations"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Projects.WorkArea", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - - b.Property("AreaName") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("FloorId") - .HasColumnType("int"); - - b.Property("TenantId") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("FloorId"); - - b.HasIndex("TenantId"); - - b.ToTable("WorkAreas"); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRole", b => - { - b.Property("Id") - .HasColumnType("varchar(255)"); - - b.Property("ConcurrencyStamp") - .IsConcurrencyToken() - .HasColumnType("longtext"); - - b.Property("Name") - .HasMaxLength(256) - .HasColumnType("varchar(256)"); - - b.Property("NormalizedName") - .HasMaxLength(256) - .HasColumnType("varchar(256)"); - - b.HasKey("Id"); - - b.HasIndex("NormalizedName") - .IsUnique() - .HasDatabaseName("RoleNameIndex"); - - b.ToTable("AspNetRoles", (string)null); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - - b.Property("ClaimType") - .HasColumnType("longtext"); - - b.Property("ClaimValue") - .HasColumnType("longtext"); - - b.Property("RoleId") - .IsRequired() - .HasColumnType("varchar(255)"); - - b.HasKey("Id"); - - b.HasIndex("RoleId"); - - b.ToTable("AspNetRoleClaims", (string)null); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUser", b => - { - b.Property("Id") - .HasColumnType("varchar(255)"); - - b.Property("AccessFailedCount") - .HasColumnType("int"); - - b.Property("ConcurrencyStamp") - .IsConcurrencyToken() - .HasColumnType("longtext"); - - b.Property("Discriminator") - .IsRequired() - .HasMaxLength(21) - .HasColumnType("varchar(21)"); - - b.Property("Email") - .HasMaxLength(256) - .HasColumnType("varchar(256)"); - - b.Property("EmailConfirmed") - .HasColumnType("tinyint(1)"); - - b.Property("LockoutEnabled") - .HasColumnType("tinyint(1)"); - - b.Property("LockoutEnd") - .HasColumnType("datetime(6)"); - - b.Property("NormalizedEmail") - .HasMaxLength(256) - .HasColumnType("varchar(256)"); - - b.Property("NormalizedUserName") - .HasMaxLength(256) - .HasColumnType("varchar(256)"); - - b.Property("PasswordHash") - .HasColumnType("longtext"); - - b.Property("PhoneNumber") - .HasColumnType("longtext"); - - b.Property("PhoneNumberConfirmed") - .HasColumnType("tinyint(1)"); - - b.Property("SecurityStamp") - .HasColumnType("longtext"); - - b.Property("TwoFactorEnabled") - .HasColumnType("tinyint(1)"); - - b.Property("UserName") - .HasMaxLength(256) - .HasColumnType("varchar(256)"); - - b.HasKey("Id"); - - b.HasIndex("NormalizedEmail") - .HasDatabaseName("EmailIndex"); - - b.HasIndex("NormalizedUserName") - .IsUnique() - .HasDatabaseName("UserNameIndex"); - - b.ToTable("AspNetUsers", (string)null); - - b.HasDiscriminator().HasValue("IdentityUser"); - - b.UseTphMappingStrategy(); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - - b.Property("ClaimType") - .HasColumnType("longtext"); - - b.Property("ClaimValue") - .HasColumnType("longtext"); - - b.Property("UserId") - .IsRequired() - .HasColumnType("varchar(255)"); - - b.HasKey("Id"); - - b.HasIndex("UserId"); - - b.ToTable("AspNetUserClaims", (string)null); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin", b => - { - b.Property("LoginProvider") - .HasColumnType("varchar(255)"); - - b.Property("ProviderKey") - .HasColumnType("varchar(255)"); - - b.Property("ProviderDisplayName") - .HasColumnType("longtext"); - - b.Property("UserId") - .IsRequired() - .HasColumnType("varchar(255)"); - - b.HasKey("LoginProvider", "ProviderKey"); - - b.HasIndex("UserId"); - - b.ToTable("AspNetUserLogins", (string)null); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole", b => - { - b.Property("UserId") - .HasColumnType("varchar(255)"); - - b.Property("RoleId") - .HasColumnType("varchar(255)"); - - b.HasKey("UserId", "RoleId"); - - b.HasIndex("RoleId"); - - b.ToTable("AspNetUserRoles", (string)null); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken", b => - { - b.Property("UserId") - .HasColumnType("varchar(255)"); - - b.Property("LoginProvider") - .HasColumnType("varchar(255)"); - - b.Property("Name") - .HasColumnType("varchar(255)"); - - b.Property("Value") - .HasColumnType("longtext"); - - b.HasKey("UserId", "LoginProvider", "Name"); - - b.ToTable("AspNetUserTokens", (string)null); - }); - - modelBuilder.Entity("Marco.Pms.Model.Entitlements.ApplicationUser", b => - { - b.HasBaseType("Microsoft.AspNetCore.Identity.IdentityUser"); - - b.Property("IsRootUser") - .HasColumnType("tinyint(1)"); - - b.Property("Role") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("TenantId") - .HasColumnType("int"); - - b.HasDiscriminator().HasValue("ApplicationUser"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Activities.TaskAllocation", b => - { - b.HasOne("Marco.Pms.Model.Projects.Building", "Building") - .WithMany() - .HasForeignKey("BuildingId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Marco.Pms.Model.Employees.Employee", "Employee") - .WithMany() - .HasForeignKey("EmployeeId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Marco.Pms.Model.Projects.Project", "Project") - .WithMany() - .HasForeignKey("ProjectId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Marco.Pms.Model.Entitlements.Tenant", "Tenant") - .WithMany() - .HasForeignKey("TenantId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Marco.Pms.Model.Projects.WorkArea", "WorkArea") - .WithMany() - .HasForeignKey("WorkAreaId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Building"); - - b.Navigation("Employee"); - - b.Navigation("Project"); - - b.Navigation("Tenant"); - - b.Navigation("WorkArea"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Activities.WorkItem", b => - { - b.HasOne("Marco.Pms.Model.Entitlements.ActivityMaster", "ActivityMaster") - .WithMany() - .HasForeignKey("ActivityId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Marco.Pms.Model.Entitlements.Tenant", "Tenant") - .WithMany() - .HasForeignKey("TenantId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Marco.Pms.Model.Projects.WorkArea", "WorkArea") - .WithMany() - .HasForeignKey("WorkAreaId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("ActivityMaster"); - - b.Navigation("Tenant"); - - b.Navigation("WorkArea"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Activities.WorkItemMapping", b => - { - b.HasOne("Marco.Pms.Model.Entitlements.Tenant", "Tenant") - .WithMany() - .HasForeignKey("TenantId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Marco.Pms.Model.Projects.WorkArea", "WorkArea") - .WithMany() - .HasForeignKey("WorkAreaId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Marco.Pms.Model.Activities.WorkItem", "WorkItem") - .WithMany() - .HasForeignKey("WorkItemId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Tenant"); - - b.Navigation("WorkArea"); - - b.Navigation("WorkItem"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Authentication.RefreshToken", b => - { - b.HasOne("Microsoft.AspNetCore.Identity.IdentityUser", "User") - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("User"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Employees.Attendance", b => - { - b.HasOne("Marco.Pms.Model.Employees.Employee", "Employee") - .WithMany() - .HasForeignKey("EmployeeID") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Marco.Pms.Model.Employees.AttendanceLog", "InTimeLog") - .WithMany() - .HasForeignKey("InTimeID"); - - b.HasOne("Marco.Pms.Model.Employees.AttendanceLog", "OutTimeLog") - .WithMany() - .HasForeignKey("OutTimeID"); - - b.HasOne("Marco.Pms.Model.Entitlements.Tenant", "Tenant") - .WithMany() - .HasForeignKey("TenantId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Employee"); - - b.Navigation("InTimeLog"); - - b.Navigation("OutTimeLog"); - - b.Navigation("Tenant"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Employees.AttendanceLog", b => - { - b.HasOne("Marco.Pms.Model.Employees.Employee", "Employee") - .WithMany() - .HasForeignKey("EmployeeID") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Marco.Pms.Model.Entitlements.Tenant", "Tenant") - .WithMany() - .HasForeignKey("TenantId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Employee"); - - b.Navigation("Tenant"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Employees.Employee", b => - { - b.HasOne("Marco.Pms.Model.Entitlements.ApplicationUser", "ApplicationUser") - .WithMany() - .HasForeignKey("ApplicationUserId"); - - b.HasOne("Marco.Pms.Model.Entitlements.EmployeeRole", "EmployeeRole") - .WithMany() - .HasForeignKey("RoleId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Marco.Pms.Model.Entitlements.Tenant", "Tenant") - .WithMany() - .HasForeignKey("TenantId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("ApplicationUser"); - - b.Navigation("EmployeeRole"); - - b.Navigation("Tenant"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Employees.WorkShift", b => - { - b.HasOne("Marco.Pms.Model.Entitlements.Tenant", "Tenant") - .WithMany() - .HasForeignKey("TenantId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Tenant"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Entitlements.ActivityMaster", b => - { - b.HasOne("Marco.Pms.Model.Activities.TaskAllocation", null) - .WithMany("AllotedTask") - .HasForeignKey("TaskAllocationId"); - - b.HasOne("Marco.Pms.Model.Entitlements.Tenant", "Tenant") - .WithMany() - .HasForeignKey("TenantId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Tenant"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Entitlements.EmployeeRole", b => - { - b.HasOne("Marco.Pms.Model.Entitlements.Tenant", "Tenant") - .WithMany() - .HasForeignKey("TenantId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Tenant"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Entitlements.Feature", b => - { - b.HasOne("Marco.Pms.Model.Entitlements.Tenant", "Tenant") - .WithMany() - .HasForeignKey("TenantId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Tenant"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Entitlements.FeaturePermission", b => - { - b.HasOne("Marco.Pms.Model.Entitlements.Feature", "Feature") - .WithMany() - .HasForeignKey("FeatureId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Marco.Pms.Model.Entitlements.EmployeeRole", "Role") - .WithMany("FeaturePermissions") - .HasForeignKey("RoleId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Marco.Pms.Model.Entitlements.Tenant", "Tenant") - .WithMany() - .HasForeignKey("TenantId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Feature"); - - b.Navigation("Role"); - - b.Navigation("Tenant"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Entitlements.StatusMaster", b => - { - b.HasOne("Marco.Pms.Model.Entitlements.Tenant", "Tenant") - .WithMany() - .HasForeignKey("TenantId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Tenant"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Projects.Building", b => - { - b.HasOne("Marco.Pms.Model.Entitlements.Tenant", "Tenant") - .WithMany() - .HasForeignKey("TenantId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Tenant"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Projects.Floor", b => - { - b.HasOne("Marco.Pms.Model.Projects.Building", "Building") - .WithMany() - .HasForeignKey("BuildingId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Marco.Pms.Model.Entitlements.Tenant", "Tenant") - .WithMany() - .HasForeignKey("TenantId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Building"); - - b.Navigation("Tenant"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Projects.Project", b => - { - b.HasOne("Marco.Pms.Model.Entitlements.StatusMaster", "ProjectStatus") - .WithMany() - .HasForeignKey("ProjectStatusId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Marco.Pms.Model.Entitlements.Tenant", "Tenant") - .WithMany() - .HasForeignKey("TenantId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("ProjectStatus"); - - b.Navigation("Tenant"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Projects.ProjectAllocation", b => - { - b.HasOne("Marco.Pms.Model.Employees.Employee", "Employee") - .WithMany() - .HasForeignKey("EmployeeId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Marco.Pms.Model.Projects.Project", "Project") - .WithMany() - .HasForeignKey("ProjectId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Marco.Pms.Model.Entitlements.Tenant", "Tenant") - .WithMany() - .HasForeignKey("TenantId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Employee"); - - b.Navigation("Project"); - - b.Navigation("Tenant"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Projects.WorkArea", b => - { - b.HasOne("Marco.Pms.Model.Projects.Floor", "Floor") - .WithMany() - .HasForeignKey("FloorId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Marco.Pms.Model.Entitlements.Tenant", "Tenant") - .WithMany() - .HasForeignKey("TenantId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Floor"); - - b.Navigation("Tenant"); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim", b => - { - b.HasOne("Microsoft.AspNetCore.Identity.IdentityRole", null) - .WithMany() - .HasForeignKey("RoleId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim", b => - { - b.HasOne("Microsoft.AspNetCore.Identity.IdentityUser", null) - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin", b => - { - b.HasOne("Microsoft.AspNetCore.Identity.IdentityUser", null) - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole", b => - { - b.HasOne("Microsoft.AspNetCore.Identity.IdentityRole", null) - .WithMany() - .HasForeignKey("RoleId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Microsoft.AspNetCore.Identity.IdentityUser", null) - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken", b => - { - b.HasOne("Microsoft.AspNetCore.Identity.IdentityUser", null) - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Marco.Pms.Model.Activities.TaskAllocation", b => - { - b.Navigation("AllotedTask"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Entitlements.EmployeeRole", b => - { - b.Navigation("FeaturePermissions"); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/Marco.Pms.DataAccess/Migrations/20250204133319_role.Designer.cs b/Marco.Pms.DataAccess/Migrations/20250204133319_role.Designer.cs deleted file mode 100644 index 2ad16ca..0000000 --- a/Marco.Pms.DataAccess/Migrations/20250204133319_role.Designer.cs +++ /dev/null @@ -1,1553 +0,0 @@ -// -using System; -using Marco.Pms.DataAccess.Data; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Metadata; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; - -#nullable disable - -namespace Marco.Pms.DataAccess.Migrations -{ - [DbContext(typeof(ApplicationDbContext))] - [Migration("20250204133319_role")] - partial class role - { - /// - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasAnnotation("ProductVersion", "8.0.12") - .HasAnnotation("Relational:MaxIdentifierLength", 64); - - //MySqlModelBuilderExtensions.AutoIncrementColumns(modelBuilder); - - modelBuilder.Entity("Marco.Pms.Model.Activities.TaskAllocation", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - - b.Property("AllocationDate") - .HasColumnType("datetime(6)"); - - b.Property("BuildingId") - .HasColumnType("int"); - - b.Property("EmployeeId") - .HasColumnType("int"); - - b.Property("EmployeeRole") - .HasColumnType("int"); - - b.Property("ProjectId") - .HasColumnType("int"); - - b.Property("ReAllocationDate") - .HasColumnType("datetime(6)"); - - b.Property("TenantId") - .HasColumnType("int"); - - b.Property("WorkAreaId") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("BuildingId"); - - b.HasIndex("EmployeeId"); - - b.HasIndex("ProjectId"); - - b.HasIndex("TenantId"); - - b.HasIndex("WorkAreaId"); - - b.ToTable("TaskAllocations"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Activities.WorkItem", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - - b.Property("ActivityId") - .HasColumnType("int"); - - b.Property("CompletedWork") - .HasColumnType("int"); - - b.Property("PlannedWork") - .HasColumnType("int"); - - b.Property("TaskDate") - .HasColumnType("datetime(6)"); - - b.Property("TenantId") - .HasColumnType("int"); - - b.Property("WorkAreaId") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("ActivityId"); - - b.HasIndex("TenantId"); - - b.HasIndex("WorkAreaId"); - - b.ToTable("WorkItems"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Activities.WorkItemMapping", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - - b.Property("TenantId") - .HasColumnType("int"); - - b.Property("WorkAreaId") - .HasColumnType("int"); - - b.Property("WorkItemId") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("TenantId"); - - b.HasIndex("WorkAreaId"); - - b.HasIndex("WorkItemId"); - - b.ToTable("WorkItemMapping"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Authentication.RefreshToken", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - - b.Property("CreatedAt") - .HasColumnType("datetime(6)"); - - b.Property("ExpiryDate") - .HasColumnType("datetime(6)"); - - b.Property("IsRevoked") - .HasColumnType("tinyint(1)"); - - b.Property("IsUsed") - .HasColumnType("tinyint(1)"); - - b.Property("RevokedAt") - .HasColumnType("datetime(6)"); - - b.Property("Token") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("UserId") - .IsRequired() - .HasColumnType("varchar(255)"); - - b.HasKey("Id"); - - b.HasIndex("UserId"); - - b.ToTable("RefreshTokens"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Employees.Attendance", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - - b.Property("ApprovedBy") - .HasColumnType("longtext"); - - b.Property("Comment") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("Date") - .HasColumnType("datetime(6)"); - - b.Property("EmployeeID") - .HasColumnType("int"); - - b.Property("InTimeID") - .HasColumnType("int"); - - b.Property("IsApproved") - .HasColumnType("tinyint(1)"); - - b.Property("OutTimeID") - .HasColumnType("int"); - - b.Property("TenantId") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("EmployeeID"); - - b.HasIndex("InTimeID"); - - b.HasIndex("OutTimeID"); - - b.HasIndex("TenantId"); - - b.ToTable("Attendances"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Employees.AttendanceLog", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - - b.Property("CheckTime") - .HasColumnType("datetime(6)"); - - b.Property("Comment") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("EmployeeID") - .HasColumnType("int"); - - b.Property("IsCheckIn") - .HasColumnType("tinyint(1)"); - - b.Property("Latitude") - .HasColumnType("longtext"); - - b.Property("Longitude") - .HasColumnType("longtext"); - - b.Property("Photo") - .HasColumnType("longblob"); - - b.Property("TenantId") - .HasColumnType("int"); - - b.Property("UpdatedBy") - .HasColumnType("longtext"); - - b.HasKey("Id"); - - b.HasIndex("EmployeeID"); - - b.HasIndex("TenantId"); - - b.ToTable("AttendanceLogs"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Employees.Employee", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - - b.Property("AadharNumber") - .HasColumnType("longtext"); - - b.Property("ApplicationUserId") - .HasColumnType("varchar(255)"); - - b.Property("BirthDate") - .HasColumnType("datetime(6)"); - - b.Property("CurrentAddress") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("Email") - .HasColumnType("longtext"); - - b.Property("EmergencyPhoneNumber") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("FirstName") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("Gender") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("LastName") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("MiddleName") - .HasColumnType("longtext"); - - b.Property("PanNumber") - .HasColumnType("longtext"); - - b.Property("PeramnentAddress") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("PhoneNumber") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("Photo") - .HasColumnType("longblob"); - - b.Property("RoleId") - .HasColumnType("char(36)"); - - b.Property("TenantId") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("ApplicationUserId"); - - b.HasIndex("RoleId"); - - b.HasIndex("TenantId"); - - b.ToTable("Employees"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Employees.WorkShift", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - - b.Property("EndTime") - .HasColumnType("time(6)"); - - b.Property("Name") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("StartTime") - .HasColumnType("time(6)"); - - b.Property("TenantId") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("TenantId"); - - b.ToTable("WorkShifts"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Entitlements.ActivityMaster", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - - b.Property("ActivityName") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("TaskAllocationId") - .HasColumnType("int"); - - b.Property("TenantId") - .HasColumnType("int"); - - b.Property("UnitOfMeasurement") - .IsRequired() - .HasColumnType("longtext"); - - b.HasKey("Id"); - - b.HasIndex("TaskAllocationId"); - - b.HasIndex("TenantId"); - - b.ToTable("ActivityMasters"); - - b.HasData( - new - { - Id = 1, - ActivityName = "Core Cutting", - TenantId = 1, - UnitOfMeasurement = "Number" - }, - new - { - Id = 2, - ActivityName = "Fabrication", - TenantId = 1, - UnitOfMeasurement = "Meter" - }, - new - { - Id = 3, - ActivityName = "Lifting", - TenantId = 1, - UnitOfMeasurement = "Meter" - }, - new - { - Id = 4, - ActivityName = "Hanging", - TenantId = 1, - UnitOfMeasurement = "Meter" - }, - new - { - Id = 5, - ActivityName = "Tapping", - TenantId = 1, - UnitOfMeasurement = "Meter" - }, - new - { - Id = 6, - ActivityName = "Welding", - TenantId = 1, - UnitOfMeasurement = "Meter" - }, - new - { - Id = 7, - ActivityName = "Testing", - TenantId = 1, - UnitOfMeasurement = "Area" - }, - new - { - Id = 8, - ActivityName = "Painting", - TenantId = 1, - UnitOfMeasurement = "Meter" - }, - new - { - Id = 9, - ActivityName = "Marking Area", - TenantId = 1, - UnitOfMeasurement = "Meter" - }, - new - { - Id = 10, - ActivityName = "Drilling", - TenantId = 1, - UnitOfMeasurement = "Number" - }, - new - { - Id = 11, - ActivityName = "MS Support Fabrication", - TenantId = 1, - UnitOfMeasurement = "Number" - }, - new - { - Id = 12, - ActivityName = "MS Support Hanging", - TenantId = 1, - UnitOfMeasurement = "Number" - }, - new - { - Id = 13, - ActivityName = "Hydrant Volve", - TenantId = 1, - UnitOfMeasurement = "Number" - }, - new - { - Id = 14, - ActivityName = "Sprinkler Installation", - TenantId = 1, - UnitOfMeasurement = "Number" - }); - }); - - modelBuilder.Entity("Marco.Pms.Model.Entitlements.EmployeeRole", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("char(36)"); - - b.Property("Description") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("Role") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("TenantId") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("TenantId"); - - b.ToTable("EmployeeRoles"); - - b.HasData( - new - { - Id = new Guid("2c8d0808-c421-11ef-9b93-0242ac110002"), - Description = "", - Role = "Admin", - TenantId = 1 - }, - new - { - Id = new Guid("62e0918d-c421-11ef-9b93-0242ac110002"), - Description = "", - Role = "Welder", - TenantId = 1 - }, - new - { - Id = new Guid("68823f1f-c421-11ef-9b93-0242ac110002"), - Description = "", - Role = "Helper", - TenantId = 1 - }, - new - { - Id = new Guid("6d3a7c72-c421-11ef-9b93-0242ac110002"), - Description = "", - Role = "Site Engineer", - TenantId = 1 - }, - new - { - Id = new Guid("6d3aad72-c421-11ef-9b93-0242ac110002"), - Description = "", - Role = "Project Manager", - TenantId = 1 - }); - }); - - modelBuilder.Entity("Marco.Pms.Model.Entitlements.Feature", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("char(36)"); - - b.Property("Description") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("EmployeeRoleId") - .HasColumnType("char(36)"); - - b.Property("Name") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("TenantId") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("EmployeeRoleId"); - - b.HasIndex("TenantId"); - - b.ToTable("Features"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Entitlements.FeaturePermission", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("char(36)"); - - b.Property("AllowCreate") - .HasColumnType("tinyint(1)"); - - b.Property("AllowDelete") - .HasColumnType("tinyint(1)"); - - b.Property("AllowModify") - .HasColumnType("tinyint(1)"); - - b.Property("AllowView") - .HasColumnType("tinyint(1)"); - - b.Property("FeatureId") - .HasColumnType("char(36)"); - - b.Property("IsEnabled") - .HasColumnType("tinyint(1)"); - - b.Property("TenantId") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("FeatureId"); - - b.ToTable("FeaturePermission"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Entitlements.StatusMaster", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - - b.Property("Status") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("TenantId") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("TenantId"); - - b.ToTable("StatusMasters"); - - b.HasData( - new - { - Id = 1, - Status = "Active", - TenantId = 1 - }, - new - { - Id = 2, - Status = "In Progress", - TenantId = 1 - }, - new - { - Id = 3, - Status = "On Hold", - TenantId = 1 - }, - new - { - Id = 4, - Status = "Completed", - TenantId = 1 - }); - }); - - modelBuilder.Entity("Marco.Pms.Model.Entitlements.Tenant", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - - b.Property("ContactName") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("ContactNumber") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("Description") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("DomainName") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("Name") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("OnBoardingDate") - .HasColumnType("datetime(6)"); - - b.HasKey("Id"); - - b.ToTable("Tenants"); - - b.HasData( - new - { - Id = 1, - ContactName = "Admin", - ContactNumber = "123456789", - Description = "", - DomainName = "www.marcobms.org", - Name = "MarcoBMS", - OnBoardingDate = new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified) - }); - }); - - modelBuilder.Entity("Marco.Pms.Model.Projects.Building", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - - b.Property("Description") - .HasColumnType("longtext"); - - b.Property("Name") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("ProjectId") - .HasColumnType("int"); - - b.Property("TenantId") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("TenantId"); - - b.ToTable("Buildings"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Projects.Floor", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - - b.Property("BuildingId") - .HasColumnType("int"); - - b.Property("FloorName") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("TenantId") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("BuildingId"); - - b.HasIndex("TenantId"); - - b.ToTable("Floor"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Projects.Project", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - - b.Property("ContactPerson") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("EndDate") - .HasColumnType("datetime(6)"); - - b.Property("Name") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("ProjectAddress") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("ProjectStatusId") - .HasColumnType("int"); - - b.Property("StartDate") - .HasColumnType("datetime(6)"); - - b.Property("TenantId") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("ProjectStatusId"); - - b.HasIndex("TenantId"); - - b.ToTable("Projects"); - - b.HasData( - new - { - Id = 1, - ContactPerson = "Project 1 Contact Person", - Name = "Project 1", - ProjectAddress = "Project 1 Address", - ProjectStatusId = 1, - TenantId = 1 - }, - new - { - Id = 2, - ContactPerson = "Project 2 Contact Person", - Name = "Project 2", - ProjectAddress = "Project 2 Address", - ProjectStatusId = 2, - TenantId = 1 - }, - new - { - Id = 3, - ContactPerson = "Project 3 Contact Person", - Name = "Project 3", - ProjectAddress = "Project 3 Address", - ProjectStatusId = 3, - TenantId = 1 - }); - }); - - modelBuilder.Entity("Marco.Pms.Model.Projects.ProjectAllocation", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - - b.Property("AllocationDate") - .HasColumnType("datetime(6)"); - - b.Property("EmployeeId") - .HasColumnType("int"); - - b.Property("EmployeeRoleId") - .HasColumnType("char(36)"); - - b.Property("ProjectId") - .HasColumnType("int"); - - b.Property("ReAllocationDate") - .HasColumnType("datetime(6)"); - - b.Property("TenantId") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("EmployeeId"); - - b.HasIndex("ProjectId"); - - b.HasIndex("TenantId"); - - b.ToTable("ProjectAllocations"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Projects.WorkArea", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - - b.Property("AreaName") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("FloorId") - .HasColumnType("int"); - - b.Property("TenantId") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("FloorId"); - - b.HasIndex("TenantId"); - - b.ToTable("WorkAreas"); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRole", b => - { - b.Property("Id") - .HasColumnType("varchar(255)"); - - b.Property("ConcurrencyStamp") - .IsConcurrencyToken() - .HasColumnType("longtext"); - - b.Property("Name") - .HasMaxLength(256) - .HasColumnType("varchar(256)"); - - b.Property("NormalizedName") - .HasMaxLength(256) - .HasColumnType("varchar(256)"); - - b.HasKey("Id"); - - b.HasIndex("NormalizedName") - .IsUnique() - .HasDatabaseName("RoleNameIndex"); - - b.ToTable("AspNetRoles", (string)null); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - - b.Property("ClaimType") - .HasColumnType("longtext"); - - b.Property("ClaimValue") - .HasColumnType("longtext"); - - b.Property("RoleId") - .IsRequired() - .HasColumnType("varchar(255)"); - - b.HasKey("Id"); - - b.HasIndex("RoleId"); - - b.ToTable("AspNetRoleClaims", (string)null); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUser", b => - { - b.Property("Id") - .HasColumnType("varchar(255)"); - - b.Property("AccessFailedCount") - .HasColumnType("int"); - - b.Property("ConcurrencyStamp") - .IsConcurrencyToken() - .HasColumnType("longtext"); - - b.Property("Discriminator") - .IsRequired() - .HasMaxLength(21) - .HasColumnType("varchar(21)"); - - b.Property("Email") - .HasMaxLength(256) - .HasColumnType("varchar(256)"); - - b.Property("EmailConfirmed") - .HasColumnType("tinyint(1)"); - - b.Property("LockoutEnabled") - .HasColumnType("tinyint(1)"); - - b.Property("LockoutEnd") - .HasColumnType("datetime(6)"); - - b.Property("NormalizedEmail") - .HasMaxLength(256) - .HasColumnType("varchar(256)"); - - b.Property("NormalizedUserName") - .HasMaxLength(256) - .HasColumnType("varchar(256)"); - - b.Property("PasswordHash") - .HasColumnType("longtext"); - - b.Property("PhoneNumber") - .HasColumnType("longtext"); - - b.Property("PhoneNumberConfirmed") - .HasColumnType("tinyint(1)"); - - b.Property("SecurityStamp") - .HasColumnType("longtext"); - - b.Property("TwoFactorEnabled") - .HasColumnType("tinyint(1)"); - - b.Property("UserName") - .HasMaxLength(256) - .HasColumnType("varchar(256)"); - - b.HasKey("Id"); - - b.HasIndex("NormalizedEmail") - .HasDatabaseName("EmailIndex"); - - b.HasIndex("NormalizedUserName") - .IsUnique() - .HasDatabaseName("UserNameIndex"); - - b.ToTable("AspNetUsers", (string)null); - - b.HasDiscriminator().HasValue("IdentityUser"); - - b.UseTphMappingStrategy(); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - - b.Property("ClaimType") - .HasColumnType("longtext"); - - b.Property("ClaimValue") - .HasColumnType("longtext"); - - b.Property("UserId") - .IsRequired() - .HasColumnType("varchar(255)"); - - b.HasKey("Id"); - - b.HasIndex("UserId"); - - b.ToTable("AspNetUserClaims", (string)null); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin", b => - { - b.Property("LoginProvider") - .HasColumnType("varchar(255)"); - - b.Property("ProviderKey") - .HasColumnType("varchar(255)"); - - b.Property("ProviderDisplayName") - .HasColumnType("longtext"); - - b.Property("UserId") - .IsRequired() - .HasColumnType("varchar(255)"); - - b.HasKey("LoginProvider", "ProviderKey"); - - b.HasIndex("UserId"); - - b.ToTable("AspNetUserLogins", (string)null); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole", b => - { - b.Property("UserId") - .HasColumnType("varchar(255)"); - - b.Property("RoleId") - .HasColumnType("varchar(255)"); - - b.HasKey("UserId", "RoleId"); - - b.HasIndex("RoleId"); - - b.ToTable("AspNetUserRoles", (string)null); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken", b => - { - b.Property("UserId") - .HasColumnType("varchar(255)"); - - b.Property("LoginProvider") - .HasColumnType("varchar(255)"); - - b.Property("Name") - .HasColumnType("varchar(255)"); - - b.Property("Value") - .HasColumnType("longtext"); - - b.HasKey("UserId", "LoginProvider", "Name"); - - b.ToTable("AspNetUserTokens", (string)null); - }); - - modelBuilder.Entity("Marco.Pms.Model.Entitlements.ApplicationUser", b => - { - b.HasBaseType("Microsoft.AspNetCore.Identity.IdentityUser"); - - b.Property("IsRootUser") - .HasColumnType("tinyint(1)"); - - b.Property("Role") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("TenantId") - .HasColumnType("int"); - - b.HasDiscriminator().HasValue("ApplicationUser"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Activities.TaskAllocation", b => - { - b.HasOne("Marco.Pms.Model.Projects.Building", "Building") - .WithMany() - .HasForeignKey("BuildingId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Marco.Pms.Model.Employees.Employee", "Employee") - .WithMany() - .HasForeignKey("EmployeeId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Marco.Pms.Model.Projects.Project", "Project") - .WithMany() - .HasForeignKey("ProjectId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Marco.Pms.Model.Entitlements.Tenant", "Tenant") - .WithMany() - .HasForeignKey("TenantId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Marco.Pms.Model.Projects.WorkArea", "WorkArea") - .WithMany() - .HasForeignKey("WorkAreaId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Building"); - - b.Navigation("Employee"); - - b.Navigation("Project"); - - b.Navigation("Tenant"); - - b.Navigation("WorkArea"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Activities.WorkItem", b => - { - b.HasOne("Marco.Pms.Model.Entitlements.ActivityMaster", "ActivityMaster") - .WithMany() - .HasForeignKey("ActivityId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Marco.Pms.Model.Entitlements.Tenant", "Tenant") - .WithMany() - .HasForeignKey("TenantId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Marco.Pms.Model.Projects.WorkArea", "WorkArea") - .WithMany() - .HasForeignKey("WorkAreaId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("ActivityMaster"); - - b.Navigation("Tenant"); - - b.Navigation("WorkArea"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Activities.WorkItemMapping", b => - { - b.HasOne("Marco.Pms.Model.Entitlements.Tenant", "Tenant") - .WithMany() - .HasForeignKey("TenantId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Marco.Pms.Model.Projects.WorkArea", "WorkArea") - .WithMany() - .HasForeignKey("WorkAreaId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Marco.Pms.Model.Activities.WorkItem", "WorkItem") - .WithMany() - .HasForeignKey("WorkItemId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Tenant"); - - b.Navigation("WorkArea"); - - b.Navigation("WorkItem"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Authentication.RefreshToken", b => - { - b.HasOne("Microsoft.AspNetCore.Identity.IdentityUser", "User") - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("User"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Employees.Attendance", b => - { - b.HasOne("Marco.Pms.Model.Employees.Employee", "Employee") - .WithMany() - .HasForeignKey("EmployeeID") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Marco.Pms.Model.Employees.AttendanceLog", "InTimeLog") - .WithMany() - .HasForeignKey("InTimeID"); - - b.HasOne("Marco.Pms.Model.Employees.AttendanceLog", "OutTimeLog") - .WithMany() - .HasForeignKey("OutTimeID"); - - b.HasOne("Marco.Pms.Model.Entitlements.Tenant", "Tenant") - .WithMany() - .HasForeignKey("TenantId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Employee"); - - b.Navigation("InTimeLog"); - - b.Navigation("OutTimeLog"); - - b.Navigation("Tenant"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Employees.AttendanceLog", b => - { - b.HasOne("Marco.Pms.Model.Employees.Employee", "Employee") - .WithMany() - .HasForeignKey("EmployeeID") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Marco.Pms.Model.Entitlements.Tenant", "Tenant") - .WithMany() - .HasForeignKey("TenantId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Employee"); - - b.Navigation("Tenant"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Employees.Employee", b => - { - b.HasOne("Marco.Pms.Model.Entitlements.ApplicationUser", "ApplicationUser") - .WithMany() - .HasForeignKey("ApplicationUserId"); - - b.HasOne("Marco.Pms.Model.Entitlements.EmployeeRole", "EmployeeRole") - .WithMany() - .HasForeignKey("RoleId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Marco.Pms.Model.Entitlements.Tenant", "Tenant") - .WithMany() - .HasForeignKey("TenantId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("ApplicationUser"); - - b.Navigation("EmployeeRole"); - - b.Navigation("Tenant"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Employees.WorkShift", b => - { - b.HasOne("Marco.Pms.Model.Entitlements.Tenant", "Tenant") - .WithMany() - .HasForeignKey("TenantId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Tenant"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Entitlements.ActivityMaster", b => - { - b.HasOne("Marco.Pms.Model.Activities.TaskAllocation", null) - .WithMany("AllotedTask") - .HasForeignKey("TaskAllocationId"); - - b.HasOne("Marco.Pms.Model.Entitlements.Tenant", "Tenant") - .WithMany() - .HasForeignKey("TenantId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Tenant"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Entitlements.EmployeeRole", b => - { - b.HasOne("Marco.Pms.Model.Entitlements.Tenant", "Tenant") - .WithMany() - .HasForeignKey("TenantId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Tenant"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Entitlements.Feature", b => - { - b.HasOne("Marco.Pms.Model.Entitlements.EmployeeRole", null) - .WithMany("Features") - .HasForeignKey("EmployeeRoleId"); - - b.HasOne("Marco.Pms.Model.Entitlements.Tenant", "Tenant") - .WithMany() - .HasForeignKey("TenantId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Tenant"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Entitlements.FeaturePermission", b => - { - b.HasOne("Marco.Pms.Model.Entitlements.Feature", "Feature") - .WithMany("FeaturePermissions") - .HasForeignKey("FeatureId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Feature"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Entitlements.StatusMaster", b => - { - b.HasOne("Marco.Pms.Model.Entitlements.Tenant", "Tenant") - .WithMany() - .HasForeignKey("TenantId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Tenant"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Projects.Building", b => - { - b.HasOne("Marco.Pms.Model.Entitlements.Tenant", "Tenant") - .WithMany() - .HasForeignKey("TenantId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Tenant"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Projects.Floor", b => - { - b.HasOne("Marco.Pms.Model.Projects.Building", "Building") - .WithMany() - .HasForeignKey("BuildingId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Marco.Pms.Model.Entitlements.Tenant", "Tenant") - .WithMany() - .HasForeignKey("TenantId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Building"); - - b.Navigation("Tenant"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Projects.Project", b => - { - b.HasOne("Marco.Pms.Model.Entitlements.StatusMaster", "ProjectStatus") - .WithMany() - .HasForeignKey("ProjectStatusId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Marco.Pms.Model.Entitlements.Tenant", "Tenant") - .WithMany() - .HasForeignKey("TenantId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("ProjectStatus"); - - b.Navigation("Tenant"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Projects.ProjectAllocation", b => - { - b.HasOne("Marco.Pms.Model.Employees.Employee", "Employee") - .WithMany() - .HasForeignKey("EmployeeId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Marco.Pms.Model.Projects.Project", "Project") - .WithMany() - .HasForeignKey("ProjectId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Marco.Pms.Model.Entitlements.Tenant", "Tenant") - .WithMany() - .HasForeignKey("TenantId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Employee"); - - b.Navigation("Project"); - - b.Navigation("Tenant"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Projects.WorkArea", b => - { - b.HasOne("Marco.Pms.Model.Projects.Floor", "Floor") - .WithMany() - .HasForeignKey("FloorId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Marco.Pms.Model.Entitlements.Tenant", "Tenant") - .WithMany() - .HasForeignKey("TenantId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Floor"); - - b.Navigation("Tenant"); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim", b => - { - b.HasOne("Microsoft.AspNetCore.Identity.IdentityRole", null) - .WithMany() - .HasForeignKey("RoleId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim", b => - { - b.HasOne("Microsoft.AspNetCore.Identity.IdentityUser", null) - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin", b => - { - b.HasOne("Microsoft.AspNetCore.Identity.IdentityUser", null) - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole", b => - { - b.HasOne("Microsoft.AspNetCore.Identity.IdentityRole", null) - .WithMany() - .HasForeignKey("RoleId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Microsoft.AspNetCore.Identity.IdentityUser", null) - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken", b => - { - b.HasOne("Microsoft.AspNetCore.Identity.IdentityUser", null) - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Marco.Pms.Model.Activities.TaskAllocation", b => - { - b.Navigation("AllotedTask"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Entitlements.EmployeeRole", b => - { - b.Navigation("Features"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Entitlements.Feature", b => - { - b.Navigation("FeaturePermissions"); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/Marco.Pms.DataAccess/Migrations/20250204133319_role.cs b/Marco.Pms.DataAccess/Migrations/20250204133319_role.cs deleted file mode 100644 index 3a78f05..0000000 --- a/Marco.Pms.DataAccess/Migrations/20250204133319_role.cs +++ /dev/null @@ -1,278 +0,0 @@ -using System; -using Microsoft.EntityFrameworkCore.Migrations; - -#nullable disable - -namespace Marco.Pms.DataAccess.Migrations -{ - /// - public partial class role : Migration - { - /// - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropForeignKey( - name: "FK_Feature_Tenants_TenantId", - table: "Feature"); - - migrationBuilder.DropForeignKey( - name: "FK_FeaturePermission_EmployeeRoles_RoleId", - table: "FeaturePermission"); - - migrationBuilder.DropForeignKey( - name: "FK_FeaturePermission_Feature_FeatureId", - table: "FeaturePermission"); - - migrationBuilder.DropForeignKey( - name: "FK_FeaturePermission_Tenants_TenantId", - table: "FeaturePermission"); - - migrationBuilder.DropIndex( - name: "IX_FeaturePermission_RoleId", - table: "FeaturePermission"); - - migrationBuilder.DropIndex( - name: "IX_FeaturePermission_TenantId", - table: "FeaturePermission"); - - migrationBuilder.DropPrimaryKey( - name: "PK_Feature", - table: "Feature"); - - migrationBuilder.DropColumn( - name: "RoleId", - table: "FeaturePermission"); - - migrationBuilder.RenameTable( - name: "Feature", - newName: "Features"); - - migrationBuilder.RenameIndex( - name: "IX_Feature_TenantId", - table: "Features", - newName: "IX_Features_TenantId"); - - migrationBuilder.AddColumn( - name: "AllowCreate", - table: "FeaturePermission", - type: "tinyint(1)", - nullable: false, - defaultValue: false); - - migrationBuilder.AddColumn( - name: "AllowDelete", - table: "FeaturePermission", - type: "tinyint(1)", - nullable: false, - defaultValue: false); - - migrationBuilder.AddColumn( - name: "AllowModify", - table: "FeaturePermission", - type: "tinyint(1)", - nullable: false, - defaultValue: false); - - migrationBuilder.AddColumn( - name: "AllowView", - table: "FeaturePermission", - type: "tinyint(1)", - nullable: false, - defaultValue: false); - - migrationBuilder.AddColumn( - name: "Description", - table: "EmployeeRoles", - type: "longtext", - nullable: false) - .Annotation("MySql:CharSet", "utf8mb4"); - - migrationBuilder.AddColumn( - name: "EmployeeRoleId", - table: "Features", - type: "char(36)", - nullable: true, - collation: "ascii_general_ci"); - - migrationBuilder.AddPrimaryKey( - name: "PK_Features", - table: "Features", - column: "Id"); - - migrationBuilder.UpdateData( - table: "EmployeeRoles", - keyColumn: "Id", - keyValue: new Guid("2c8d0808-c421-11ef-9b93-0242ac110002"), - column: "Description", - value: ""); - - migrationBuilder.UpdateData( - table: "EmployeeRoles", - keyColumn: "Id", - keyValue: new Guid("62e0918d-c421-11ef-9b93-0242ac110002"), - column: "Description", - value: ""); - - migrationBuilder.UpdateData( - table: "EmployeeRoles", - keyColumn: "Id", - keyValue: new Guid("68823f1f-c421-11ef-9b93-0242ac110002"), - column: "Description", - value: ""); - - migrationBuilder.UpdateData( - table: "EmployeeRoles", - keyColumn: "Id", - keyValue: new Guid("6d3a7c72-c421-11ef-9b93-0242ac110002"), - column: "Description", - value: ""); - - migrationBuilder.UpdateData( - table: "EmployeeRoles", - keyColumn: "Id", - keyValue: new Guid("6d3aad72-c421-11ef-9b93-0242ac110002"), - column: "Description", - value: ""); - - migrationBuilder.CreateIndex( - name: "IX_Features_EmployeeRoleId", - table: "Features", - column: "EmployeeRoleId"); - - migrationBuilder.AddForeignKey( - name: "FK_FeaturePermission_Features_FeatureId", - table: "FeaturePermission", - column: "FeatureId", - principalTable: "Features", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); - - migrationBuilder.AddForeignKey( - name: "FK_Features_EmployeeRoles_EmployeeRoleId", - table: "Features", - column: "EmployeeRoleId", - principalTable: "EmployeeRoles", - principalColumn: "Id"); - - migrationBuilder.AddForeignKey( - name: "FK_Features_Tenants_TenantId", - table: "Features", - column: "TenantId", - principalTable: "Tenants", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); - } - - /// - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropForeignKey( - name: "FK_FeaturePermission_Features_FeatureId", - table: "FeaturePermission"); - - migrationBuilder.DropForeignKey( - name: "FK_Features_EmployeeRoles_EmployeeRoleId", - table: "Features"); - - migrationBuilder.DropForeignKey( - name: "FK_Features_Tenants_TenantId", - table: "Features"); - - migrationBuilder.DropPrimaryKey( - name: "PK_Features", - table: "Features"); - - migrationBuilder.DropIndex( - name: "IX_Features_EmployeeRoleId", - table: "Features"); - - migrationBuilder.DropColumn( - name: "AllowCreate", - table: "FeaturePermission"); - - migrationBuilder.DropColumn( - name: "AllowDelete", - table: "FeaturePermission"); - - migrationBuilder.DropColumn( - name: "AllowModify", - table: "FeaturePermission"); - - migrationBuilder.DropColumn( - name: "AllowView", - table: "FeaturePermission"); - - migrationBuilder.DropColumn( - name: "Description", - table: "EmployeeRoles"); - - migrationBuilder.DropColumn( - name: "EmployeeRoleId", - table: "Features"); - - migrationBuilder.RenameTable( - name: "Features", - newName: "Feature"); - - migrationBuilder.RenameIndex( - name: "IX_Features_TenantId", - table: "Feature", - newName: "IX_Feature_TenantId"); - - migrationBuilder.AddColumn( - name: "RoleId", - table: "FeaturePermission", - type: "char(36)", - nullable: false, - defaultValue: new Guid("00000000-0000-0000-0000-000000000000"), - collation: "ascii_general_ci"); - - migrationBuilder.AddPrimaryKey( - name: "PK_Feature", - table: "Feature", - column: "Id"); - - migrationBuilder.CreateIndex( - name: "IX_FeaturePermission_RoleId", - table: "FeaturePermission", - column: "RoleId"); - - migrationBuilder.CreateIndex( - name: "IX_FeaturePermission_TenantId", - table: "FeaturePermission", - column: "TenantId"); - - migrationBuilder.AddForeignKey( - name: "FK_Feature_Tenants_TenantId", - table: "Feature", - column: "TenantId", - principalTable: "Tenants", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); - - migrationBuilder.AddForeignKey( - name: "FK_FeaturePermission_EmployeeRoles_RoleId", - table: "FeaturePermission", - column: "RoleId", - principalTable: "EmployeeRoles", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); - - migrationBuilder.AddForeignKey( - name: "FK_FeaturePermission_Feature_FeatureId", - table: "FeaturePermission", - column: "FeatureId", - principalTable: "Feature", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); - - migrationBuilder.AddForeignKey( - name: "FK_FeaturePermission_Tenants_TenantId", - table: "FeaturePermission", - column: "TenantId", - principalTable: "Tenants", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); - } - } -} diff --git a/Marco.Pms.DataAccess/Migrations/20250205081523_addFeatures.Designer.cs b/Marco.Pms.DataAccess/Migrations/20250205081523_addFeatures.Designer.cs deleted file mode 100644 index 2a69af3..0000000 --- a/Marco.Pms.DataAccess/Migrations/20250205081523_addFeatures.Designer.cs +++ /dev/null @@ -1,1807 +0,0 @@ -// -using System; -using Marco.Pms.DataAccess.Data; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Metadata; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; - -#nullable disable - -namespace Marco.Pms.DataAccess.Migrations -{ - [DbContext(typeof(ApplicationDbContext))] - [Migration("20250205081523_addFeatures")] - partial class addFeatures - { - /// - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasAnnotation("ProductVersion", "8.0.12") - .HasAnnotation("Relational:MaxIdentifierLength", 64); - - // MySqlModelBuilderExtensions.AutoIncrementColumns(modelBuilder); - - modelBuilder.Entity("Marco.Pms.Model.Activities.TaskAllocation", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - - b.Property("AllocationDate") - .HasColumnType("datetime(6)"); - - b.Property("BuildingId") - .HasColumnType("int"); - - b.Property("EmployeeId") - .HasColumnType("int"); - - b.Property("EmployeeRole") - .HasColumnType("int"); - - b.Property("ProjectId") - .HasColumnType("int"); - - b.Property("ReAllocationDate") - .HasColumnType("datetime(6)"); - - b.Property("TenantId") - .HasColumnType("int"); - - b.Property("WorkAreaId") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("BuildingId"); - - b.HasIndex("EmployeeId"); - - b.HasIndex("ProjectId"); - - b.HasIndex("TenantId"); - - b.HasIndex("WorkAreaId"); - - b.ToTable("TaskAllocations"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Activities.WorkItem", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - - b.Property("ActivityId") - .HasColumnType("int"); - - b.Property("CompletedWork") - .HasColumnType("int"); - - b.Property("PlannedWork") - .HasColumnType("int"); - - b.Property("TaskDate") - .HasColumnType("datetime(6)"); - - b.Property("TenantId") - .HasColumnType("int"); - - b.Property("WorkAreaId") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("ActivityId"); - - b.HasIndex("TenantId"); - - b.HasIndex("WorkAreaId"); - - b.ToTable("WorkItems"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Activities.WorkItemMapping", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - - b.Property("TenantId") - .HasColumnType("int"); - - b.Property("WorkAreaId") - .HasColumnType("int"); - - b.Property("WorkItemId") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("TenantId"); - - b.HasIndex("WorkAreaId"); - - b.HasIndex("WorkItemId"); - - b.ToTable("WorkItemMapping"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Authentication.RefreshToken", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - - b.Property("CreatedAt") - .HasColumnType("datetime(6)"); - - b.Property("ExpiryDate") - .HasColumnType("datetime(6)"); - - b.Property("IsRevoked") - .HasColumnType("tinyint(1)"); - - b.Property("IsUsed") - .HasColumnType("tinyint(1)"); - - b.Property("RevokedAt") - .HasColumnType("datetime(6)"); - - b.Property("Token") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("UserId") - .IsRequired() - .HasColumnType("varchar(255)"); - - b.HasKey("Id"); - - b.HasIndex("UserId"); - - b.ToTable("RefreshTokens"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Employees.Attendance", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - - b.Property("ApprovedBy") - .HasColumnType("longtext"); - - b.Property("Comment") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("Date") - .HasColumnType("datetime(6)"); - - b.Property("EmployeeID") - .HasColumnType("int"); - - b.Property("InTimeID") - .HasColumnType("int"); - - b.Property("IsApproved") - .HasColumnType("tinyint(1)"); - - b.Property("OutTimeID") - .HasColumnType("int"); - - b.Property("TenantId") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("EmployeeID"); - - b.HasIndex("InTimeID"); - - b.HasIndex("OutTimeID"); - - b.HasIndex("TenantId"); - - b.ToTable("Attendances"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Employees.AttendanceLog", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - - b.Property("CheckTime") - .HasColumnType("datetime(6)"); - - b.Property("Comment") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("EmployeeID") - .HasColumnType("int"); - - b.Property("IsCheckIn") - .HasColumnType("tinyint(1)"); - - b.Property("Latitude") - .HasColumnType("longtext"); - - b.Property("Longitude") - .HasColumnType("longtext"); - - b.Property("Photo") - .HasColumnType("longblob"); - - b.Property("TenantId") - .HasColumnType("int"); - - b.Property("UpdatedBy") - .HasColumnType("longtext"); - - b.HasKey("Id"); - - b.HasIndex("EmployeeID"); - - b.HasIndex("TenantId"); - - b.ToTable("AttendanceLogs"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Employees.Employee", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - - b.Property("AadharNumber") - .HasColumnType("longtext"); - - b.Property("ApplicationUserId") - .HasColumnType("varchar(255)"); - - b.Property("BirthDate") - .HasColumnType("datetime(6)"); - - b.Property("CurrentAddress") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("Email") - .HasColumnType("longtext"); - - b.Property("EmergencyPhoneNumber") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("FirstName") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("Gender") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("LastName") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("MiddleName") - .HasColumnType("longtext"); - - b.Property("PanNumber") - .HasColumnType("longtext"); - - b.Property("PeramnentAddress") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("PhoneNumber") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("Photo") - .HasColumnType("longblob"); - - b.Property("RoleId") - .HasColumnType("char(36)"); - - b.Property("TenantId") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("ApplicationUserId"); - - b.HasIndex("RoleId"); - - b.HasIndex("TenantId"); - - b.ToTable("Employees"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Employees.WorkShift", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - - b.Property("EndTime") - .HasColumnType("time(6)"); - - b.Property("Name") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("StartTime") - .HasColumnType("time(6)"); - - b.Property("TenantId") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("TenantId"); - - b.ToTable("WorkShifts"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Entitlements.ActivityMaster", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - - b.Property("ActivityName") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("TaskAllocationId") - .HasColumnType("int"); - - b.Property("TenantId") - .HasColumnType("int"); - - b.Property("UnitOfMeasurement") - .IsRequired() - .HasColumnType("longtext"); - - b.HasKey("Id"); - - b.HasIndex("TaskAllocationId"); - - b.HasIndex("TenantId"); - - b.ToTable("ActivityMasters"); - - b.HasData( - new - { - Id = 1, - ActivityName = "Core Cutting", - TenantId = 1, - UnitOfMeasurement = "Number" - }, - new - { - Id = 2, - ActivityName = "Fabrication", - TenantId = 1, - UnitOfMeasurement = "Meter" - }, - new - { - Id = 3, - ActivityName = "Lifting", - TenantId = 1, - UnitOfMeasurement = "Meter" - }, - new - { - Id = 4, - ActivityName = "Hanging", - TenantId = 1, - UnitOfMeasurement = "Meter" - }, - new - { - Id = 5, - ActivityName = "Tapping", - TenantId = 1, - UnitOfMeasurement = "Meter" - }, - new - { - Id = 6, - ActivityName = "Welding", - TenantId = 1, - UnitOfMeasurement = "Meter" - }, - new - { - Id = 7, - ActivityName = "Testing", - TenantId = 1, - UnitOfMeasurement = "Area" - }, - new - { - Id = 8, - ActivityName = "Painting", - TenantId = 1, - UnitOfMeasurement = "Meter" - }, - new - { - Id = 9, - ActivityName = "Marking Area", - TenantId = 1, - UnitOfMeasurement = "Meter" - }, - new - { - Id = 10, - ActivityName = "Drilling", - TenantId = 1, - UnitOfMeasurement = "Number" - }, - new - { - Id = 11, - ActivityName = "MS Support Fabrication", - TenantId = 1, - UnitOfMeasurement = "Number" - }, - new - { - Id = 12, - ActivityName = "MS Support Hanging", - TenantId = 1, - UnitOfMeasurement = "Number" - }, - new - { - Id = 13, - ActivityName = "Hydrant Volve", - TenantId = 1, - UnitOfMeasurement = "Number" - }, - new - { - Id = 14, - ActivityName = "Sprinkler Installation", - TenantId = 1, - UnitOfMeasurement = "Number" - }); - }); - - modelBuilder.Entity("Marco.Pms.Model.Entitlements.EmployeeRole", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("char(36)"); - - b.Property("Description") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("Role") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("TenantId") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("TenantId"); - - b.ToTable("EmployeeRoles"); - - b.HasData( - new - { - Id = new Guid("2c8d0808-c421-11ef-9b93-0242ac110002"), - Description = "", - Role = "Admin", - TenantId = 1 - }, - new - { - Id = new Guid("62e0918d-c421-11ef-9b93-0242ac110002"), - Description = "", - Role = "Welder", - TenantId = 1 - }, - new - { - Id = new Guid("68823f1f-c421-11ef-9b93-0242ac110002"), - Description = "", - Role = "Helper", - TenantId = 1 - }, - new - { - Id = new Guid("6d3a7c72-c421-11ef-9b93-0242ac110002"), - Description = "", - Role = "Site Engineer", - TenantId = 1 - }, - new - { - Id = new Guid("6d3aad72-c421-11ef-9b93-0242ac110002"), - Description = "", - Role = "Project Manager", - TenantId = 1 - }); - }); - - modelBuilder.Entity("Marco.Pms.Model.Entitlements.Feature", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("char(36)"); - - b.Property("Description") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("EmployeeRoleId") - .HasColumnType("char(36)"); - - b.Property("IsActive") - .HasColumnType("tinyint(1)"); - - b.Property("ModuleId") - .HasColumnType("int"); - - b.Property("Name") - .IsRequired() - .HasColumnType("longtext"); - - b.HasKey("Id"); - - b.HasIndex("EmployeeRoleId"); - - b.HasIndex("ModuleId"); - - b.ToTable("Features"); - - b.HasData( - new - { - Id = new Guid("53176ebf-c75d-42e5-839f-4508ffac3def"), - Description = "Manage Project", - IsActive = true, - ModuleId = 1, - Name = "Manage Project" - }, - new - { - Id = new Guid("9666de86-d7c7-4d3d-acaa-fcd6d6b81f3c"), - Description = "Manage Infra", - IsActive = true, - ModuleId = 1, - Name = "Manage Infra" - }, - new - { - Id = new Guid("9d4b5489-2079-40b9-bd77-6e1bf90bc19f"), - Description = "Manage Tasks", - IsActive = true, - ModuleId = 1, - Name = "Manage Tasks" - }, - new - { - Id = new Guid("39e66f81-efc6-446c-95bd-46bff6cfb606"), - Description = "Assign and Update Tasks Progress", - IsActive = true, - ModuleId = 1, - Name = "Assign and Update Tasks Progress" - }, - new - { - Id = new Guid("81ab8a87-8ccd-4015-a917-0627cee6a100"), - Description = "Manage Employee", - IsActive = true, - ModuleId = 2, - Name = "Manage Employee" - }, - new - { - Id = new Guid("52c9cf54-1eb2-44d2-81bb-524cf29c0a94"), - Description = "Attendance", - IsActive = true, - ModuleId = 2, - Name = "Attendance" - }, - new - { - Id = new Guid("be3b3afc-6ccf-4566-b9b6-aafcb65546be"), - Description = "Global Masters", - IsActive = true, - ModuleId = 3, - Name = "Global Masters" - }, - new - { - Id = new Guid("660131a4-788c-4739-a082-cbbf7879cbf2"), - Description = "Tenant Masters", - IsActive = true, - ModuleId = 3, - Name = "Tenant Masters" - }); - }); - - modelBuilder.Entity("Marco.Pms.Model.Entitlements.FeaturePermission", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("char(36)"); - - b.Property("Description") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("FeatureId") - .HasColumnType("char(36)"); - - b.Property("IsEnabled") - .HasColumnType("tinyint(1)"); - - b.Property("Name") - .IsRequired() - .HasColumnType("longtext"); - - b.HasKey("Id"); - - b.HasIndex("FeatureId"); - - b.ToTable("FeaturePermissions"); - - b.HasData( - new - { - Id = new Guid("6ea44136-987e-44ba-9e5d-1cf8f5837ebc"), - Description = "", - FeatureId = new Guid("53176ebf-c75d-42e5-839f-4508ffac3def"), - IsEnabled = true, - Name = "View Project" - }, - new - { - Id = new Guid("172fc9b6-755b-4f62-ab26-55c34a330614"), - Description = "", - FeatureId = new Guid("53176ebf-c75d-42e5-839f-4508ffac3def"), - IsEnabled = true, - Name = "Manage Project" - }, - new - { - Id = new Guid("b94802ce-0689-4643-9e1d-11c86950c35b"), - Description = "", - FeatureId = new Guid("53176ebf-c75d-42e5-839f-4508ffac3def"), - IsEnabled = true, - Name = "Manage Team" - }, - new - { - Id = new Guid("c7b68e33-72f0-474f-bd96-77636427ecc8"), - Description = "", - FeatureId = new Guid("9666de86-d7c7-4d3d-acaa-fcd6d6b81f3c"), - IsEnabled = true, - Name = "View Project Infra" - }, - new - { - Id = new Guid("f2aee20a-b754-4537-8166-f9507b44585b"), - Description = "", - FeatureId = new Guid("9666de86-d7c7-4d3d-acaa-fcd6d6b81f3c"), - IsEnabled = true, - Name = "Manage Project Infra" - }, - new - { - Id = new Guid("9fcc5f87-25e3-4846-90ac-67a71ab92e3c"), - Description = "", - FeatureId = new Guid("9d4b5489-2079-40b9-bd77-6e1bf90bc19f"), - IsEnabled = true, - Name = "View Task" - }, - new - { - Id = new Guid("08752f33-3b29-4816-b76b-ea8a968ed3c5"), - Description = "", - FeatureId = new Guid("9d4b5489-2079-40b9-bd77-6e1bf90bc19f"), - IsEnabled = true, - Name = "Manage Task" - }, - new - { - Id = new Guid("d135a4b0-4f9a-4903-ab9c-4843839ebdee"), - Description = "", - FeatureId = new Guid("81ab8a87-8ccd-4015-a917-0627cee6a100"), - IsEnabled = true, - Name = "Assign Task and Report Progress" - }, - new - { - Id = new Guid("ed99ecd4-1bed-42e1-b7b3-d64c04493823"), - Description = "", - FeatureId = new Guid("81ab8a87-8ccd-4015-a917-0627cee6a100"), - IsEnabled = true, - Name = "Approve Task" - }, - new - { - Id = new Guid("b82d2b7e-0d52-45f3-997b-c008ea460e7f"), - Description = "", - FeatureId = new Guid("81ab8a87-8ccd-4015-a917-0627cee6a100"), - IsEnabled = true, - Name = "View Employee" - }, - new - { - Id = new Guid("a97d366a-c2bb-448d-be93-402bd2324566"), - Description = "", - FeatureId = new Guid("81ab8a87-8ccd-4015-a917-0627cee6a100"), - IsEnabled = true, - Name = "Manage Employee" - }, - new - { - Id = new Guid("fbd213e0-0250-46f1-9f5f-4b2a1e6e76a3"), - Description = "", - FeatureId = new Guid("81ab8a87-8ccd-4015-a917-0627cee6a100"), - IsEnabled = true, - Name = "Assign To Project" - }, - new - { - Id = new Guid("915e6bff-65f6-4e3f-aea8-3fd217d3ea9e"), - Description = "", - FeatureId = new Guid("52c9cf54-1eb2-44d2-81bb-524cf29c0a94"), - IsEnabled = true, - Name = "Perform Attendance " - }, - new - { - Id = new Guid("57802c4a-00aa-4a1f-a048-fd2f70dd44b6"), - Description = "", - FeatureId = new Guid("52c9cf54-1eb2-44d2-81bb-524cf29c0a94"), - IsEnabled = true, - Name = "Regularize Attendance" - }, - new - { - Id = new Guid("5ffbafe0-7ab0-48b1-bb50-c1bf76b65f9d"), - Description = "", - FeatureId = new Guid("be3b3afc-6ccf-4566-b9b6-aafcb65546be"), - IsEnabled = true, - Name = "View Masters" - }, - new - { - Id = new Guid("588a8824-f924-4955-82d8-fc51956cf323"), - Description = "", - FeatureId = new Guid("be3b3afc-6ccf-4566-b9b6-aafcb65546be"), - IsEnabled = true, - Name = "Manage Masters" - }, - new - { - Id = new Guid("cb8ec407-46d4-4467-930c-69127cda6dec"), - Description = "", - FeatureId = new Guid("660131a4-788c-4739-a082-cbbf7879cbf2"), - IsEnabled = true, - Name = "View Masters" - }, - new - { - Id = new Guid("6b1a6d97-a951-4de5-9b19-709bac7c4f18"), - Description = "", - FeatureId = new Guid("660131a4-788c-4739-a082-cbbf7879cbf2"), - IsEnabled = true, - Name = "Manage Masters" - }); - }); - - modelBuilder.Entity("Marco.Pms.Model.Entitlements.Module", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - - b.Property("Description") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("Key") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("Name") - .IsRequired() - .HasColumnType("longtext"); - - b.HasKey("Id"); - - b.ToTable("Modules"); - - b.HasData( - new - { - Id = 1, - Description = "Project Module", - Key = "9a7ed07c-f7dd-4831-bf64-d5278fa9e38c", - Name = "Project" - }, - new - { - Id = 2, - Description = "Employee Module", - Key = "a9fb08bf-7dae-4282-9b02-f63d94d7a9dc", - Name = "Employee" - }, - new - { - Id = 3, - Description = "Masters Module", - Key = "e6423995-d7bf-452e-8bcc-780a655b015c", - Name = "Masters" - }); - }); - - modelBuilder.Entity("Marco.Pms.Model.Entitlements.StatusMaster", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - - b.Property("Status") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("TenantId") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("TenantId"); - - b.ToTable("StatusMasters"); - - b.HasData( - new - { - Id = 1, - Status = "Active", - TenantId = 1 - }, - new - { - Id = 2, - Status = "In Progress", - TenantId = 1 - }, - new - { - Id = 3, - Status = "On Hold", - TenantId = 1 - }, - new - { - Id = 4, - Status = "Completed", - TenantId = 1 - }); - }); - - modelBuilder.Entity("Marco.Pms.Model.Entitlements.Tenant", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - - b.Property("ContactName") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("ContactNumber") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("Description") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("DomainName") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("Name") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("OnBoardingDate") - .HasColumnType("datetime(6)"); - - b.HasKey("Id"); - - b.ToTable("Tenants"); - - b.HasData( - new - { - Id = 1, - ContactName = "Admin", - ContactNumber = "123456789", - Description = "", - DomainName = "www.marcobms.org", - Name = "MarcoBMS", - OnBoardingDate = new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified) - }); - }); - - modelBuilder.Entity("Marco.Pms.Model.Projects.Building", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - - b.Property("Description") - .HasColumnType("longtext"); - - b.Property("Name") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("ProjectId") - .HasColumnType("int"); - - b.Property("TenantId") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("TenantId"); - - b.ToTable("Buildings"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Projects.Floor", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - - b.Property("BuildingId") - .HasColumnType("int"); - - b.Property("FloorName") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("TenantId") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("BuildingId"); - - b.HasIndex("TenantId"); - - b.ToTable("Floor"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Projects.Project", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - - b.Property("ContactPerson") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("EndDate") - .HasColumnType("datetime(6)"); - - b.Property("Name") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("ProjectAddress") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("ProjectStatusId") - .HasColumnType("int"); - - b.Property("StartDate") - .HasColumnType("datetime(6)"); - - b.Property("TenantId") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("ProjectStatusId"); - - b.HasIndex("TenantId"); - - b.ToTable("Projects"); - - b.HasData( - new - { - Id = 1, - ContactPerson = "Project 1 Contact Person", - Name = "Project 1", - ProjectAddress = "Project 1 Address", - ProjectStatusId = 1, - TenantId = 1 - }, - new - { - Id = 2, - ContactPerson = "Project 2 Contact Person", - Name = "Project 2", - ProjectAddress = "Project 2 Address", - ProjectStatusId = 2, - TenantId = 1 - }, - new - { - Id = 3, - ContactPerson = "Project 3 Contact Person", - Name = "Project 3", - ProjectAddress = "Project 3 Address", - ProjectStatusId = 3, - TenantId = 1 - }); - }); - - modelBuilder.Entity("Marco.Pms.Model.Projects.ProjectAllocation", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - - b.Property("AllocationDate") - .HasColumnType("datetime(6)"); - - b.Property("EmployeeId") - .HasColumnType("int"); - - b.Property("EmployeeRoleId") - .HasColumnType("char(36)"); - - b.Property("ProjectId") - .HasColumnType("int"); - - b.Property("ReAllocationDate") - .HasColumnType("datetime(6)"); - - b.Property("TenantId") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("EmployeeId"); - - b.HasIndex("ProjectId"); - - b.HasIndex("TenantId"); - - b.ToTable("ProjectAllocations"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Projects.WorkArea", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - - b.Property("AreaName") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("FloorId") - .HasColumnType("int"); - - b.Property("TenantId") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("FloorId"); - - b.HasIndex("TenantId"); - - b.ToTable("WorkAreas"); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRole", b => - { - b.Property("Id") - .HasColumnType("varchar(255)"); - - b.Property("ConcurrencyStamp") - .IsConcurrencyToken() - .HasColumnType("longtext"); - - b.Property("Name") - .HasMaxLength(256) - .HasColumnType("varchar(256)"); - - b.Property("NormalizedName") - .HasMaxLength(256) - .HasColumnType("varchar(256)"); - - b.HasKey("Id"); - - b.HasIndex("NormalizedName") - .IsUnique() - .HasDatabaseName("RoleNameIndex"); - - b.ToTable("AspNetRoles", (string)null); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - - b.Property("ClaimType") - .HasColumnType("longtext"); - - b.Property("ClaimValue") - .HasColumnType("longtext"); - - b.Property("RoleId") - .IsRequired() - .HasColumnType("varchar(255)"); - - b.HasKey("Id"); - - b.HasIndex("RoleId"); - - b.ToTable("AspNetRoleClaims", (string)null); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUser", b => - { - b.Property("Id") - .HasColumnType("varchar(255)"); - - b.Property("AccessFailedCount") - .HasColumnType("int"); - - b.Property("ConcurrencyStamp") - .IsConcurrencyToken() - .HasColumnType("longtext"); - - b.Property("Discriminator") - .IsRequired() - .HasMaxLength(21) - .HasColumnType("varchar(21)"); - - b.Property("Email") - .HasMaxLength(256) - .HasColumnType("varchar(256)"); - - b.Property("EmailConfirmed") - .HasColumnType("tinyint(1)"); - - b.Property("LockoutEnabled") - .HasColumnType("tinyint(1)"); - - b.Property("LockoutEnd") - .HasColumnType("datetime(6)"); - - b.Property("NormalizedEmail") - .HasMaxLength(256) - .HasColumnType("varchar(256)"); - - b.Property("NormalizedUserName") - .HasMaxLength(256) - .HasColumnType("varchar(256)"); - - b.Property("PasswordHash") - .HasColumnType("longtext"); - - b.Property("PhoneNumber") - .HasColumnType("longtext"); - - b.Property("PhoneNumberConfirmed") - .HasColumnType("tinyint(1)"); - - b.Property("SecurityStamp") - .HasColumnType("longtext"); - - b.Property("TwoFactorEnabled") - .HasColumnType("tinyint(1)"); - - b.Property("UserName") - .HasMaxLength(256) - .HasColumnType("varchar(256)"); - - b.HasKey("Id"); - - b.HasIndex("NormalizedEmail") - .HasDatabaseName("EmailIndex"); - - b.HasIndex("NormalizedUserName") - .IsUnique() - .HasDatabaseName("UserNameIndex"); - - b.ToTable("AspNetUsers", (string)null); - - b.HasDiscriminator().HasValue("IdentityUser"); - - b.UseTphMappingStrategy(); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - - b.Property("ClaimType") - .HasColumnType("longtext"); - - b.Property("ClaimValue") - .HasColumnType("longtext"); - - b.Property("UserId") - .IsRequired() - .HasColumnType("varchar(255)"); - - b.HasKey("Id"); - - b.HasIndex("UserId"); - - b.ToTable("AspNetUserClaims", (string)null); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin", b => - { - b.Property("LoginProvider") - .HasColumnType("varchar(255)"); - - b.Property("ProviderKey") - .HasColumnType("varchar(255)"); - - b.Property("ProviderDisplayName") - .HasColumnType("longtext"); - - b.Property("UserId") - .IsRequired() - .HasColumnType("varchar(255)"); - - b.HasKey("LoginProvider", "ProviderKey"); - - b.HasIndex("UserId"); - - b.ToTable("AspNetUserLogins", (string)null); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole", b => - { - b.Property("UserId") - .HasColumnType("varchar(255)"); - - b.Property("RoleId") - .HasColumnType("varchar(255)"); - - b.HasKey("UserId", "RoleId"); - - b.HasIndex("RoleId"); - - b.ToTable("AspNetUserRoles", (string)null); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken", b => - { - b.Property("UserId") - .HasColumnType("varchar(255)"); - - b.Property("LoginProvider") - .HasColumnType("varchar(255)"); - - b.Property("Name") - .HasColumnType("varchar(255)"); - - b.Property("Value") - .HasColumnType("longtext"); - - b.HasKey("UserId", "LoginProvider", "Name"); - - b.ToTable("AspNetUserTokens", (string)null); - }); - - modelBuilder.Entity("Marco.Pms.Model.Entitlements.ApplicationUser", b => - { - b.HasBaseType("Microsoft.AspNetCore.Identity.IdentityUser"); - - b.Property("IsRootUser") - .HasColumnType("tinyint(1)"); - - b.Property("Role") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("TenantId") - .HasColumnType("int"); - - b.HasDiscriminator().HasValue("ApplicationUser"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Activities.TaskAllocation", b => - { - b.HasOne("Marco.Pms.Model.Projects.Building", "Building") - .WithMany() - .HasForeignKey("BuildingId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Marco.Pms.Model.Employees.Employee", "Employee") - .WithMany() - .HasForeignKey("EmployeeId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Marco.Pms.Model.Projects.Project", "Project") - .WithMany() - .HasForeignKey("ProjectId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Marco.Pms.Model.Entitlements.Tenant", "Tenant") - .WithMany() - .HasForeignKey("TenantId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Marco.Pms.Model.Projects.WorkArea", "WorkArea") - .WithMany() - .HasForeignKey("WorkAreaId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Building"); - - b.Navigation("Employee"); - - b.Navigation("Project"); - - b.Navigation("Tenant"); - - b.Navigation("WorkArea"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Activities.WorkItem", b => - { - b.HasOne("Marco.Pms.Model.Entitlements.ActivityMaster", "ActivityMaster") - .WithMany() - .HasForeignKey("ActivityId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Marco.Pms.Model.Entitlements.Tenant", "Tenant") - .WithMany() - .HasForeignKey("TenantId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Marco.Pms.Model.Projects.WorkArea", "WorkArea") - .WithMany() - .HasForeignKey("WorkAreaId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("ActivityMaster"); - - b.Navigation("Tenant"); - - b.Navigation("WorkArea"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Activities.WorkItemMapping", b => - { - b.HasOne("Marco.Pms.Model.Entitlements.Tenant", "Tenant") - .WithMany() - .HasForeignKey("TenantId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Marco.Pms.Model.Projects.WorkArea", "WorkArea") - .WithMany() - .HasForeignKey("WorkAreaId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Marco.Pms.Model.Activities.WorkItem", "WorkItem") - .WithMany() - .HasForeignKey("WorkItemId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Tenant"); - - b.Navigation("WorkArea"); - - b.Navigation("WorkItem"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Authentication.RefreshToken", b => - { - b.HasOne("Microsoft.AspNetCore.Identity.IdentityUser", "User") - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("User"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Employees.Attendance", b => - { - b.HasOne("Marco.Pms.Model.Employees.Employee", "Employee") - .WithMany() - .HasForeignKey("EmployeeID") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Marco.Pms.Model.Employees.AttendanceLog", "InTimeLog") - .WithMany() - .HasForeignKey("InTimeID"); - - b.HasOne("Marco.Pms.Model.Employees.AttendanceLog", "OutTimeLog") - .WithMany() - .HasForeignKey("OutTimeID"); - - b.HasOne("Marco.Pms.Model.Entitlements.Tenant", "Tenant") - .WithMany() - .HasForeignKey("TenantId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Employee"); - - b.Navigation("InTimeLog"); - - b.Navigation("OutTimeLog"); - - b.Navigation("Tenant"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Employees.AttendanceLog", b => - { - b.HasOne("Marco.Pms.Model.Employees.Employee", "Employee") - .WithMany() - .HasForeignKey("EmployeeID") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Marco.Pms.Model.Entitlements.Tenant", "Tenant") - .WithMany() - .HasForeignKey("TenantId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Employee"); - - b.Navigation("Tenant"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Employees.Employee", b => - { - b.HasOne("Marco.Pms.Model.Entitlements.ApplicationUser", "ApplicationUser") - .WithMany() - .HasForeignKey("ApplicationUserId"); - - b.HasOne("Marco.Pms.Model.Entitlements.EmployeeRole", "EmployeeRole") - .WithMany() - .HasForeignKey("RoleId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Marco.Pms.Model.Entitlements.Tenant", "Tenant") - .WithMany() - .HasForeignKey("TenantId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("ApplicationUser"); - - b.Navigation("EmployeeRole"); - - b.Navigation("Tenant"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Employees.WorkShift", b => - { - b.HasOne("Marco.Pms.Model.Entitlements.Tenant", "Tenant") - .WithMany() - .HasForeignKey("TenantId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Tenant"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Entitlements.ActivityMaster", b => - { - b.HasOne("Marco.Pms.Model.Activities.TaskAllocation", null) - .WithMany("AllotedTask") - .HasForeignKey("TaskAllocationId"); - - b.HasOne("Marco.Pms.Model.Entitlements.Tenant", "Tenant") - .WithMany() - .HasForeignKey("TenantId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Tenant"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Entitlements.EmployeeRole", b => - { - b.HasOne("Marco.Pms.Model.Entitlements.Tenant", "Tenant") - .WithMany() - .HasForeignKey("TenantId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Tenant"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Entitlements.Feature", b => - { - b.HasOne("Marco.Pms.Model.Entitlements.EmployeeRole", null) - .WithMany("Features") - .HasForeignKey("EmployeeRoleId"); - - b.HasOne("Marco.Pms.Model.Entitlements.Module", "Module") - .WithMany() - .HasForeignKey("ModuleId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Module"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Entitlements.FeaturePermission", b => - { - b.HasOne("Marco.Pms.Model.Entitlements.Feature", null) - .WithMany("FeaturePermissions") - .HasForeignKey("FeatureId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Marco.Pms.Model.Entitlements.StatusMaster", b => - { - b.HasOne("Marco.Pms.Model.Entitlements.Tenant", "Tenant") - .WithMany() - .HasForeignKey("TenantId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Tenant"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Projects.Building", b => - { - b.HasOne("Marco.Pms.Model.Entitlements.Tenant", "Tenant") - .WithMany() - .HasForeignKey("TenantId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Tenant"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Projects.Floor", b => - { - b.HasOne("Marco.Pms.Model.Projects.Building", "Building") - .WithMany() - .HasForeignKey("BuildingId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Marco.Pms.Model.Entitlements.Tenant", "Tenant") - .WithMany() - .HasForeignKey("TenantId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Building"); - - b.Navigation("Tenant"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Projects.Project", b => - { - b.HasOne("Marco.Pms.Model.Entitlements.StatusMaster", "ProjectStatus") - .WithMany() - .HasForeignKey("ProjectStatusId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Marco.Pms.Model.Entitlements.Tenant", "Tenant") - .WithMany() - .HasForeignKey("TenantId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("ProjectStatus"); - - b.Navigation("Tenant"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Projects.ProjectAllocation", b => - { - b.HasOne("Marco.Pms.Model.Employees.Employee", "Employee") - .WithMany() - .HasForeignKey("EmployeeId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Marco.Pms.Model.Projects.Project", "Project") - .WithMany() - .HasForeignKey("ProjectId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Marco.Pms.Model.Entitlements.Tenant", "Tenant") - .WithMany() - .HasForeignKey("TenantId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Employee"); - - b.Navigation("Project"); - - b.Navigation("Tenant"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Projects.WorkArea", b => - { - b.HasOne("Marco.Pms.Model.Projects.Floor", "Floor") - .WithMany() - .HasForeignKey("FloorId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Marco.Pms.Model.Entitlements.Tenant", "Tenant") - .WithMany() - .HasForeignKey("TenantId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Floor"); - - b.Navigation("Tenant"); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim", b => - { - b.HasOne("Microsoft.AspNetCore.Identity.IdentityRole", null) - .WithMany() - .HasForeignKey("RoleId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim", b => - { - b.HasOne("Microsoft.AspNetCore.Identity.IdentityUser", null) - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin", b => - { - b.HasOne("Microsoft.AspNetCore.Identity.IdentityUser", null) - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole", b => - { - b.HasOne("Microsoft.AspNetCore.Identity.IdentityRole", null) - .WithMany() - .HasForeignKey("RoleId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Microsoft.AspNetCore.Identity.IdentityUser", null) - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken", b => - { - b.HasOne("Microsoft.AspNetCore.Identity.IdentityUser", null) - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Marco.Pms.Model.Activities.TaskAllocation", b => - { - b.Navigation("AllotedTask"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Entitlements.EmployeeRole", b => - { - b.Navigation("Features"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Entitlements.Feature", b => - { - b.Navigation("FeaturePermissions"); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/Marco.Pms.DataAccess/Migrations/20250205081523_addFeatures.cs b/Marco.Pms.DataAccess/Migrations/20250205081523_addFeatures.cs deleted file mode 100644 index 83fa617..0000000 --- a/Marco.Pms.DataAccess/Migrations/20250205081523_addFeatures.cs +++ /dev/null @@ -1,416 +0,0 @@ -using System; -using Microsoft.EntityFrameworkCore.Metadata; -using Microsoft.EntityFrameworkCore.Migrations; - -#nullable disable - -#pragma warning disable CA1814 // Prefer jagged arrays over multidimensional - -namespace Marco.Pms.DataAccess.Migrations -{ - /// - public partial class addFeatures : Migration - { - /// - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropForeignKey( - name: "FK_FeaturePermission_Features_FeatureId", - table: "FeaturePermission"); - - migrationBuilder.DropForeignKey( - name: "FK_Features_Tenants_TenantId", - table: "Features"); - - migrationBuilder.DropPrimaryKey( - name: "PK_FeaturePermission", - table: "FeaturePermission"); - - migrationBuilder.DropColumn( - name: "AllowCreate", - table: "FeaturePermission"); - - migrationBuilder.DropColumn( - name: "AllowDelete", - table: "FeaturePermission"); - - migrationBuilder.DropColumn( - name: "AllowModify", - table: "FeaturePermission"); - - migrationBuilder.DropColumn( - name: "AllowView", - table: "FeaturePermission"); - - migrationBuilder.DropColumn( - name: "TenantId", - table: "FeaturePermission"); - - migrationBuilder.RenameTable( - name: "FeaturePermission", - newName: "FeaturePermissions"); - - migrationBuilder.RenameColumn( - name: "TenantId", - table: "Features", - newName: "ModuleId"); - - migrationBuilder.RenameIndex( - name: "IX_Features_TenantId", - table: "Features", - newName: "IX_Features_ModuleId"); - - migrationBuilder.RenameIndex( - name: "IX_FeaturePermission_FeatureId", - table: "FeaturePermissions", - newName: "IX_FeaturePermissions_FeatureId"); - - migrationBuilder.AddColumn( - name: "IsActive", - table: "Features", - type: "tinyint(1)", - nullable: false, - defaultValue: false); - - migrationBuilder.AddColumn( - name: "Description", - table: "FeaturePermissions", - type: "longtext", - nullable: false) - .Annotation("MySql:CharSet", "utf8mb4"); - - migrationBuilder.AddColumn( - name: "Name", - table: "FeaturePermissions", - type: "longtext", - nullable: false) - .Annotation("MySql:CharSet", "utf8mb4"); - - migrationBuilder.AddPrimaryKey( - name: "PK_FeaturePermissions", - table: "FeaturePermissions", - column: "Id"); - - migrationBuilder.CreateTable( - name: "Modules", - columns: table => new - { - Id = table.Column(type: "int", nullable: false) - .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), - Name = table.Column(type: "longtext", nullable: false) - .Annotation("MySql:CharSet", "utf8mb4"), - Description = table.Column(type: "longtext", nullable: false) - .Annotation("MySql:CharSet", "utf8mb4"), - Key = table.Column(type: "longtext", nullable: false) - .Annotation("MySql:CharSet", "utf8mb4") - }, - constraints: table => - { - table.PrimaryKey("PK_Modules", x => x.Id); - }) - .Annotation("MySql:CharSet", "utf8mb4"); - - migrationBuilder.InsertData( - table: "Modules", - columns: new[] { "Id", "Description", "Key", "Name" }, - values: new object[,] - { - { 1, "Project Module", "9a7ed07c-f7dd-4831-bf64-d5278fa9e38c", "Project" }, - { 2, "Employee Module", "a9fb08bf-7dae-4282-9b02-f63d94d7a9dc", "Employee" }, - { 3, "Masters Module", "e6423995-d7bf-452e-8bcc-780a655b015c", "Masters" } - }); - - migrationBuilder.InsertData( - table: "Features", - columns: new[] { "Id", "Description", "EmployeeRoleId", "IsActive", "ModuleId", "Name" }, - values: new object[,] - { - { new Guid("39e66f81-efc6-446c-95bd-46bff6cfb606"), "Assign and Update Tasks Progress", null, true, 1, "Assign and Update Tasks Progress" }, - { new Guid("52c9cf54-1eb2-44d2-81bb-524cf29c0a94"), "Attendance", null, true, 2, "Attendance" }, - { new Guid("53176ebf-c75d-42e5-839f-4508ffac3def"), "Manage Project", null, true, 1, "Manage Project" }, - { new Guid("660131a4-788c-4739-a082-cbbf7879cbf2"), "Tenant Masters", null, true, 3, "Tenant Masters" }, - { new Guid("81ab8a87-8ccd-4015-a917-0627cee6a100"), "Manage Employee", null, true, 2, "Manage Employee" }, - { new Guid("9666de86-d7c7-4d3d-acaa-fcd6d6b81f3c"), "Manage Infra", null, true, 1, "Manage Infra" }, - { new Guid("9d4b5489-2079-40b9-bd77-6e1bf90bc19f"), "Manage Tasks", null, true, 1, "Manage Tasks" }, - { new Guid("be3b3afc-6ccf-4566-b9b6-aafcb65546be"), "Global Masters", null, true, 3, "Global Masters" } - }); - - migrationBuilder.InsertData( - table: "FeaturePermissions", - columns: new[] { "Id", "Description", "FeatureId", "IsEnabled", "Name" }, - values: new object[,] - { - { new Guid("08752f33-3b29-4816-b76b-ea8a968ed3c5"), "", new Guid("9d4b5489-2079-40b9-bd77-6e1bf90bc19f"), true, "Manage Task" }, - { new Guid("172fc9b6-755b-4f62-ab26-55c34a330614"), "", new Guid("53176ebf-c75d-42e5-839f-4508ffac3def"), true, "Manage Project" }, - { new Guid("57802c4a-00aa-4a1f-a048-fd2f70dd44b6"), "", new Guid("52c9cf54-1eb2-44d2-81bb-524cf29c0a94"), true, "Regularize Attendance" }, - { new Guid("588a8824-f924-4955-82d8-fc51956cf323"), "", new Guid("be3b3afc-6ccf-4566-b9b6-aafcb65546be"), true, "Manage Masters" }, - { new Guid("5ffbafe0-7ab0-48b1-bb50-c1bf76b65f9d"), "", new Guid("be3b3afc-6ccf-4566-b9b6-aafcb65546be"), true, "View Masters" }, - { new Guid("6b1a6d97-a951-4de5-9b19-709bac7c4f18"), "", new Guid("660131a4-788c-4739-a082-cbbf7879cbf2"), true, "Manage Masters" }, - { new Guid("6ea44136-987e-44ba-9e5d-1cf8f5837ebc"), "", new Guid("53176ebf-c75d-42e5-839f-4508ffac3def"), true, "View Project" }, - { new Guid("915e6bff-65f6-4e3f-aea8-3fd217d3ea9e"), "", new Guid("52c9cf54-1eb2-44d2-81bb-524cf29c0a94"), true, "Perform Attendance " }, - { new Guid("9fcc5f87-25e3-4846-90ac-67a71ab92e3c"), "", new Guid("9d4b5489-2079-40b9-bd77-6e1bf90bc19f"), true, "View Task" }, - { new Guid("a97d366a-c2bb-448d-be93-402bd2324566"), "", new Guid("81ab8a87-8ccd-4015-a917-0627cee6a100"), true, "Manage Employee" }, - { new Guid("b82d2b7e-0d52-45f3-997b-c008ea460e7f"), "", new Guid("81ab8a87-8ccd-4015-a917-0627cee6a100"), true, "View Employee" }, - { new Guid("b94802ce-0689-4643-9e1d-11c86950c35b"), "", new Guid("53176ebf-c75d-42e5-839f-4508ffac3def"), true, "Manage Team" }, - { new Guid("c7b68e33-72f0-474f-bd96-77636427ecc8"), "", new Guid("9666de86-d7c7-4d3d-acaa-fcd6d6b81f3c"), true, "View Project Infra" }, - { new Guid("cb8ec407-46d4-4467-930c-69127cda6dec"), "", new Guid("660131a4-788c-4739-a082-cbbf7879cbf2"), true, "View Masters" }, - { new Guid("d135a4b0-4f9a-4903-ab9c-4843839ebdee"), "", new Guid("81ab8a87-8ccd-4015-a917-0627cee6a100"), true, "Assign Task and Report Progress" }, - { new Guid("ed99ecd4-1bed-42e1-b7b3-d64c04493823"), "", new Guid("81ab8a87-8ccd-4015-a917-0627cee6a100"), true, "Approve Task" }, - { new Guid("f2aee20a-b754-4537-8166-f9507b44585b"), "", new Guid("9666de86-d7c7-4d3d-acaa-fcd6d6b81f3c"), true, "Manage Project Infra" }, - { new Guid("fbd213e0-0250-46f1-9f5f-4b2a1e6e76a3"), "", new Guid("81ab8a87-8ccd-4015-a917-0627cee6a100"), true, "Assign To Project" } - }); - - migrationBuilder.AddForeignKey( - name: "FK_FeaturePermissions_Features_FeatureId", - table: "FeaturePermissions", - column: "FeatureId", - principalTable: "Features", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); - - migrationBuilder.AddForeignKey( - name: "FK_Features_Modules_ModuleId", - table: "Features", - column: "ModuleId", - principalTable: "Modules", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); - } - - /// - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropForeignKey( - name: "FK_FeaturePermissions_Features_FeatureId", - table: "FeaturePermissions"); - - migrationBuilder.DropForeignKey( - name: "FK_Features_Modules_ModuleId", - table: "Features"); - - migrationBuilder.DropTable( - name: "Modules"); - - migrationBuilder.DropPrimaryKey( - name: "PK_FeaturePermissions", - table: "FeaturePermissions"); - - migrationBuilder.DeleteData( - table: "FeaturePermissions", - keyColumn: "Id", - keyValue: new Guid("08752f33-3b29-4816-b76b-ea8a968ed3c5")); - - migrationBuilder.DeleteData( - table: "FeaturePermissions", - keyColumn: "Id", - keyValue: new Guid("172fc9b6-755b-4f62-ab26-55c34a330614")); - - migrationBuilder.DeleteData( - table: "FeaturePermissions", - keyColumn: "Id", - keyValue: new Guid("57802c4a-00aa-4a1f-a048-fd2f70dd44b6")); - - migrationBuilder.DeleteData( - table: "FeaturePermissions", - keyColumn: "Id", - keyValue: new Guid("588a8824-f924-4955-82d8-fc51956cf323")); - - migrationBuilder.DeleteData( - table: "FeaturePermissions", - keyColumn: "Id", - keyValue: new Guid("5ffbafe0-7ab0-48b1-bb50-c1bf76b65f9d")); - - migrationBuilder.DeleteData( - table: "FeaturePermissions", - keyColumn: "Id", - keyValue: new Guid("6b1a6d97-a951-4de5-9b19-709bac7c4f18")); - - migrationBuilder.DeleteData( - table: "FeaturePermissions", - keyColumn: "Id", - keyValue: new Guid("6ea44136-987e-44ba-9e5d-1cf8f5837ebc")); - - migrationBuilder.DeleteData( - table: "FeaturePermissions", - keyColumn: "Id", - keyValue: new Guid("915e6bff-65f6-4e3f-aea8-3fd217d3ea9e")); - - migrationBuilder.DeleteData( - table: "FeaturePermissions", - keyColumn: "Id", - keyValue: new Guid("9fcc5f87-25e3-4846-90ac-67a71ab92e3c")); - - migrationBuilder.DeleteData( - table: "FeaturePermissions", - keyColumn: "Id", - keyValue: new Guid("a97d366a-c2bb-448d-be93-402bd2324566")); - - migrationBuilder.DeleteData( - table: "FeaturePermissions", - keyColumn: "Id", - keyValue: new Guid("b82d2b7e-0d52-45f3-997b-c008ea460e7f")); - - migrationBuilder.DeleteData( - table: "FeaturePermissions", - keyColumn: "Id", - keyValue: new Guid("b94802ce-0689-4643-9e1d-11c86950c35b")); - - migrationBuilder.DeleteData( - table: "FeaturePermissions", - keyColumn: "Id", - keyValue: new Guid("c7b68e33-72f0-474f-bd96-77636427ecc8")); - - migrationBuilder.DeleteData( - table: "FeaturePermissions", - keyColumn: "Id", - keyValue: new Guid("cb8ec407-46d4-4467-930c-69127cda6dec")); - - migrationBuilder.DeleteData( - table: "FeaturePermissions", - keyColumn: "Id", - keyValue: new Guid("d135a4b0-4f9a-4903-ab9c-4843839ebdee")); - - migrationBuilder.DeleteData( - table: "FeaturePermissions", - keyColumn: "Id", - keyValue: new Guid("ed99ecd4-1bed-42e1-b7b3-d64c04493823")); - - migrationBuilder.DeleteData( - table: "FeaturePermissions", - keyColumn: "Id", - keyValue: new Guid("f2aee20a-b754-4537-8166-f9507b44585b")); - - migrationBuilder.DeleteData( - table: "FeaturePermissions", - keyColumn: "Id", - keyValue: new Guid("fbd213e0-0250-46f1-9f5f-4b2a1e6e76a3")); - - migrationBuilder.DeleteData( - table: "Features", - keyColumn: "Id", - keyValue: new Guid("39e66f81-efc6-446c-95bd-46bff6cfb606")); - - migrationBuilder.DeleteData( - table: "Features", - keyColumn: "Id", - keyValue: new Guid("52c9cf54-1eb2-44d2-81bb-524cf29c0a94")); - - migrationBuilder.DeleteData( - table: "Features", - keyColumn: "Id", - keyValue: new Guid("53176ebf-c75d-42e5-839f-4508ffac3def")); - - migrationBuilder.DeleteData( - table: "Features", - keyColumn: "Id", - keyValue: new Guid("660131a4-788c-4739-a082-cbbf7879cbf2")); - - migrationBuilder.DeleteData( - table: "Features", - keyColumn: "Id", - keyValue: new Guid("81ab8a87-8ccd-4015-a917-0627cee6a100")); - - migrationBuilder.DeleteData( - table: "Features", - keyColumn: "Id", - keyValue: new Guid("9666de86-d7c7-4d3d-acaa-fcd6d6b81f3c")); - - migrationBuilder.DeleteData( - table: "Features", - keyColumn: "Id", - keyValue: new Guid("9d4b5489-2079-40b9-bd77-6e1bf90bc19f")); - - migrationBuilder.DeleteData( - table: "Features", - keyColumn: "Id", - keyValue: new Guid("be3b3afc-6ccf-4566-b9b6-aafcb65546be")); - - migrationBuilder.DropColumn( - name: "IsActive", - table: "Features"); - - migrationBuilder.DropColumn( - name: "Description", - table: "FeaturePermissions"); - - migrationBuilder.DropColumn( - name: "Name", - table: "FeaturePermissions"); - - migrationBuilder.RenameTable( - name: "FeaturePermissions", - newName: "FeaturePermission"); - - migrationBuilder.RenameColumn( - name: "ModuleId", - table: "Features", - newName: "TenantId"); - - migrationBuilder.RenameIndex( - name: "IX_Features_ModuleId", - table: "Features", - newName: "IX_Features_TenantId"); - - migrationBuilder.RenameIndex( - name: "IX_FeaturePermissions_FeatureId", - table: "FeaturePermission", - newName: "IX_FeaturePermission_FeatureId"); - - migrationBuilder.AddColumn( - name: "AllowCreate", - table: "FeaturePermission", - type: "tinyint(1)", - nullable: false, - defaultValue: false); - - migrationBuilder.AddColumn( - name: "AllowDelete", - table: "FeaturePermission", - type: "tinyint(1)", - nullable: false, - defaultValue: false); - - migrationBuilder.AddColumn( - name: "AllowModify", - table: "FeaturePermission", - type: "tinyint(1)", - nullable: false, - defaultValue: false); - - migrationBuilder.AddColumn( - name: "AllowView", - table: "FeaturePermission", - type: "tinyint(1)", - nullable: false, - defaultValue: false); - - migrationBuilder.AddColumn( - name: "TenantId", - table: "FeaturePermission", - type: "int", - nullable: false, - defaultValue: 0); - - migrationBuilder.AddPrimaryKey( - name: "PK_FeaturePermission", - table: "FeaturePermission", - column: "Id"); - - migrationBuilder.AddForeignKey( - name: "FK_FeaturePermission_Features_FeatureId", - table: "FeaturePermission", - column: "FeatureId", - principalTable: "Features", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); - - migrationBuilder.AddForeignKey( - name: "FK_Features_Tenants_TenantId", - table: "Features", - column: "TenantId", - principalTable: "Tenants", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); - } - } -} diff --git a/Marco.Pms.DataAccess/Migrations/20250205082324_featuremapping.Designer.cs b/Marco.Pms.DataAccess/Migrations/20250205082324_featuremapping.Designer.cs deleted file mode 100644 index 977bcbe..0000000 --- a/Marco.Pms.DataAccess/Migrations/20250205082324_featuremapping.Designer.cs +++ /dev/null @@ -1,1809 +0,0 @@ -// -using System; -using Marco.Pms.DataAccess.Data; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Metadata; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; - -#nullable disable - -namespace Marco.Pms.DataAccess.Migrations -{ - [DbContext(typeof(ApplicationDbContext))] - [Migration("20250205082324_featuremapping")] - partial class featuremapping - { - /// - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasAnnotation("ProductVersion", "8.0.12") - .HasAnnotation("Relational:MaxIdentifierLength", 64); - - // MySqlModelBuilderExtensions.AutoIncrementColumns(modelBuilder); - - modelBuilder.Entity("Marco.Pms.Model.Activities.TaskAllocation", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - - b.Property("AllocationDate") - .HasColumnType("datetime(6)"); - - b.Property("BuildingId") - .HasColumnType("int"); - - b.Property("EmployeeId") - .HasColumnType("int"); - - b.Property("EmployeeRole") - .HasColumnType("int"); - - b.Property("ProjectId") - .HasColumnType("int"); - - b.Property("ReAllocationDate") - .HasColumnType("datetime(6)"); - - b.Property("TenantId") - .HasColumnType("int"); - - b.Property("WorkAreaId") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("BuildingId"); - - b.HasIndex("EmployeeId"); - - b.HasIndex("ProjectId"); - - b.HasIndex("TenantId"); - - b.HasIndex("WorkAreaId"); - - b.ToTable("TaskAllocations"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Activities.WorkItem", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - - b.Property("ActivityId") - .HasColumnType("int"); - - b.Property("CompletedWork") - .HasColumnType("int"); - - b.Property("PlannedWork") - .HasColumnType("int"); - - b.Property("TaskDate") - .HasColumnType("datetime(6)"); - - b.Property("TenantId") - .HasColumnType("int"); - - b.Property("WorkAreaId") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("ActivityId"); - - b.HasIndex("TenantId"); - - b.HasIndex("WorkAreaId"); - - b.ToTable("WorkItems"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Activities.WorkItemMapping", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - - b.Property("TenantId") - .HasColumnType("int"); - - b.Property("WorkAreaId") - .HasColumnType("int"); - - b.Property("WorkItemId") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("TenantId"); - - b.HasIndex("WorkAreaId"); - - b.HasIndex("WorkItemId"); - - b.ToTable("WorkItemMapping"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Authentication.RefreshToken", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - - b.Property("CreatedAt") - .HasColumnType("datetime(6)"); - - b.Property("ExpiryDate") - .HasColumnType("datetime(6)"); - - b.Property("IsRevoked") - .HasColumnType("tinyint(1)"); - - b.Property("IsUsed") - .HasColumnType("tinyint(1)"); - - b.Property("RevokedAt") - .HasColumnType("datetime(6)"); - - b.Property("Token") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("UserId") - .IsRequired() - .HasColumnType("varchar(255)"); - - b.HasKey("Id"); - - b.HasIndex("UserId"); - - b.ToTable("RefreshTokens"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Employees.Attendance", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - - b.Property("ApprovedBy") - .HasColumnType("longtext"); - - b.Property("Comment") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("Date") - .HasColumnType("datetime(6)"); - - b.Property("EmployeeID") - .HasColumnType("int"); - - b.Property("InTimeID") - .HasColumnType("int"); - - b.Property("IsApproved") - .HasColumnType("tinyint(1)"); - - b.Property("OutTimeID") - .HasColumnType("int"); - - b.Property("TenantId") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("EmployeeID"); - - b.HasIndex("InTimeID"); - - b.HasIndex("OutTimeID"); - - b.HasIndex("TenantId"); - - b.ToTable("Attendances"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Employees.AttendanceLog", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - - b.Property("CheckTime") - .HasColumnType("datetime(6)"); - - b.Property("Comment") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("EmployeeID") - .HasColumnType("int"); - - b.Property("IsCheckIn") - .HasColumnType("tinyint(1)"); - - b.Property("Latitude") - .HasColumnType("longtext"); - - b.Property("Longitude") - .HasColumnType("longtext"); - - b.Property("Photo") - .HasColumnType("longblob"); - - b.Property("TenantId") - .HasColumnType("int"); - - b.Property("UpdatedBy") - .HasColumnType("longtext"); - - b.HasKey("Id"); - - b.HasIndex("EmployeeID"); - - b.HasIndex("TenantId"); - - b.ToTable("AttendanceLogs"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Employees.Employee", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - - b.Property("AadharNumber") - .HasColumnType("longtext"); - - b.Property("ApplicationUserId") - .HasColumnType("varchar(255)"); - - b.Property("BirthDate") - .HasColumnType("datetime(6)"); - - b.Property("CurrentAddress") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("Email") - .HasColumnType("longtext"); - - b.Property("EmergencyPhoneNumber") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("FirstName") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("Gender") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("LastName") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("MiddleName") - .HasColumnType("longtext"); - - b.Property("PanNumber") - .HasColumnType("longtext"); - - b.Property("PeramnentAddress") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("PhoneNumber") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("Photo") - .HasColumnType("longblob"); - - b.Property("RoleId") - .HasColumnType("char(36)"); - - b.Property("TenantId") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("ApplicationUserId"); - - b.HasIndex("RoleId"); - - b.HasIndex("TenantId"); - - b.ToTable("Employees"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Employees.WorkShift", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - - b.Property("EndTime") - .HasColumnType("time(6)"); - - b.Property("Name") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("StartTime") - .HasColumnType("time(6)"); - - b.Property("TenantId") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("TenantId"); - - b.ToTable("WorkShifts"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Entitlements.ActivityMaster", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - - b.Property("ActivityName") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("TaskAllocationId") - .HasColumnType("int"); - - b.Property("TenantId") - .HasColumnType("int"); - - b.Property("UnitOfMeasurement") - .IsRequired() - .HasColumnType("longtext"); - - b.HasKey("Id"); - - b.HasIndex("TaskAllocationId"); - - b.HasIndex("TenantId"); - - b.ToTable("ActivityMasters"); - - b.HasData( - new - { - Id = 1, - ActivityName = "Core Cutting", - TenantId = 1, - UnitOfMeasurement = "Number" - }, - new - { - Id = 2, - ActivityName = "Fabrication", - TenantId = 1, - UnitOfMeasurement = "Meter" - }, - new - { - Id = 3, - ActivityName = "Lifting", - TenantId = 1, - UnitOfMeasurement = "Meter" - }, - new - { - Id = 4, - ActivityName = "Hanging", - TenantId = 1, - UnitOfMeasurement = "Meter" - }, - new - { - Id = 5, - ActivityName = "Tapping", - TenantId = 1, - UnitOfMeasurement = "Meter" - }, - new - { - Id = 6, - ActivityName = "Welding", - TenantId = 1, - UnitOfMeasurement = "Meter" - }, - new - { - Id = 7, - ActivityName = "Testing", - TenantId = 1, - UnitOfMeasurement = "Area" - }, - new - { - Id = 8, - ActivityName = "Painting", - TenantId = 1, - UnitOfMeasurement = "Meter" - }, - new - { - Id = 9, - ActivityName = "Marking Area", - TenantId = 1, - UnitOfMeasurement = "Meter" - }, - new - { - Id = 10, - ActivityName = "Drilling", - TenantId = 1, - UnitOfMeasurement = "Number" - }, - new - { - Id = 11, - ActivityName = "MS Support Fabrication", - TenantId = 1, - UnitOfMeasurement = "Number" - }, - new - { - Id = 12, - ActivityName = "MS Support Hanging", - TenantId = 1, - UnitOfMeasurement = "Number" - }, - new - { - Id = 13, - ActivityName = "Hydrant Volve", - TenantId = 1, - UnitOfMeasurement = "Number" - }, - new - { - Id = 14, - ActivityName = "Sprinkler Installation", - TenantId = 1, - UnitOfMeasurement = "Number" - }); - }); - - modelBuilder.Entity("Marco.Pms.Model.Entitlements.EmployeeRole", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("char(36)"); - - b.Property("Description") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("Role") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("TenantId") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("TenantId"); - - b.ToTable("EmployeeRoles"); - - b.HasData( - new - { - Id = new Guid("2c8d0808-c421-11ef-9b93-0242ac110002"), - Description = "", - Role = "Admin", - TenantId = 1 - }, - new - { - Id = new Guid("62e0918d-c421-11ef-9b93-0242ac110002"), - Description = "", - Role = "Welder", - TenantId = 1 - }, - new - { - Id = new Guid("68823f1f-c421-11ef-9b93-0242ac110002"), - Description = "", - Role = "Helper", - TenantId = 1 - }, - new - { - Id = new Guid("6d3a7c72-c421-11ef-9b93-0242ac110002"), - Description = "", - Role = "Site Engineer", - TenantId = 1 - }, - new - { - Id = new Guid("6d3aad72-c421-11ef-9b93-0242ac110002"), - Description = "", - Role = "Project Manager", - TenantId = 1 - }); - }); - - modelBuilder.Entity("Marco.Pms.Model.Entitlements.Feature", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("char(36)"); - - b.Property("Description") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("EmployeeRoleId") - .HasColumnType("char(36)"); - - b.Property("IsActive") - .HasColumnType("tinyint(1)"); - - b.Property("ModuleId") - .HasColumnType("int"); - - b.Property("Name") - .IsRequired() - .HasColumnType("longtext"); - - b.HasKey("Id"); - - b.HasIndex("EmployeeRoleId"); - - b.HasIndex("ModuleId"); - - b.ToTable("Features"); - - b.HasData( - new - { - Id = new Guid("53176ebf-c75d-42e5-839f-4508ffac3def"), - Description = "Manage Project", - IsActive = true, - ModuleId = 1, - Name = "Manage Project" - }, - new - { - Id = new Guid("9666de86-d7c7-4d3d-acaa-fcd6d6b81f3c"), - Description = "Manage Infra", - IsActive = true, - ModuleId = 1, - Name = "Manage Infra" - }, - new - { - Id = new Guid("9d4b5489-2079-40b9-bd77-6e1bf90bc19f"), - Description = "Manage Tasks", - IsActive = true, - ModuleId = 1, - Name = "Manage Tasks" - }, - new - { - Id = new Guid("39e66f81-efc6-446c-95bd-46bff6cfb606"), - Description = "Assign and Update Tasks Progress", - IsActive = true, - ModuleId = 1, - Name = "Assign and Update Tasks Progress" - }, - new - { - Id = new Guid("81ab8a87-8ccd-4015-a917-0627cee6a100"), - Description = "Manage Employee", - IsActive = true, - ModuleId = 2, - Name = "Manage Employee" - }, - new - { - Id = new Guid("52c9cf54-1eb2-44d2-81bb-524cf29c0a94"), - Description = "Attendance", - IsActive = true, - ModuleId = 2, - Name = "Attendance" - }, - new - { - Id = new Guid("be3b3afc-6ccf-4566-b9b6-aafcb65546be"), - Description = "Global Masters", - IsActive = true, - ModuleId = 3, - Name = "Global Masters" - }, - new - { - Id = new Guid("660131a4-788c-4739-a082-cbbf7879cbf2"), - Description = "Tenant Masters", - IsActive = true, - ModuleId = 3, - Name = "Tenant Masters" - }); - }); - - modelBuilder.Entity("Marco.Pms.Model.Entitlements.FeaturePermission", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("char(36)"); - - b.Property("Description") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("FeatureId") - .HasColumnType("char(36)"); - - b.Property("IsEnabled") - .HasColumnType("tinyint(1)"); - - b.Property("Name") - .IsRequired() - .HasColumnType("longtext"); - - b.HasKey("Id"); - - b.HasIndex("FeatureId"); - - b.ToTable("FeaturePermissions"); - - b.HasData( - new - { - Id = new Guid("6ea44136-987e-44ba-9e5d-1cf8f5837ebc"), - Description = "", - FeatureId = new Guid("53176ebf-c75d-42e5-839f-4508ffac3def"), - IsEnabled = true, - Name = "View Project" - }, - new - { - Id = new Guid("172fc9b6-755b-4f62-ab26-55c34a330614"), - Description = "", - FeatureId = new Guid("53176ebf-c75d-42e5-839f-4508ffac3def"), - IsEnabled = true, - Name = "Manage Project" - }, - new - { - Id = new Guid("b94802ce-0689-4643-9e1d-11c86950c35b"), - Description = "", - FeatureId = new Guid("53176ebf-c75d-42e5-839f-4508ffac3def"), - IsEnabled = true, - Name = "Manage Team" - }, - new - { - Id = new Guid("c7b68e33-72f0-474f-bd96-77636427ecc8"), - Description = "", - FeatureId = new Guid("9666de86-d7c7-4d3d-acaa-fcd6d6b81f3c"), - IsEnabled = true, - Name = "View Project Infra" - }, - new - { - Id = new Guid("f2aee20a-b754-4537-8166-f9507b44585b"), - Description = "", - FeatureId = new Guid("9666de86-d7c7-4d3d-acaa-fcd6d6b81f3c"), - IsEnabled = true, - Name = "Manage Project Infra" - }, - new - { - Id = new Guid("9fcc5f87-25e3-4846-90ac-67a71ab92e3c"), - Description = "", - FeatureId = new Guid("9d4b5489-2079-40b9-bd77-6e1bf90bc19f"), - IsEnabled = true, - Name = "View Task" - }, - new - { - Id = new Guid("08752f33-3b29-4816-b76b-ea8a968ed3c5"), - Description = "", - FeatureId = new Guid("9d4b5489-2079-40b9-bd77-6e1bf90bc19f"), - IsEnabled = true, - Name = "Manage Task" - }, - new - { - Id = new Guid("d135a4b0-4f9a-4903-ab9c-4843839ebdee"), - Description = "", - FeatureId = new Guid("81ab8a87-8ccd-4015-a917-0627cee6a100"), - IsEnabled = true, - Name = "Assign Task and Report Progress" - }, - new - { - Id = new Guid("ed99ecd4-1bed-42e1-b7b3-d64c04493823"), - Description = "", - FeatureId = new Guid("81ab8a87-8ccd-4015-a917-0627cee6a100"), - IsEnabled = true, - Name = "Approve Task" - }, - new - { - Id = new Guid("b82d2b7e-0d52-45f3-997b-c008ea460e7f"), - Description = "", - FeatureId = new Guid("81ab8a87-8ccd-4015-a917-0627cee6a100"), - IsEnabled = true, - Name = "View Employee" - }, - new - { - Id = new Guid("a97d366a-c2bb-448d-be93-402bd2324566"), - Description = "", - FeatureId = new Guid("81ab8a87-8ccd-4015-a917-0627cee6a100"), - IsEnabled = true, - Name = "Manage Employee" - }, - new - { - Id = new Guid("fbd213e0-0250-46f1-9f5f-4b2a1e6e76a3"), - Description = "", - FeatureId = new Guid("81ab8a87-8ccd-4015-a917-0627cee6a100"), - IsEnabled = true, - Name = "Assign To Project" - }, - new - { - Id = new Guid("915e6bff-65f6-4e3f-aea8-3fd217d3ea9e"), - Description = "", - FeatureId = new Guid("52c9cf54-1eb2-44d2-81bb-524cf29c0a94"), - IsEnabled = true, - Name = "Perform Attendance " - }, - new - { - Id = new Guid("57802c4a-00aa-4a1f-a048-fd2f70dd44b6"), - Description = "", - FeatureId = new Guid("52c9cf54-1eb2-44d2-81bb-524cf29c0a94"), - IsEnabled = true, - Name = "Regularize Attendance" - }, - new - { - Id = new Guid("5ffbafe0-7ab0-48b1-bb50-c1bf76b65f9d"), - Description = "", - FeatureId = new Guid("be3b3afc-6ccf-4566-b9b6-aafcb65546be"), - IsEnabled = true, - Name = "View Masters" - }, - new - { - Id = new Guid("588a8824-f924-4955-82d8-fc51956cf323"), - Description = "", - FeatureId = new Guid("be3b3afc-6ccf-4566-b9b6-aafcb65546be"), - IsEnabled = true, - Name = "Manage Masters" - }, - new - { - Id = new Guid("cb8ec407-46d4-4467-930c-69127cda6dec"), - Description = "", - FeatureId = new Guid("660131a4-788c-4739-a082-cbbf7879cbf2"), - IsEnabled = true, - Name = "View Masters" - }, - new - { - Id = new Guid("6b1a6d97-a951-4de5-9b19-709bac7c4f18"), - Description = "", - FeatureId = new Guid("660131a4-788c-4739-a082-cbbf7879cbf2"), - IsEnabled = true, - Name = "Manage Masters" - }); - }); - - modelBuilder.Entity("Marco.Pms.Model.Entitlements.Module", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - - b.Property("Description") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("Key") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("Name") - .IsRequired() - .HasColumnType("longtext"); - - b.HasKey("Id"); - - b.ToTable("Modules"); - - b.HasData( - new - { - Id = 1, - Description = "Project Module", - Key = "73f5248b-c0d7-49de-a045-3617339c94cd", - Name = "Project" - }, - new - { - Id = 2, - Description = "Employee Module", - Key = "35fd0032-dfb1-44a4-931c-b9417ec406e7", - Name = "Employee" - }, - new - { - Id = 3, - Description = "Masters Module", - Key = "adccb225-5824-4b96-96f8-d28143c42475", - Name = "Masters" - }); - }); - - modelBuilder.Entity("Marco.Pms.Model.Entitlements.StatusMaster", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - - b.Property("Status") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("TenantId") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("TenantId"); - - b.ToTable("StatusMasters"); - - b.HasData( - new - { - Id = 1, - Status = "Active", - TenantId = 1 - }, - new - { - Id = 2, - Status = "In Progress", - TenantId = 1 - }, - new - { - Id = 3, - Status = "On Hold", - TenantId = 1 - }, - new - { - Id = 4, - Status = "Completed", - TenantId = 1 - }); - }); - - modelBuilder.Entity("Marco.Pms.Model.Entitlements.Tenant", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - - b.Property("ContactName") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("ContactNumber") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("Description") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("DomainName") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("Name") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("OnBoardingDate") - .HasColumnType("datetime(6)"); - - b.HasKey("Id"); - - b.ToTable("Tenants"); - - b.HasData( - new - { - Id = 1, - ContactName = "Admin", - ContactNumber = "123456789", - Description = "", - DomainName = "www.marcobms.org", - Name = "MarcoBMS", - OnBoardingDate = new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified) - }); - }); - - modelBuilder.Entity("Marco.Pms.Model.Projects.Building", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - - b.Property("Description") - .HasColumnType("longtext"); - - b.Property("Name") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("ProjectId") - .HasColumnType("int"); - - b.Property("TenantId") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("TenantId"); - - b.ToTable("Buildings"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Projects.Floor", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - - b.Property("BuildingId") - .HasColumnType("int"); - - b.Property("FloorName") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("TenantId") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("BuildingId"); - - b.HasIndex("TenantId"); - - b.ToTable("Floor"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Projects.Project", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - - b.Property("ContactPerson") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("EndDate") - .HasColumnType("datetime(6)"); - - b.Property("Name") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("ProjectAddress") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("ProjectStatusId") - .HasColumnType("int"); - - b.Property("StartDate") - .HasColumnType("datetime(6)"); - - b.Property("TenantId") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("ProjectStatusId"); - - b.HasIndex("TenantId"); - - b.ToTable("Projects"); - - b.HasData( - new - { - Id = 1, - ContactPerson = "Project 1 Contact Person", - Name = "Project 1", - ProjectAddress = "Project 1 Address", - ProjectStatusId = 1, - TenantId = 1 - }, - new - { - Id = 2, - ContactPerson = "Project 2 Contact Person", - Name = "Project 2", - ProjectAddress = "Project 2 Address", - ProjectStatusId = 2, - TenantId = 1 - }, - new - { - Id = 3, - ContactPerson = "Project 3 Contact Person", - Name = "Project 3", - ProjectAddress = "Project 3 Address", - ProjectStatusId = 3, - TenantId = 1 - }); - }); - - modelBuilder.Entity("Marco.Pms.Model.Projects.ProjectAllocation", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - - b.Property("AllocationDate") - .HasColumnType("datetime(6)"); - - b.Property("EmployeeId") - .HasColumnType("int"); - - b.Property("EmployeeRoleId") - .HasColumnType("char(36)"); - - b.Property("ProjectId") - .HasColumnType("int"); - - b.Property("ReAllocationDate") - .HasColumnType("datetime(6)"); - - b.Property("TenantId") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("EmployeeId"); - - b.HasIndex("ProjectId"); - - b.HasIndex("TenantId"); - - b.ToTable("ProjectAllocations"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Projects.WorkArea", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - - b.Property("AreaName") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("FloorId") - .HasColumnType("int"); - - b.Property("TenantId") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("FloorId"); - - b.HasIndex("TenantId"); - - b.ToTable("WorkAreas"); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRole", b => - { - b.Property("Id") - .HasColumnType("varchar(255)"); - - b.Property("ConcurrencyStamp") - .IsConcurrencyToken() - .HasColumnType("longtext"); - - b.Property("Name") - .HasMaxLength(256) - .HasColumnType("varchar(256)"); - - b.Property("NormalizedName") - .HasMaxLength(256) - .HasColumnType("varchar(256)"); - - b.HasKey("Id"); - - b.HasIndex("NormalizedName") - .IsUnique() - .HasDatabaseName("RoleNameIndex"); - - b.ToTable("AspNetRoles", (string)null); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - - b.Property("ClaimType") - .HasColumnType("longtext"); - - b.Property("ClaimValue") - .HasColumnType("longtext"); - - b.Property("RoleId") - .IsRequired() - .HasColumnType("varchar(255)"); - - b.HasKey("Id"); - - b.HasIndex("RoleId"); - - b.ToTable("AspNetRoleClaims", (string)null); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUser", b => - { - b.Property("Id") - .HasColumnType("varchar(255)"); - - b.Property("AccessFailedCount") - .HasColumnType("int"); - - b.Property("ConcurrencyStamp") - .IsConcurrencyToken() - .HasColumnType("longtext"); - - b.Property("Discriminator") - .IsRequired() - .HasMaxLength(21) - .HasColumnType("varchar(21)"); - - b.Property("Email") - .HasMaxLength(256) - .HasColumnType("varchar(256)"); - - b.Property("EmailConfirmed") - .HasColumnType("tinyint(1)"); - - b.Property("LockoutEnabled") - .HasColumnType("tinyint(1)"); - - b.Property("LockoutEnd") - .HasColumnType("datetime(6)"); - - b.Property("NormalizedEmail") - .HasMaxLength(256) - .HasColumnType("varchar(256)"); - - b.Property("NormalizedUserName") - .HasMaxLength(256) - .HasColumnType("varchar(256)"); - - b.Property("PasswordHash") - .HasColumnType("longtext"); - - b.Property("PhoneNumber") - .HasColumnType("longtext"); - - b.Property("PhoneNumberConfirmed") - .HasColumnType("tinyint(1)"); - - b.Property("SecurityStamp") - .HasColumnType("longtext"); - - b.Property("TwoFactorEnabled") - .HasColumnType("tinyint(1)"); - - b.Property("UserName") - .HasMaxLength(256) - .HasColumnType("varchar(256)"); - - b.HasKey("Id"); - - b.HasIndex("NormalizedEmail") - .HasDatabaseName("EmailIndex"); - - b.HasIndex("NormalizedUserName") - .IsUnique() - .HasDatabaseName("UserNameIndex"); - - b.ToTable("AspNetUsers", (string)null); - - b.HasDiscriminator().HasValue("IdentityUser"); - - b.UseTphMappingStrategy(); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - - b.Property("ClaimType") - .HasColumnType("longtext"); - - b.Property("ClaimValue") - .HasColumnType("longtext"); - - b.Property("UserId") - .IsRequired() - .HasColumnType("varchar(255)"); - - b.HasKey("Id"); - - b.HasIndex("UserId"); - - b.ToTable("AspNetUserClaims", (string)null); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin", b => - { - b.Property("LoginProvider") - .HasColumnType("varchar(255)"); - - b.Property("ProviderKey") - .HasColumnType("varchar(255)"); - - b.Property("ProviderDisplayName") - .HasColumnType("longtext"); - - b.Property("UserId") - .IsRequired() - .HasColumnType("varchar(255)"); - - b.HasKey("LoginProvider", "ProviderKey"); - - b.HasIndex("UserId"); - - b.ToTable("AspNetUserLogins", (string)null); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole", b => - { - b.Property("UserId") - .HasColumnType("varchar(255)"); - - b.Property("RoleId") - .HasColumnType("varchar(255)"); - - b.HasKey("UserId", "RoleId"); - - b.HasIndex("RoleId"); - - b.ToTable("AspNetUserRoles", (string)null); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken", b => - { - b.Property("UserId") - .HasColumnType("varchar(255)"); - - b.Property("LoginProvider") - .HasColumnType("varchar(255)"); - - b.Property("Name") - .HasColumnType("varchar(255)"); - - b.Property("Value") - .HasColumnType("longtext"); - - b.HasKey("UserId", "LoginProvider", "Name"); - - b.ToTable("AspNetUserTokens", (string)null); - }); - - modelBuilder.Entity("Marco.Pms.Model.Entitlements.ApplicationUser", b => - { - b.HasBaseType("Microsoft.AspNetCore.Identity.IdentityUser"); - - b.Property("IsRootUser") - .HasColumnType("tinyint(1)"); - - b.Property("Role") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("TenantId") - .HasColumnType("int"); - - b.HasDiscriminator().HasValue("ApplicationUser"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Activities.TaskAllocation", b => - { - b.HasOne("Marco.Pms.Model.Projects.Building", "Building") - .WithMany() - .HasForeignKey("BuildingId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Marco.Pms.Model.Employees.Employee", "Employee") - .WithMany() - .HasForeignKey("EmployeeId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Marco.Pms.Model.Projects.Project", "Project") - .WithMany() - .HasForeignKey("ProjectId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Marco.Pms.Model.Entitlements.Tenant", "Tenant") - .WithMany() - .HasForeignKey("TenantId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Marco.Pms.Model.Projects.WorkArea", "WorkArea") - .WithMany() - .HasForeignKey("WorkAreaId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Building"); - - b.Navigation("Employee"); - - b.Navigation("Project"); - - b.Navigation("Tenant"); - - b.Navigation("WorkArea"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Activities.WorkItem", b => - { - b.HasOne("Marco.Pms.Model.Entitlements.ActivityMaster", "ActivityMaster") - .WithMany() - .HasForeignKey("ActivityId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Marco.Pms.Model.Entitlements.Tenant", "Tenant") - .WithMany() - .HasForeignKey("TenantId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Marco.Pms.Model.Projects.WorkArea", "WorkArea") - .WithMany() - .HasForeignKey("WorkAreaId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("ActivityMaster"); - - b.Navigation("Tenant"); - - b.Navigation("WorkArea"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Activities.WorkItemMapping", b => - { - b.HasOne("Marco.Pms.Model.Entitlements.Tenant", "Tenant") - .WithMany() - .HasForeignKey("TenantId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Marco.Pms.Model.Projects.WorkArea", "WorkArea") - .WithMany() - .HasForeignKey("WorkAreaId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Marco.Pms.Model.Activities.WorkItem", "WorkItem") - .WithMany() - .HasForeignKey("WorkItemId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Tenant"); - - b.Navigation("WorkArea"); - - b.Navigation("WorkItem"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Authentication.RefreshToken", b => - { - b.HasOne("Microsoft.AspNetCore.Identity.IdentityUser", "User") - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("User"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Employees.Attendance", b => - { - b.HasOne("Marco.Pms.Model.Employees.Employee", "Employee") - .WithMany() - .HasForeignKey("EmployeeID") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Marco.Pms.Model.Employees.AttendanceLog", "InTimeLog") - .WithMany() - .HasForeignKey("InTimeID"); - - b.HasOne("Marco.Pms.Model.Employees.AttendanceLog", "OutTimeLog") - .WithMany() - .HasForeignKey("OutTimeID"); - - b.HasOne("Marco.Pms.Model.Entitlements.Tenant", "Tenant") - .WithMany() - .HasForeignKey("TenantId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Employee"); - - b.Navigation("InTimeLog"); - - b.Navigation("OutTimeLog"); - - b.Navigation("Tenant"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Employees.AttendanceLog", b => - { - b.HasOne("Marco.Pms.Model.Employees.Employee", "Employee") - .WithMany() - .HasForeignKey("EmployeeID") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Marco.Pms.Model.Entitlements.Tenant", "Tenant") - .WithMany() - .HasForeignKey("TenantId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Employee"); - - b.Navigation("Tenant"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Employees.Employee", b => - { - b.HasOne("Marco.Pms.Model.Entitlements.ApplicationUser", "ApplicationUser") - .WithMany() - .HasForeignKey("ApplicationUserId"); - - b.HasOne("Marco.Pms.Model.Entitlements.EmployeeRole", "EmployeeRole") - .WithMany() - .HasForeignKey("RoleId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Marco.Pms.Model.Entitlements.Tenant", "Tenant") - .WithMany() - .HasForeignKey("TenantId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("ApplicationUser"); - - b.Navigation("EmployeeRole"); - - b.Navigation("Tenant"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Employees.WorkShift", b => - { - b.HasOne("Marco.Pms.Model.Entitlements.Tenant", "Tenant") - .WithMany() - .HasForeignKey("TenantId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Tenant"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Entitlements.ActivityMaster", b => - { - b.HasOne("Marco.Pms.Model.Activities.TaskAllocation", null) - .WithMany("AllotedTask") - .HasForeignKey("TaskAllocationId"); - - b.HasOne("Marco.Pms.Model.Entitlements.Tenant", "Tenant") - .WithMany() - .HasForeignKey("TenantId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Tenant"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Entitlements.EmployeeRole", b => - { - b.HasOne("Marco.Pms.Model.Entitlements.Tenant", "Tenant") - .WithMany() - .HasForeignKey("TenantId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Tenant"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Entitlements.Feature", b => - { - b.HasOne("Marco.Pms.Model.Entitlements.EmployeeRole", null) - .WithMany("Features") - .HasForeignKey("EmployeeRoleId"); - - b.HasOne("Marco.Pms.Model.Entitlements.Module", "Module") - .WithMany() - .HasForeignKey("ModuleId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Module"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Entitlements.FeaturePermission", b => - { - b.HasOne("Marco.Pms.Model.Entitlements.Feature", "Feature") - .WithMany("FeaturePermissions") - .HasForeignKey("FeatureId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Feature"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Entitlements.StatusMaster", b => - { - b.HasOne("Marco.Pms.Model.Entitlements.Tenant", "Tenant") - .WithMany() - .HasForeignKey("TenantId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Tenant"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Projects.Building", b => - { - b.HasOne("Marco.Pms.Model.Entitlements.Tenant", "Tenant") - .WithMany() - .HasForeignKey("TenantId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Tenant"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Projects.Floor", b => - { - b.HasOne("Marco.Pms.Model.Projects.Building", "Building") - .WithMany() - .HasForeignKey("BuildingId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Marco.Pms.Model.Entitlements.Tenant", "Tenant") - .WithMany() - .HasForeignKey("TenantId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Building"); - - b.Navigation("Tenant"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Projects.Project", b => - { - b.HasOne("Marco.Pms.Model.Entitlements.StatusMaster", "ProjectStatus") - .WithMany() - .HasForeignKey("ProjectStatusId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Marco.Pms.Model.Entitlements.Tenant", "Tenant") - .WithMany() - .HasForeignKey("TenantId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("ProjectStatus"); - - b.Navigation("Tenant"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Projects.ProjectAllocation", b => - { - b.HasOne("Marco.Pms.Model.Employees.Employee", "Employee") - .WithMany() - .HasForeignKey("EmployeeId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Marco.Pms.Model.Projects.Project", "Project") - .WithMany() - .HasForeignKey("ProjectId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Marco.Pms.Model.Entitlements.Tenant", "Tenant") - .WithMany() - .HasForeignKey("TenantId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Employee"); - - b.Navigation("Project"); - - b.Navigation("Tenant"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Projects.WorkArea", b => - { - b.HasOne("Marco.Pms.Model.Projects.Floor", "Floor") - .WithMany() - .HasForeignKey("FloorId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Marco.Pms.Model.Entitlements.Tenant", "Tenant") - .WithMany() - .HasForeignKey("TenantId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Floor"); - - b.Navigation("Tenant"); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim", b => - { - b.HasOne("Microsoft.AspNetCore.Identity.IdentityRole", null) - .WithMany() - .HasForeignKey("RoleId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim", b => - { - b.HasOne("Microsoft.AspNetCore.Identity.IdentityUser", null) - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin", b => - { - b.HasOne("Microsoft.AspNetCore.Identity.IdentityUser", null) - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole", b => - { - b.HasOne("Microsoft.AspNetCore.Identity.IdentityRole", null) - .WithMany() - .HasForeignKey("RoleId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Microsoft.AspNetCore.Identity.IdentityUser", null) - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken", b => - { - b.HasOne("Microsoft.AspNetCore.Identity.IdentityUser", null) - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Marco.Pms.Model.Activities.TaskAllocation", b => - { - b.Navigation("AllotedTask"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Entitlements.EmployeeRole", b => - { - b.Navigation("Features"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Entitlements.Feature", b => - { - b.Navigation("FeaturePermissions"); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/Marco.Pms.DataAccess/Migrations/20250205082324_featuremapping.cs b/Marco.Pms.DataAccess/Migrations/20250205082324_featuremapping.cs deleted file mode 100644 index 77b5c96..0000000 --- a/Marco.Pms.DataAccess/Migrations/20250205082324_featuremapping.cs +++ /dev/null @@ -1,60 +0,0 @@ -using Microsoft.EntityFrameworkCore.Migrations; - -#nullable disable - -namespace Marco.Pms.DataAccess.Migrations -{ - /// - public partial class featuremapping : Migration - { - /// - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.UpdateData( - table: "Modules", - keyColumn: "Id", - keyValue: 1, - column: "Key", - value: "73f5248b-c0d7-49de-a045-3617339c94cd"); - - migrationBuilder.UpdateData( - table: "Modules", - keyColumn: "Id", - keyValue: 2, - column: "Key", - value: "35fd0032-dfb1-44a4-931c-b9417ec406e7"); - - migrationBuilder.UpdateData( - table: "Modules", - keyColumn: "Id", - keyValue: 3, - column: "Key", - value: "adccb225-5824-4b96-96f8-d28143c42475"); - } - - /// - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.UpdateData( - table: "Modules", - keyColumn: "Id", - keyValue: 1, - column: "Key", - value: "9a7ed07c-f7dd-4831-bf64-d5278fa9e38c"); - - migrationBuilder.UpdateData( - table: "Modules", - keyColumn: "Id", - keyValue: 2, - column: "Key", - value: "a9fb08bf-7dae-4282-9b02-f63d94d7a9dc"); - - migrationBuilder.UpdateData( - table: "Modules", - keyColumn: "Id", - keyValue: 3, - column: "Key", - value: "e6423995-d7bf-452e-8bcc-780a655b015c"); - } - } -} diff --git a/Marco.Pms.DataAccess/Migrations/20250206083015_NoNavigationMigration.Designer.cs b/Marco.Pms.DataAccess/Migrations/20250206083015_NoNavigationMigration.Designer.cs deleted file mode 100644 index 97e6337..0000000 --- a/Marco.Pms.DataAccess/Migrations/20250206083015_NoNavigationMigration.Designer.cs +++ /dev/null @@ -1,1716 +0,0 @@ -// -using System; -using Marco.Pms.DataAccess.Data; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Metadata; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; - -#nullable disable - -namespace Marco.Pms.DataAccess.Migrations -{ - [DbContext(typeof(ApplicationDbContext))] - [Migration("20250206083015_NoNavigationMigration")] - partial class NoNavigationMigration - { - /// - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasAnnotation("ProductVersion", "8.0.12") - .HasAnnotation("Relational:MaxIdentifierLength", 64); - - //MySqlModelBuilderExtensions.AutoIncrementColumns(modelBuilder); - - modelBuilder.Entity("Marco.Pms.Model.Activities.TaskAllocation", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - - b.Property("AllocationDate") - .HasColumnType("datetime(6)"); - - b.Property("BuildingId") - .HasColumnType("int"); - - b.Property("EmployeeId") - .HasColumnType("int"); - - b.Property("EmployeeRole") - .HasColumnType("int"); - - b.Property("ProjectId") - .HasColumnType("int"); - - b.Property("ReAllocationDate") - .HasColumnType("datetime(6)"); - - b.Property("TenantId") - .HasColumnType("int"); - - b.Property("WorkAreaId") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("BuildingId"); - - b.HasIndex("EmployeeId"); - - b.HasIndex("ProjectId"); - - b.HasIndex("TenantId"); - - b.HasIndex("WorkAreaId"); - - b.ToTable("TaskAllocations"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Activities.WorkItem", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - - b.Property("ActivityId") - .HasColumnType("int"); - - b.Property("CompletedWork") - .HasColumnType("int"); - - b.Property("PlannedWork") - .HasColumnType("int"); - - b.Property("TaskDate") - .HasColumnType("datetime(6)"); - - b.Property("TenantId") - .HasColumnType("int"); - - b.Property("WorkAreaId") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("ActivityId"); - - b.HasIndex("TenantId"); - - b.HasIndex("WorkAreaId"); - - b.ToTable("WorkItems"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Activities.WorkItemMapping", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - - b.Property("TenantId") - .HasColumnType("int"); - - b.Property("WorkAreaId") - .HasColumnType("int"); - - b.Property("WorkItemId") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("TenantId"); - - b.HasIndex("WorkAreaId"); - - b.HasIndex("WorkItemId"); - - b.ToTable("WorkItemMapping"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Authentication.RefreshToken", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - - b.Property("CreatedAt") - .HasColumnType("datetime(6)"); - - b.Property("ExpiryDate") - .HasColumnType("datetime(6)"); - - b.Property("IsRevoked") - .HasColumnType("tinyint(1)"); - - b.Property("IsUsed") - .HasColumnType("tinyint(1)"); - - b.Property("RevokedAt") - .HasColumnType("datetime(6)"); - - b.Property("Token") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("UserId") - .IsRequired() - .HasColumnType("varchar(255)"); - - b.HasKey("Id"); - - b.HasIndex("UserId"); - - b.ToTable("RefreshTokens"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Employees.Attendance", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - - b.Property("ApprovedBy") - .HasColumnType("longtext"); - - b.Property("Comment") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("Date") - .HasColumnType("datetime(6)"); - - b.Property("EmployeeID") - .HasColumnType("int"); - - b.Property("InTimeID") - .HasColumnType("int"); - - b.Property("IsApproved") - .HasColumnType("tinyint(1)"); - - b.Property("OutTimeID") - .HasColumnType("int"); - - b.Property("TenantId") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("EmployeeID"); - - b.HasIndex("InTimeID"); - - b.HasIndex("OutTimeID"); - - b.HasIndex("TenantId"); - - b.ToTable("Attendances"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Employees.AttendanceLog", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - - b.Property("CheckTime") - .HasColumnType("datetime(6)"); - - b.Property("Comment") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("EmployeeID") - .HasColumnType("int"); - - b.Property("IsCheckIn") - .HasColumnType("tinyint(1)"); - - b.Property("Latitude") - .HasColumnType("longtext"); - - b.Property("Longitude") - .HasColumnType("longtext"); - - b.Property("Photo") - .HasColumnType("longblob"); - - b.Property("TenantId") - .HasColumnType("int"); - - b.Property("UpdatedBy") - .HasColumnType("longtext"); - - b.HasKey("Id"); - - b.HasIndex("EmployeeID"); - - b.HasIndex("TenantId"); - - b.ToTable("AttendanceLogs"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Employees.Employee", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - - b.Property("AadharNumber") - .HasColumnType("longtext"); - - b.Property("ApplicationUserId") - .HasColumnType("varchar(255)"); - - b.Property("BirthDate") - .HasColumnType("datetime(6)"); - - b.Property("CurrentAddress") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("Email") - .HasColumnType("longtext"); - - b.Property("EmergencyPhoneNumber") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("FirstName") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("Gender") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("LastName") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("MiddleName") - .HasColumnType("longtext"); - - b.Property("PanNumber") - .HasColumnType("longtext"); - - b.Property("PeramnentAddress") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("PhoneNumber") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("Photo") - .HasColumnType("longblob"); - - b.Property("RoleId") - .HasColumnType("char(36)"); - - b.Property("TenantId") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("ApplicationUserId"); - - b.HasIndex("TenantId"); - - b.ToTable("Employees"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Employees.WorkShift", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - - b.Property("EndTime") - .HasColumnType("time(6)"); - - b.Property("Name") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("StartTime") - .HasColumnType("time(6)"); - - b.Property("TenantId") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("TenantId"); - - b.ToTable("WorkShifts"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Entitlements.ActivityMaster", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - - b.Property("ActivityName") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("TaskAllocationId") - .HasColumnType("int"); - - b.Property("TenantId") - .HasColumnType("int"); - - b.Property("UnitOfMeasurement") - .IsRequired() - .HasColumnType("longtext"); - - b.HasKey("Id"); - - b.HasIndex("TaskAllocationId"); - - b.HasIndex("TenantId"); - - b.ToTable("ActivityMasters"); - - b.HasData( - new - { - Id = 1, - ActivityName = "Core Cutting", - TenantId = 1, - UnitOfMeasurement = "Number" - }, - new - { - Id = 2, - ActivityName = "Fabrication", - TenantId = 1, - UnitOfMeasurement = "Meter" - }, - new - { - Id = 3, - ActivityName = "Lifting", - TenantId = 1, - UnitOfMeasurement = "Meter" - }, - new - { - Id = 4, - ActivityName = "Hanging", - TenantId = 1, - UnitOfMeasurement = "Meter" - }, - new - { - Id = 5, - ActivityName = "Tapping", - TenantId = 1, - UnitOfMeasurement = "Meter" - }, - new - { - Id = 6, - ActivityName = "Welding", - TenantId = 1, - UnitOfMeasurement = "Meter" - }, - new - { - Id = 7, - ActivityName = "Testing", - TenantId = 1, - UnitOfMeasurement = "Area" - }, - new - { - Id = 8, - ActivityName = "Painting", - TenantId = 1, - UnitOfMeasurement = "Meter" - }, - new - { - Id = 9, - ActivityName = "Marking Area", - TenantId = 1, - UnitOfMeasurement = "Meter" - }, - new - { - Id = 10, - ActivityName = "Drilling", - TenantId = 1, - UnitOfMeasurement = "Number" - }, - new - { - Id = 11, - ActivityName = "MS Support Fabrication", - TenantId = 1, - UnitOfMeasurement = "Number" - }, - new - { - Id = 12, - ActivityName = "MS Support Hanging", - TenantId = 1, - UnitOfMeasurement = "Number" - }, - new - { - Id = 13, - ActivityName = "Hydrant Volve", - TenantId = 1, - UnitOfMeasurement = "Number" - }, - new - { - Id = 14, - ActivityName = "Sprinkler Installation", - TenantId = 1, - UnitOfMeasurement = "Number" - }); - }); - - modelBuilder.Entity("Marco.Pms.Model.Entitlements.Feature", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("char(36)"); - - b.Property("Description") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("IsActive") - .HasColumnType("tinyint(1)"); - - b.Property("ModuleId") - .HasColumnType("int"); - - b.Property("Name") - .IsRequired() - .HasColumnType("longtext"); - - b.HasKey("Id"); - - b.HasIndex("ModuleId"); - - b.ToTable("Features"); - - b.HasData( - new - { - Id = new Guid("53176ebf-c75d-42e5-839f-4508ffac3def"), - Description = "Manage Project", - IsActive = true, - ModuleId = 1, - Name = "Manage Project" - }, - new - { - Id = new Guid("9666de86-d7c7-4d3d-acaa-fcd6d6b81f3c"), - Description = "Manage Infra", - IsActive = true, - ModuleId = 1, - Name = "Manage Infra" - }, - new - { - Id = new Guid("9d4b5489-2079-40b9-bd77-6e1bf90bc19f"), - Description = "Manage Tasks", - IsActive = true, - ModuleId = 1, - Name = "Manage Tasks" - }, - new - { - Id = new Guid("39e66f81-efc6-446c-95bd-46bff6cfb606"), - Description = "Assign and Update Tasks Progress", - IsActive = true, - ModuleId = 1, - Name = "Assign and Update Tasks Progress" - }, - new - { - Id = new Guid("81ab8a87-8ccd-4015-a917-0627cee6a100"), - Description = "Manage Employee", - IsActive = true, - ModuleId = 2, - Name = "Manage Employee" - }, - new - { - Id = new Guid("52c9cf54-1eb2-44d2-81bb-524cf29c0a94"), - Description = "Attendance", - IsActive = true, - ModuleId = 2, - Name = "Attendance" - }, - new - { - Id = new Guid("be3b3afc-6ccf-4566-b9b6-aafcb65546be"), - Description = "Global Masters", - IsActive = true, - ModuleId = 3, - Name = "Global Masters" - }, - new - { - Id = new Guid("660131a4-788c-4739-a082-cbbf7879cbf2"), - Description = "Tenant Masters", - IsActive = true, - ModuleId = 3, - Name = "Tenant Masters" - }); - }); - - modelBuilder.Entity("Marco.Pms.Model.Entitlements.FeaturePermission", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("char(36)"); - - b.Property("Description") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("FeatureId") - .HasColumnType("char(36)"); - - b.Property("IsEnabled") - .HasColumnType("tinyint(1)"); - - b.Property("Name") - .IsRequired() - .HasColumnType("longtext"); - - b.HasKey("Id"); - - b.HasIndex("FeatureId"); - - b.ToTable("FeaturePermissions"); - - b.HasData( - new - { - Id = new Guid("6ea44136-987e-44ba-9e5d-1cf8f5837ebc"), - Description = "", - FeatureId = new Guid("53176ebf-c75d-42e5-839f-4508ffac3def"), - IsEnabled = true, - Name = "View Project" - }, - new - { - Id = new Guid("172fc9b6-755b-4f62-ab26-55c34a330614"), - Description = "", - FeatureId = new Guid("53176ebf-c75d-42e5-839f-4508ffac3def"), - IsEnabled = true, - Name = "Manage Project" - }, - new - { - Id = new Guid("b94802ce-0689-4643-9e1d-11c86950c35b"), - Description = "", - FeatureId = new Guid("53176ebf-c75d-42e5-839f-4508ffac3def"), - IsEnabled = true, - Name = "Manage Team" - }, - new - { - Id = new Guid("c7b68e33-72f0-474f-bd96-77636427ecc8"), - Description = "", - FeatureId = new Guid("9666de86-d7c7-4d3d-acaa-fcd6d6b81f3c"), - IsEnabled = true, - Name = "View Project Infra" - }, - new - { - Id = new Guid("f2aee20a-b754-4537-8166-f9507b44585b"), - Description = "", - FeatureId = new Guid("9666de86-d7c7-4d3d-acaa-fcd6d6b81f3c"), - IsEnabled = true, - Name = "Manage Project Infra" - }, - new - { - Id = new Guid("9fcc5f87-25e3-4846-90ac-67a71ab92e3c"), - Description = "", - FeatureId = new Guid("9d4b5489-2079-40b9-bd77-6e1bf90bc19f"), - IsEnabled = true, - Name = "View Task" - }, - new - { - Id = new Guid("08752f33-3b29-4816-b76b-ea8a968ed3c5"), - Description = "", - FeatureId = new Guid("9d4b5489-2079-40b9-bd77-6e1bf90bc19f"), - IsEnabled = true, - Name = "Manage Task" - }, - new - { - Id = new Guid("d135a4b0-4f9a-4903-ab9c-4843839ebdee"), - Description = "", - FeatureId = new Guid("81ab8a87-8ccd-4015-a917-0627cee6a100"), - IsEnabled = true, - Name = "Assign Task and Report Progress" - }, - new - { - Id = new Guid("ed99ecd4-1bed-42e1-b7b3-d64c04493823"), - Description = "", - FeatureId = new Guid("81ab8a87-8ccd-4015-a917-0627cee6a100"), - IsEnabled = true, - Name = "Approve Task" - }, - new - { - Id = new Guid("b82d2b7e-0d52-45f3-997b-c008ea460e7f"), - Description = "", - FeatureId = new Guid("81ab8a87-8ccd-4015-a917-0627cee6a100"), - IsEnabled = true, - Name = "View Employee" - }, - new - { - Id = new Guid("a97d366a-c2bb-448d-be93-402bd2324566"), - Description = "", - FeatureId = new Guid("81ab8a87-8ccd-4015-a917-0627cee6a100"), - IsEnabled = true, - Name = "Manage Employee" - }, - new - { - Id = new Guid("fbd213e0-0250-46f1-9f5f-4b2a1e6e76a3"), - Description = "", - FeatureId = new Guid("81ab8a87-8ccd-4015-a917-0627cee6a100"), - IsEnabled = true, - Name = "Assign To Project" - }, - new - { - Id = new Guid("915e6bff-65f6-4e3f-aea8-3fd217d3ea9e"), - Description = "", - FeatureId = new Guid("52c9cf54-1eb2-44d2-81bb-524cf29c0a94"), - IsEnabled = true, - Name = "Perform Attendance " - }, - new - { - Id = new Guid("57802c4a-00aa-4a1f-a048-fd2f70dd44b6"), - Description = "", - FeatureId = new Guid("52c9cf54-1eb2-44d2-81bb-524cf29c0a94"), - IsEnabled = true, - Name = "Regularize Attendance" - }, - new - { - Id = new Guid("5ffbafe0-7ab0-48b1-bb50-c1bf76b65f9d"), - Description = "", - FeatureId = new Guid("be3b3afc-6ccf-4566-b9b6-aafcb65546be"), - IsEnabled = true, - Name = "View Masters" - }, - new - { - Id = new Guid("588a8824-f924-4955-82d8-fc51956cf323"), - Description = "", - FeatureId = new Guid("be3b3afc-6ccf-4566-b9b6-aafcb65546be"), - IsEnabled = true, - Name = "Manage Masters" - }, - new - { - Id = new Guid("cb8ec407-46d4-4467-930c-69127cda6dec"), - Description = "", - FeatureId = new Guid("660131a4-788c-4739-a082-cbbf7879cbf2"), - IsEnabled = true, - Name = "View Masters" - }, - new - { - Id = new Guid("6b1a6d97-a951-4de5-9b19-709bac7c4f18"), - Description = "", - FeatureId = new Guid("660131a4-788c-4739-a082-cbbf7879cbf2"), - IsEnabled = true, - Name = "Manage Masters" - }); - }); - - modelBuilder.Entity("Marco.Pms.Model.Entitlements.Module", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - - b.Property("Description") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("Key") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("Name") - .IsRequired() - .HasColumnType("longtext"); - - b.HasKey("Id"); - - b.ToTable("Modules"); - - b.HasData( - new - { - Id = 1, - Description = "Project Module", - Key = "b29e3352-d83f-42eb-9c57-6e2cbf1b7c9b", - Name = "Project" - }, - new - { - Id = 2, - Description = "Employee Module", - Key = "d522bcb3-6965-4c2f-be14-dd18b3181a34", - Name = "Employee" - }, - new - { - Id = 3, - Description = "Masters Module", - Key = "77302f42-93ec-49eb-9e05-80b80939639a", - Name = "Masters" - }); - }); - - - modelBuilder.Entity("Marco.Pms.Model.Entitlements.StatusMaster", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - - b.Property("Status") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("TenantId") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("TenantId"); - - b.ToTable("StatusMasters"); - - b.HasData( - new - { - Id = 1, - Status = "Active", - TenantId = 1 - }, - new - { - Id = 2, - Status = "In Progress", - TenantId = 1 - }, - new - { - Id = 3, - Status = "On Hold", - TenantId = 1 - }, - new - { - Id = 4, - Status = "Completed", - TenantId = 1 - }); - }); - - modelBuilder.Entity("Marco.Pms.Model.Entitlements.Tenant", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - - b.Property("ContactName") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("ContactNumber") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("Description") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("DomainName") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("Name") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("OnBoardingDate") - .HasColumnType("datetime(6)"); - - b.HasKey("Id"); - - b.ToTable("Tenants"); - - b.HasData( - new - { - Id = 1, - ContactName = "Admin", - ContactNumber = "123456789", - Description = "", - DomainName = "www.marcobms.org", - Name = "MarcoBMS", - OnBoardingDate = new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified) - }); - }); - - modelBuilder.Entity("Marco.Pms.Model.Projects.Building", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - - b.Property("Description") - .HasColumnType("longtext"); - - b.Property("Name") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("ProjectId") - .HasColumnType("int"); - - b.Property("TenantId") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("TenantId"); - - b.ToTable("Buildings"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Projects.Floor", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - - b.Property("BuildingId") - .HasColumnType("int"); - - b.Property("FloorName") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("TenantId") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("BuildingId"); - - b.HasIndex("TenantId"); - - b.ToTable("Floor"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Projects.Project", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - - b.Property("ContactPerson") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("EndDate") - .HasColumnType("datetime(6)"); - - b.Property("Name") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("ProjectAddress") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("ProjectStatusId") - .HasColumnType("int"); - - b.Property("StartDate") - .HasColumnType("datetime(6)"); - - b.Property("TenantId") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("ProjectStatusId"); - - b.HasIndex("TenantId"); - - b.ToTable("Projects"); - - b.HasData( - new - { - Id = 1, - ContactPerson = "Project 1 Contact Person", - Name = "Project 1", - ProjectAddress = "Project 1 Address", - ProjectStatusId = 1, - TenantId = 1 - }, - new - { - Id = 2, - ContactPerson = "Project 2 Contact Person", - Name = "Project 2", - ProjectAddress = "Project 2 Address", - ProjectStatusId = 2, - TenantId = 1 - }, - new - { - Id = 3, - ContactPerson = "Project 3 Contact Person", - Name = "Project 3", - ProjectAddress = "Project 3 Address", - ProjectStatusId = 3, - TenantId = 1 - }); - }); - - modelBuilder.Entity("Marco.Pms.Model.Projects.ProjectAllocation", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - - b.Property("AllocationDate") - .HasColumnType("datetime(6)"); - - b.Property("EmployeeId") - .HasColumnType("int"); - - b.Property("EmployeeRoleId") - .HasColumnType("char(36)"); - - b.Property("ProjectId") - .HasColumnType("int"); - - b.Property("ReAllocationDate") - .HasColumnType("datetime(6)"); - - b.Property("TenantId") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("EmployeeId"); - - b.HasIndex("ProjectId"); - - b.HasIndex("TenantId"); - - b.ToTable("ProjectAllocations"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Projects.WorkArea", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - - b.Property("AreaName") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("FloorId") - .HasColumnType("int"); - - b.Property("TenantId") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("FloorId"); - - b.HasIndex("TenantId"); - - b.ToTable("WorkAreas"); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRole", b => - { - b.Property("Id") - .HasColumnType("varchar(255)"); - - b.Property("ConcurrencyStamp") - .IsConcurrencyToken() - .HasColumnType("longtext"); - - b.Property("Name") - .HasMaxLength(256) - .HasColumnType("varchar(256)"); - - b.Property("NormalizedName") - .HasMaxLength(256) - .HasColumnType("varchar(256)"); - - b.HasKey("Id"); - - b.HasIndex("NormalizedName") - .IsUnique() - .HasDatabaseName("RoleNameIndex"); - - b.ToTable("AspNetRoles", (string)null); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - - b.Property("ClaimType") - .HasColumnType("longtext"); - - b.Property("ClaimValue") - .HasColumnType("longtext"); - - b.Property("RoleId") - .IsRequired() - .HasColumnType("varchar(255)"); - - b.HasKey("Id"); - - b.HasIndex("RoleId"); - - b.ToTable("AspNetRoleClaims", (string)null); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUser", b => - { - b.Property("Id") - .HasColumnType("varchar(255)"); - - b.Property("AccessFailedCount") - .HasColumnType("int"); - - b.Property("ConcurrencyStamp") - .IsConcurrencyToken() - .HasColumnType("longtext"); - - b.Property("Discriminator") - .IsRequired() - .HasMaxLength(21) - .HasColumnType("varchar(21)"); - - b.Property("Email") - .HasMaxLength(256) - .HasColumnType("varchar(256)"); - - b.Property("EmailConfirmed") - .HasColumnType("tinyint(1)"); - - b.Property("LockoutEnabled") - .HasColumnType("tinyint(1)"); - - b.Property("LockoutEnd") - .HasColumnType("datetime(6)"); - - b.Property("NormalizedEmail") - .HasMaxLength(256) - .HasColumnType("varchar(256)"); - - b.Property("NormalizedUserName") - .HasMaxLength(256) - .HasColumnType("varchar(256)"); - - b.Property("PasswordHash") - .HasColumnType("longtext"); - - b.Property("PhoneNumber") - .HasColumnType("longtext"); - - b.Property("PhoneNumberConfirmed") - .HasColumnType("tinyint(1)"); - - b.Property("SecurityStamp") - .HasColumnType("longtext"); - - b.Property("TwoFactorEnabled") - .HasColumnType("tinyint(1)"); - - b.Property("UserName") - .HasMaxLength(256) - .HasColumnType("varchar(256)"); - - b.HasKey("Id"); - - b.HasIndex("NormalizedEmail") - .HasDatabaseName("EmailIndex"); - - b.HasIndex("NormalizedUserName") - .IsUnique() - .HasDatabaseName("UserNameIndex"); - - b.ToTable("AspNetUsers", (string)null); - - b.HasDiscriminator().HasValue("IdentityUser"); - - b.UseTphMappingStrategy(); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - - b.Property("ClaimType") - .HasColumnType("longtext"); - - b.Property("ClaimValue") - .HasColumnType("longtext"); - - b.Property("UserId") - .IsRequired() - .HasColumnType("varchar(255)"); - - b.HasKey("Id"); - - b.HasIndex("UserId"); - - b.ToTable("AspNetUserClaims", (string)null); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin", b => - { - b.Property("LoginProvider") - .HasColumnType("varchar(255)"); - - b.Property("ProviderKey") - .HasColumnType("varchar(255)"); - - b.Property("ProviderDisplayName") - .HasColumnType("longtext"); - - b.Property("UserId") - .IsRequired() - .HasColumnType("varchar(255)"); - - b.HasKey("LoginProvider", "ProviderKey"); - - b.HasIndex("UserId"); - - b.ToTable("AspNetUserLogins", (string)null); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole", b => - { - b.Property("UserId") - .HasColumnType("varchar(255)"); - - b.Property("RoleId") - .HasColumnType("varchar(255)"); - - b.HasKey("UserId", "RoleId"); - - b.HasIndex("RoleId"); - - b.ToTable("AspNetUserRoles", (string)null); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken", b => - { - b.Property("UserId") - .HasColumnType("varchar(255)"); - - b.Property("LoginProvider") - .HasColumnType("varchar(255)"); - - b.Property("Name") - .HasColumnType("varchar(255)"); - - b.Property("Value") - .HasColumnType("longtext"); - - b.HasKey("UserId", "LoginProvider", "Name"); - - b.ToTable("AspNetUserTokens", (string)null); - }); - - modelBuilder.Entity("Marco.Pms.Model.Entitlements.ApplicationUser", b => - { - b.HasBaseType("Microsoft.AspNetCore.Identity.IdentityUser"); - - b.Property("IsRootUser") - .HasColumnType("tinyint(1)"); - - b.Property("Role") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("TenantId") - .HasColumnType("int"); - - b.HasDiscriminator().HasValue("ApplicationUser"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Activities.TaskAllocation", b => - { - b.HasOne("Marco.Pms.Model.Projects.Building", "Building") - .WithMany() - .HasForeignKey("BuildingId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Marco.Pms.Model.Employees.Employee", "Employee") - .WithMany() - .HasForeignKey("EmployeeId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Marco.Pms.Model.Projects.Project", "Project") - .WithMany() - .HasForeignKey("ProjectId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Marco.Pms.Model.Entitlements.Tenant", "Tenant") - .WithMany() - .HasForeignKey("TenantId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Marco.Pms.Model.Projects.WorkArea", "WorkArea") - .WithMany() - .HasForeignKey("WorkAreaId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Building"); - - b.Navigation("Employee"); - - b.Navigation("Project"); - - b.Navigation("Tenant"); - - b.Navigation("WorkArea"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Activities.WorkItem", b => - { - b.HasOne("Marco.Pms.Model.Entitlements.ActivityMaster", "ActivityMaster") - .WithMany() - .HasForeignKey("ActivityId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Marco.Pms.Model.Entitlements.Tenant", "Tenant") - .WithMany() - .HasForeignKey("TenantId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Marco.Pms.Model.Projects.WorkArea", "WorkArea") - .WithMany() - .HasForeignKey("WorkAreaId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("ActivityMaster"); - - b.Navigation("Tenant"); - - b.Navigation("WorkArea"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Activities.WorkItemMapping", b => - { - b.HasOne("Marco.Pms.Model.Entitlements.Tenant", "Tenant") - .WithMany() - .HasForeignKey("TenantId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Marco.Pms.Model.Projects.WorkArea", "WorkArea") - .WithMany() - .HasForeignKey("WorkAreaId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Marco.Pms.Model.Activities.WorkItem", "WorkItem") - .WithMany() - .HasForeignKey("WorkItemId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Tenant"); - - b.Navigation("WorkArea"); - - b.Navigation("WorkItem"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Authentication.RefreshToken", b => - { - b.HasOne("Microsoft.AspNetCore.Identity.IdentityUser", "User") - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("User"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Employees.Attendance", b => - { - b.HasOne("Marco.Pms.Model.Employees.Employee", "Employee") - .WithMany() - .HasForeignKey("EmployeeID") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Marco.Pms.Model.Employees.AttendanceLog", "InTimeLog") - .WithMany() - .HasForeignKey("InTimeID"); - - b.HasOne("Marco.Pms.Model.Employees.AttendanceLog", "OutTimeLog") - .WithMany() - .HasForeignKey("OutTimeID"); - - b.HasOne("Marco.Pms.Model.Entitlements.Tenant", "Tenant") - .WithMany() - .HasForeignKey("TenantId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Employee"); - - b.Navigation("InTimeLog"); - - b.Navigation("OutTimeLog"); - - b.Navigation("Tenant"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Employees.AttendanceLog", b => - { - b.HasOne("Marco.Pms.Model.Employees.Employee", "Employee") - .WithMany() - .HasForeignKey("EmployeeID") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Marco.Pms.Model.Entitlements.Tenant", "Tenant") - .WithMany() - .HasForeignKey("TenantId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Employee"); - - b.Navigation("Tenant"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Employees.Employee", b => - { - b.HasOne("Marco.Pms.Model.Entitlements.ApplicationUser", "ApplicationUser") - .WithMany() - .HasForeignKey("ApplicationUserId"); - - b.HasOne("Marco.Pms.Model.Entitlements.Tenant", "Tenant") - .WithMany() - .HasForeignKey("TenantId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("ApplicationUser"); - - b.Navigation("Tenant"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Employees.WorkShift", b => - { - b.HasOne("Marco.Pms.Model.Entitlements.Tenant", "Tenant") - .WithMany() - .HasForeignKey("TenantId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Tenant"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Entitlements.ActivityMaster", b => - { - b.HasOne("Marco.Pms.Model.Activities.TaskAllocation", null) - .WithMany("AllotedTask") - .HasForeignKey("TaskAllocationId"); - - b.HasOne("Marco.Pms.Model.Entitlements.Tenant", "Tenant") - .WithMany() - .HasForeignKey("TenantId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Tenant"); - }); - - - modelBuilder.Entity("Marco.Pms.Model.Entitlements.Feature", b => - { - b.HasOne("Marco.Pms.Model.Entitlements.Module", "Module") - .WithMany() - .HasForeignKey("ModuleId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Module"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Entitlements.FeaturePermission", b => - { - b.HasOne("Marco.Pms.Model.Entitlements.Feature", "Feature") - .WithMany("FeaturePermissions") - .HasForeignKey("FeatureId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Feature"); - }); - - - modelBuilder.Entity("Marco.Pms.Model.Entitlements.StatusMaster", b => - { - b.HasOne("Marco.Pms.Model.Entitlements.Tenant", "Tenant") - .WithMany() - .HasForeignKey("TenantId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Tenant"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Projects.Building", b => - { - b.HasOne("Marco.Pms.Model.Entitlements.Tenant", "Tenant") - .WithMany() - .HasForeignKey("TenantId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Tenant"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Projects.Floor", b => - { - b.HasOne("Marco.Pms.Model.Projects.Building", "Building") - .WithMany() - .HasForeignKey("BuildingId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Marco.Pms.Model.Entitlements.Tenant", "Tenant") - .WithMany() - .HasForeignKey("TenantId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Building"); - - b.Navigation("Tenant"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Projects.Project", b => - { - b.HasOne("Marco.Pms.Model.Entitlements.StatusMaster", "ProjectStatus") - .WithMany() - .HasForeignKey("ProjectStatusId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Marco.Pms.Model.Entitlements.Tenant", "Tenant") - .WithMany() - .HasForeignKey("TenantId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("ProjectStatus"); - - b.Navigation("Tenant"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Projects.ProjectAllocation", b => - { - b.HasOne("Marco.Pms.Model.Employees.Employee", "Employee") - .WithMany() - .HasForeignKey("EmployeeId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Marco.Pms.Model.Projects.Project", "Project") - .WithMany() - .HasForeignKey("ProjectId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Marco.Pms.Model.Entitlements.Tenant", "Tenant") - .WithMany() - .HasForeignKey("TenantId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Employee"); - - b.Navigation("Project"); - - b.Navigation("Tenant"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Projects.WorkArea", b => - { - b.HasOne("Marco.Pms.Model.Projects.Floor", "Floor") - .WithMany() - .HasForeignKey("FloorId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Marco.Pms.Model.Entitlements.Tenant", "Tenant") - .WithMany() - .HasForeignKey("TenantId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Floor"); - - b.Navigation("Tenant"); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim", b => - { - b.HasOne("Microsoft.AspNetCore.Identity.IdentityRole", null) - .WithMany() - .HasForeignKey("RoleId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim", b => - { - b.HasOne("Microsoft.AspNetCore.Identity.IdentityUser", null) - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin", b => - { - b.HasOne("Microsoft.AspNetCore.Identity.IdentityUser", null) - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole", b => - { - b.HasOne("Microsoft.AspNetCore.Identity.IdentityRole", null) - .WithMany() - .HasForeignKey("RoleId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Microsoft.AspNetCore.Identity.IdentityUser", null) - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken", b => - { - b.HasOne("Microsoft.AspNetCore.Identity.IdentityUser", null) - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Marco.Pms.Model.Activities.TaskAllocation", b => - { - b.Navigation("AllotedTask"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Entitlements.Feature", b => - { - b.Navigation("FeaturePermissions"); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/Marco.Pms.DataAccess/Migrations/20250206083015_NoNavigationMigration.cs b/Marco.Pms.DataAccess/Migrations/20250206083015_NoNavigationMigration.cs deleted file mode 100644 index 496c3d8..0000000 --- a/Marco.Pms.DataAccess/Migrations/20250206083015_NoNavigationMigration.cs +++ /dev/null @@ -1,73 +0,0 @@ -using System; -using Microsoft.EntityFrameworkCore.Migrations; - -#nullable disable - -namespace Marco.Pms.DataAccess.Migrations -{ - /// - public partial class NoNavigationMigration : Migration - { - /// - protected override void Up(MigrationBuilder migrationBuilder) - { - //migrationBuilder.AddColumn( - // name: "RoleId", - // table: "Employees", - // type: "char(36)", - // nullable: false, - // defaultValue: new Guid("00000000-0000-0000-0000-000000000000"), - // collation: "ascii_general_ci"); - - migrationBuilder.UpdateData( - table: "Modules", - keyColumn: "Id", - keyValue: 1, - column: "Key", - value: "b29e3352-d83f-42eb-9c57-6e2cbf1b7c9b"); - - migrationBuilder.UpdateData( - table: "Modules", - keyColumn: "Id", - keyValue: 2, - column: "Key", - value: "d522bcb3-6965-4c2f-be14-dd18b3181a34"); - - migrationBuilder.UpdateData( - table: "Modules", - keyColumn: "Id", - keyValue: 3, - column: "Key", - value: "77302f42-93ec-49eb-9e05-80b80939639a"); - } - - /// - protected override void Down(MigrationBuilder migrationBuilder) - { - //migrationBuilder.DropColumn( - // name: "RoleId", - // table: "Employees"); - - migrationBuilder.UpdateData( - table: "Modules", - keyColumn: "Id", - keyValue: 1, - column: "Key", - value: "03f97e79-e7ff-412b-91b4-19b71325f00c"); - - migrationBuilder.UpdateData( - table: "Modules", - keyColumn: "Id", - keyValue: 2, - column: "Key", - value: "2351d591-bdd5-4eb5-a375-125c8cfdcf29"); - - migrationBuilder.UpdateData( - table: "Modules", - keyColumn: "Id", - keyValue: 3, - column: "Key", - value: "bedbed6b-8ea5-4bd2-a37c-d5454d0dd280"); - } - } -} diff --git a/Marco.Pms.DataAccess/Migrations/20250206101247_updatefeaturesmaster.Designer.cs b/Marco.Pms.DataAccess/Migrations/20250206101247_updatefeaturesmaster.Designer.cs deleted file mode 100644 index 6924c0e..0000000 --- a/Marco.Pms.DataAccess/Migrations/20250206101247_updatefeaturesmaster.Designer.cs +++ /dev/null @@ -1,1717 +0,0 @@ -// -using System; -using Marco.Pms.DataAccess.Data; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Metadata; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; - -#nullable disable - -namespace Marco.Pms.DataAccess.Migrations -{ - [DbContext(typeof(ApplicationDbContext))] - [Migration("20250206101247_updatefeaturesmaster")] - partial class updatefeaturesmaster - { - /// - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasAnnotation("ProductVersion", "8.0.12") - .HasAnnotation("Relational:MaxIdentifierLength", 64); - - //MySqlModelBuilderExtensions.AutoIncrementColumns(modelBuilder); - - modelBuilder.Entity("Marco.Pms.Model.Activities.TaskAllocation", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - - b.Property("AllocationDate") - .HasColumnType("datetime(6)"); - - b.Property("BuildingId") - .HasColumnType("int"); - - b.Property("EmployeeId") - .HasColumnType("int"); - - b.Property("EmployeeRole") - .HasColumnType("int"); - - b.Property("ProjectId") - .HasColumnType("int"); - - b.Property("ReAllocationDate") - .HasColumnType("datetime(6)"); - - b.Property("TenantId") - .HasColumnType("int"); - - b.Property("WorkAreaId") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("BuildingId"); - - b.HasIndex("EmployeeId"); - - b.HasIndex("ProjectId"); - - b.HasIndex("TenantId"); - - b.HasIndex("WorkAreaId"); - - b.ToTable("TaskAllocations"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Activities.WorkItem", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - - b.Property("ActivityId") - .HasColumnType("int"); - - b.Property("CompletedWork") - .HasColumnType("int"); - - b.Property("PlannedWork") - .HasColumnType("int"); - - b.Property("TaskDate") - .HasColumnType("datetime(6)"); - - b.Property("TenantId") - .HasColumnType("int"); - - b.Property("WorkAreaId") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("ActivityId"); - - b.HasIndex("TenantId"); - - b.HasIndex("WorkAreaId"); - - b.ToTable("WorkItems"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Activities.WorkItemMapping", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - - b.Property("TenantId") - .HasColumnType("int"); - - b.Property("WorkAreaId") - .HasColumnType("int"); - - b.Property("WorkItemId") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("TenantId"); - - b.HasIndex("WorkAreaId"); - - b.HasIndex("WorkItemId"); - - b.ToTable("WorkItemMapping"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Authentication.RefreshToken", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - - b.Property("CreatedAt") - .HasColumnType("datetime(6)"); - - b.Property("ExpiryDate") - .HasColumnType("datetime(6)"); - - b.Property("IsRevoked") - .HasColumnType("tinyint(1)"); - - b.Property("IsUsed") - .HasColumnType("tinyint(1)"); - - b.Property("RevokedAt") - .HasColumnType("datetime(6)"); - - b.Property("Token") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("UserId") - .IsRequired() - .HasColumnType("varchar(255)"); - - b.HasKey("Id"); - - b.HasIndex("UserId"); - - b.ToTable("RefreshTokens"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Employees.Attendance", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - - b.Property("ApprovedBy") - .HasColumnType("longtext"); - - b.Property("Comment") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("Date") - .HasColumnType("datetime(6)"); - - b.Property("EmployeeID") - .HasColumnType("int"); - - b.Property("InTimeID") - .HasColumnType("int"); - - b.Property("IsApproved") - .HasColumnType("tinyint(1)"); - - b.Property("OutTimeID") - .HasColumnType("int"); - - b.Property("TenantId") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("EmployeeID"); - - b.HasIndex("InTimeID"); - - b.HasIndex("OutTimeID"); - - b.HasIndex("TenantId"); - - b.ToTable("Attendances"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Employees.AttendanceLog", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - - b.Property("CheckTime") - .HasColumnType("datetime(6)"); - - b.Property("Comment") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("EmployeeID") - .HasColumnType("int"); - - b.Property("IsCheckIn") - .HasColumnType("tinyint(1)"); - - b.Property("Latitude") - .HasColumnType("longtext"); - - b.Property("Longitude") - .HasColumnType("longtext"); - - b.Property("Photo") - .HasColumnType("longblob"); - - b.Property("TenantId") - .HasColumnType("int"); - - b.Property("UpdatedBy") - .HasColumnType("longtext"); - - b.HasKey("Id"); - - b.HasIndex("EmployeeID"); - - b.HasIndex("TenantId"); - - b.ToTable("AttendanceLogs"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Employees.Employee", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - - b.Property("AadharNumber") - .HasColumnType("longtext"); - - b.Property("ApplicationUserId") - .HasColumnType("varchar(255)"); - - b.Property("BirthDate") - .HasColumnType("datetime(6)"); - - b.Property("CurrentAddress") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("Email") - .HasColumnType("longtext"); - - b.Property("EmergencyPhoneNumber") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("FirstName") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("Gender") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("LastName") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("MiddleName") - .HasColumnType("longtext"); - - b.Property("PanNumber") - .HasColumnType("longtext"); - - b.Property("PeramnentAddress") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("PhoneNumber") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("Photo") - .HasColumnType("longblob"); - - b.Property("RoleId") - .HasColumnType("char(36)"); - - b.Property("TenantId") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("ApplicationUserId"); - - b.HasIndex("TenantId"); - - b.ToTable("Employees"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Employees.WorkShift", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - - b.Property("EndTime") - .HasColumnType("time(6)"); - - b.Property("Name") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("StartTime") - .HasColumnType("time(6)"); - - b.Property("TenantId") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("TenantId"); - - b.ToTable("WorkShifts"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Entitlements.ActivityMaster", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - - b.Property("ActivityName") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("TaskAllocationId") - .HasColumnType("int"); - - b.Property("TenantId") - .HasColumnType("int"); - - b.Property("UnitOfMeasurement") - .IsRequired() - .HasColumnType("longtext"); - - b.HasKey("Id"); - - b.HasIndex("TaskAllocationId"); - - b.HasIndex("TenantId"); - - b.ToTable("ActivityMasters"); - - b.HasData( - new - { - Id = 1, - ActivityName = "Core Cutting", - TenantId = 1, - UnitOfMeasurement = "Number" - }, - new - { - Id = 2, - ActivityName = "Fabrication", - TenantId = 1, - UnitOfMeasurement = "Meter" - }, - new - { - Id = 3, - ActivityName = "Lifting", - TenantId = 1, - UnitOfMeasurement = "Meter" - }, - new - { - Id = 4, - ActivityName = "Hanging", - TenantId = 1, - UnitOfMeasurement = "Meter" - }, - new - { - Id = 5, - ActivityName = "Tapping", - TenantId = 1, - UnitOfMeasurement = "Meter" - }, - new - { - Id = 6, - ActivityName = "Welding", - TenantId = 1, - UnitOfMeasurement = "Meter" - }, - new - { - Id = 7, - ActivityName = "Testing", - TenantId = 1, - UnitOfMeasurement = "Area" - }, - new - { - Id = 8, - ActivityName = "Painting", - TenantId = 1, - UnitOfMeasurement = "Meter" - }, - new - { - Id = 9, - ActivityName = "Marking Area", - TenantId = 1, - UnitOfMeasurement = "Meter" - }, - new - { - Id = 10, - ActivityName = "Drilling", - TenantId = 1, - UnitOfMeasurement = "Number" - }, - new - { - Id = 11, - ActivityName = "MS Support Fabrication", - TenantId = 1, - UnitOfMeasurement = "Number" - }, - new - { - Id = 12, - ActivityName = "MS Support Hanging", - TenantId = 1, - UnitOfMeasurement = "Number" - }, - new - { - Id = 13, - ActivityName = "Hydrant Volve", - TenantId = 1, - UnitOfMeasurement = "Number" - }, - new - { - Id = 14, - ActivityName = "Sprinkler Installation", - TenantId = 1, - UnitOfMeasurement = "Number" - }); - }); - - - modelBuilder.Entity("Marco.Pms.Model.Entitlements.Feature", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("char(36)"); - - b.Property("Description") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("IsActive") - .HasColumnType("tinyint(1)"); - - b.Property("ModuleId") - .HasColumnType("int"); - - b.Property("Name") - .IsRequired() - .HasColumnType("longtext"); - - b.HasKey("Id"); - - b.HasIndex("ModuleId"); - - b.ToTable("Features"); - - b.HasData( - new - { - Id = new Guid("53176ebf-c75d-42e5-839f-4508ffac3def"), - Description = "Manage Project", - IsActive = true, - ModuleId = 1, - Name = "Manage Project" - }, - new - { - Id = new Guid("9666de86-d7c7-4d3d-acaa-fcd6d6b81f3c"), - Description = "Manage Infra", - IsActive = true, - ModuleId = 1, - Name = "Manage Infra" - }, - new - { - Id = new Guid("9d4b5489-2079-40b9-bd77-6e1bf90bc19f"), - Description = "Manage Tasks", - IsActive = true, - ModuleId = 1, - Name = "Manage Tasks" - }, - new - { - Id = new Guid("39e66f81-efc6-446c-95bd-46bff6cfb606"), - Description = "Assign and Update Tasks Progress", - IsActive = true, - ModuleId = 1, - Name = "Assign and Update Tasks Progress" - }, - new - { - Id = new Guid("81ab8a87-8ccd-4015-a917-0627cee6a100"), - Description = "Manage Employee", - IsActive = true, - ModuleId = 2, - Name = "Manage Employee" - }, - new - { - Id = new Guid("52c9cf54-1eb2-44d2-81bb-524cf29c0a94"), - Description = "Attendance", - IsActive = true, - ModuleId = 2, - Name = "Attendance" - }, - new - { - Id = new Guid("be3b3afc-6ccf-4566-b9b6-aafcb65546be"), - Description = "Global Masters", - IsActive = true, - ModuleId = 3, - Name = "Global Masters" - }, - new - { - Id = new Guid("660131a4-788c-4739-a082-cbbf7879cbf2"), - Description = "Tenant Masters", - IsActive = true, - ModuleId = 3, - Name = "Tenant Masters" - }); - }); - - modelBuilder.Entity("Marco.Pms.Model.Entitlements.FeaturePermission", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("char(36)"); - - b.Property("Description") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("FeatureId") - .HasColumnType("char(36)"); - - b.Property("IsEnabled") - .HasColumnType("tinyint(1)"); - - b.Property("Name") - .IsRequired() - .HasColumnType("longtext"); - - b.HasKey("Id"); - - b.HasIndex("FeatureId"); - - b.ToTable("FeaturePermissions"); - - b.HasData( - new - { - Id = new Guid("6ea44136-987e-44ba-9e5d-1cf8f5837ebc"), - Description = "", - FeatureId = new Guid("53176ebf-c75d-42e5-839f-4508ffac3def"), - IsEnabled = true, - Name = "View Project" - }, - new - { - Id = new Guid("172fc9b6-755b-4f62-ab26-55c34a330614"), - Description = "", - FeatureId = new Guid("53176ebf-c75d-42e5-839f-4508ffac3def"), - IsEnabled = true, - Name = "Manage Project" - }, - new - { - Id = new Guid("b94802ce-0689-4643-9e1d-11c86950c35b"), - Description = "", - FeatureId = new Guid("53176ebf-c75d-42e5-839f-4508ffac3def"), - IsEnabled = true, - Name = "Manage Team" - }, - new - { - Id = new Guid("c7b68e33-72f0-474f-bd96-77636427ecc8"), - Description = "", - FeatureId = new Guid("9666de86-d7c7-4d3d-acaa-fcd6d6b81f3c"), - IsEnabled = true, - Name = "View Project Infra" - }, - new - { - Id = new Guid("f2aee20a-b754-4537-8166-f9507b44585b"), - Description = "", - FeatureId = new Guid("9666de86-d7c7-4d3d-acaa-fcd6d6b81f3c"), - IsEnabled = true, - Name = "Manage Project Infra" - }, - new - { - Id = new Guid("9fcc5f87-25e3-4846-90ac-67a71ab92e3c"), - Description = "", - FeatureId = new Guid("9d4b5489-2079-40b9-bd77-6e1bf90bc19f"), - IsEnabled = true, - Name = "View Task" - }, - new - { - Id = new Guid("08752f33-3b29-4816-b76b-ea8a968ed3c5"), - Description = "", - FeatureId = new Guid("9d4b5489-2079-40b9-bd77-6e1bf90bc19f"), - IsEnabled = true, - Name = "Manage Task" - }, - new - { - Id = new Guid("d135a4b0-4f9a-4903-ab9c-4843839ebdee"), - Description = "", - FeatureId = new Guid("39e66f81-efc6-446c-95bd-46bff6cfb606"), - IsEnabled = true, - Name = "Assign Task and Report Progress" - }, - new - { - Id = new Guid("ed99ecd4-1bed-42e1-b7b3-d64c04493823"), - Description = "", - FeatureId = new Guid("39e66f81-efc6-446c-95bd-46bff6cfb606"), - IsEnabled = true, - Name = "Approve Task" - }, - new - { - Id = new Guid("b82d2b7e-0d52-45f3-997b-c008ea460e7f"), - Description = "", - FeatureId = new Guid("81ab8a87-8ccd-4015-a917-0627cee6a100"), - IsEnabled = true, - Name = "View Employee" - }, - new - { - Id = new Guid("a97d366a-c2bb-448d-be93-402bd2324566"), - Description = "", - FeatureId = new Guid("81ab8a87-8ccd-4015-a917-0627cee6a100"), - IsEnabled = true, - Name = "Manage Employee" - }, - new - { - Id = new Guid("fbd213e0-0250-46f1-9f5f-4b2a1e6e76a3"), - Description = "", - FeatureId = new Guid("81ab8a87-8ccd-4015-a917-0627cee6a100"), - IsEnabled = true, - Name = "Assign To Project" - }, - new - { - Id = new Guid("915e6bff-65f6-4e3f-aea8-3fd217d3ea9e"), - Description = "", - FeatureId = new Guid("52c9cf54-1eb2-44d2-81bb-524cf29c0a94"), - IsEnabled = true, - Name = "Perform Attendance " - }, - new - { - Id = new Guid("57802c4a-00aa-4a1f-a048-fd2f70dd44b6"), - Description = "", - FeatureId = new Guid("52c9cf54-1eb2-44d2-81bb-524cf29c0a94"), - IsEnabled = true, - Name = "Regularize Attendance" - }, - new - { - Id = new Guid("5ffbafe0-7ab0-48b1-bb50-c1bf76b65f9d"), - Description = "", - FeatureId = new Guid("be3b3afc-6ccf-4566-b9b6-aafcb65546be"), - IsEnabled = true, - Name = "View Masters" - }, - new - { - Id = new Guid("588a8824-f924-4955-82d8-fc51956cf323"), - Description = "", - FeatureId = new Guid("be3b3afc-6ccf-4566-b9b6-aafcb65546be"), - IsEnabled = true, - Name = "Manage Masters" - }, - new - { - Id = new Guid("cb8ec407-46d4-4467-930c-69127cda6dec"), - Description = "", - FeatureId = new Guid("660131a4-788c-4739-a082-cbbf7879cbf2"), - IsEnabled = true, - Name = "View Masters" - }, - new - { - Id = new Guid("6b1a6d97-a951-4de5-9b19-709bac7c4f18"), - Description = "", - FeatureId = new Guid("660131a4-788c-4739-a082-cbbf7879cbf2"), - IsEnabled = true, - Name = "Manage Masters" - }); - }); - - modelBuilder.Entity("Marco.Pms.Model.Entitlements.Module", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - - b.Property("Description") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("Key") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("Name") - .IsRequired() - .HasColumnType("longtext"); - - b.HasKey("Id"); - - b.ToTable("Modules"); - - b.HasData( - new - { - Id = 1, - Description = "Project Module", - Key = "b0aa1d10-7b8a-40f1-96b3-219e8de89ccb", - Name = "Project" - }, - new - { - Id = 2, - Description = "Employee Module", - Key = "19101abd-012e-4809-b153-da6bdbca0d7a", - Name = "Employee" - }, - new - { - Id = 3, - Description = "Masters Module", - Key = "0cb9a301-edf2-4a15-8eeb-5bfea0ad4d90", - Name = "Masters" - }); - }); - - - modelBuilder.Entity("Marco.Pms.Model.Entitlements.StatusMaster", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - - b.Property("Status") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("TenantId") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("TenantId"); - - b.ToTable("StatusMasters"); - - b.HasData( - new - { - Id = 1, - Status = "Active", - TenantId = 1 - }, - new - { - Id = 2, - Status = "In Progress", - TenantId = 1 - }, - new - { - Id = 3, - Status = "On Hold", - TenantId = 1 - }, - new - { - Id = 4, - Status = "Completed", - TenantId = 1 - }); - }); - - modelBuilder.Entity("Marco.Pms.Model.Entitlements.Tenant", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - - b.Property("ContactName") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("ContactNumber") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("Description") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("DomainName") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("Name") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("OnBoardingDate") - .HasColumnType("datetime(6)"); - - b.HasKey("Id"); - - b.ToTable("Tenants"); - - b.HasData( - new - { - Id = 1, - ContactName = "Admin", - ContactNumber = "123456789", - Description = "", - DomainName = "www.marcobms.org", - Name = "MarcoBMS", - OnBoardingDate = new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified) - }); - }); - - modelBuilder.Entity("Marco.Pms.Model.Projects.Building", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - - b.Property("Description") - .HasColumnType("longtext"); - - b.Property("Name") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("ProjectId") - .HasColumnType("int"); - - b.Property("TenantId") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("TenantId"); - - b.ToTable("Buildings"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Projects.Floor", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - - b.Property("BuildingId") - .HasColumnType("int"); - - b.Property("FloorName") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("TenantId") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("BuildingId"); - - b.HasIndex("TenantId"); - - b.ToTable("Floor"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Projects.Project", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - - b.Property("ContactPerson") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("EndDate") - .HasColumnType("datetime(6)"); - - b.Property("Name") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("ProjectAddress") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("ProjectStatusId") - .HasColumnType("int"); - - b.Property("StartDate") - .HasColumnType("datetime(6)"); - - b.Property("TenantId") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("ProjectStatusId"); - - b.HasIndex("TenantId"); - - b.ToTable("Projects"); - - b.HasData( - new - { - Id = 1, - ContactPerson = "Project 1 Contact Person", - Name = "Project 1", - ProjectAddress = "Project 1 Address", - ProjectStatusId = 1, - TenantId = 1 - }, - new - { - Id = 2, - ContactPerson = "Project 2 Contact Person", - Name = "Project 2", - ProjectAddress = "Project 2 Address", - ProjectStatusId = 2, - TenantId = 1 - }, - new - { - Id = 3, - ContactPerson = "Project 3 Contact Person", - Name = "Project 3", - ProjectAddress = "Project 3 Address", - ProjectStatusId = 3, - TenantId = 1 - }); - }); - - modelBuilder.Entity("Marco.Pms.Model.Projects.ProjectAllocation", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - - b.Property("AllocationDate") - .HasColumnType("datetime(6)"); - - b.Property("EmployeeId") - .HasColumnType("int"); - - b.Property("EmployeeRoleId") - .HasColumnType("char(36)"); - - b.Property("ProjectId") - .HasColumnType("int"); - - b.Property("ReAllocationDate") - .HasColumnType("datetime(6)"); - - b.Property("TenantId") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("EmployeeId"); - - b.HasIndex("ProjectId"); - - b.HasIndex("TenantId"); - - b.ToTable("ProjectAllocations"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Projects.WorkArea", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - - b.Property("AreaName") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("FloorId") - .HasColumnType("int"); - - b.Property("TenantId") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("FloorId"); - - b.HasIndex("TenantId"); - - b.ToTable("WorkAreas"); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRole", b => - { - b.Property("Id") - .HasColumnType("varchar(255)"); - - b.Property("ConcurrencyStamp") - .IsConcurrencyToken() - .HasColumnType("longtext"); - - b.Property("Name") - .HasMaxLength(256) - .HasColumnType("varchar(256)"); - - b.Property("NormalizedName") - .HasMaxLength(256) - .HasColumnType("varchar(256)"); - - b.HasKey("Id"); - - b.HasIndex("NormalizedName") - .IsUnique() - .HasDatabaseName("RoleNameIndex"); - - b.ToTable("AspNetRoles", (string)null); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - - b.Property("ClaimType") - .HasColumnType("longtext"); - - b.Property("ClaimValue") - .HasColumnType("longtext"); - - b.Property("RoleId") - .IsRequired() - .HasColumnType("varchar(255)"); - - b.HasKey("Id"); - - b.HasIndex("RoleId"); - - b.ToTable("AspNetRoleClaims", (string)null); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUser", b => - { - b.Property("Id") - .HasColumnType("varchar(255)"); - - b.Property("AccessFailedCount") - .HasColumnType("int"); - - b.Property("ConcurrencyStamp") - .IsConcurrencyToken() - .HasColumnType("longtext"); - - b.Property("Discriminator") - .IsRequired() - .HasMaxLength(21) - .HasColumnType("varchar(21)"); - - b.Property("Email") - .HasMaxLength(256) - .HasColumnType("varchar(256)"); - - b.Property("EmailConfirmed") - .HasColumnType("tinyint(1)"); - - b.Property("LockoutEnabled") - .HasColumnType("tinyint(1)"); - - b.Property("LockoutEnd") - .HasColumnType("datetime(6)"); - - b.Property("NormalizedEmail") - .HasMaxLength(256) - .HasColumnType("varchar(256)"); - - b.Property("NormalizedUserName") - .HasMaxLength(256) - .HasColumnType("varchar(256)"); - - b.Property("PasswordHash") - .HasColumnType("longtext"); - - b.Property("PhoneNumber") - .HasColumnType("longtext"); - - b.Property("PhoneNumberConfirmed") - .HasColumnType("tinyint(1)"); - - b.Property("SecurityStamp") - .HasColumnType("longtext"); - - b.Property("TwoFactorEnabled") - .HasColumnType("tinyint(1)"); - - b.Property("UserName") - .HasMaxLength(256) - .HasColumnType("varchar(256)"); - - b.HasKey("Id"); - - b.HasIndex("NormalizedEmail") - .HasDatabaseName("EmailIndex"); - - b.HasIndex("NormalizedUserName") - .IsUnique() - .HasDatabaseName("UserNameIndex"); - - b.ToTable("AspNetUsers", (string)null); - - b.HasDiscriminator().HasValue("IdentityUser"); - - b.UseTphMappingStrategy(); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - - b.Property("ClaimType") - .HasColumnType("longtext"); - - b.Property("ClaimValue") - .HasColumnType("longtext"); - - b.Property("UserId") - .IsRequired() - .HasColumnType("varchar(255)"); - - b.HasKey("Id"); - - b.HasIndex("UserId"); - - b.ToTable("AspNetUserClaims", (string)null); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin", b => - { - b.Property("LoginProvider") - .HasColumnType("varchar(255)"); - - b.Property("ProviderKey") - .HasColumnType("varchar(255)"); - - b.Property("ProviderDisplayName") - .HasColumnType("longtext"); - - b.Property("UserId") - .IsRequired() - .HasColumnType("varchar(255)"); - - b.HasKey("LoginProvider", "ProviderKey"); - - b.HasIndex("UserId"); - - b.ToTable("AspNetUserLogins", (string)null); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole", b => - { - b.Property("UserId") - .HasColumnType("varchar(255)"); - - b.Property("RoleId") - .HasColumnType("varchar(255)"); - - b.HasKey("UserId", "RoleId"); - - b.HasIndex("RoleId"); - - b.ToTable("AspNetUserRoles", (string)null); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken", b => - { - b.Property("UserId") - .HasColumnType("varchar(255)"); - - b.Property("LoginProvider") - .HasColumnType("varchar(255)"); - - b.Property("Name") - .HasColumnType("varchar(255)"); - - b.Property("Value") - .HasColumnType("longtext"); - - b.HasKey("UserId", "LoginProvider", "Name"); - - b.ToTable("AspNetUserTokens", (string)null); - }); - - modelBuilder.Entity("Marco.Pms.Model.Entitlements.ApplicationUser", b => - { - b.HasBaseType("Microsoft.AspNetCore.Identity.IdentityUser"); - - b.Property("IsRootUser") - .HasColumnType("tinyint(1)"); - - b.Property("Role") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("TenantId") - .HasColumnType("int"); - - b.HasDiscriminator().HasValue("ApplicationUser"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Activities.TaskAllocation", b => - { - b.HasOne("Marco.Pms.Model.Projects.Building", "Building") - .WithMany() - .HasForeignKey("BuildingId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Marco.Pms.Model.Employees.Employee", "Employee") - .WithMany() - .HasForeignKey("EmployeeId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Marco.Pms.Model.Projects.Project", "Project") - .WithMany() - .HasForeignKey("ProjectId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Marco.Pms.Model.Entitlements.Tenant", "Tenant") - .WithMany() - .HasForeignKey("TenantId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Marco.Pms.Model.Projects.WorkArea", "WorkArea") - .WithMany() - .HasForeignKey("WorkAreaId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Building"); - - b.Navigation("Employee"); - - b.Navigation("Project"); - - b.Navigation("Tenant"); - - b.Navigation("WorkArea"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Activities.WorkItem", b => - { - b.HasOne("Marco.Pms.Model.Entitlements.ActivityMaster", "ActivityMaster") - .WithMany() - .HasForeignKey("ActivityId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Marco.Pms.Model.Entitlements.Tenant", "Tenant") - .WithMany() - .HasForeignKey("TenantId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Marco.Pms.Model.Projects.WorkArea", "WorkArea") - .WithMany() - .HasForeignKey("WorkAreaId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("ActivityMaster"); - - b.Navigation("Tenant"); - - b.Navigation("WorkArea"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Activities.WorkItemMapping", b => - { - b.HasOne("Marco.Pms.Model.Entitlements.Tenant", "Tenant") - .WithMany() - .HasForeignKey("TenantId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Marco.Pms.Model.Projects.WorkArea", "WorkArea") - .WithMany() - .HasForeignKey("WorkAreaId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Marco.Pms.Model.Activities.WorkItem", "WorkItem") - .WithMany() - .HasForeignKey("WorkItemId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Tenant"); - - b.Navigation("WorkArea"); - - b.Navigation("WorkItem"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Authentication.RefreshToken", b => - { - b.HasOne("Microsoft.AspNetCore.Identity.IdentityUser", "User") - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("User"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Employees.Attendance", b => - { - b.HasOne("Marco.Pms.Model.Employees.Employee", "Employee") - .WithMany() - .HasForeignKey("EmployeeID") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Marco.Pms.Model.Employees.AttendanceLog", "InTimeLog") - .WithMany() - .HasForeignKey("InTimeID"); - - b.HasOne("Marco.Pms.Model.Employees.AttendanceLog", "OutTimeLog") - .WithMany() - .HasForeignKey("OutTimeID"); - - b.HasOne("Marco.Pms.Model.Entitlements.Tenant", "Tenant") - .WithMany() - .HasForeignKey("TenantId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Employee"); - - b.Navigation("InTimeLog"); - - b.Navigation("OutTimeLog"); - - b.Navigation("Tenant"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Employees.AttendanceLog", b => - { - b.HasOne("Marco.Pms.Model.Employees.Employee", "Employee") - .WithMany() - .HasForeignKey("EmployeeID") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Marco.Pms.Model.Entitlements.Tenant", "Tenant") - .WithMany() - .HasForeignKey("TenantId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Employee"); - - b.Navigation("Tenant"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Employees.Employee", b => - { - b.HasOne("Marco.Pms.Model.Entitlements.ApplicationUser", "ApplicationUser") - .WithMany() - .HasForeignKey("ApplicationUserId"); - - b.HasOne("Marco.Pms.Model.Entitlements.Tenant", "Tenant") - .WithMany() - .HasForeignKey("TenantId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("ApplicationUser"); - - b.Navigation("Tenant"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Employees.WorkShift", b => - { - b.HasOne("Marco.Pms.Model.Entitlements.Tenant", "Tenant") - .WithMany() - .HasForeignKey("TenantId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Tenant"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Entitlements.ActivityMaster", b => - { - b.HasOne("Marco.Pms.Model.Activities.TaskAllocation", null) - .WithMany("AllotedTask") - .HasForeignKey("TaskAllocationId"); - - b.HasOne("Marco.Pms.Model.Entitlements.Tenant", "Tenant") - .WithMany() - .HasForeignKey("TenantId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Tenant"); - }); - - - modelBuilder.Entity("Marco.Pms.Model.Entitlements.Feature", b => - { - b.HasOne("Marco.Pms.Model.Entitlements.Module", "Module") - .WithMany() - .HasForeignKey("ModuleId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Module"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Entitlements.FeaturePermission", b => - { - b.HasOne("Marco.Pms.Model.Entitlements.Feature", "Feature") - .WithMany("FeaturePermissions") - .HasForeignKey("FeatureId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Feature"); - }); - - - modelBuilder.Entity("Marco.Pms.Model.Entitlements.StatusMaster", b => - { - b.HasOne("Marco.Pms.Model.Entitlements.Tenant", "Tenant") - .WithMany() - .HasForeignKey("TenantId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Tenant"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Projects.Building", b => - { - b.HasOne("Marco.Pms.Model.Entitlements.Tenant", "Tenant") - .WithMany() - .HasForeignKey("TenantId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Tenant"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Projects.Floor", b => - { - b.HasOne("Marco.Pms.Model.Projects.Building", "Building") - .WithMany() - .HasForeignKey("BuildingId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Marco.Pms.Model.Entitlements.Tenant", "Tenant") - .WithMany() - .HasForeignKey("TenantId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Building"); - - b.Navigation("Tenant"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Projects.Project", b => - { - b.HasOne("Marco.Pms.Model.Entitlements.StatusMaster", "ProjectStatus") - .WithMany() - .HasForeignKey("ProjectStatusId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Marco.Pms.Model.Entitlements.Tenant", "Tenant") - .WithMany() - .HasForeignKey("TenantId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("ProjectStatus"); - - b.Navigation("Tenant"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Projects.ProjectAllocation", b => - { - b.HasOne("Marco.Pms.Model.Employees.Employee", "Employee") - .WithMany() - .HasForeignKey("EmployeeId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Marco.Pms.Model.Projects.Project", "Project") - .WithMany() - .HasForeignKey("ProjectId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Marco.Pms.Model.Entitlements.Tenant", "Tenant") - .WithMany() - .HasForeignKey("TenantId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Employee"); - - b.Navigation("Project"); - - b.Navigation("Tenant"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Projects.WorkArea", b => - { - b.HasOne("Marco.Pms.Model.Projects.Floor", "Floor") - .WithMany() - .HasForeignKey("FloorId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Marco.Pms.Model.Entitlements.Tenant", "Tenant") - .WithMany() - .HasForeignKey("TenantId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Floor"); - - b.Navigation("Tenant"); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim", b => - { - b.HasOne("Microsoft.AspNetCore.Identity.IdentityRole", null) - .WithMany() - .HasForeignKey("RoleId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim", b => - { - b.HasOne("Microsoft.AspNetCore.Identity.IdentityUser", null) - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin", b => - { - b.HasOne("Microsoft.AspNetCore.Identity.IdentityUser", null) - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole", b => - { - b.HasOne("Microsoft.AspNetCore.Identity.IdentityRole", null) - .WithMany() - .HasForeignKey("RoleId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Microsoft.AspNetCore.Identity.IdentityUser", null) - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken", b => - { - b.HasOne("Microsoft.AspNetCore.Identity.IdentityUser", null) - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Marco.Pms.Model.Activities.TaskAllocation", b => - { - b.Navigation("AllotedTask"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Entitlements.Feature", b => - { - b.Navigation("FeaturePermissions"); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/Marco.Pms.DataAccess/Migrations/20250206101247_updatefeaturesmaster.cs b/Marco.Pms.DataAccess/Migrations/20250206101247_updatefeaturesmaster.cs deleted file mode 100644 index db49b97..0000000 --- a/Marco.Pms.DataAccess/Migrations/20250206101247_updatefeaturesmaster.cs +++ /dev/null @@ -1,89 +0,0 @@ -using System; -using Microsoft.EntityFrameworkCore.Migrations; - -#nullable disable - -namespace Marco.Pms.DataAccess.Migrations -{ - /// - public partial class updatefeaturesmaster : Migration - { - /// - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.UpdateData( - table: "FeaturePermissions", - keyColumn: "Id", - keyValue: new Guid("d135a4b0-4f9a-4903-ab9c-4843839ebdee"), - column: "FeatureId", - value: new Guid("39e66f81-efc6-446c-95bd-46bff6cfb606")); - - migrationBuilder.UpdateData( - table: "FeaturePermissions", - keyColumn: "Id", - keyValue: new Guid("ed99ecd4-1bed-42e1-b7b3-d64c04493823"), - column: "FeatureId", - value: new Guid("39e66f81-efc6-446c-95bd-46bff6cfb606")); - - migrationBuilder.UpdateData( - table: "Modules", - keyColumn: "Id", - keyValue: 1, - column: "Key", - value: "b0aa1d10-7b8a-40f1-96b3-219e8de89ccb"); - - migrationBuilder.UpdateData( - table: "Modules", - keyColumn: "Id", - keyValue: 2, - column: "Key", - value: "19101abd-012e-4809-b153-da6bdbca0d7a"); - - migrationBuilder.UpdateData( - table: "Modules", - keyColumn: "Id", - keyValue: 3, - column: "Key", - value: "0cb9a301-edf2-4a15-8eeb-5bfea0ad4d90"); - } - - /// - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.UpdateData( - table: "FeaturePermissions", - keyColumn: "Id", - keyValue: new Guid("d135a4b0-4f9a-4903-ab9c-4843839ebdee"), - column: "FeatureId", - value: new Guid("81ab8a87-8ccd-4015-a917-0627cee6a100")); - - migrationBuilder.UpdateData( - table: "FeaturePermissions", - keyColumn: "Id", - keyValue: new Guid("ed99ecd4-1bed-42e1-b7b3-d64c04493823"), - column: "FeatureId", - value: new Guid("81ab8a87-8ccd-4015-a917-0627cee6a100")); - - migrationBuilder.UpdateData( - table: "Modules", - keyColumn: "Id", - keyValue: 1, - column: "Key", - value: "b29e3352-d83f-42eb-9c57-6e2cbf1b7c9b"); - - migrationBuilder.UpdateData( - table: "Modules", - keyColumn: "Id", - keyValue: 2, - column: "Key", - value: "d522bcb3-6965-4c2f-be14-dd18b3181a34"); - - migrationBuilder.UpdateData( - table: "Modules", - keyColumn: "Id", - keyValue: 3, - column: "Key", - value: "77302f42-93ec-49eb-9e05-80b80939639a"); - } - } -} diff --git a/Marco.Pms.DataAccess/Migrations/20250206114122_mapping.Designer.cs b/Marco.Pms.DataAccess/Migrations/20250206114122_mapping.Designer.cs deleted file mode 100644 index b61499a..0000000 --- a/Marco.Pms.DataAccess/Migrations/20250206114122_mapping.Designer.cs +++ /dev/null @@ -1,1706 +0,0 @@ -// -using System; -using Marco.Pms.DataAccess.Data; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Metadata; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; - -#nullable disable - -namespace Marco.Pms.DataAccess.Migrations -{ - [DbContext(typeof(ApplicationDbContext))] - [Migration("20250206114122_mapping")] - partial class mapping - { - /// - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasAnnotation("ProductVersion", "8.0.12") - .HasAnnotation("Relational:MaxIdentifierLength", 64); - - // MySqlModelBuilderExtensions.AutoIncrementColumns(modelBuilder); - - modelBuilder.Entity("Marco.Pms.Model.Activities.TaskAllocation", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - - b.Property("AllocationDate") - .HasColumnType("datetime(6)"); - - b.Property("BuildingId") - .HasColumnType("int"); - - b.Property("EmployeeId") - .HasColumnType("int"); - - b.Property("EmployeeRole") - .HasColumnType("int"); - - b.Property("ProjectId") - .HasColumnType("int"); - - b.Property("ReAllocationDate") - .HasColumnType("datetime(6)"); - - b.Property("TenantId") - .HasColumnType("int"); - - b.Property("WorkAreaId") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("BuildingId"); - - b.HasIndex("EmployeeId"); - - b.HasIndex("ProjectId"); - - b.HasIndex("TenantId"); - - b.HasIndex("WorkAreaId"); - - b.ToTable("TaskAllocations"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Activities.WorkItem", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - - b.Property("ActivityId") - .HasColumnType("int"); - - b.Property("CompletedWork") - .HasColumnType("int"); - - b.Property("PlannedWork") - .HasColumnType("int"); - - b.Property("TaskDate") - .HasColumnType("datetime(6)"); - - b.Property("TenantId") - .HasColumnType("int"); - - b.Property("WorkAreaId") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("ActivityId"); - - b.HasIndex("TenantId"); - - b.HasIndex("WorkAreaId"); - - b.ToTable("WorkItems"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Activities.WorkItemMapping", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - - b.Property("TenantId") - .HasColumnType("int"); - - b.Property("WorkAreaId") - .HasColumnType("int"); - - b.Property("WorkItemId") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("TenantId"); - - b.HasIndex("WorkAreaId"); - - b.HasIndex("WorkItemId"); - - b.ToTable("WorkItemMapping"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Authentication.RefreshToken", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - - b.Property("CreatedAt") - .HasColumnType("datetime(6)"); - - b.Property("ExpiryDate") - .HasColumnType("datetime(6)"); - - b.Property("IsRevoked") - .HasColumnType("tinyint(1)"); - - b.Property("IsUsed") - .HasColumnType("tinyint(1)"); - - b.Property("RevokedAt") - .HasColumnType("datetime(6)"); - - b.Property("Token") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("UserId") - .IsRequired() - .HasColumnType("varchar(255)"); - - b.HasKey("Id"); - - b.HasIndex("UserId"); - - b.ToTable("RefreshTokens"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Employees.Attendance", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - - b.Property("ApprovedBy") - .HasColumnType("longtext"); - - b.Property("Comment") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("Date") - .HasColumnType("datetime(6)"); - - b.Property("EmployeeID") - .HasColumnType("int"); - - b.Property("InTimeID") - .HasColumnType("int"); - - b.Property("IsApproved") - .HasColumnType("tinyint(1)"); - - b.Property("OutTimeID") - .HasColumnType("int"); - - b.Property("TenantId") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("EmployeeID"); - - b.HasIndex("InTimeID"); - - b.HasIndex("OutTimeID"); - - b.HasIndex("TenantId"); - - b.ToTable("Attendances"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Employees.AttendanceLog", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - - b.Property("CheckTime") - .HasColumnType("datetime(6)"); - - b.Property("Comment") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("EmployeeID") - .HasColumnType("int"); - - b.Property("IsCheckIn") - .HasColumnType("tinyint(1)"); - - b.Property("Latitude") - .HasColumnType("longtext"); - - b.Property("Longitude") - .HasColumnType("longtext"); - - b.Property("Photo") - .HasColumnType("longblob"); - - b.Property("TenantId") - .HasColumnType("int"); - - b.Property("UpdatedBy") - .HasColumnType("longtext"); - - b.HasKey("Id"); - - b.HasIndex("EmployeeID"); - - b.HasIndex("TenantId"); - - b.ToTable("AttendanceLogs"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Employees.Employee", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - - b.Property("AadharNumber") - .HasColumnType("longtext"); - - b.Property("ApplicationUserId") - .HasColumnType("varchar(255)"); - - b.Property("BirthDate") - .HasColumnType("datetime(6)"); - - b.Property("CurrentAddress") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("Email") - .HasColumnType("longtext"); - - b.Property("EmergencyPhoneNumber") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("FirstName") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("Gender") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("LastName") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("MiddleName") - .HasColumnType("longtext"); - - b.Property("PanNumber") - .HasColumnType("longtext"); - - b.Property("PeramnentAddress") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("PhoneNumber") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("Photo") - .HasColumnType("longblob"); - - b.Property("RoleId") - .HasColumnType("char(36)"); - - b.Property("TenantId") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("ApplicationUserId"); - - b.HasIndex("TenantId"); - - b.ToTable("Employees"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Employees.WorkShift", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - - b.Property("EndTime") - .HasColumnType("time(6)"); - - b.Property("Name") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("StartTime") - .HasColumnType("time(6)"); - - b.Property("TenantId") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("TenantId"); - - b.ToTable("WorkShifts"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Entitlements.ActivityMaster", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - - b.Property("ActivityName") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("TaskAllocationId") - .HasColumnType("int"); - - b.Property("TenantId") - .HasColumnType("int"); - - b.Property("UnitOfMeasurement") - .IsRequired() - .HasColumnType("longtext"); - - b.HasKey("Id"); - - b.HasIndex("TaskAllocationId"); - - b.HasIndex("TenantId"); - - b.ToTable("ActivityMasters"); - - b.HasData( - new - { - Id = 1, - ActivityName = "Core Cutting", - TenantId = 1, - UnitOfMeasurement = "Number" - }, - new - { - Id = 2, - ActivityName = "Fabrication", - TenantId = 1, - UnitOfMeasurement = "Meter" - }, - new - { - Id = 3, - ActivityName = "Lifting", - TenantId = 1, - UnitOfMeasurement = "Meter" - }, - new - { - Id = 4, - ActivityName = "Hanging", - TenantId = 1, - UnitOfMeasurement = "Meter" - }, - new - { - Id = 5, - ActivityName = "Tapping", - TenantId = 1, - UnitOfMeasurement = "Meter" - }, - new - { - Id = 6, - ActivityName = "Welding", - TenantId = 1, - UnitOfMeasurement = "Meter" - }, - new - { - Id = 7, - ActivityName = "Testing", - TenantId = 1, - UnitOfMeasurement = "Area" - }, - new - { - Id = 8, - ActivityName = "Painting", - TenantId = 1, - UnitOfMeasurement = "Meter" - }, - new - { - Id = 9, - ActivityName = "Marking Area", - TenantId = 1, - UnitOfMeasurement = "Meter" - }, - new - { - Id = 10, - ActivityName = "Drilling", - TenantId = 1, - UnitOfMeasurement = "Number" - }, - new - { - Id = 11, - ActivityName = "MS Support Fabrication", - TenantId = 1, - UnitOfMeasurement = "Number" - }, - new - { - Id = 12, - ActivityName = "MS Support Hanging", - TenantId = 1, - UnitOfMeasurement = "Number" - }, - new - { - Id = 13, - ActivityName = "Hydrant Volve", - TenantId = 1, - UnitOfMeasurement = "Number" - }, - new - { - Id = 14, - ActivityName = "Sprinkler Installation", - TenantId = 1, - UnitOfMeasurement = "Number" - }); - }); - - - modelBuilder.Entity("Marco.Pms.Model.Entitlements.Feature", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("char(36)"); - - b.Property("Description") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("IsActive") - .HasColumnType("tinyint(1)"); - - b.Property("ModuleId") - .HasColumnType("int"); - - b.Property("Name") - .IsRequired() - .HasColumnType("longtext"); - - b.HasKey("Id"); - - b.HasIndex("ModuleId"); - - b.ToTable("Features"); - - b.HasData( - new - { - Id = new Guid("53176ebf-c75d-42e5-839f-4508ffac3def"), - Description = "Manage Project", - IsActive = true, - ModuleId = 1, - Name = "Manage Project" - }, - new - { - Id = new Guid("9666de86-d7c7-4d3d-acaa-fcd6d6b81f3c"), - Description = "Manage Infra", - IsActive = true, - ModuleId = 1, - Name = "Manage Infra" - }, - new - { - Id = new Guid("9d4b5489-2079-40b9-bd77-6e1bf90bc19f"), - Description = "Manage Tasks", - IsActive = true, - ModuleId = 1, - Name = "Manage Tasks" - }, - new - { - Id = new Guid("39e66f81-efc6-446c-95bd-46bff6cfb606"), - Description = "Assign and Update Tasks Progress", - IsActive = true, - ModuleId = 1, - Name = "Assign and Update Tasks Progress" - }, - new - { - Id = new Guid("81ab8a87-8ccd-4015-a917-0627cee6a100"), - Description = "Manage Employee", - IsActive = true, - ModuleId = 2, - Name = "Manage Employee" - }, - new - { - Id = new Guid("52c9cf54-1eb2-44d2-81bb-524cf29c0a94"), - Description = "Attendance", - IsActive = true, - ModuleId = 2, - Name = "Attendance" - }, - new - { - Id = new Guid("be3b3afc-6ccf-4566-b9b6-aafcb65546be"), - Description = "Global Masters", - IsActive = true, - ModuleId = 3, - Name = "Global Masters" - }, - new - { - Id = new Guid("660131a4-788c-4739-a082-cbbf7879cbf2"), - Description = "Tenant Masters", - IsActive = true, - ModuleId = 3, - Name = "Tenant Masters" - }); - }); - - modelBuilder.Entity("Marco.Pms.Model.Entitlements.FeaturePermission", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("char(36)"); - - b.Property("Description") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("FeatureId") - .HasColumnType("char(36)"); - - b.Property("IsEnabled") - .HasColumnType("tinyint(1)"); - - b.Property("Name") - .IsRequired() - .HasColumnType("longtext"); - - b.HasKey("Id"); - - b.HasIndex("FeatureId"); - - b.ToTable("FeaturePermissions"); - - b.HasData( - new - { - Id = new Guid("6ea44136-987e-44ba-9e5d-1cf8f5837ebc"), - Description = "", - FeatureId = new Guid("53176ebf-c75d-42e5-839f-4508ffac3def"), - IsEnabled = true, - Name = "View Project" - }, - new - { - Id = new Guid("172fc9b6-755b-4f62-ab26-55c34a330614"), - Description = "", - FeatureId = new Guid("53176ebf-c75d-42e5-839f-4508ffac3def"), - IsEnabled = true, - Name = "Manage Project" - }, - new - { - Id = new Guid("b94802ce-0689-4643-9e1d-11c86950c35b"), - Description = "", - FeatureId = new Guid("53176ebf-c75d-42e5-839f-4508ffac3def"), - IsEnabled = true, - Name = "Manage Team" - }, - new - { - Id = new Guid("c7b68e33-72f0-474f-bd96-77636427ecc8"), - Description = "", - FeatureId = new Guid("9666de86-d7c7-4d3d-acaa-fcd6d6b81f3c"), - IsEnabled = true, - Name = "View Project Infra" - }, - new - { - Id = new Guid("f2aee20a-b754-4537-8166-f9507b44585b"), - Description = "", - FeatureId = new Guid("9666de86-d7c7-4d3d-acaa-fcd6d6b81f3c"), - IsEnabled = true, - Name = "Manage Project Infra" - }, - new - { - Id = new Guid("9fcc5f87-25e3-4846-90ac-67a71ab92e3c"), - Description = "", - FeatureId = new Guid("9d4b5489-2079-40b9-bd77-6e1bf90bc19f"), - IsEnabled = true, - Name = "View Task" - }, - new - { - Id = new Guid("08752f33-3b29-4816-b76b-ea8a968ed3c5"), - Description = "", - FeatureId = new Guid("9d4b5489-2079-40b9-bd77-6e1bf90bc19f"), - IsEnabled = true, - Name = "Manage Task" - }, - new - { - Id = new Guid("d135a4b0-4f9a-4903-ab9c-4843839ebdee"), - Description = "", - FeatureId = new Guid("39e66f81-efc6-446c-95bd-46bff6cfb606"), - IsEnabled = true, - Name = "Assign Task and Report Progress" - }, - new - { - Id = new Guid("ed99ecd4-1bed-42e1-b7b3-d64c04493823"), - Description = "", - FeatureId = new Guid("39e66f81-efc6-446c-95bd-46bff6cfb606"), - IsEnabled = true, - Name = "Approve Task" - }, - new - { - Id = new Guid("b82d2b7e-0d52-45f3-997b-c008ea460e7f"), - Description = "", - FeatureId = new Guid("81ab8a87-8ccd-4015-a917-0627cee6a100"), - IsEnabled = true, - Name = "View Employee" - }, - new - { - Id = new Guid("a97d366a-c2bb-448d-be93-402bd2324566"), - Description = "", - FeatureId = new Guid("81ab8a87-8ccd-4015-a917-0627cee6a100"), - IsEnabled = true, - Name = "Manage Employee" - }, - new - { - Id = new Guid("fbd213e0-0250-46f1-9f5f-4b2a1e6e76a3"), - Description = "", - FeatureId = new Guid("81ab8a87-8ccd-4015-a917-0627cee6a100"), - IsEnabled = true, - Name = "Assign To Project" - }, - new - { - Id = new Guid("915e6bff-65f6-4e3f-aea8-3fd217d3ea9e"), - Description = "", - FeatureId = new Guid("52c9cf54-1eb2-44d2-81bb-524cf29c0a94"), - IsEnabled = true, - Name = "Perform Attendance " - }, - new - { - Id = new Guid("57802c4a-00aa-4a1f-a048-fd2f70dd44b6"), - Description = "", - FeatureId = new Guid("52c9cf54-1eb2-44d2-81bb-524cf29c0a94"), - IsEnabled = true, - Name = "Regularize Attendance" - }, - new - { - Id = new Guid("5ffbafe0-7ab0-48b1-bb50-c1bf76b65f9d"), - Description = "", - FeatureId = new Guid("be3b3afc-6ccf-4566-b9b6-aafcb65546be"), - IsEnabled = true, - Name = "View Masters" - }, - new - { - Id = new Guid("588a8824-f924-4955-82d8-fc51956cf323"), - Description = "", - FeatureId = new Guid("be3b3afc-6ccf-4566-b9b6-aafcb65546be"), - IsEnabled = true, - Name = "Manage Masters" - }, - new - { - Id = new Guid("cb8ec407-46d4-4467-930c-69127cda6dec"), - Description = "", - FeatureId = new Guid("660131a4-788c-4739-a082-cbbf7879cbf2"), - IsEnabled = true, - Name = "View Masters" - }, - new - { - Id = new Guid("6b1a6d97-a951-4de5-9b19-709bac7c4f18"), - Description = "", - FeatureId = new Guid("660131a4-788c-4739-a082-cbbf7879cbf2"), - IsEnabled = true, - Name = "Manage Masters" - }); - }); - - modelBuilder.Entity("Marco.Pms.Model.Entitlements.Module", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - - b.Property("Description") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("Key") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("Name") - .IsRequired() - .HasColumnType("longtext"); - - b.HasKey("Id"); - - b.ToTable("Modules"); - - b.HasData( - new - { - Id = 1, - Description = "Project Module", - Key = "eec3cf92-01c2-41a2-bfc1-f3c2af318848", - Name = "Project" - }, - new - { - Id = 2, - Description = "Employee Module", - Key = "6a22bf2f-e8f0-4164-aedc-307b370b4ef6", - Name = "Employee" - }, - new - { - Id = 3, - Description = "Masters Module", - Key = "69a68bf1-30e7-45fc-ab75-0c11ea10bfc3", - Name = "Masters" - }); - }); - - - modelBuilder.Entity("Marco.Pms.Model.Entitlements.StatusMaster", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - - b.Property("Status") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("TenantId") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("TenantId"); - - b.ToTable("StatusMasters"); - - b.HasData( - new - { - Id = 1, - Status = "Active", - TenantId = 1 - }, - new - { - Id = 2, - Status = "In Progress", - TenantId = 1 - }, - new - { - Id = 3, - Status = "On Hold", - TenantId = 1 - }, - new - { - Id = 4, - Status = "Completed", - TenantId = 1 - }); - }); - - modelBuilder.Entity("Marco.Pms.Model.Entitlements.Tenant", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - - b.Property("ContactName") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("ContactNumber") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("Description") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("DomainName") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("Name") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("OnBoardingDate") - .HasColumnType("datetime(6)"); - - b.HasKey("Id"); - - b.ToTable("Tenants"); - - b.HasData( - new - { - Id = 1, - ContactName = "Admin", - ContactNumber = "123456789", - Description = "", - DomainName = "www.marcobms.org", - Name = "MarcoBMS", - OnBoardingDate = new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified) - }); - }); - - modelBuilder.Entity("Marco.Pms.Model.Projects.Building", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - - b.Property("Description") - .HasColumnType("longtext"); - - b.Property("Name") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("ProjectId") - .HasColumnType("int"); - - b.Property("TenantId") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("TenantId"); - - b.ToTable("Buildings"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Projects.Floor", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - - b.Property("BuildingId") - .HasColumnType("int"); - - b.Property("FloorName") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("TenantId") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("BuildingId"); - - b.HasIndex("TenantId"); - - b.ToTable("Floor"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Projects.Project", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - - b.Property("ContactPerson") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("EndDate") - .HasColumnType("datetime(6)"); - - b.Property("Name") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("ProjectAddress") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("ProjectStatusId") - .HasColumnType("int"); - - b.Property("StartDate") - .HasColumnType("datetime(6)"); - - b.Property("TenantId") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("ProjectStatusId"); - - b.HasIndex("TenantId"); - - b.ToTable("Projects"); - - b.HasData( - new - { - Id = 1, - ContactPerson = "Project 1 Contact Person", - Name = "Project 1", - ProjectAddress = "Project 1 Address", - ProjectStatusId = 1, - TenantId = 1 - }, - new - { - Id = 2, - ContactPerson = "Project 2 Contact Person", - Name = "Project 2", - ProjectAddress = "Project 2 Address", - ProjectStatusId = 2, - TenantId = 1 - }, - new - { - Id = 3, - ContactPerson = "Project 3 Contact Person", - Name = "Project 3", - ProjectAddress = "Project 3 Address", - ProjectStatusId = 3, - TenantId = 1 - }); - }); - - modelBuilder.Entity("Marco.Pms.Model.Projects.ProjectAllocation", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - - b.Property("AllocationDate") - .HasColumnType("datetime(6)"); - - b.Property("EmployeeId") - .HasColumnType("int"); - - b.Property("EmployeeRoleId") - .HasColumnType("char(36)"); - - b.Property("ProjectId") - .HasColumnType("int"); - - b.Property("ReAllocationDate") - .HasColumnType("datetime(6)"); - - b.Property("TenantId") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("EmployeeId"); - - b.HasIndex("ProjectId"); - - b.HasIndex("TenantId"); - - b.ToTable("ProjectAllocations"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Projects.WorkArea", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - - b.Property("AreaName") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("FloorId") - .HasColumnType("int"); - - b.Property("TenantId") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("FloorId"); - - b.HasIndex("TenantId"); - - b.ToTable("WorkAreas"); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRole", b => - { - b.Property("Id") - .HasColumnType("varchar(255)"); - - b.Property("ConcurrencyStamp") - .IsConcurrencyToken() - .HasColumnType("longtext"); - - b.Property("Name") - .HasMaxLength(256) - .HasColumnType("varchar(256)"); - - b.Property("NormalizedName") - .HasMaxLength(256) - .HasColumnType("varchar(256)"); - - b.HasKey("Id"); - - b.HasIndex("NormalizedName") - .IsUnique() - .HasDatabaseName("RoleNameIndex"); - - b.ToTable("AspNetRoles", (string)null); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - - b.Property("ClaimType") - .HasColumnType("longtext"); - - b.Property("ClaimValue") - .HasColumnType("longtext"); - - b.Property("RoleId") - .IsRequired() - .HasColumnType("varchar(255)"); - - b.HasKey("Id"); - - b.HasIndex("RoleId"); - - b.ToTable("AspNetRoleClaims", (string)null); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUser", b => - { - b.Property("Id") - .HasColumnType("varchar(255)"); - - b.Property("AccessFailedCount") - .HasColumnType("int"); - - b.Property("ConcurrencyStamp") - .IsConcurrencyToken() - .HasColumnType("longtext"); - - b.Property("Discriminator") - .IsRequired() - .HasMaxLength(21) - .HasColumnType("varchar(21)"); - - b.Property("Email") - .HasMaxLength(256) - .HasColumnType("varchar(256)"); - - b.Property("EmailConfirmed") - .HasColumnType("tinyint(1)"); - - b.Property("LockoutEnabled") - .HasColumnType("tinyint(1)"); - - b.Property("LockoutEnd") - .HasColumnType("datetime(6)"); - - b.Property("NormalizedEmail") - .HasMaxLength(256) - .HasColumnType("varchar(256)"); - - b.Property("NormalizedUserName") - .HasMaxLength(256) - .HasColumnType("varchar(256)"); - - b.Property("PasswordHash") - .HasColumnType("longtext"); - - b.Property("PhoneNumber") - .HasColumnType("longtext"); - - b.Property("PhoneNumberConfirmed") - .HasColumnType("tinyint(1)"); - - b.Property("SecurityStamp") - .HasColumnType("longtext"); - - b.Property("TwoFactorEnabled") - .HasColumnType("tinyint(1)"); - - b.Property("UserName") - .HasMaxLength(256) - .HasColumnType("varchar(256)"); - - b.HasKey("Id"); - - b.HasIndex("NormalizedEmail") - .HasDatabaseName("EmailIndex"); - - b.HasIndex("NormalizedUserName") - .IsUnique() - .HasDatabaseName("UserNameIndex"); - - b.ToTable("AspNetUsers", (string)null); - - b.HasDiscriminator().HasValue("IdentityUser"); - - b.UseTphMappingStrategy(); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - - b.Property("ClaimType") - .HasColumnType("longtext"); - - b.Property("ClaimValue") - .HasColumnType("longtext"); - - b.Property("UserId") - .IsRequired() - .HasColumnType("varchar(255)"); - - b.HasKey("Id"); - - b.HasIndex("UserId"); - - b.ToTable("AspNetUserClaims", (string)null); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin", b => - { - b.Property("LoginProvider") - .HasColumnType("varchar(255)"); - - b.Property("ProviderKey") - .HasColumnType("varchar(255)"); - - b.Property("ProviderDisplayName") - .HasColumnType("longtext"); - - b.Property("UserId") - .IsRequired() - .HasColumnType("varchar(255)"); - - b.HasKey("LoginProvider", "ProviderKey"); - - b.HasIndex("UserId"); - - b.ToTable("AspNetUserLogins", (string)null); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole", b => - { - b.Property("UserId") - .HasColumnType("varchar(255)"); - - b.Property("RoleId") - .HasColumnType("varchar(255)"); - - b.HasKey("UserId", "RoleId"); - - b.HasIndex("RoleId"); - - b.ToTable("AspNetUserRoles", (string)null); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken", b => - { - b.Property("UserId") - .HasColumnType("varchar(255)"); - - b.Property("LoginProvider") - .HasColumnType("varchar(255)"); - - b.Property("Name") - .HasColumnType("varchar(255)"); - - b.Property("Value") - .HasColumnType("longtext"); - - b.HasKey("UserId", "LoginProvider", "Name"); - - b.ToTable("AspNetUserTokens", (string)null); - }); - - modelBuilder.Entity("Marco.Pms.Model.Entitlements.ApplicationUser", b => - { - b.HasBaseType("Microsoft.AspNetCore.Identity.IdentityUser"); - - b.Property("IsRootUser") - .HasColumnType("tinyint(1)"); - - b.Property("Role") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("TenantId") - .HasColumnType("int"); - - b.HasDiscriminator().HasValue("ApplicationUser"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Activities.TaskAllocation", b => - { - b.HasOne("Marco.Pms.Model.Projects.Building", "Building") - .WithMany() - .HasForeignKey("BuildingId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Marco.Pms.Model.Employees.Employee", "Employee") - .WithMany() - .HasForeignKey("EmployeeId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Marco.Pms.Model.Projects.Project", "Project") - .WithMany() - .HasForeignKey("ProjectId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Marco.Pms.Model.Entitlements.Tenant", "Tenant") - .WithMany() - .HasForeignKey("TenantId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Marco.Pms.Model.Projects.WorkArea", "WorkArea") - .WithMany() - .HasForeignKey("WorkAreaId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Building"); - - b.Navigation("Employee"); - - b.Navigation("Project"); - - b.Navigation("Tenant"); - - b.Navigation("WorkArea"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Activities.WorkItem", b => - { - b.HasOne("Marco.Pms.Model.Entitlements.ActivityMaster", "ActivityMaster") - .WithMany() - .HasForeignKey("ActivityId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Marco.Pms.Model.Entitlements.Tenant", "Tenant") - .WithMany() - .HasForeignKey("TenantId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Marco.Pms.Model.Projects.WorkArea", "WorkArea") - .WithMany() - .HasForeignKey("WorkAreaId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("ActivityMaster"); - - b.Navigation("Tenant"); - - b.Navigation("WorkArea"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Activities.WorkItemMapping", b => - { - b.HasOne("Marco.Pms.Model.Entitlements.Tenant", "Tenant") - .WithMany() - .HasForeignKey("TenantId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Marco.Pms.Model.Projects.WorkArea", "WorkArea") - .WithMany() - .HasForeignKey("WorkAreaId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Marco.Pms.Model.Activities.WorkItem", "WorkItem") - .WithMany() - .HasForeignKey("WorkItemId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Tenant"); - - b.Navigation("WorkArea"); - - b.Navigation("WorkItem"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Authentication.RefreshToken", b => - { - b.HasOne("Microsoft.AspNetCore.Identity.IdentityUser", "User") - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("User"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Employees.Attendance", b => - { - b.HasOne("Marco.Pms.Model.Employees.Employee", "Employee") - .WithMany() - .HasForeignKey("EmployeeID") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Marco.Pms.Model.Employees.AttendanceLog", "InTimeLog") - .WithMany() - .HasForeignKey("InTimeID"); - - b.HasOne("Marco.Pms.Model.Employees.AttendanceLog", "OutTimeLog") - .WithMany() - .HasForeignKey("OutTimeID"); - - b.HasOne("Marco.Pms.Model.Entitlements.Tenant", "Tenant") - .WithMany() - .HasForeignKey("TenantId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Employee"); - - b.Navigation("InTimeLog"); - - b.Navigation("OutTimeLog"); - - b.Navigation("Tenant"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Employees.AttendanceLog", b => - { - b.HasOne("Marco.Pms.Model.Employees.Employee", "Employee") - .WithMany() - .HasForeignKey("EmployeeID") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Marco.Pms.Model.Entitlements.Tenant", "Tenant") - .WithMany() - .HasForeignKey("TenantId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Employee"); - - b.Navigation("Tenant"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Employees.Employee", b => - { - b.HasOne("Marco.Pms.Model.Entitlements.ApplicationUser", "ApplicationUser") - .WithMany() - .HasForeignKey("ApplicationUserId"); - - b.HasOne("Marco.Pms.Model.Entitlements.Tenant", "Tenant") - .WithMany() - .HasForeignKey("TenantId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("ApplicationUser"); - - b.Navigation("Tenant"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Employees.WorkShift", b => - { - b.HasOne("Marco.Pms.Model.Entitlements.Tenant", "Tenant") - .WithMany() - .HasForeignKey("TenantId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Tenant"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Entitlements.ActivityMaster", b => - { - b.HasOne("Marco.Pms.Model.Activities.TaskAllocation", null) - .WithMany("AllotedTask") - .HasForeignKey("TaskAllocationId"); - - b.HasOne("Marco.Pms.Model.Entitlements.Tenant", "Tenant") - .WithMany() - .HasForeignKey("TenantId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Tenant"); - }); - - - modelBuilder.Entity("Marco.Pms.Model.Entitlements.FeaturePermission", b => - { - b.HasOne("Marco.Pms.Model.Entitlements.Feature", "Feature") - .WithMany("FeaturePermissions") - .HasForeignKey("FeatureId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Feature"); - }); - - - modelBuilder.Entity("Marco.Pms.Model.Entitlements.StatusMaster", b => - { - b.HasOne("Marco.Pms.Model.Entitlements.Tenant", "Tenant") - .WithMany() - .HasForeignKey("TenantId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Tenant"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Projects.Building", b => - { - b.HasOne("Marco.Pms.Model.Entitlements.Tenant", "Tenant") - .WithMany() - .HasForeignKey("TenantId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Tenant"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Projects.Floor", b => - { - b.HasOne("Marco.Pms.Model.Projects.Building", "Building") - .WithMany() - .HasForeignKey("BuildingId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Marco.Pms.Model.Entitlements.Tenant", "Tenant") - .WithMany() - .HasForeignKey("TenantId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Building"); - - b.Navigation("Tenant"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Projects.Project", b => - { - b.HasOne("Marco.Pms.Model.Entitlements.StatusMaster", "ProjectStatus") - .WithMany() - .HasForeignKey("ProjectStatusId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Marco.Pms.Model.Entitlements.Tenant", "Tenant") - .WithMany() - .HasForeignKey("TenantId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("ProjectStatus"); - - b.Navigation("Tenant"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Projects.ProjectAllocation", b => - { - b.HasOne("Marco.Pms.Model.Employees.Employee", "Employee") - .WithMany() - .HasForeignKey("EmployeeId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Marco.Pms.Model.Projects.Project", "Project") - .WithMany() - .HasForeignKey("ProjectId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Marco.Pms.Model.Entitlements.Tenant", "Tenant") - .WithMany() - .HasForeignKey("TenantId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Employee"); - - b.Navigation("Project"); - - b.Navigation("Tenant"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Projects.WorkArea", b => - { - b.HasOne("Marco.Pms.Model.Projects.Floor", "Floor") - .WithMany() - .HasForeignKey("FloorId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Marco.Pms.Model.Entitlements.Tenant", "Tenant") - .WithMany() - .HasForeignKey("TenantId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Floor"); - - b.Navigation("Tenant"); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim", b => - { - b.HasOne("Microsoft.AspNetCore.Identity.IdentityRole", null) - .WithMany() - .HasForeignKey("RoleId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim", b => - { - b.HasOne("Microsoft.AspNetCore.Identity.IdentityUser", null) - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin", b => - { - b.HasOne("Microsoft.AspNetCore.Identity.IdentityUser", null) - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole", b => - { - b.HasOne("Microsoft.AspNetCore.Identity.IdentityRole", null) - .WithMany() - .HasForeignKey("RoleId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Microsoft.AspNetCore.Identity.IdentityUser", null) - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken", b => - { - b.HasOne("Microsoft.AspNetCore.Identity.IdentityUser", null) - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Marco.Pms.Model.Activities.TaskAllocation", b => - { - b.Navigation("AllotedTask"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Entitlements.Feature", b => - { - b.Navigation("FeaturePermissions"); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/Marco.Pms.DataAccess/Migrations/20250206114122_mapping.cs b/Marco.Pms.DataAccess/Migrations/20250206114122_mapping.cs deleted file mode 100644 index de18d58..0000000 --- a/Marco.Pms.DataAccess/Migrations/20250206114122_mapping.cs +++ /dev/null @@ -1,65 +0,0 @@ -using Microsoft.EntityFrameworkCore.Migrations; - -#nullable disable - -namespace Marco.Pms.DataAccess.Migrations -{ - /// - public partial class mapping : Migration - { - /// - protected override void Up(MigrationBuilder migrationBuilder) - { - - - migrationBuilder.UpdateData( - table: "Modules", - keyColumn: "Id", - keyValue: 1, - column: "Key", - value: "eec3cf92-01c2-41a2-bfc1-f3c2af318848"); - - migrationBuilder.UpdateData( - table: "Modules", - keyColumn: "Id", - keyValue: 2, - column: "Key", - value: "6a22bf2f-e8f0-4164-aedc-307b370b4ef6"); - - migrationBuilder.UpdateData( - table: "Modules", - keyColumn: "Id", - keyValue: 3, - column: "Key", - value: "69a68bf1-30e7-45fc-ab75-0c11ea10bfc3"); - - } - - /// - protected override void Down(MigrationBuilder migrationBuilder) - { - - migrationBuilder.UpdateData( - table: "Modules", - keyColumn: "Id", - keyValue: 1, - column: "Key", - value: "b0aa1d10-7b8a-40f1-96b3-219e8de89ccb"); - - migrationBuilder.UpdateData( - table: "Modules", - keyColumn: "Id", - keyValue: 2, - column: "Key", - value: "19101abd-012e-4809-b153-da6bdbca0d7a"); - - migrationBuilder.UpdateData( - table: "Modules", - keyColumn: "Id", - keyValue: 3, - column: "Key", - value: "0cb9a301-edf2-4a15-8eeb-5bfea0ad4d90"); - - } - } -} diff --git a/Marco.Pms.DataAccess/Migrations/20250207070319_RolePermissionMappings.Designer.cs b/Marco.Pms.DataAccess/Migrations/20250207070319_RolePermissionMappings.Designer.cs deleted file mode 100644 index 372f280..0000000 --- a/Marco.Pms.DataAccess/Migrations/20250207070319_RolePermissionMappings.Designer.cs +++ /dev/null @@ -1,1813 +0,0 @@ -// -using System; -using Marco.Pms.DataAccess.Data; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Metadata; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; - -#nullable disable - -namespace Marco.Pms.DataAccess.Migrations -{ - [DbContext(typeof(ApplicationDbContext))] - [Migration("20250207070319_RolePermissionMappings")] - partial class RolePermissionMappings - { - /// - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasAnnotation("ProductVersion", "8.0.12") - .HasAnnotation("Relational:MaxIdentifierLength", 64); - - //MySqlModelBuilderExtensions.AutoIncrementColumns(modelBuilder); - - modelBuilder.Entity("Marco.Pms.Model.Activities.TaskAllocation", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - - b.Property("AllocationDate") - .HasColumnType("datetime(6)"); - - b.Property("BuildingId") - .HasColumnType("int"); - - b.Property("EmployeeId") - .HasColumnType("int"); - - b.Property("EmployeeRole") - .HasColumnType("int"); - - b.Property("ProjectId") - .HasColumnType("int"); - - b.Property("ReAllocationDate") - .HasColumnType("datetime(6)"); - - b.Property("TenantId") - .HasColumnType("int"); - - b.Property("WorkAreaId") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("BuildingId"); - - b.HasIndex("EmployeeId"); - - b.HasIndex("ProjectId"); - - b.HasIndex("TenantId"); - - b.HasIndex("WorkAreaId"); - - b.ToTable("TaskAllocations"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Activities.WorkItem", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - - b.Property("ActivityId") - .HasColumnType("int"); - - b.Property("CompletedWork") - .HasColumnType("int"); - - b.Property("PlannedWork") - .HasColumnType("int"); - - b.Property("TaskDate") - .HasColumnType("datetime(6)"); - - b.Property("TenantId") - .HasColumnType("int"); - - b.Property("WorkAreaId") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("ActivityId"); - - b.HasIndex("TenantId"); - - b.HasIndex("WorkAreaId"); - - b.ToTable("WorkItems"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Activities.WorkItemMapping", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - - b.Property("TenantId") - .HasColumnType("int"); - - b.Property("WorkAreaId") - .HasColumnType("int"); - - b.Property("WorkItemId") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("TenantId"); - - b.HasIndex("WorkAreaId"); - - b.HasIndex("WorkItemId"); - - b.ToTable("WorkItemMapping"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Authentication.RefreshToken", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - - b.Property("CreatedAt") - .HasColumnType("datetime(6)"); - - b.Property("ExpiryDate") - .HasColumnType("datetime(6)"); - - b.Property("IsRevoked") - .HasColumnType("tinyint(1)"); - - b.Property("IsUsed") - .HasColumnType("tinyint(1)"); - - b.Property("RevokedAt") - .HasColumnType("datetime(6)"); - - b.Property("Token") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("UserId") - .IsRequired() - .HasColumnType("varchar(255)"); - - b.HasKey("Id"); - - b.HasIndex("UserId"); - - b.ToTable("RefreshTokens"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Employees.Attendance", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - - b.Property("ApprovedBy") - .HasColumnType("longtext"); - - b.Property("Comment") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("Date") - .HasColumnType("datetime(6)"); - - b.Property("EmployeeID") - .HasColumnType("int"); - - b.Property("InTimeID") - .HasColumnType("int"); - - b.Property("IsApproved") - .HasColumnType("tinyint(1)"); - - b.Property("OutTimeID") - .HasColumnType("int"); - - b.Property("TenantId") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("EmployeeID"); - - b.HasIndex("InTimeID"); - - b.HasIndex("OutTimeID"); - - b.HasIndex("TenantId"); - - b.ToTable("Attendances"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Employees.AttendanceLog", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - - b.Property("CheckTime") - .HasColumnType("datetime(6)"); - - b.Property("Comment") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("EmployeeID") - .HasColumnType("int"); - - b.Property("IsCheckIn") - .HasColumnType("tinyint(1)"); - - b.Property("Latitude") - .HasColumnType("longtext"); - - b.Property("Longitude") - .HasColumnType("longtext"); - - b.Property("Photo") - .HasColumnType("longblob"); - - b.Property("TenantId") - .HasColumnType("int"); - - b.Property("UpdatedBy") - .HasColumnType("longtext"); - - b.HasKey("Id"); - - b.HasIndex("EmployeeID"); - - b.HasIndex("TenantId"); - - b.ToTable("AttendanceLogs"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Employees.Employee", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - - b.Property("AadharNumber") - .HasColumnType("longtext"); - - b.Property("ApplicationUserId") - .HasColumnType("varchar(255)"); - - b.Property("BirthDate") - .HasColumnType("datetime(6)"); - - b.Property("CurrentAddress") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("Email") - .HasColumnType("longtext"); - - b.Property("EmergencyPhoneNumber") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("FirstName") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("Gender") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("LastName") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("MiddleName") - .HasColumnType("longtext"); - - b.Property("PanNumber") - .HasColumnType("longtext"); - - b.Property("PeramnentAddress") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("PhoneNumber") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("Photo") - .HasColumnType("longblob"); - - b.Property("RoleId") - .HasColumnType("char(36)"); - - b.Property("TenantId") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("ApplicationUserId"); - - b.HasIndex("TenantId"); - - b.ToTable("Employees"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Employees.WorkShift", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - - b.Property("EndTime") - .HasColumnType("time(6)"); - - b.Property("Name") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("StartTime") - .HasColumnType("time(6)"); - - b.Property("TenantId") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("TenantId"); - - b.ToTable("WorkShifts"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Entitlements.ActivityMaster", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - - b.Property("ActivityName") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("TaskAllocationId") - .HasColumnType("int"); - - b.Property("TenantId") - .HasColumnType("int"); - - b.Property("UnitOfMeasurement") - .IsRequired() - .HasColumnType("longtext"); - - b.HasKey("Id"); - - b.HasIndex("TaskAllocationId"); - - b.HasIndex("TenantId"); - - b.ToTable("ActivityMasters"); - - b.HasData( - new - { - Id = 1, - ActivityName = "Core Cutting", - TenantId = 1, - UnitOfMeasurement = "Number" - }, - new - { - Id = 2, - ActivityName = "Fabrication", - TenantId = 1, - UnitOfMeasurement = "Meter" - }, - new - { - Id = 3, - ActivityName = "Lifting", - TenantId = 1, - UnitOfMeasurement = "Meter" - }, - new - { - Id = 4, - ActivityName = "Hanging", - TenantId = 1, - UnitOfMeasurement = "Meter" - }, - new - { - Id = 5, - ActivityName = "Tapping", - TenantId = 1, - UnitOfMeasurement = "Meter" - }, - new - { - Id = 6, - ActivityName = "Welding", - TenantId = 1, - UnitOfMeasurement = "Meter" - }, - new - { - Id = 7, - ActivityName = "Testing", - TenantId = 1, - UnitOfMeasurement = "Area" - }, - new - { - Id = 8, - ActivityName = "Painting", - TenantId = 1, - UnitOfMeasurement = "Meter" - }, - new - { - Id = 9, - ActivityName = "Marking Area", - TenantId = 1, - UnitOfMeasurement = "Meter" - }, - new - { - Id = 10, - ActivityName = "Drilling", - TenantId = 1, - UnitOfMeasurement = "Number" - }, - new - { - Id = 11, - ActivityName = "MS Support Fabrication", - TenantId = 1, - UnitOfMeasurement = "Number" - }, - new - { - Id = 12, - ActivityName = "MS Support Hanging", - TenantId = 1, - UnitOfMeasurement = "Number" - }, - new - { - Id = 13, - ActivityName = "Hydrant Volve", - TenantId = 1, - UnitOfMeasurement = "Number" - }, - new - { - Id = 14, - ActivityName = "Sprinkler Installation", - TenantId = 1, - UnitOfMeasurement = "Number" - }); - }); - - modelBuilder.Entity("Marco.Pms.Model.Entitlements.ApplicationRole", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("char(36)"); - - b.Property("Description") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("Role") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("TenantId") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("TenantId"); - - b.ToTable("ApplicationRoles"); - - b.HasData( - new - { - Id = new Guid("2c8d0808-c421-11ef-9b93-0242ac110002"), - Description = "", - Role = "Admin", - TenantId = 1 - }, - new - { - Id = new Guid("62e0918d-c421-11ef-9b93-0242ac110002"), - Description = "", - Role = "Welder", - TenantId = 1 - }, - new - { - Id = new Guid("68823f1f-c421-11ef-9b93-0242ac110002"), - Description = "", - Role = "Helper", - TenantId = 1 - }, - new - { - Id = new Guid("6d3a7c72-c421-11ef-9b93-0242ac110002"), - Description = "", - Role = "Site Engineer", - TenantId = 1 - }, - new - { - Id = new Guid("6d3aad72-c421-11ef-9b93-0242ac110002"), - Description = "", - Role = "Project Manager", - TenantId = 1 - }); - }); - - modelBuilder.Entity("Marco.Pms.Model.Entitlements.Feature", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("char(36)"); - - b.Property("Description") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("IsActive") - .HasColumnType("tinyint(1)"); - - b.Property("ModuleId") - .HasColumnType("int"); - - b.Property("Name") - .IsRequired() - .HasColumnType("longtext"); - - b.HasKey("Id"); - - b.HasIndex("ModuleId"); - - b.ToTable("Features"); - - b.HasData( - new - { - Id = new Guid("53176ebf-c75d-42e5-839f-4508ffac3def"), - Description = "Manage Project", - IsActive = true, - ModuleId = 1, - Name = "Manage Project" - }, - new - { - Id = new Guid("9666de86-d7c7-4d3d-acaa-fcd6d6b81f3c"), - Description = "Manage Infra", - IsActive = true, - ModuleId = 1, - Name = "Manage Infra" - }, - new - { - Id = new Guid("9d4b5489-2079-40b9-bd77-6e1bf90bc19f"), - Description = "Manage Tasks", - IsActive = true, - ModuleId = 1, - Name = "Manage Tasks" - }, - new - { - Id = new Guid("39e66f81-efc6-446c-95bd-46bff6cfb606"), - Description = "Assign and Update Tasks Progress", - IsActive = true, - ModuleId = 1, - Name = "Assign and Update Tasks Progress" - }, - new - { - Id = new Guid("81ab8a87-8ccd-4015-a917-0627cee6a100"), - Description = "Manage Employee", - IsActive = true, - ModuleId = 2, - Name = "Manage Employee" - }, - new - { - Id = new Guid("52c9cf54-1eb2-44d2-81bb-524cf29c0a94"), - Description = "Attendance", - IsActive = true, - ModuleId = 2, - Name = "Attendance" - }, - new - { - Id = new Guid("be3b3afc-6ccf-4566-b9b6-aafcb65546be"), - Description = "Global Masters", - IsActive = true, - ModuleId = 3, - Name = "Global Masters" - }, - new - { - Id = new Guid("660131a4-788c-4739-a082-cbbf7879cbf2"), - Description = "Tenant Masters", - IsActive = true, - ModuleId = 3, - Name = "Tenant Masters" - }); - }); - - modelBuilder.Entity("Marco.Pms.Model.Entitlements.FeaturePermission", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("char(36)"); - - b.Property("Description") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("FeatureId") - .HasColumnType("char(36)"); - - b.Property("IsEnabled") - .HasColumnType("tinyint(1)"); - - b.Property("Name") - .IsRequired() - .HasColumnType("longtext"); - - b.HasKey("Id"); - - b.HasIndex("FeatureId"); - - b.ToTable("FeaturePermissions"); - - b.HasData( - new - { - Id = new Guid("6ea44136-987e-44ba-9e5d-1cf8f5837ebc"), - Description = "", - FeatureId = new Guid("53176ebf-c75d-42e5-839f-4508ffac3def"), - IsEnabled = true, - Name = "View Project" - }, - new - { - Id = new Guid("172fc9b6-755b-4f62-ab26-55c34a330614"), - Description = "", - FeatureId = new Guid("53176ebf-c75d-42e5-839f-4508ffac3def"), - IsEnabled = true, - Name = "Manage Project" - }, - new - { - Id = new Guid("b94802ce-0689-4643-9e1d-11c86950c35b"), - Description = "", - FeatureId = new Guid("53176ebf-c75d-42e5-839f-4508ffac3def"), - IsEnabled = true, - Name = "Manage Team" - }, - new - { - Id = new Guid("c7b68e33-72f0-474f-bd96-77636427ecc8"), - Description = "", - FeatureId = new Guid("9666de86-d7c7-4d3d-acaa-fcd6d6b81f3c"), - IsEnabled = true, - Name = "View Project Infra" - }, - new - { - Id = new Guid("f2aee20a-b754-4537-8166-f9507b44585b"), - Description = "", - FeatureId = new Guid("9666de86-d7c7-4d3d-acaa-fcd6d6b81f3c"), - IsEnabled = true, - Name = "Manage Project Infra" - }, - new - { - Id = new Guid("9fcc5f87-25e3-4846-90ac-67a71ab92e3c"), - Description = "", - FeatureId = new Guid("9d4b5489-2079-40b9-bd77-6e1bf90bc19f"), - IsEnabled = true, - Name = "View Task" - }, - new - { - Id = new Guid("08752f33-3b29-4816-b76b-ea8a968ed3c5"), - Description = "", - FeatureId = new Guid("9d4b5489-2079-40b9-bd77-6e1bf90bc19f"), - IsEnabled = true, - Name = "Manage Task" - }, - new - { - Id = new Guid("d135a4b0-4f9a-4903-ab9c-4843839ebdee"), - Description = "", - FeatureId = new Guid("39e66f81-efc6-446c-95bd-46bff6cfb606"), - IsEnabled = true, - Name = "Assign Task and Report Progress" - }, - new - { - Id = new Guid("ed99ecd4-1bed-42e1-b7b3-d64c04493823"), - Description = "", - FeatureId = new Guid("39e66f81-efc6-446c-95bd-46bff6cfb606"), - IsEnabled = true, - Name = "Approve Task" - }, - new - { - Id = new Guid("b82d2b7e-0d52-45f3-997b-c008ea460e7f"), - Description = "", - FeatureId = new Guid("81ab8a87-8ccd-4015-a917-0627cee6a100"), - IsEnabled = true, - Name = "View Employee" - }, - new - { - Id = new Guid("a97d366a-c2bb-448d-be93-402bd2324566"), - Description = "", - FeatureId = new Guid("81ab8a87-8ccd-4015-a917-0627cee6a100"), - IsEnabled = true, - Name = "Manage Employee" - }, - new - { - Id = new Guid("fbd213e0-0250-46f1-9f5f-4b2a1e6e76a3"), - Description = "", - FeatureId = new Guid("81ab8a87-8ccd-4015-a917-0627cee6a100"), - IsEnabled = true, - Name = "Assign To Project" - }, - new - { - Id = new Guid("915e6bff-65f6-4e3f-aea8-3fd217d3ea9e"), - Description = "", - FeatureId = new Guid("52c9cf54-1eb2-44d2-81bb-524cf29c0a94"), - IsEnabled = true, - Name = "Perform Attendance " - }, - new - { - Id = new Guid("57802c4a-00aa-4a1f-a048-fd2f70dd44b6"), - Description = "", - FeatureId = new Guid("52c9cf54-1eb2-44d2-81bb-524cf29c0a94"), - IsEnabled = true, - Name = "Regularize Attendance" - }, - new - { - Id = new Guid("5ffbafe0-7ab0-48b1-bb50-c1bf76b65f9d"), - Description = "", - FeatureId = new Guid("be3b3afc-6ccf-4566-b9b6-aafcb65546be"), - IsEnabled = true, - Name = "View Masters" - }, - new - { - Id = new Guid("588a8824-f924-4955-82d8-fc51956cf323"), - Description = "", - FeatureId = new Guid("be3b3afc-6ccf-4566-b9b6-aafcb65546be"), - IsEnabled = true, - Name = "Manage Masters" - }, - new - { - Id = new Guid("cb8ec407-46d4-4467-930c-69127cda6dec"), - Description = "", - FeatureId = new Guid("660131a4-788c-4739-a082-cbbf7879cbf2"), - IsEnabled = true, - Name = "View Masters" - }, - new - { - Id = new Guid("6b1a6d97-a951-4de5-9b19-709bac7c4f18"), - Description = "", - FeatureId = new Guid("660131a4-788c-4739-a082-cbbf7879cbf2"), - IsEnabled = true, - Name = "Manage Masters" - }); - }); - - modelBuilder.Entity("Marco.Pms.Model.Entitlements.Module", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - - b.Property("Description") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("Key") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("Name") - .IsRequired() - .HasColumnType("longtext"); - - b.HasKey("Id"); - - b.ToTable("Modules"); - - b.HasData( - new - { - Id = 1, - Description = "Project Module", - Key = "286516c2-0d55-439c-a8fa-b6858735ef65", - Name = "Project" - }, - new - { - Id = 2, - Description = "Employee Module", - Key = "6a84b9c0-1478-4d87-9ef6-34c00f0fca4a", - Name = "Employee" - }, - new - { - Id = 3, - Description = "Masters Module", - Key = "c38971e1-491e-479f-9d02-54634c0b4908", - Name = "Masters" - }); - }); - - modelBuilder.Entity("Marco.Pms.Model.Entitlements.RolePermissionMappings", b => - { - b.Property("ApplicationRoleId") - .HasColumnType("char(36)"); - - b.Property("FeaturePermissionId") - .HasColumnType("char(36)"); - - b.HasKey("ApplicationRoleId", "FeaturePermissionId"); - - b.HasIndex("FeaturePermissionId"); - - b.ToTable("RolePermissionMappings"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Entitlements.StatusMaster", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - - b.Property("Status") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("TenantId") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("TenantId"); - - b.ToTable("StatusMasters"); - - b.HasData( - new - { - Id = 1, - Status = "Active", - TenantId = 1 - }, - new - { - Id = 2, - Status = "In Progress", - TenantId = 1 - }, - new - { - Id = 3, - Status = "On Hold", - TenantId = 1 - }, - new - { - Id = 4, - Status = "Completed", - TenantId = 1 - }); - }); - - modelBuilder.Entity("Marco.Pms.Model.Entitlements.Tenant", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - - b.Property("ContactName") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("ContactNumber") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("Description") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("DomainName") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("Name") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("OnBoardingDate") - .HasColumnType("datetime(6)"); - - b.HasKey("Id"); - - b.ToTable("Tenants"); - - b.HasData( - new - { - Id = 1, - ContactName = "Admin", - ContactNumber = "123456789", - Description = "", - DomainName = "www.marcobms.org", - Name = "MarcoBMS", - OnBoardingDate = new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified) - }); - }); - - modelBuilder.Entity("Marco.Pms.Model.Projects.Building", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - - b.Property("Description") - .HasColumnType("longtext"); - - b.Property("Name") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("ProjectId") - .HasColumnType("int"); - - b.Property("TenantId") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("TenantId"); - - b.ToTable("Buildings"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Projects.Floor", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - - b.Property("BuildingId") - .HasColumnType("int"); - - b.Property("FloorName") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("TenantId") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("BuildingId"); - - b.HasIndex("TenantId"); - - b.ToTable("Floor"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Projects.Project", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - - b.Property("ContactPerson") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("EndDate") - .HasColumnType("datetime(6)"); - - b.Property("Name") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("ProjectAddress") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("ProjectStatusId") - .HasColumnType("int"); - - b.Property("StartDate") - .HasColumnType("datetime(6)"); - - b.Property("TenantId") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("ProjectStatusId"); - - b.HasIndex("TenantId"); - - b.ToTable("Projects"); - - b.HasData( - new - { - Id = 1, - ContactPerson = "Project 1 Contact Person", - Name = "Project 1", - ProjectAddress = "Project 1 Address", - ProjectStatusId = 1, - TenantId = 1 - }, - new - { - Id = 2, - ContactPerson = "Project 2 Contact Person", - Name = "Project 2", - ProjectAddress = "Project 2 Address", - ProjectStatusId = 2, - TenantId = 1 - }, - new - { - Id = 3, - ContactPerson = "Project 3 Contact Person", - Name = "Project 3", - ProjectAddress = "Project 3 Address", - ProjectStatusId = 3, - TenantId = 1 - }); - }); - - modelBuilder.Entity("Marco.Pms.Model.Projects.ProjectAllocation", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - - b.Property("AllocationDate") - .HasColumnType("datetime(6)"); - - b.Property("EmployeeId") - .HasColumnType("int"); - - b.Property("EmployeeRoleId") - .HasColumnType("char(36)"); - - b.Property("ProjectId") - .HasColumnType("int"); - - b.Property("ReAllocationDate") - .HasColumnType("datetime(6)"); - - b.Property("TenantId") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("EmployeeId"); - - b.HasIndex("ProjectId"); - - b.HasIndex("TenantId"); - - b.ToTable("ProjectAllocations"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Projects.WorkArea", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - - b.Property("AreaName") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("FloorId") - .HasColumnType("int"); - - b.Property("TenantId") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("FloorId"); - - b.HasIndex("TenantId"); - - b.ToTable("WorkAreas"); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRole", b => - { - b.Property("Id") - .HasColumnType("varchar(255)"); - - b.Property("ConcurrencyStamp") - .IsConcurrencyToken() - .HasColumnType("longtext"); - - b.Property("Name") - .HasMaxLength(256) - .HasColumnType("varchar(256)"); - - b.Property("NormalizedName") - .HasMaxLength(256) - .HasColumnType("varchar(256)"); - - b.HasKey("Id"); - - b.HasIndex("NormalizedName") - .IsUnique() - .HasDatabaseName("RoleNameIndex"); - - b.ToTable("AspNetRoles", (string)null); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - - b.Property("ClaimType") - .HasColumnType("longtext"); - - b.Property("ClaimValue") - .HasColumnType("longtext"); - - b.Property("RoleId") - .IsRequired() - .HasColumnType("varchar(255)"); - - b.HasKey("Id"); - - b.HasIndex("RoleId"); - - b.ToTable("AspNetRoleClaims", (string)null); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUser", b => - { - b.Property("Id") - .HasColumnType("varchar(255)"); - - b.Property("AccessFailedCount") - .HasColumnType("int"); - - b.Property("ConcurrencyStamp") - .IsConcurrencyToken() - .HasColumnType("longtext"); - - b.Property("Discriminator") - .IsRequired() - .HasMaxLength(21) - .HasColumnType("varchar(21)"); - - b.Property("Email") - .HasMaxLength(256) - .HasColumnType("varchar(256)"); - - b.Property("EmailConfirmed") - .HasColumnType("tinyint(1)"); - - b.Property("LockoutEnabled") - .HasColumnType("tinyint(1)"); - - b.Property("LockoutEnd") - .HasColumnType("datetime(6)"); - - b.Property("NormalizedEmail") - .HasMaxLength(256) - .HasColumnType("varchar(256)"); - - b.Property("NormalizedUserName") - .HasMaxLength(256) - .HasColumnType("varchar(256)"); - - b.Property("PasswordHash") - .HasColumnType("longtext"); - - b.Property("PhoneNumber") - .HasColumnType("longtext"); - - b.Property("PhoneNumberConfirmed") - .HasColumnType("tinyint(1)"); - - b.Property("SecurityStamp") - .HasColumnType("longtext"); - - b.Property("TwoFactorEnabled") - .HasColumnType("tinyint(1)"); - - b.Property("UserName") - .HasMaxLength(256) - .HasColumnType("varchar(256)"); - - b.HasKey("Id"); - - b.HasIndex("NormalizedEmail") - .HasDatabaseName("EmailIndex"); - - b.HasIndex("NormalizedUserName") - .IsUnique() - .HasDatabaseName("UserNameIndex"); - - b.ToTable("AspNetUsers", (string)null); - - b.HasDiscriminator().HasValue("IdentityUser"); - - b.UseTphMappingStrategy(); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - - b.Property("ClaimType") - .HasColumnType("longtext"); - - b.Property("ClaimValue") - .HasColumnType("longtext"); - - b.Property("UserId") - .IsRequired() - .HasColumnType("varchar(255)"); - - b.HasKey("Id"); - - b.HasIndex("UserId"); - - b.ToTable("AspNetUserClaims", (string)null); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin", b => - { - b.Property("LoginProvider") - .HasColumnType("varchar(255)"); - - b.Property("ProviderKey") - .HasColumnType("varchar(255)"); - - b.Property("ProviderDisplayName") - .HasColumnType("longtext"); - - b.Property("UserId") - .IsRequired() - .HasColumnType("varchar(255)"); - - b.HasKey("LoginProvider", "ProviderKey"); - - b.HasIndex("UserId"); - - b.ToTable("AspNetUserLogins", (string)null); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole", b => - { - b.Property("UserId") - .HasColumnType("varchar(255)"); - - b.Property("RoleId") - .HasColumnType("varchar(255)"); - - b.HasKey("UserId", "RoleId"); - - b.HasIndex("RoleId"); - - b.ToTable("AspNetUserRoles", (string)null); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken", b => - { - b.Property("UserId") - .HasColumnType("varchar(255)"); - - b.Property("LoginProvider") - .HasColumnType("varchar(255)"); - - b.Property("Name") - .HasColumnType("varchar(255)"); - - b.Property("Value") - .HasColumnType("longtext"); - - b.HasKey("UserId", "LoginProvider", "Name"); - - b.ToTable("AspNetUserTokens", (string)null); - }); - - modelBuilder.Entity("Marco.Pms.Model.Entitlements.ApplicationUser", b => - { - b.HasBaseType("Microsoft.AspNetCore.Identity.IdentityUser"); - - b.Property("IsRootUser") - .HasColumnType("tinyint(1)"); - - b.Property("Role") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("TenantId") - .HasColumnType("int"); - - b.HasDiscriminator().HasValue("ApplicationUser"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Activities.TaskAllocation", b => - { - b.HasOne("Marco.Pms.Model.Projects.Building", "Building") - .WithMany() - .HasForeignKey("BuildingId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Marco.Pms.Model.Employees.Employee", "Employee") - .WithMany() - .HasForeignKey("EmployeeId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Marco.Pms.Model.Projects.Project", "Project") - .WithMany() - .HasForeignKey("ProjectId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Marco.Pms.Model.Entitlements.Tenant", "Tenant") - .WithMany() - .HasForeignKey("TenantId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Marco.Pms.Model.Projects.WorkArea", "WorkArea") - .WithMany() - .HasForeignKey("WorkAreaId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Building"); - - b.Navigation("Employee"); - - b.Navigation("Project"); - - b.Navigation("Tenant"); - - b.Navigation("WorkArea"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Activities.WorkItem", b => - { - b.HasOne("Marco.Pms.Model.Entitlements.ActivityMaster", "ActivityMaster") - .WithMany() - .HasForeignKey("ActivityId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Marco.Pms.Model.Entitlements.Tenant", "Tenant") - .WithMany() - .HasForeignKey("TenantId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Marco.Pms.Model.Projects.WorkArea", "WorkArea") - .WithMany() - .HasForeignKey("WorkAreaId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("ActivityMaster"); - - b.Navigation("Tenant"); - - b.Navigation("WorkArea"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Activities.WorkItemMapping", b => - { - b.HasOne("Marco.Pms.Model.Entitlements.Tenant", "Tenant") - .WithMany() - .HasForeignKey("TenantId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Marco.Pms.Model.Projects.WorkArea", "WorkArea") - .WithMany() - .HasForeignKey("WorkAreaId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Marco.Pms.Model.Activities.WorkItem", "WorkItem") - .WithMany() - .HasForeignKey("WorkItemId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Tenant"); - - b.Navigation("WorkArea"); - - b.Navigation("WorkItem"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Authentication.RefreshToken", b => - { - b.HasOne("Microsoft.AspNetCore.Identity.IdentityUser", "User") - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("User"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Employees.Attendance", b => - { - b.HasOne("Marco.Pms.Model.Employees.Employee", "Employee") - .WithMany() - .HasForeignKey("EmployeeID") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Marco.Pms.Model.Employees.AttendanceLog", "InTimeLog") - .WithMany() - .HasForeignKey("InTimeID"); - - b.HasOne("Marco.Pms.Model.Employees.AttendanceLog", "OutTimeLog") - .WithMany() - .HasForeignKey("OutTimeID"); - - b.HasOne("Marco.Pms.Model.Entitlements.Tenant", "Tenant") - .WithMany() - .HasForeignKey("TenantId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Employee"); - - b.Navigation("InTimeLog"); - - b.Navigation("OutTimeLog"); - - b.Navigation("Tenant"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Employees.AttendanceLog", b => - { - b.HasOne("Marco.Pms.Model.Employees.Employee", "Employee") - .WithMany() - .HasForeignKey("EmployeeID") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Marco.Pms.Model.Entitlements.Tenant", "Tenant") - .WithMany() - .HasForeignKey("TenantId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Employee"); - - b.Navigation("Tenant"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Employees.Employee", b => - { - b.HasOne("Marco.Pms.Model.Entitlements.ApplicationUser", "ApplicationUser") - .WithMany() - .HasForeignKey("ApplicationUserId"); - - b.HasOne("Marco.Pms.Model.Entitlements.Tenant", "Tenant") - .WithMany() - .HasForeignKey("TenantId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("ApplicationUser"); - - b.Navigation("Tenant"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Employees.WorkShift", b => - { - b.HasOne("Marco.Pms.Model.Entitlements.Tenant", "Tenant") - .WithMany() - .HasForeignKey("TenantId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Tenant"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Entitlements.ActivityMaster", b => - { - b.HasOne("Marco.Pms.Model.Activities.TaskAllocation", null) - .WithMany("AllotedTask") - .HasForeignKey("TaskAllocationId"); - - b.HasOne("Marco.Pms.Model.Entitlements.Tenant", "Tenant") - .WithMany() - .HasForeignKey("TenantId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Tenant"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Entitlements.ApplicationRole", b => - { - b.HasOne("Marco.Pms.Model.Entitlements.Tenant", null) - .WithMany() - .HasForeignKey("TenantId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Marco.Pms.Model.Entitlements.Feature", b => - { - b.HasOne("Marco.Pms.Model.Entitlements.Module", "Module") - .WithMany() - .HasForeignKey("ModuleId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Module"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Entitlements.FeaturePermission", b => - { - b.HasOne("Marco.Pms.Model.Entitlements.Feature", "Feature") - .WithMany("FeaturePermissions") - .HasForeignKey("FeatureId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Feature"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Entitlements.RolePermissionMappings", b => - { - b.HasOne("Marco.Pms.Model.Entitlements.ApplicationRole", null) - .WithMany() - .HasForeignKey("ApplicationRoleId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Marco.Pms.Model.Entitlements.FeaturePermission", null) - .WithMany() - .HasForeignKey("FeaturePermissionId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Marco.Pms.Model.Entitlements.StatusMaster", b => - { - b.HasOne("Marco.Pms.Model.Entitlements.Tenant", "Tenant") - .WithMany() - .HasForeignKey("TenantId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Tenant"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Projects.Building", b => - { - b.HasOne("Marco.Pms.Model.Entitlements.Tenant", "Tenant") - .WithMany() - .HasForeignKey("TenantId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Tenant"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Projects.Floor", b => - { - b.HasOne("Marco.Pms.Model.Projects.Building", "Building") - .WithMany() - .HasForeignKey("BuildingId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Marco.Pms.Model.Entitlements.Tenant", "Tenant") - .WithMany() - .HasForeignKey("TenantId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Building"); - - b.Navigation("Tenant"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Projects.Project", b => - { - b.HasOne("Marco.Pms.Model.Entitlements.StatusMaster", "ProjectStatus") - .WithMany() - .HasForeignKey("ProjectStatusId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Marco.Pms.Model.Entitlements.Tenant", "Tenant") - .WithMany() - .HasForeignKey("TenantId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("ProjectStatus"); - - b.Navigation("Tenant"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Projects.ProjectAllocation", b => - { - b.HasOne("Marco.Pms.Model.Employees.Employee", "Employee") - .WithMany() - .HasForeignKey("EmployeeId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Marco.Pms.Model.Projects.Project", "Project") - .WithMany() - .HasForeignKey("ProjectId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Marco.Pms.Model.Entitlements.Tenant", "Tenant") - .WithMany() - .HasForeignKey("TenantId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Employee"); - - b.Navigation("Project"); - - b.Navigation("Tenant"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Projects.WorkArea", b => - { - b.HasOne("Marco.Pms.Model.Projects.Floor", "Floor") - .WithMany() - .HasForeignKey("FloorId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Marco.Pms.Model.Entitlements.Tenant", "Tenant") - .WithMany() - .HasForeignKey("TenantId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Floor"); - - b.Navigation("Tenant"); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim", b => - { - b.HasOne("Microsoft.AspNetCore.Identity.IdentityRole", null) - .WithMany() - .HasForeignKey("RoleId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim", b => - { - b.HasOne("Microsoft.AspNetCore.Identity.IdentityUser", null) - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin", b => - { - b.HasOne("Microsoft.AspNetCore.Identity.IdentityUser", null) - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole", b => - { - b.HasOne("Microsoft.AspNetCore.Identity.IdentityRole", null) - .WithMany() - .HasForeignKey("RoleId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Microsoft.AspNetCore.Identity.IdentityUser", null) - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken", b => - { - b.HasOne("Microsoft.AspNetCore.Identity.IdentityUser", null) - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Marco.Pms.Model.Activities.TaskAllocation", b => - { - b.Navigation("AllotedTask"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Entitlements.Feature", b => - { - b.Navigation("FeaturePermissions"); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/Marco.Pms.DataAccess/Migrations/20250207070319_RolePermissionMappings.cs b/Marco.Pms.DataAccess/Migrations/20250207070319_RolePermissionMappings.cs deleted file mode 100644 index 723d938..0000000 --- a/Marco.Pms.DataAccess/Migrations/20250207070319_RolePermissionMappings.cs +++ /dev/null @@ -1,139 +0,0 @@ -using System; -using Microsoft.EntityFrameworkCore.Migrations; - -#nullable disable - -#pragma warning disable CA1814 // Prefer jagged arrays over multidimensional - -namespace Marco.Pms.DataAccess.Migrations -{ - /// - public partial class RolePermissionMappings : Migration - { - /// - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.CreateTable( - name: "ApplicationRoles", - columns: table => new - { - Id = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), - Role = table.Column(type: "longtext", nullable: false) - .Annotation("MySql:CharSet", "utf8mb4"), - Description = table.Column(type: "longtext", nullable: false) - .Annotation("MySql:CharSet", "utf8mb4"), - TenantId = table.Column(type: "int", nullable: false) - }, - constraints: table => - { - table.PrimaryKey("PK_ApplicationRoles", x => x.Id); - table.ForeignKey( - name: "FK_ApplicationRoles_Tenants_TenantId", - column: x => x.TenantId, - principalTable: "Tenants", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); - }) - .Annotation("MySql:CharSet", "utf8mb4"); - - migrationBuilder.CreateTable( - name: "RolePermissionMappings", - columns: table => new - { - ApplicationRoleId = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), - FeaturePermissionId = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci") - }, - constraints: table => - { - table.PrimaryKey("PK_RolePermissionMappings", x => new { x.ApplicationRoleId, x.FeaturePermissionId }); - table.ForeignKey( - name: "FK_RolePermissionMappings_ApplicationRoles_ApplicationRoleId", - column: x => x.ApplicationRoleId, - principalTable: "ApplicationRoles", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); - table.ForeignKey( - name: "FK_RolePermissionMappings_FeaturePermissions_FeaturePermissionId", - column: x => x.FeaturePermissionId, - principalTable: "FeaturePermissions", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); - }) - .Annotation("MySql:CharSet", "utf8mb4"); - - migrationBuilder.InsertData( - table: "ApplicationRoles", - columns: new[] { "Id", "Description", "Role", "TenantId" }, - values: new object[,] - { - { new Guid("2c8d0808-c421-11ef-9b93-0242ac110002"), "", "Admin", 1 }, - { new Guid("62e0918d-c421-11ef-9b93-0242ac110002"), "", "Welder", 1 }, - { new Guid("68823f1f-c421-11ef-9b93-0242ac110002"), "", "Helper", 1 }, - { new Guid("6d3a7c72-c421-11ef-9b93-0242ac110002"), "", "Site Engineer", 1 }, - { new Guid("6d3aad72-c421-11ef-9b93-0242ac110002"), "", "Project Manager", 1 } - }); - - migrationBuilder.UpdateData( - table: "Modules", - keyColumn: "Id", - keyValue: 1, - column: "Key", - value: "286516c2-0d55-439c-a8fa-b6858735ef65"); - - migrationBuilder.UpdateData( - table: "Modules", - keyColumn: "Id", - keyValue: 2, - column: "Key", - value: "6a84b9c0-1478-4d87-9ef6-34c00f0fca4a"); - - migrationBuilder.UpdateData( - table: "Modules", - keyColumn: "Id", - keyValue: 3, - column: "Key", - value: "c38971e1-491e-479f-9d02-54634c0b4908"); - - migrationBuilder.CreateIndex( - name: "IX_ApplicationRoles_TenantId", - table: "ApplicationRoles", - column: "TenantId"); - - migrationBuilder.CreateIndex( - name: "IX_RolePermissionMappings_FeaturePermissionId", - table: "RolePermissionMappings", - column: "FeaturePermissionId"); - } - - /// - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropTable( - name: "RolePermissionMappings"); - - migrationBuilder.DropTable( - name: "ApplicationRoles"); - - migrationBuilder.UpdateData( - table: "Modules", - keyColumn: "Id", - keyValue: 1, - column: "Key", - value: "235d7bb6-9fae-4cdc-bc62-2426059cd49e"); - - migrationBuilder.UpdateData( - table: "Modules", - keyColumn: "Id", - keyValue: 2, - column: "Key", - value: "e60119bf-48b1-4534-82ae-88d23ae46f15"); - - migrationBuilder.UpdateData( - table: "Modules", - keyColumn: "Id", - keyValue: 3, - column: "Key", - value: "9090b0dd-7a3c-46f7-82e5-816eb6c416d2"); - } - } -} diff --git a/Marco.Pms.DataAccess/Migrations/20250208050500_EmployeeRolesMapping.Designer.cs b/Marco.Pms.DataAccess/Migrations/20250208050500_EmployeeRolesMapping.Designer.cs deleted file mode 100644 index 41892f7..0000000 --- a/Marco.Pms.DataAccess/Migrations/20250208050500_EmployeeRolesMapping.Designer.cs +++ /dev/null @@ -1,1869 +0,0 @@ -// -using System; -using Marco.Pms.DataAccess.Data; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Metadata; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; - -#nullable disable - -namespace Marco.Pms.DataAccess.Migrations -{ - [DbContext(typeof(ApplicationDbContext))] - [Migration("20250208050500_EmployeeRolesMapping")] - partial class EmployeeRolesMapping - { - /// - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasAnnotation("ProductVersion", "8.0.12") - .HasAnnotation("Relational:MaxIdentifierLength", 64); - - //MySqlModelBuilderExtensions.AutoIncrementColumns(modelBuilder); - - modelBuilder.Entity("Marco.Pms.Model.Activities.TaskAllocation", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - - b.Property("AllocationDate") - .HasColumnType("datetime(6)"); - - b.Property("BuildingId") - .HasColumnType("int"); - - b.Property("EmployeeId") - .HasColumnType("int"); - - b.Property("EmployeeRole") - .HasColumnType("int"); - - b.Property("ProjectId") - .HasColumnType("int"); - - b.Property("ReAllocationDate") - .HasColumnType("datetime(6)"); - - b.Property("TenantId") - .HasColumnType("int"); - - b.Property("WorkAreaId") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("BuildingId"); - - b.HasIndex("EmployeeId"); - - b.HasIndex("ProjectId"); - - b.HasIndex("TenantId"); - - b.HasIndex("WorkAreaId"); - - b.ToTable("TaskAllocations"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Activities.WorkItem", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - - b.Property("ActivityId") - .HasColumnType("int"); - - b.Property("CompletedWork") - .HasColumnType("int"); - - b.Property("PlannedWork") - .HasColumnType("int"); - - b.Property("TaskDate") - .HasColumnType("datetime(6)"); - - b.Property("TenantId") - .HasColumnType("int"); - - b.Property("WorkAreaId") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("ActivityId"); - - b.HasIndex("TenantId"); - - b.HasIndex("WorkAreaId"); - - b.ToTable("WorkItems"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Activities.WorkItemMapping", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - - b.Property("TenantId") - .HasColumnType("int"); - - b.Property("WorkAreaId") - .HasColumnType("int"); - - b.Property("WorkItemId") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("TenantId"); - - b.HasIndex("WorkAreaId"); - - b.HasIndex("WorkItemId"); - - b.ToTable("WorkItemMapping"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Authentication.RefreshToken", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - - b.Property("CreatedAt") - .HasColumnType("datetime(6)"); - - b.Property("ExpiryDate") - .HasColumnType("datetime(6)"); - - b.Property("IsRevoked") - .HasColumnType("tinyint(1)"); - - b.Property("IsUsed") - .HasColumnType("tinyint(1)"); - - b.Property("RevokedAt") - .HasColumnType("datetime(6)"); - - b.Property("Token") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("UserId") - .IsRequired() - .HasColumnType("varchar(255)"); - - b.HasKey("Id"); - - b.HasIndex("UserId"); - - b.ToTable("RefreshTokens"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Employees.Attendance", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - - b.Property("ApprovedBy") - .HasColumnType("longtext"); - - b.Property("Comment") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("Date") - .HasColumnType("datetime(6)"); - - b.Property("EmployeeID") - .HasColumnType("int"); - - b.Property("InTimeID") - .HasColumnType("int"); - - b.Property("IsApproved") - .HasColumnType("tinyint(1)"); - - b.Property("OutTimeID") - .HasColumnType("int"); - - b.Property("TenantId") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("EmployeeID"); - - b.HasIndex("InTimeID"); - - b.HasIndex("OutTimeID"); - - b.HasIndex("TenantId"); - - b.ToTable("Attendances"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Employees.AttendanceLog", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - - b.Property("CheckTime") - .HasColumnType("datetime(6)"); - - b.Property("Comment") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("EmployeeID") - .HasColumnType("int"); - - b.Property("IsCheckIn") - .HasColumnType("tinyint(1)"); - - b.Property("Latitude") - .HasColumnType("longtext"); - - b.Property("Longitude") - .HasColumnType("longtext"); - - b.Property("Photo") - .HasColumnType("longblob"); - - b.Property("TenantId") - .HasColumnType("int"); - - b.Property("UpdatedBy") - .HasColumnType("longtext"); - - b.HasKey("Id"); - - b.HasIndex("EmployeeID"); - - b.HasIndex("TenantId"); - - b.ToTable("AttendanceLogs"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Employees.Employee", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - - b.Property("AadharNumber") - .HasColumnType("longtext"); - - b.Property("ApplicationUserId") - .HasColumnType("varchar(255)"); - - b.Property("BirthDate") - .HasColumnType("datetime(6)"); - - b.Property("CurrentAddress") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("Email") - .HasColumnType("longtext"); - - b.Property("EmergencyPhoneNumber") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("FirstName") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("Gender") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("LastName") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("MiddleName") - .HasColumnType("longtext"); - - b.Property("PanNumber") - .HasColumnType("longtext"); - - b.Property("PeramnentAddress") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("PhoneNumber") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("Photo") - .HasColumnType("longblob"); - - b.Property("RoleId") - .HasColumnType("char(36)"); - - b.Property("TenantId") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("ApplicationUserId"); - - b.HasIndex("TenantId"); - - b.ToTable("Employees"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Employees.WorkShift", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - - b.Property("EndTime") - .HasColumnType("time(6)"); - - b.Property("Name") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("StartTime") - .HasColumnType("time(6)"); - - b.Property("TenantId") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("TenantId"); - - b.ToTable("WorkShifts"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Entitlements.ActivityMaster", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - - b.Property("ActivityName") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("TaskAllocationId") - .HasColumnType("int"); - - b.Property("TenantId") - .HasColumnType("int"); - - b.Property("UnitOfMeasurement") - .IsRequired() - .HasColumnType("longtext"); - - b.HasKey("Id"); - - b.HasIndex("TaskAllocationId"); - - b.HasIndex("TenantId"); - - b.ToTable("ActivityMasters"); - - b.HasData( - new - { - Id = 1, - ActivityName = "Core Cutting", - TenantId = 1, - UnitOfMeasurement = "Number" - }, - new - { - Id = 2, - ActivityName = "Fabrication", - TenantId = 1, - UnitOfMeasurement = "Meter" - }, - new - { - Id = 3, - ActivityName = "Lifting", - TenantId = 1, - UnitOfMeasurement = "Meter" - }, - new - { - Id = 4, - ActivityName = "Hanging", - TenantId = 1, - UnitOfMeasurement = "Meter" - }, - new - { - Id = 5, - ActivityName = "Tapping", - TenantId = 1, - UnitOfMeasurement = "Meter" - }, - new - { - Id = 6, - ActivityName = "Welding", - TenantId = 1, - UnitOfMeasurement = "Meter" - }, - new - { - Id = 7, - ActivityName = "Testing", - TenantId = 1, - UnitOfMeasurement = "Area" - }, - new - { - Id = 8, - ActivityName = "Painting", - TenantId = 1, - UnitOfMeasurement = "Meter" - }, - new - { - Id = 9, - ActivityName = "Marking Area", - TenantId = 1, - UnitOfMeasurement = "Meter" - }, - new - { - Id = 10, - ActivityName = "Drilling", - TenantId = 1, - UnitOfMeasurement = "Number" - }, - new - { - Id = 11, - ActivityName = "MS Support Fabrication", - TenantId = 1, - UnitOfMeasurement = "Number" - }, - new - { - Id = 12, - ActivityName = "MS Support Hanging", - TenantId = 1, - UnitOfMeasurement = "Number" - }, - new - { - Id = 13, - ActivityName = "Hydrant Volve", - TenantId = 1, - UnitOfMeasurement = "Number" - }, - new - { - Id = 14, - ActivityName = "Sprinkler Installation", - TenantId = 1, - UnitOfMeasurement = "Number" - }); - }); - - modelBuilder.Entity("Marco.Pms.Model.Entitlements.ApplicationRole", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("char(36)"); - - b.Property("Description") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("Role") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("TenantId") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("TenantId"); - - b.ToTable("ApplicationRoles"); - - b.HasData( - new - { - Id = new Guid("2c8d0808-c421-11ef-9b93-0242ac110002"), - Description = "", - Role = "Admin", - TenantId = 1 - }, - new - { - Id = new Guid("62e0918d-c421-11ef-9b93-0242ac110002"), - Description = "", - Role = "Welder", - TenantId = 1 - }, - new - { - Id = new Guid("68823f1f-c421-11ef-9b93-0242ac110002"), - Description = "", - Role = "Helper", - TenantId = 1 - }, - new - { - Id = new Guid("6d3a7c72-c421-11ef-9b93-0242ac110002"), - Description = "", - Role = "Site Engineer", - TenantId = 1 - }, - new - { - Id = new Guid("6d3aad72-c421-11ef-9b93-0242ac110002"), - Description = "", - Role = "Project Manager", - TenantId = 1 - }); - }); - - modelBuilder.Entity("Marco.Pms.Model.Entitlements.EmployeeRoleMapping", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("char(36)"); - - b.Property("EmployeeId") - .HasColumnType("int"); - - b.Property("IsEnabled") - .HasColumnType("tinyint(1)"); - - b.Property("RoleId") - .HasColumnType("char(36)"); - - b.Property("TenantId") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("EmployeeId"); - - b.HasIndex("RoleId"); - - b.HasIndex("TenantId"); - - b.ToTable("EmployeeRoleMappings"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Entitlements.Feature", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("char(36)"); - - b.Property("Description") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("IsActive") - .HasColumnType("tinyint(1)"); - - b.Property("ModuleId") - .HasColumnType("int"); - - b.Property("Name") - .IsRequired() - .HasColumnType("longtext"); - - b.HasKey("Id"); - - b.HasIndex("ModuleId"); - - b.ToTable("Features"); - - b.HasData( - new - { - Id = new Guid("53176ebf-c75d-42e5-839f-4508ffac3def"), - Description = "Manage Project", - IsActive = true, - ModuleId = 1, - Name = "Manage Project" - }, - new - { - Id = new Guid("9666de86-d7c7-4d3d-acaa-fcd6d6b81f3c"), - Description = "Manage Infra", - IsActive = true, - ModuleId = 1, - Name = "Manage Infra" - }, - new - { - Id = new Guid("9d4b5489-2079-40b9-bd77-6e1bf90bc19f"), - Description = "Manage Tasks", - IsActive = true, - ModuleId = 1, - Name = "Manage Tasks" - }, - new - { - Id = new Guid("39e66f81-efc6-446c-95bd-46bff6cfb606"), - Description = "Assign and Update Tasks Progress", - IsActive = true, - ModuleId = 1, - Name = "Assign and Update Tasks Progress" - }, - new - { - Id = new Guid("81ab8a87-8ccd-4015-a917-0627cee6a100"), - Description = "Manage Employee", - IsActive = true, - ModuleId = 2, - Name = "Manage Employee" - }, - new - { - Id = new Guid("52c9cf54-1eb2-44d2-81bb-524cf29c0a94"), - Description = "Attendance", - IsActive = true, - ModuleId = 2, - Name = "Attendance" - }, - new - { - Id = new Guid("be3b3afc-6ccf-4566-b9b6-aafcb65546be"), - Description = "Global Masters", - IsActive = true, - ModuleId = 3, - Name = "Global Masters" - }, - new - { - Id = new Guid("660131a4-788c-4739-a082-cbbf7879cbf2"), - Description = "Tenant Masters", - IsActive = true, - ModuleId = 3, - Name = "Tenant Masters" - }); - }); - - modelBuilder.Entity("Marco.Pms.Model.Entitlements.FeaturePermission", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("char(36)"); - - b.Property("Description") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("FeatureId") - .HasColumnType("char(36)"); - - b.Property("IsEnabled") - .HasColumnType("tinyint(1)"); - - b.Property("Name") - .IsRequired() - .HasColumnType("longtext"); - - b.HasKey("Id"); - - b.HasIndex("FeatureId"); - - b.ToTable("FeaturePermissions"); - - b.HasData( - new - { - Id = new Guid("6ea44136-987e-44ba-9e5d-1cf8f5837ebc"), - Description = "", - FeatureId = new Guid("53176ebf-c75d-42e5-839f-4508ffac3def"), - IsEnabled = true, - Name = "View Project" - }, - new - { - Id = new Guid("172fc9b6-755b-4f62-ab26-55c34a330614"), - Description = "", - FeatureId = new Guid("53176ebf-c75d-42e5-839f-4508ffac3def"), - IsEnabled = true, - Name = "Manage Project" - }, - new - { - Id = new Guid("b94802ce-0689-4643-9e1d-11c86950c35b"), - Description = "", - FeatureId = new Guid("53176ebf-c75d-42e5-839f-4508ffac3def"), - IsEnabled = true, - Name = "Manage Team" - }, - new - { - Id = new Guid("c7b68e33-72f0-474f-bd96-77636427ecc8"), - Description = "", - FeatureId = new Guid("9666de86-d7c7-4d3d-acaa-fcd6d6b81f3c"), - IsEnabled = true, - Name = "View Project Infra" - }, - new - { - Id = new Guid("f2aee20a-b754-4537-8166-f9507b44585b"), - Description = "", - FeatureId = new Guid("9666de86-d7c7-4d3d-acaa-fcd6d6b81f3c"), - IsEnabled = true, - Name = "Manage Project Infra" - }, - new - { - Id = new Guid("9fcc5f87-25e3-4846-90ac-67a71ab92e3c"), - Description = "", - FeatureId = new Guid("9d4b5489-2079-40b9-bd77-6e1bf90bc19f"), - IsEnabled = true, - Name = "View Task" - }, - new - { - Id = new Guid("08752f33-3b29-4816-b76b-ea8a968ed3c5"), - Description = "", - FeatureId = new Guid("9d4b5489-2079-40b9-bd77-6e1bf90bc19f"), - IsEnabled = true, - Name = "Manage Task" - }, - new - { - Id = new Guid("d135a4b0-4f9a-4903-ab9c-4843839ebdee"), - Description = "", - FeatureId = new Guid("39e66f81-efc6-446c-95bd-46bff6cfb606"), - IsEnabled = true, - Name = "Assign Task and Report Progress" - }, - new - { - Id = new Guid("ed99ecd4-1bed-42e1-b7b3-d64c04493823"), - Description = "", - FeatureId = new Guid("39e66f81-efc6-446c-95bd-46bff6cfb606"), - IsEnabled = true, - Name = "Approve Task" - }, - new - { - Id = new Guid("b82d2b7e-0d52-45f3-997b-c008ea460e7f"), - Description = "", - FeatureId = new Guid("81ab8a87-8ccd-4015-a917-0627cee6a100"), - IsEnabled = true, - Name = "View Employee" - }, - new - { - Id = new Guid("a97d366a-c2bb-448d-be93-402bd2324566"), - Description = "", - FeatureId = new Guid("81ab8a87-8ccd-4015-a917-0627cee6a100"), - IsEnabled = true, - Name = "Manage Employee" - }, - new - { - Id = new Guid("fbd213e0-0250-46f1-9f5f-4b2a1e6e76a3"), - Description = "", - FeatureId = new Guid("81ab8a87-8ccd-4015-a917-0627cee6a100"), - IsEnabled = true, - Name = "Assign To Project" - }, - new - { - Id = new Guid("915e6bff-65f6-4e3f-aea8-3fd217d3ea9e"), - Description = "", - FeatureId = new Guid("52c9cf54-1eb2-44d2-81bb-524cf29c0a94"), - IsEnabled = true, - Name = "Perform Attendance " - }, - new - { - Id = new Guid("57802c4a-00aa-4a1f-a048-fd2f70dd44b6"), - Description = "", - FeatureId = new Guid("52c9cf54-1eb2-44d2-81bb-524cf29c0a94"), - IsEnabled = true, - Name = "Regularize Attendance" - }, - new - { - Id = new Guid("5ffbafe0-7ab0-48b1-bb50-c1bf76b65f9d"), - Description = "", - FeatureId = new Guid("be3b3afc-6ccf-4566-b9b6-aafcb65546be"), - IsEnabled = true, - Name = "View Masters" - }, - new - { - Id = new Guid("588a8824-f924-4955-82d8-fc51956cf323"), - Description = "", - FeatureId = new Guid("be3b3afc-6ccf-4566-b9b6-aafcb65546be"), - IsEnabled = true, - Name = "Manage Masters" - }, - new - { - Id = new Guid("cb8ec407-46d4-4467-930c-69127cda6dec"), - Description = "", - FeatureId = new Guid("660131a4-788c-4739-a082-cbbf7879cbf2"), - IsEnabled = true, - Name = "View Masters" - }, - new - { - Id = new Guid("6b1a6d97-a951-4de5-9b19-709bac7c4f18"), - Description = "", - FeatureId = new Guid("660131a4-788c-4739-a082-cbbf7879cbf2"), - IsEnabled = true, - Name = "Manage Masters" - }); - }); - - modelBuilder.Entity("Marco.Pms.Model.Entitlements.Module", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - - b.Property("Description") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("Key") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("Name") - .IsRequired() - .HasColumnType("longtext"); - - b.HasKey("Id"); - - b.ToTable("Modules"); - - b.HasData( - new - { - Id = 1, - Description = "Project Module", - Key = "05db8d60-e977-40f6-b944-8602d0d4cb98", - Name = "Project" - }, - new - { - Id = 2, - Description = "Employee Module", - Key = "456ddbbe-0963-406d-8874-589a546c3670", - Name = "Employee" - }, - new - { - Id = 3, - Description = "Masters Module", - Key = "19eca67f-c3b1-4e5c-8d95-c8341cf058ae", - Name = "Masters" - }); - }); - - modelBuilder.Entity("Marco.Pms.Model.Entitlements.RolePermissionMappings", b => - { - b.Property("ApplicationRoleId") - .HasColumnType("char(36)"); - - b.Property("FeaturePermissionId") - .HasColumnType("char(36)"); - - b.HasKey("ApplicationRoleId", "FeaturePermissionId"); - - b.HasIndex("FeaturePermissionId"); - - b.ToTable("RolePermissionMappings"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Entitlements.StatusMaster", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - - b.Property("Status") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("TenantId") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("TenantId"); - - b.ToTable("StatusMasters"); - - b.HasData( - new - { - Id = 1, - Status = "Active", - TenantId = 1 - }, - new - { - Id = 2, - Status = "In Progress", - TenantId = 1 - }, - new - { - Id = 3, - Status = "On Hold", - TenantId = 1 - }, - new - { - Id = 4, - Status = "Completed", - TenantId = 1 - }); - }); - - modelBuilder.Entity("Marco.Pms.Model.Entitlements.Tenant", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - - b.Property("ContactName") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("ContactNumber") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("Description") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("DomainName") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("Name") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("OnBoardingDate") - .HasColumnType("datetime(6)"); - - b.HasKey("Id"); - - b.ToTable("Tenants"); - - b.HasData( - new - { - Id = 1, - ContactName = "Admin", - ContactNumber = "123456789", - Description = "", - DomainName = "www.marcobms.org", - Name = "MarcoBMS", - OnBoardingDate = new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified) - }); - }); - - modelBuilder.Entity("Marco.Pms.Model.Projects.Building", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - - b.Property("Description") - .HasColumnType("longtext"); - - b.Property("Name") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("ProjectId") - .HasColumnType("int"); - - b.Property("TenantId") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("TenantId"); - - b.ToTable("Buildings"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Projects.Floor", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - - b.Property("BuildingId") - .HasColumnType("int"); - - b.Property("FloorName") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("TenantId") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("BuildingId"); - - b.HasIndex("TenantId"); - - b.ToTable("Floor"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Projects.Project", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - - b.Property("ContactPerson") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("EndDate") - .HasColumnType("datetime(6)"); - - b.Property("Name") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("ProjectAddress") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("ProjectStatusId") - .HasColumnType("int"); - - b.Property("StartDate") - .HasColumnType("datetime(6)"); - - b.Property("TenantId") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("ProjectStatusId"); - - b.HasIndex("TenantId"); - - b.ToTable("Projects"); - - b.HasData( - new - { - Id = 1, - ContactPerson = "Project 1 Contact Person", - Name = "Project 1", - ProjectAddress = "Project 1 Address", - ProjectStatusId = 1, - TenantId = 1 - }, - new - { - Id = 2, - ContactPerson = "Project 2 Contact Person", - Name = "Project 2", - ProjectAddress = "Project 2 Address", - ProjectStatusId = 2, - TenantId = 1 - }, - new - { - Id = 3, - ContactPerson = "Project 3 Contact Person", - Name = "Project 3", - ProjectAddress = "Project 3 Address", - ProjectStatusId = 3, - TenantId = 1 - }); - }); - - modelBuilder.Entity("Marco.Pms.Model.Projects.ProjectAllocation", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - - b.Property("AllocationDate") - .HasColumnType("datetime(6)"); - - b.Property("EmployeeId") - .HasColumnType("int"); - - b.Property("EmployeeRoleId") - .HasColumnType("char(36)"); - - b.Property("ProjectId") - .HasColumnType("int"); - - b.Property("ReAllocationDate") - .HasColumnType("datetime(6)"); - - b.Property("TenantId") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("EmployeeId"); - - b.HasIndex("ProjectId"); - - b.HasIndex("TenantId"); - - b.ToTable("ProjectAllocations"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Projects.WorkArea", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - - b.Property("AreaName") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("FloorId") - .HasColumnType("int"); - - b.Property("TenantId") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("FloorId"); - - b.HasIndex("TenantId"); - - b.ToTable("WorkAreas"); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRole", b => - { - b.Property("Id") - .HasColumnType("varchar(255)"); - - b.Property("ConcurrencyStamp") - .IsConcurrencyToken() - .HasColumnType("longtext"); - - b.Property("Name") - .HasMaxLength(256) - .HasColumnType("varchar(256)"); - - b.Property("NormalizedName") - .HasMaxLength(256) - .HasColumnType("varchar(256)"); - - b.HasKey("Id"); - - b.HasIndex("NormalizedName") - .IsUnique() - .HasDatabaseName("RoleNameIndex"); - - b.ToTable("AspNetRoles", (string)null); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - - b.Property("ClaimType") - .HasColumnType("longtext"); - - b.Property("ClaimValue") - .HasColumnType("longtext"); - - b.Property("RoleId") - .IsRequired() - .HasColumnType("varchar(255)"); - - b.HasKey("Id"); - - b.HasIndex("RoleId"); - - b.ToTable("AspNetRoleClaims", (string)null); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUser", b => - { - b.Property("Id") - .HasColumnType("varchar(255)"); - - b.Property("AccessFailedCount") - .HasColumnType("int"); - - b.Property("ConcurrencyStamp") - .IsConcurrencyToken() - .HasColumnType("longtext"); - - b.Property("Discriminator") - .IsRequired() - .HasMaxLength(21) - .HasColumnType("varchar(21)"); - - b.Property("Email") - .HasMaxLength(256) - .HasColumnType("varchar(256)"); - - b.Property("EmailConfirmed") - .HasColumnType("tinyint(1)"); - - b.Property("LockoutEnabled") - .HasColumnType("tinyint(1)"); - - b.Property("LockoutEnd") - .HasColumnType("datetime(6)"); - - b.Property("NormalizedEmail") - .HasMaxLength(256) - .HasColumnType("varchar(256)"); - - b.Property("NormalizedUserName") - .HasMaxLength(256) - .HasColumnType("varchar(256)"); - - b.Property("PasswordHash") - .HasColumnType("longtext"); - - b.Property("PhoneNumber") - .HasColumnType("longtext"); - - b.Property("PhoneNumberConfirmed") - .HasColumnType("tinyint(1)"); - - b.Property("SecurityStamp") - .HasColumnType("longtext"); - - b.Property("TwoFactorEnabled") - .HasColumnType("tinyint(1)"); - - b.Property("UserName") - .HasMaxLength(256) - .HasColumnType("varchar(256)"); - - b.HasKey("Id"); - - b.HasIndex("NormalizedEmail") - .HasDatabaseName("EmailIndex"); - - b.HasIndex("NormalizedUserName") - .IsUnique() - .HasDatabaseName("UserNameIndex"); - - b.ToTable("AspNetUsers", (string)null); - - b.HasDiscriminator().HasValue("IdentityUser"); - - b.UseTphMappingStrategy(); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - - b.Property("ClaimType") - .HasColumnType("longtext"); - - b.Property("ClaimValue") - .HasColumnType("longtext"); - - b.Property("UserId") - .IsRequired() - .HasColumnType("varchar(255)"); - - b.HasKey("Id"); - - b.HasIndex("UserId"); - - b.ToTable("AspNetUserClaims", (string)null); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin", b => - { - b.Property("LoginProvider") - .HasColumnType("varchar(255)"); - - b.Property("ProviderKey") - .HasColumnType("varchar(255)"); - - b.Property("ProviderDisplayName") - .HasColumnType("longtext"); - - b.Property("UserId") - .IsRequired() - .HasColumnType("varchar(255)"); - - b.HasKey("LoginProvider", "ProviderKey"); - - b.HasIndex("UserId"); - - b.ToTable("AspNetUserLogins", (string)null); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole", b => - { - b.Property("UserId") - .HasColumnType("varchar(255)"); - - b.Property("RoleId") - .HasColumnType("varchar(255)"); - - b.HasKey("UserId", "RoleId"); - - b.HasIndex("RoleId"); - - b.ToTable("AspNetUserRoles", (string)null); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken", b => - { - b.Property("UserId") - .HasColumnType("varchar(255)"); - - b.Property("LoginProvider") - .HasColumnType("varchar(255)"); - - b.Property("Name") - .HasColumnType("varchar(255)"); - - b.Property("Value") - .HasColumnType("longtext"); - - b.HasKey("UserId", "LoginProvider", "Name"); - - b.ToTable("AspNetUserTokens", (string)null); - }); - - modelBuilder.Entity("Marco.Pms.Model.Entitlements.ApplicationUser", b => - { - b.HasBaseType("Microsoft.AspNetCore.Identity.IdentityUser"); - - b.Property("IsRootUser") - .HasColumnType("tinyint(1)"); - - b.Property("Role") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("TenantId") - .HasColumnType("int"); - - b.HasDiscriminator().HasValue("ApplicationUser"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Activities.TaskAllocation", b => - { - b.HasOne("Marco.Pms.Model.Projects.Building", "Building") - .WithMany() - .HasForeignKey("BuildingId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Marco.Pms.Model.Employees.Employee", "Employee") - .WithMany() - .HasForeignKey("EmployeeId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Marco.Pms.Model.Projects.Project", "Project") - .WithMany() - .HasForeignKey("ProjectId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Marco.Pms.Model.Entitlements.Tenant", "Tenant") - .WithMany() - .HasForeignKey("TenantId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Marco.Pms.Model.Projects.WorkArea", "WorkArea") - .WithMany() - .HasForeignKey("WorkAreaId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Building"); - - b.Navigation("Employee"); - - b.Navigation("Project"); - - b.Navigation("Tenant"); - - b.Navigation("WorkArea"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Activities.WorkItem", b => - { - b.HasOne("Marco.Pms.Model.Entitlements.ActivityMaster", "ActivityMaster") - .WithMany() - .HasForeignKey("ActivityId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Marco.Pms.Model.Entitlements.Tenant", "Tenant") - .WithMany() - .HasForeignKey("TenantId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Marco.Pms.Model.Projects.WorkArea", "WorkArea") - .WithMany() - .HasForeignKey("WorkAreaId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("ActivityMaster"); - - b.Navigation("Tenant"); - - b.Navigation("WorkArea"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Activities.WorkItemMapping", b => - { - b.HasOne("Marco.Pms.Model.Entitlements.Tenant", "Tenant") - .WithMany() - .HasForeignKey("TenantId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Marco.Pms.Model.Projects.WorkArea", "WorkArea") - .WithMany() - .HasForeignKey("WorkAreaId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Marco.Pms.Model.Activities.WorkItem", "WorkItem") - .WithMany() - .HasForeignKey("WorkItemId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Tenant"); - - b.Navigation("WorkArea"); - - b.Navigation("WorkItem"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Authentication.RefreshToken", b => - { - b.HasOne("Microsoft.AspNetCore.Identity.IdentityUser", "User") - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("User"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Employees.Attendance", b => - { - b.HasOne("Marco.Pms.Model.Employees.Employee", "Employee") - .WithMany() - .HasForeignKey("EmployeeID") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Marco.Pms.Model.Employees.AttendanceLog", "InTimeLog") - .WithMany() - .HasForeignKey("InTimeID"); - - b.HasOne("Marco.Pms.Model.Employees.AttendanceLog", "OutTimeLog") - .WithMany() - .HasForeignKey("OutTimeID"); - - b.HasOne("Marco.Pms.Model.Entitlements.Tenant", "Tenant") - .WithMany() - .HasForeignKey("TenantId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Employee"); - - b.Navigation("InTimeLog"); - - b.Navigation("OutTimeLog"); - - b.Navigation("Tenant"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Employees.AttendanceLog", b => - { - b.HasOne("Marco.Pms.Model.Employees.Employee", "Employee") - .WithMany() - .HasForeignKey("EmployeeID") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Marco.Pms.Model.Entitlements.Tenant", "Tenant") - .WithMany() - .HasForeignKey("TenantId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Employee"); - - b.Navigation("Tenant"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Employees.Employee", b => - { - b.HasOne("Marco.Pms.Model.Entitlements.ApplicationUser", "ApplicationUser") - .WithMany() - .HasForeignKey("ApplicationUserId"); - - b.HasOne("Marco.Pms.Model.Entitlements.Tenant", "Tenant") - .WithMany() - .HasForeignKey("TenantId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("ApplicationUser"); - - b.Navigation("Tenant"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Employees.WorkShift", b => - { - b.HasOne("Marco.Pms.Model.Entitlements.Tenant", "Tenant") - .WithMany() - .HasForeignKey("TenantId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Tenant"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Entitlements.ActivityMaster", b => - { - b.HasOne("Marco.Pms.Model.Activities.TaskAllocation", null) - .WithMany("AllotedTask") - .HasForeignKey("TaskAllocationId"); - - b.HasOne("Marco.Pms.Model.Entitlements.Tenant", "Tenant") - .WithMany() - .HasForeignKey("TenantId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Tenant"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Entitlements.ApplicationRole", b => - { - b.HasOne("Marco.Pms.Model.Entitlements.Tenant", null) - .WithMany() - .HasForeignKey("TenantId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Marco.Pms.Model.Entitlements.EmployeeRoleMapping", b => - { - b.HasOne("Marco.Pms.Model.Employees.Employee", "Employee") - .WithMany() - .HasForeignKey("EmployeeId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Marco.Pms.Model.Entitlements.ApplicationRole", "Role") - .WithMany() - .HasForeignKey("RoleId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Marco.Pms.Model.Entitlements.Tenant", "Tenant") - .WithMany() - .HasForeignKey("TenantId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Employee"); - - b.Navigation("Role"); - - b.Navigation("Tenant"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Entitlements.Feature", b => - { - b.HasOne("Marco.Pms.Model.Entitlements.Module", "Module") - .WithMany() - .HasForeignKey("ModuleId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Module"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Entitlements.FeaturePermission", b => - { - b.HasOne("Marco.Pms.Model.Entitlements.Feature", "Feature") - .WithMany("FeaturePermissions") - .HasForeignKey("FeatureId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Feature"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Entitlements.RolePermissionMappings", b => - { - b.HasOne("Marco.Pms.Model.Entitlements.ApplicationRole", null) - .WithMany() - .HasForeignKey("ApplicationRoleId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Marco.Pms.Model.Entitlements.FeaturePermission", null) - .WithMany() - .HasForeignKey("FeaturePermissionId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Marco.Pms.Model.Entitlements.StatusMaster", b => - { - b.HasOne("Marco.Pms.Model.Entitlements.Tenant", "Tenant") - .WithMany() - .HasForeignKey("TenantId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Tenant"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Projects.Building", b => - { - b.HasOne("Marco.Pms.Model.Entitlements.Tenant", "Tenant") - .WithMany() - .HasForeignKey("TenantId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Tenant"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Projects.Floor", b => - { - b.HasOne("Marco.Pms.Model.Projects.Building", "Building") - .WithMany() - .HasForeignKey("BuildingId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Marco.Pms.Model.Entitlements.Tenant", "Tenant") - .WithMany() - .HasForeignKey("TenantId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Building"); - - b.Navigation("Tenant"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Projects.Project", b => - { - b.HasOne("Marco.Pms.Model.Entitlements.StatusMaster", "ProjectStatus") - .WithMany() - .HasForeignKey("ProjectStatusId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Marco.Pms.Model.Entitlements.Tenant", "Tenant") - .WithMany() - .HasForeignKey("TenantId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("ProjectStatus"); - - b.Navigation("Tenant"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Projects.ProjectAllocation", b => - { - b.HasOne("Marco.Pms.Model.Employees.Employee", "Employee") - .WithMany() - .HasForeignKey("EmployeeId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Marco.Pms.Model.Projects.Project", "Project") - .WithMany() - .HasForeignKey("ProjectId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Marco.Pms.Model.Entitlements.Tenant", "Tenant") - .WithMany() - .HasForeignKey("TenantId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Employee"); - - b.Navigation("Project"); - - b.Navigation("Tenant"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Projects.WorkArea", b => - { - b.HasOne("Marco.Pms.Model.Projects.Floor", "Floor") - .WithMany() - .HasForeignKey("FloorId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Marco.Pms.Model.Entitlements.Tenant", "Tenant") - .WithMany() - .HasForeignKey("TenantId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Floor"); - - b.Navigation("Tenant"); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim", b => - { - b.HasOne("Microsoft.AspNetCore.Identity.IdentityRole", null) - .WithMany() - .HasForeignKey("RoleId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim", b => - { - b.HasOne("Microsoft.AspNetCore.Identity.IdentityUser", null) - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin", b => - { - b.HasOne("Microsoft.AspNetCore.Identity.IdentityUser", null) - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole", b => - { - b.HasOne("Microsoft.AspNetCore.Identity.IdentityRole", null) - .WithMany() - .HasForeignKey("RoleId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Microsoft.AspNetCore.Identity.IdentityUser", null) - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken", b => - { - b.HasOne("Microsoft.AspNetCore.Identity.IdentityUser", null) - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Marco.Pms.Model.Activities.TaskAllocation", b => - { - b.Navigation("AllotedTask"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Entitlements.Feature", b => - { - b.Navigation("FeaturePermissions"); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/Marco.Pms.DataAccess/Migrations/20250208050500_EmployeeRolesMapping.cs b/Marco.Pms.DataAccess/Migrations/20250208050500_EmployeeRolesMapping.cs deleted file mode 100644 index 696ba82..0000000 --- a/Marco.Pms.DataAccess/Migrations/20250208050500_EmployeeRolesMapping.cs +++ /dev/null @@ -1,113 +0,0 @@ -using System; -using Microsoft.EntityFrameworkCore.Migrations; - -#nullable disable - -namespace Marco.Pms.DataAccess.Migrations -{ - /// - public partial class EmployeeRolesMapping : Migration - { - /// - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.CreateTable( - name: "EmployeeRoleMappings", - columns: table => new - { - Id = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), - EmployeeId = table.Column(type: "int", nullable: false), - RoleId = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), - IsEnabled = table.Column(type: "tinyint(1)", nullable: false), - TenantId = table.Column(type: "int", nullable: false) - }, - constraints: table => - { - table.PrimaryKey("PK_EmployeeRoleMappings", x => x.Id); - table.ForeignKey( - name: "FK_EmployeeRoleMappings_ApplicationRoles_RoleId", - column: x => x.RoleId, - principalTable: "ApplicationRoles", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); - table.ForeignKey( - name: "FK_EmployeeRoleMappings_Employees_EmployeeId", - column: x => x.EmployeeId, - principalTable: "Employees", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); - table.ForeignKey( - name: "FK_EmployeeRoleMappings_Tenants_TenantId", - column: x => x.TenantId, - principalTable: "Tenants", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); - }) - .Annotation("MySql:CharSet", "utf8mb4"); - - migrationBuilder.UpdateData( - table: "Modules", - keyColumn: "Id", - keyValue: 1, - column: "Key", - value: "05db8d60-e977-40f6-b944-8602d0d4cb98"); - - migrationBuilder.UpdateData( - table: "Modules", - keyColumn: "Id", - keyValue: 2, - column: "Key", - value: "456ddbbe-0963-406d-8874-589a546c3670"); - - migrationBuilder.UpdateData( - table: "Modules", - keyColumn: "Id", - keyValue: 3, - column: "Key", - value: "19eca67f-c3b1-4e5c-8d95-c8341cf058ae"); - - migrationBuilder.CreateIndex( - name: "IX_EmployeeRoleMappings_EmployeeId", - table: "EmployeeRoleMappings", - column: "EmployeeId"); - - migrationBuilder.CreateIndex( - name: "IX_EmployeeRoleMappings_RoleId", - table: "EmployeeRoleMappings", - column: "RoleId"); - - migrationBuilder.CreateIndex( - name: "IX_EmployeeRoleMappings_TenantId", - table: "EmployeeRoleMappings", - column: "TenantId"); - } - - /// - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropTable( - name: "EmployeeRoleMappings"); - - migrationBuilder.UpdateData( - table: "Modules", - keyColumn: "Id", - keyValue: 1, - column: "Key", - value: "286516c2-0d55-439c-a8fa-b6858735ef65"); - - migrationBuilder.UpdateData( - table: "Modules", - keyColumn: "Id", - keyValue: 2, - column: "Key", - value: "6a84b9c0-1478-4d87-9ef6-34c00f0fca4a"); - - migrationBuilder.UpdateData( - table: "Modules", - keyColumn: "Id", - keyValue: 3, - column: "Key", - value: "c38971e1-491e-479f-9d02-54634c0b4908"); - } - } -} diff --git a/Marco.Pms.DataAccess/Migrations/20250217065507_addjobrole.Designer.cs b/Marco.Pms.DataAccess/Migrations/20250217065507_addjobrole.Designer.cs deleted file mode 100644 index 5157842..0000000 --- a/Marco.Pms.DataAccess/Migrations/20250217065507_addjobrole.Designer.cs +++ /dev/null @@ -1,1913 +0,0 @@ -// -using System; -using Marco.Pms.DataAccess.Data; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Metadata; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; - -#nullable disable - -namespace Marco.Pms.DataAccess.Migrations -{ - [DbContext(typeof(ApplicationDbContext))] - [Migration("20250217065507_addjobrole")] - partial class addjobrole - { - /// - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasAnnotation("ProductVersion", "8.0.12") - .HasAnnotation("Relational:MaxIdentifierLength", 64); - - //MySqlModelBuilderExtensions.AutoIncrementColumns(modelBuilder); - - modelBuilder.Entity("Marco.Pms.Model.Activities.TaskAllocation", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - - b.Property("AllocationDate") - .HasColumnType("datetime(6)"); - - b.Property("BuildingId") - .HasColumnType("int"); - - b.Property("EmployeeId") - .HasColumnType("int"); - - b.Property("EmployeeRole") - .HasColumnType("int"); - - b.Property("ProjectId") - .HasColumnType("int"); - - b.Property("ReAllocationDate") - .HasColumnType("datetime(6)"); - - b.Property("TenantId") - .HasColumnType("int"); - - b.Property("WorkAreaId") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("BuildingId"); - - b.HasIndex("EmployeeId"); - - b.HasIndex("ProjectId"); - - b.HasIndex("TenantId"); - - b.HasIndex("WorkAreaId"); - - b.ToTable("TaskAllocations"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Activities.WorkItem", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - - b.Property("ActivityId") - .HasColumnType("int"); - - b.Property("CompletedWork") - .HasColumnType("int"); - - b.Property("PlannedWork") - .HasColumnType("int"); - - b.Property("TaskDate") - .HasColumnType("datetime(6)"); - - b.Property("TenantId") - .HasColumnType("int"); - - b.Property("WorkAreaId") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("ActivityId"); - - b.HasIndex("TenantId"); - - b.HasIndex("WorkAreaId"); - - b.ToTable("WorkItems"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Activities.WorkItemMapping", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - - b.Property("TenantId") - .HasColumnType("int"); - - b.Property("WorkAreaId") - .HasColumnType("int"); - - b.Property("WorkItemId") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("TenantId"); - - b.HasIndex("WorkAreaId"); - - b.HasIndex("WorkItemId"); - - b.ToTable("WorkItemMapping"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Authentication.RefreshToken", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - - b.Property("CreatedAt") - .HasColumnType("datetime(6)"); - - b.Property("ExpiryDate") - .HasColumnType("datetime(6)"); - - b.Property("IsRevoked") - .HasColumnType("tinyint(1)"); - - b.Property("IsUsed") - .HasColumnType("tinyint(1)"); - - b.Property("RevokedAt") - .HasColumnType("datetime(6)"); - - b.Property("Token") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("UserId") - .IsRequired() - .HasColumnType("varchar(255)"); - - b.HasKey("Id"); - - b.HasIndex("UserId"); - - b.ToTable("RefreshTokens"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Employees.Attendance", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - - b.Property("ApprovedBy") - .HasColumnType("longtext"); - - b.Property("Comment") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("Date") - .HasColumnType("datetime(6)"); - - b.Property("EmployeeID") - .HasColumnType("int"); - - b.Property("InTimeID") - .HasColumnType("int"); - - b.Property("IsApproved") - .HasColumnType("tinyint(1)"); - - b.Property("OutTimeID") - .HasColumnType("int"); - - b.Property("TenantId") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("EmployeeID"); - - b.HasIndex("InTimeID"); - - b.HasIndex("OutTimeID"); - - b.HasIndex("TenantId"); - - b.ToTable("Attendances"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Employees.AttendanceLog", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - - b.Property("CheckTime") - .HasColumnType("datetime(6)"); - - b.Property("Comment") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("EmployeeID") - .HasColumnType("int"); - - b.Property("IsCheckIn") - .HasColumnType("tinyint(1)"); - - b.Property("Latitude") - .HasColumnType("longtext"); - - b.Property("Longitude") - .HasColumnType("longtext"); - - b.Property("Photo") - .HasColumnType("longblob"); - - b.Property("TenantId") - .HasColumnType("int"); - - b.Property("UpdatedBy") - .HasColumnType("longtext"); - - b.HasKey("Id"); - - b.HasIndex("EmployeeID"); - - b.HasIndex("TenantId"); - - b.ToTable("AttendanceLogs"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Employees.Employee", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - - b.Property("AadharNumber") - .HasColumnType("longtext"); - - b.Property("ApplicationUserId") - .HasColumnType("varchar(255)"); - - b.Property("BirthDate") - .HasColumnType("datetime(6)"); - - b.Property("CurrentAddress") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("Email") - .HasColumnType("longtext"); - - b.Property("EmergencyPhoneNumber") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("FirstName") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("Gender") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("JobRoleId") - .HasColumnType("int"); - - b.Property("LastName") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("MiddleName") - .HasColumnType("longtext"); - - b.Property("PanNumber") - .HasColumnType("longtext"); - - b.Property("PeramnentAddress") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("PhoneNumber") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("Photo") - .HasColumnType("longblob"); - - b.Property("TenantId") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("ApplicationUserId"); - - b.HasIndex("JobRoleId"); - - b.HasIndex("TenantId"); - - b.ToTable("Employees"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Employees.WorkShift", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - - b.Property("EndTime") - .HasColumnType("time(6)"); - - b.Property("Name") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("StartTime") - .HasColumnType("time(6)"); - - b.Property("TenantId") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("TenantId"); - - b.ToTable("WorkShifts"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Entitlements.ActivityMaster", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - - b.Property("ActivityName") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("TaskAllocationId") - .HasColumnType("int"); - - b.Property("TenantId") - .HasColumnType("int"); - - b.Property("UnitOfMeasurement") - .IsRequired() - .HasColumnType("longtext"); - - b.HasKey("Id"); - - b.HasIndex("TaskAllocationId"); - - b.HasIndex("TenantId"); - - b.ToTable("ActivityMasters"); - - b.HasData( - new - { - Id = 1, - ActivityName = "Core Cutting", - TenantId = 1, - UnitOfMeasurement = "Number" - }, - new - { - Id = 2, - ActivityName = "Fabrication", - TenantId = 1, - UnitOfMeasurement = "Meter" - }, - new - { - Id = 3, - ActivityName = "Lifting", - TenantId = 1, - UnitOfMeasurement = "Meter" - }, - new - { - Id = 4, - ActivityName = "Hanging", - TenantId = 1, - UnitOfMeasurement = "Meter" - }, - new - { - Id = 5, - ActivityName = "Tapping", - TenantId = 1, - UnitOfMeasurement = "Meter" - }, - new - { - Id = 6, - ActivityName = "Welding", - TenantId = 1, - UnitOfMeasurement = "Meter" - }, - new - { - Id = 7, - ActivityName = "Testing", - TenantId = 1, - UnitOfMeasurement = "Area" - }, - new - { - Id = 8, - ActivityName = "Painting", - TenantId = 1, - UnitOfMeasurement = "Meter" - }, - new - { - Id = 9, - ActivityName = "Marking Area", - TenantId = 1, - UnitOfMeasurement = "Meter" - }, - new - { - Id = 10, - ActivityName = "Drilling", - TenantId = 1, - UnitOfMeasurement = "Number" - }, - new - { - Id = 11, - ActivityName = "MS Support Fabrication", - TenantId = 1, - UnitOfMeasurement = "Number" - }, - new - { - Id = 12, - ActivityName = "MS Support Hanging", - TenantId = 1, - UnitOfMeasurement = "Number" - }, - new - { - Id = 13, - ActivityName = "Hydrant Volve", - TenantId = 1, - UnitOfMeasurement = "Number" - }, - new - { - Id = 14, - ActivityName = "Sprinkler Installation", - TenantId = 1, - UnitOfMeasurement = "Number" - }); - }); - - modelBuilder.Entity("Marco.Pms.Model.Entitlements.ApplicationRole", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("char(36)"); - - b.Property("Description") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("Role") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("TenantId") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("TenantId"); - - b.ToTable("ApplicationRoles"); - - b.HasData( - new - { - Id = new Guid("2c8d0808-c421-11ef-9b93-0242ac110002"), - Description = "", - Role = "Admin", - TenantId = 1 - }, - new - { - Id = new Guid("62e0918d-c421-11ef-9b93-0242ac110002"), - Description = "", - Role = "Welder", - TenantId = 1 - }, - new - { - Id = new Guid("68823f1f-c421-11ef-9b93-0242ac110002"), - Description = "", - Role = "Helper", - TenantId = 1 - }, - new - { - Id = new Guid("6d3a7c72-c421-11ef-9b93-0242ac110002"), - Description = "", - Role = "Site Engineer", - TenantId = 1 - }, - new - { - Id = new Guid("6d3aad72-c421-11ef-9b93-0242ac110002"), - Description = "", - Role = "Project Manager", - TenantId = 1 - }); - }); - - modelBuilder.Entity("Marco.Pms.Model.Entitlements.EmployeeRoleMapping", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("char(36)"); - - b.Property("EmployeeId") - .HasColumnType("int"); - - b.Property("IsEnabled") - .HasColumnType("tinyint(1)"); - - b.Property("RoleId") - .HasColumnType("char(36)"); - - b.Property("TenantId") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("EmployeeId"); - - b.HasIndex("RoleId"); - - b.HasIndex("TenantId"); - - b.ToTable("EmployeeRoleMappings"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Entitlements.Feature", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("char(36)"); - - b.Property("Description") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("IsActive") - .HasColumnType("tinyint(1)"); - - b.Property("ModuleId") - .HasColumnType("int"); - - b.Property("Name") - .IsRequired() - .HasColumnType("longtext"); - - b.HasKey("Id"); - - b.HasIndex("ModuleId"); - - b.ToTable("Features"); - - b.HasData( - new - { - Id = new Guid("53176ebf-c75d-42e5-839f-4508ffac3def"), - Description = "Manage Project", - IsActive = true, - ModuleId = 1, - Name = "Manage Project" - }, - new - { - Id = new Guid("9666de86-d7c7-4d3d-acaa-fcd6d6b81f3c"), - Description = "Manage Infra", - IsActive = true, - ModuleId = 1, - Name = "Manage Infra" - }, - new - { - Id = new Guid("9d4b5489-2079-40b9-bd77-6e1bf90bc19f"), - Description = "Manage Tasks", - IsActive = true, - ModuleId = 1, - Name = "Manage Tasks" - }, - new - { - Id = new Guid("39e66f81-efc6-446c-95bd-46bff6cfb606"), - Description = "Assign and Update Tasks Progress", - IsActive = true, - ModuleId = 1, - Name = "Assign and Update Tasks Progress" - }, - new - { - Id = new Guid("81ab8a87-8ccd-4015-a917-0627cee6a100"), - Description = "Manage Employee", - IsActive = true, - ModuleId = 2, - Name = "Manage Employee" - }, - new - { - Id = new Guid("52c9cf54-1eb2-44d2-81bb-524cf29c0a94"), - Description = "Attendance", - IsActive = true, - ModuleId = 2, - Name = "Attendance" - }, - new - { - Id = new Guid("be3b3afc-6ccf-4566-b9b6-aafcb65546be"), - Description = "Global Masters", - IsActive = true, - ModuleId = 3, - Name = "Global Masters" - }, - new - { - Id = new Guid("660131a4-788c-4739-a082-cbbf7879cbf2"), - Description = "Tenant Masters", - IsActive = true, - ModuleId = 3, - Name = "Tenant Masters" - }); - }); - - modelBuilder.Entity("Marco.Pms.Model.Entitlements.FeaturePermission", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("char(36)"); - - b.Property("Description") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("FeatureId") - .HasColumnType("char(36)"); - - b.Property("IsEnabled") - .HasColumnType("tinyint(1)"); - - b.Property("Name") - .IsRequired() - .HasColumnType("longtext"); - - b.HasKey("Id"); - - b.HasIndex("FeatureId"); - - b.ToTable("FeaturePermissions"); - - b.HasData( - new - { - Id = new Guid("6ea44136-987e-44ba-9e5d-1cf8f5837ebc"), - Description = "", - FeatureId = new Guid("53176ebf-c75d-42e5-839f-4508ffac3def"), - IsEnabled = true, - Name = "View Project" - }, - new - { - Id = new Guid("172fc9b6-755b-4f62-ab26-55c34a330614"), - Description = "", - FeatureId = new Guid("53176ebf-c75d-42e5-839f-4508ffac3def"), - IsEnabled = true, - Name = "Manage Project" - }, - new - { - Id = new Guid("b94802ce-0689-4643-9e1d-11c86950c35b"), - Description = "", - FeatureId = new Guid("53176ebf-c75d-42e5-839f-4508ffac3def"), - IsEnabled = true, - Name = "Manage Team" - }, - new - { - Id = new Guid("c7b68e33-72f0-474f-bd96-77636427ecc8"), - Description = "", - FeatureId = new Guid("9666de86-d7c7-4d3d-acaa-fcd6d6b81f3c"), - IsEnabled = true, - Name = "View Project Infra" - }, - new - { - Id = new Guid("f2aee20a-b754-4537-8166-f9507b44585b"), - Description = "", - FeatureId = new Guid("9666de86-d7c7-4d3d-acaa-fcd6d6b81f3c"), - IsEnabled = true, - Name = "Manage Project Infra" - }, - new - { - Id = new Guid("9fcc5f87-25e3-4846-90ac-67a71ab92e3c"), - Description = "", - FeatureId = new Guid("9d4b5489-2079-40b9-bd77-6e1bf90bc19f"), - IsEnabled = true, - Name = "View Task" - }, - new - { - Id = new Guid("08752f33-3b29-4816-b76b-ea8a968ed3c5"), - Description = "", - FeatureId = new Guid("9d4b5489-2079-40b9-bd77-6e1bf90bc19f"), - IsEnabled = true, - Name = "Manage Task" - }, - new - { - Id = new Guid("d135a4b0-4f9a-4903-ab9c-4843839ebdee"), - Description = "", - FeatureId = new Guid("39e66f81-efc6-446c-95bd-46bff6cfb606"), - IsEnabled = true, - Name = "Assign Task and Report Progress" - }, - new - { - Id = new Guid("ed99ecd4-1bed-42e1-b7b3-d64c04493823"), - Description = "", - FeatureId = new Guid("39e66f81-efc6-446c-95bd-46bff6cfb606"), - IsEnabled = true, - Name = "Approve Task" - }, - new - { - Id = new Guid("b82d2b7e-0d52-45f3-997b-c008ea460e7f"), - Description = "", - FeatureId = new Guid("81ab8a87-8ccd-4015-a917-0627cee6a100"), - IsEnabled = true, - Name = "View Employee" - }, - new - { - Id = new Guid("a97d366a-c2bb-448d-be93-402bd2324566"), - Description = "", - FeatureId = new Guid("81ab8a87-8ccd-4015-a917-0627cee6a100"), - IsEnabled = true, - Name = "Manage Employee" - }, - new - { - Id = new Guid("fbd213e0-0250-46f1-9f5f-4b2a1e6e76a3"), - Description = "", - FeatureId = new Guid("81ab8a87-8ccd-4015-a917-0627cee6a100"), - IsEnabled = true, - Name = "Assign To Project" - }, - new - { - Id = new Guid("915e6bff-65f6-4e3f-aea8-3fd217d3ea9e"), - Description = "", - FeatureId = new Guid("52c9cf54-1eb2-44d2-81bb-524cf29c0a94"), - IsEnabled = true, - Name = "Perform Attendance " - }, - new - { - Id = new Guid("57802c4a-00aa-4a1f-a048-fd2f70dd44b6"), - Description = "", - FeatureId = new Guid("52c9cf54-1eb2-44d2-81bb-524cf29c0a94"), - IsEnabled = true, - Name = "Regularize Attendance" - }, - new - { - Id = new Guid("5ffbafe0-7ab0-48b1-bb50-c1bf76b65f9d"), - Description = "", - FeatureId = new Guid("be3b3afc-6ccf-4566-b9b6-aafcb65546be"), - IsEnabled = true, - Name = "View Masters" - }, - new - { - Id = new Guid("588a8824-f924-4955-82d8-fc51956cf323"), - Description = "", - FeatureId = new Guid("be3b3afc-6ccf-4566-b9b6-aafcb65546be"), - IsEnabled = true, - Name = "Manage Masters" - }, - new - { - Id = new Guid("cb8ec407-46d4-4467-930c-69127cda6dec"), - Description = "", - FeatureId = new Guid("660131a4-788c-4739-a082-cbbf7879cbf2"), - IsEnabled = true, - Name = "View Masters" - }, - new - { - Id = new Guid("6b1a6d97-a951-4de5-9b19-709bac7c4f18"), - Description = "", - FeatureId = new Guid("660131a4-788c-4739-a082-cbbf7879cbf2"), - IsEnabled = true, - Name = "Manage Masters" - }); - }); - - modelBuilder.Entity("Marco.Pms.Model.Entitlements.JobRole", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - - b.Property("Description") - .HasColumnType("longtext"); - - b.Property("Name") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("TenantId") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("TenantId"); - - b.ToTable("JobRoles"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Entitlements.Module", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - - b.Property("Description") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("Key") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("Name") - .IsRequired() - .HasColumnType("longtext"); - - b.HasKey("Id"); - - b.ToTable("Modules"); - - b.HasData( - new - { - Id = 1, - Description = "Project Module", - Key = "ad9fb730-b80a-446c-bf49-bf41f90e0c0b", - Name = "Project" - }, - new - { - Id = 2, - Description = "Employee Module", - Key = "bc153ba8-7f38-4b91-97d5-1deb230250a9", - Name = "Employee" - }, - new - { - Id = 3, - Description = "Masters Module", - Key = "44e296ca-5597-44c9-9159-b481c941f902", - Name = "Masters" - }); - }); - - modelBuilder.Entity("Marco.Pms.Model.Entitlements.RolePermissionMappings", b => - { - b.Property("ApplicationRoleId") - .HasColumnType("char(36)"); - - b.Property("FeaturePermissionId") - .HasColumnType("char(36)"); - - b.HasKey("ApplicationRoleId", "FeaturePermissionId"); - - b.HasIndex("FeaturePermissionId"); - - b.ToTable("RolePermissionMappings"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Entitlements.StatusMaster", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - - b.Property("Status") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("TenantId") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("TenantId"); - - b.ToTable("StatusMasters"); - - b.HasData( - new - { - Id = 1, - Status = "Active", - TenantId = 1 - }, - new - { - Id = 2, - Status = "In Progress", - TenantId = 1 - }, - new - { - Id = 3, - Status = "On Hold", - TenantId = 1 - }, - new - { - Id = 4, - Status = "Completed", - TenantId = 1 - }); - }); - - modelBuilder.Entity("Marco.Pms.Model.Entitlements.Tenant", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - - b.Property("ContactName") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("ContactNumber") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("Description") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("DomainName") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("Name") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("OnBoardingDate") - .HasColumnType("datetime(6)"); - - b.HasKey("Id"); - - b.ToTable("Tenants"); - - b.HasData( - new - { - Id = 1, - ContactName = "Admin", - ContactNumber = "123456789", - Description = "", - DomainName = "www.marcobms.org", - Name = "MarcoBMS", - OnBoardingDate = new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified) - }); - }); - - modelBuilder.Entity("Marco.Pms.Model.Projects.Building", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - - b.Property("Description") - .HasColumnType("longtext"); - - b.Property("Name") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("ProjectId") - .HasColumnType("int"); - - b.Property("TenantId") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("TenantId"); - - b.ToTable("Buildings"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Projects.Floor", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - - b.Property("BuildingId") - .HasColumnType("int"); - - b.Property("FloorName") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("TenantId") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("BuildingId"); - - b.HasIndex("TenantId"); - - b.ToTable("Floor"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Projects.Project", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - - b.Property("ContactPerson") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("EndDate") - .HasColumnType("datetime(6)"); - - b.Property("Name") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("ProjectAddress") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("ProjectStatusId") - .HasColumnType("int"); - - b.Property("StartDate") - .HasColumnType("datetime(6)"); - - b.Property("TenantId") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("ProjectStatusId"); - - b.HasIndex("TenantId"); - - b.ToTable("Projects"); - - b.HasData( - new - { - Id = 1, - ContactPerson = "Project 1 Contact Person", - Name = "Project 1", - ProjectAddress = "Project 1 Address", - ProjectStatusId = 1, - TenantId = 1 - }, - new - { - Id = 2, - ContactPerson = "Project 2 Contact Person", - Name = "Project 2", - ProjectAddress = "Project 2 Address", - ProjectStatusId = 2, - TenantId = 1 - }, - new - { - Id = 3, - ContactPerson = "Project 3 Contact Person", - Name = "Project 3", - ProjectAddress = "Project 3 Address", - ProjectStatusId = 3, - TenantId = 1 - }); - }); - - modelBuilder.Entity("Marco.Pms.Model.Projects.ProjectAllocation", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - - b.Property("AllocationDate") - .HasColumnType("datetime(6)"); - - b.Property("EmployeeId") - .HasColumnType("int"); - - b.Property("EmployeeRoleId") - .HasColumnType("char(36)"); - - b.Property("ProjectId") - .HasColumnType("int"); - - b.Property("ReAllocationDate") - .HasColumnType("datetime(6)"); - - b.Property("TenantId") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("EmployeeId"); - - b.HasIndex("ProjectId"); - - b.HasIndex("TenantId"); - - b.ToTable("ProjectAllocations"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Projects.WorkArea", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - - b.Property("AreaName") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("FloorId") - .HasColumnType("int"); - - b.Property("TenantId") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("FloorId"); - - b.HasIndex("TenantId"); - - b.ToTable("WorkAreas"); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRole", b => - { - b.Property("Id") - .HasColumnType("varchar(255)"); - - b.Property("ConcurrencyStamp") - .IsConcurrencyToken() - .HasColumnType("longtext"); - - b.Property("Name") - .HasMaxLength(256) - .HasColumnType("varchar(256)"); - - b.Property("NormalizedName") - .HasMaxLength(256) - .HasColumnType("varchar(256)"); - - b.HasKey("Id"); - - b.HasIndex("NormalizedName") - .IsUnique() - .HasDatabaseName("RoleNameIndex"); - - b.ToTable("AspNetRoles", (string)null); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - - b.Property("ClaimType") - .HasColumnType("longtext"); - - b.Property("ClaimValue") - .HasColumnType("longtext"); - - b.Property("RoleId") - .IsRequired() - .HasColumnType("varchar(255)"); - - b.HasKey("Id"); - - b.HasIndex("RoleId"); - - b.ToTable("AspNetRoleClaims", (string)null); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUser", b => - { - b.Property("Id") - .HasColumnType("varchar(255)"); - - b.Property("AccessFailedCount") - .HasColumnType("int"); - - b.Property("ConcurrencyStamp") - .IsConcurrencyToken() - .HasColumnType("longtext"); - - b.Property("Discriminator") - .IsRequired() - .HasMaxLength(21) - .HasColumnType("varchar(21)"); - - b.Property("Email") - .HasMaxLength(256) - .HasColumnType("varchar(256)"); - - b.Property("EmailConfirmed") - .HasColumnType("tinyint(1)"); - - b.Property("LockoutEnabled") - .HasColumnType("tinyint(1)"); - - b.Property("LockoutEnd") - .HasColumnType("datetime(6)"); - - b.Property("NormalizedEmail") - .HasMaxLength(256) - .HasColumnType("varchar(256)"); - - b.Property("NormalizedUserName") - .HasMaxLength(256) - .HasColumnType("varchar(256)"); - - b.Property("PasswordHash") - .HasColumnType("longtext"); - - b.Property("PhoneNumber") - .HasColumnType("longtext"); - - b.Property("PhoneNumberConfirmed") - .HasColumnType("tinyint(1)"); - - b.Property("SecurityStamp") - .HasColumnType("longtext"); - - b.Property("TwoFactorEnabled") - .HasColumnType("tinyint(1)"); - - b.Property("UserName") - .HasMaxLength(256) - .HasColumnType("varchar(256)"); - - b.HasKey("Id"); - - b.HasIndex("NormalizedEmail") - .HasDatabaseName("EmailIndex"); - - b.HasIndex("NormalizedUserName") - .IsUnique() - .HasDatabaseName("UserNameIndex"); - - b.ToTable("AspNetUsers", (string)null); - - b.HasDiscriminator().HasValue("IdentityUser"); - - b.UseTphMappingStrategy(); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - - b.Property("ClaimType") - .HasColumnType("longtext"); - - b.Property("ClaimValue") - .HasColumnType("longtext"); - - b.Property("UserId") - .IsRequired() - .HasColumnType("varchar(255)"); - - b.HasKey("Id"); - - b.HasIndex("UserId"); - - b.ToTable("AspNetUserClaims", (string)null); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin", b => - { - b.Property("LoginProvider") - .HasColumnType("varchar(255)"); - - b.Property("ProviderKey") - .HasColumnType("varchar(255)"); - - b.Property("ProviderDisplayName") - .HasColumnType("longtext"); - - b.Property("UserId") - .IsRequired() - .HasColumnType("varchar(255)"); - - b.HasKey("LoginProvider", "ProviderKey"); - - b.HasIndex("UserId"); - - b.ToTable("AspNetUserLogins", (string)null); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole", b => - { - b.Property("UserId") - .HasColumnType("varchar(255)"); - - b.Property("RoleId") - .HasColumnType("varchar(255)"); - - b.HasKey("UserId", "RoleId"); - - b.HasIndex("RoleId"); - - b.ToTable("AspNetUserRoles", (string)null); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken", b => - { - b.Property("UserId") - .HasColumnType("varchar(255)"); - - b.Property("LoginProvider") - .HasColumnType("varchar(255)"); - - b.Property("Name") - .HasColumnType("varchar(255)"); - - b.Property("Value") - .HasColumnType("longtext"); - - b.HasKey("UserId", "LoginProvider", "Name"); - - b.ToTable("AspNetUserTokens", (string)null); - }); - - modelBuilder.Entity("Marco.Pms.Model.Entitlements.ApplicationUser", b => - { - b.HasBaseType("Microsoft.AspNetCore.Identity.IdentityUser"); - - b.Property("IsRootUser") - .HasColumnType("tinyint(1)"); - - b.Property("Role") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("TenantId") - .HasColumnType("int"); - - b.HasDiscriminator().HasValue("ApplicationUser"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Activities.TaskAllocation", b => - { - b.HasOne("Marco.Pms.Model.Projects.Building", "Building") - .WithMany() - .HasForeignKey("BuildingId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Marco.Pms.Model.Employees.Employee", "Employee") - .WithMany() - .HasForeignKey("EmployeeId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Marco.Pms.Model.Projects.Project", "Project") - .WithMany() - .HasForeignKey("ProjectId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Marco.Pms.Model.Entitlements.Tenant", "Tenant") - .WithMany() - .HasForeignKey("TenantId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Marco.Pms.Model.Projects.WorkArea", "WorkArea") - .WithMany() - .HasForeignKey("WorkAreaId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Building"); - - b.Navigation("Employee"); - - b.Navigation("Project"); - - b.Navigation("Tenant"); - - b.Navigation("WorkArea"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Activities.WorkItem", b => - { - b.HasOne("Marco.Pms.Model.Entitlements.ActivityMaster", "ActivityMaster") - .WithMany() - .HasForeignKey("ActivityId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Marco.Pms.Model.Entitlements.Tenant", "Tenant") - .WithMany() - .HasForeignKey("TenantId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Marco.Pms.Model.Projects.WorkArea", "WorkArea") - .WithMany() - .HasForeignKey("WorkAreaId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("ActivityMaster"); - - b.Navigation("Tenant"); - - b.Navigation("WorkArea"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Activities.WorkItemMapping", b => - { - b.HasOne("Marco.Pms.Model.Entitlements.Tenant", "Tenant") - .WithMany() - .HasForeignKey("TenantId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Marco.Pms.Model.Projects.WorkArea", "WorkArea") - .WithMany() - .HasForeignKey("WorkAreaId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Marco.Pms.Model.Activities.WorkItem", "WorkItem") - .WithMany() - .HasForeignKey("WorkItemId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Tenant"); - - b.Navigation("WorkArea"); - - b.Navigation("WorkItem"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Authentication.RefreshToken", b => - { - b.HasOne("Microsoft.AspNetCore.Identity.IdentityUser", "User") - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("User"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Employees.Attendance", b => - { - b.HasOne("Marco.Pms.Model.Employees.Employee", "Employee") - .WithMany() - .HasForeignKey("EmployeeID") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Marco.Pms.Model.Employees.AttendanceLog", "InTimeLog") - .WithMany() - .HasForeignKey("InTimeID"); - - b.HasOne("Marco.Pms.Model.Employees.AttendanceLog", "OutTimeLog") - .WithMany() - .HasForeignKey("OutTimeID"); - - b.HasOne("Marco.Pms.Model.Entitlements.Tenant", "Tenant") - .WithMany() - .HasForeignKey("TenantId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Employee"); - - b.Navigation("InTimeLog"); - - b.Navigation("OutTimeLog"); - - b.Navigation("Tenant"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Employees.AttendanceLog", b => - { - b.HasOne("Marco.Pms.Model.Employees.Employee", "Employee") - .WithMany() - .HasForeignKey("EmployeeID") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Marco.Pms.Model.Entitlements.Tenant", "Tenant") - .WithMany() - .HasForeignKey("TenantId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Employee"); - - b.Navigation("Tenant"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Employees.Employee", b => - { - b.HasOne("Marco.Pms.Model.Entitlements.ApplicationUser", "ApplicationUser") - .WithMany() - .HasForeignKey("ApplicationUserId"); - - b.HasOne("Marco.Pms.Model.Entitlements.JobRole", "JobRole") - .WithMany() - .HasForeignKey("JobRoleId"); - - b.HasOne("Marco.Pms.Model.Entitlements.Tenant", "Tenant") - .WithMany() - .HasForeignKey("TenantId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("ApplicationUser"); - - b.Navigation("JobRole"); - - b.Navigation("Tenant"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Employees.WorkShift", b => - { - b.HasOne("Marco.Pms.Model.Entitlements.Tenant", "Tenant") - .WithMany() - .HasForeignKey("TenantId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Tenant"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Entitlements.ActivityMaster", b => - { - b.HasOne("Marco.Pms.Model.Activities.TaskAllocation", null) - .WithMany("AllotedTask") - .HasForeignKey("TaskAllocationId"); - - b.HasOne("Marco.Pms.Model.Entitlements.Tenant", "Tenant") - .WithMany() - .HasForeignKey("TenantId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Tenant"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Entitlements.ApplicationRole", b => - { - b.HasOne("Marco.Pms.Model.Entitlements.Tenant", null) - .WithMany() - .HasForeignKey("TenantId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Marco.Pms.Model.Entitlements.EmployeeRoleMapping", b => - { - b.HasOne("Marco.Pms.Model.Employees.Employee", "Employee") - .WithMany() - .HasForeignKey("EmployeeId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Marco.Pms.Model.Entitlements.ApplicationRole", "Role") - .WithMany() - .HasForeignKey("RoleId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Marco.Pms.Model.Entitlements.Tenant", "Tenant") - .WithMany() - .HasForeignKey("TenantId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Employee"); - - b.Navigation("Role"); - - b.Navigation("Tenant"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Entitlements.Feature", b => - { - b.HasOne("Marco.Pms.Model.Entitlements.Module", "Module") - .WithMany() - .HasForeignKey("ModuleId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Module"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Entitlements.FeaturePermission", b => - { - b.HasOne("Marco.Pms.Model.Entitlements.Feature", "Feature") - .WithMany("FeaturePermissions") - .HasForeignKey("FeatureId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Feature"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Entitlements.JobRole", b => - { - b.HasOne("Marco.Pms.Model.Entitlements.Tenant", "Tenant") - .WithMany() - .HasForeignKey("TenantId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Tenant"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Entitlements.RolePermissionMappings", b => - { - b.HasOne("Marco.Pms.Model.Entitlements.ApplicationRole", null) - .WithMany() - .HasForeignKey("ApplicationRoleId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Marco.Pms.Model.Entitlements.FeaturePermission", null) - .WithMany() - .HasForeignKey("FeaturePermissionId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Marco.Pms.Model.Entitlements.StatusMaster", b => - { - b.HasOne("Marco.Pms.Model.Entitlements.Tenant", "Tenant") - .WithMany() - .HasForeignKey("TenantId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Tenant"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Projects.Building", b => - { - b.HasOne("Marco.Pms.Model.Entitlements.Tenant", "Tenant") - .WithMany() - .HasForeignKey("TenantId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Tenant"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Projects.Floor", b => - { - b.HasOne("Marco.Pms.Model.Projects.Building", "Building") - .WithMany() - .HasForeignKey("BuildingId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Marco.Pms.Model.Entitlements.Tenant", "Tenant") - .WithMany() - .HasForeignKey("TenantId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Building"); - - b.Navigation("Tenant"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Projects.Project", b => - { - b.HasOne("Marco.Pms.Model.Entitlements.StatusMaster", "ProjectStatus") - .WithMany() - .HasForeignKey("ProjectStatusId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Marco.Pms.Model.Entitlements.Tenant", "Tenant") - .WithMany() - .HasForeignKey("TenantId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("ProjectStatus"); - - b.Navigation("Tenant"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Projects.ProjectAllocation", b => - { - b.HasOne("Marco.Pms.Model.Employees.Employee", "Employee") - .WithMany() - .HasForeignKey("EmployeeId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Marco.Pms.Model.Projects.Project", "Project") - .WithMany() - .HasForeignKey("ProjectId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Marco.Pms.Model.Entitlements.Tenant", "Tenant") - .WithMany() - .HasForeignKey("TenantId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Employee"); - - b.Navigation("Project"); - - b.Navigation("Tenant"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Projects.WorkArea", b => - { - b.HasOne("Marco.Pms.Model.Projects.Floor", "Floor") - .WithMany() - .HasForeignKey("FloorId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Marco.Pms.Model.Entitlements.Tenant", "Tenant") - .WithMany() - .HasForeignKey("TenantId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Floor"); - - b.Navigation("Tenant"); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim", b => - { - b.HasOne("Microsoft.AspNetCore.Identity.IdentityRole", null) - .WithMany() - .HasForeignKey("RoleId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim", b => - { - b.HasOne("Microsoft.AspNetCore.Identity.IdentityUser", null) - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin", b => - { - b.HasOne("Microsoft.AspNetCore.Identity.IdentityUser", null) - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole", b => - { - b.HasOne("Microsoft.AspNetCore.Identity.IdentityRole", null) - .WithMany() - .HasForeignKey("RoleId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Microsoft.AspNetCore.Identity.IdentityUser", null) - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken", b => - { - b.HasOne("Microsoft.AspNetCore.Identity.IdentityUser", null) - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Marco.Pms.Model.Activities.TaskAllocation", b => - { - b.Navigation("AllotedTask"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Entitlements.Feature", b => - { - b.Navigation("FeaturePermissions"); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/Marco.Pms.DataAccess/Migrations/20250217065507_addjobrole.cs b/Marco.Pms.DataAccess/Migrations/20250217065507_addjobrole.cs deleted file mode 100644 index dbc7686..0000000 --- a/Marco.Pms.DataAccess/Migrations/20250217065507_addjobrole.cs +++ /dev/null @@ -1,136 +0,0 @@ -using System; -using Microsoft.EntityFrameworkCore.Metadata; -using Microsoft.EntityFrameworkCore.Migrations; - -#nullable disable - -namespace Marco.Pms.DataAccess.Migrations -{ - /// - public partial class addjobrole : Migration - { - /// - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropColumn( - name: "RoleId", - table: "Employees"); - - migrationBuilder.AddColumn( - name: "JobRoleId", - table: "Employees", - type: "int", - nullable: true); - - migrationBuilder.CreateTable( - name: "JobRoles", - columns: table => new - { - Id = table.Column(type: "int", nullable: false) - .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), - Name = table.Column(type: "longtext", nullable: false) - .Annotation("MySql:CharSet", "utf8mb4"), - Description = table.Column(type: "longtext", nullable: true) - .Annotation("MySql:CharSet", "utf8mb4"), - TenantId = table.Column(type: "int", nullable: false) - }, - constraints: table => - { - table.PrimaryKey("PK_JobRoles", x => x.Id); - table.ForeignKey( - name: "FK_JobRoles_Tenants_TenantId", - column: x => x.TenantId, - principalTable: "Tenants", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); - }) - .Annotation("MySql:CharSet", "utf8mb4"); - - migrationBuilder.UpdateData( - table: "Modules", - keyColumn: "Id", - keyValue: 1, - column: "Key", - value: "ad9fb730-b80a-446c-bf49-bf41f90e0c0b"); - - migrationBuilder.UpdateData( - table: "Modules", - keyColumn: "Id", - keyValue: 2, - column: "Key", - value: "bc153ba8-7f38-4b91-97d5-1deb230250a9"); - - migrationBuilder.UpdateData( - table: "Modules", - keyColumn: "Id", - keyValue: 3, - column: "Key", - value: "44e296ca-5597-44c9-9159-b481c941f902"); - - migrationBuilder.CreateIndex( - name: "IX_Employees_JobRoleId", - table: "Employees", - column: "JobRoleId"); - - migrationBuilder.CreateIndex( - name: "IX_JobRoles_TenantId", - table: "JobRoles", - column: "TenantId"); - - migrationBuilder.AddForeignKey( - name: "FK_Employees_JobRoles_JobRoleId", - table: "Employees", - column: "JobRoleId", - principalTable: "JobRoles", - principalColumn: "Id"); - } - - /// - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropForeignKey( - name: "FK_Employees_JobRoles_JobRoleId", - table: "Employees"); - - migrationBuilder.DropTable( - name: "JobRoles"); - - migrationBuilder.DropIndex( - name: "IX_Employees_JobRoleId", - table: "Employees"); - - migrationBuilder.DropColumn( - name: "JobRoleId", - table: "Employees"); - - migrationBuilder.AddColumn( - name: "RoleId", - table: "Employees", - type: "char(36)", - nullable: false, - defaultValue: new Guid("00000000-0000-0000-0000-000000000000"), - collation: "ascii_general_ci"); - - migrationBuilder.UpdateData( - table: "Modules", - keyColumn: "Id", - keyValue: 1, - column: "Key", - value: "05db8d60-e977-40f6-b944-8602d0d4cb98"); - - migrationBuilder.UpdateData( - table: "Modules", - keyColumn: "Id", - keyValue: 2, - column: "Key", - value: "456ddbbe-0963-406d-8874-589a546c3670"); - - migrationBuilder.UpdateData( - table: "Modules", - keyColumn: "Id", - keyValue: 3, - column: "Key", - value: "19eca67f-c3b1-4e5c-8d95-c8341cf058ae"); - } - } -} diff --git a/Marco.Pms.DataAccess/Migrations/20250302060812_CreateJobRoles.Designer.cs b/Marco.Pms.DataAccess/Migrations/20250302060812_CreateJobRoles.Designer.cs deleted file mode 100644 index 63a677d..0000000 --- a/Marco.Pms.DataAccess/Migrations/20250302060812_CreateJobRoles.Designer.cs +++ /dev/null @@ -1,1913 +0,0 @@ -// -using System; -using Marco.Pms.DataAccess.Data; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Metadata; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; - -#nullable disable - -namespace Marco.Pms.DataAccess.Migrations -{ - [DbContext(typeof(ApplicationDbContext))] - [Migration("20250302060812_CreateJobRoles")] - partial class CreateJobRoles - { - /// - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasAnnotation("ProductVersion", "8.0.12") - .HasAnnotation("Relational:MaxIdentifierLength", 64); - - // MySqlModelBuilderExtensions.AutoIncrementColumns(modelBuilder); - - modelBuilder.Entity("Marco.Pms.Model.Activities.TaskAllocation", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - - b.Property("AllocationDate") - .HasColumnType("datetime(6)"); - - b.Property("BuildingId") - .HasColumnType("int"); - - b.Property("EmployeeId") - .HasColumnType("int"); - - b.Property("EmployeeRole") - .HasColumnType("int"); - - b.Property("ProjectId") - .HasColumnType("int"); - - b.Property("ReAllocationDate") - .HasColumnType("datetime(6)"); - - b.Property("TenantId") - .HasColumnType("int"); - - b.Property("WorkAreaId") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("BuildingId"); - - b.HasIndex("EmployeeId"); - - b.HasIndex("ProjectId"); - - b.HasIndex("TenantId"); - - b.HasIndex("WorkAreaId"); - - b.ToTable("TaskAllocations"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Activities.WorkItem", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - - b.Property("ActivityId") - .HasColumnType("int"); - - b.Property("CompletedWork") - .HasColumnType("int"); - - b.Property("PlannedWork") - .HasColumnType("int"); - - b.Property("TaskDate") - .HasColumnType("datetime(6)"); - - b.Property("TenantId") - .HasColumnType("int"); - - b.Property("WorkAreaId") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("ActivityId"); - - b.HasIndex("TenantId"); - - b.HasIndex("WorkAreaId"); - - b.ToTable("WorkItems"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Activities.WorkItemMapping", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - - b.Property("TenantId") - .HasColumnType("int"); - - b.Property("WorkAreaId") - .HasColumnType("int"); - - b.Property("WorkItemId") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("TenantId"); - - b.HasIndex("WorkAreaId"); - - b.HasIndex("WorkItemId"); - - b.ToTable("WorkItemMapping"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Authentication.RefreshToken", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - - b.Property("CreatedAt") - .HasColumnType("datetime(6)"); - - b.Property("ExpiryDate") - .HasColumnType("datetime(6)"); - - b.Property("IsRevoked") - .HasColumnType("tinyint(1)"); - - b.Property("IsUsed") - .HasColumnType("tinyint(1)"); - - b.Property("RevokedAt") - .HasColumnType("datetime(6)"); - - b.Property("Token") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("UserId") - .IsRequired() - .HasColumnType("varchar(255)"); - - b.HasKey("Id"); - - b.HasIndex("UserId"); - - b.ToTable("RefreshTokens"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Employees.Attendance", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - - b.Property("ApprovedBy") - .HasColumnType("longtext"); - - b.Property("Comment") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("Date") - .HasColumnType("datetime(6)"); - - b.Property("EmployeeID") - .HasColumnType("int"); - - b.Property("InTimeID") - .HasColumnType("int"); - - b.Property("IsApproved") - .HasColumnType("tinyint(1)"); - - b.Property("OutTimeID") - .HasColumnType("int"); - - b.Property("TenantId") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("EmployeeID"); - - b.HasIndex("InTimeID"); - - b.HasIndex("OutTimeID"); - - b.HasIndex("TenantId"); - - b.ToTable("Attendances"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Employees.AttendanceLog", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - - b.Property("CheckTime") - .HasColumnType("datetime(6)"); - - b.Property("Comment") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("EmployeeID") - .HasColumnType("int"); - - b.Property("IsCheckIn") - .HasColumnType("tinyint(1)"); - - b.Property("Latitude") - .HasColumnType("longtext"); - - b.Property("Longitude") - .HasColumnType("longtext"); - - b.Property("Photo") - .HasColumnType("longblob"); - - b.Property("TenantId") - .HasColumnType("int"); - - b.Property("UpdatedBy") - .HasColumnType("longtext"); - - b.HasKey("Id"); - - b.HasIndex("EmployeeID"); - - b.HasIndex("TenantId"); - - b.ToTable("AttendanceLogs"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Employees.Employee", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - - b.Property("AadharNumber") - .HasColumnType("longtext"); - - b.Property("ApplicationUserId") - .HasColumnType("varchar(255)"); - - b.Property("BirthDate") - .HasColumnType("datetime(6)"); - - b.Property("CurrentAddress") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("Email") - .HasColumnType("longtext"); - - b.Property("EmergencyPhoneNumber") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("FirstName") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("Gender") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("JobRoleId") - .HasColumnType("int"); - - b.Property("LastName") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("MiddleName") - .HasColumnType("longtext"); - - b.Property("PanNumber") - .HasColumnType("longtext"); - - b.Property("PeramnentAddress") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("PhoneNumber") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("Photo") - .HasColumnType("longblob"); - - b.Property("TenantId") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("ApplicationUserId"); - - b.HasIndex("JobRoleId"); - - b.HasIndex("TenantId"); - - b.ToTable("Employees"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Employees.WorkShift", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - - b.Property("EndTime") - .HasColumnType("time(6)"); - - b.Property("Name") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("StartTime") - .HasColumnType("time(6)"); - - b.Property("TenantId") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("TenantId"); - - b.ToTable("WorkShifts"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Entitlements.ActivityMaster", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - - b.Property("ActivityName") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("TaskAllocationId") - .HasColumnType("int"); - - b.Property("TenantId") - .HasColumnType("int"); - - b.Property("UnitOfMeasurement") - .IsRequired() - .HasColumnType("longtext"); - - b.HasKey("Id"); - - b.HasIndex("TaskAllocationId"); - - b.HasIndex("TenantId"); - - b.ToTable("ActivityMasters"); - - b.HasData( - new - { - Id = 1, - ActivityName = "Core Cutting", - TenantId = 1, - UnitOfMeasurement = "Number" - }, - new - { - Id = 2, - ActivityName = "Fabrication", - TenantId = 1, - UnitOfMeasurement = "Meter" - }, - new - { - Id = 3, - ActivityName = "Lifting", - TenantId = 1, - UnitOfMeasurement = "Meter" - }, - new - { - Id = 4, - ActivityName = "Hanging", - TenantId = 1, - UnitOfMeasurement = "Meter" - }, - new - { - Id = 5, - ActivityName = "Tapping", - TenantId = 1, - UnitOfMeasurement = "Meter" - }, - new - { - Id = 6, - ActivityName = "Welding", - TenantId = 1, - UnitOfMeasurement = "Meter" - }, - new - { - Id = 7, - ActivityName = "Testing", - TenantId = 1, - UnitOfMeasurement = "Area" - }, - new - { - Id = 8, - ActivityName = "Painting", - TenantId = 1, - UnitOfMeasurement = "Meter" - }, - new - { - Id = 9, - ActivityName = "Marking Area", - TenantId = 1, - UnitOfMeasurement = "Meter" - }, - new - { - Id = 10, - ActivityName = "Drilling", - TenantId = 1, - UnitOfMeasurement = "Number" - }, - new - { - Id = 11, - ActivityName = "MS Support Fabrication", - TenantId = 1, - UnitOfMeasurement = "Number" - }, - new - { - Id = 12, - ActivityName = "MS Support Hanging", - TenantId = 1, - UnitOfMeasurement = "Number" - }, - new - { - Id = 13, - ActivityName = "Hydrant Volve", - TenantId = 1, - UnitOfMeasurement = "Number" - }, - new - { - Id = 14, - ActivityName = "Sprinkler Installation", - TenantId = 1, - UnitOfMeasurement = "Number" - }); - }); - - modelBuilder.Entity("Marco.Pms.Model.Entitlements.ApplicationRole", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("char(36)"); - - b.Property("Description") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("Role") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("TenantId") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("TenantId"); - - b.ToTable("ApplicationRoles"); - - b.HasData( - new - { - Id = new Guid("2c8d0808-c421-11ef-9b93-0242ac110002"), - Description = "", - Role = "Admin", - TenantId = 1 - }, - new - { - Id = new Guid("62e0918d-c421-11ef-9b93-0242ac110002"), - Description = "", - Role = "Welder", - TenantId = 1 - }, - new - { - Id = new Guid("68823f1f-c421-11ef-9b93-0242ac110002"), - Description = "", - Role = "Helper", - TenantId = 1 - }, - new - { - Id = new Guid("6d3a7c72-c421-11ef-9b93-0242ac110002"), - Description = "", - Role = "Site Engineer", - TenantId = 1 - }, - new - { - Id = new Guid("6d3aad72-c421-11ef-9b93-0242ac110002"), - Description = "", - Role = "Project Manager", - TenantId = 1 - }); - }); - - modelBuilder.Entity("Marco.Pms.Model.Entitlements.EmployeeRoleMapping", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("char(36)"); - - b.Property("EmployeeId") - .HasColumnType("int"); - - b.Property("IsEnabled") - .HasColumnType("tinyint(1)"); - - b.Property("RoleId") - .HasColumnType("char(36)"); - - b.Property("TenantId") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("EmployeeId"); - - b.HasIndex("RoleId"); - - b.HasIndex("TenantId"); - - b.ToTable("EmployeeRoleMappings"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Entitlements.Feature", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("char(36)"); - - b.Property("Description") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("IsActive") - .HasColumnType("tinyint(1)"); - - b.Property("ModuleId") - .HasColumnType("int"); - - b.Property("Name") - .IsRequired() - .HasColumnType("longtext"); - - b.HasKey("Id"); - - b.HasIndex("ModuleId"); - - b.ToTable("Features"); - - b.HasData( - new - { - Id = new Guid("53176ebf-c75d-42e5-839f-4508ffac3def"), - Description = "Manage Project", - IsActive = true, - ModuleId = 1, - Name = "Manage Project" - }, - new - { - Id = new Guid("9666de86-d7c7-4d3d-acaa-fcd6d6b81f3c"), - Description = "Manage Infra", - IsActive = true, - ModuleId = 1, - Name = "Manage Infra" - }, - new - { - Id = new Guid("9d4b5489-2079-40b9-bd77-6e1bf90bc19f"), - Description = "Manage Tasks", - IsActive = true, - ModuleId = 1, - Name = "Manage Tasks" - }, - new - { - Id = new Guid("39e66f81-efc6-446c-95bd-46bff6cfb606"), - Description = "Assign and Update Tasks Progress", - IsActive = true, - ModuleId = 1, - Name = "Assign and Update Tasks Progress" - }, - new - { - Id = new Guid("81ab8a87-8ccd-4015-a917-0627cee6a100"), - Description = "Manage Employee", - IsActive = true, - ModuleId = 2, - Name = "Manage Employee" - }, - new - { - Id = new Guid("52c9cf54-1eb2-44d2-81bb-524cf29c0a94"), - Description = "Attendance", - IsActive = true, - ModuleId = 2, - Name = "Attendance" - }, - new - { - Id = new Guid("be3b3afc-6ccf-4566-b9b6-aafcb65546be"), - Description = "Global Masters", - IsActive = true, - ModuleId = 3, - Name = "Global Masters" - }, - new - { - Id = new Guid("660131a4-788c-4739-a082-cbbf7879cbf2"), - Description = "Tenant Masters", - IsActive = true, - ModuleId = 3, - Name = "Tenant Masters" - }); - }); - - modelBuilder.Entity("Marco.Pms.Model.Entitlements.FeaturePermission", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("char(36)"); - - b.Property("Description") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("FeatureId") - .HasColumnType("char(36)"); - - b.Property("IsEnabled") - .HasColumnType("tinyint(1)"); - - b.Property("Name") - .IsRequired() - .HasColumnType("longtext"); - - b.HasKey("Id"); - - b.HasIndex("FeatureId"); - - b.ToTable("FeaturePermissions"); - - b.HasData( - new - { - Id = new Guid("6ea44136-987e-44ba-9e5d-1cf8f5837ebc"), - Description = "", - FeatureId = new Guid("53176ebf-c75d-42e5-839f-4508ffac3def"), - IsEnabled = true, - Name = "View Project" - }, - new - { - Id = new Guid("172fc9b6-755b-4f62-ab26-55c34a330614"), - Description = "", - FeatureId = new Guid("53176ebf-c75d-42e5-839f-4508ffac3def"), - IsEnabled = true, - Name = "Manage Project" - }, - new - { - Id = new Guid("b94802ce-0689-4643-9e1d-11c86950c35b"), - Description = "", - FeatureId = new Guid("53176ebf-c75d-42e5-839f-4508ffac3def"), - IsEnabled = true, - Name = "Manage Team" - }, - new - { - Id = new Guid("c7b68e33-72f0-474f-bd96-77636427ecc8"), - Description = "", - FeatureId = new Guid("9666de86-d7c7-4d3d-acaa-fcd6d6b81f3c"), - IsEnabled = true, - Name = "View Project Infra" - }, - new - { - Id = new Guid("f2aee20a-b754-4537-8166-f9507b44585b"), - Description = "", - FeatureId = new Guid("9666de86-d7c7-4d3d-acaa-fcd6d6b81f3c"), - IsEnabled = true, - Name = "Manage Project Infra" - }, - new - { - Id = new Guid("9fcc5f87-25e3-4846-90ac-67a71ab92e3c"), - Description = "", - FeatureId = new Guid("9d4b5489-2079-40b9-bd77-6e1bf90bc19f"), - IsEnabled = true, - Name = "View Task" - }, - new - { - Id = new Guid("08752f33-3b29-4816-b76b-ea8a968ed3c5"), - Description = "", - FeatureId = new Guid("9d4b5489-2079-40b9-bd77-6e1bf90bc19f"), - IsEnabled = true, - Name = "Manage Task" - }, - new - { - Id = new Guid("d135a4b0-4f9a-4903-ab9c-4843839ebdee"), - Description = "", - FeatureId = new Guid("39e66f81-efc6-446c-95bd-46bff6cfb606"), - IsEnabled = true, - Name = "Assign Task and Report Progress" - }, - new - { - Id = new Guid("ed99ecd4-1bed-42e1-b7b3-d64c04493823"), - Description = "", - FeatureId = new Guid("39e66f81-efc6-446c-95bd-46bff6cfb606"), - IsEnabled = true, - Name = "Approve Task" - }, - new - { - Id = new Guid("b82d2b7e-0d52-45f3-997b-c008ea460e7f"), - Description = "", - FeatureId = new Guid("81ab8a87-8ccd-4015-a917-0627cee6a100"), - IsEnabled = true, - Name = "View Employee" - }, - new - { - Id = new Guid("a97d366a-c2bb-448d-be93-402bd2324566"), - Description = "", - FeatureId = new Guid("81ab8a87-8ccd-4015-a917-0627cee6a100"), - IsEnabled = true, - Name = "Manage Employee" - }, - new - { - Id = new Guid("fbd213e0-0250-46f1-9f5f-4b2a1e6e76a3"), - Description = "", - FeatureId = new Guid("81ab8a87-8ccd-4015-a917-0627cee6a100"), - IsEnabled = true, - Name = "Assign To Project" - }, - new - { - Id = new Guid("915e6bff-65f6-4e3f-aea8-3fd217d3ea9e"), - Description = "", - FeatureId = new Guid("52c9cf54-1eb2-44d2-81bb-524cf29c0a94"), - IsEnabled = true, - Name = "Perform Attendance " - }, - new - { - Id = new Guid("57802c4a-00aa-4a1f-a048-fd2f70dd44b6"), - Description = "", - FeatureId = new Guid("52c9cf54-1eb2-44d2-81bb-524cf29c0a94"), - IsEnabled = true, - Name = "Regularize Attendance" - }, - new - { - Id = new Guid("5ffbafe0-7ab0-48b1-bb50-c1bf76b65f9d"), - Description = "", - FeatureId = new Guid("be3b3afc-6ccf-4566-b9b6-aafcb65546be"), - IsEnabled = true, - Name = "View Masters" - }, - new - { - Id = new Guid("588a8824-f924-4955-82d8-fc51956cf323"), - Description = "", - FeatureId = new Guid("be3b3afc-6ccf-4566-b9b6-aafcb65546be"), - IsEnabled = true, - Name = "Manage Masters" - }, - new - { - Id = new Guid("cb8ec407-46d4-4467-930c-69127cda6dec"), - Description = "", - FeatureId = new Guid("660131a4-788c-4739-a082-cbbf7879cbf2"), - IsEnabled = true, - Name = "View Masters" - }, - new - { - Id = new Guid("6b1a6d97-a951-4de5-9b19-709bac7c4f18"), - Description = "", - FeatureId = new Guid("660131a4-788c-4739-a082-cbbf7879cbf2"), - IsEnabled = true, - Name = "Manage Masters" - }); - }); - - modelBuilder.Entity("Marco.Pms.Model.Entitlements.JobRole", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - - b.Property("Description") - .HasColumnType("longtext"); - - b.Property("Name") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("TenantId") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("TenantId"); - - b.ToTable("JobRoles"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Entitlements.Module", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - - b.Property("Description") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("Key") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("Name") - .IsRequired() - .HasColumnType("longtext"); - - b.HasKey("Id"); - - b.ToTable("Modules"); - - b.HasData( - new - { - Id = 1, - Description = "Project Module", - Key = "331a7bea-688e-4f27-8dba-697d9cd29870", - Name = "Project" - }, - new - { - Id = 2, - Description = "Employee Module", - Key = "ba873fd2-277b-4baa-88b9-22b69010ffa8", - Name = "Employee" - }, - new - { - Id = 3, - Description = "Masters Module", - Key = "aa481e97-9a9b-4b1e-b9dd-0a6ce26dab47", - Name = "Masters" - }); - }); - - modelBuilder.Entity("Marco.Pms.Model.Entitlements.RolePermissionMappings", b => - { - b.Property("ApplicationRoleId") - .HasColumnType("char(36)"); - - b.Property("FeaturePermissionId") - .HasColumnType("char(36)"); - - b.HasKey("ApplicationRoleId", "FeaturePermissionId"); - - b.HasIndex("FeaturePermissionId"); - - b.ToTable("RolePermissionMappings"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Entitlements.StatusMaster", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - - b.Property("Status") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("TenantId") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("TenantId"); - - b.ToTable("StatusMasters"); - - b.HasData( - new - { - Id = 1, - Status = "Active", - TenantId = 1 - }, - new - { - Id = 2, - Status = "In Progress", - TenantId = 1 - }, - new - { - Id = 3, - Status = "On Hold", - TenantId = 1 - }, - new - { - Id = 4, - Status = "Completed", - TenantId = 1 - }); - }); - - modelBuilder.Entity("Marco.Pms.Model.Entitlements.Tenant", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - - b.Property("ContactName") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("ContactNumber") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("Description") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("DomainName") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("Name") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("OnBoardingDate") - .HasColumnType("datetime(6)"); - - b.HasKey("Id"); - - b.ToTable("Tenants"); - - b.HasData( - new - { - Id = 1, - ContactName = "Admin", - ContactNumber = "123456789", - Description = "", - DomainName = "www.marcobms.org", - Name = "MarcoBMS", - OnBoardingDate = new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified) - }); - }); - - modelBuilder.Entity("Marco.Pms.Model.Projects.Building", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - - b.Property("Description") - .HasColumnType("longtext"); - - b.Property("Name") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("ProjectId") - .HasColumnType("int"); - - b.Property("TenantId") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("TenantId"); - - b.ToTable("Buildings"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Projects.Floor", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - - b.Property("BuildingId") - .HasColumnType("int"); - - b.Property("FloorName") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("TenantId") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("BuildingId"); - - b.HasIndex("TenantId"); - - b.ToTable("Floor"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Projects.Project", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - - b.Property("ContactPerson") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("EndDate") - .HasColumnType("datetime(6)"); - - b.Property("Name") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("ProjectAddress") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("ProjectStatusId") - .HasColumnType("int"); - - b.Property("StartDate") - .HasColumnType("datetime(6)"); - - b.Property("TenantId") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("ProjectStatusId"); - - b.HasIndex("TenantId"); - - b.ToTable("Projects"); - - b.HasData( - new - { - Id = 1, - ContactPerson = "Project 1 Contact Person", - Name = "Project 1", - ProjectAddress = "Project 1 Address", - ProjectStatusId = 1, - TenantId = 1 - }, - new - { - Id = 2, - ContactPerson = "Project 2 Contact Person", - Name = "Project 2", - ProjectAddress = "Project 2 Address", - ProjectStatusId = 2, - TenantId = 1 - }, - new - { - Id = 3, - ContactPerson = "Project 3 Contact Person", - Name = "Project 3", - ProjectAddress = "Project 3 Address", - ProjectStatusId = 3, - TenantId = 1 - }); - }); - - modelBuilder.Entity("Marco.Pms.Model.Projects.ProjectAllocation", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - - b.Property("AllocationDate") - .HasColumnType("datetime(6)"); - - b.Property("EmployeeId") - .HasColumnType("int"); - - b.Property("EmployeeRoleId") - .HasColumnType("char(36)"); - - b.Property("ProjectId") - .HasColumnType("int"); - - b.Property("ReAllocationDate") - .HasColumnType("datetime(6)"); - - b.Property("TenantId") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("EmployeeId"); - - b.HasIndex("ProjectId"); - - b.HasIndex("TenantId"); - - b.ToTable("ProjectAllocations"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Projects.WorkArea", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - - b.Property("AreaName") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("FloorId") - .HasColumnType("int"); - - b.Property("TenantId") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("FloorId"); - - b.HasIndex("TenantId"); - - b.ToTable("WorkAreas"); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRole", b => - { - b.Property("Id") - .HasColumnType("varchar(255)"); - - b.Property("ConcurrencyStamp") - .IsConcurrencyToken() - .HasColumnType("longtext"); - - b.Property("Name") - .HasMaxLength(256) - .HasColumnType("varchar(256)"); - - b.Property("NormalizedName") - .HasMaxLength(256) - .HasColumnType("varchar(256)"); - - b.HasKey("Id"); - - b.HasIndex("NormalizedName") - .IsUnique() - .HasDatabaseName("RoleNameIndex"); - - b.ToTable("AspNetRoles", (string)null); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - - b.Property("ClaimType") - .HasColumnType("longtext"); - - b.Property("ClaimValue") - .HasColumnType("longtext"); - - b.Property("RoleId") - .IsRequired() - .HasColumnType("varchar(255)"); - - b.HasKey("Id"); - - b.HasIndex("RoleId"); - - b.ToTable("AspNetRoleClaims", (string)null); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUser", b => - { - b.Property("Id") - .HasColumnType("varchar(255)"); - - b.Property("AccessFailedCount") - .HasColumnType("int"); - - b.Property("ConcurrencyStamp") - .IsConcurrencyToken() - .HasColumnType("longtext"); - - b.Property("Discriminator") - .IsRequired() - .HasMaxLength(21) - .HasColumnType("varchar(21)"); - - b.Property("Email") - .HasMaxLength(256) - .HasColumnType("varchar(256)"); - - b.Property("EmailConfirmed") - .HasColumnType("tinyint(1)"); - - b.Property("LockoutEnabled") - .HasColumnType("tinyint(1)"); - - b.Property("LockoutEnd") - .HasColumnType("datetime(6)"); - - b.Property("NormalizedEmail") - .HasMaxLength(256) - .HasColumnType("varchar(256)"); - - b.Property("NormalizedUserName") - .HasMaxLength(256) - .HasColumnType("varchar(256)"); - - b.Property("PasswordHash") - .HasColumnType("longtext"); - - b.Property("PhoneNumber") - .HasColumnType("longtext"); - - b.Property("PhoneNumberConfirmed") - .HasColumnType("tinyint(1)"); - - b.Property("SecurityStamp") - .HasColumnType("longtext"); - - b.Property("TwoFactorEnabled") - .HasColumnType("tinyint(1)"); - - b.Property("UserName") - .HasMaxLength(256) - .HasColumnType("varchar(256)"); - - b.HasKey("Id"); - - b.HasIndex("NormalizedEmail") - .HasDatabaseName("EmailIndex"); - - b.HasIndex("NormalizedUserName") - .IsUnique() - .HasDatabaseName("UserNameIndex"); - - b.ToTable("AspNetUsers", (string)null); - - b.HasDiscriminator().HasValue("IdentityUser"); - - b.UseTphMappingStrategy(); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - - b.Property("ClaimType") - .HasColumnType("longtext"); - - b.Property("ClaimValue") - .HasColumnType("longtext"); - - b.Property("UserId") - .IsRequired() - .HasColumnType("varchar(255)"); - - b.HasKey("Id"); - - b.HasIndex("UserId"); - - b.ToTable("AspNetUserClaims", (string)null); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin", b => - { - b.Property("LoginProvider") - .HasColumnType("varchar(255)"); - - b.Property("ProviderKey") - .HasColumnType("varchar(255)"); - - b.Property("ProviderDisplayName") - .HasColumnType("longtext"); - - b.Property("UserId") - .IsRequired() - .HasColumnType("varchar(255)"); - - b.HasKey("LoginProvider", "ProviderKey"); - - b.HasIndex("UserId"); - - b.ToTable("AspNetUserLogins", (string)null); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole", b => - { - b.Property("UserId") - .HasColumnType("varchar(255)"); - - b.Property("RoleId") - .HasColumnType("varchar(255)"); - - b.HasKey("UserId", "RoleId"); - - b.HasIndex("RoleId"); - - b.ToTable("AspNetUserRoles", (string)null); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken", b => - { - b.Property("UserId") - .HasColumnType("varchar(255)"); - - b.Property("LoginProvider") - .HasColumnType("varchar(255)"); - - b.Property("Name") - .HasColumnType("varchar(255)"); - - b.Property("Value") - .HasColumnType("longtext"); - - b.HasKey("UserId", "LoginProvider", "Name"); - - b.ToTable("AspNetUserTokens", (string)null); - }); - - modelBuilder.Entity("Marco.Pms.Model.Entitlements.ApplicationUser", b => - { - b.HasBaseType("Microsoft.AspNetCore.Identity.IdentityUser"); - - b.Property("IsRootUser") - .HasColumnType("tinyint(1)"); - - b.Property("Role") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("TenantId") - .HasColumnType("int"); - - b.HasDiscriminator().HasValue("ApplicationUser"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Activities.TaskAllocation", b => - { - b.HasOne("Marco.Pms.Model.Projects.Building", "Building") - .WithMany() - .HasForeignKey("BuildingId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Marco.Pms.Model.Employees.Employee", "Employee") - .WithMany() - .HasForeignKey("EmployeeId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Marco.Pms.Model.Projects.Project", "Project") - .WithMany() - .HasForeignKey("ProjectId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Marco.Pms.Model.Entitlements.Tenant", "Tenant") - .WithMany() - .HasForeignKey("TenantId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Marco.Pms.Model.Projects.WorkArea", "WorkArea") - .WithMany() - .HasForeignKey("WorkAreaId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Building"); - - b.Navigation("Employee"); - - b.Navigation("Project"); - - b.Navigation("Tenant"); - - b.Navigation("WorkArea"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Activities.WorkItem", b => - { - b.HasOne("Marco.Pms.Model.Entitlements.ActivityMaster", "ActivityMaster") - .WithMany() - .HasForeignKey("ActivityId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Marco.Pms.Model.Entitlements.Tenant", "Tenant") - .WithMany() - .HasForeignKey("TenantId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Marco.Pms.Model.Projects.WorkArea", "WorkArea") - .WithMany() - .HasForeignKey("WorkAreaId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("ActivityMaster"); - - b.Navigation("Tenant"); - - b.Navigation("WorkArea"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Activities.WorkItemMapping", b => - { - b.HasOne("Marco.Pms.Model.Entitlements.Tenant", "Tenant") - .WithMany() - .HasForeignKey("TenantId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Marco.Pms.Model.Projects.WorkArea", "WorkArea") - .WithMany() - .HasForeignKey("WorkAreaId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Marco.Pms.Model.Activities.WorkItem", "WorkItem") - .WithMany() - .HasForeignKey("WorkItemId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Tenant"); - - b.Navigation("WorkArea"); - - b.Navigation("WorkItem"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Authentication.RefreshToken", b => - { - b.HasOne("Microsoft.AspNetCore.Identity.IdentityUser", "User") - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("User"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Employees.Attendance", b => - { - b.HasOne("Marco.Pms.Model.Employees.Employee", "Employee") - .WithMany() - .HasForeignKey("EmployeeID") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Marco.Pms.Model.Employees.AttendanceLog", "InTimeLog") - .WithMany() - .HasForeignKey("InTimeID"); - - b.HasOne("Marco.Pms.Model.Employees.AttendanceLog", "OutTimeLog") - .WithMany() - .HasForeignKey("OutTimeID"); - - b.HasOne("Marco.Pms.Model.Entitlements.Tenant", "Tenant") - .WithMany() - .HasForeignKey("TenantId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Employee"); - - b.Navigation("InTimeLog"); - - b.Navigation("OutTimeLog"); - - b.Navigation("Tenant"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Employees.AttendanceLog", b => - { - b.HasOne("Marco.Pms.Model.Employees.Employee", "Employee") - .WithMany() - .HasForeignKey("EmployeeID") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Marco.Pms.Model.Entitlements.Tenant", "Tenant") - .WithMany() - .HasForeignKey("TenantId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Employee"); - - b.Navigation("Tenant"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Employees.Employee", b => - { - b.HasOne("Marco.Pms.Model.Entitlements.ApplicationUser", "ApplicationUser") - .WithMany() - .HasForeignKey("ApplicationUserId"); - - b.HasOne("Marco.Pms.Model.Entitlements.JobRole", "JobRole") - .WithMany() - .HasForeignKey("JobRoleId"); - - b.HasOne("Marco.Pms.Model.Entitlements.Tenant", "Tenant") - .WithMany() - .HasForeignKey("TenantId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("ApplicationUser"); - - b.Navigation("JobRole"); - - b.Navigation("Tenant"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Employees.WorkShift", b => - { - b.HasOne("Marco.Pms.Model.Entitlements.Tenant", "Tenant") - .WithMany() - .HasForeignKey("TenantId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Tenant"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Entitlements.ActivityMaster", b => - { - b.HasOne("Marco.Pms.Model.Activities.TaskAllocation", null) - .WithMany("AllotedTask") - .HasForeignKey("TaskAllocationId"); - - b.HasOne("Marco.Pms.Model.Entitlements.Tenant", "Tenant") - .WithMany() - .HasForeignKey("TenantId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Tenant"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Entitlements.ApplicationRole", b => - { - b.HasOne("Marco.Pms.Model.Entitlements.Tenant", null) - .WithMany() - .HasForeignKey("TenantId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Marco.Pms.Model.Entitlements.EmployeeRoleMapping", b => - { - b.HasOne("Marco.Pms.Model.Employees.Employee", "Employee") - .WithMany() - .HasForeignKey("EmployeeId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Marco.Pms.Model.Entitlements.ApplicationRole", "Role") - .WithMany() - .HasForeignKey("RoleId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Marco.Pms.Model.Entitlements.Tenant", "Tenant") - .WithMany() - .HasForeignKey("TenantId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Employee"); - - b.Navigation("Role"); - - b.Navigation("Tenant"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Entitlements.Feature", b => - { - b.HasOne("Marco.Pms.Model.Entitlements.Module", "Module") - .WithMany() - .HasForeignKey("ModuleId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Module"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Entitlements.FeaturePermission", b => - { - b.HasOne("Marco.Pms.Model.Entitlements.Feature", "Feature") - .WithMany("FeaturePermissions") - .HasForeignKey("FeatureId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Feature"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Entitlements.JobRole", b => - { - b.HasOne("Marco.Pms.Model.Entitlements.Tenant", "Tenant") - .WithMany() - .HasForeignKey("TenantId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Tenant"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Entitlements.RolePermissionMappings", b => - { - b.HasOne("Marco.Pms.Model.Entitlements.ApplicationRole", null) - .WithMany() - .HasForeignKey("ApplicationRoleId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Marco.Pms.Model.Entitlements.FeaturePermission", null) - .WithMany() - .HasForeignKey("FeaturePermissionId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Marco.Pms.Model.Entitlements.StatusMaster", b => - { - b.HasOne("Marco.Pms.Model.Entitlements.Tenant", "Tenant") - .WithMany() - .HasForeignKey("TenantId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Tenant"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Projects.Building", b => - { - b.HasOne("Marco.Pms.Model.Entitlements.Tenant", "Tenant") - .WithMany() - .HasForeignKey("TenantId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Tenant"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Projects.Floor", b => - { - b.HasOne("Marco.Pms.Model.Projects.Building", "Building") - .WithMany() - .HasForeignKey("BuildingId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Marco.Pms.Model.Entitlements.Tenant", "Tenant") - .WithMany() - .HasForeignKey("TenantId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Building"); - - b.Navigation("Tenant"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Projects.Project", b => - { - b.HasOne("Marco.Pms.Model.Entitlements.StatusMaster", "ProjectStatus") - .WithMany() - .HasForeignKey("ProjectStatusId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Marco.Pms.Model.Entitlements.Tenant", "Tenant") - .WithMany() - .HasForeignKey("TenantId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("ProjectStatus"); - - b.Navigation("Tenant"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Projects.ProjectAllocation", b => - { - b.HasOne("Marco.Pms.Model.Employees.Employee", "Employee") - .WithMany() - .HasForeignKey("EmployeeId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Marco.Pms.Model.Projects.Project", "Project") - .WithMany() - .HasForeignKey("ProjectId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Marco.Pms.Model.Entitlements.Tenant", "Tenant") - .WithMany() - .HasForeignKey("TenantId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Employee"); - - b.Navigation("Project"); - - b.Navigation("Tenant"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Projects.WorkArea", b => - { - b.HasOne("Marco.Pms.Model.Projects.Floor", "Floor") - .WithMany() - .HasForeignKey("FloorId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Marco.Pms.Model.Entitlements.Tenant", "Tenant") - .WithMany() - .HasForeignKey("TenantId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Floor"); - - b.Navigation("Tenant"); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim", b => - { - b.HasOne("Microsoft.AspNetCore.Identity.IdentityRole", null) - .WithMany() - .HasForeignKey("RoleId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim", b => - { - b.HasOne("Microsoft.AspNetCore.Identity.IdentityUser", null) - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin", b => - { - b.HasOne("Microsoft.AspNetCore.Identity.IdentityUser", null) - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole", b => - { - b.HasOne("Microsoft.AspNetCore.Identity.IdentityRole", null) - .WithMany() - .HasForeignKey("RoleId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Microsoft.AspNetCore.Identity.IdentityUser", null) - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken", b => - { - b.HasOne("Microsoft.AspNetCore.Identity.IdentityUser", null) - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Marco.Pms.Model.Activities.TaskAllocation", b => - { - b.Navigation("AllotedTask"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Entitlements.Feature", b => - { - b.Navigation("FeaturePermissions"); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/Marco.Pms.DataAccess/Migrations/20250302060812_CreateJobRoles.cs b/Marco.Pms.DataAccess/Migrations/20250302060812_CreateJobRoles.cs deleted file mode 100644 index c1f7d00..0000000 --- a/Marco.Pms.DataAccess/Migrations/20250302060812_CreateJobRoles.cs +++ /dev/null @@ -1,136 +0,0 @@ -using System; -using Microsoft.EntityFrameworkCore.Metadata; -using Microsoft.EntityFrameworkCore.Migrations; - -#nullable disable - -namespace Marco.Pms.DataAccess.Migrations -{ - /// - public partial class CreateJobRoles : Migration - { - /// - protected override void Up(MigrationBuilder migrationBuilder) - { - //migrationBuilder.DropColumn( - // name: "RoleId", - // table: "Employees"); - - migrationBuilder.AddColumn( - name: "JobRoleId", - table: "Employees", - type: "int", - nullable: true); - - migrationBuilder.CreateTable( - name: "JobRoles", - columns: table => new - { - Id = table.Column(type: "int", nullable: false) - .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), - Name = table.Column(type: "longtext", nullable: false) - .Annotation("MySql:CharSet", "utf8mb4"), - Description = table.Column(type: "longtext", nullable: true) - .Annotation("MySql:CharSet", "utf8mb4"), - TenantId = table.Column(type: "int", nullable: false) - }, - constraints: table => - { - table.PrimaryKey("PK_JobRoles", x => x.Id); - table.ForeignKey( - name: "FK_JobRoles_Tenants_TenantId", - column: x => x.TenantId, - principalTable: "Tenants", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); - }) - .Annotation("MySql:CharSet", "utf8mb4"); - - migrationBuilder.UpdateData( - table: "Modules", - keyColumn: "Id", - keyValue: 1, - column: "Key", - value: "331a7bea-688e-4f27-8dba-697d9cd29870"); - - migrationBuilder.UpdateData( - table: "Modules", - keyColumn: "Id", - keyValue: 2, - column: "Key", - value: "ba873fd2-277b-4baa-88b9-22b69010ffa8"); - - migrationBuilder.UpdateData( - table: "Modules", - keyColumn: "Id", - keyValue: 3, - column: "Key", - value: "aa481e97-9a9b-4b1e-b9dd-0a6ce26dab47"); - - migrationBuilder.CreateIndex( - name: "IX_Employees_JobRoleId", - table: "Employees", - column: "JobRoleId"); - - migrationBuilder.CreateIndex( - name: "IX_JobRoles_TenantId", - table: "JobRoles", - column: "TenantId"); - - migrationBuilder.AddForeignKey( - name: "FK_Employees_JobRoles_JobRoleId", - table: "Employees", - column: "JobRoleId", - principalTable: "JobRoles", - principalColumn: "Id"); - } - - /// - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropForeignKey( - name: "FK_Employees_JobRoles_JobRoleId", - table: "Employees"); - - migrationBuilder.DropTable( - name: "JobRoles"); - - migrationBuilder.DropIndex( - name: "IX_Employees_JobRoleId", - table: "Employees"); - - migrationBuilder.DropColumn( - name: "JobRoleId", - table: "Employees"); - - migrationBuilder.AddColumn( - name: "RoleId", - table: "Employees", - type: "char(36)", - nullable: false, - defaultValue: new Guid("00000000-0000-0000-0000-000000000000"), - collation: "ascii_general_ci"); - - migrationBuilder.UpdateData( - table: "Modules", - keyColumn: "Id", - keyValue: 1, - column: "Key", - value: "05db8d60-e977-40f6-b944-8602d0d4cb98"); - - migrationBuilder.UpdateData( - table: "Modules", - keyColumn: "Id", - keyValue: 2, - column: "Key", - value: "456ddbbe-0963-406d-8874-589a546c3670"); - - migrationBuilder.UpdateData( - table: "Modules", - keyColumn: "Id", - keyValue: 3, - column: "Key", - value: "19eca67f-c3b1-4e5c-8d95-c8341cf058ae"); - } - } -} diff --git a/Marco.Pms.DataAccess/Migrations/20250303045849_attendancemodule.Designer.cs b/Marco.Pms.DataAccess/Migrations/20250303045849_attendancemodule.Designer.cs deleted file mode 100644 index ab78759..0000000 --- a/Marco.Pms.DataAccess/Migrations/20250303045849_attendancemodule.Designer.cs +++ /dev/null @@ -1,1933 +0,0 @@ -// -using System; -using Marco.Pms.DataAccess.Data; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Metadata; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; - -#nullable disable - -namespace Marco.Pms.DataAccess.Migrations -{ - [DbContext(typeof(ApplicationDbContext))] - [Migration("20250303045849_attendancemodule")] - partial class attendancemodule - { - /// - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasAnnotation("ProductVersion", "8.0.12") - .HasAnnotation("Relational:MaxIdentifierLength", 64); - - // MySqlModelBuilderExtensions.AutoIncrementColumns(modelBuilder); - - modelBuilder.Entity("Marco.Pms.Model.Activities.TaskAllocation", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - - b.Property("AllocationDate") - .HasColumnType("datetime(6)"); - - b.Property("BuildingId") - .HasColumnType("int"); - - b.Property("EmployeeId") - .HasColumnType("int"); - - b.Property("EmployeeRole") - .HasColumnType("int"); - - b.Property("ProjectId") - .HasColumnType("int"); - - b.Property("ReAllocationDate") - .HasColumnType("datetime(6)"); - - b.Property("TenantId") - .HasColumnType("int"); - - b.Property("WorkAreaId") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("BuildingId"); - - b.HasIndex("EmployeeId"); - - b.HasIndex("ProjectId"); - - b.HasIndex("TenantId"); - - b.HasIndex("WorkAreaId"); - - b.ToTable("TaskAllocations"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Activities.WorkItem", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - - b.Property("ActivityId") - .HasColumnType("int"); - - b.Property("CompletedWork") - .HasColumnType("int"); - - b.Property("PlannedWork") - .HasColumnType("int"); - - b.Property("TaskDate") - .HasColumnType("datetime(6)"); - - b.Property("TenantId") - .HasColumnType("int"); - - b.Property("WorkAreaId") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("ActivityId"); - - b.HasIndex("TenantId"); - - b.HasIndex("WorkAreaId"); - - b.ToTable("WorkItems"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Activities.WorkItemMapping", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - - b.Property("TenantId") - .HasColumnType("int"); - - b.Property("WorkAreaId") - .HasColumnType("int"); - - b.Property("WorkItemId") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("TenantId"); - - b.HasIndex("WorkAreaId"); - - b.HasIndex("WorkItemId"); - - b.ToTable("WorkItemMapping"); - }); - - modelBuilder.Entity("Marco.Pms.Model.AttendanceModule.AttendLog", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - - b.Property("Activity") - .HasColumnType("int"); - - b.Property("ActivityTime") - .HasColumnType("datetime(6)"); - - b.Property("AttendanceId") - .HasColumnType("int"); - - b.Property("Comment") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("EmployeeID") - .HasColumnType("int"); - - b.Property("Latitude") - .HasColumnType("longtext"); - - b.Property("Longitude") - .HasColumnType("longtext"); - - b.Property("Photo") - .HasColumnType("longblob"); - - b.Property("TenantId") - .HasColumnType("int"); - - b.Property("UpdatedBy") - .HasColumnType("int"); - - b.Property("UpdatedOn") - .HasColumnType("datetime(6)"); - - b.HasKey("Id"); - - b.HasIndex("AttendanceId"); - - b.HasIndex("EmployeeID"); - - b.HasIndex("TenantId"); - - b.HasIndex("UpdatedBy"); - - b.ToTable("AttendLogs"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Authentication.RefreshToken", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - - b.Property("CreatedAt") - .HasColumnType("datetime(6)"); - - b.Property("ExpiryDate") - .HasColumnType("datetime(6)"); - - b.Property("IsRevoked") - .HasColumnType("tinyint(1)"); - - b.Property("IsUsed") - .HasColumnType("tinyint(1)"); - - b.Property("RevokedAt") - .HasColumnType("datetime(6)"); - - b.Property("Token") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("UserId") - .IsRequired() - .HasColumnType("varchar(255)"); - - b.HasKey("Id"); - - b.HasIndex("UserId"); - - b.ToTable("RefreshTokens"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Employees.Attendance", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - - b.Property("Activity") - .HasColumnType("int"); - - b.Property("ApprovedBy") - .HasColumnType("int"); - - b.Property("AttendanceDate") - .HasColumnType("datetime(6)"); - - b.Property("Comment") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("Date") - .HasColumnType("datetime(6)"); - - b.Property("EmployeeID") - .HasColumnType("int"); - - b.Property("InTime") - .HasColumnType("datetime(6)"); - - b.Property("IsApproved") - .HasColumnType("tinyint(1)"); - - b.Property("OutTime") - .HasColumnType("datetime(6)"); - - b.Property("ProjectID") - .HasColumnType("int"); - - b.Property("TenantId") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("EmployeeID"); - - b.HasIndex("TenantId"); - - b.ToTable("Attendances"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Employees.Employee", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - - b.Property("AadharNumber") - .HasColumnType("longtext"); - - b.Property("ApplicationUserId") - .HasColumnType("varchar(255)"); - - b.Property("BirthDate") - .HasColumnType("datetime(6)"); - - b.Property("CurrentAddress") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("Email") - .HasColumnType("longtext"); - - b.Property("EmergencyPhoneNumber") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("FirstName") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("Gender") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("JobRoleId") - .HasColumnType("int"); - - b.Property("LastName") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("MiddleName") - .HasColumnType("longtext"); - - b.Property("PanNumber") - .HasColumnType("longtext"); - - b.Property("PeramnentAddress") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("PhoneNumber") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("Photo") - .HasColumnType("longblob"); - - b.Property("RoleId") - .HasColumnType("char(36)"); - - b.Property("TenantId") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("ApplicationUserId"); - - b.HasIndex("JobRoleId"); - - b.HasIndex("TenantId"); - - b.ToTable("Employees"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Employees.WorkShift", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - - b.Property("EndTime") - .HasColumnType("time(6)"); - - b.Property("Name") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("StartTime") - .HasColumnType("time(6)"); - - b.Property("TenantId") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("TenantId"); - - b.ToTable("WorkShifts"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Entitlements.ActivityMaster", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - - b.Property("ActivityName") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("TaskAllocationId") - .HasColumnType("int"); - - b.Property("TenantId") - .HasColumnType("int"); - - b.Property("UnitOfMeasurement") - .IsRequired() - .HasColumnType("longtext"); - - b.HasKey("Id"); - - b.HasIndex("TaskAllocationId"); - - b.HasIndex("TenantId"); - - b.ToTable("ActivityMasters"); - - b.HasData( - new - { - Id = 1, - ActivityName = "Core Cutting", - TenantId = 1, - UnitOfMeasurement = "Number" - }, - new - { - Id = 2, - ActivityName = "Fabrication", - TenantId = 1, - UnitOfMeasurement = "Meter" - }, - new - { - Id = 3, - ActivityName = "Lifting", - TenantId = 1, - UnitOfMeasurement = "Meter" - }, - new - { - Id = 4, - ActivityName = "Hanging", - TenantId = 1, - UnitOfMeasurement = "Meter" - }, - new - { - Id = 5, - ActivityName = "Tapping", - TenantId = 1, - UnitOfMeasurement = "Meter" - }, - new - { - Id = 6, - ActivityName = "Welding", - TenantId = 1, - UnitOfMeasurement = "Meter" - }, - new - { - Id = 7, - ActivityName = "Testing", - TenantId = 1, - UnitOfMeasurement = "Area" - }, - new - { - Id = 8, - ActivityName = "Painting", - TenantId = 1, - UnitOfMeasurement = "Meter" - }, - new - { - Id = 9, - ActivityName = "Marking Area", - TenantId = 1, - UnitOfMeasurement = "Meter" - }, - new - { - Id = 10, - ActivityName = "Drilling", - TenantId = 1, - UnitOfMeasurement = "Number" - }, - new - { - Id = 11, - ActivityName = "MS Support Fabrication", - TenantId = 1, - UnitOfMeasurement = "Number" - }, - new - { - Id = 12, - ActivityName = "MS Support Hanging", - TenantId = 1, - UnitOfMeasurement = "Number" - }, - new - { - Id = 13, - ActivityName = "Hydrant Volve", - TenantId = 1, - UnitOfMeasurement = "Number" - }, - new - { - Id = 14, - ActivityName = "Sprinkler Installation", - TenantId = 1, - UnitOfMeasurement = "Number" - }); - }); - - modelBuilder.Entity("Marco.Pms.Model.Entitlements.ApplicationRole", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("char(36)"); - - b.Property("Description") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("Role") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("TenantId") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("TenantId"); - - b.ToTable("ApplicationRoles"); - - b.HasData( - new - { - Id = new Guid("2c8d0808-c421-11ef-9b93-0242ac110002"), - Description = "", - Role = "Admin", - TenantId = 1 - }, - new - { - Id = new Guid("62e0918d-c421-11ef-9b93-0242ac110002"), - Description = "", - Role = "Welder", - TenantId = 1 - }, - new - { - Id = new Guid("68823f1f-c421-11ef-9b93-0242ac110002"), - Description = "", - Role = "Helper", - TenantId = 1 - }, - new - { - Id = new Guid("6d3a7c72-c421-11ef-9b93-0242ac110002"), - Description = "", - Role = "Site Engineer", - TenantId = 1 - }, - new - { - Id = new Guid("6d3aad72-c421-11ef-9b93-0242ac110002"), - Description = "", - Role = "Project Manager", - TenantId = 1 - }); - }); - - modelBuilder.Entity("Marco.Pms.Model.Entitlements.EmployeeRoleMapping", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("char(36)"); - - b.Property("EmployeeId") - .HasColumnType("int"); - - b.Property("IsEnabled") - .HasColumnType("tinyint(1)"); - - b.Property("RoleId") - .HasColumnType("char(36)"); - - b.Property("TenantId") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("EmployeeId"); - - b.HasIndex("RoleId"); - - b.HasIndex("TenantId"); - - b.ToTable("EmployeeRoleMappings"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Entitlements.Feature", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("char(36)"); - - b.Property("Description") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("IsActive") - .HasColumnType("tinyint(1)"); - - b.Property("ModuleId") - .HasColumnType("int"); - - b.Property("Name") - .IsRequired() - .HasColumnType("longtext"); - - b.HasKey("Id"); - - b.HasIndex("ModuleId"); - - b.ToTable("Features"); - - b.HasData( - new - { - Id = new Guid("53176ebf-c75d-42e5-839f-4508ffac3def"), - Description = "Manage Project", - IsActive = true, - ModuleId = 1, - Name = "Manage Project" - }, - new - { - Id = new Guid("9666de86-d7c7-4d3d-acaa-fcd6d6b81f3c"), - Description = "Manage Infra", - IsActive = true, - ModuleId = 1, - Name = "Manage Infra" - }, - new - { - Id = new Guid("9d4b5489-2079-40b9-bd77-6e1bf90bc19f"), - Description = "Manage Tasks", - IsActive = true, - ModuleId = 1, - Name = "Manage Tasks" - }, - new - { - Id = new Guid("39e66f81-efc6-446c-95bd-46bff6cfb606"), - Description = "Assign and Update Tasks Progress", - IsActive = true, - ModuleId = 1, - Name = "Assign and Update Tasks Progress" - }, - new - { - Id = new Guid("81ab8a87-8ccd-4015-a917-0627cee6a100"), - Description = "Manage Employee", - IsActive = true, - ModuleId = 2, - Name = "Manage Employee" - }, - new - { - Id = new Guid("52c9cf54-1eb2-44d2-81bb-524cf29c0a94"), - Description = "Attendance", - IsActive = true, - ModuleId = 2, - Name = "Attendance" - }, - new - { - Id = new Guid("be3b3afc-6ccf-4566-b9b6-aafcb65546be"), - Description = "Global Masters", - IsActive = true, - ModuleId = 3, - Name = "Global Masters" - }, - new - { - Id = new Guid("660131a4-788c-4739-a082-cbbf7879cbf2"), - Description = "Tenant Masters", - IsActive = true, - ModuleId = 3, - Name = "Tenant Masters" - }); - }); - - modelBuilder.Entity("Marco.Pms.Model.Entitlements.FeaturePermission", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("char(36)"); - - b.Property("Description") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("FeatureId") - .HasColumnType("char(36)"); - - b.Property("IsEnabled") - .HasColumnType("tinyint(1)"); - - b.Property("Name") - .IsRequired() - .HasColumnType("longtext"); - - b.HasKey("Id"); - - b.HasIndex("FeatureId"); - - b.ToTable("FeaturePermissions"); - - b.HasData( - new - { - Id = new Guid("6ea44136-987e-44ba-9e5d-1cf8f5837ebc"), - Description = "", - FeatureId = new Guid("53176ebf-c75d-42e5-839f-4508ffac3def"), - IsEnabled = true, - Name = "View Project" - }, - new - { - Id = new Guid("172fc9b6-755b-4f62-ab26-55c34a330614"), - Description = "", - FeatureId = new Guid("53176ebf-c75d-42e5-839f-4508ffac3def"), - IsEnabled = true, - Name = "Manage Project" - }, - new - { - Id = new Guid("b94802ce-0689-4643-9e1d-11c86950c35b"), - Description = "", - FeatureId = new Guid("53176ebf-c75d-42e5-839f-4508ffac3def"), - IsEnabled = true, - Name = "Manage Team" - }, - new - { - Id = new Guid("c7b68e33-72f0-474f-bd96-77636427ecc8"), - Description = "", - FeatureId = new Guid("9666de86-d7c7-4d3d-acaa-fcd6d6b81f3c"), - IsEnabled = true, - Name = "View Project Infra" - }, - new - { - Id = new Guid("f2aee20a-b754-4537-8166-f9507b44585b"), - Description = "", - FeatureId = new Guid("9666de86-d7c7-4d3d-acaa-fcd6d6b81f3c"), - IsEnabled = true, - Name = "Manage Project Infra" - }, - new - { - Id = new Guid("9fcc5f87-25e3-4846-90ac-67a71ab92e3c"), - Description = "", - FeatureId = new Guid("9d4b5489-2079-40b9-bd77-6e1bf90bc19f"), - IsEnabled = true, - Name = "View Task" - }, - new - { - Id = new Guid("08752f33-3b29-4816-b76b-ea8a968ed3c5"), - Description = "", - FeatureId = new Guid("9d4b5489-2079-40b9-bd77-6e1bf90bc19f"), - IsEnabled = true, - Name = "Manage Task" - }, - new - { - Id = new Guid("d135a4b0-4f9a-4903-ab9c-4843839ebdee"), - Description = "", - FeatureId = new Guid("39e66f81-efc6-446c-95bd-46bff6cfb606"), - IsEnabled = true, - Name = "Assign Task and Report Progress" - }, - new - { - Id = new Guid("ed99ecd4-1bed-42e1-b7b3-d64c04493823"), - Description = "", - FeatureId = new Guid("39e66f81-efc6-446c-95bd-46bff6cfb606"), - IsEnabled = true, - Name = "Approve Task" - }, - new - { - Id = new Guid("b82d2b7e-0d52-45f3-997b-c008ea460e7f"), - Description = "", - FeatureId = new Guid("81ab8a87-8ccd-4015-a917-0627cee6a100"), - IsEnabled = true, - Name = "View Employee" - }, - new - { - Id = new Guid("a97d366a-c2bb-448d-be93-402bd2324566"), - Description = "", - FeatureId = new Guid("81ab8a87-8ccd-4015-a917-0627cee6a100"), - IsEnabled = true, - Name = "Manage Employee" - }, - new - { - Id = new Guid("fbd213e0-0250-46f1-9f5f-4b2a1e6e76a3"), - Description = "", - FeatureId = new Guid("81ab8a87-8ccd-4015-a917-0627cee6a100"), - IsEnabled = true, - Name = "Assign To Project" - }, - new - { - Id = new Guid("915e6bff-65f6-4e3f-aea8-3fd217d3ea9e"), - Description = "", - FeatureId = new Guid("52c9cf54-1eb2-44d2-81bb-524cf29c0a94"), - IsEnabled = true, - Name = "Perform Attendance " - }, - new - { - Id = new Guid("57802c4a-00aa-4a1f-a048-fd2f70dd44b6"), - Description = "", - FeatureId = new Guid("52c9cf54-1eb2-44d2-81bb-524cf29c0a94"), - IsEnabled = true, - Name = "Regularize Attendance" - }, - new - { - Id = new Guid("5ffbafe0-7ab0-48b1-bb50-c1bf76b65f9d"), - Description = "", - FeatureId = new Guid("be3b3afc-6ccf-4566-b9b6-aafcb65546be"), - IsEnabled = true, - Name = "View Masters" - }, - new - { - Id = new Guid("588a8824-f924-4955-82d8-fc51956cf323"), - Description = "", - FeatureId = new Guid("be3b3afc-6ccf-4566-b9b6-aafcb65546be"), - IsEnabled = true, - Name = "Manage Masters" - }, - new - { - Id = new Guid("cb8ec407-46d4-4467-930c-69127cda6dec"), - Description = "", - FeatureId = new Guid("660131a4-788c-4739-a082-cbbf7879cbf2"), - IsEnabled = true, - Name = "View Masters" - }, - new - { - Id = new Guid("6b1a6d97-a951-4de5-9b19-709bac7c4f18"), - Description = "", - FeatureId = new Guid("660131a4-788c-4739-a082-cbbf7879cbf2"), - IsEnabled = true, - Name = "Manage Masters" - }); - }); - - modelBuilder.Entity("Marco.Pms.Model.Entitlements.JobRole", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - - b.Property("Description") - .HasColumnType("longtext"); - - b.Property("Name") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("TenantId") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("TenantId"); - - b.ToTable("JobRoles"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Entitlements.Module", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - - b.Property("Description") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("Key") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("Name") - .IsRequired() - .HasColumnType("longtext"); - - b.HasKey("Id"); - - b.ToTable("Modules"); - - b.HasData( - new - { - Id = 1, - Description = "Project Module", - Key = "04db13e4-201a-44ba-9d9a-6c07f91d3cd0", - Name = "Project" - }, - new - { - Id = 2, - Description = "Employee Module", - Key = "72e2c008-c3f1-4dd8-a6ed-19c9eec3d892", - Name = "Employee" - }, - new - { - Id = 3, - Description = "Masters Module", - Key = "0a8eda0f-39b8-4efe-98af-5c6f2a7cd5cf", - Name = "Masters" - }); - }); - - modelBuilder.Entity("Marco.Pms.Model.Entitlements.RolePermissionMappings", b => - { - b.Property("ApplicationRoleId") - .HasColumnType("char(36)"); - - b.Property("FeaturePermissionId") - .HasColumnType("char(36)"); - - b.HasKey("ApplicationRoleId", "FeaturePermissionId"); - - b.HasIndex("FeaturePermissionId"); - - b.ToTable("RolePermissionMappings"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Entitlements.StatusMaster", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - - b.Property("Status") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("TenantId") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("TenantId"); - - b.ToTable("StatusMasters"); - - b.HasData( - new - { - Id = 1, - Status = "Active", - TenantId = 1 - }, - new - { - Id = 2, - Status = "In Progress", - TenantId = 1 - }, - new - { - Id = 3, - Status = "On Hold", - TenantId = 1 - }, - new - { - Id = 4, - Status = "Completed", - TenantId = 1 - }); - }); - - modelBuilder.Entity("Marco.Pms.Model.Entitlements.Tenant", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - - b.Property("ContactName") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("ContactNumber") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("Description") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("DomainName") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("Name") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("OnBoardingDate") - .HasColumnType("datetime(6)"); - - b.HasKey("Id"); - - b.ToTable("Tenants"); - - b.HasData( - new - { - Id = 1, - ContactName = "Admin", - ContactNumber = "123456789", - Description = "", - DomainName = "www.marcobms.org", - Name = "MarcoBMS", - OnBoardingDate = new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified) - }); - }); - - modelBuilder.Entity("Marco.Pms.Model.Projects.Building", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - - b.Property("Description") - .HasColumnType("longtext"); - - b.Property("Name") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("ProjectId") - .HasColumnType("int"); - - b.Property("TenantId") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("TenantId"); - - b.ToTable("Buildings"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Projects.Floor", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - - b.Property("BuildingId") - .HasColumnType("int"); - - b.Property("FloorName") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("TenantId") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("BuildingId"); - - b.HasIndex("TenantId"); - - b.ToTable("Floor"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Projects.Project", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - - b.Property("ContactPerson") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("EndDate") - .HasColumnType("datetime(6)"); - - b.Property("Name") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("ProjectAddress") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("ProjectStatusId") - .HasColumnType("int"); - - b.Property("StartDate") - .HasColumnType("datetime(6)"); - - b.Property("TenantId") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("ProjectStatusId"); - - b.HasIndex("TenantId"); - - b.ToTable("Projects"); - - b.HasData( - new - { - Id = 1, - ContactPerson = "Project 1 Contact Person", - Name = "Project 1", - ProjectAddress = "Project 1 Address", - ProjectStatusId = 1, - TenantId = 1 - }, - new - { - Id = 2, - ContactPerson = "Project 2 Contact Person", - Name = "Project 2", - ProjectAddress = "Project 2 Address", - ProjectStatusId = 2, - TenantId = 1 - }, - new - { - Id = 3, - ContactPerson = "Project 3 Contact Person", - Name = "Project 3", - ProjectAddress = "Project 3 Address", - ProjectStatusId = 3, - TenantId = 1 - }); - }); - - modelBuilder.Entity("Marco.Pms.Model.Projects.ProjectAllocation", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - - b.Property("AllocationDate") - .HasColumnType("datetime(6)"); - - b.Property("EmployeeId") - .HasColumnType("int"); - - b.Property("EmployeeRoleId") - .HasColumnType("char(36)"); - - b.Property("ProjectId") - .HasColumnType("int"); - - b.Property("ReAllocationDate") - .HasColumnType("datetime(6)"); - - b.Property("TenantId") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("EmployeeId"); - - b.HasIndex("ProjectId"); - - b.HasIndex("TenantId"); - - b.ToTable("ProjectAllocations"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Projects.WorkArea", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - - b.Property("AreaName") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("FloorId") - .HasColumnType("int"); - - b.Property("TenantId") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("FloorId"); - - b.HasIndex("TenantId"); - - b.ToTable("WorkAreas"); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRole", b => - { - b.Property("Id") - .HasColumnType("varchar(255)"); - - b.Property("ConcurrencyStamp") - .IsConcurrencyToken() - .HasColumnType("longtext"); - - b.Property("Name") - .HasMaxLength(256) - .HasColumnType("varchar(256)"); - - b.Property("NormalizedName") - .HasMaxLength(256) - .HasColumnType("varchar(256)"); - - b.HasKey("Id"); - - b.HasIndex("NormalizedName") - .IsUnique() - .HasDatabaseName("RoleNameIndex"); - - b.ToTable("AspNetRoles", (string)null); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - - b.Property("ClaimType") - .HasColumnType("longtext"); - - b.Property("ClaimValue") - .HasColumnType("longtext"); - - b.Property("RoleId") - .IsRequired() - .HasColumnType("varchar(255)"); - - b.HasKey("Id"); - - b.HasIndex("RoleId"); - - b.ToTable("AspNetRoleClaims", (string)null); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUser", b => - { - b.Property("Id") - .HasColumnType("varchar(255)"); - - b.Property("AccessFailedCount") - .HasColumnType("int"); - - b.Property("ConcurrencyStamp") - .IsConcurrencyToken() - .HasColumnType("longtext"); - - b.Property("Discriminator") - .IsRequired() - .HasMaxLength(21) - .HasColumnType("varchar(21)"); - - b.Property("Email") - .HasMaxLength(256) - .HasColumnType("varchar(256)"); - - b.Property("EmailConfirmed") - .HasColumnType("tinyint(1)"); - - b.Property("LockoutEnabled") - .HasColumnType("tinyint(1)"); - - b.Property("LockoutEnd") - .HasColumnType("datetime(6)"); - - b.Property("NormalizedEmail") - .HasMaxLength(256) - .HasColumnType("varchar(256)"); - - b.Property("NormalizedUserName") - .HasMaxLength(256) - .HasColumnType("varchar(256)"); - - b.Property("PasswordHash") - .HasColumnType("longtext"); - - b.Property("PhoneNumber") - .HasColumnType("longtext"); - - b.Property("PhoneNumberConfirmed") - .HasColumnType("tinyint(1)"); - - b.Property("SecurityStamp") - .HasColumnType("longtext"); - - b.Property("TwoFactorEnabled") - .HasColumnType("tinyint(1)"); - - b.Property("UserName") - .HasMaxLength(256) - .HasColumnType("varchar(256)"); - - b.HasKey("Id"); - - b.HasIndex("NormalizedEmail") - .HasDatabaseName("EmailIndex"); - - b.HasIndex("NormalizedUserName") - .IsUnique() - .HasDatabaseName("UserNameIndex"); - - b.ToTable("AspNetUsers", (string)null); - - b.HasDiscriminator().HasValue("IdentityUser"); - - b.UseTphMappingStrategy(); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - - b.Property("ClaimType") - .HasColumnType("longtext"); - - b.Property("ClaimValue") - .HasColumnType("longtext"); - - b.Property("UserId") - .IsRequired() - .HasColumnType("varchar(255)"); - - b.HasKey("Id"); - - b.HasIndex("UserId"); - - b.ToTable("AspNetUserClaims", (string)null); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin", b => - { - b.Property("LoginProvider") - .HasColumnType("varchar(255)"); - - b.Property("ProviderKey") - .HasColumnType("varchar(255)"); - - b.Property("ProviderDisplayName") - .HasColumnType("longtext"); - - b.Property("UserId") - .IsRequired() - .HasColumnType("varchar(255)"); - - b.HasKey("LoginProvider", "ProviderKey"); - - b.HasIndex("UserId"); - - b.ToTable("AspNetUserLogins", (string)null); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole", b => - { - b.Property("UserId") - .HasColumnType("varchar(255)"); - - b.Property("RoleId") - .HasColumnType("varchar(255)"); - - b.HasKey("UserId", "RoleId"); - - b.HasIndex("RoleId"); - - b.ToTable("AspNetUserRoles", (string)null); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken", b => - { - b.Property("UserId") - .HasColumnType("varchar(255)"); - - b.Property("LoginProvider") - .HasColumnType("varchar(255)"); - - b.Property("Name") - .HasColumnType("varchar(255)"); - - b.Property("Value") - .HasColumnType("longtext"); - - b.HasKey("UserId", "LoginProvider", "Name"); - - b.ToTable("AspNetUserTokens", (string)null); - }); - - modelBuilder.Entity("Marco.Pms.Model.Entitlements.ApplicationUser", b => - { - b.HasBaseType("Microsoft.AspNetCore.Identity.IdentityUser"); - - b.Property("IsRootUser") - .HasColumnType("tinyint(1)"); - - b.Property("Role") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("TenantId") - .HasColumnType("int"); - - b.HasDiscriminator().HasValue("ApplicationUser"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Activities.TaskAllocation", b => - { - b.HasOne("Marco.Pms.Model.Projects.Building", "Building") - .WithMany() - .HasForeignKey("BuildingId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Marco.Pms.Model.Employees.Employee", "Employee") - .WithMany() - .HasForeignKey("EmployeeId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Marco.Pms.Model.Projects.Project", "Project") - .WithMany() - .HasForeignKey("ProjectId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Marco.Pms.Model.Entitlements.Tenant", "Tenant") - .WithMany() - .HasForeignKey("TenantId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Marco.Pms.Model.Projects.WorkArea", "WorkArea") - .WithMany() - .HasForeignKey("WorkAreaId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Building"); - - b.Navigation("Employee"); - - b.Navigation("Project"); - - b.Navigation("Tenant"); - - b.Navigation("WorkArea"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Activities.WorkItem", b => - { - b.HasOne("Marco.Pms.Model.Entitlements.ActivityMaster", "ActivityMaster") - .WithMany() - .HasForeignKey("ActivityId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Marco.Pms.Model.Entitlements.Tenant", "Tenant") - .WithMany() - .HasForeignKey("TenantId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Marco.Pms.Model.Projects.WorkArea", "WorkArea") - .WithMany() - .HasForeignKey("WorkAreaId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("ActivityMaster"); - - b.Navigation("Tenant"); - - b.Navigation("WorkArea"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Activities.WorkItemMapping", b => - { - b.HasOne("Marco.Pms.Model.Entitlements.Tenant", "Tenant") - .WithMany() - .HasForeignKey("TenantId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Marco.Pms.Model.Projects.WorkArea", "WorkArea") - .WithMany() - .HasForeignKey("WorkAreaId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Marco.Pms.Model.Activities.WorkItem", "WorkItem") - .WithMany() - .HasForeignKey("WorkItemId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Tenant"); - - b.Navigation("WorkArea"); - - b.Navigation("WorkItem"); - }); - - modelBuilder.Entity("Marco.Pms.Model.AttendanceModule.AttendLog", b => - { - b.HasOne("Marco.Pms.Model.Employees.Attendance", "Attendance") - .WithMany() - .HasForeignKey("AttendanceId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Marco.Pms.Model.Employees.Employee", "Employee") - .WithMany() - .HasForeignKey("EmployeeID") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Marco.Pms.Model.Entitlements.Tenant", "Tenant") - .WithMany() - .HasForeignKey("TenantId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Marco.Pms.Model.Employees.Employee", "UpdatedByEmployee") - .WithMany() - .HasForeignKey("UpdatedBy"); - - b.Navigation("Attendance"); - - b.Navigation("Employee"); - - b.Navigation("Tenant"); - - b.Navigation("UpdatedByEmployee"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Authentication.RefreshToken", b => - { - b.HasOne("Microsoft.AspNetCore.Identity.IdentityUser", "User") - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("User"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Employees.Attendance", b => - { - b.HasOne("Marco.Pms.Model.Employees.Employee", "Approver") - .WithMany() - .HasForeignKey("EmployeeID") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Marco.Pms.Model.Entitlements.Tenant", "Tenant") - .WithMany() - .HasForeignKey("TenantId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Approver"); - - b.Navigation("Tenant"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Employees.Employee", b => - { - b.HasOne("Marco.Pms.Model.Entitlements.ApplicationUser", "ApplicationUser") - .WithMany() - .HasForeignKey("ApplicationUserId"); - - b.HasOne("Marco.Pms.Model.Entitlements.JobRole", "JobRole") - .WithMany() - .HasForeignKey("JobRoleId"); - - b.HasOne("Marco.Pms.Model.Entitlements.Tenant", "Tenant") - .WithMany() - .HasForeignKey("TenantId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("ApplicationUser"); - - b.Navigation("JobRole"); - - b.Navigation("Tenant"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Employees.WorkShift", b => - { - b.HasOne("Marco.Pms.Model.Entitlements.Tenant", "Tenant") - .WithMany() - .HasForeignKey("TenantId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Tenant"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Entitlements.ActivityMaster", b => - { - b.HasOne("Marco.Pms.Model.Activities.TaskAllocation", null) - .WithMany("AllotedTask") - .HasForeignKey("TaskAllocationId"); - - b.HasOne("Marco.Pms.Model.Entitlements.Tenant", "Tenant") - .WithMany() - .HasForeignKey("TenantId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Tenant"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Entitlements.ApplicationRole", b => - { - b.HasOne("Marco.Pms.Model.Entitlements.Tenant", null) - .WithMany() - .HasForeignKey("TenantId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Marco.Pms.Model.Entitlements.EmployeeRoleMapping", b => - { - b.HasOne("Marco.Pms.Model.Employees.Employee", "Employee") - .WithMany() - .HasForeignKey("EmployeeId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Marco.Pms.Model.Entitlements.ApplicationRole", "Role") - .WithMany() - .HasForeignKey("RoleId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Marco.Pms.Model.Entitlements.Tenant", "Tenant") - .WithMany() - .HasForeignKey("TenantId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Employee"); - - b.Navigation("Role"); - - b.Navigation("Tenant"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Entitlements.Feature", b => - { - b.HasOne("Marco.Pms.Model.Entitlements.Module", "Module") - .WithMany() - .HasForeignKey("ModuleId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Module"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Entitlements.FeaturePermission", b => - { - b.HasOne("Marco.Pms.Model.Entitlements.Feature", "Feature") - .WithMany("FeaturePermissions") - .HasForeignKey("FeatureId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Feature"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Entitlements.JobRole", b => - { - b.HasOne("Marco.Pms.Model.Entitlements.Tenant", "Tenant") - .WithMany() - .HasForeignKey("TenantId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Tenant"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Entitlements.RolePermissionMappings", b => - { - b.HasOne("Marco.Pms.Model.Entitlements.ApplicationRole", null) - .WithMany() - .HasForeignKey("ApplicationRoleId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Marco.Pms.Model.Entitlements.FeaturePermission", null) - .WithMany() - .HasForeignKey("FeaturePermissionId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Marco.Pms.Model.Entitlements.StatusMaster", b => - { - b.HasOne("Marco.Pms.Model.Entitlements.Tenant", "Tenant") - .WithMany() - .HasForeignKey("TenantId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Tenant"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Projects.Building", b => - { - b.HasOne("Marco.Pms.Model.Entitlements.Tenant", "Tenant") - .WithMany() - .HasForeignKey("TenantId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Tenant"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Projects.Floor", b => - { - b.HasOne("Marco.Pms.Model.Projects.Building", "Building") - .WithMany() - .HasForeignKey("BuildingId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Marco.Pms.Model.Entitlements.Tenant", "Tenant") - .WithMany() - .HasForeignKey("TenantId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Building"); - - b.Navigation("Tenant"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Projects.Project", b => - { - b.HasOne("Marco.Pms.Model.Entitlements.StatusMaster", "ProjectStatus") - .WithMany() - .HasForeignKey("ProjectStatusId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Marco.Pms.Model.Entitlements.Tenant", "Tenant") - .WithMany() - .HasForeignKey("TenantId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("ProjectStatus"); - - b.Navigation("Tenant"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Projects.ProjectAllocation", b => - { - b.HasOne("Marco.Pms.Model.Employees.Employee", "Employee") - .WithMany() - .HasForeignKey("EmployeeId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Marco.Pms.Model.Projects.Project", "Project") - .WithMany() - .HasForeignKey("ProjectId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Marco.Pms.Model.Entitlements.Tenant", "Tenant") - .WithMany() - .HasForeignKey("TenantId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Employee"); - - b.Navigation("Project"); - - b.Navigation("Tenant"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Projects.WorkArea", b => - { - b.HasOne("Marco.Pms.Model.Projects.Floor", "Floor") - .WithMany() - .HasForeignKey("FloorId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Marco.Pms.Model.Entitlements.Tenant", "Tenant") - .WithMany() - .HasForeignKey("TenantId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Floor"); - - b.Navigation("Tenant"); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim", b => - { - b.HasOne("Microsoft.AspNetCore.Identity.IdentityRole", null) - .WithMany() - .HasForeignKey("RoleId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim", b => - { - b.HasOne("Microsoft.AspNetCore.Identity.IdentityUser", null) - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin", b => - { - b.HasOne("Microsoft.AspNetCore.Identity.IdentityUser", null) - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole", b => - { - b.HasOne("Microsoft.AspNetCore.Identity.IdentityRole", null) - .WithMany() - .HasForeignKey("RoleId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Microsoft.AspNetCore.Identity.IdentityUser", null) - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken", b => - { - b.HasOne("Microsoft.AspNetCore.Identity.IdentityUser", null) - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Marco.Pms.Model.Activities.TaskAllocation", b => - { - b.Navigation("AllotedTask"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Entitlements.Feature", b => - { - b.Navigation("FeaturePermissions"); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/Marco.Pms.DataAccess/Migrations/20250303045849_attendancemodule.cs b/Marco.Pms.DataAccess/Migrations/20250303045849_attendancemodule.cs deleted file mode 100644 index 7f156c6..0000000 --- a/Marco.Pms.DataAccess/Migrations/20250303045849_attendancemodule.cs +++ /dev/null @@ -1,208 +0,0 @@ -using System; -using Microsoft.EntityFrameworkCore.Metadata; -using Microsoft.EntityFrameworkCore.Migrations; - -#nullable disable - -namespace Marco.Pms.DataAccess.Migrations -{ - /// - public partial class attendancemodule : Migration - { - /// - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropTable( - name: "AttendanceLogs"); - - migrationBuilder.CreateTable( - name: "AttendLogs", - columns: table => new - { - Id = table.Column(type: "int", nullable: false) - .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), - Comment = table.Column(type: "longtext", nullable: false) - .Annotation("MySql:CharSet", "utf8mb4"), - AttendanceId = table.Column(type: "int", nullable: false), - EmployeeID = table.Column(type: "int", nullable: false), - ActivityTime = table.Column(type: "datetime(6)", nullable: true), - Activity = table.Column(type: "int", nullable: false), - Photo = table.Column(type: "longblob", nullable: true), - Latitude = table.Column(type: "longtext", nullable: true) - .Annotation("MySql:CharSet", "utf8mb4"), - Longitude = table.Column(type: "longtext", nullable: true) - .Annotation("MySql:CharSet", "utf8mb4"), - UpdatedOn = table.Column(type: "datetime(6)", nullable: false), - UpdatedBy = table.Column(type: "int", nullable: true), - TenantId = table.Column(type: "int", nullable: false) - }, - constraints: table => - { - table.PrimaryKey("PK_AttendLogs", x => x.Id); - table.ForeignKey( - name: "FK_AttendLogs_Attendances_AttendanceId", - column: x => x.AttendanceId, - principalTable: "Attendances", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); - table.ForeignKey( - name: "FK_AttendLogs_Employees_EmployeeID", - column: x => x.EmployeeID, - principalTable: "Employees", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); - table.ForeignKey( - name: "FK_AttendLogs_Employees_UpdatedBy", - column: x => x.UpdatedBy, - principalTable: "Employees", - principalColumn: "Id"); - table.ForeignKey( - name: "FK_AttendLogs_Tenants_TenantId", - column: x => x.TenantId, - principalTable: "Tenants", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); - }) - .Annotation("MySql:CharSet", "utf8mb4"); - - migrationBuilder.UpdateData( - table: "Modules", - keyColumn: "Id", - keyValue: 1, - column: "Key", - value: "04db13e4-201a-44ba-9d9a-6c07f91d3cd0"); - - migrationBuilder.UpdateData( - table: "Modules", - keyColumn: "Id", - keyValue: 2, - column: "Key", - value: "72e2c008-c3f1-4dd8-a6ed-19c9eec3d892"); - - migrationBuilder.UpdateData( - table: "Modules", - keyColumn: "Id", - keyValue: 3, - column: "Key", - value: "0a8eda0f-39b8-4efe-98af-5c6f2a7cd5cf"); - - migrationBuilder.CreateIndex( - name: "IX_AttendLogs_AttendanceId", - table: "AttendLogs", - column: "AttendanceId"); - - migrationBuilder.CreateIndex( - name: "IX_AttendLogs_EmployeeID", - table: "AttendLogs", - column: "EmployeeID"); - - migrationBuilder.CreateIndex( - name: "IX_AttendLogs_TenantId", - table: "AttendLogs", - column: "TenantId"); - - migrationBuilder.CreateIndex( - name: "IX_AttendLogs_UpdatedBy", - table: "AttendLogs", - column: "UpdatedBy"); - } - - /// - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropTable( - name: "AttendLogs"); - - migrationBuilder.CreateTable( - name: "AttendanceLogs", - columns: table => new - { - Id = table.Column(type: "int", nullable: false) - .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), - AttendanceId = table.Column(type: "int", nullable: false), - EmployeeID = table.Column(type: "int", nullable: false), - TenantId = table.Column(type: "int", nullable: false), - UpdatedBy = table.Column(type: "int", nullable: true), - Activity = table.Column(type: "int", nullable: false), - ActivityTime = table.Column(type: "datetime(6)", nullable: true), - Comment = table.Column(type: "longtext", nullable: false) - .Annotation("MySql:CharSet", "utf8mb4"), - Latitude = table.Column(type: "longtext", nullable: true) - .Annotation("MySql:CharSet", "utf8mb4"), - Longitude = table.Column(type: "longtext", nullable: true) - .Annotation("MySql:CharSet", "utf8mb4"), - Photo = table.Column(type: "longblob", nullable: true), - UpdatedOn = table.Column(type: "datetime(6)", nullable: false) - }, - constraints: table => - { - table.PrimaryKey("PK_AttendanceLogs", x => x.Id); - table.ForeignKey( - name: "FK_AttendanceLogs_Attendances_AttendanceId", - column: x => x.AttendanceId, - principalTable: "Attendances", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); - table.ForeignKey( - name: "FK_AttendanceLogs_Employees_EmployeeID", - column: x => x.EmployeeID, - principalTable: "Employees", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); - table.ForeignKey( - name: "FK_AttendanceLogs_Employees_UpdatedBy", - column: x => x.UpdatedBy, - principalTable: "Employees", - principalColumn: "Id"); - table.ForeignKey( - name: "FK_AttendanceLogs_Tenants_TenantId", - column: x => x.TenantId, - principalTable: "Tenants", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); - }) - .Annotation("MySql:CharSet", "utf8mb4"); - - migrationBuilder.UpdateData( - table: "Modules", - keyColumn: "Id", - keyValue: 1, - column: "Key", - value: "9a70d253-1f44-411c-899a-718c344c1aea"); - - migrationBuilder.UpdateData( - table: "Modules", - keyColumn: "Id", - keyValue: 2, - column: "Key", - value: "aff7e2a1-8b98-49ca-a73e-b342a4d7ef90"); - - migrationBuilder.UpdateData( - table: "Modules", - keyColumn: "Id", - keyValue: 3, - column: "Key", - value: "dc33f0de-5730-40b0-b52b-c61ea0176c03"); - - migrationBuilder.CreateIndex( - name: "IX_AttendanceLogs_AttendanceId", - table: "AttendanceLogs", - column: "AttendanceId"); - - migrationBuilder.CreateIndex( - name: "IX_AttendanceLogs_EmployeeID", - table: "AttendanceLogs", - column: "EmployeeID"); - - migrationBuilder.CreateIndex( - name: "IX_AttendanceLogs_TenantId", - table: "AttendanceLogs", - column: "TenantId"); - - migrationBuilder.CreateIndex( - name: "IX_AttendanceLogs_UpdatedBy", - table: "AttendanceLogs", - column: "UpdatedBy"); - } - } -} diff --git a/Marco.Pms.DataAccess/Migrations/20250303050349_renameattendancelogs.Designer.cs b/Marco.Pms.DataAccess/Migrations/20250303050349_renameattendancelogs.Designer.cs deleted file mode 100644 index dd5bbb2..0000000 --- a/Marco.Pms.DataAccess/Migrations/20250303050349_renameattendancelogs.Designer.cs +++ /dev/null @@ -1,1933 +0,0 @@ -// -using System; -using Marco.Pms.DataAccess.Data; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Metadata; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; - -#nullable disable - -namespace Marco.Pms.DataAccess.Migrations -{ - [DbContext(typeof(ApplicationDbContext))] - [Migration("20250303050349_renameattendancelogs")] - partial class renameattendancelogs - { - /// - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasAnnotation("ProductVersion", "8.0.12") - .HasAnnotation("Relational:MaxIdentifierLength", 64); - - //MySqlModelBuilderExtensions.AutoIncrementColumns(modelBuilder); - - modelBuilder.Entity("Marco.Pms.Model.Activities.TaskAllocation", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - - b.Property("AllocationDate") - .HasColumnType("datetime(6)"); - - b.Property("BuildingId") - .HasColumnType("int"); - - b.Property("EmployeeId") - .HasColumnType("int"); - - b.Property("EmployeeRole") - .HasColumnType("int"); - - b.Property("ProjectId") - .HasColumnType("int"); - - b.Property("ReAllocationDate") - .HasColumnType("datetime(6)"); - - b.Property("TenantId") - .HasColumnType("int"); - - b.Property("WorkAreaId") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("BuildingId"); - - b.HasIndex("EmployeeId"); - - b.HasIndex("ProjectId"); - - b.HasIndex("TenantId"); - - b.HasIndex("WorkAreaId"); - - b.ToTable("TaskAllocations"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Activities.WorkItem", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - - b.Property("ActivityId") - .HasColumnType("int"); - - b.Property("CompletedWork") - .HasColumnType("int"); - - b.Property("PlannedWork") - .HasColumnType("int"); - - b.Property("TaskDate") - .HasColumnType("datetime(6)"); - - b.Property("TenantId") - .HasColumnType("int"); - - b.Property("WorkAreaId") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("ActivityId"); - - b.HasIndex("TenantId"); - - b.HasIndex("WorkAreaId"); - - b.ToTable("WorkItems"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Activities.WorkItemMapping", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - - b.Property("TenantId") - .HasColumnType("int"); - - b.Property("WorkAreaId") - .HasColumnType("int"); - - b.Property("WorkItemId") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("TenantId"); - - b.HasIndex("WorkAreaId"); - - b.HasIndex("WorkItemId"); - - b.ToTable("WorkItemMapping"); - }); - - modelBuilder.Entity("Marco.Pms.Model.AttendanceModule.Attendance", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - - b.Property("Activity") - .HasColumnType("int"); - - b.Property("ApprovedBy") - .HasColumnType("int"); - - b.Property("AttendanceDate") - .HasColumnType("datetime(6)"); - - b.Property("Comment") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("Date") - .HasColumnType("datetime(6)"); - - b.Property("EmployeeID") - .HasColumnType("int"); - - b.Property("InTime") - .HasColumnType("datetime(6)"); - - b.Property("IsApproved") - .HasColumnType("tinyint(1)"); - - b.Property("OutTime") - .HasColumnType("datetime(6)"); - - b.Property("ProjectID") - .HasColumnType("int"); - - b.Property("TenantId") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("EmployeeID"); - - b.HasIndex("TenantId"); - - b.ToTable("Attendances"); - }); - - modelBuilder.Entity("Marco.Pms.Model.AttendanceModule.AttendanceLog", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - - b.Property("Activity") - .HasColumnType("int"); - - b.Property("ActivityTime") - .HasColumnType("datetime(6)"); - - b.Property("AttendanceId") - .HasColumnType("int"); - - b.Property("Comment") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("EmployeeID") - .HasColumnType("int"); - - b.Property("Latitude") - .HasColumnType("longtext"); - - b.Property("Longitude") - .HasColumnType("longtext"); - - b.Property("Photo") - .HasColumnType("longblob"); - - b.Property("TenantId") - .HasColumnType("int"); - - b.Property("UpdatedBy") - .HasColumnType("int"); - - b.Property("UpdatedOn") - .HasColumnType("datetime(6)"); - - b.HasKey("Id"); - - b.HasIndex("AttendanceId"); - - b.HasIndex("EmployeeID"); - - b.HasIndex("TenantId"); - - b.HasIndex("UpdatedBy"); - - b.ToTable("AttendanceLogs"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Authentication.RefreshToken", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - - b.Property("CreatedAt") - .HasColumnType("datetime(6)"); - - b.Property("ExpiryDate") - .HasColumnType("datetime(6)"); - - b.Property("IsRevoked") - .HasColumnType("tinyint(1)"); - - b.Property("IsUsed") - .HasColumnType("tinyint(1)"); - - b.Property("RevokedAt") - .HasColumnType("datetime(6)"); - - b.Property("Token") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("UserId") - .IsRequired() - .HasColumnType("varchar(255)"); - - b.HasKey("Id"); - - b.HasIndex("UserId"); - - b.ToTable("RefreshTokens"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Employees.Employee", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - - b.Property("AadharNumber") - .HasColumnType("longtext"); - - b.Property("ApplicationUserId") - .HasColumnType("varchar(255)"); - - b.Property("BirthDate") - .HasColumnType("datetime(6)"); - - b.Property("CurrentAddress") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("Email") - .HasColumnType("longtext"); - - b.Property("EmergencyPhoneNumber") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("FirstName") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("Gender") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("JobRoleId") - .HasColumnType("int"); - - b.Property("LastName") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("MiddleName") - .HasColumnType("longtext"); - - b.Property("PanNumber") - .HasColumnType("longtext"); - - b.Property("PeramnentAddress") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("PhoneNumber") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("Photo") - .HasColumnType("longblob"); - - b.Property("RoleId") - .HasColumnType("char(36)"); - - b.Property("TenantId") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("ApplicationUserId"); - - b.HasIndex("JobRoleId"); - - b.HasIndex("TenantId"); - - b.ToTable("Employees"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Employees.WorkShift", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - - b.Property("EndTime") - .HasColumnType("time(6)"); - - b.Property("Name") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("StartTime") - .HasColumnType("time(6)"); - - b.Property("TenantId") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("TenantId"); - - b.ToTable("WorkShifts"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Entitlements.ActivityMaster", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - - b.Property("ActivityName") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("TaskAllocationId") - .HasColumnType("int"); - - b.Property("TenantId") - .HasColumnType("int"); - - b.Property("UnitOfMeasurement") - .IsRequired() - .HasColumnType("longtext"); - - b.HasKey("Id"); - - b.HasIndex("TaskAllocationId"); - - b.HasIndex("TenantId"); - - b.ToTable("ActivityMasters"); - - b.HasData( - new - { - Id = 1, - ActivityName = "Core Cutting", - TenantId = 1, - UnitOfMeasurement = "Number" - }, - new - { - Id = 2, - ActivityName = "Fabrication", - TenantId = 1, - UnitOfMeasurement = "Meter" - }, - new - { - Id = 3, - ActivityName = "Lifting", - TenantId = 1, - UnitOfMeasurement = "Meter" - }, - new - { - Id = 4, - ActivityName = "Hanging", - TenantId = 1, - UnitOfMeasurement = "Meter" - }, - new - { - Id = 5, - ActivityName = "Tapping", - TenantId = 1, - UnitOfMeasurement = "Meter" - }, - new - { - Id = 6, - ActivityName = "Welding", - TenantId = 1, - UnitOfMeasurement = "Meter" - }, - new - { - Id = 7, - ActivityName = "Testing", - TenantId = 1, - UnitOfMeasurement = "Area" - }, - new - { - Id = 8, - ActivityName = "Painting", - TenantId = 1, - UnitOfMeasurement = "Meter" - }, - new - { - Id = 9, - ActivityName = "Marking Area", - TenantId = 1, - UnitOfMeasurement = "Meter" - }, - new - { - Id = 10, - ActivityName = "Drilling", - TenantId = 1, - UnitOfMeasurement = "Number" - }, - new - { - Id = 11, - ActivityName = "MS Support Fabrication", - TenantId = 1, - UnitOfMeasurement = "Number" - }, - new - { - Id = 12, - ActivityName = "MS Support Hanging", - TenantId = 1, - UnitOfMeasurement = "Number" - }, - new - { - Id = 13, - ActivityName = "Hydrant Volve", - TenantId = 1, - UnitOfMeasurement = "Number" - }, - new - { - Id = 14, - ActivityName = "Sprinkler Installation", - TenantId = 1, - UnitOfMeasurement = "Number" - }); - }); - - modelBuilder.Entity("Marco.Pms.Model.Entitlements.ApplicationRole", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("char(36)"); - - b.Property("Description") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("Role") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("TenantId") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("TenantId"); - - b.ToTable("ApplicationRoles"); - - b.HasData( - new - { - Id = new Guid("2c8d0808-c421-11ef-9b93-0242ac110002"), - Description = "", - Role = "Admin", - TenantId = 1 - }, - new - { - Id = new Guid("62e0918d-c421-11ef-9b93-0242ac110002"), - Description = "", - Role = "Welder", - TenantId = 1 - }, - new - { - Id = new Guid("68823f1f-c421-11ef-9b93-0242ac110002"), - Description = "", - Role = "Helper", - TenantId = 1 - }, - new - { - Id = new Guid("6d3a7c72-c421-11ef-9b93-0242ac110002"), - Description = "", - Role = "Site Engineer", - TenantId = 1 - }, - new - { - Id = new Guid("6d3aad72-c421-11ef-9b93-0242ac110002"), - Description = "", - Role = "Project Manager", - TenantId = 1 - }); - }); - - modelBuilder.Entity("Marco.Pms.Model.Entitlements.EmployeeRoleMapping", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("char(36)"); - - b.Property("EmployeeId") - .HasColumnType("int"); - - b.Property("IsEnabled") - .HasColumnType("tinyint(1)"); - - b.Property("RoleId") - .HasColumnType("char(36)"); - - b.Property("TenantId") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("EmployeeId"); - - b.HasIndex("RoleId"); - - b.HasIndex("TenantId"); - - b.ToTable("EmployeeRoleMappings"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Entitlements.Feature", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("char(36)"); - - b.Property("Description") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("IsActive") - .HasColumnType("tinyint(1)"); - - b.Property("ModuleId") - .HasColumnType("int"); - - b.Property("Name") - .IsRequired() - .HasColumnType("longtext"); - - b.HasKey("Id"); - - b.HasIndex("ModuleId"); - - b.ToTable("Features"); - - b.HasData( - new - { - Id = new Guid("53176ebf-c75d-42e5-839f-4508ffac3def"), - Description = "Manage Project", - IsActive = true, - ModuleId = 1, - Name = "Manage Project" - }, - new - { - Id = new Guid("9666de86-d7c7-4d3d-acaa-fcd6d6b81f3c"), - Description = "Manage Infra", - IsActive = true, - ModuleId = 1, - Name = "Manage Infra" - }, - new - { - Id = new Guid("9d4b5489-2079-40b9-bd77-6e1bf90bc19f"), - Description = "Manage Tasks", - IsActive = true, - ModuleId = 1, - Name = "Manage Tasks" - }, - new - { - Id = new Guid("39e66f81-efc6-446c-95bd-46bff6cfb606"), - Description = "Assign and Update Tasks Progress", - IsActive = true, - ModuleId = 1, - Name = "Assign and Update Tasks Progress" - }, - new - { - Id = new Guid("81ab8a87-8ccd-4015-a917-0627cee6a100"), - Description = "Manage Employee", - IsActive = true, - ModuleId = 2, - Name = "Manage Employee" - }, - new - { - Id = new Guid("52c9cf54-1eb2-44d2-81bb-524cf29c0a94"), - Description = "Attendance", - IsActive = true, - ModuleId = 2, - Name = "Attendance" - }, - new - { - Id = new Guid("be3b3afc-6ccf-4566-b9b6-aafcb65546be"), - Description = "Global Masters", - IsActive = true, - ModuleId = 3, - Name = "Global Masters" - }, - new - { - Id = new Guid("660131a4-788c-4739-a082-cbbf7879cbf2"), - Description = "Tenant Masters", - IsActive = true, - ModuleId = 3, - Name = "Tenant Masters" - }); - }); - - modelBuilder.Entity("Marco.Pms.Model.Entitlements.FeaturePermission", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("char(36)"); - - b.Property("Description") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("FeatureId") - .HasColumnType("char(36)"); - - b.Property("IsEnabled") - .HasColumnType("tinyint(1)"); - - b.Property("Name") - .IsRequired() - .HasColumnType("longtext"); - - b.HasKey("Id"); - - b.HasIndex("FeatureId"); - - b.ToTable("FeaturePermissions"); - - b.HasData( - new - { - Id = new Guid("6ea44136-987e-44ba-9e5d-1cf8f5837ebc"), - Description = "", - FeatureId = new Guid("53176ebf-c75d-42e5-839f-4508ffac3def"), - IsEnabled = true, - Name = "View Project" - }, - new - { - Id = new Guid("172fc9b6-755b-4f62-ab26-55c34a330614"), - Description = "", - FeatureId = new Guid("53176ebf-c75d-42e5-839f-4508ffac3def"), - IsEnabled = true, - Name = "Manage Project" - }, - new - { - Id = new Guid("b94802ce-0689-4643-9e1d-11c86950c35b"), - Description = "", - FeatureId = new Guid("53176ebf-c75d-42e5-839f-4508ffac3def"), - IsEnabled = true, - Name = "Manage Team" - }, - new - { - Id = new Guid("c7b68e33-72f0-474f-bd96-77636427ecc8"), - Description = "", - FeatureId = new Guid("9666de86-d7c7-4d3d-acaa-fcd6d6b81f3c"), - IsEnabled = true, - Name = "View Project Infra" - }, - new - { - Id = new Guid("f2aee20a-b754-4537-8166-f9507b44585b"), - Description = "", - FeatureId = new Guid("9666de86-d7c7-4d3d-acaa-fcd6d6b81f3c"), - IsEnabled = true, - Name = "Manage Project Infra" - }, - new - { - Id = new Guid("9fcc5f87-25e3-4846-90ac-67a71ab92e3c"), - Description = "", - FeatureId = new Guid("9d4b5489-2079-40b9-bd77-6e1bf90bc19f"), - IsEnabled = true, - Name = "View Task" - }, - new - { - Id = new Guid("08752f33-3b29-4816-b76b-ea8a968ed3c5"), - Description = "", - FeatureId = new Guid("9d4b5489-2079-40b9-bd77-6e1bf90bc19f"), - IsEnabled = true, - Name = "Manage Task" - }, - new - { - Id = new Guid("d135a4b0-4f9a-4903-ab9c-4843839ebdee"), - Description = "", - FeatureId = new Guid("39e66f81-efc6-446c-95bd-46bff6cfb606"), - IsEnabled = true, - Name = "Assign Task and Report Progress" - }, - new - { - Id = new Guid("ed99ecd4-1bed-42e1-b7b3-d64c04493823"), - Description = "", - FeatureId = new Guid("39e66f81-efc6-446c-95bd-46bff6cfb606"), - IsEnabled = true, - Name = "Approve Task" - }, - new - { - Id = new Guid("b82d2b7e-0d52-45f3-997b-c008ea460e7f"), - Description = "", - FeatureId = new Guid("81ab8a87-8ccd-4015-a917-0627cee6a100"), - IsEnabled = true, - Name = "View Employee" - }, - new - { - Id = new Guid("a97d366a-c2bb-448d-be93-402bd2324566"), - Description = "", - FeatureId = new Guid("81ab8a87-8ccd-4015-a917-0627cee6a100"), - IsEnabled = true, - Name = "Manage Employee" - }, - new - { - Id = new Guid("fbd213e0-0250-46f1-9f5f-4b2a1e6e76a3"), - Description = "", - FeatureId = new Guid("81ab8a87-8ccd-4015-a917-0627cee6a100"), - IsEnabled = true, - Name = "Assign To Project" - }, - new - { - Id = new Guid("915e6bff-65f6-4e3f-aea8-3fd217d3ea9e"), - Description = "", - FeatureId = new Guid("52c9cf54-1eb2-44d2-81bb-524cf29c0a94"), - IsEnabled = true, - Name = "Perform Attendance " - }, - new - { - Id = new Guid("57802c4a-00aa-4a1f-a048-fd2f70dd44b6"), - Description = "", - FeatureId = new Guid("52c9cf54-1eb2-44d2-81bb-524cf29c0a94"), - IsEnabled = true, - Name = "Regularize Attendance" - }, - new - { - Id = new Guid("5ffbafe0-7ab0-48b1-bb50-c1bf76b65f9d"), - Description = "", - FeatureId = new Guid("be3b3afc-6ccf-4566-b9b6-aafcb65546be"), - IsEnabled = true, - Name = "View Masters" - }, - new - { - Id = new Guid("588a8824-f924-4955-82d8-fc51956cf323"), - Description = "", - FeatureId = new Guid("be3b3afc-6ccf-4566-b9b6-aafcb65546be"), - IsEnabled = true, - Name = "Manage Masters" - }, - new - { - Id = new Guid("cb8ec407-46d4-4467-930c-69127cda6dec"), - Description = "", - FeatureId = new Guid("660131a4-788c-4739-a082-cbbf7879cbf2"), - IsEnabled = true, - Name = "View Masters" - }, - new - { - Id = new Guid("6b1a6d97-a951-4de5-9b19-709bac7c4f18"), - Description = "", - FeatureId = new Guid("660131a4-788c-4739-a082-cbbf7879cbf2"), - IsEnabled = true, - Name = "Manage Masters" - }); - }); - - modelBuilder.Entity("Marco.Pms.Model.Entitlements.JobRole", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - - b.Property("Description") - .HasColumnType("longtext"); - - b.Property("Name") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("TenantId") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("TenantId"); - - b.ToTable("JobRoles"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Entitlements.Module", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - - b.Property("Description") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("Key") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("Name") - .IsRequired() - .HasColumnType("longtext"); - - b.HasKey("Id"); - - b.ToTable("Modules"); - - b.HasData( - new - { - Id = 1, - Description = "Project Module", - Key = "e20751cc-a482-499e-98de-ccc88689fcc6", - Name = "Project" - }, - new - { - Id = 2, - Description = "Employee Module", - Key = "589ba09f-e176-4c90-9502-707799d33e94", - Name = "Employee" - }, - new - { - Id = 3, - Description = "Masters Module", - Key = "f1c5886a-474c-4b71-bda8-f278b78b0a4d", - Name = "Masters" - }); - }); - - modelBuilder.Entity("Marco.Pms.Model.Entitlements.RolePermissionMappings", b => - { - b.Property("ApplicationRoleId") - .HasColumnType("char(36)"); - - b.Property("FeaturePermissionId") - .HasColumnType("char(36)"); - - b.HasKey("ApplicationRoleId", "FeaturePermissionId"); - - b.HasIndex("FeaturePermissionId"); - - b.ToTable("RolePermissionMappings"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Entitlements.StatusMaster", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - - b.Property("Status") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("TenantId") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("TenantId"); - - b.ToTable("StatusMasters"); - - b.HasData( - new - { - Id = 1, - Status = "Active", - TenantId = 1 - }, - new - { - Id = 2, - Status = "In Progress", - TenantId = 1 - }, - new - { - Id = 3, - Status = "On Hold", - TenantId = 1 - }, - new - { - Id = 4, - Status = "Completed", - TenantId = 1 - }); - }); - - modelBuilder.Entity("Marco.Pms.Model.Entitlements.Tenant", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - - b.Property("ContactName") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("ContactNumber") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("Description") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("DomainName") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("Name") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("OnBoardingDate") - .HasColumnType("datetime(6)"); - - b.HasKey("Id"); - - b.ToTable("Tenants"); - - b.HasData( - new - { - Id = 1, - ContactName = "Admin", - ContactNumber = "123456789", - Description = "", - DomainName = "www.marcobms.org", - Name = "MarcoBMS", - OnBoardingDate = new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified) - }); - }); - - modelBuilder.Entity("Marco.Pms.Model.Projects.Building", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - - b.Property("Description") - .HasColumnType("longtext"); - - b.Property("Name") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("ProjectId") - .HasColumnType("int"); - - b.Property("TenantId") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("TenantId"); - - b.ToTable("Buildings"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Projects.Floor", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - - b.Property("BuildingId") - .HasColumnType("int"); - - b.Property("FloorName") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("TenantId") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("BuildingId"); - - b.HasIndex("TenantId"); - - b.ToTable("Floor"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Projects.Project", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - - b.Property("ContactPerson") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("EndDate") - .HasColumnType("datetime(6)"); - - b.Property("Name") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("ProjectAddress") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("ProjectStatusId") - .HasColumnType("int"); - - b.Property("StartDate") - .HasColumnType("datetime(6)"); - - b.Property("TenantId") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("ProjectStatusId"); - - b.HasIndex("TenantId"); - - b.ToTable("Projects"); - - b.HasData( - new - { - Id = 1, - ContactPerson = "Project 1 Contact Person", - Name = "Project 1", - ProjectAddress = "Project 1 Address", - ProjectStatusId = 1, - TenantId = 1 - }, - new - { - Id = 2, - ContactPerson = "Project 2 Contact Person", - Name = "Project 2", - ProjectAddress = "Project 2 Address", - ProjectStatusId = 2, - TenantId = 1 - }, - new - { - Id = 3, - ContactPerson = "Project 3 Contact Person", - Name = "Project 3", - ProjectAddress = "Project 3 Address", - ProjectStatusId = 3, - TenantId = 1 - }); - }); - - modelBuilder.Entity("Marco.Pms.Model.Projects.ProjectAllocation", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - - b.Property("AllocationDate") - .HasColumnType("datetime(6)"); - - b.Property("EmployeeId") - .HasColumnType("int"); - - b.Property("EmployeeRoleId") - .HasColumnType("char(36)"); - - b.Property("ProjectId") - .HasColumnType("int"); - - b.Property("ReAllocationDate") - .HasColumnType("datetime(6)"); - - b.Property("TenantId") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("EmployeeId"); - - b.HasIndex("ProjectId"); - - b.HasIndex("TenantId"); - - b.ToTable("ProjectAllocations"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Projects.WorkArea", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - - b.Property("AreaName") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("FloorId") - .HasColumnType("int"); - - b.Property("TenantId") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("FloorId"); - - b.HasIndex("TenantId"); - - b.ToTable("WorkAreas"); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRole", b => - { - b.Property("Id") - .HasColumnType("varchar(255)"); - - b.Property("ConcurrencyStamp") - .IsConcurrencyToken() - .HasColumnType("longtext"); - - b.Property("Name") - .HasMaxLength(256) - .HasColumnType("varchar(256)"); - - b.Property("NormalizedName") - .HasMaxLength(256) - .HasColumnType("varchar(256)"); - - b.HasKey("Id"); - - b.HasIndex("NormalizedName") - .IsUnique() - .HasDatabaseName("RoleNameIndex"); - - b.ToTable("AspNetRoles", (string)null); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - - b.Property("ClaimType") - .HasColumnType("longtext"); - - b.Property("ClaimValue") - .HasColumnType("longtext"); - - b.Property("RoleId") - .IsRequired() - .HasColumnType("varchar(255)"); - - b.HasKey("Id"); - - b.HasIndex("RoleId"); - - b.ToTable("AspNetRoleClaims", (string)null); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUser", b => - { - b.Property("Id") - .HasColumnType("varchar(255)"); - - b.Property("AccessFailedCount") - .HasColumnType("int"); - - b.Property("ConcurrencyStamp") - .IsConcurrencyToken() - .HasColumnType("longtext"); - - b.Property("Discriminator") - .IsRequired() - .HasMaxLength(21) - .HasColumnType("varchar(21)"); - - b.Property("Email") - .HasMaxLength(256) - .HasColumnType("varchar(256)"); - - b.Property("EmailConfirmed") - .HasColumnType("tinyint(1)"); - - b.Property("LockoutEnabled") - .HasColumnType("tinyint(1)"); - - b.Property("LockoutEnd") - .HasColumnType("datetime(6)"); - - b.Property("NormalizedEmail") - .HasMaxLength(256) - .HasColumnType("varchar(256)"); - - b.Property("NormalizedUserName") - .HasMaxLength(256) - .HasColumnType("varchar(256)"); - - b.Property("PasswordHash") - .HasColumnType("longtext"); - - b.Property("PhoneNumber") - .HasColumnType("longtext"); - - b.Property("PhoneNumberConfirmed") - .HasColumnType("tinyint(1)"); - - b.Property("SecurityStamp") - .HasColumnType("longtext"); - - b.Property("TwoFactorEnabled") - .HasColumnType("tinyint(1)"); - - b.Property("UserName") - .HasMaxLength(256) - .HasColumnType("varchar(256)"); - - b.HasKey("Id"); - - b.HasIndex("NormalizedEmail") - .HasDatabaseName("EmailIndex"); - - b.HasIndex("NormalizedUserName") - .IsUnique() - .HasDatabaseName("UserNameIndex"); - - b.ToTable("AspNetUsers", (string)null); - - b.HasDiscriminator().HasValue("IdentityUser"); - - b.UseTphMappingStrategy(); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - - b.Property("ClaimType") - .HasColumnType("longtext"); - - b.Property("ClaimValue") - .HasColumnType("longtext"); - - b.Property("UserId") - .IsRequired() - .HasColumnType("varchar(255)"); - - b.HasKey("Id"); - - b.HasIndex("UserId"); - - b.ToTable("AspNetUserClaims", (string)null); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin", b => - { - b.Property("LoginProvider") - .HasColumnType("varchar(255)"); - - b.Property("ProviderKey") - .HasColumnType("varchar(255)"); - - b.Property("ProviderDisplayName") - .HasColumnType("longtext"); - - b.Property("UserId") - .IsRequired() - .HasColumnType("varchar(255)"); - - b.HasKey("LoginProvider", "ProviderKey"); - - b.HasIndex("UserId"); - - b.ToTable("AspNetUserLogins", (string)null); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole", b => - { - b.Property("UserId") - .HasColumnType("varchar(255)"); - - b.Property("RoleId") - .HasColumnType("varchar(255)"); - - b.HasKey("UserId", "RoleId"); - - b.HasIndex("RoleId"); - - b.ToTable("AspNetUserRoles", (string)null); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken", b => - { - b.Property("UserId") - .HasColumnType("varchar(255)"); - - b.Property("LoginProvider") - .HasColumnType("varchar(255)"); - - b.Property("Name") - .HasColumnType("varchar(255)"); - - b.Property("Value") - .HasColumnType("longtext"); - - b.HasKey("UserId", "LoginProvider", "Name"); - - b.ToTable("AspNetUserTokens", (string)null); - }); - - modelBuilder.Entity("Marco.Pms.Model.Entitlements.ApplicationUser", b => - { - b.HasBaseType("Microsoft.AspNetCore.Identity.IdentityUser"); - - b.Property("IsRootUser") - .HasColumnType("tinyint(1)"); - - b.Property("Role") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("TenantId") - .HasColumnType("int"); - - b.HasDiscriminator().HasValue("ApplicationUser"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Activities.TaskAllocation", b => - { - b.HasOne("Marco.Pms.Model.Projects.Building", "Building") - .WithMany() - .HasForeignKey("BuildingId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Marco.Pms.Model.Employees.Employee", "Employee") - .WithMany() - .HasForeignKey("EmployeeId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Marco.Pms.Model.Projects.Project", "Project") - .WithMany() - .HasForeignKey("ProjectId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Marco.Pms.Model.Entitlements.Tenant", "Tenant") - .WithMany() - .HasForeignKey("TenantId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Marco.Pms.Model.Projects.WorkArea", "WorkArea") - .WithMany() - .HasForeignKey("WorkAreaId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Building"); - - b.Navigation("Employee"); - - b.Navigation("Project"); - - b.Navigation("Tenant"); - - b.Navigation("WorkArea"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Activities.WorkItem", b => - { - b.HasOne("Marco.Pms.Model.Entitlements.ActivityMaster", "ActivityMaster") - .WithMany() - .HasForeignKey("ActivityId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Marco.Pms.Model.Entitlements.Tenant", "Tenant") - .WithMany() - .HasForeignKey("TenantId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Marco.Pms.Model.Projects.WorkArea", "WorkArea") - .WithMany() - .HasForeignKey("WorkAreaId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("ActivityMaster"); - - b.Navigation("Tenant"); - - b.Navigation("WorkArea"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Activities.WorkItemMapping", b => - { - b.HasOne("Marco.Pms.Model.Entitlements.Tenant", "Tenant") - .WithMany() - .HasForeignKey("TenantId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Marco.Pms.Model.Projects.WorkArea", "WorkArea") - .WithMany() - .HasForeignKey("WorkAreaId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Marco.Pms.Model.Activities.WorkItem", "WorkItem") - .WithMany() - .HasForeignKey("WorkItemId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Tenant"); - - b.Navigation("WorkArea"); - - b.Navigation("WorkItem"); - }); - - modelBuilder.Entity("Marco.Pms.Model.AttendanceModule.Attendance", b => - { - b.HasOne("Marco.Pms.Model.Employees.Employee", "Approver") - .WithMany() - .HasForeignKey("EmployeeID") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Marco.Pms.Model.Entitlements.Tenant", "Tenant") - .WithMany() - .HasForeignKey("TenantId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Approver"); - - b.Navigation("Tenant"); - }); - - modelBuilder.Entity("Marco.Pms.Model.AttendanceModule.AttendanceLog", b => - { - b.HasOne("Marco.Pms.Model.AttendanceModule.Attendance", "Attendance") - .WithMany() - .HasForeignKey("AttendanceId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Marco.Pms.Model.Employees.Employee", "Employee") - .WithMany() - .HasForeignKey("EmployeeID") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Marco.Pms.Model.Entitlements.Tenant", "Tenant") - .WithMany() - .HasForeignKey("TenantId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Marco.Pms.Model.Employees.Employee", "UpdatedByEmployee") - .WithMany() - .HasForeignKey("UpdatedBy"); - - b.Navigation("Attendance"); - - b.Navigation("Employee"); - - b.Navigation("Tenant"); - - b.Navigation("UpdatedByEmployee"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Authentication.RefreshToken", b => - { - b.HasOne("Microsoft.AspNetCore.Identity.IdentityUser", "User") - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("User"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Employees.Employee", b => - { - b.HasOne("Marco.Pms.Model.Entitlements.ApplicationUser", "ApplicationUser") - .WithMany() - .HasForeignKey("ApplicationUserId"); - - b.HasOne("Marco.Pms.Model.Entitlements.JobRole", "JobRole") - .WithMany() - .HasForeignKey("JobRoleId"); - - b.HasOne("Marco.Pms.Model.Entitlements.Tenant", "Tenant") - .WithMany() - .HasForeignKey("TenantId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("ApplicationUser"); - - b.Navigation("JobRole"); - - b.Navigation("Tenant"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Employees.WorkShift", b => - { - b.HasOne("Marco.Pms.Model.Entitlements.Tenant", "Tenant") - .WithMany() - .HasForeignKey("TenantId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Tenant"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Entitlements.ActivityMaster", b => - { - b.HasOne("Marco.Pms.Model.Activities.TaskAllocation", null) - .WithMany("AllotedTask") - .HasForeignKey("TaskAllocationId"); - - b.HasOne("Marco.Pms.Model.Entitlements.Tenant", "Tenant") - .WithMany() - .HasForeignKey("TenantId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Tenant"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Entitlements.ApplicationRole", b => - { - b.HasOne("Marco.Pms.Model.Entitlements.Tenant", null) - .WithMany() - .HasForeignKey("TenantId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Marco.Pms.Model.Entitlements.EmployeeRoleMapping", b => - { - b.HasOne("Marco.Pms.Model.Employees.Employee", "Employee") - .WithMany() - .HasForeignKey("EmployeeId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Marco.Pms.Model.Entitlements.ApplicationRole", "Role") - .WithMany() - .HasForeignKey("RoleId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Marco.Pms.Model.Entitlements.Tenant", "Tenant") - .WithMany() - .HasForeignKey("TenantId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Employee"); - - b.Navigation("Role"); - - b.Navigation("Tenant"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Entitlements.Feature", b => - { - b.HasOne("Marco.Pms.Model.Entitlements.Module", "Module") - .WithMany() - .HasForeignKey("ModuleId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Module"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Entitlements.FeaturePermission", b => - { - b.HasOne("Marco.Pms.Model.Entitlements.Feature", "Feature") - .WithMany("FeaturePermissions") - .HasForeignKey("FeatureId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Feature"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Entitlements.JobRole", b => - { - b.HasOne("Marco.Pms.Model.Entitlements.Tenant", "Tenant") - .WithMany() - .HasForeignKey("TenantId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Tenant"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Entitlements.RolePermissionMappings", b => - { - b.HasOne("Marco.Pms.Model.Entitlements.ApplicationRole", null) - .WithMany() - .HasForeignKey("ApplicationRoleId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Marco.Pms.Model.Entitlements.FeaturePermission", null) - .WithMany() - .HasForeignKey("FeaturePermissionId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Marco.Pms.Model.Entitlements.StatusMaster", b => - { - b.HasOne("Marco.Pms.Model.Entitlements.Tenant", "Tenant") - .WithMany() - .HasForeignKey("TenantId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Tenant"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Projects.Building", b => - { - b.HasOne("Marco.Pms.Model.Entitlements.Tenant", "Tenant") - .WithMany() - .HasForeignKey("TenantId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Tenant"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Projects.Floor", b => - { - b.HasOne("Marco.Pms.Model.Projects.Building", "Building") - .WithMany() - .HasForeignKey("BuildingId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Marco.Pms.Model.Entitlements.Tenant", "Tenant") - .WithMany() - .HasForeignKey("TenantId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Building"); - - b.Navigation("Tenant"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Projects.Project", b => - { - b.HasOne("Marco.Pms.Model.Entitlements.StatusMaster", "ProjectStatus") - .WithMany() - .HasForeignKey("ProjectStatusId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Marco.Pms.Model.Entitlements.Tenant", "Tenant") - .WithMany() - .HasForeignKey("TenantId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("ProjectStatus"); - - b.Navigation("Tenant"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Projects.ProjectAllocation", b => - { - b.HasOne("Marco.Pms.Model.Employees.Employee", "Employee") - .WithMany() - .HasForeignKey("EmployeeId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Marco.Pms.Model.Projects.Project", "Project") - .WithMany() - .HasForeignKey("ProjectId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Marco.Pms.Model.Entitlements.Tenant", "Tenant") - .WithMany() - .HasForeignKey("TenantId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Employee"); - - b.Navigation("Project"); - - b.Navigation("Tenant"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Projects.WorkArea", b => - { - b.HasOne("Marco.Pms.Model.Projects.Floor", "Floor") - .WithMany() - .HasForeignKey("FloorId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Marco.Pms.Model.Entitlements.Tenant", "Tenant") - .WithMany() - .HasForeignKey("TenantId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Floor"); - - b.Navigation("Tenant"); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim", b => - { - b.HasOne("Microsoft.AspNetCore.Identity.IdentityRole", null) - .WithMany() - .HasForeignKey("RoleId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim", b => - { - b.HasOne("Microsoft.AspNetCore.Identity.IdentityUser", null) - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin", b => - { - b.HasOne("Microsoft.AspNetCore.Identity.IdentityUser", null) - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole", b => - { - b.HasOne("Microsoft.AspNetCore.Identity.IdentityRole", null) - .WithMany() - .HasForeignKey("RoleId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Microsoft.AspNetCore.Identity.IdentityUser", null) - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken", b => - { - b.HasOne("Microsoft.AspNetCore.Identity.IdentityUser", null) - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Marco.Pms.Model.Activities.TaskAllocation", b => - { - b.Navigation("AllotedTask"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Entitlements.Feature", b => - { - b.Navigation("FeaturePermissions"); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/Marco.Pms.DataAccess/Migrations/20250303050349_renameattendancelogs.cs b/Marco.Pms.DataAccess/Migrations/20250303050349_renameattendancelogs.cs deleted file mode 100644 index 5e5e9cc..0000000 --- a/Marco.Pms.DataAccess/Migrations/20250303050349_renameattendancelogs.cs +++ /dev/null @@ -1,208 +0,0 @@ -using System; -using Microsoft.EntityFrameworkCore.Metadata; -using Microsoft.EntityFrameworkCore.Migrations; - -#nullable disable - -namespace Marco.Pms.DataAccess.Migrations -{ - /// - public partial class renameattendancelogs : Migration - { - /// - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropTable( - name: "AttendLogs"); - - migrationBuilder.CreateTable( - name: "AttendanceLogs", - columns: table => new - { - Id = table.Column(type: "int", nullable: false) - .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), - Comment = table.Column(type: "longtext", nullable: false) - .Annotation("MySql:CharSet", "utf8mb4"), - AttendanceId = table.Column(type: "int", nullable: false), - EmployeeID = table.Column(type: "int", nullable: false), - ActivityTime = table.Column(type: "datetime(6)", nullable: true), - Activity = table.Column(type: "int", nullable: false), - Photo = table.Column(type: "longblob", nullable: true), - Latitude = table.Column(type: "longtext", nullable: true) - .Annotation("MySql:CharSet", "utf8mb4"), - Longitude = table.Column(type: "longtext", nullable: true) - .Annotation("MySql:CharSet", "utf8mb4"), - UpdatedOn = table.Column(type: "datetime(6)", nullable: false), - UpdatedBy = table.Column(type: "int", nullable: true), - TenantId = table.Column(type: "int", nullable: false) - }, - constraints: table => - { - table.PrimaryKey("PK_AttendanceLogs", x => x.Id); - table.ForeignKey( - name: "FK_AttendanceLogs_Attendances_AttendanceId", - column: x => x.AttendanceId, - principalTable: "Attendances", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); - table.ForeignKey( - name: "FK_AttendanceLogs_Employees_EmployeeID", - column: x => x.EmployeeID, - principalTable: "Employees", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); - table.ForeignKey( - name: "FK_AttendanceLogs_Employees_UpdatedBy", - column: x => x.UpdatedBy, - principalTable: "Employees", - principalColumn: "Id"); - table.ForeignKey( - name: "FK_AttendanceLogs_Tenants_TenantId", - column: x => x.TenantId, - principalTable: "Tenants", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); - }) - .Annotation("MySql:CharSet", "utf8mb4"); - - migrationBuilder.UpdateData( - table: "Modules", - keyColumn: "Id", - keyValue: 1, - column: "Key", - value: "e20751cc-a482-499e-98de-ccc88689fcc6"); - - migrationBuilder.UpdateData( - table: "Modules", - keyColumn: "Id", - keyValue: 2, - column: "Key", - value: "589ba09f-e176-4c90-9502-707799d33e94"); - - migrationBuilder.UpdateData( - table: "Modules", - keyColumn: "Id", - keyValue: 3, - column: "Key", - value: "f1c5886a-474c-4b71-bda8-f278b78b0a4d"); - - migrationBuilder.CreateIndex( - name: "IX_AttendanceLogs_AttendanceId", - table: "AttendanceLogs", - column: "AttendanceId"); - - migrationBuilder.CreateIndex( - name: "IX_AttendanceLogs_EmployeeID", - table: "AttendanceLogs", - column: "EmployeeID"); - - migrationBuilder.CreateIndex( - name: "IX_AttendanceLogs_TenantId", - table: "AttendanceLogs", - column: "TenantId"); - - migrationBuilder.CreateIndex( - name: "IX_AttendanceLogs_UpdatedBy", - table: "AttendanceLogs", - column: "UpdatedBy"); - } - - /// - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropTable( - name: "AttendanceLogs"); - - migrationBuilder.CreateTable( - name: "AttendLogs", - columns: table => new - { - Id = table.Column(type: "int", nullable: false) - .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), - AttendanceId = table.Column(type: "int", nullable: false), - EmployeeID = table.Column(type: "int", nullable: false), - TenantId = table.Column(type: "int", nullable: false), - UpdatedBy = table.Column(type: "int", nullable: true), - Activity = table.Column(type: "int", nullable: false), - ActivityTime = table.Column(type: "datetime(6)", nullable: true), - Comment = table.Column(type: "longtext", nullable: false) - .Annotation("MySql:CharSet", "utf8mb4"), - Latitude = table.Column(type: "longtext", nullable: true) - .Annotation("MySql:CharSet", "utf8mb4"), - Longitude = table.Column(type: "longtext", nullable: true) - .Annotation("MySql:CharSet", "utf8mb4"), - Photo = table.Column(type: "longblob", nullable: true), - UpdatedOn = table.Column(type: "datetime(6)", nullable: false) - }, - constraints: table => - { - table.PrimaryKey("PK_AttendLogs", x => x.Id); - table.ForeignKey( - name: "FK_AttendLogs_Attendances_AttendanceId", - column: x => x.AttendanceId, - principalTable: "Attendances", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); - table.ForeignKey( - name: "FK_AttendLogs_Employees_EmployeeID", - column: x => x.EmployeeID, - principalTable: "Employees", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); - table.ForeignKey( - name: "FK_AttendLogs_Employees_UpdatedBy", - column: x => x.UpdatedBy, - principalTable: "Employees", - principalColumn: "Id"); - table.ForeignKey( - name: "FK_AttendLogs_Tenants_TenantId", - column: x => x.TenantId, - principalTable: "Tenants", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); - }) - .Annotation("MySql:CharSet", "utf8mb4"); - - migrationBuilder.UpdateData( - table: "Modules", - keyColumn: "Id", - keyValue: 1, - column: "Key", - value: "04db13e4-201a-44ba-9d9a-6c07f91d3cd0"); - - migrationBuilder.UpdateData( - table: "Modules", - keyColumn: "Id", - keyValue: 2, - column: "Key", - value: "72e2c008-c3f1-4dd8-a6ed-19c9eec3d892"); - - migrationBuilder.UpdateData( - table: "Modules", - keyColumn: "Id", - keyValue: 3, - column: "Key", - value: "0a8eda0f-39b8-4efe-98af-5c6f2a7cd5cf"); - - migrationBuilder.CreateIndex( - name: "IX_AttendLogs_AttendanceId", - table: "AttendLogs", - column: "AttendanceId"); - - migrationBuilder.CreateIndex( - name: "IX_AttendLogs_EmployeeID", - table: "AttendLogs", - column: "EmployeeID"); - - migrationBuilder.CreateIndex( - name: "IX_AttendLogs_TenantId", - table: "AttendLogs", - column: "TenantId"); - - migrationBuilder.CreateIndex( - name: "IX_AttendLogs_UpdatedBy", - table: "AttendLogs", - column: "UpdatedBy"); - } - } -} diff --git a/Marco.Pms.DataAccess/Migrations/20250303083329_attend.Designer.cs b/Marco.Pms.DataAccess/Migrations/20250303083329_attend.Designer.cs deleted file mode 100644 index 15b711b..0000000 --- a/Marco.Pms.DataAccess/Migrations/20250303083329_attend.Designer.cs +++ /dev/null @@ -1,2003 +0,0 @@ -// -using System; -using Marco.Pms.DataAccess.Data; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Metadata; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; - -#nullable disable - -namespace Marco.Pms.DataAccess.Migrations -{ - [DbContext(typeof(ApplicationDbContext))] - [Migration("20250303083329_attend")] - partial class attend - { - /// - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasAnnotation("ProductVersion", "8.0.12") - .HasAnnotation("Relational:MaxIdentifierLength", 64); - - // MySqlModelBuilderExtensions.AutoIncrementColumns(modelBuilder); - - modelBuilder.Entity("Marco.Pms.Model.Activities.TaskAllocation", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - - b.Property("AllocationDate") - .HasColumnType("datetime(6)"); - - b.Property("BuildingId") - .HasColumnType("int"); - - b.Property("EmployeeId") - .HasColumnType("int"); - - b.Property("EmployeeRole") - .HasColumnType("int"); - - b.Property("ProjectId") - .HasColumnType("int"); - - b.Property("ReAllocationDate") - .HasColumnType("datetime(6)"); - - b.Property("TenantId") - .HasColumnType("int"); - - b.Property("WorkAreaId") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("BuildingId"); - - b.HasIndex("EmployeeId"); - - b.HasIndex("ProjectId"); - - b.HasIndex("TenantId"); - - b.HasIndex("WorkAreaId"); - - b.ToTable("TaskAllocations"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Activities.WorkItem", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - - b.Property("ActivityId") - .HasColumnType("int"); - - b.Property("CompletedWork") - .HasColumnType("int"); - - b.Property("PlannedWork") - .HasColumnType("int"); - - b.Property("TaskDate") - .HasColumnType("datetime(6)"); - - b.Property("TenantId") - .HasColumnType("int"); - - b.Property("WorkAreaId") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("ActivityId"); - - b.HasIndex("TenantId"); - - b.HasIndex("WorkAreaId"); - - b.ToTable("WorkItems"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Activities.WorkItemMapping", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - - b.Property("TenantId") - .HasColumnType("int"); - - b.Property("WorkAreaId") - .HasColumnType("int"); - - b.Property("WorkItemId") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("TenantId"); - - b.HasIndex("WorkAreaId"); - - b.HasIndex("WorkItemId"); - - b.ToTable("WorkItemMapping"); - }); - - modelBuilder.Entity("Marco.Pms.Model.AttendanceModule.Attend", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - - b.Property("Activity") - .HasColumnType("int"); - - b.Property("ApprovedBy") - .HasColumnType("int"); - - b.Property("AttendanceDate") - .HasColumnType("datetime(6)"); - - b.Property("Comment") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("Date") - .HasColumnType("datetime(6)"); - - b.Property("EmployeeID") - .HasColumnType("int"); - - b.Property("InTime") - .HasColumnType("datetime(6)"); - - b.Property("IsApproved") - .HasColumnType("tinyint(1)"); - - b.Property("OutTime") - .HasColumnType("datetime(6)"); - - b.Property("ProjectID") - .HasColumnType("int"); - - b.Property("TenantId") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("EmployeeID"); - - b.HasIndex("TenantId"); - - b.ToTable("Attendes"); - }); - - modelBuilder.Entity("Marco.Pms.Model.AttendanceModule.Attendance", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - - b.Property("Activity") - .HasColumnType("int"); - - b.Property("ApprovedBy") - .HasColumnType("int"); - - b.Property("AttendanceDate") - .HasColumnType("datetime(6)"); - - b.Property("Comment") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("Date") - .HasColumnType("datetime(6)"); - - b.Property("EmployeeID") - .HasColumnType("int"); - - b.Property("InTime") - .HasColumnType("datetime(6)"); - - b.Property("IsApproved") - .HasColumnType("tinyint(1)"); - - b.Property("OutTime") - .HasColumnType("datetime(6)"); - - b.Property("ProjectID") - .HasColumnType("int"); - - b.Property("TenantId") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("EmployeeID"); - - b.HasIndex("TenantId"); - - b.ToTable("Attendance"); - }); - - modelBuilder.Entity("Marco.Pms.Model.AttendanceModule.AttendanceLog", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - - b.Property("Activity") - .HasColumnType("int"); - - b.Property("ActivityTime") - .HasColumnType("datetime(6)"); - - b.Property("AttendanceId") - .HasColumnType("int"); - - b.Property("Comment") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("EmployeeID") - .HasColumnType("int"); - - b.Property("Latitude") - .HasColumnType("longtext"); - - b.Property("Longitude") - .HasColumnType("longtext"); - - b.Property("Photo") - .HasColumnType("longblob"); - - b.Property("TenantId") - .HasColumnType("int"); - - b.Property("UpdatedBy") - .HasColumnType("int"); - - b.Property("UpdatedOn") - .HasColumnType("datetime(6)"); - - b.HasKey("Id"); - - b.HasIndex("AttendanceId"); - - b.HasIndex("EmployeeID"); - - b.HasIndex("TenantId"); - - b.HasIndex("UpdatedBy"); - - b.ToTable("AttendanceLogs"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Authentication.RefreshToken", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - - b.Property("CreatedAt") - .HasColumnType("datetime(6)"); - - b.Property("ExpiryDate") - .HasColumnType("datetime(6)"); - - b.Property("IsRevoked") - .HasColumnType("tinyint(1)"); - - b.Property("IsUsed") - .HasColumnType("tinyint(1)"); - - b.Property("RevokedAt") - .HasColumnType("datetime(6)"); - - b.Property("Token") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("UserId") - .IsRequired() - .HasColumnType("varchar(255)"); - - b.HasKey("Id"); - - b.HasIndex("UserId"); - - b.ToTable("RefreshTokens"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Employees.Employee", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - - b.Property("AadharNumber") - .HasColumnType("longtext"); - - b.Property("ApplicationUserId") - .HasColumnType("varchar(255)"); - - b.Property("BirthDate") - .HasColumnType("datetime(6)"); - - b.Property("CurrentAddress") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("Email") - .HasColumnType("longtext"); - - b.Property("EmergencyPhoneNumber") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("FirstName") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("Gender") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("JobRoleId") - .HasColumnType("int"); - - b.Property("LastName") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("MiddleName") - .HasColumnType("longtext"); - - b.Property("PanNumber") - .HasColumnType("longtext"); - - b.Property("PeramnentAddress") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("PhoneNumber") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("Photo") - .HasColumnType("longblob"); - - b.Property("RoleId") - .HasColumnType("char(36)"); - - b.Property("TenantId") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("ApplicationUserId"); - - b.HasIndex("JobRoleId"); - - b.HasIndex("TenantId"); - - b.ToTable("Employees"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Employees.WorkShift", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - - b.Property("EndTime") - .HasColumnType("time(6)"); - - b.Property("Name") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("StartTime") - .HasColumnType("time(6)"); - - b.Property("TenantId") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("TenantId"); - - b.ToTable("WorkShifts"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Entitlements.ActivityMaster", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - - b.Property("ActivityName") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("TaskAllocationId") - .HasColumnType("int"); - - b.Property("TenantId") - .HasColumnType("int"); - - b.Property("UnitOfMeasurement") - .IsRequired() - .HasColumnType("longtext"); - - b.HasKey("Id"); - - b.HasIndex("TaskAllocationId"); - - b.HasIndex("TenantId"); - - b.ToTable("ActivityMasters"); - - b.HasData( - new - { - Id = 1, - ActivityName = "Core Cutting", - TenantId = 1, - UnitOfMeasurement = "Number" - }, - new - { - Id = 2, - ActivityName = "Fabrication", - TenantId = 1, - UnitOfMeasurement = "Meter" - }, - new - { - Id = 3, - ActivityName = "Lifting", - TenantId = 1, - UnitOfMeasurement = "Meter" - }, - new - { - Id = 4, - ActivityName = "Hanging", - TenantId = 1, - UnitOfMeasurement = "Meter" - }, - new - { - Id = 5, - ActivityName = "Tapping", - TenantId = 1, - UnitOfMeasurement = "Meter" - }, - new - { - Id = 6, - ActivityName = "Welding", - TenantId = 1, - UnitOfMeasurement = "Meter" - }, - new - { - Id = 7, - ActivityName = "Testing", - TenantId = 1, - UnitOfMeasurement = "Area" - }, - new - { - Id = 8, - ActivityName = "Painting", - TenantId = 1, - UnitOfMeasurement = "Meter" - }, - new - { - Id = 9, - ActivityName = "Marking Area", - TenantId = 1, - UnitOfMeasurement = "Meter" - }, - new - { - Id = 10, - ActivityName = "Drilling", - TenantId = 1, - UnitOfMeasurement = "Number" - }, - new - { - Id = 11, - ActivityName = "MS Support Fabrication", - TenantId = 1, - UnitOfMeasurement = "Number" - }, - new - { - Id = 12, - ActivityName = "MS Support Hanging", - TenantId = 1, - UnitOfMeasurement = "Number" - }, - new - { - Id = 13, - ActivityName = "Hydrant Volve", - TenantId = 1, - UnitOfMeasurement = "Number" - }, - new - { - Id = 14, - ActivityName = "Sprinkler Installation", - TenantId = 1, - UnitOfMeasurement = "Number" - }); - }); - - modelBuilder.Entity("Marco.Pms.Model.Entitlements.ApplicationRole", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("char(36)"); - - b.Property("Description") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("Role") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("TenantId") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("TenantId"); - - b.ToTable("ApplicationRoles"); - - b.HasData( - new - { - Id = new Guid("2c8d0808-c421-11ef-9b93-0242ac110002"), - Description = "", - Role = "Admin", - TenantId = 1 - }, - new - { - Id = new Guid("62e0918d-c421-11ef-9b93-0242ac110002"), - Description = "", - Role = "Welder", - TenantId = 1 - }, - new - { - Id = new Guid("68823f1f-c421-11ef-9b93-0242ac110002"), - Description = "", - Role = "Helper", - TenantId = 1 - }, - new - { - Id = new Guid("6d3a7c72-c421-11ef-9b93-0242ac110002"), - Description = "", - Role = "Site Engineer", - TenantId = 1 - }, - new - { - Id = new Guid("6d3aad72-c421-11ef-9b93-0242ac110002"), - Description = "", - Role = "Project Manager", - TenantId = 1 - }); - }); - - modelBuilder.Entity("Marco.Pms.Model.Entitlements.EmployeeRoleMapping", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("char(36)"); - - b.Property("EmployeeId") - .HasColumnType("int"); - - b.Property("IsEnabled") - .HasColumnType("tinyint(1)"); - - b.Property("RoleId") - .HasColumnType("char(36)"); - - b.Property("TenantId") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("EmployeeId"); - - b.HasIndex("RoleId"); - - b.HasIndex("TenantId"); - - b.ToTable("EmployeeRoleMappings"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Entitlements.Feature", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("char(36)"); - - b.Property("Description") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("IsActive") - .HasColumnType("tinyint(1)"); - - b.Property("ModuleId") - .HasColumnType("int"); - - b.Property("Name") - .IsRequired() - .HasColumnType("longtext"); - - b.HasKey("Id"); - - b.HasIndex("ModuleId"); - - b.ToTable("Features"); - - b.HasData( - new - { - Id = new Guid("53176ebf-c75d-42e5-839f-4508ffac3def"), - Description = "Manage Project", - IsActive = true, - ModuleId = 1, - Name = "Manage Project" - }, - new - { - Id = new Guid("9666de86-d7c7-4d3d-acaa-fcd6d6b81f3c"), - Description = "Manage Infra", - IsActive = true, - ModuleId = 1, - Name = "Manage Infra" - }, - new - { - Id = new Guid("9d4b5489-2079-40b9-bd77-6e1bf90bc19f"), - Description = "Manage Tasks", - IsActive = true, - ModuleId = 1, - Name = "Manage Tasks" - }, - new - { - Id = new Guid("39e66f81-efc6-446c-95bd-46bff6cfb606"), - Description = "Assign and Update Tasks Progress", - IsActive = true, - ModuleId = 1, - Name = "Assign and Update Tasks Progress" - }, - new - { - Id = new Guid("81ab8a87-8ccd-4015-a917-0627cee6a100"), - Description = "Manage Employee", - IsActive = true, - ModuleId = 2, - Name = "Manage Employee" - }, - new - { - Id = new Guid("52c9cf54-1eb2-44d2-81bb-524cf29c0a94"), - Description = "Attendance", - IsActive = true, - ModuleId = 2, - Name = "Attendance" - }, - new - { - Id = new Guid("be3b3afc-6ccf-4566-b9b6-aafcb65546be"), - Description = "Global Masters", - IsActive = true, - ModuleId = 3, - Name = "Global Masters" - }, - new - { - Id = new Guid("660131a4-788c-4739-a082-cbbf7879cbf2"), - Description = "Tenant Masters", - IsActive = true, - ModuleId = 3, - Name = "Tenant Masters" - }); - }); - - modelBuilder.Entity("Marco.Pms.Model.Entitlements.FeaturePermission", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("char(36)"); - - b.Property("Description") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("FeatureId") - .HasColumnType("char(36)"); - - b.Property("IsEnabled") - .HasColumnType("tinyint(1)"); - - b.Property("Name") - .IsRequired() - .HasColumnType("longtext"); - - b.HasKey("Id"); - - b.HasIndex("FeatureId"); - - b.ToTable("FeaturePermissions"); - - b.HasData( - new - { - Id = new Guid("6ea44136-987e-44ba-9e5d-1cf8f5837ebc"), - Description = "", - FeatureId = new Guid("53176ebf-c75d-42e5-839f-4508ffac3def"), - IsEnabled = true, - Name = "View Project" - }, - new - { - Id = new Guid("172fc9b6-755b-4f62-ab26-55c34a330614"), - Description = "", - FeatureId = new Guid("53176ebf-c75d-42e5-839f-4508ffac3def"), - IsEnabled = true, - Name = "Manage Project" - }, - new - { - Id = new Guid("b94802ce-0689-4643-9e1d-11c86950c35b"), - Description = "", - FeatureId = new Guid("53176ebf-c75d-42e5-839f-4508ffac3def"), - IsEnabled = true, - Name = "Manage Team" - }, - new - { - Id = new Guid("c7b68e33-72f0-474f-bd96-77636427ecc8"), - Description = "", - FeatureId = new Guid("9666de86-d7c7-4d3d-acaa-fcd6d6b81f3c"), - IsEnabled = true, - Name = "View Project Infra" - }, - new - { - Id = new Guid("f2aee20a-b754-4537-8166-f9507b44585b"), - Description = "", - FeatureId = new Guid("9666de86-d7c7-4d3d-acaa-fcd6d6b81f3c"), - IsEnabled = true, - Name = "Manage Project Infra" - }, - new - { - Id = new Guid("9fcc5f87-25e3-4846-90ac-67a71ab92e3c"), - Description = "", - FeatureId = new Guid("9d4b5489-2079-40b9-bd77-6e1bf90bc19f"), - IsEnabled = true, - Name = "View Task" - }, - new - { - Id = new Guid("08752f33-3b29-4816-b76b-ea8a968ed3c5"), - Description = "", - FeatureId = new Guid("9d4b5489-2079-40b9-bd77-6e1bf90bc19f"), - IsEnabled = true, - Name = "Manage Task" - }, - new - { - Id = new Guid("d135a4b0-4f9a-4903-ab9c-4843839ebdee"), - Description = "", - FeatureId = new Guid("39e66f81-efc6-446c-95bd-46bff6cfb606"), - IsEnabled = true, - Name = "Assign Task and Report Progress" - }, - new - { - Id = new Guid("ed99ecd4-1bed-42e1-b7b3-d64c04493823"), - Description = "", - FeatureId = new Guid("39e66f81-efc6-446c-95bd-46bff6cfb606"), - IsEnabled = true, - Name = "Approve Task" - }, - new - { - Id = new Guid("b82d2b7e-0d52-45f3-997b-c008ea460e7f"), - Description = "", - FeatureId = new Guid("81ab8a87-8ccd-4015-a917-0627cee6a100"), - IsEnabled = true, - Name = "View Employee" - }, - new - { - Id = new Guid("a97d366a-c2bb-448d-be93-402bd2324566"), - Description = "", - FeatureId = new Guid("81ab8a87-8ccd-4015-a917-0627cee6a100"), - IsEnabled = true, - Name = "Manage Employee" - }, - new - { - Id = new Guid("fbd213e0-0250-46f1-9f5f-4b2a1e6e76a3"), - Description = "", - FeatureId = new Guid("81ab8a87-8ccd-4015-a917-0627cee6a100"), - IsEnabled = true, - Name = "Assign To Project" - }, - new - { - Id = new Guid("915e6bff-65f6-4e3f-aea8-3fd217d3ea9e"), - Description = "", - FeatureId = new Guid("52c9cf54-1eb2-44d2-81bb-524cf29c0a94"), - IsEnabled = true, - Name = "Perform Attendance " - }, - new - { - Id = new Guid("57802c4a-00aa-4a1f-a048-fd2f70dd44b6"), - Description = "", - FeatureId = new Guid("52c9cf54-1eb2-44d2-81bb-524cf29c0a94"), - IsEnabled = true, - Name = "Regularize Attendance" - }, - new - { - Id = new Guid("5ffbafe0-7ab0-48b1-bb50-c1bf76b65f9d"), - Description = "", - FeatureId = new Guid("be3b3afc-6ccf-4566-b9b6-aafcb65546be"), - IsEnabled = true, - Name = "View Masters" - }, - new - { - Id = new Guid("588a8824-f924-4955-82d8-fc51956cf323"), - Description = "", - FeatureId = new Guid("be3b3afc-6ccf-4566-b9b6-aafcb65546be"), - IsEnabled = true, - Name = "Manage Masters" - }, - new - { - Id = new Guid("cb8ec407-46d4-4467-930c-69127cda6dec"), - Description = "", - FeatureId = new Guid("660131a4-788c-4739-a082-cbbf7879cbf2"), - IsEnabled = true, - Name = "View Masters" - }, - new - { - Id = new Guid("6b1a6d97-a951-4de5-9b19-709bac7c4f18"), - Description = "", - FeatureId = new Guid("660131a4-788c-4739-a082-cbbf7879cbf2"), - IsEnabled = true, - Name = "Manage Masters" - }); - }); - - modelBuilder.Entity("Marco.Pms.Model.Entitlements.JobRole", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - - b.Property("Description") - .HasColumnType("longtext"); - - b.Property("Name") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("TenantId") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("TenantId"); - - b.ToTable("JobRoles"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Entitlements.Module", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - - b.Property("Description") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("Key") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("Name") - .IsRequired() - .HasColumnType("longtext"); - - b.HasKey("Id"); - - b.ToTable("Modules"); - - b.HasData( - new - { - Id = 1, - Description = "Project Module", - Key = "c66df186-3191-4286-b5ef-c6a4adc3a65b", - Name = "Project" - }, - new - { - Id = 2, - Description = "Employee Module", - Key = "5efb0b4b-03ab-480c-a2fd-d5a8be9e5f96", - Name = "Employee" - }, - new - { - Id = 3, - Description = "Masters Module", - Key = "43e0fb8a-3d42-451c-9899-24bb033b4e70", - Name = "Masters" - }); - }); - - modelBuilder.Entity("Marco.Pms.Model.Entitlements.RolePermissionMappings", b => - { - b.Property("ApplicationRoleId") - .HasColumnType("char(36)"); - - b.Property("FeaturePermissionId") - .HasColumnType("char(36)"); - - b.HasKey("ApplicationRoleId", "FeaturePermissionId"); - - b.HasIndex("FeaturePermissionId"); - - b.ToTable("RolePermissionMappings"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Entitlements.StatusMaster", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - - b.Property("Status") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("TenantId") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("TenantId"); - - b.ToTable("StatusMasters"); - - b.HasData( - new - { - Id = 1, - Status = "Active", - TenantId = 1 - }, - new - { - Id = 2, - Status = "In Progress", - TenantId = 1 - }, - new - { - Id = 3, - Status = "On Hold", - TenantId = 1 - }, - new - { - Id = 4, - Status = "Completed", - TenantId = 1 - }); - }); - - modelBuilder.Entity("Marco.Pms.Model.Entitlements.Tenant", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - - b.Property("ContactName") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("ContactNumber") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("Description") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("DomainName") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("Name") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("OnBoardingDate") - .HasColumnType("datetime(6)"); - - b.HasKey("Id"); - - b.ToTable("Tenants"); - - b.HasData( - new - { - Id = 1, - ContactName = "Admin", - ContactNumber = "123456789", - Description = "", - DomainName = "www.marcobms.org", - Name = "MarcoBMS", - OnBoardingDate = new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified) - }); - }); - - modelBuilder.Entity("Marco.Pms.Model.Projects.Building", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - - b.Property("Description") - .HasColumnType("longtext"); - - b.Property("Name") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("ProjectId") - .HasColumnType("int"); - - b.Property("TenantId") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("TenantId"); - - b.ToTable("Buildings"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Projects.Floor", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - - b.Property("BuildingId") - .HasColumnType("int"); - - b.Property("FloorName") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("TenantId") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("BuildingId"); - - b.HasIndex("TenantId"); - - b.ToTable("Floor"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Projects.Project", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - - b.Property("ContactPerson") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("EndDate") - .HasColumnType("datetime(6)"); - - b.Property("Name") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("ProjectAddress") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("ProjectStatusId") - .HasColumnType("int"); - - b.Property("StartDate") - .HasColumnType("datetime(6)"); - - b.Property("TenantId") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("ProjectStatusId"); - - b.HasIndex("TenantId"); - - b.ToTable("Projects"); - - b.HasData( - new - { - Id = 1, - ContactPerson = "Project 1 Contact Person", - Name = "Project 1", - ProjectAddress = "Project 1 Address", - ProjectStatusId = 1, - TenantId = 1 - }, - new - { - Id = 2, - ContactPerson = "Project 2 Contact Person", - Name = "Project 2", - ProjectAddress = "Project 2 Address", - ProjectStatusId = 2, - TenantId = 1 - }, - new - { - Id = 3, - ContactPerson = "Project 3 Contact Person", - Name = "Project 3", - ProjectAddress = "Project 3 Address", - ProjectStatusId = 3, - TenantId = 1 - }); - }); - - modelBuilder.Entity("Marco.Pms.Model.Projects.ProjectAllocation", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - - b.Property("AllocationDate") - .HasColumnType("datetime(6)"); - - b.Property("EmployeeId") - .HasColumnType("int"); - - b.Property("EmployeeRoleId") - .HasColumnType("char(36)"); - - b.Property("ProjectId") - .HasColumnType("int"); - - b.Property("ReAllocationDate") - .HasColumnType("datetime(6)"); - - b.Property("TenantId") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("EmployeeId"); - - b.HasIndex("ProjectId"); - - b.HasIndex("TenantId"); - - b.ToTable("ProjectAllocations"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Projects.WorkArea", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - - b.Property("AreaName") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("FloorId") - .HasColumnType("int"); - - b.Property("TenantId") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("FloorId"); - - b.HasIndex("TenantId"); - - b.ToTable("WorkAreas"); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRole", b => - { - b.Property("Id") - .HasColumnType("varchar(255)"); - - b.Property("ConcurrencyStamp") - .IsConcurrencyToken() - .HasColumnType("longtext"); - - b.Property("Name") - .HasMaxLength(256) - .HasColumnType("varchar(256)"); - - b.Property("NormalizedName") - .HasMaxLength(256) - .HasColumnType("varchar(256)"); - - b.HasKey("Id"); - - b.HasIndex("NormalizedName") - .IsUnique() - .HasDatabaseName("RoleNameIndex"); - - b.ToTable("AspNetRoles", (string)null); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - - b.Property("ClaimType") - .HasColumnType("longtext"); - - b.Property("ClaimValue") - .HasColumnType("longtext"); - - b.Property("RoleId") - .IsRequired() - .HasColumnType("varchar(255)"); - - b.HasKey("Id"); - - b.HasIndex("RoleId"); - - b.ToTable("AspNetRoleClaims", (string)null); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUser", b => - { - b.Property("Id") - .HasColumnType("varchar(255)"); - - b.Property("AccessFailedCount") - .HasColumnType("int"); - - b.Property("ConcurrencyStamp") - .IsConcurrencyToken() - .HasColumnType("longtext"); - - b.Property("Discriminator") - .IsRequired() - .HasMaxLength(21) - .HasColumnType("varchar(21)"); - - b.Property("Email") - .HasMaxLength(256) - .HasColumnType("varchar(256)"); - - b.Property("EmailConfirmed") - .HasColumnType("tinyint(1)"); - - b.Property("LockoutEnabled") - .HasColumnType("tinyint(1)"); - - b.Property("LockoutEnd") - .HasColumnType("datetime(6)"); - - b.Property("NormalizedEmail") - .HasMaxLength(256) - .HasColumnType("varchar(256)"); - - b.Property("NormalizedUserName") - .HasMaxLength(256) - .HasColumnType("varchar(256)"); - - b.Property("PasswordHash") - .HasColumnType("longtext"); - - b.Property("PhoneNumber") - .HasColumnType("longtext"); - - b.Property("PhoneNumberConfirmed") - .HasColumnType("tinyint(1)"); - - b.Property("SecurityStamp") - .HasColumnType("longtext"); - - b.Property("TwoFactorEnabled") - .HasColumnType("tinyint(1)"); - - b.Property("UserName") - .HasMaxLength(256) - .HasColumnType("varchar(256)"); - - b.HasKey("Id"); - - b.HasIndex("NormalizedEmail") - .HasDatabaseName("EmailIndex"); - - b.HasIndex("NormalizedUserName") - .IsUnique() - .HasDatabaseName("UserNameIndex"); - - b.ToTable("AspNetUsers", (string)null); - - b.HasDiscriminator().HasValue("IdentityUser"); - - b.UseTphMappingStrategy(); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - - b.Property("ClaimType") - .HasColumnType("longtext"); - - b.Property("ClaimValue") - .HasColumnType("longtext"); - - b.Property("UserId") - .IsRequired() - .HasColumnType("varchar(255)"); - - b.HasKey("Id"); - - b.HasIndex("UserId"); - - b.ToTable("AspNetUserClaims", (string)null); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin", b => - { - b.Property("LoginProvider") - .HasColumnType("varchar(255)"); - - b.Property("ProviderKey") - .HasColumnType("varchar(255)"); - - b.Property("ProviderDisplayName") - .HasColumnType("longtext"); - - b.Property("UserId") - .IsRequired() - .HasColumnType("varchar(255)"); - - b.HasKey("LoginProvider", "ProviderKey"); - - b.HasIndex("UserId"); - - b.ToTable("AspNetUserLogins", (string)null); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole", b => - { - b.Property("UserId") - .HasColumnType("varchar(255)"); - - b.Property("RoleId") - .HasColumnType("varchar(255)"); - - b.HasKey("UserId", "RoleId"); - - b.HasIndex("RoleId"); - - b.ToTable("AspNetUserRoles", (string)null); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken", b => - { - b.Property("UserId") - .HasColumnType("varchar(255)"); - - b.Property("LoginProvider") - .HasColumnType("varchar(255)"); - - b.Property("Name") - .HasColumnType("varchar(255)"); - - b.Property("Value") - .HasColumnType("longtext"); - - b.HasKey("UserId", "LoginProvider", "Name"); - - b.ToTable("AspNetUserTokens", (string)null); - }); - - modelBuilder.Entity("Marco.Pms.Model.Entitlements.ApplicationUser", b => - { - b.HasBaseType("Microsoft.AspNetCore.Identity.IdentityUser"); - - b.Property("IsRootUser") - .HasColumnType("tinyint(1)"); - - b.Property("Role") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("TenantId") - .HasColumnType("int"); - - b.HasDiscriminator().HasValue("ApplicationUser"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Activities.TaskAllocation", b => - { - b.HasOne("Marco.Pms.Model.Projects.Building", "Building") - .WithMany() - .HasForeignKey("BuildingId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Marco.Pms.Model.Employees.Employee", "Employee") - .WithMany() - .HasForeignKey("EmployeeId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Marco.Pms.Model.Projects.Project", "Project") - .WithMany() - .HasForeignKey("ProjectId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Marco.Pms.Model.Entitlements.Tenant", "Tenant") - .WithMany() - .HasForeignKey("TenantId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Marco.Pms.Model.Projects.WorkArea", "WorkArea") - .WithMany() - .HasForeignKey("WorkAreaId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Building"); - - b.Navigation("Employee"); - - b.Navigation("Project"); - - b.Navigation("Tenant"); - - b.Navigation("WorkArea"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Activities.WorkItem", b => - { - b.HasOne("Marco.Pms.Model.Entitlements.ActivityMaster", "ActivityMaster") - .WithMany() - .HasForeignKey("ActivityId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Marco.Pms.Model.Entitlements.Tenant", "Tenant") - .WithMany() - .HasForeignKey("TenantId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Marco.Pms.Model.Projects.WorkArea", "WorkArea") - .WithMany() - .HasForeignKey("WorkAreaId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("ActivityMaster"); - - b.Navigation("Tenant"); - - b.Navigation("WorkArea"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Activities.WorkItemMapping", b => - { - b.HasOne("Marco.Pms.Model.Entitlements.Tenant", "Tenant") - .WithMany() - .HasForeignKey("TenantId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Marco.Pms.Model.Projects.WorkArea", "WorkArea") - .WithMany() - .HasForeignKey("WorkAreaId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Marco.Pms.Model.Activities.WorkItem", "WorkItem") - .WithMany() - .HasForeignKey("WorkItemId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Tenant"); - - b.Navigation("WorkArea"); - - b.Navigation("WorkItem"); - }); - - modelBuilder.Entity("Marco.Pms.Model.AttendanceModule.Attend", b => - { - b.HasOne("Marco.Pms.Model.Employees.Employee", "Approver") - .WithMany() - .HasForeignKey("EmployeeID") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Marco.Pms.Model.Entitlements.Tenant", "Tenant") - .WithMany() - .HasForeignKey("TenantId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Approver"); - - b.Navigation("Tenant"); - }); - - modelBuilder.Entity("Marco.Pms.Model.AttendanceModule.Attendance", b => - { - b.HasOne("Marco.Pms.Model.Employees.Employee", "Approver") - .WithMany() - .HasForeignKey("EmployeeID") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Marco.Pms.Model.Entitlements.Tenant", "Tenant") - .WithMany() - .HasForeignKey("TenantId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Approver"); - - b.Navigation("Tenant"); - }); - - modelBuilder.Entity("Marco.Pms.Model.AttendanceModule.AttendanceLog", b => - { - b.HasOne("Marco.Pms.Model.AttendanceModule.Attendance", "Attendance") - .WithMany() - .HasForeignKey("AttendanceId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Marco.Pms.Model.Employees.Employee", "Employee") - .WithMany() - .HasForeignKey("EmployeeID") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Marco.Pms.Model.Entitlements.Tenant", "Tenant") - .WithMany() - .HasForeignKey("TenantId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Marco.Pms.Model.Employees.Employee", "UpdatedByEmployee") - .WithMany() - .HasForeignKey("UpdatedBy"); - - b.Navigation("Attendance"); - - b.Navigation("Employee"); - - b.Navigation("Tenant"); - - b.Navigation("UpdatedByEmployee"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Authentication.RefreshToken", b => - { - b.HasOne("Microsoft.AspNetCore.Identity.IdentityUser", "User") - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("User"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Employees.Employee", b => - { - b.HasOne("Marco.Pms.Model.Entitlements.ApplicationUser", "ApplicationUser") - .WithMany() - .HasForeignKey("ApplicationUserId"); - - b.HasOne("Marco.Pms.Model.Entitlements.JobRole", "JobRole") - .WithMany() - .HasForeignKey("JobRoleId"); - - b.HasOne("Marco.Pms.Model.Entitlements.Tenant", "Tenant") - .WithMany() - .HasForeignKey("TenantId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("ApplicationUser"); - - b.Navigation("JobRole"); - - b.Navigation("Tenant"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Employees.WorkShift", b => - { - b.HasOne("Marco.Pms.Model.Entitlements.Tenant", "Tenant") - .WithMany() - .HasForeignKey("TenantId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Tenant"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Entitlements.ActivityMaster", b => - { - b.HasOne("Marco.Pms.Model.Activities.TaskAllocation", null) - .WithMany("AllotedTask") - .HasForeignKey("TaskAllocationId"); - - b.HasOne("Marco.Pms.Model.Entitlements.Tenant", "Tenant") - .WithMany() - .HasForeignKey("TenantId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Tenant"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Entitlements.ApplicationRole", b => - { - b.HasOne("Marco.Pms.Model.Entitlements.Tenant", null) - .WithMany() - .HasForeignKey("TenantId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Marco.Pms.Model.Entitlements.EmployeeRoleMapping", b => - { - b.HasOne("Marco.Pms.Model.Employees.Employee", "Employee") - .WithMany() - .HasForeignKey("EmployeeId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Marco.Pms.Model.Entitlements.ApplicationRole", "Role") - .WithMany() - .HasForeignKey("RoleId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Marco.Pms.Model.Entitlements.Tenant", "Tenant") - .WithMany() - .HasForeignKey("TenantId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Employee"); - - b.Navigation("Role"); - - b.Navigation("Tenant"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Entitlements.Feature", b => - { - b.HasOne("Marco.Pms.Model.Entitlements.Module", "Module") - .WithMany() - .HasForeignKey("ModuleId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Module"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Entitlements.FeaturePermission", b => - { - b.HasOne("Marco.Pms.Model.Entitlements.Feature", "Feature") - .WithMany("FeaturePermissions") - .HasForeignKey("FeatureId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Feature"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Entitlements.JobRole", b => - { - b.HasOne("Marco.Pms.Model.Entitlements.Tenant", "Tenant") - .WithMany() - .HasForeignKey("TenantId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Tenant"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Entitlements.RolePermissionMappings", b => - { - b.HasOne("Marco.Pms.Model.Entitlements.ApplicationRole", null) - .WithMany() - .HasForeignKey("ApplicationRoleId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Marco.Pms.Model.Entitlements.FeaturePermission", null) - .WithMany() - .HasForeignKey("FeaturePermissionId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Marco.Pms.Model.Entitlements.StatusMaster", b => - { - b.HasOne("Marco.Pms.Model.Entitlements.Tenant", "Tenant") - .WithMany() - .HasForeignKey("TenantId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Tenant"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Projects.Building", b => - { - b.HasOne("Marco.Pms.Model.Entitlements.Tenant", "Tenant") - .WithMany() - .HasForeignKey("TenantId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Tenant"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Projects.Floor", b => - { - b.HasOne("Marco.Pms.Model.Projects.Building", "Building") - .WithMany() - .HasForeignKey("BuildingId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Marco.Pms.Model.Entitlements.Tenant", "Tenant") - .WithMany() - .HasForeignKey("TenantId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Building"); - - b.Navigation("Tenant"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Projects.Project", b => - { - b.HasOne("Marco.Pms.Model.Entitlements.StatusMaster", "ProjectStatus") - .WithMany() - .HasForeignKey("ProjectStatusId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Marco.Pms.Model.Entitlements.Tenant", "Tenant") - .WithMany() - .HasForeignKey("TenantId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("ProjectStatus"); - - b.Navigation("Tenant"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Projects.ProjectAllocation", b => - { - b.HasOne("Marco.Pms.Model.Employees.Employee", "Employee") - .WithMany() - .HasForeignKey("EmployeeId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Marco.Pms.Model.Projects.Project", "Project") - .WithMany() - .HasForeignKey("ProjectId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Marco.Pms.Model.Entitlements.Tenant", "Tenant") - .WithMany() - .HasForeignKey("TenantId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Employee"); - - b.Navigation("Project"); - - b.Navigation("Tenant"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Projects.WorkArea", b => - { - b.HasOne("Marco.Pms.Model.Projects.Floor", "Floor") - .WithMany() - .HasForeignKey("FloorId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Marco.Pms.Model.Entitlements.Tenant", "Tenant") - .WithMany() - .HasForeignKey("TenantId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Floor"); - - b.Navigation("Tenant"); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim", b => - { - b.HasOne("Microsoft.AspNetCore.Identity.IdentityRole", null) - .WithMany() - .HasForeignKey("RoleId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim", b => - { - b.HasOne("Microsoft.AspNetCore.Identity.IdentityUser", null) - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin", b => - { - b.HasOne("Microsoft.AspNetCore.Identity.IdentityUser", null) - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole", b => - { - b.HasOne("Microsoft.AspNetCore.Identity.IdentityRole", null) - .WithMany() - .HasForeignKey("RoleId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Microsoft.AspNetCore.Identity.IdentityUser", null) - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken", b => - { - b.HasOne("Microsoft.AspNetCore.Identity.IdentityUser", null) - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Marco.Pms.Model.Activities.TaskAllocation", b => - { - b.Navigation("AllotedTask"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Entitlements.Feature", b => - { - b.Navigation("FeaturePermissions"); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/Marco.Pms.DataAccess/Migrations/20250303083329_attend.cs b/Marco.Pms.DataAccess/Migrations/20250303083329_attend.cs deleted file mode 100644 index ede525f..0000000 --- a/Marco.Pms.DataAccess/Migrations/20250303083329_attend.cs +++ /dev/null @@ -1,242 +0,0 @@ -using System; -using Microsoft.EntityFrameworkCore.Metadata; -using Microsoft.EntityFrameworkCore.Migrations; - -#nullable disable - -namespace Marco.Pms.DataAccess.Migrations -{ - /// - public partial class attend : Migration - { - /// - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropForeignKey( - name: "FK_AttendanceLogs_Attendances_AttendanceId", - table: "AttendanceLogs"); - - migrationBuilder.DropForeignKey( - name: "FK_Attendances_Employees_EmployeeID", - table: "Attendances"); - - migrationBuilder.DropForeignKey( - name: "FK_Attendances_Tenants_TenantId", - table: "Attendances"); - - migrationBuilder.DropPrimaryKey( - name: "PK_Attendances", - table: "Attendances"); - - migrationBuilder.RenameTable( - name: "Attendances", - newName: "Attendance"); - - migrationBuilder.RenameIndex( - name: "IX_Attendances_TenantId", - table: "Attendance", - newName: "IX_Attendance_TenantId"); - - migrationBuilder.RenameIndex( - name: "IX_Attendances_EmployeeID", - table: "Attendance", - newName: "IX_Attendance_EmployeeID"); - - migrationBuilder.AddColumn( - name: "RoleId", - table: "Employees", - type: "char(36)", - nullable: false, - defaultValue: new Guid("00000000-0000-0000-0000-000000000000"), - collation: "ascii_general_ci"); - - migrationBuilder.AddPrimaryKey( - name: "PK_Attendance", - table: "Attendance", - column: "Id"); - - migrationBuilder.CreateTable( - name: "Attendes", - columns: table => new - { - Id = table.Column(type: "int", nullable: false) - .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), - Comment = table.Column(type: "longtext", nullable: false) - .Annotation("MySql:CharSet", "utf8mb4"), - EmployeeID = table.Column(type: "int", nullable: false), - Date = table.Column(type: "datetime(6)", nullable: false), - ProjectID = table.Column(type: "int", nullable: false), - AttendanceDate = table.Column(type: "datetime(6)", nullable: false), - InTime = table.Column(type: "datetime(6)", nullable: true), - OutTime = table.Column(type: "datetime(6)", nullable: true), - IsApproved = table.Column(type: "tinyint(1)", nullable: false), - Activity = table.Column(type: "int", nullable: false), - ApprovedBy = table.Column(type: "int", nullable: true), - TenantId = table.Column(type: "int", nullable: false) - }, - constraints: table => - { - table.PrimaryKey("PK_Attendes", x => x.Id); - table.ForeignKey( - name: "FK_Attendes_Employees_EmployeeID", - column: x => x.EmployeeID, - principalTable: "Employees", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); - table.ForeignKey( - name: "FK_Attendes_Tenants_TenantId", - column: x => x.TenantId, - principalTable: "Tenants", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); - }) - .Annotation("MySql:CharSet", "utf8mb4"); - - migrationBuilder.UpdateData( - table: "Modules", - keyColumn: "Id", - keyValue: 1, - column: "Key", - value: "c66df186-3191-4286-b5ef-c6a4adc3a65b"); - - migrationBuilder.UpdateData( - table: "Modules", - keyColumn: "Id", - keyValue: 2, - column: "Key", - value: "5efb0b4b-03ab-480c-a2fd-d5a8be9e5f96"); - - migrationBuilder.UpdateData( - table: "Modules", - keyColumn: "Id", - keyValue: 3, - column: "Key", - value: "43e0fb8a-3d42-451c-9899-24bb033b4e70"); - - migrationBuilder.CreateIndex( - name: "IX_Attendes_EmployeeID", - table: "Attendes", - column: "EmployeeID"); - - migrationBuilder.CreateIndex( - name: "IX_Attendes_TenantId", - table: "Attendes", - column: "TenantId"); - - migrationBuilder.AddForeignKey( - name: "FK_Attendance_Employees_EmployeeID", - table: "Attendance", - column: "EmployeeID", - principalTable: "Employees", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); - - migrationBuilder.AddForeignKey( - name: "FK_Attendance_Tenants_TenantId", - table: "Attendance", - column: "TenantId", - principalTable: "Tenants", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); - - migrationBuilder.AddForeignKey( - name: "FK_AttendanceLogs_Attendance_AttendanceId", - table: "AttendanceLogs", - column: "AttendanceId", - principalTable: "Attendance", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); - } - - /// - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropForeignKey( - name: "FK_Attendance_Employees_EmployeeID", - table: "Attendance"); - - migrationBuilder.DropForeignKey( - name: "FK_Attendance_Tenants_TenantId", - table: "Attendance"); - - migrationBuilder.DropForeignKey( - name: "FK_AttendanceLogs_Attendance_AttendanceId", - table: "AttendanceLogs"); - - migrationBuilder.DropTable( - name: "Attendes"); - - migrationBuilder.DropPrimaryKey( - name: "PK_Attendance", - table: "Attendance"); - - migrationBuilder.DropColumn( - name: "RoleId", - table: "Employees"); - - migrationBuilder.RenameTable( - name: "Attendance", - newName: "Attendances"); - - migrationBuilder.RenameIndex( - name: "IX_Attendance_TenantId", - table: "Attendances", - newName: "IX_Attendances_TenantId"); - - migrationBuilder.RenameIndex( - name: "IX_Attendance_EmployeeID", - table: "Attendances", - newName: "IX_Attendances_EmployeeID"); - - migrationBuilder.AddPrimaryKey( - name: "PK_Attendances", - table: "Attendances", - column: "Id"); - - migrationBuilder.UpdateData( - table: "Modules", - keyColumn: "Id", - keyValue: 1, - column: "Key", - value: "331a7bea-688e-4f27-8dba-697d9cd29870"); - - migrationBuilder.UpdateData( - table: "Modules", - keyColumn: "Id", - keyValue: 2, - column: "Key", - value: "ba873fd2-277b-4baa-88b9-22b69010ffa8"); - - migrationBuilder.UpdateData( - table: "Modules", - keyColumn: "Id", - keyValue: 3, - column: "Key", - value: "aa481e97-9a9b-4b1e-b9dd-0a6ce26dab47"); - - migrationBuilder.AddForeignKey( - name: "FK_AttendanceLogs_Attendances_AttendanceId", - table: "AttendanceLogs", - column: "AttendanceId", - principalTable: "Attendances", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); - - migrationBuilder.AddForeignKey( - name: "FK_Attendances_Employees_EmployeeID", - table: "Attendances", - column: "EmployeeID", - principalTable: "Employees", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); - - migrationBuilder.AddForeignKey( - name: "FK_Attendances_Tenants_TenantId", - table: "Attendances", - column: "TenantId", - principalTable: "Tenants", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); - } - } -} diff --git a/Marco.Pms.DataAccess/Migrations/20250303085119_attendrename.Designer.cs b/Marco.Pms.DataAccess/Migrations/20250303085119_attendrename.Designer.cs deleted file mode 100644 index a840623..0000000 --- a/Marco.Pms.DataAccess/Migrations/20250303085119_attendrename.Designer.cs +++ /dev/null @@ -1,1933 +0,0 @@ -// -using System; -using Marco.Pms.DataAccess.Data; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Metadata; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; - -#nullable disable - -namespace Marco.Pms.DataAccess.Migrations -{ - [DbContext(typeof(ApplicationDbContext))] - [Migration("20250303085119_attendrename")] - partial class attendrename - { - /// - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasAnnotation("ProductVersion", "8.0.12") - .HasAnnotation("Relational:MaxIdentifierLength", 64); - - //MySqlModelBuilderExtensions.AutoIncrementColumns(modelBuilder); - - modelBuilder.Entity("Marco.Pms.Model.Activities.TaskAllocation", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - - b.Property("AllocationDate") - .HasColumnType("datetime(6)"); - - b.Property("BuildingId") - .HasColumnType("int"); - - b.Property("EmployeeId") - .HasColumnType("int"); - - b.Property("EmployeeRole") - .HasColumnType("int"); - - b.Property("ProjectId") - .HasColumnType("int"); - - b.Property("ReAllocationDate") - .HasColumnType("datetime(6)"); - - b.Property("TenantId") - .HasColumnType("int"); - - b.Property("WorkAreaId") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("BuildingId"); - - b.HasIndex("EmployeeId"); - - b.HasIndex("ProjectId"); - - b.HasIndex("TenantId"); - - b.HasIndex("WorkAreaId"); - - b.ToTable("TaskAllocations"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Activities.WorkItem", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - - b.Property("ActivityId") - .HasColumnType("int"); - - b.Property("CompletedWork") - .HasColumnType("int"); - - b.Property("PlannedWork") - .HasColumnType("int"); - - b.Property("TaskDate") - .HasColumnType("datetime(6)"); - - b.Property("TenantId") - .HasColumnType("int"); - - b.Property("WorkAreaId") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("ActivityId"); - - b.HasIndex("TenantId"); - - b.HasIndex("WorkAreaId"); - - b.ToTable("WorkItems"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Activities.WorkItemMapping", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - - b.Property("TenantId") - .HasColumnType("int"); - - b.Property("WorkAreaId") - .HasColumnType("int"); - - b.Property("WorkItemId") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("TenantId"); - - b.HasIndex("WorkAreaId"); - - b.HasIndex("WorkItemId"); - - b.ToTable("WorkItemMapping"); - }); - - modelBuilder.Entity("Marco.Pms.Model.AttendanceModule.Attendance", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - - b.Property("Activity") - .HasColumnType("int"); - - b.Property("ApprovedBy") - .HasColumnType("int"); - - b.Property("AttendanceDate") - .HasColumnType("datetime(6)"); - - b.Property("Comment") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("Date") - .HasColumnType("datetime(6)"); - - b.Property("EmployeeID") - .HasColumnType("int"); - - b.Property("InTime") - .HasColumnType("datetime(6)"); - - b.Property("IsApproved") - .HasColumnType("tinyint(1)"); - - b.Property("OutTime") - .HasColumnType("datetime(6)"); - - b.Property("ProjectID") - .HasColumnType("int"); - - b.Property("TenantId") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("EmployeeID"); - - b.HasIndex("TenantId"); - - b.ToTable("Attendes"); - }); - - modelBuilder.Entity("Marco.Pms.Model.AttendanceModule.AttendanceLog", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - - b.Property("Activity") - .HasColumnType("int"); - - b.Property("ActivityTime") - .HasColumnType("datetime(6)"); - - b.Property("AttendanceId") - .HasColumnType("int"); - - b.Property("Comment") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("EmployeeID") - .HasColumnType("int"); - - b.Property("Latitude") - .HasColumnType("longtext"); - - b.Property("Longitude") - .HasColumnType("longtext"); - - b.Property("Photo") - .HasColumnType("longblob"); - - b.Property("TenantId") - .HasColumnType("int"); - - b.Property("UpdatedBy") - .HasColumnType("int"); - - b.Property("UpdatedOn") - .HasColumnType("datetime(6)"); - - b.HasKey("Id"); - - b.HasIndex("AttendanceId"); - - b.HasIndex("EmployeeID"); - - b.HasIndex("TenantId"); - - b.HasIndex("UpdatedBy"); - - b.ToTable("AttendanceLogs"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Authentication.RefreshToken", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - - b.Property("CreatedAt") - .HasColumnType("datetime(6)"); - - b.Property("ExpiryDate") - .HasColumnType("datetime(6)"); - - b.Property("IsRevoked") - .HasColumnType("tinyint(1)"); - - b.Property("IsUsed") - .HasColumnType("tinyint(1)"); - - b.Property("RevokedAt") - .HasColumnType("datetime(6)"); - - b.Property("Token") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("UserId") - .IsRequired() - .HasColumnType("varchar(255)"); - - b.HasKey("Id"); - - b.HasIndex("UserId"); - - b.ToTable("RefreshTokens"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Employees.Employee", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - - b.Property("AadharNumber") - .HasColumnType("longtext"); - - b.Property("ApplicationUserId") - .HasColumnType("varchar(255)"); - - b.Property("BirthDate") - .HasColumnType("datetime(6)"); - - b.Property("CurrentAddress") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("Email") - .HasColumnType("longtext"); - - b.Property("EmergencyPhoneNumber") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("FirstName") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("Gender") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("JobRoleId") - .HasColumnType("int"); - - b.Property("LastName") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("MiddleName") - .HasColumnType("longtext"); - - b.Property("PanNumber") - .HasColumnType("longtext"); - - b.Property("PeramnentAddress") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("PhoneNumber") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("Photo") - .HasColumnType("longblob"); - - b.Property("RoleId") - .HasColumnType("char(36)"); - - b.Property("TenantId") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("ApplicationUserId"); - - b.HasIndex("JobRoleId"); - - b.HasIndex("TenantId"); - - b.ToTable("Employees"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Employees.WorkShift", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - - b.Property("EndTime") - .HasColumnType("time(6)"); - - b.Property("Name") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("StartTime") - .HasColumnType("time(6)"); - - b.Property("TenantId") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("TenantId"); - - b.ToTable("WorkShifts"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Entitlements.ActivityMaster", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - - b.Property("ActivityName") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("TaskAllocationId") - .HasColumnType("int"); - - b.Property("TenantId") - .HasColumnType("int"); - - b.Property("UnitOfMeasurement") - .IsRequired() - .HasColumnType("longtext"); - - b.HasKey("Id"); - - b.HasIndex("TaskAllocationId"); - - b.HasIndex("TenantId"); - - b.ToTable("ActivityMasters"); - - b.HasData( - new - { - Id = 1, - ActivityName = "Core Cutting", - TenantId = 1, - UnitOfMeasurement = "Number" - }, - new - { - Id = 2, - ActivityName = "Fabrication", - TenantId = 1, - UnitOfMeasurement = "Meter" - }, - new - { - Id = 3, - ActivityName = "Lifting", - TenantId = 1, - UnitOfMeasurement = "Meter" - }, - new - { - Id = 4, - ActivityName = "Hanging", - TenantId = 1, - UnitOfMeasurement = "Meter" - }, - new - { - Id = 5, - ActivityName = "Tapping", - TenantId = 1, - UnitOfMeasurement = "Meter" - }, - new - { - Id = 6, - ActivityName = "Welding", - TenantId = 1, - UnitOfMeasurement = "Meter" - }, - new - { - Id = 7, - ActivityName = "Testing", - TenantId = 1, - UnitOfMeasurement = "Area" - }, - new - { - Id = 8, - ActivityName = "Painting", - TenantId = 1, - UnitOfMeasurement = "Meter" - }, - new - { - Id = 9, - ActivityName = "Marking Area", - TenantId = 1, - UnitOfMeasurement = "Meter" - }, - new - { - Id = 10, - ActivityName = "Drilling", - TenantId = 1, - UnitOfMeasurement = "Number" - }, - new - { - Id = 11, - ActivityName = "MS Support Fabrication", - TenantId = 1, - UnitOfMeasurement = "Number" - }, - new - { - Id = 12, - ActivityName = "MS Support Hanging", - TenantId = 1, - UnitOfMeasurement = "Number" - }, - new - { - Id = 13, - ActivityName = "Hydrant Volve", - TenantId = 1, - UnitOfMeasurement = "Number" - }, - new - { - Id = 14, - ActivityName = "Sprinkler Installation", - TenantId = 1, - UnitOfMeasurement = "Number" - }); - }); - - modelBuilder.Entity("Marco.Pms.Model.Entitlements.ApplicationRole", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("char(36)"); - - b.Property("Description") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("Role") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("TenantId") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("TenantId"); - - b.ToTable("ApplicationRoles"); - - b.HasData( - new - { - Id = new Guid("2c8d0808-c421-11ef-9b93-0242ac110002"), - Description = "", - Role = "Admin", - TenantId = 1 - }, - new - { - Id = new Guid("62e0918d-c421-11ef-9b93-0242ac110002"), - Description = "", - Role = "Welder", - TenantId = 1 - }, - new - { - Id = new Guid("68823f1f-c421-11ef-9b93-0242ac110002"), - Description = "", - Role = "Helper", - TenantId = 1 - }, - new - { - Id = new Guid("6d3a7c72-c421-11ef-9b93-0242ac110002"), - Description = "", - Role = "Site Engineer", - TenantId = 1 - }, - new - { - Id = new Guid("6d3aad72-c421-11ef-9b93-0242ac110002"), - Description = "", - Role = "Project Manager", - TenantId = 1 - }); - }); - - modelBuilder.Entity("Marco.Pms.Model.Entitlements.EmployeeRoleMapping", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("char(36)"); - - b.Property("EmployeeId") - .HasColumnType("int"); - - b.Property("IsEnabled") - .HasColumnType("tinyint(1)"); - - b.Property("RoleId") - .HasColumnType("char(36)"); - - b.Property("TenantId") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("EmployeeId"); - - b.HasIndex("RoleId"); - - b.HasIndex("TenantId"); - - b.ToTable("EmployeeRoleMappings"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Entitlements.Feature", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("char(36)"); - - b.Property("Description") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("IsActive") - .HasColumnType("tinyint(1)"); - - b.Property("ModuleId") - .HasColumnType("int"); - - b.Property("Name") - .IsRequired() - .HasColumnType("longtext"); - - b.HasKey("Id"); - - b.HasIndex("ModuleId"); - - b.ToTable("Features"); - - b.HasData( - new - { - Id = new Guid("53176ebf-c75d-42e5-839f-4508ffac3def"), - Description = "Manage Project", - IsActive = true, - ModuleId = 1, - Name = "Manage Project" - }, - new - { - Id = new Guid("9666de86-d7c7-4d3d-acaa-fcd6d6b81f3c"), - Description = "Manage Infra", - IsActive = true, - ModuleId = 1, - Name = "Manage Infra" - }, - new - { - Id = new Guid("9d4b5489-2079-40b9-bd77-6e1bf90bc19f"), - Description = "Manage Tasks", - IsActive = true, - ModuleId = 1, - Name = "Manage Tasks" - }, - new - { - Id = new Guid("39e66f81-efc6-446c-95bd-46bff6cfb606"), - Description = "Assign and Update Tasks Progress", - IsActive = true, - ModuleId = 1, - Name = "Assign and Update Tasks Progress" - }, - new - { - Id = new Guid("81ab8a87-8ccd-4015-a917-0627cee6a100"), - Description = "Manage Employee", - IsActive = true, - ModuleId = 2, - Name = "Manage Employee" - }, - new - { - Id = new Guid("52c9cf54-1eb2-44d2-81bb-524cf29c0a94"), - Description = "Attendance", - IsActive = true, - ModuleId = 2, - Name = "Attendance" - }, - new - { - Id = new Guid("be3b3afc-6ccf-4566-b9b6-aafcb65546be"), - Description = "Global Masters", - IsActive = true, - ModuleId = 3, - Name = "Global Masters" - }, - new - { - Id = new Guid("660131a4-788c-4739-a082-cbbf7879cbf2"), - Description = "Tenant Masters", - IsActive = true, - ModuleId = 3, - Name = "Tenant Masters" - }); - }); - - modelBuilder.Entity("Marco.Pms.Model.Entitlements.FeaturePermission", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("char(36)"); - - b.Property("Description") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("FeatureId") - .HasColumnType("char(36)"); - - b.Property("IsEnabled") - .HasColumnType("tinyint(1)"); - - b.Property("Name") - .IsRequired() - .HasColumnType("longtext"); - - b.HasKey("Id"); - - b.HasIndex("FeatureId"); - - b.ToTable("FeaturePermissions"); - - b.HasData( - new - { - Id = new Guid("6ea44136-987e-44ba-9e5d-1cf8f5837ebc"), - Description = "", - FeatureId = new Guid("53176ebf-c75d-42e5-839f-4508ffac3def"), - IsEnabled = true, - Name = "View Project" - }, - new - { - Id = new Guid("172fc9b6-755b-4f62-ab26-55c34a330614"), - Description = "", - FeatureId = new Guid("53176ebf-c75d-42e5-839f-4508ffac3def"), - IsEnabled = true, - Name = "Manage Project" - }, - new - { - Id = new Guid("b94802ce-0689-4643-9e1d-11c86950c35b"), - Description = "", - FeatureId = new Guid("53176ebf-c75d-42e5-839f-4508ffac3def"), - IsEnabled = true, - Name = "Manage Team" - }, - new - { - Id = new Guid("c7b68e33-72f0-474f-bd96-77636427ecc8"), - Description = "", - FeatureId = new Guid("9666de86-d7c7-4d3d-acaa-fcd6d6b81f3c"), - IsEnabled = true, - Name = "View Project Infra" - }, - new - { - Id = new Guid("f2aee20a-b754-4537-8166-f9507b44585b"), - Description = "", - FeatureId = new Guid("9666de86-d7c7-4d3d-acaa-fcd6d6b81f3c"), - IsEnabled = true, - Name = "Manage Project Infra" - }, - new - { - Id = new Guid("9fcc5f87-25e3-4846-90ac-67a71ab92e3c"), - Description = "", - FeatureId = new Guid("9d4b5489-2079-40b9-bd77-6e1bf90bc19f"), - IsEnabled = true, - Name = "View Task" - }, - new - { - Id = new Guid("08752f33-3b29-4816-b76b-ea8a968ed3c5"), - Description = "", - FeatureId = new Guid("9d4b5489-2079-40b9-bd77-6e1bf90bc19f"), - IsEnabled = true, - Name = "Manage Task" - }, - new - { - Id = new Guid("d135a4b0-4f9a-4903-ab9c-4843839ebdee"), - Description = "", - FeatureId = new Guid("39e66f81-efc6-446c-95bd-46bff6cfb606"), - IsEnabled = true, - Name = "Assign Task and Report Progress" - }, - new - { - Id = new Guid("ed99ecd4-1bed-42e1-b7b3-d64c04493823"), - Description = "", - FeatureId = new Guid("39e66f81-efc6-446c-95bd-46bff6cfb606"), - IsEnabled = true, - Name = "Approve Task" - }, - new - { - Id = new Guid("b82d2b7e-0d52-45f3-997b-c008ea460e7f"), - Description = "", - FeatureId = new Guid("81ab8a87-8ccd-4015-a917-0627cee6a100"), - IsEnabled = true, - Name = "View Employee" - }, - new - { - Id = new Guid("a97d366a-c2bb-448d-be93-402bd2324566"), - Description = "", - FeatureId = new Guid("81ab8a87-8ccd-4015-a917-0627cee6a100"), - IsEnabled = true, - Name = "Manage Employee" - }, - new - { - Id = new Guid("fbd213e0-0250-46f1-9f5f-4b2a1e6e76a3"), - Description = "", - FeatureId = new Guid("81ab8a87-8ccd-4015-a917-0627cee6a100"), - IsEnabled = true, - Name = "Assign To Project" - }, - new - { - Id = new Guid("915e6bff-65f6-4e3f-aea8-3fd217d3ea9e"), - Description = "", - FeatureId = new Guid("52c9cf54-1eb2-44d2-81bb-524cf29c0a94"), - IsEnabled = true, - Name = "Perform Attendance " - }, - new - { - Id = new Guid("57802c4a-00aa-4a1f-a048-fd2f70dd44b6"), - Description = "", - FeatureId = new Guid("52c9cf54-1eb2-44d2-81bb-524cf29c0a94"), - IsEnabled = true, - Name = "Regularize Attendance" - }, - new - { - Id = new Guid("5ffbafe0-7ab0-48b1-bb50-c1bf76b65f9d"), - Description = "", - FeatureId = new Guid("be3b3afc-6ccf-4566-b9b6-aafcb65546be"), - IsEnabled = true, - Name = "View Masters" - }, - new - { - Id = new Guid("588a8824-f924-4955-82d8-fc51956cf323"), - Description = "", - FeatureId = new Guid("be3b3afc-6ccf-4566-b9b6-aafcb65546be"), - IsEnabled = true, - Name = "Manage Masters" - }, - new - { - Id = new Guid("cb8ec407-46d4-4467-930c-69127cda6dec"), - Description = "", - FeatureId = new Guid("660131a4-788c-4739-a082-cbbf7879cbf2"), - IsEnabled = true, - Name = "View Masters" - }, - new - { - Id = new Guid("6b1a6d97-a951-4de5-9b19-709bac7c4f18"), - Description = "", - FeatureId = new Guid("660131a4-788c-4739-a082-cbbf7879cbf2"), - IsEnabled = true, - Name = "Manage Masters" - }); - }); - - modelBuilder.Entity("Marco.Pms.Model.Entitlements.JobRole", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - - b.Property("Description") - .HasColumnType("longtext"); - - b.Property("Name") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("TenantId") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("TenantId"); - - b.ToTable("JobRoles"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Entitlements.Module", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - - b.Property("Description") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("Key") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("Name") - .IsRequired() - .HasColumnType("longtext"); - - b.HasKey("Id"); - - b.ToTable("Modules"); - - b.HasData( - new - { - Id = 1, - Description = "Project Module", - Key = "6962167a-70de-4e3d-961d-14cfe676ef22", - Name = "Project" - }, - new - { - Id = 2, - Description = "Employee Module", - Key = "d8d0ed22-ce17-4a73-b507-307c43c08b57", - Name = "Employee" - }, - new - { - Id = 3, - Description = "Masters Module", - Key = "3c0463c6-2842-43ac-b7d3-ca74b26c74a6", - Name = "Masters" - }); - }); - - modelBuilder.Entity("Marco.Pms.Model.Entitlements.RolePermissionMappings", b => - { - b.Property("ApplicationRoleId") - .HasColumnType("char(36)"); - - b.Property("FeaturePermissionId") - .HasColumnType("char(36)"); - - b.HasKey("ApplicationRoleId", "FeaturePermissionId"); - - b.HasIndex("FeaturePermissionId"); - - b.ToTable("RolePermissionMappings"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Entitlements.StatusMaster", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - - b.Property("Status") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("TenantId") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("TenantId"); - - b.ToTable("StatusMasters"); - - b.HasData( - new - { - Id = 1, - Status = "Active", - TenantId = 1 - }, - new - { - Id = 2, - Status = "In Progress", - TenantId = 1 - }, - new - { - Id = 3, - Status = "On Hold", - TenantId = 1 - }, - new - { - Id = 4, - Status = "Completed", - TenantId = 1 - }); - }); - - modelBuilder.Entity("Marco.Pms.Model.Entitlements.Tenant", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - - b.Property("ContactName") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("ContactNumber") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("Description") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("DomainName") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("Name") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("OnBoardingDate") - .HasColumnType("datetime(6)"); - - b.HasKey("Id"); - - b.ToTable("Tenants"); - - b.HasData( - new - { - Id = 1, - ContactName = "Admin", - ContactNumber = "123456789", - Description = "", - DomainName = "www.marcobms.org", - Name = "MarcoBMS", - OnBoardingDate = new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified) - }); - }); - - modelBuilder.Entity("Marco.Pms.Model.Projects.Building", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - - b.Property("Description") - .HasColumnType("longtext"); - - b.Property("Name") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("ProjectId") - .HasColumnType("int"); - - b.Property("TenantId") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("TenantId"); - - b.ToTable("Buildings"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Projects.Floor", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - - b.Property("BuildingId") - .HasColumnType("int"); - - b.Property("FloorName") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("TenantId") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("BuildingId"); - - b.HasIndex("TenantId"); - - b.ToTable("Floor"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Projects.Project", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - - b.Property("ContactPerson") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("EndDate") - .HasColumnType("datetime(6)"); - - b.Property("Name") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("ProjectAddress") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("ProjectStatusId") - .HasColumnType("int"); - - b.Property("StartDate") - .HasColumnType("datetime(6)"); - - b.Property("TenantId") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("ProjectStatusId"); - - b.HasIndex("TenantId"); - - b.ToTable("Projects"); - - b.HasData( - new - { - Id = 1, - ContactPerson = "Project 1 Contact Person", - Name = "Project 1", - ProjectAddress = "Project 1 Address", - ProjectStatusId = 1, - TenantId = 1 - }, - new - { - Id = 2, - ContactPerson = "Project 2 Contact Person", - Name = "Project 2", - ProjectAddress = "Project 2 Address", - ProjectStatusId = 2, - TenantId = 1 - }, - new - { - Id = 3, - ContactPerson = "Project 3 Contact Person", - Name = "Project 3", - ProjectAddress = "Project 3 Address", - ProjectStatusId = 3, - TenantId = 1 - }); - }); - - modelBuilder.Entity("Marco.Pms.Model.Projects.ProjectAllocation", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - - b.Property("AllocationDate") - .HasColumnType("datetime(6)"); - - b.Property("EmployeeId") - .HasColumnType("int"); - - b.Property("EmployeeRoleId") - .HasColumnType("char(36)"); - - b.Property("ProjectId") - .HasColumnType("int"); - - b.Property("ReAllocationDate") - .HasColumnType("datetime(6)"); - - b.Property("TenantId") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("EmployeeId"); - - b.HasIndex("ProjectId"); - - b.HasIndex("TenantId"); - - b.ToTable("ProjectAllocations"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Projects.WorkArea", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - - b.Property("AreaName") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("FloorId") - .HasColumnType("int"); - - b.Property("TenantId") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("FloorId"); - - b.HasIndex("TenantId"); - - b.ToTable("WorkAreas"); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRole", b => - { - b.Property("Id") - .HasColumnType("varchar(255)"); - - b.Property("ConcurrencyStamp") - .IsConcurrencyToken() - .HasColumnType("longtext"); - - b.Property("Name") - .HasMaxLength(256) - .HasColumnType("varchar(256)"); - - b.Property("NormalizedName") - .HasMaxLength(256) - .HasColumnType("varchar(256)"); - - b.HasKey("Id"); - - b.HasIndex("NormalizedName") - .IsUnique() - .HasDatabaseName("RoleNameIndex"); - - b.ToTable("AspNetRoles", (string)null); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - - b.Property("ClaimType") - .HasColumnType("longtext"); - - b.Property("ClaimValue") - .HasColumnType("longtext"); - - b.Property("RoleId") - .IsRequired() - .HasColumnType("varchar(255)"); - - b.HasKey("Id"); - - b.HasIndex("RoleId"); - - b.ToTable("AspNetRoleClaims", (string)null); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUser", b => - { - b.Property("Id") - .HasColumnType("varchar(255)"); - - b.Property("AccessFailedCount") - .HasColumnType("int"); - - b.Property("ConcurrencyStamp") - .IsConcurrencyToken() - .HasColumnType("longtext"); - - b.Property("Discriminator") - .IsRequired() - .HasMaxLength(21) - .HasColumnType("varchar(21)"); - - b.Property("Email") - .HasMaxLength(256) - .HasColumnType("varchar(256)"); - - b.Property("EmailConfirmed") - .HasColumnType("tinyint(1)"); - - b.Property("LockoutEnabled") - .HasColumnType("tinyint(1)"); - - b.Property("LockoutEnd") - .HasColumnType("datetime(6)"); - - b.Property("NormalizedEmail") - .HasMaxLength(256) - .HasColumnType("varchar(256)"); - - b.Property("NormalizedUserName") - .HasMaxLength(256) - .HasColumnType("varchar(256)"); - - b.Property("PasswordHash") - .HasColumnType("longtext"); - - b.Property("PhoneNumber") - .HasColumnType("longtext"); - - b.Property("PhoneNumberConfirmed") - .HasColumnType("tinyint(1)"); - - b.Property("SecurityStamp") - .HasColumnType("longtext"); - - b.Property("TwoFactorEnabled") - .HasColumnType("tinyint(1)"); - - b.Property("UserName") - .HasMaxLength(256) - .HasColumnType("varchar(256)"); - - b.HasKey("Id"); - - b.HasIndex("NormalizedEmail") - .HasDatabaseName("EmailIndex"); - - b.HasIndex("NormalizedUserName") - .IsUnique() - .HasDatabaseName("UserNameIndex"); - - b.ToTable("AspNetUsers", (string)null); - - b.HasDiscriminator().HasValue("IdentityUser"); - - b.UseTphMappingStrategy(); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - - b.Property("ClaimType") - .HasColumnType("longtext"); - - b.Property("ClaimValue") - .HasColumnType("longtext"); - - b.Property("UserId") - .IsRequired() - .HasColumnType("varchar(255)"); - - b.HasKey("Id"); - - b.HasIndex("UserId"); - - b.ToTable("AspNetUserClaims", (string)null); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin", b => - { - b.Property("LoginProvider") - .HasColumnType("varchar(255)"); - - b.Property("ProviderKey") - .HasColumnType("varchar(255)"); - - b.Property("ProviderDisplayName") - .HasColumnType("longtext"); - - b.Property("UserId") - .IsRequired() - .HasColumnType("varchar(255)"); - - b.HasKey("LoginProvider", "ProviderKey"); - - b.HasIndex("UserId"); - - b.ToTable("AspNetUserLogins", (string)null); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole", b => - { - b.Property("UserId") - .HasColumnType("varchar(255)"); - - b.Property("RoleId") - .HasColumnType("varchar(255)"); - - b.HasKey("UserId", "RoleId"); - - b.HasIndex("RoleId"); - - b.ToTable("AspNetUserRoles", (string)null); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken", b => - { - b.Property("UserId") - .HasColumnType("varchar(255)"); - - b.Property("LoginProvider") - .HasColumnType("varchar(255)"); - - b.Property("Name") - .HasColumnType("varchar(255)"); - - b.Property("Value") - .HasColumnType("longtext"); - - b.HasKey("UserId", "LoginProvider", "Name"); - - b.ToTable("AspNetUserTokens", (string)null); - }); - - modelBuilder.Entity("Marco.Pms.Model.Entitlements.ApplicationUser", b => - { - b.HasBaseType("Microsoft.AspNetCore.Identity.IdentityUser"); - - b.Property("IsRootUser") - .HasColumnType("tinyint(1)"); - - b.Property("Role") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("TenantId") - .HasColumnType("int"); - - b.HasDiscriminator().HasValue("ApplicationUser"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Activities.TaskAllocation", b => - { - b.HasOne("Marco.Pms.Model.Projects.Building", "Building") - .WithMany() - .HasForeignKey("BuildingId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Marco.Pms.Model.Employees.Employee", "Employee") - .WithMany() - .HasForeignKey("EmployeeId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Marco.Pms.Model.Projects.Project", "Project") - .WithMany() - .HasForeignKey("ProjectId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Marco.Pms.Model.Entitlements.Tenant", "Tenant") - .WithMany() - .HasForeignKey("TenantId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Marco.Pms.Model.Projects.WorkArea", "WorkArea") - .WithMany() - .HasForeignKey("WorkAreaId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Building"); - - b.Navigation("Employee"); - - b.Navigation("Project"); - - b.Navigation("Tenant"); - - b.Navigation("WorkArea"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Activities.WorkItem", b => - { - b.HasOne("Marco.Pms.Model.Entitlements.ActivityMaster", "ActivityMaster") - .WithMany() - .HasForeignKey("ActivityId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Marco.Pms.Model.Entitlements.Tenant", "Tenant") - .WithMany() - .HasForeignKey("TenantId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Marco.Pms.Model.Projects.WorkArea", "WorkArea") - .WithMany() - .HasForeignKey("WorkAreaId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("ActivityMaster"); - - b.Navigation("Tenant"); - - b.Navigation("WorkArea"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Activities.WorkItemMapping", b => - { - b.HasOne("Marco.Pms.Model.Entitlements.Tenant", "Tenant") - .WithMany() - .HasForeignKey("TenantId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Marco.Pms.Model.Projects.WorkArea", "WorkArea") - .WithMany() - .HasForeignKey("WorkAreaId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Marco.Pms.Model.Activities.WorkItem", "WorkItem") - .WithMany() - .HasForeignKey("WorkItemId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Tenant"); - - b.Navigation("WorkArea"); - - b.Navigation("WorkItem"); - }); - - modelBuilder.Entity("Marco.Pms.Model.AttendanceModule.Attendance", b => - { - b.HasOne("Marco.Pms.Model.Employees.Employee", "Approver") - .WithMany() - .HasForeignKey("EmployeeID") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Marco.Pms.Model.Entitlements.Tenant", "Tenant") - .WithMany() - .HasForeignKey("TenantId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Approver"); - - b.Navigation("Tenant"); - }); - - modelBuilder.Entity("Marco.Pms.Model.AttendanceModule.AttendanceLog", b => - { - b.HasOne("Marco.Pms.Model.AttendanceModule.Attendance", "Attendance") - .WithMany() - .HasForeignKey("AttendanceId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Marco.Pms.Model.Employees.Employee", "Employee") - .WithMany() - .HasForeignKey("EmployeeID") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Marco.Pms.Model.Entitlements.Tenant", "Tenant") - .WithMany() - .HasForeignKey("TenantId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Marco.Pms.Model.Employees.Employee", "UpdatedByEmployee") - .WithMany() - .HasForeignKey("UpdatedBy"); - - b.Navigation("Attendance"); - - b.Navigation("Employee"); - - b.Navigation("Tenant"); - - b.Navigation("UpdatedByEmployee"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Authentication.RefreshToken", b => - { - b.HasOne("Microsoft.AspNetCore.Identity.IdentityUser", "User") - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("User"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Employees.Employee", b => - { - b.HasOne("Marco.Pms.Model.Entitlements.ApplicationUser", "ApplicationUser") - .WithMany() - .HasForeignKey("ApplicationUserId"); - - b.HasOne("Marco.Pms.Model.Entitlements.JobRole", "JobRole") - .WithMany() - .HasForeignKey("JobRoleId"); - - b.HasOne("Marco.Pms.Model.Entitlements.Tenant", "Tenant") - .WithMany() - .HasForeignKey("TenantId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("ApplicationUser"); - - b.Navigation("JobRole"); - - b.Navigation("Tenant"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Employees.WorkShift", b => - { - b.HasOne("Marco.Pms.Model.Entitlements.Tenant", "Tenant") - .WithMany() - .HasForeignKey("TenantId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Tenant"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Entitlements.ActivityMaster", b => - { - b.HasOne("Marco.Pms.Model.Activities.TaskAllocation", null) - .WithMany("AllotedTask") - .HasForeignKey("TaskAllocationId"); - - b.HasOne("Marco.Pms.Model.Entitlements.Tenant", "Tenant") - .WithMany() - .HasForeignKey("TenantId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Tenant"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Entitlements.ApplicationRole", b => - { - b.HasOne("Marco.Pms.Model.Entitlements.Tenant", null) - .WithMany() - .HasForeignKey("TenantId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Marco.Pms.Model.Entitlements.EmployeeRoleMapping", b => - { - b.HasOne("Marco.Pms.Model.Employees.Employee", "Employee") - .WithMany() - .HasForeignKey("EmployeeId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Marco.Pms.Model.Entitlements.ApplicationRole", "Role") - .WithMany() - .HasForeignKey("RoleId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Marco.Pms.Model.Entitlements.Tenant", "Tenant") - .WithMany() - .HasForeignKey("TenantId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Employee"); - - b.Navigation("Role"); - - b.Navigation("Tenant"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Entitlements.Feature", b => - { - b.HasOne("Marco.Pms.Model.Entitlements.Module", "Module") - .WithMany() - .HasForeignKey("ModuleId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Module"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Entitlements.FeaturePermission", b => - { - b.HasOne("Marco.Pms.Model.Entitlements.Feature", "Feature") - .WithMany("FeaturePermissions") - .HasForeignKey("FeatureId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Feature"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Entitlements.JobRole", b => - { - b.HasOne("Marco.Pms.Model.Entitlements.Tenant", "Tenant") - .WithMany() - .HasForeignKey("TenantId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Tenant"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Entitlements.RolePermissionMappings", b => - { - b.HasOne("Marco.Pms.Model.Entitlements.ApplicationRole", null) - .WithMany() - .HasForeignKey("ApplicationRoleId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Marco.Pms.Model.Entitlements.FeaturePermission", null) - .WithMany() - .HasForeignKey("FeaturePermissionId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Marco.Pms.Model.Entitlements.StatusMaster", b => - { - b.HasOne("Marco.Pms.Model.Entitlements.Tenant", "Tenant") - .WithMany() - .HasForeignKey("TenantId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Tenant"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Projects.Building", b => - { - b.HasOne("Marco.Pms.Model.Entitlements.Tenant", "Tenant") - .WithMany() - .HasForeignKey("TenantId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Tenant"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Projects.Floor", b => - { - b.HasOne("Marco.Pms.Model.Projects.Building", "Building") - .WithMany() - .HasForeignKey("BuildingId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Marco.Pms.Model.Entitlements.Tenant", "Tenant") - .WithMany() - .HasForeignKey("TenantId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Building"); - - b.Navigation("Tenant"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Projects.Project", b => - { - b.HasOne("Marco.Pms.Model.Entitlements.StatusMaster", "ProjectStatus") - .WithMany() - .HasForeignKey("ProjectStatusId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Marco.Pms.Model.Entitlements.Tenant", "Tenant") - .WithMany() - .HasForeignKey("TenantId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("ProjectStatus"); - - b.Navigation("Tenant"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Projects.ProjectAllocation", b => - { - b.HasOne("Marco.Pms.Model.Employees.Employee", "Employee") - .WithMany() - .HasForeignKey("EmployeeId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Marco.Pms.Model.Projects.Project", "Project") - .WithMany() - .HasForeignKey("ProjectId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Marco.Pms.Model.Entitlements.Tenant", "Tenant") - .WithMany() - .HasForeignKey("TenantId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Employee"); - - b.Navigation("Project"); - - b.Navigation("Tenant"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Projects.WorkArea", b => - { - b.HasOne("Marco.Pms.Model.Projects.Floor", "Floor") - .WithMany() - .HasForeignKey("FloorId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Marco.Pms.Model.Entitlements.Tenant", "Tenant") - .WithMany() - .HasForeignKey("TenantId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Floor"); - - b.Navigation("Tenant"); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim", b => - { - b.HasOne("Microsoft.AspNetCore.Identity.IdentityRole", null) - .WithMany() - .HasForeignKey("RoleId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim", b => - { - b.HasOne("Microsoft.AspNetCore.Identity.IdentityUser", null) - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin", b => - { - b.HasOne("Microsoft.AspNetCore.Identity.IdentityUser", null) - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole", b => - { - b.HasOne("Microsoft.AspNetCore.Identity.IdentityRole", null) - .WithMany() - .HasForeignKey("RoleId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Microsoft.AspNetCore.Identity.IdentityUser", null) - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken", b => - { - b.HasOne("Microsoft.AspNetCore.Identity.IdentityUser", null) - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Marco.Pms.Model.Activities.TaskAllocation", b => - { - b.Navigation("AllotedTask"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Entitlements.Feature", b => - { - b.Navigation("FeaturePermissions"); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/Marco.Pms.DataAccess/Migrations/20250303085119_attendrename.cs b/Marco.Pms.DataAccess/Migrations/20250303085119_attendrename.cs deleted file mode 100644 index 0ef5490..0000000 --- a/Marco.Pms.DataAccess/Migrations/20250303085119_attendrename.cs +++ /dev/null @@ -1,117 +0,0 @@ -using Microsoft.EntityFrameworkCore.Migrations; - -#nullable disable - -namespace Marco.Pms.DataAccess.Migrations -{ - /// - public partial class attendrename : Migration - { - /// - protected override void Up(MigrationBuilder migrationBuilder) - { - - migrationBuilder.DropForeignKey( - name: "FK_AttendanceLogs_Attendance_AttendanceId", - table: "AttendanceLogs"); - - - migrationBuilder.DropTable( - name: "Attendance"); - - - migrationBuilder.AddForeignKey( - name: "FK_AttendanceLogs_Attendes_AttendanceId", - table: "AttendanceLogs", - column: "AttendanceId", - principalTable: "Attendes", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); - - } - - /// - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropForeignKey( - name: "FK_AttendanceLogs_Attendes_AttendanceId", - table: "AttendanceLogs"); - - migrationBuilder.DropForeignKey( - name: "FK_Attendes_Employees_EmployeeID", - table: "Attendes"); - - migrationBuilder.DropForeignKey( - name: "FK_Attendes_Tenants_TenantId", - table: "Attendes"); - - migrationBuilder.DropPrimaryKey( - name: "PK_Attendes", - table: "Attendes"); - - migrationBuilder.RenameTable( - name: "Attendes", - newName: "Attendances"); - - migrationBuilder.RenameIndex( - name: "IX_Attendes_TenantId", - table: "Attendances", - newName: "IX_Attendances_TenantId"); - - migrationBuilder.RenameIndex( - name: "IX_Attendes_EmployeeID", - table: "Attendances", - newName: "IX_Attendances_EmployeeID"); - - migrationBuilder.AddPrimaryKey( - name: "PK_Attendances", - table: "Attendances", - column: "Id"); - - migrationBuilder.UpdateData( - table: "Modules", - keyColumn: "Id", - keyValue: 1, - column: "Key", - value: "02f1b9b7-9cc5-4822-8090-362ca9b61a8e"); - - migrationBuilder.UpdateData( - table: "Modules", - keyColumn: "Id", - keyValue: 2, - column: "Key", - value: "b9005cdc-0d10-4110-9e42-1d7117b68cd3"); - - migrationBuilder.UpdateData( - table: "Modules", - keyColumn: "Id", - keyValue: 3, - column: "Key", - value: "6df40548-5543-4066-aab4-5f340015b731"); - - migrationBuilder.AddForeignKey( - name: "FK_AttendanceLogs_Attendances_AttendanceId", - table: "AttendanceLogs", - column: "AttendanceId", - principalTable: "Attendances", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); - - migrationBuilder.AddForeignKey( - name: "FK_Attendances_Employees_EmployeeID", - table: "Attendances", - column: "EmployeeID", - principalTable: "Employees", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); - - migrationBuilder.AddForeignKey( - name: "FK_Attendances_Tenants_TenantId", - table: "Attendances", - column: "TenantId", - principalTable: "Tenants", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); - } - } -} diff --git a/Marco.Pms.DataAccess/Migrations/20250311072410_addIsActiveToProjectAllocation.Designer.cs b/Marco.Pms.DataAccess/Migrations/20250311072410_addIsActiveToProjectAllocation.Designer.cs deleted file mode 100644 index 4de4b2b..0000000 --- a/Marco.Pms.DataAccess/Migrations/20250311072410_addIsActiveToProjectAllocation.Designer.cs +++ /dev/null @@ -1,1936 +0,0 @@ -// -using System; -using Marco.Pms.DataAccess.Data; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Metadata; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; - -#nullable disable - -namespace Marco.Pms.DataAccess.Migrations -{ - [DbContext(typeof(ApplicationDbContext))] - [Migration("20250311072410_addIsActiveToProjectAllocation")] - partial class addIsActiveToProjectAllocation - { - /// - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasAnnotation("ProductVersion", "8.0.12") - .HasAnnotation("Relational:MaxIdentifierLength", 64); - - // MySqlModelBuilderExtensions.AutoIncrementColumns(modelBuilder); - - modelBuilder.Entity("Marco.Pms.Model.Activities.TaskAllocation", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - - b.Property("AllocationDate") - .HasColumnType("datetime(6)"); - - b.Property("BuildingId") - .HasColumnType("int"); - - b.Property("EmployeeId") - .HasColumnType("int"); - - b.Property("EmployeeRole") - .HasColumnType("int"); - - b.Property("ProjectId") - .HasColumnType("int"); - - b.Property("ReAllocationDate") - .HasColumnType("datetime(6)"); - - b.Property("TenantId") - .HasColumnType("int"); - - b.Property("WorkAreaId") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("BuildingId"); - - b.HasIndex("EmployeeId"); - - b.HasIndex("ProjectId"); - - b.HasIndex("TenantId"); - - b.HasIndex("WorkAreaId"); - - b.ToTable("TaskAllocations"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Activities.WorkItem", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - - b.Property("ActivityId") - .HasColumnType("int"); - - b.Property("CompletedWork") - .HasColumnType("int"); - - b.Property("PlannedWork") - .HasColumnType("int"); - - b.Property("TaskDate") - .HasColumnType("datetime(6)"); - - b.Property("TenantId") - .HasColumnType("int"); - - b.Property("WorkAreaId") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("ActivityId"); - - b.HasIndex("TenantId"); - - b.HasIndex("WorkAreaId"); - - b.ToTable("WorkItems"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Activities.WorkItemMapping", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - - b.Property("TenantId") - .HasColumnType("int"); - - b.Property("WorkAreaId") - .HasColumnType("int"); - - b.Property("WorkItemId") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("TenantId"); - - b.HasIndex("WorkAreaId"); - - b.HasIndex("WorkItemId"); - - b.ToTable("WorkItemMapping"); - }); - - modelBuilder.Entity("Marco.Pms.Model.AttendanceModule.Attendance", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - - b.Property("Activity") - .HasColumnType("int"); - - b.Property("ApprovedBy") - .HasColumnType("int"); - - b.Property("AttendanceDate") - .HasColumnType("datetime(6)"); - - b.Property("Comment") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("Date") - .HasColumnType("datetime(6)"); - - b.Property("EmployeeID") - .HasColumnType("int"); - - b.Property("InTime") - .HasColumnType("datetime(6)"); - - b.Property("IsApproved") - .HasColumnType("tinyint(1)"); - - b.Property("OutTime") - .HasColumnType("datetime(6)"); - - b.Property("ProjectID") - .HasColumnType("int"); - - b.Property("TenantId") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("EmployeeID"); - - b.HasIndex("TenantId"); - - b.ToTable("Attendes"); - }); - - modelBuilder.Entity("Marco.Pms.Model.AttendanceModule.AttendanceLog", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - - b.Property("Activity") - .HasColumnType("int"); - - b.Property("ActivityTime") - .HasColumnType("datetime(6)"); - - b.Property("AttendanceId") - .HasColumnType("int"); - - b.Property("Comment") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("EmployeeID") - .HasColumnType("int"); - - b.Property("Latitude") - .HasColumnType("longtext"); - - b.Property("Longitude") - .HasColumnType("longtext"); - - b.Property("Photo") - .HasColumnType("longblob"); - - b.Property("TenantId") - .HasColumnType("int"); - - b.Property("UpdatedBy") - .HasColumnType("int"); - - b.Property("UpdatedOn") - .HasColumnType("datetime(6)"); - - b.HasKey("Id"); - - b.HasIndex("AttendanceId"); - - b.HasIndex("EmployeeID"); - - b.HasIndex("TenantId"); - - b.HasIndex("UpdatedBy"); - - b.ToTable("AttendanceLogs"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Authentication.RefreshToken", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - - b.Property("CreatedAt") - .HasColumnType("datetime(6)"); - - b.Property("ExpiryDate") - .HasColumnType("datetime(6)"); - - b.Property("IsRevoked") - .HasColumnType("tinyint(1)"); - - b.Property("IsUsed") - .HasColumnType("tinyint(1)"); - - b.Property("RevokedAt") - .HasColumnType("datetime(6)"); - - b.Property("Token") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("UserId") - .IsRequired() - .HasColumnType("varchar(255)"); - - b.HasKey("Id"); - - b.HasIndex("UserId"); - - b.ToTable("RefreshTokens"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Employees.Employee", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - - b.Property("AadharNumber") - .HasColumnType("longtext"); - - b.Property("ApplicationUserId") - .HasColumnType("varchar(255)"); - - b.Property("BirthDate") - .HasColumnType("datetime(6)"); - - b.Property("CurrentAddress") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("Email") - .HasColumnType("longtext"); - - b.Property("EmergencyPhoneNumber") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("FirstName") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("Gender") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("JobRoleId") - .HasColumnType("int"); - - b.Property("LastName") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("MiddleName") - .HasColumnType("longtext"); - - b.Property("PanNumber") - .HasColumnType("longtext"); - - b.Property("PeramnentAddress") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("PhoneNumber") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("Photo") - .HasColumnType("longblob"); - - b.Property("RoleId") - .HasColumnType("char(36)"); - - b.Property("TenantId") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("ApplicationUserId"); - - b.HasIndex("JobRoleId"); - - b.HasIndex("TenantId"); - - b.ToTable("Employees"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Employees.WorkShift", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - - b.Property("EndTime") - .HasColumnType("time(6)"); - - b.Property("Name") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("StartTime") - .HasColumnType("time(6)"); - - b.Property("TenantId") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("TenantId"); - - b.ToTable("WorkShifts"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Entitlements.ActivityMaster", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - - b.Property("ActivityName") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("TaskAllocationId") - .HasColumnType("int"); - - b.Property("TenantId") - .HasColumnType("int"); - - b.Property("UnitOfMeasurement") - .IsRequired() - .HasColumnType("longtext"); - - b.HasKey("Id"); - - b.HasIndex("TaskAllocationId"); - - b.HasIndex("TenantId"); - - b.ToTable("ActivityMasters"); - - b.HasData( - new - { - Id = 1, - ActivityName = "Core Cutting", - TenantId = 1, - UnitOfMeasurement = "Number" - }, - new - { - Id = 2, - ActivityName = "Fabrication", - TenantId = 1, - UnitOfMeasurement = "Meter" - }, - new - { - Id = 3, - ActivityName = "Lifting", - TenantId = 1, - UnitOfMeasurement = "Meter" - }, - new - { - Id = 4, - ActivityName = "Hanging", - TenantId = 1, - UnitOfMeasurement = "Meter" - }, - new - { - Id = 5, - ActivityName = "Tapping", - TenantId = 1, - UnitOfMeasurement = "Meter" - }, - new - { - Id = 6, - ActivityName = "Welding", - TenantId = 1, - UnitOfMeasurement = "Meter" - }, - new - { - Id = 7, - ActivityName = "Testing", - TenantId = 1, - UnitOfMeasurement = "Area" - }, - new - { - Id = 8, - ActivityName = "Painting", - TenantId = 1, - UnitOfMeasurement = "Meter" - }, - new - { - Id = 9, - ActivityName = "Marking Area", - TenantId = 1, - UnitOfMeasurement = "Meter" - }, - new - { - Id = 10, - ActivityName = "Drilling", - TenantId = 1, - UnitOfMeasurement = "Number" - }, - new - { - Id = 11, - ActivityName = "MS Support Fabrication", - TenantId = 1, - UnitOfMeasurement = "Number" - }, - new - { - Id = 12, - ActivityName = "MS Support Hanging", - TenantId = 1, - UnitOfMeasurement = "Number" - }, - new - { - Id = 13, - ActivityName = "Hydrant Volve", - TenantId = 1, - UnitOfMeasurement = "Number" - }, - new - { - Id = 14, - ActivityName = "Sprinkler Installation", - TenantId = 1, - UnitOfMeasurement = "Number" - }); - }); - - modelBuilder.Entity("Marco.Pms.Model.Entitlements.ApplicationRole", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("char(36)"); - - b.Property("Description") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("Role") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("TenantId") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("TenantId"); - - b.ToTable("ApplicationRoles"); - - b.HasData( - new - { - Id = new Guid("2c8d0808-c421-11ef-9b93-0242ac110002"), - Description = "", - Role = "Admin", - TenantId = 1 - }, - new - { - Id = new Guid("62e0918d-c421-11ef-9b93-0242ac110002"), - Description = "", - Role = "Welder", - TenantId = 1 - }, - new - { - Id = new Guid("68823f1f-c421-11ef-9b93-0242ac110002"), - Description = "", - Role = "Helper", - TenantId = 1 - }, - new - { - Id = new Guid("6d3a7c72-c421-11ef-9b93-0242ac110002"), - Description = "", - Role = "Site Engineer", - TenantId = 1 - }, - new - { - Id = new Guid("6d3aad72-c421-11ef-9b93-0242ac110002"), - Description = "", - Role = "Project Manager", - TenantId = 1 - }); - }); - - modelBuilder.Entity("Marco.Pms.Model.Entitlements.EmployeeRoleMapping", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("char(36)"); - - b.Property("EmployeeId") - .HasColumnType("int"); - - b.Property("IsEnabled") - .HasColumnType("tinyint(1)"); - - b.Property("RoleId") - .HasColumnType("char(36)"); - - b.Property("TenantId") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("EmployeeId"); - - b.HasIndex("RoleId"); - - b.HasIndex("TenantId"); - - b.ToTable("EmployeeRoleMappings"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Entitlements.Feature", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("char(36)"); - - b.Property("Description") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("IsActive") - .HasColumnType("tinyint(1)"); - - b.Property("ModuleId") - .HasColumnType("int"); - - b.Property("Name") - .IsRequired() - .HasColumnType("longtext"); - - b.HasKey("Id"); - - b.HasIndex("ModuleId"); - - b.ToTable("Features"); - - b.HasData( - new - { - Id = new Guid("53176ebf-c75d-42e5-839f-4508ffac3def"), - Description = "Manage Project", - IsActive = true, - ModuleId = 1, - Name = "Manage Project" - }, - new - { - Id = new Guid("9666de86-d7c7-4d3d-acaa-fcd6d6b81f3c"), - Description = "Manage Infra", - IsActive = true, - ModuleId = 1, - Name = "Manage Infra" - }, - new - { - Id = new Guid("9d4b5489-2079-40b9-bd77-6e1bf90bc19f"), - Description = "Manage Tasks", - IsActive = true, - ModuleId = 1, - Name = "Manage Tasks" - }, - new - { - Id = new Guid("39e66f81-efc6-446c-95bd-46bff6cfb606"), - Description = "Assign and Update Tasks Progress", - IsActive = true, - ModuleId = 1, - Name = "Assign and Update Tasks Progress" - }, - new - { - Id = new Guid("81ab8a87-8ccd-4015-a917-0627cee6a100"), - Description = "Manage Employee", - IsActive = true, - ModuleId = 2, - Name = "Manage Employee" - }, - new - { - Id = new Guid("52c9cf54-1eb2-44d2-81bb-524cf29c0a94"), - Description = "Attendance", - IsActive = true, - ModuleId = 2, - Name = "Attendance" - }, - new - { - Id = new Guid("be3b3afc-6ccf-4566-b9b6-aafcb65546be"), - Description = "Global Masters", - IsActive = true, - ModuleId = 3, - Name = "Global Masters" - }, - new - { - Id = new Guid("660131a4-788c-4739-a082-cbbf7879cbf2"), - Description = "Tenant Masters", - IsActive = true, - ModuleId = 3, - Name = "Tenant Masters" - }); - }); - - modelBuilder.Entity("Marco.Pms.Model.Entitlements.FeaturePermission", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("char(36)"); - - b.Property("Description") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("FeatureId") - .HasColumnType("char(36)"); - - b.Property("IsEnabled") - .HasColumnType("tinyint(1)"); - - b.Property("Name") - .IsRequired() - .HasColumnType("longtext"); - - b.HasKey("Id"); - - b.HasIndex("FeatureId"); - - b.ToTable("FeaturePermissions"); - - b.HasData( - new - { - Id = new Guid("6ea44136-987e-44ba-9e5d-1cf8f5837ebc"), - Description = "", - FeatureId = new Guid("53176ebf-c75d-42e5-839f-4508ffac3def"), - IsEnabled = true, - Name = "View Project" - }, - new - { - Id = new Guid("172fc9b6-755b-4f62-ab26-55c34a330614"), - Description = "", - FeatureId = new Guid("53176ebf-c75d-42e5-839f-4508ffac3def"), - IsEnabled = true, - Name = "Manage Project" - }, - new - { - Id = new Guid("b94802ce-0689-4643-9e1d-11c86950c35b"), - Description = "", - FeatureId = new Guid("53176ebf-c75d-42e5-839f-4508ffac3def"), - IsEnabled = true, - Name = "Manage Team" - }, - new - { - Id = new Guid("c7b68e33-72f0-474f-bd96-77636427ecc8"), - Description = "", - FeatureId = new Guid("9666de86-d7c7-4d3d-acaa-fcd6d6b81f3c"), - IsEnabled = true, - Name = "View Project Infra" - }, - new - { - Id = new Guid("f2aee20a-b754-4537-8166-f9507b44585b"), - Description = "", - FeatureId = new Guid("9666de86-d7c7-4d3d-acaa-fcd6d6b81f3c"), - IsEnabled = true, - Name = "Manage Project Infra" - }, - new - { - Id = new Guid("9fcc5f87-25e3-4846-90ac-67a71ab92e3c"), - Description = "", - FeatureId = new Guid("9d4b5489-2079-40b9-bd77-6e1bf90bc19f"), - IsEnabled = true, - Name = "View Task" - }, - new - { - Id = new Guid("08752f33-3b29-4816-b76b-ea8a968ed3c5"), - Description = "", - FeatureId = new Guid("9d4b5489-2079-40b9-bd77-6e1bf90bc19f"), - IsEnabled = true, - Name = "Manage Task" - }, - new - { - Id = new Guid("d135a4b0-4f9a-4903-ab9c-4843839ebdee"), - Description = "", - FeatureId = new Guid("39e66f81-efc6-446c-95bd-46bff6cfb606"), - IsEnabled = true, - Name = "Assign Task and Report Progress" - }, - new - { - Id = new Guid("ed99ecd4-1bed-42e1-b7b3-d64c04493823"), - Description = "", - FeatureId = new Guid("39e66f81-efc6-446c-95bd-46bff6cfb606"), - IsEnabled = true, - Name = "Approve Task" - }, - new - { - Id = new Guid("b82d2b7e-0d52-45f3-997b-c008ea460e7f"), - Description = "", - FeatureId = new Guid("81ab8a87-8ccd-4015-a917-0627cee6a100"), - IsEnabled = true, - Name = "View Employee" - }, - new - { - Id = new Guid("a97d366a-c2bb-448d-be93-402bd2324566"), - Description = "", - FeatureId = new Guid("81ab8a87-8ccd-4015-a917-0627cee6a100"), - IsEnabled = true, - Name = "Manage Employee" - }, - new - { - Id = new Guid("fbd213e0-0250-46f1-9f5f-4b2a1e6e76a3"), - Description = "", - FeatureId = new Guid("81ab8a87-8ccd-4015-a917-0627cee6a100"), - IsEnabled = true, - Name = "Assign To Project" - }, - new - { - Id = new Guid("915e6bff-65f6-4e3f-aea8-3fd217d3ea9e"), - Description = "", - FeatureId = new Guid("52c9cf54-1eb2-44d2-81bb-524cf29c0a94"), - IsEnabled = true, - Name = "Perform Attendance " - }, - new - { - Id = new Guid("57802c4a-00aa-4a1f-a048-fd2f70dd44b6"), - Description = "", - FeatureId = new Guid("52c9cf54-1eb2-44d2-81bb-524cf29c0a94"), - IsEnabled = true, - Name = "Regularize Attendance" - }, - new - { - Id = new Guid("5ffbafe0-7ab0-48b1-bb50-c1bf76b65f9d"), - Description = "", - FeatureId = new Guid("be3b3afc-6ccf-4566-b9b6-aafcb65546be"), - IsEnabled = true, - Name = "View Masters" - }, - new - { - Id = new Guid("588a8824-f924-4955-82d8-fc51956cf323"), - Description = "", - FeatureId = new Guid("be3b3afc-6ccf-4566-b9b6-aafcb65546be"), - IsEnabled = true, - Name = "Manage Masters" - }, - new - { - Id = new Guid("cb8ec407-46d4-4467-930c-69127cda6dec"), - Description = "", - FeatureId = new Guid("660131a4-788c-4739-a082-cbbf7879cbf2"), - IsEnabled = true, - Name = "View Masters" - }, - new - { - Id = new Guid("6b1a6d97-a951-4de5-9b19-709bac7c4f18"), - Description = "", - FeatureId = new Guid("660131a4-788c-4739-a082-cbbf7879cbf2"), - IsEnabled = true, - Name = "Manage Masters" - }); - }); - - modelBuilder.Entity("Marco.Pms.Model.Entitlements.JobRole", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - - b.Property("Description") - .HasColumnType("longtext"); - - b.Property("Name") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("TenantId") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("TenantId"); - - b.ToTable("JobRoles"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Entitlements.Module", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - - b.Property("Description") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("Key") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("Name") - .IsRequired() - .HasColumnType("longtext"); - - b.HasKey("Id"); - - b.ToTable("Modules"); - - b.HasData( - new - { - Id = 1, - Description = "Project Module", - Key = "b04da7e9-0406-409c-ac7f-b97256e6ea02", - Name = "Project" - }, - new - { - Id = 2, - Description = "Employee Module", - Key = "0971c7fb-6ce1-458a-ae3f-8d3205893637", - Name = "Employee" - }, - new - { - Id = 3, - Description = "Masters Module", - Key = "504ec132-e6a9-422f-8f85-050602cfce05", - Name = "Masters" - }); - }); - - modelBuilder.Entity("Marco.Pms.Model.Entitlements.RolePermissionMappings", b => - { - b.Property("ApplicationRoleId") - .HasColumnType("char(36)"); - - b.Property("FeaturePermissionId") - .HasColumnType("char(36)"); - - b.HasKey("ApplicationRoleId", "FeaturePermissionId"); - - b.HasIndex("FeaturePermissionId"); - - b.ToTable("RolePermissionMappings"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Entitlements.StatusMaster", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - - b.Property("Status") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("TenantId") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("TenantId"); - - b.ToTable("StatusMasters"); - - b.HasData( - new - { - Id = 1, - Status = "Active", - TenantId = 1 - }, - new - { - Id = 2, - Status = "In Progress", - TenantId = 1 - }, - new - { - Id = 3, - Status = "On Hold", - TenantId = 1 - }, - new - { - Id = 4, - Status = "Completed", - TenantId = 1 - }); - }); - - modelBuilder.Entity("Marco.Pms.Model.Entitlements.Tenant", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - - b.Property("ContactName") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("ContactNumber") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("Description") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("DomainName") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("Name") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("OnBoardingDate") - .HasColumnType("datetime(6)"); - - b.HasKey("Id"); - - b.ToTable("Tenants"); - - b.HasData( - new - { - Id = 1, - ContactName = "Admin", - ContactNumber = "123456789", - Description = "", - DomainName = "www.marcobms.org", - Name = "MarcoBMS", - OnBoardingDate = new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified) - }); - }); - - modelBuilder.Entity("Marco.Pms.Model.Projects.Building", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - - b.Property("Description") - .HasColumnType("longtext"); - - b.Property("Name") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("ProjectId") - .HasColumnType("int"); - - b.Property("TenantId") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("TenantId"); - - b.ToTable("Buildings"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Projects.Floor", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - - b.Property("BuildingId") - .HasColumnType("int"); - - b.Property("FloorName") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("TenantId") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("BuildingId"); - - b.HasIndex("TenantId"); - - b.ToTable("Floor"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Projects.Project", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - - b.Property("ContactPerson") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("EndDate") - .HasColumnType("datetime(6)"); - - b.Property("Name") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("ProjectAddress") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("ProjectStatusId") - .HasColumnType("int"); - - b.Property("StartDate") - .HasColumnType("datetime(6)"); - - b.Property("TenantId") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("ProjectStatusId"); - - b.HasIndex("TenantId"); - - b.ToTable("Projects"); - - b.HasData( - new - { - Id = 1, - ContactPerson = "Project 1 Contact Person", - Name = "Project 1", - ProjectAddress = "Project 1 Address", - ProjectStatusId = 1, - TenantId = 1 - }, - new - { - Id = 2, - ContactPerson = "Project 2 Contact Person", - Name = "Project 2", - ProjectAddress = "Project 2 Address", - ProjectStatusId = 2, - TenantId = 1 - }, - new - { - Id = 3, - ContactPerson = "Project 3 Contact Person", - Name = "Project 3", - ProjectAddress = "Project 3 Address", - ProjectStatusId = 3, - TenantId = 1 - }); - }); - - modelBuilder.Entity("Marco.Pms.Model.Projects.ProjectAllocation", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - - b.Property("AllocationDate") - .HasColumnType("datetime(6)"); - - b.Property("EmployeeId") - .HasColumnType("int"); - - b.Property("EmployeeRoleId") - .HasColumnType("char(36)"); - - b.Property("IsActive") - .HasColumnType("tinyint(1)"); - - b.Property("ProjectId") - .HasColumnType("int"); - - b.Property("ReAllocationDate") - .HasColumnType("datetime(6)"); - - b.Property("TenantId") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("EmployeeId"); - - b.HasIndex("ProjectId"); - - b.HasIndex("TenantId"); - - b.ToTable("ProjectAllocations"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Projects.WorkArea", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - - b.Property("AreaName") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("FloorId") - .HasColumnType("int"); - - b.Property("TenantId") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("FloorId"); - - b.HasIndex("TenantId"); - - b.ToTable("WorkAreas"); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRole", b => - { - b.Property("Id") - .HasColumnType("varchar(255)"); - - b.Property("ConcurrencyStamp") - .IsConcurrencyToken() - .HasColumnType("longtext"); - - b.Property("Name") - .HasMaxLength(256) - .HasColumnType("varchar(256)"); - - b.Property("NormalizedName") - .HasMaxLength(256) - .HasColumnType("varchar(256)"); - - b.HasKey("Id"); - - b.HasIndex("NormalizedName") - .IsUnique() - .HasDatabaseName("RoleNameIndex"); - - b.ToTable("AspNetRoles", (string)null); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - - b.Property("ClaimType") - .HasColumnType("longtext"); - - b.Property("ClaimValue") - .HasColumnType("longtext"); - - b.Property("RoleId") - .IsRequired() - .HasColumnType("varchar(255)"); - - b.HasKey("Id"); - - b.HasIndex("RoleId"); - - b.ToTable("AspNetRoleClaims", (string)null); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUser", b => - { - b.Property("Id") - .HasColumnType("varchar(255)"); - - b.Property("AccessFailedCount") - .HasColumnType("int"); - - b.Property("ConcurrencyStamp") - .IsConcurrencyToken() - .HasColumnType("longtext"); - - b.Property("Discriminator") - .IsRequired() - .HasMaxLength(21) - .HasColumnType("varchar(21)"); - - b.Property("Email") - .HasMaxLength(256) - .HasColumnType("varchar(256)"); - - b.Property("EmailConfirmed") - .HasColumnType("tinyint(1)"); - - b.Property("LockoutEnabled") - .HasColumnType("tinyint(1)"); - - b.Property("LockoutEnd") - .HasColumnType("datetime(6)"); - - b.Property("NormalizedEmail") - .HasMaxLength(256) - .HasColumnType("varchar(256)"); - - b.Property("NormalizedUserName") - .HasMaxLength(256) - .HasColumnType("varchar(256)"); - - b.Property("PasswordHash") - .HasColumnType("longtext"); - - b.Property("PhoneNumber") - .HasColumnType("longtext"); - - b.Property("PhoneNumberConfirmed") - .HasColumnType("tinyint(1)"); - - b.Property("SecurityStamp") - .HasColumnType("longtext"); - - b.Property("TwoFactorEnabled") - .HasColumnType("tinyint(1)"); - - b.Property("UserName") - .HasMaxLength(256) - .HasColumnType("varchar(256)"); - - b.HasKey("Id"); - - b.HasIndex("NormalizedEmail") - .HasDatabaseName("EmailIndex"); - - b.HasIndex("NormalizedUserName") - .IsUnique() - .HasDatabaseName("UserNameIndex"); - - b.ToTable("AspNetUsers", (string)null); - - b.HasDiscriminator().HasValue("IdentityUser"); - - b.UseTphMappingStrategy(); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - - b.Property("ClaimType") - .HasColumnType("longtext"); - - b.Property("ClaimValue") - .HasColumnType("longtext"); - - b.Property("UserId") - .IsRequired() - .HasColumnType("varchar(255)"); - - b.HasKey("Id"); - - b.HasIndex("UserId"); - - b.ToTable("AspNetUserClaims", (string)null); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin", b => - { - b.Property("LoginProvider") - .HasColumnType("varchar(255)"); - - b.Property("ProviderKey") - .HasColumnType("varchar(255)"); - - b.Property("ProviderDisplayName") - .HasColumnType("longtext"); - - b.Property("UserId") - .IsRequired() - .HasColumnType("varchar(255)"); - - b.HasKey("LoginProvider", "ProviderKey"); - - b.HasIndex("UserId"); - - b.ToTable("AspNetUserLogins", (string)null); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole", b => - { - b.Property("UserId") - .HasColumnType("varchar(255)"); - - b.Property("RoleId") - .HasColumnType("varchar(255)"); - - b.HasKey("UserId", "RoleId"); - - b.HasIndex("RoleId"); - - b.ToTable("AspNetUserRoles", (string)null); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken", b => - { - b.Property("UserId") - .HasColumnType("varchar(255)"); - - b.Property("LoginProvider") - .HasColumnType("varchar(255)"); - - b.Property("Name") - .HasColumnType("varchar(255)"); - - b.Property("Value") - .HasColumnType("longtext"); - - b.HasKey("UserId", "LoginProvider", "Name"); - - b.ToTable("AspNetUserTokens", (string)null); - }); - - modelBuilder.Entity("Marco.Pms.Model.Entitlements.ApplicationUser", b => - { - b.HasBaseType("Microsoft.AspNetCore.Identity.IdentityUser"); - - b.Property("IsRootUser") - .HasColumnType("tinyint(1)"); - - b.Property("Role") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("TenantId") - .HasColumnType("int"); - - b.HasDiscriminator().HasValue("ApplicationUser"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Activities.TaskAllocation", b => - { - b.HasOne("Marco.Pms.Model.Projects.Building", "Building") - .WithMany() - .HasForeignKey("BuildingId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Marco.Pms.Model.Employees.Employee", "Employee") - .WithMany() - .HasForeignKey("EmployeeId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Marco.Pms.Model.Projects.Project", "Project") - .WithMany() - .HasForeignKey("ProjectId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Marco.Pms.Model.Entitlements.Tenant", "Tenant") - .WithMany() - .HasForeignKey("TenantId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Marco.Pms.Model.Projects.WorkArea", "WorkArea") - .WithMany() - .HasForeignKey("WorkAreaId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Building"); - - b.Navigation("Employee"); - - b.Navigation("Project"); - - b.Navigation("Tenant"); - - b.Navigation("WorkArea"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Activities.WorkItem", b => - { - b.HasOne("Marco.Pms.Model.Entitlements.ActivityMaster", "ActivityMaster") - .WithMany() - .HasForeignKey("ActivityId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Marco.Pms.Model.Entitlements.Tenant", "Tenant") - .WithMany() - .HasForeignKey("TenantId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Marco.Pms.Model.Projects.WorkArea", "WorkArea") - .WithMany() - .HasForeignKey("WorkAreaId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("ActivityMaster"); - - b.Navigation("Tenant"); - - b.Navigation("WorkArea"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Activities.WorkItemMapping", b => - { - b.HasOne("Marco.Pms.Model.Entitlements.Tenant", "Tenant") - .WithMany() - .HasForeignKey("TenantId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Marco.Pms.Model.Projects.WorkArea", "WorkArea") - .WithMany() - .HasForeignKey("WorkAreaId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Marco.Pms.Model.Activities.WorkItem", "WorkItem") - .WithMany() - .HasForeignKey("WorkItemId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Tenant"); - - b.Navigation("WorkArea"); - - b.Navigation("WorkItem"); - }); - - modelBuilder.Entity("Marco.Pms.Model.AttendanceModule.Attendance", b => - { - b.HasOne("Marco.Pms.Model.Employees.Employee", "Approver") - .WithMany() - .HasForeignKey("EmployeeID") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Marco.Pms.Model.Entitlements.Tenant", "Tenant") - .WithMany() - .HasForeignKey("TenantId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Approver"); - - b.Navigation("Tenant"); - }); - - modelBuilder.Entity("Marco.Pms.Model.AttendanceModule.AttendanceLog", b => - { - b.HasOne("Marco.Pms.Model.AttendanceModule.Attendance", "Attendance") - .WithMany() - .HasForeignKey("AttendanceId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Marco.Pms.Model.Employees.Employee", "Employee") - .WithMany() - .HasForeignKey("EmployeeID") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Marco.Pms.Model.Entitlements.Tenant", "Tenant") - .WithMany() - .HasForeignKey("TenantId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Marco.Pms.Model.Employees.Employee", "UpdatedByEmployee") - .WithMany() - .HasForeignKey("UpdatedBy"); - - b.Navigation("Attendance"); - - b.Navigation("Employee"); - - b.Navigation("Tenant"); - - b.Navigation("UpdatedByEmployee"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Authentication.RefreshToken", b => - { - b.HasOne("Microsoft.AspNetCore.Identity.IdentityUser", "User") - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("User"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Employees.Employee", b => - { - b.HasOne("Marco.Pms.Model.Entitlements.ApplicationUser", "ApplicationUser") - .WithMany() - .HasForeignKey("ApplicationUserId"); - - b.HasOne("Marco.Pms.Model.Entitlements.JobRole", "JobRole") - .WithMany() - .HasForeignKey("JobRoleId"); - - b.HasOne("Marco.Pms.Model.Entitlements.Tenant", "Tenant") - .WithMany() - .HasForeignKey("TenantId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("ApplicationUser"); - - b.Navigation("JobRole"); - - b.Navigation("Tenant"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Employees.WorkShift", b => - { - b.HasOne("Marco.Pms.Model.Entitlements.Tenant", "Tenant") - .WithMany() - .HasForeignKey("TenantId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Tenant"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Entitlements.ActivityMaster", b => - { - b.HasOne("Marco.Pms.Model.Activities.TaskAllocation", null) - .WithMany("AllotedTask") - .HasForeignKey("TaskAllocationId"); - - b.HasOne("Marco.Pms.Model.Entitlements.Tenant", "Tenant") - .WithMany() - .HasForeignKey("TenantId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Tenant"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Entitlements.ApplicationRole", b => - { - b.HasOne("Marco.Pms.Model.Entitlements.Tenant", null) - .WithMany() - .HasForeignKey("TenantId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Marco.Pms.Model.Entitlements.EmployeeRoleMapping", b => - { - b.HasOne("Marco.Pms.Model.Employees.Employee", "Employee") - .WithMany() - .HasForeignKey("EmployeeId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Marco.Pms.Model.Entitlements.ApplicationRole", "Role") - .WithMany() - .HasForeignKey("RoleId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Marco.Pms.Model.Entitlements.Tenant", "Tenant") - .WithMany() - .HasForeignKey("TenantId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Employee"); - - b.Navigation("Role"); - - b.Navigation("Tenant"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Entitlements.Feature", b => - { - b.HasOne("Marco.Pms.Model.Entitlements.Module", "Module") - .WithMany() - .HasForeignKey("ModuleId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Module"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Entitlements.FeaturePermission", b => - { - b.HasOne("Marco.Pms.Model.Entitlements.Feature", "Feature") - .WithMany("FeaturePermissions") - .HasForeignKey("FeatureId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Feature"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Entitlements.JobRole", b => - { - b.HasOne("Marco.Pms.Model.Entitlements.Tenant", "Tenant") - .WithMany() - .HasForeignKey("TenantId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Tenant"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Entitlements.RolePermissionMappings", b => - { - b.HasOne("Marco.Pms.Model.Entitlements.ApplicationRole", null) - .WithMany() - .HasForeignKey("ApplicationRoleId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Marco.Pms.Model.Entitlements.FeaturePermission", null) - .WithMany() - .HasForeignKey("FeaturePermissionId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Marco.Pms.Model.Entitlements.StatusMaster", b => - { - b.HasOne("Marco.Pms.Model.Entitlements.Tenant", "Tenant") - .WithMany() - .HasForeignKey("TenantId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Tenant"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Projects.Building", b => - { - b.HasOne("Marco.Pms.Model.Entitlements.Tenant", "Tenant") - .WithMany() - .HasForeignKey("TenantId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Tenant"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Projects.Floor", b => - { - b.HasOne("Marco.Pms.Model.Projects.Building", "Building") - .WithMany() - .HasForeignKey("BuildingId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Marco.Pms.Model.Entitlements.Tenant", "Tenant") - .WithMany() - .HasForeignKey("TenantId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Building"); - - b.Navigation("Tenant"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Projects.Project", b => - { - b.HasOne("Marco.Pms.Model.Entitlements.StatusMaster", "ProjectStatus") - .WithMany() - .HasForeignKey("ProjectStatusId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Marco.Pms.Model.Entitlements.Tenant", "Tenant") - .WithMany() - .HasForeignKey("TenantId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("ProjectStatus"); - - b.Navigation("Tenant"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Projects.ProjectAllocation", b => - { - b.HasOne("Marco.Pms.Model.Employees.Employee", "Employee") - .WithMany() - .HasForeignKey("EmployeeId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Marco.Pms.Model.Projects.Project", "Project") - .WithMany() - .HasForeignKey("ProjectId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Marco.Pms.Model.Entitlements.Tenant", "Tenant") - .WithMany() - .HasForeignKey("TenantId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Employee"); - - b.Navigation("Project"); - - b.Navigation("Tenant"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Projects.WorkArea", b => - { - b.HasOne("Marco.Pms.Model.Projects.Floor", "Floor") - .WithMany() - .HasForeignKey("FloorId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Marco.Pms.Model.Entitlements.Tenant", "Tenant") - .WithMany() - .HasForeignKey("TenantId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Floor"); - - b.Navigation("Tenant"); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim", b => - { - b.HasOne("Microsoft.AspNetCore.Identity.IdentityRole", null) - .WithMany() - .HasForeignKey("RoleId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim", b => - { - b.HasOne("Microsoft.AspNetCore.Identity.IdentityUser", null) - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin", b => - { - b.HasOne("Microsoft.AspNetCore.Identity.IdentityUser", null) - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole", b => - { - b.HasOne("Microsoft.AspNetCore.Identity.IdentityRole", null) - .WithMany() - .HasForeignKey("RoleId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Microsoft.AspNetCore.Identity.IdentityUser", null) - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken", b => - { - b.HasOne("Microsoft.AspNetCore.Identity.IdentityUser", null) - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Marco.Pms.Model.Activities.TaskAllocation", b => - { - b.Navigation("AllotedTask"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Entitlements.Feature", b => - { - b.Navigation("FeaturePermissions"); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/Marco.Pms.DataAccess/Migrations/20250311072410_addIsActiveToProjectAllocation.cs b/Marco.Pms.DataAccess/Migrations/20250311072410_addIsActiveToProjectAllocation.cs deleted file mode 100644 index a721a20..0000000 --- a/Marco.Pms.DataAccess/Migrations/20250311072410_addIsActiveToProjectAllocation.cs +++ /dev/null @@ -1,71 +0,0 @@ -using Microsoft.EntityFrameworkCore.Migrations; - -#nullable disable - -namespace Marco.Pms.DataAccess.Migrations -{ - /// - public partial class addIsActiveToProjectAllocation : Migration - { - /// - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.AddColumn( - name: "IsActive", - table: "ProjectAllocations", - type: "tinyint(1)", - nullable: false, - defaultValue: false); - - migrationBuilder.UpdateData( - table: "Modules", - keyColumn: "Id", - keyValue: 1, - column: "Key", - value: "b04da7e9-0406-409c-ac7f-b97256e6ea02"); - - migrationBuilder.UpdateData( - table: "Modules", - keyColumn: "Id", - keyValue: 2, - column: "Key", - value: "0971c7fb-6ce1-458a-ae3f-8d3205893637"); - - migrationBuilder.UpdateData( - table: "Modules", - keyColumn: "Id", - keyValue: 3, - column: "Key", - value: "504ec132-e6a9-422f-8f85-050602cfce05"); - } - - /// - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropColumn( - name: "IsActive", - table: "ProjectAllocations"); - - migrationBuilder.UpdateData( - table: "Modules", - keyColumn: "Id", - keyValue: 1, - column: "Key", - value: "6962167a-70de-4e3d-961d-14cfe676ef22"); - - migrationBuilder.UpdateData( - table: "Modules", - keyColumn: "Id", - keyValue: 2, - column: "Key", - value: "d8d0ed22-ce17-4a73-b507-307c43c08b57"); - - migrationBuilder.UpdateData( - table: "Modules", - keyColumn: "Id", - keyValue: 3, - column: "Key", - value: "3c0463c6-2842-43ac-b7d3-ca74b26c74a6"); - } - } -} diff --git a/Marco.Pms.DataAccess/Migrations/20250315082651_addEmergencyContactPersonInEmployeeModel.Designer.cs b/Marco.Pms.DataAccess/Migrations/20250315082651_addEmergencyContactPersonInEmployeeModel.Designer.cs deleted file mode 100644 index 21b5489..0000000 --- a/Marco.Pms.DataAccess/Migrations/20250315082651_addEmergencyContactPersonInEmployeeModel.Designer.cs +++ /dev/null @@ -1,1943 +0,0 @@ -// -using System; -using Marco.Pms.DataAccess.Data; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Metadata; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; - -#nullable disable - -namespace Marco.Pms.DataAccess.Migrations -{ - [DbContext(typeof(ApplicationDbContext))] - [Migration("20250315082651_addEmergencyContactPersonInEmployeeModel")] - partial class addEmergencyContactPersonInEmployeeModel - { - /// - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasAnnotation("ProductVersion", "8.0.12") - .HasAnnotation("Relational:MaxIdentifierLength", 64); - - // MySqlModelBuilderExtensions.AutoIncrementColumns(modelBuilder); - - modelBuilder.Entity("Marco.Pms.Model.Activities.TaskAllocation", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - - b.Property("AllocationDate") - .HasColumnType("datetime(6)"); - - b.Property("BuildingId") - .HasColumnType("int"); - - b.Property("EmployeeId") - .HasColumnType("int"); - - b.Property("EmployeeRole") - .HasColumnType("int"); - - b.Property("ProjectId") - .HasColumnType("int"); - - b.Property("ReAllocationDate") - .HasColumnType("datetime(6)"); - - b.Property("TenantId") - .HasColumnType("int"); - - b.Property("WorkAreaId") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("BuildingId"); - - b.HasIndex("EmployeeId"); - - b.HasIndex("ProjectId"); - - b.HasIndex("TenantId"); - - b.HasIndex("WorkAreaId"); - - b.ToTable("TaskAllocations"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Activities.WorkItem", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - - b.Property("ActivityId") - .HasColumnType("int"); - - b.Property("CompletedWork") - .HasColumnType("int"); - - b.Property("PlannedWork") - .HasColumnType("int"); - - b.Property("TaskDate") - .HasColumnType("datetime(6)"); - - b.Property("TenantId") - .HasColumnType("int"); - - b.Property("WorkAreaId") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("ActivityId"); - - b.HasIndex("TenantId"); - - b.HasIndex("WorkAreaId"); - - b.ToTable("WorkItems"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Activities.WorkItemMapping", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - - b.Property("TenantId") - .HasColumnType("int"); - - b.Property("WorkAreaId") - .HasColumnType("int"); - - b.Property("WorkItemId") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("TenantId"); - - b.HasIndex("WorkAreaId"); - - b.HasIndex("WorkItemId"); - - b.ToTable("WorkItemMapping"); - }); - - modelBuilder.Entity("Marco.Pms.Model.AttendanceModule.Attendance", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - - b.Property("Activity") - .HasColumnType("int"); - - b.Property("ApprovedBy") - .HasColumnType("int"); - - b.Property("AttendanceDate") - .HasColumnType("datetime(6)"); - - b.Property("Comment") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("Date") - .HasColumnType("datetime(6)"); - - b.Property("EmployeeID") - .HasColumnType("int"); - - b.Property("InTime") - .HasColumnType("datetime(6)"); - - b.Property("IsApproved") - .HasColumnType("tinyint(1)"); - - b.Property("OutTime") - .HasColumnType("datetime(6)"); - - b.Property("ProjectID") - .HasColumnType("int"); - - b.Property("TenantId") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("EmployeeID"); - - b.HasIndex("TenantId"); - - b.ToTable("Attendes"); - }); - - modelBuilder.Entity("Marco.Pms.Model.AttendanceModule.AttendanceLog", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - - b.Property("Activity") - .HasColumnType("int"); - - b.Property("ActivityTime") - .HasColumnType("datetime(6)"); - - b.Property("AttendanceId") - .HasColumnType("int"); - - b.Property("Comment") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("EmployeeID") - .HasColumnType("int"); - - b.Property("Latitude") - .HasColumnType("longtext"); - - b.Property("Longitude") - .HasColumnType("longtext"); - - b.Property("Photo") - .HasColumnType("longblob"); - - b.Property("TenantId") - .HasColumnType("int"); - - b.Property("UpdatedBy") - .HasColumnType("int"); - - b.Property("UpdatedOn") - .HasColumnType("datetime(6)"); - - b.HasKey("Id"); - - b.HasIndex("AttendanceId"); - - b.HasIndex("EmployeeID"); - - b.HasIndex("TenantId"); - - b.HasIndex("UpdatedBy"); - - b.ToTable("AttendanceLogs"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Authentication.RefreshToken", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - - b.Property("CreatedAt") - .HasColumnType("datetime(6)"); - - b.Property("ExpiryDate") - .HasColumnType("datetime(6)"); - - b.Property("IsRevoked") - .HasColumnType("tinyint(1)"); - - b.Property("IsUsed") - .HasColumnType("tinyint(1)"); - - b.Property("RevokedAt") - .HasColumnType("datetime(6)"); - - b.Property("Token") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("UserId") - .IsRequired() - .HasColumnType("varchar(255)"); - - b.HasKey("Id"); - - b.HasIndex("UserId"); - - b.ToTable("RefreshTokens"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Employees.Employee", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - - b.Property("AadharNumber") - .HasColumnType("longtext"); - - b.Property("ApplicationUserId") - .HasColumnType("varchar(255)"); - - b.Property("BirthDate") - .HasColumnType("datetime(6)"); - - b.Property("CurrentAddress") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("Email") - .HasColumnType("longtext"); - - b.Property("EmergencyContactPerson") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("EmergencyPhoneNumber") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("FirstName") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("Gender") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("IsActive") - .HasColumnType("tinyint(1)"); - - b.Property("JobRoleId") - .HasColumnType("int"); - - b.Property("LastName") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("MiddleName") - .HasColumnType("longtext"); - - b.Property("PanNumber") - .HasColumnType("longtext"); - - b.Property("PeramnentAddress") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("PhoneNumber") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("Photo") - .HasColumnType("longblob"); - - b.Property("RoleId") - .HasColumnType("char(36)"); - - b.Property("TenantId") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("ApplicationUserId"); - - b.HasIndex("JobRoleId"); - - b.HasIndex("TenantId"); - - b.ToTable("Employees"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Employees.WorkShift", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - - b.Property("EndTime") - .HasColumnType("time(6)"); - - b.Property("Name") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("StartTime") - .HasColumnType("time(6)"); - - b.Property("TenantId") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("TenantId"); - - b.ToTable("WorkShifts"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Entitlements.ActivityMaster", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - - b.Property("ActivityName") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("TaskAllocationId") - .HasColumnType("int"); - - b.Property("TenantId") - .HasColumnType("int"); - - b.Property("UnitOfMeasurement") - .IsRequired() - .HasColumnType("longtext"); - - b.HasKey("Id"); - - b.HasIndex("TaskAllocationId"); - - b.HasIndex("TenantId"); - - b.ToTable("ActivityMasters"); - - b.HasData( - new - { - Id = 1, - ActivityName = "Core Cutting", - TenantId = 1, - UnitOfMeasurement = "Number" - }, - new - { - Id = 2, - ActivityName = "Fabrication", - TenantId = 1, - UnitOfMeasurement = "Meter" - }, - new - { - Id = 3, - ActivityName = "Lifting", - TenantId = 1, - UnitOfMeasurement = "Meter" - }, - new - { - Id = 4, - ActivityName = "Hanging", - TenantId = 1, - UnitOfMeasurement = "Meter" - }, - new - { - Id = 5, - ActivityName = "Tapping", - TenantId = 1, - UnitOfMeasurement = "Meter" - }, - new - { - Id = 6, - ActivityName = "Welding", - TenantId = 1, - UnitOfMeasurement = "Meter" - }, - new - { - Id = 7, - ActivityName = "Testing", - TenantId = 1, - UnitOfMeasurement = "Area" - }, - new - { - Id = 8, - ActivityName = "Painting", - TenantId = 1, - UnitOfMeasurement = "Meter" - }, - new - { - Id = 9, - ActivityName = "Marking Area", - TenantId = 1, - UnitOfMeasurement = "Meter" - }, - new - { - Id = 10, - ActivityName = "Drilling", - TenantId = 1, - UnitOfMeasurement = "Number" - }, - new - { - Id = 11, - ActivityName = "MS Support Fabrication", - TenantId = 1, - UnitOfMeasurement = "Number" - }, - new - { - Id = 12, - ActivityName = "MS Support Hanging", - TenantId = 1, - UnitOfMeasurement = "Number" - }, - new - { - Id = 13, - ActivityName = "Hydrant Volve", - TenantId = 1, - UnitOfMeasurement = "Number" - }, - new - { - Id = 14, - ActivityName = "Sprinkler Installation", - TenantId = 1, - UnitOfMeasurement = "Number" - }); - }); - - modelBuilder.Entity("Marco.Pms.Model.Entitlements.ApplicationRole", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("char(36)"); - - b.Property("Description") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("Role") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("TenantId") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("TenantId"); - - b.ToTable("ApplicationRoles"); - - b.HasData( - new - { - Id = new Guid("2c8d0808-c421-11ef-9b93-0242ac110002"), - Description = "", - Role = "Admin", - TenantId = 1 - }, - new - { - Id = new Guid("62e0918d-c421-11ef-9b93-0242ac110002"), - Description = "", - Role = "Welder", - TenantId = 1 - }, - new - { - Id = new Guid("68823f1f-c421-11ef-9b93-0242ac110002"), - Description = "", - Role = "Helper", - TenantId = 1 - }, - new - { - Id = new Guid("6d3a7c72-c421-11ef-9b93-0242ac110002"), - Description = "", - Role = "Site Engineer", - TenantId = 1 - }, - new - { - Id = new Guid("6d3aad72-c421-11ef-9b93-0242ac110002"), - Description = "", - Role = "Project Manager", - TenantId = 1 - }); - }); - - modelBuilder.Entity("Marco.Pms.Model.Entitlements.EmployeeRoleMapping", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("char(36)"); - - b.Property("EmployeeId") - .HasColumnType("int"); - - b.Property("IsEnabled") - .HasColumnType("tinyint(1)"); - - b.Property("RoleId") - .HasColumnType("char(36)"); - - b.Property("TenantId") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("EmployeeId"); - - b.HasIndex("RoleId"); - - b.HasIndex("TenantId"); - - b.ToTable("EmployeeRoleMappings"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Entitlements.Feature", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("char(36)"); - - b.Property("Description") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("IsActive") - .HasColumnType("tinyint(1)"); - - b.Property("ModuleId") - .HasColumnType("int"); - - b.Property("Name") - .IsRequired() - .HasColumnType("longtext"); - - b.HasKey("Id"); - - b.HasIndex("ModuleId"); - - b.ToTable("Features"); - - b.HasData( - new - { - Id = new Guid("53176ebf-c75d-42e5-839f-4508ffac3def"), - Description = "Manage Project", - IsActive = true, - ModuleId = 1, - Name = "Manage Project" - }, - new - { - Id = new Guid("9666de86-d7c7-4d3d-acaa-fcd6d6b81f3c"), - Description = "Manage Infra", - IsActive = true, - ModuleId = 1, - Name = "Manage Infra" - }, - new - { - Id = new Guid("9d4b5489-2079-40b9-bd77-6e1bf90bc19f"), - Description = "Manage Tasks", - IsActive = true, - ModuleId = 1, - Name = "Manage Tasks" - }, - new - { - Id = new Guid("39e66f81-efc6-446c-95bd-46bff6cfb606"), - Description = "Assign and Update Tasks Progress", - IsActive = true, - ModuleId = 1, - Name = "Assign and Update Tasks Progress" - }, - new - { - Id = new Guid("81ab8a87-8ccd-4015-a917-0627cee6a100"), - Description = "Manage Employee", - IsActive = true, - ModuleId = 2, - Name = "Manage Employee" - }, - new - { - Id = new Guid("52c9cf54-1eb2-44d2-81bb-524cf29c0a94"), - Description = "Attendance", - IsActive = true, - ModuleId = 2, - Name = "Attendance" - }, - new - { - Id = new Guid("be3b3afc-6ccf-4566-b9b6-aafcb65546be"), - Description = "Global Masters", - IsActive = true, - ModuleId = 3, - Name = "Global Masters" - }, - new - { - Id = new Guid("660131a4-788c-4739-a082-cbbf7879cbf2"), - Description = "Tenant Masters", - IsActive = true, - ModuleId = 3, - Name = "Tenant Masters" - }); - }); - - modelBuilder.Entity("Marco.Pms.Model.Entitlements.FeaturePermission", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("char(36)"); - - b.Property("Description") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("FeatureId") - .HasColumnType("char(36)"); - - b.Property("IsEnabled") - .HasColumnType("tinyint(1)"); - - b.Property("Name") - .IsRequired() - .HasColumnType("longtext"); - - b.HasKey("Id"); - - b.HasIndex("FeatureId"); - - b.ToTable("FeaturePermissions"); - - b.HasData( - new - { - Id = new Guid("6ea44136-987e-44ba-9e5d-1cf8f5837ebc"), - Description = "", - FeatureId = new Guid("53176ebf-c75d-42e5-839f-4508ffac3def"), - IsEnabled = true, - Name = "View Project" - }, - new - { - Id = new Guid("172fc9b6-755b-4f62-ab26-55c34a330614"), - Description = "", - FeatureId = new Guid("53176ebf-c75d-42e5-839f-4508ffac3def"), - IsEnabled = true, - Name = "Manage Project" - }, - new - { - Id = new Guid("b94802ce-0689-4643-9e1d-11c86950c35b"), - Description = "", - FeatureId = new Guid("53176ebf-c75d-42e5-839f-4508ffac3def"), - IsEnabled = true, - Name = "Manage Team" - }, - new - { - Id = new Guid("c7b68e33-72f0-474f-bd96-77636427ecc8"), - Description = "", - FeatureId = new Guid("9666de86-d7c7-4d3d-acaa-fcd6d6b81f3c"), - IsEnabled = true, - Name = "View Project Infra" - }, - new - { - Id = new Guid("f2aee20a-b754-4537-8166-f9507b44585b"), - Description = "", - FeatureId = new Guid("9666de86-d7c7-4d3d-acaa-fcd6d6b81f3c"), - IsEnabled = true, - Name = "Manage Project Infra" - }, - new - { - Id = new Guid("9fcc5f87-25e3-4846-90ac-67a71ab92e3c"), - Description = "", - FeatureId = new Guid("9d4b5489-2079-40b9-bd77-6e1bf90bc19f"), - IsEnabled = true, - Name = "View Task" - }, - new - { - Id = new Guid("08752f33-3b29-4816-b76b-ea8a968ed3c5"), - Description = "", - FeatureId = new Guid("9d4b5489-2079-40b9-bd77-6e1bf90bc19f"), - IsEnabled = true, - Name = "Manage Task" - }, - new - { - Id = new Guid("d135a4b0-4f9a-4903-ab9c-4843839ebdee"), - Description = "", - FeatureId = new Guid("39e66f81-efc6-446c-95bd-46bff6cfb606"), - IsEnabled = true, - Name = "Assign Task and Report Progress" - }, - new - { - Id = new Guid("ed99ecd4-1bed-42e1-b7b3-d64c04493823"), - Description = "", - FeatureId = new Guid("39e66f81-efc6-446c-95bd-46bff6cfb606"), - IsEnabled = true, - Name = "Approve Task" - }, - new - { - Id = new Guid("b82d2b7e-0d52-45f3-997b-c008ea460e7f"), - Description = "", - FeatureId = new Guid("81ab8a87-8ccd-4015-a917-0627cee6a100"), - IsEnabled = true, - Name = "View Employee" - }, - new - { - Id = new Guid("a97d366a-c2bb-448d-be93-402bd2324566"), - Description = "", - FeatureId = new Guid("81ab8a87-8ccd-4015-a917-0627cee6a100"), - IsEnabled = true, - Name = "Manage Employee" - }, - new - { - Id = new Guid("fbd213e0-0250-46f1-9f5f-4b2a1e6e76a3"), - Description = "", - FeatureId = new Guid("81ab8a87-8ccd-4015-a917-0627cee6a100"), - IsEnabled = true, - Name = "Assign To Project" - }, - new - { - Id = new Guid("915e6bff-65f6-4e3f-aea8-3fd217d3ea9e"), - Description = "", - FeatureId = new Guid("52c9cf54-1eb2-44d2-81bb-524cf29c0a94"), - IsEnabled = true, - Name = "Perform Attendance " - }, - new - { - Id = new Guid("57802c4a-00aa-4a1f-a048-fd2f70dd44b6"), - Description = "", - FeatureId = new Guid("52c9cf54-1eb2-44d2-81bb-524cf29c0a94"), - IsEnabled = true, - Name = "Regularize Attendance" - }, - new - { - Id = new Guid("5ffbafe0-7ab0-48b1-bb50-c1bf76b65f9d"), - Description = "", - FeatureId = new Guid("be3b3afc-6ccf-4566-b9b6-aafcb65546be"), - IsEnabled = true, - Name = "View Masters" - }, - new - { - Id = new Guid("588a8824-f924-4955-82d8-fc51956cf323"), - Description = "", - FeatureId = new Guid("be3b3afc-6ccf-4566-b9b6-aafcb65546be"), - IsEnabled = true, - Name = "Manage Masters" - }, - new - { - Id = new Guid("cb8ec407-46d4-4467-930c-69127cda6dec"), - Description = "", - FeatureId = new Guid("660131a4-788c-4739-a082-cbbf7879cbf2"), - IsEnabled = true, - Name = "View Masters" - }, - new - { - Id = new Guid("6b1a6d97-a951-4de5-9b19-709bac7c4f18"), - Description = "", - FeatureId = new Guid("660131a4-788c-4739-a082-cbbf7879cbf2"), - IsEnabled = true, - Name = "Manage Masters" - }); - }); - - modelBuilder.Entity("Marco.Pms.Model.Entitlements.JobRole", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - - b.Property("Description") - .HasColumnType("longtext"); - - b.Property("Name") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("TenantId") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("TenantId"); - - b.ToTable("JobRoles"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Entitlements.Module", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - - b.Property("Description") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("Key") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("Name") - .IsRequired() - .HasColumnType("longtext"); - - b.HasKey("Id"); - - b.ToTable("Modules"); - - b.HasData( - new - { - Id = 1, - Description = "Project Module", - Key = "b04da7e9-0406-409c-ac7f-b97256e6ea02", - Name = "Project" - }, - new - { - Id = 2, - Description = "Employee Module", - Key = "0971c7fb-6ce1-458a-ae3f-8d3205893637", - Name = "Employee" - }, - new - { - Id = 3, - Description = "Masters Module", - Key = "504ec132-e6a9-422f-8f85-050602cfce05", - Name = "Masters" - }); - }); - - modelBuilder.Entity("Marco.Pms.Model.Entitlements.RolePermissionMappings", b => - { - b.Property("ApplicationRoleId") - .HasColumnType("char(36)"); - - b.Property("FeaturePermissionId") - .HasColumnType("char(36)"); - - b.HasKey("ApplicationRoleId", "FeaturePermissionId"); - - b.HasIndex("FeaturePermissionId"); - - b.ToTable("RolePermissionMappings"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Entitlements.StatusMaster", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - - b.Property("Status") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("TenantId") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("TenantId"); - - b.ToTable("StatusMasters"); - - b.HasData( - new - { - Id = 1, - Status = "Active", - TenantId = 1 - }, - new - { - Id = 2, - Status = "In Progress", - TenantId = 1 - }, - new - { - Id = 3, - Status = "On Hold", - TenantId = 1 - }, - new - { - Id = 4, - Status = "Completed", - TenantId = 1 - }); - }); - - modelBuilder.Entity("Marco.Pms.Model.Entitlements.Tenant", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - - b.Property("ContactName") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("ContactNumber") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("Description") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("DomainName") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("Name") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("OnBoardingDate") - .HasColumnType("datetime(6)"); - - b.HasKey("Id"); - - b.ToTable("Tenants"); - - b.HasData( - new - { - Id = 1, - ContactName = "Admin", - ContactNumber = "123456789", - Description = "", - DomainName = "www.marcobms.org", - Name = "MarcoBMS", - OnBoardingDate = new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified) - }); - }); - - modelBuilder.Entity("Marco.Pms.Model.Projects.Building", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - - b.Property("Description") - .HasColumnType("longtext"); - - b.Property("Name") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("ProjectId") - .HasColumnType("int"); - - b.Property("TenantId") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("TenantId"); - - b.ToTable("Buildings"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Projects.Floor", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - - b.Property("BuildingId") - .HasColumnType("int"); - - b.Property("FloorName") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("TenantId") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("BuildingId"); - - b.HasIndex("TenantId"); - - b.ToTable("Floor"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Projects.Project", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - - b.Property("ContactPerson") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("EndDate") - .HasColumnType("datetime(6)"); - - b.Property("Name") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("ProjectAddress") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("ProjectStatusId") - .HasColumnType("int"); - - b.Property("StartDate") - .HasColumnType("datetime(6)"); - - b.Property("TenantId") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("ProjectStatusId"); - - b.HasIndex("TenantId"); - - b.ToTable("Projects"); - - b.HasData( - new - { - Id = 1, - ContactPerson = "Project 1 Contact Person", - Name = "Project 1", - ProjectAddress = "Project 1 Address", - ProjectStatusId = 1, - TenantId = 1 - }, - new - { - Id = 2, - ContactPerson = "Project 2 Contact Person", - Name = "Project 2", - ProjectAddress = "Project 2 Address", - ProjectStatusId = 2, - TenantId = 1 - }, - new - { - Id = 3, - ContactPerson = "Project 3 Contact Person", - Name = "Project 3", - ProjectAddress = "Project 3 Address", - ProjectStatusId = 3, - TenantId = 1 - }); - }); - - modelBuilder.Entity("Marco.Pms.Model.Projects.ProjectAllocation", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - - b.Property("AllocationDate") - .HasColumnType("datetime(6)"); - - b.Property("EmployeeId") - .HasColumnType("int"); - - b.Property("EmployeeRoleId") - .HasColumnType("char(36)"); - - b.Property("IsActive") - .HasColumnType("tinyint(1)"); - - b.Property("ProjectId") - .HasColumnType("int"); - - b.Property("ReAllocationDate") - .HasColumnType("datetime(6)"); - - b.Property("TenantId") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("EmployeeId"); - - b.HasIndex("ProjectId"); - - b.HasIndex("TenantId"); - - b.ToTable("ProjectAllocations"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Projects.WorkArea", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - - b.Property("AreaName") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("FloorId") - .HasColumnType("int"); - - b.Property("TenantId") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("FloorId"); - - b.HasIndex("TenantId"); - - b.ToTable("WorkAreas"); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRole", b => - { - b.Property("Id") - .HasColumnType("varchar(255)"); - - b.Property("ConcurrencyStamp") - .IsConcurrencyToken() - .HasColumnType("longtext"); - - b.Property("Name") - .HasMaxLength(256) - .HasColumnType("varchar(256)"); - - b.Property("NormalizedName") - .HasMaxLength(256) - .HasColumnType("varchar(256)"); - - b.HasKey("Id"); - - b.HasIndex("NormalizedName") - .IsUnique() - .HasDatabaseName("RoleNameIndex"); - - b.ToTable("AspNetRoles", (string)null); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - - b.Property("ClaimType") - .HasColumnType("longtext"); - - b.Property("ClaimValue") - .HasColumnType("longtext"); - - b.Property("RoleId") - .IsRequired() - .HasColumnType("varchar(255)"); - - b.HasKey("Id"); - - b.HasIndex("RoleId"); - - b.ToTable("AspNetRoleClaims", (string)null); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUser", b => - { - b.Property("Id") - .HasColumnType("varchar(255)"); - - b.Property("AccessFailedCount") - .HasColumnType("int"); - - b.Property("ConcurrencyStamp") - .IsConcurrencyToken() - .HasColumnType("longtext"); - - b.Property("Discriminator") - .IsRequired() - .HasMaxLength(21) - .HasColumnType("varchar(21)"); - - b.Property("Email") - .HasMaxLength(256) - .HasColumnType("varchar(256)"); - - b.Property("EmailConfirmed") - .HasColumnType("tinyint(1)"); - - b.Property("LockoutEnabled") - .HasColumnType("tinyint(1)"); - - b.Property("LockoutEnd") - .HasColumnType("datetime(6)"); - - b.Property("NormalizedEmail") - .HasMaxLength(256) - .HasColumnType("varchar(256)"); - - b.Property("NormalizedUserName") - .HasMaxLength(256) - .HasColumnType("varchar(256)"); - - b.Property("PasswordHash") - .HasColumnType("longtext"); - - b.Property("PhoneNumber") - .HasColumnType("longtext"); - - b.Property("PhoneNumberConfirmed") - .HasColumnType("tinyint(1)"); - - b.Property("SecurityStamp") - .HasColumnType("longtext"); - - b.Property("TwoFactorEnabled") - .HasColumnType("tinyint(1)"); - - b.Property("UserName") - .HasMaxLength(256) - .HasColumnType("varchar(256)"); - - b.HasKey("Id"); - - b.HasIndex("NormalizedEmail") - .HasDatabaseName("EmailIndex"); - - b.HasIndex("NormalizedUserName") - .IsUnique() - .HasDatabaseName("UserNameIndex"); - - b.ToTable("AspNetUsers", (string)null); - - b.HasDiscriminator().HasValue("IdentityUser"); - - b.UseTphMappingStrategy(); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - - b.Property("ClaimType") - .HasColumnType("longtext"); - - b.Property("ClaimValue") - .HasColumnType("longtext"); - - b.Property("UserId") - .IsRequired() - .HasColumnType("varchar(255)"); - - b.HasKey("Id"); - - b.HasIndex("UserId"); - - b.ToTable("AspNetUserClaims", (string)null); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin", b => - { - b.Property("LoginProvider") - .HasColumnType("varchar(255)"); - - b.Property("ProviderKey") - .HasColumnType("varchar(255)"); - - b.Property("ProviderDisplayName") - .HasColumnType("longtext"); - - b.Property("UserId") - .IsRequired() - .HasColumnType("varchar(255)"); - - b.HasKey("LoginProvider", "ProviderKey"); - - b.HasIndex("UserId"); - - b.ToTable("AspNetUserLogins", (string)null); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole", b => - { - b.Property("UserId") - .HasColumnType("varchar(255)"); - - b.Property("RoleId") - .HasColumnType("varchar(255)"); - - b.HasKey("UserId", "RoleId"); - - b.HasIndex("RoleId"); - - b.ToTable("AspNetUserRoles", (string)null); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken", b => - { - b.Property("UserId") - .HasColumnType("varchar(255)"); - - b.Property("LoginProvider") - .HasColumnType("varchar(255)"); - - b.Property("Name") - .HasColumnType("varchar(255)"); - - b.Property("Value") - .HasColumnType("longtext"); - - b.HasKey("UserId", "LoginProvider", "Name"); - - b.ToTable("AspNetUserTokens", (string)null); - }); - - modelBuilder.Entity("Marco.Pms.Model.Entitlements.ApplicationUser", b => - { - b.HasBaseType("Microsoft.AspNetCore.Identity.IdentityUser"); - - b.Property("IsRootUser") - .HasColumnType("tinyint(1)"); - - b.Property("Role") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("TenantId") - .HasColumnType("int"); - - b.HasDiscriminator().HasValue("ApplicationUser"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Activities.TaskAllocation", b => - { - b.HasOne("Marco.Pms.Model.Projects.Building", "Building") - .WithMany() - .HasForeignKey("BuildingId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Marco.Pms.Model.Employees.Employee", "Employee") - .WithMany() - .HasForeignKey("EmployeeId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Marco.Pms.Model.Projects.Project", "Project") - .WithMany() - .HasForeignKey("ProjectId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Marco.Pms.Model.Entitlements.Tenant", "Tenant") - .WithMany() - .HasForeignKey("TenantId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Marco.Pms.Model.Projects.WorkArea", "WorkArea") - .WithMany() - .HasForeignKey("WorkAreaId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Building"); - - b.Navigation("Employee"); - - b.Navigation("Project"); - - b.Navigation("Tenant"); - - b.Navigation("WorkArea"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Activities.WorkItem", b => - { - b.HasOne("Marco.Pms.Model.Entitlements.ActivityMaster", "ActivityMaster") - .WithMany() - .HasForeignKey("ActivityId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Marco.Pms.Model.Entitlements.Tenant", "Tenant") - .WithMany() - .HasForeignKey("TenantId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Marco.Pms.Model.Projects.WorkArea", "WorkArea") - .WithMany() - .HasForeignKey("WorkAreaId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("ActivityMaster"); - - b.Navigation("Tenant"); - - b.Navigation("WorkArea"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Activities.WorkItemMapping", b => - { - b.HasOne("Marco.Pms.Model.Entitlements.Tenant", "Tenant") - .WithMany() - .HasForeignKey("TenantId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Marco.Pms.Model.Projects.WorkArea", "WorkArea") - .WithMany() - .HasForeignKey("WorkAreaId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Marco.Pms.Model.Activities.WorkItem", "WorkItem") - .WithMany() - .HasForeignKey("WorkItemId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Tenant"); - - b.Navigation("WorkArea"); - - b.Navigation("WorkItem"); - }); - - modelBuilder.Entity("Marco.Pms.Model.AttendanceModule.Attendance", b => - { - b.HasOne("Marco.Pms.Model.Employees.Employee", "Approver") - .WithMany() - .HasForeignKey("EmployeeID") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Marco.Pms.Model.Entitlements.Tenant", "Tenant") - .WithMany() - .HasForeignKey("TenantId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Approver"); - - b.Navigation("Tenant"); - }); - - modelBuilder.Entity("Marco.Pms.Model.AttendanceModule.AttendanceLog", b => - { - b.HasOne("Marco.Pms.Model.AttendanceModule.Attendance", "Attendance") - .WithMany() - .HasForeignKey("AttendanceId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Marco.Pms.Model.Employees.Employee", "Employee") - .WithMany() - .HasForeignKey("EmployeeID") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Marco.Pms.Model.Entitlements.Tenant", "Tenant") - .WithMany() - .HasForeignKey("TenantId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Marco.Pms.Model.Employees.Employee", "UpdatedByEmployee") - .WithMany() - .HasForeignKey("UpdatedBy"); - - b.Navigation("Attendance"); - - b.Navigation("Employee"); - - b.Navigation("Tenant"); - - b.Navigation("UpdatedByEmployee"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Authentication.RefreshToken", b => - { - b.HasOne("Microsoft.AspNetCore.Identity.IdentityUser", "User") - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("User"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Employees.Employee", b => - { - b.HasOne("Marco.Pms.Model.Entitlements.ApplicationUser", "ApplicationUser") - .WithMany() - .HasForeignKey("ApplicationUserId"); - - b.HasOne("Marco.Pms.Model.Entitlements.JobRole", "JobRole") - .WithMany() - .HasForeignKey("JobRoleId"); - - b.HasOne("Marco.Pms.Model.Entitlements.Tenant", "Tenant") - .WithMany() - .HasForeignKey("TenantId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("ApplicationUser"); - - b.Navigation("JobRole"); - - b.Navigation("Tenant"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Employees.WorkShift", b => - { - b.HasOne("Marco.Pms.Model.Entitlements.Tenant", "Tenant") - .WithMany() - .HasForeignKey("TenantId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Tenant"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Entitlements.ActivityMaster", b => - { - b.HasOne("Marco.Pms.Model.Activities.TaskAllocation", null) - .WithMany("AllotedTask") - .HasForeignKey("TaskAllocationId"); - - b.HasOne("Marco.Pms.Model.Entitlements.Tenant", "Tenant") - .WithMany() - .HasForeignKey("TenantId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Tenant"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Entitlements.ApplicationRole", b => - { - b.HasOne("Marco.Pms.Model.Entitlements.Tenant", null) - .WithMany() - .HasForeignKey("TenantId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Marco.Pms.Model.Entitlements.EmployeeRoleMapping", b => - { - b.HasOne("Marco.Pms.Model.Employees.Employee", "Employee") - .WithMany() - .HasForeignKey("EmployeeId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Marco.Pms.Model.Entitlements.ApplicationRole", "Role") - .WithMany() - .HasForeignKey("RoleId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Marco.Pms.Model.Entitlements.Tenant", "Tenant") - .WithMany() - .HasForeignKey("TenantId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Employee"); - - b.Navigation("Role"); - - b.Navigation("Tenant"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Entitlements.Feature", b => - { - b.HasOne("Marco.Pms.Model.Entitlements.Module", "Module") - .WithMany() - .HasForeignKey("ModuleId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Module"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Entitlements.FeaturePermission", b => - { - b.HasOne("Marco.Pms.Model.Entitlements.Feature", "Feature") - .WithMany("FeaturePermissions") - .HasForeignKey("FeatureId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Feature"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Entitlements.JobRole", b => - { - b.HasOne("Marco.Pms.Model.Entitlements.Tenant", "Tenant") - .WithMany() - .HasForeignKey("TenantId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Tenant"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Entitlements.RolePermissionMappings", b => - { - b.HasOne("Marco.Pms.Model.Entitlements.ApplicationRole", null) - .WithMany() - .HasForeignKey("ApplicationRoleId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Marco.Pms.Model.Entitlements.FeaturePermission", null) - .WithMany() - .HasForeignKey("FeaturePermissionId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Marco.Pms.Model.Entitlements.StatusMaster", b => - { - b.HasOne("Marco.Pms.Model.Entitlements.Tenant", "Tenant") - .WithMany() - .HasForeignKey("TenantId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Tenant"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Projects.Building", b => - { - b.HasOne("Marco.Pms.Model.Entitlements.Tenant", "Tenant") - .WithMany() - .HasForeignKey("TenantId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Tenant"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Projects.Floor", b => - { - b.HasOne("Marco.Pms.Model.Projects.Building", "Building") - .WithMany() - .HasForeignKey("BuildingId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Marco.Pms.Model.Entitlements.Tenant", "Tenant") - .WithMany() - .HasForeignKey("TenantId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Building"); - - b.Navigation("Tenant"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Projects.Project", b => - { - b.HasOne("Marco.Pms.Model.Entitlements.StatusMaster", "ProjectStatus") - .WithMany() - .HasForeignKey("ProjectStatusId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Marco.Pms.Model.Entitlements.Tenant", "Tenant") - .WithMany() - .HasForeignKey("TenantId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("ProjectStatus"); - - b.Navigation("Tenant"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Projects.ProjectAllocation", b => - { - b.HasOne("Marco.Pms.Model.Employees.Employee", "Employee") - .WithMany() - .HasForeignKey("EmployeeId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Marco.Pms.Model.Projects.Project", "Project") - .WithMany() - .HasForeignKey("ProjectId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Marco.Pms.Model.Entitlements.Tenant", "Tenant") - .WithMany() - .HasForeignKey("TenantId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Employee"); - - b.Navigation("Project"); - - b.Navigation("Tenant"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Projects.WorkArea", b => - { - b.HasOne("Marco.Pms.Model.Projects.Floor", "Floor") - .WithMany() - .HasForeignKey("FloorId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Marco.Pms.Model.Entitlements.Tenant", "Tenant") - .WithMany() - .HasForeignKey("TenantId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Floor"); - - b.Navigation("Tenant"); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim", b => - { - b.HasOne("Microsoft.AspNetCore.Identity.IdentityRole", null) - .WithMany() - .HasForeignKey("RoleId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim", b => - { - b.HasOne("Microsoft.AspNetCore.Identity.IdentityUser", null) - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin", b => - { - b.HasOne("Microsoft.AspNetCore.Identity.IdentityUser", null) - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole", b => - { - b.HasOne("Microsoft.AspNetCore.Identity.IdentityRole", null) - .WithMany() - .HasForeignKey("RoleId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Microsoft.AspNetCore.Identity.IdentityUser", null) - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken", b => - { - b.HasOne("Microsoft.AspNetCore.Identity.IdentityUser", null) - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Marco.Pms.Model.Activities.TaskAllocation", b => - { - b.Navigation("AllotedTask"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Entitlements.Feature", b => - { - b.Navigation("FeaturePermissions"); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/Marco.Pms.DataAccess/Migrations/20250315082651_addEmergencyContactPersonInEmployeeModel.cs b/Marco.Pms.DataAccess/Migrations/20250315082651_addEmergencyContactPersonInEmployeeModel.cs deleted file mode 100644 index ca20fe3..0000000 --- a/Marco.Pms.DataAccess/Migrations/20250315082651_addEmergencyContactPersonInEmployeeModel.cs +++ /dev/null @@ -1,40 +0,0 @@ -using Microsoft.EntityFrameworkCore.Migrations; - -#nullable disable - -namespace Marco.Pms.DataAccess.Migrations -{ - /// - public partial class addEmergencyContactPersonInEmployeeModel : Migration - { - /// - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.AddColumn( - name: "EmergencyContactPerson", - table: "Employees", - type: "longtext", - nullable: false) - .Annotation("MySql:CharSet", "utf8mb4"); - - migrationBuilder.AddColumn( - name: "IsActive", - table: "Employees", - type: "tinyint(1)", - nullable: false, - defaultValue: false); - } - - /// - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropColumn( - name: "EmergencyContactPerson", - table: "Employees"); - - migrationBuilder.DropColumn( - name: "IsActive", - table: "Employees"); - } - } -} diff --git a/Marco.Pms.DataAccess/Migrations/20250318053416_addJobRoleIdInProjectAllocation.Designer.cs b/Marco.Pms.DataAccess/Migrations/20250318053416_addJobRoleIdInProjectAllocation.Designer.cs deleted file mode 100644 index dfc1d17..0000000 --- a/Marco.Pms.DataAccess/Migrations/20250318053416_addJobRoleIdInProjectAllocation.Designer.cs +++ /dev/null @@ -1,1943 +0,0 @@ -// -using System; -using Marco.Pms.DataAccess.Data; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Metadata; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; - -#nullable disable - -namespace Marco.Pms.DataAccess.Migrations -{ - [DbContext(typeof(ApplicationDbContext))] - [Migration("20250318053416_addJobRoleIdInProjectAllocation")] - partial class addJobRoleIdInProjectAllocation - { - /// - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasAnnotation("ProductVersion", "8.0.12") - .HasAnnotation("Relational:MaxIdentifierLength", 64); - - //MySqlModelBuilderExtensions.AutoIncrementColumns(modelBuilder); - - modelBuilder.Entity("Marco.Pms.Model.Activities.TaskAllocation", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - - b.Property("AllocationDate") - .HasColumnType("datetime(6)"); - - b.Property("BuildingId") - .HasColumnType("int"); - - b.Property("EmployeeId") - .HasColumnType("int"); - - b.Property("EmployeeRole") - .HasColumnType("int"); - - b.Property("ProjectId") - .HasColumnType("int"); - - b.Property("ReAllocationDate") - .HasColumnType("datetime(6)"); - - b.Property("TenantId") - .HasColumnType("int"); - - b.Property("WorkAreaId") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("BuildingId"); - - b.HasIndex("EmployeeId"); - - b.HasIndex("ProjectId"); - - b.HasIndex("TenantId"); - - b.HasIndex("WorkAreaId"); - - b.ToTable("TaskAllocations"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Activities.WorkItem", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - - b.Property("ActivityId") - .HasColumnType("int"); - - b.Property("CompletedWork") - .HasColumnType("int"); - - b.Property("PlannedWork") - .HasColumnType("int"); - - b.Property("TaskDate") - .HasColumnType("datetime(6)"); - - b.Property("TenantId") - .HasColumnType("int"); - - b.Property("WorkAreaId") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("ActivityId"); - - b.HasIndex("TenantId"); - - b.HasIndex("WorkAreaId"); - - b.ToTable("WorkItems"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Activities.WorkItemMapping", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - - b.Property("TenantId") - .HasColumnType("int"); - - b.Property("WorkAreaId") - .HasColumnType("int"); - - b.Property("WorkItemId") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("TenantId"); - - b.HasIndex("WorkAreaId"); - - b.HasIndex("WorkItemId"); - - b.ToTable("WorkItemMapping"); - }); - - modelBuilder.Entity("Marco.Pms.Model.AttendanceModule.Attendance", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - - b.Property("Activity") - .HasColumnType("int"); - - b.Property("ApprovedBy") - .HasColumnType("int"); - - b.Property("AttendanceDate") - .HasColumnType("datetime(6)"); - - b.Property("Comment") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("Date") - .HasColumnType("datetime(6)"); - - b.Property("EmployeeID") - .HasColumnType("int"); - - b.Property("InTime") - .HasColumnType("datetime(6)"); - - b.Property("IsApproved") - .HasColumnType("tinyint(1)"); - - b.Property("OutTime") - .HasColumnType("datetime(6)"); - - b.Property("ProjectID") - .HasColumnType("int"); - - b.Property("TenantId") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("EmployeeID"); - - b.HasIndex("TenantId"); - - b.ToTable("Attendes"); - }); - - modelBuilder.Entity("Marco.Pms.Model.AttendanceModule.AttendanceLog", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - - b.Property("Activity") - .HasColumnType("int"); - - b.Property("ActivityTime") - .HasColumnType("datetime(6)"); - - b.Property("AttendanceId") - .HasColumnType("int"); - - b.Property("Comment") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("EmployeeID") - .HasColumnType("int"); - - b.Property("Latitude") - .HasColumnType("longtext"); - - b.Property("Longitude") - .HasColumnType("longtext"); - - b.Property("Photo") - .HasColumnType("longblob"); - - b.Property("TenantId") - .HasColumnType("int"); - - b.Property("UpdatedBy") - .HasColumnType("int"); - - b.Property("UpdatedOn") - .HasColumnType("datetime(6)"); - - b.HasKey("Id"); - - b.HasIndex("AttendanceId"); - - b.HasIndex("EmployeeID"); - - b.HasIndex("TenantId"); - - b.HasIndex("UpdatedBy"); - - b.ToTable("AttendanceLogs"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Authentication.RefreshToken", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - - b.Property("CreatedAt") - .HasColumnType("datetime(6)"); - - b.Property("ExpiryDate") - .HasColumnType("datetime(6)"); - - b.Property("IsRevoked") - .HasColumnType("tinyint(1)"); - - b.Property("IsUsed") - .HasColumnType("tinyint(1)"); - - b.Property("RevokedAt") - .HasColumnType("datetime(6)"); - - b.Property("Token") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("UserId") - .IsRequired() - .HasColumnType("varchar(255)"); - - b.HasKey("Id"); - - b.HasIndex("UserId"); - - b.ToTable("RefreshTokens"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Employees.Employee", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - - b.Property("AadharNumber") - .HasColumnType("longtext"); - - b.Property("ApplicationUserId") - .HasColumnType("varchar(255)"); - - b.Property("BirthDate") - .HasColumnType("datetime(6)"); - - b.Property("CurrentAddress") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("Email") - .HasColumnType("longtext"); - - b.Property("EmergencyContactPerson") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("EmergencyPhoneNumber") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("FirstName") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("Gender") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("IsActive") - .HasColumnType("tinyint(1)"); - - b.Property("JobRoleId") - .HasColumnType("int"); - - b.Property("LastName") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("MiddleName") - .HasColumnType("longtext"); - - b.Property("PanNumber") - .HasColumnType("longtext"); - - b.Property("PeramnentAddress") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("PhoneNumber") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("Photo") - .HasColumnType("longblob"); - - b.Property("RoleId") - .HasColumnType("char(36)"); - - b.Property("TenantId") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("ApplicationUserId"); - - b.HasIndex("JobRoleId"); - - b.HasIndex("TenantId"); - - b.ToTable("Employees"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Employees.WorkShift", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - - b.Property("EndTime") - .HasColumnType("time(6)"); - - b.Property("Name") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("StartTime") - .HasColumnType("time(6)"); - - b.Property("TenantId") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("TenantId"); - - b.ToTable("WorkShifts"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Entitlements.ActivityMaster", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - - b.Property("ActivityName") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("TaskAllocationId") - .HasColumnType("int"); - - b.Property("TenantId") - .HasColumnType("int"); - - b.Property("UnitOfMeasurement") - .IsRequired() - .HasColumnType("longtext"); - - b.HasKey("Id"); - - b.HasIndex("TaskAllocationId"); - - b.HasIndex("TenantId"); - - b.ToTable("ActivityMasters"); - - b.HasData( - new - { - Id = 1, - ActivityName = "Core Cutting", - TenantId = 1, - UnitOfMeasurement = "Number" - }, - new - { - Id = 2, - ActivityName = "Fabrication", - TenantId = 1, - UnitOfMeasurement = "Meter" - }, - new - { - Id = 3, - ActivityName = "Lifting", - TenantId = 1, - UnitOfMeasurement = "Meter" - }, - new - { - Id = 4, - ActivityName = "Hanging", - TenantId = 1, - UnitOfMeasurement = "Meter" - }, - new - { - Id = 5, - ActivityName = "Tapping", - TenantId = 1, - UnitOfMeasurement = "Meter" - }, - new - { - Id = 6, - ActivityName = "Welding", - TenantId = 1, - UnitOfMeasurement = "Meter" - }, - new - { - Id = 7, - ActivityName = "Testing", - TenantId = 1, - UnitOfMeasurement = "Area" - }, - new - { - Id = 8, - ActivityName = "Painting", - TenantId = 1, - UnitOfMeasurement = "Meter" - }, - new - { - Id = 9, - ActivityName = "Marking Area", - TenantId = 1, - UnitOfMeasurement = "Meter" - }, - new - { - Id = 10, - ActivityName = "Drilling", - TenantId = 1, - UnitOfMeasurement = "Number" - }, - new - { - Id = 11, - ActivityName = "MS Support Fabrication", - TenantId = 1, - UnitOfMeasurement = "Number" - }, - new - { - Id = 12, - ActivityName = "MS Support Hanging", - TenantId = 1, - UnitOfMeasurement = "Number" - }, - new - { - Id = 13, - ActivityName = "Hydrant Volve", - TenantId = 1, - UnitOfMeasurement = "Number" - }, - new - { - Id = 14, - ActivityName = "Sprinkler Installation", - TenantId = 1, - UnitOfMeasurement = "Number" - }); - }); - - modelBuilder.Entity("Marco.Pms.Model.Entitlements.ApplicationRole", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("char(36)"); - - b.Property("Description") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("Role") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("TenantId") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("TenantId"); - - b.ToTable("ApplicationRoles"); - - b.HasData( - new - { - Id = new Guid("2c8d0808-c421-11ef-9b93-0242ac110002"), - Description = "", - Role = "Admin", - TenantId = 1 - }, - new - { - Id = new Guid("62e0918d-c421-11ef-9b93-0242ac110002"), - Description = "", - Role = "Welder", - TenantId = 1 - }, - new - { - Id = new Guid("68823f1f-c421-11ef-9b93-0242ac110002"), - Description = "", - Role = "Helper", - TenantId = 1 - }, - new - { - Id = new Guid("6d3a7c72-c421-11ef-9b93-0242ac110002"), - Description = "", - Role = "Site Engineer", - TenantId = 1 - }, - new - { - Id = new Guid("6d3aad72-c421-11ef-9b93-0242ac110002"), - Description = "", - Role = "Project Manager", - TenantId = 1 - }); - }); - - modelBuilder.Entity("Marco.Pms.Model.Entitlements.EmployeeRoleMapping", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("char(36)"); - - b.Property("EmployeeId") - .HasColumnType("int"); - - b.Property("IsEnabled") - .HasColumnType("tinyint(1)"); - - b.Property("RoleId") - .HasColumnType("char(36)"); - - b.Property("TenantId") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("EmployeeId"); - - b.HasIndex("RoleId"); - - b.HasIndex("TenantId"); - - b.ToTable("EmployeeRoleMappings"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Entitlements.Feature", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("char(36)"); - - b.Property("Description") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("IsActive") - .HasColumnType("tinyint(1)"); - - b.Property("ModuleId") - .HasColumnType("int"); - - b.Property("Name") - .IsRequired() - .HasColumnType("longtext"); - - b.HasKey("Id"); - - b.HasIndex("ModuleId"); - - b.ToTable("Features"); - - b.HasData( - new - { - Id = new Guid("53176ebf-c75d-42e5-839f-4508ffac3def"), - Description = "Manage Project", - IsActive = true, - ModuleId = 1, - Name = "Manage Project" - }, - new - { - Id = new Guid("9666de86-d7c7-4d3d-acaa-fcd6d6b81f3c"), - Description = "Manage Infra", - IsActive = true, - ModuleId = 1, - Name = "Manage Infra" - }, - new - { - Id = new Guid("9d4b5489-2079-40b9-bd77-6e1bf90bc19f"), - Description = "Manage Tasks", - IsActive = true, - ModuleId = 1, - Name = "Manage Tasks" - }, - new - { - Id = new Guid("39e66f81-efc6-446c-95bd-46bff6cfb606"), - Description = "Assign and Update Tasks Progress", - IsActive = true, - ModuleId = 1, - Name = "Assign and Update Tasks Progress" - }, - new - { - Id = new Guid("81ab8a87-8ccd-4015-a917-0627cee6a100"), - Description = "Manage Employee", - IsActive = true, - ModuleId = 2, - Name = "Manage Employee" - }, - new - { - Id = new Guid("52c9cf54-1eb2-44d2-81bb-524cf29c0a94"), - Description = "Attendance", - IsActive = true, - ModuleId = 2, - Name = "Attendance" - }, - new - { - Id = new Guid("be3b3afc-6ccf-4566-b9b6-aafcb65546be"), - Description = "Global Masters", - IsActive = true, - ModuleId = 3, - Name = "Global Masters" - }, - new - { - Id = new Guid("660131a4-788c-4739-a082-cbbf7879cbf2"), - Description = "Tenant Masters", - IsActive = true, - ModuleId = 3, - Name = "Tenant Masters" - }); - }); - - modelBuilder.Entity("Marco.Pms.Model.Entitlements.FeaturePermission", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("char(36)"); - - b.Property("Description") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("FeatureId") - .HasColumnType("char(36)"); - - b.Property("IsEnabled") - .HasColumnType("tinyint(1)"); - - b.Property("Name") - .IsRequired() - .HasColumnType("longtext"); - - b.HasKey("Id"); - - b.HasIndex("FeatureId"); - - b.ToTable("FeaturePermissions"); - - b.HasData( - new - { - Id = new Guid("6ea44136-987e-44ba-9e5d-1cf8f5837ebc"), - Description = "", - FeatureId = new Guid("53176ebf-c75d-42e5-839f-4508ffac3def"), - IsEnabled = true, - Name = "View Project" - }, - new - { - Id = new Guid("172fc9b6-755b-4f62-ab26-55c34a330614"), - Description = "", - FeatureId = new Guid("53176ebf-c75d-42e5-839f-4508ffac3def"), - IsEnabled = true, - Name = "Manage Project" - }, - new - { - Id = new Guid("b94802ce-0689-4643-9e1d-11c86950c35b"), - Description = "", - FeatureId = new Guid("53176ebf-c75d-42e5-839f-4508ffac3def"), - IsEnabled = true, - Name = "Manage Team" - }, - new - { - Id = new Guid("c7b68e33-72f0-474f-bd96-77636427ecc8"), - Description = "", - FeatureId = new Guid("9666de86-d7c7-4d3d-acaa-fcd6d6b81f3c"), - IsEnabled = true, - Name = "View Project Infra" - }, - new - { - Id = new Guid("f2aee20a-b754-4537-8166-f9507b44585b"), - Description = "", - FeatureId = new Guid("9666de86-d7c7-4d3d-acaa-fcd6d6b81f3c"), - IsEnabled = true, - Name = "Manage Project Infra" - }, - new - { - Id = new Guid("9fcc5f87-25e3-4846-90ac-67a71ab92e3c"), - Description = "", - FeatureId = new Guid("9d4b5489-2079-40b9-bd77-6e1bf90bc19f"), - IsEnabled = true, - Name = "View Task" - }, - new - { - Id = new Guid("08752f33-3b29-4816-b76b-ea8a968ed3c5"), - Description = "", - FeatureId = new Guid("9d4b5489-2079-40b9-bd77-6e1bf90bc19f"), - IsEnabled = true, - Name = "Manage Task" - }, - new - { - Id = new Guid("d135a4b0-4f9a-4903-ab9c-4843839ebdee"), - Description = "", - FeatureId = new Guid("39e66f81-efc6-446c-95bd-46bff6cfb606"), - IsEnabled = true, - Name = "Assign Task and Report Progress" - }, - new - { - Id = new Guid("ed99ecd4-1bed-42e1-b7b3-d64c04493823"), - Description = "", - FeatureId = new Guid("39e66f81-efc6-446c-95bd-46bff6cfb606"), - IsEnabled = true, - Name = "Approve Task" - }, - new - { - Id = new Guid("b82d2b7e-0d52-45f3-997b-c008ea460e7f"), - Description = "", - FeatureId = new Guid("81ab8a87-8ccd-4015-a917-0627cee6a100"), - IsEnabled = true, - Name = "View Employee" - }, - new - { - Id = new Guid("a97d366a-c2bb-448d-be93-402bd2324566"), - Description = "", - FeatureId = new Guid("81ab8a87-8ccd-4015-a917-0627cee6a100"), - IsEnabled = true, - Name = "Manage Employee" - }, - new - { - Id = new Guid("fbd213e0-0250-46f1-9f5f-4b2a1e6e76a3"), - Description = "", - FeatureId = new Guid("81ab8a87-8ccd-4015-a917-0627cee6a100"), - IsEnabled = true, - Name = "Assign To Project" - }, - new - { - Id = new Guid("915e6bff-65f6-4e3f-aea8-3fd217d3ea9e"), - Description = "", - FeatureId = new Guid("52c9cf54-1eb2-44d2-81bb-524cf29c0a94"), - IsEnabled = true, - Name = "Perform Attendance " - }, - new - { - Id = new Guid("57802c4a-00aa-4a1f-a048-fd2f70dd44b6"), - Description = "", - FeatureId = new Guid("52c9cf54-1eb2-44d2-81bb-524cf29c0a94"), - IsEnabled = true, - Name = "Regularize Attendance" - }, - new - { - Id = new Guid("5ffbafe0-7ab0-48b1-bb50-c1bf76b65f9d"), - Description = "", - FeatureId = new Guid("be3b3afc-6ccf-4566-b9b6-aafcb65546be"), - IsEnabled = true, - Name = "View Masters" - }, - new - { - Id = new Guid("588a8824-f924-4955-82d8-fc51956cf323"), - Description = "", - FeatureId = new Guid("be3b3afc-6ccf-4566-b9b6-aafcb65546be"), - IsEnabled = true, - Name = "Manage Masters" - }, - new - { - Id = new Guid("cb8ec407-46d4-4467-930c-69127cda6dec"), - Description = "", - FeatureId = new Guid("660131a4-788c-4739-a082-cbbf7879cbf2"), - IsEnabled = true, - Name = "View Masters" - }, - new - { - Id = new Guid("6b1a6d97-a951-4de5-9b19-709bac7c4f18"), - Description = "", - FeatureId = new Guid("660131a4-788c-4739-a082-cbbf7879cbf2"), - IsEnabled = true, - Name = "Manage Masters" - }); - }); - - modelBuilder.Entity("Marco.Pms.Model.Entitlements.JobRole", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - - b.Property("Description") - .HasColumnType("longtext"); - - b.Property("Name") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("TenantId") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("TenantId"); - - b.ToTable("JobRoles"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Entitlements.Module", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - - b.Property("Description") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("Key") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("Name") - .IsRequired() - .HasColumnType("longtext"); - - b.HasKey("Id"); - - b.ToTable("Modules"); - - b.HasData( - new - { - Id = 1, - Description = "Project Module", - Key = "b04da7e9-0406-409c-ac7f-b97256e6ea02", - Name = "Project" - }, - new - { - Id = 2, - Description = "Employee Module", - Key = "0971c7fb-6ce1-458a-ae3f-8d3205893637", - Name = "Employee" - }, - new - { - Id = 3, - Description = "Masters Module", - Key = "504ec132-e6a9-422f-8f85-050602cfce05", - Name = "Masters" - }); - }); - - modelBuilder.Entity("Marco.Pms.Model.Entitlements.RolePermissionMappings", b => - { - b.Property("ApplicationRoleId") - .HasColumnType("char(36)"); - - b.Property("FeaturePermissionId") - .HasColumnType("char(36)"); - - b.HasKey("ApplicationRoleId", "FeaturePermissionId"); - - b.HasIndex("FeaturePermissionId"); - - b.ToTable("RolePermissionMappings"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Entitlements.StatusMaster", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - - b.Property("Status") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("TenantId") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("TenantId"); - - b.ToTable("StatusMasters"); - - b.HasData( - new - { - Id = 1, - Status = "Active", - TenantId = 1 - }, - new - { - Id = 2, - Status = "In Progress", - TenantId = 1 - }, - new - { - Id = 3, - Status = "On Hold", - TenantId = 1 - }, - new - { - Id = 4, - Status = "Completed", - TenantId = 1 - }); - }); - - modelBuilder.Entity("Marco.Pms.Model.Entitlements.Tenant", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - - b.Property("ContactName") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("ContactNumber") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("Description") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("DomainName") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("Name") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("OnBoardingDate") - .HasColumnType("datetime(6)"); - - b.HasKey("Id"); - - b.ToTable("Tenants"); - - b.HasData( - new - { - Id = 1, - ContactName = "Admin", - ContactNumber = "123456789", - Description = "", - DomainName = "www.marcobms.org", - Name = "MarcoBMS", - OnBoardingDate = new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified) - }); - }); - - modelBuilder.Entity("Marco.Pms.Model.Projects.Building", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - - b.Property("Description") - .HasColumnType("longtext"); - - b.Property("Name") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("ProjectId") - .HasColumnType("int"); - - b.Property("TenantId") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("TenantId"); - - b.ToTable("Buildings"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Projects.Floor", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - - b.Property("BuildingId") - .HasColumnType("int"); - - b.Property("FloorName") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("TenantId") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("BuildingId"); - - b.HasIndex("TenantId"); - - b.ToTable("Floor"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Projects.Project", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - - b.Property("ContactPerson") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("EndDate") - .HasColumnType("datetime(6)"); - - b.Property("Name") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("ProjectAddress") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("ProjectStatusId") - .HasColumnType("int"); - - b.Property("StartDate") - .HasColumnType("datetime(6)"); - - b.Property("TenantId") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("ProjectStatusId"); - - b.HasIndex("TenantId"); - - b.ToTable("Projects"); - - b.HasData( - new - { - Id = 1, - ContactPerson = "Project 1 Contact Person", - Name = "Project 1", - ProjectAddress = "Project 1 Address", - ProjectStatusId = 1, - TenantId = 1 - }, - new - { - Id = 2, - ContactPerson = "Project 2 Contact Person", - Name = "Project 2", - ProjectAddress = "Project 2 Address", - ProjectStatusId = 2, - TenantId = 1 - }, - new - { - Id = 3, - ContactPerson = "Project 3 Contact Person", - Name = "Project 3", - ProjectAddress = "Project 3 Address", - ProjectStatusId = 3, - TenantId = 1 - }); - }); - - modelBuilder.Entity("Marco.Pms.Model.Projects.ProjectAllocation", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - - b.Property("AllocationDate") - .HasColumnType("datetime(6)"); - - b.Property("EmployeeId") - .HasColumnType("int"); - - b.Property("IsActive") - .HasColumnType("tinyint(1)"); - - b.Property("JobRoleId") - .HasColumnType("int"); - - b.Property("ProjectId") - .HasColumnType("int"); - - b.Property("ReAllocationDate") - .HasColumnType("datetime(6)"); - - b.Property("TenantId") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("EmployeeId"); - - b.HasIndex("ProjectId"); - - b.HasIndex("TenantId"); - - b.ToTable("ProjectAllocations"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Projects.WorkArea", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - - b.Property("AreaName") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("FloorId") - .HasColumnType("int"); - - b.Property("TenantId") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("FloorId"); - - b.HasIndex("TenantId"); - - b.ToTable("WorkAreas"); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRole", b => - { - b.Property("Id") - .HasColumnType("varchar(255)"); - - b.Property("ConcurrencyStamp") - .IsConcurrencyToken() - .HasColumnType("longtext"); - - b.Property("Name") - .HasMaxLength(256) - .HasColumnType("varchar(256)"); - - b.Property("NormalizedName") - .HasMaxLength(256) - .HasColumnType("varchar(256)"); - - b.HasKey("Id"); - - b.HasIndex("NormalizedName") - .IsUnique() - .HasDatabaseName("RoleNameIndex"); - - b.ToTable("AspNetRoles", (string)null); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - - b.Property("ClaimType") - .HasColumnType("longtext"); - - b.Property("ClaimValue") - .HasColumnType("longtext"); - - b.Property("RoleId") - .IsRequired() - .HasColumnType("varchar(255)"); - - b.HasKey("Id"); - - b.HasIndex("RoleId"); - - b.ToTable("AspNetRoleClaims", (string)null); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUser", b => - { - b.Property("Id") - .HasColumnType("varchar(255)"); - - b.Property("AccessFailedCount") - .HasColumnType("int"); - - b.Property("ConcurrencyStamp") - .IsConcurrencyToken() - .HasColumnType("longtext"); - - b.Property("Discriminator") - .IsRequired() - .HasMaxLength(21) - .HasColumnType("varchar(21)"); - - b.Property("Email") - .HasMaxLength(256) - .HasColumnType("varchar(256)"); - - b.Property("EmailConfirmed") - .HasColumnType("tinyint(1)"); - - b.Property("LockoutEnabled") - .HasColumnType("tinyint(1)"); - - b.Property("LockoutEnd") - .HasColumnType("datetime(6)"); - - b.Property("NormalizedEmail") - .HasMaxLength(256) - .HasColumnType("varchar(256)"); - - b.Property("NormalizedUserName") - .HasMaxLength(256) - .HasColumnType("varchar(256)"); - - b.Property("PasswordHash") - .HasColumnType("longtext"); - - b.Property("PhoneNumber") - .HasColumnType("longtext"); - - b.Property("PhoneNumberConfirmed") - .HasColumnType("tinyint(1)"); - - b.Property("SecurityStamp") - .HasColumnType("longtext"); - - b.Property("TwoFactorEnabled") - .HasColumnType("tinyint(1)"); - - b.Property("UserName") - .HasMaxLength(256) - .HasColumnType("varchar(256)"); - - b.HasKey("Id"); - - b.HasIndex("NormalizedEmail") - .HasDatabaseName("EmailIndex"); - - b.HasIndex("NormalizedUserName") - .IsUnique() - .HasDatabaseName("UserNameIndex"); - - b.ToTable("AspNetUsers", (string)null); - - b.HasDiscriminator().HasValue("IdentityUser"); - - b.UseTphMappingStrategy(); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - - b.Property("ClaimType") - .HasColumnType("longtext"); - - b.Property("ClaimValue") - .HasColumnType("longtext"); - - b.Property("UserId") - .IsRequired() - .HasColumnType("varchar(255)"); - - b.HasKey("Id"); - - b.HasIndex("UserId"); - - b.ToTable("AspNetUserClaims", (string)null); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin", b => - { - b.Property("LoginProvider") - .HasColumnType("varchar(255)"); - - b.Property("ProviderKey") - .HasColumnType("varchar(255)"); - - b.Property("ProviderDisplayName") - .HasColumnType("longtext"); - - b.Property("UserId") - .IsRequired() - .HasColumnType("varchar(255)"); - - b.HasKey("LoginProvider", "ProviderKey"); - - b.HasIndex("UserId"); - - b.ToTable("AspNetUserLogins", (string)null); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole", b => - { - b.Property("UserId") - .HasColumnType("varchar(255)"); - - b.Property("RoleId") - .HasColumnType("varchar(255)"); - - b.HasKey("UserId", "RoleId"); - - b.HasIndex("RoleId"); - - b.ToTable("AspNetUserRoles", (string)null); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken", b => - { - b.Property("UserId") - .HasColumnType("varchar(255)"); - - b.Property("LoginProvider") - .HasColumnType("varchar(255)"); - - b.Property("Name") - .HasColumnType("varchar(255)"); - - b.Property("Value") - .HasColumnType("longtext"); - - b.HasKey("UserId", "LoginProvider", "Name"); - - b.ToTable("AspNetUserTokens", (string)null); - }); - - modelBuilder.Entity("Marco.Pms.Model.Entitlements.ApplicationUser", b => - { - b.HasBaseType("Microsoft.AspNetCore.Identity.IdentityUser"); - - b.Property("IsRootUser") - .HasColumnType("tinyint(1)"); - - b.Property("Role") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("TenantId") - .HasColumnType("int"); - - b.HasDiscriminator().HasValue("ApplicationUser"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Activities.TaskAllocation", b => - { - b.HasOne("Marco.Pms.Model.Projects.Building", "Building") - .WithMany() - .HasForeignKey("BuildingId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Marco.Pms.Model.Employees.Employee", "Employee") - .WithMany() - .HasForeignKey("EmployeeId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Marco.Pms.Model.Projects.Project", "Project") - .WithMany() - .HasForeignKey("ProjectId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Marco.Pms.Model.Entitlements.Tenant", "Tenant") - .WithMany() - .HasForeignKey("TenantId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Marco.Pms.Model.Projects.WorkArea", "WorkArea") - .WithMany() - .HasForeignKey("WorkAreaId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Building"); - - b.Navigation("Employee"); - - b.Navigation("Project"); - - b.Navigation("Tenant"); - - b.Navigation("WorkArea"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Activities.WorkItem", b => - { - b.HasOne("Marco.Pms.Model.Entitlements.ActivityMaster", "ActivityMaster") - .WithMany() - .HasForeignKey("ActivityId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Marco.Pms.Model.Entitlements.Tenant", "Tenant") - .WithMany() - .HasForeignKey("TenantId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Marco.Pms.Model.Projects.WorkArea", "WorkArea") - .WithMany() - .HasForeignKey("WorkAreaId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("ActivityMaster"); - - b.Navigation("Tenant"); - - b.Navigation("WorkArea"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Activities.WorkItemMapping", b => - { - b.HasOne("Marco.Pms.Model.Entitlements.Tenant", "Tenant") - .WithMany() - .HasForeignKey("TenantId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Marco.Pms.Model.Projects.WorkArea", "WorkArea") - .WithMany() - .HasForeignKey("WorkAreaId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Marco.Pms.Model.Activities.WorkItem", "WorkItem") - .WithMany() - .HasForeignKey("WorkItemId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Tenant"); - - b.Navigation("WorkArea"); - - b.Navigation("WorkItem"); - }); - - modelBuilder.Entity("Marco.Pms.Model.AttendanceModule.Attendance", b => - { - b.HasOne("Marco.Pms.Model.Employees.Employee", "Approver") - .WithMany() - .HasForeignKey("EmployeeID") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Marco.Pms.Model.Entitlements.Tenant", "Tenant") - .WithMany() - .HasForeignKey("TenantId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Approver"); - - b.Navigation("Tenant"); - }); - - modelBuilder.Entity("Marco.Pms.Model.AttendanceModule.AttendanceLog", b => - { - b.HasOne("Marco.Pms.Model.AttendanceModule.Attendance", "Attendance") - .WithMany() - .HasForeignKey("AttendanceId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Marco.Pms.Model.Employees.Employee", "Employee") - .WithMany() - .HasForeignKey("EmployeeID") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Marco.Pms.Model.Entitlements.Tenant", "Tenant") - .WithMany() - .HasForeignKey("TenantId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Marco.Pms.Model.Employees.Employee", "UpdatedByEmployee") - .WithMany() - .HasForeignKey("UpdatedBy"); - - b.Navigation("Attendance"); - - b.Navigation("Employee"); - - b.Navigation("Tenant"); - - b.Navigation("UpdatedByEmployee"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Authentication.RefreshToken", b => - { - b.HasOne("Microsoft.AspNetCore.Identity.IdentityUser", "User") - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("User"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Employees.Employee", b => - { - b.HasOne("Marco.Pms.Model.Entitlements.ApplicationUser", "ApplicationUser") - .WithMany() - .HasForeignKey("ApplicationUserId"); - - b.HasOne("Marco.Pms.Model.Entitlements.JobRole", "JobRole") - .WithMany() - .HasForeignKey("JobRoleId"); - - b.HasOne("Marco.Pms.Model.Entitlements.Tenant", "Tenant") - .WithMany() - .HasForeignKey("TenantId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("ApplicationUser"); - - b.Navigation("JobRole"); - - b.Navigation("Tenant"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Employees.WorkShift", b => - { - b.HasOne("Marco.Pms.Model.Entitlements.Tenant", "Tenant") - .WithMany() - .HasForeignKey("TenantId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Tenant"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Entitlements.ActivityMaster", b => - { - b.HasOne("Marco.Pms.Model.Activities.TaskAllocation", null) - .WithMany("AllotedTask") - .HasForeignKey("TaskAllocationId"); - - b.HasOne("Marco.Pms.Model.Entitlements.Tenant", "Tenant") - .WithMany() - .HasForeignKey("TenantId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Tenant"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Entitlements.ApplicationRole", b => - { - b.HasOne("Marco.Pms.Model.Entitlements.Tenant", null) - .WithMany() - .HasForeignKey("TenantId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Marco.Pms.Model.Entitlements.EmployeeRoleMapping", b => - { - b.HasOne("Marco.Pms.Model.Employees.Employee", "Employee") - .WithMany() - .HasForeignKey("EmployeeId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Marco.Pms.Model.Entitlements.ApplicationRole", "Role") - .WithMany() - .HasForeignKey("RoleId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Marco.Pms.Model.Entitlements.Tenant", "Tenant") - .WithMany() - .HasForeignKey("TenantId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Employee"); - - b.Navigation("Role"); - - b.Navigation("Tenant"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Entitlements.Feature", b => - { - b.HasOne("Marco.Pms.Model.Entitlements.Module", "Module") - .WithMany() - .HasForeignKey("ModuleId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Module"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Entitlements.FeaturePermission", b => - { - b.HasOne("Marco.Pms.Model.Entitlements.Feature", "Feature") - .WithMany("FeaturePermissions") - .HasForeignKey("FeatureId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Feature"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Entitlements.JobRole", b => - { - b.HasOne("Marco.Pms.Model.Entitlements.Tenant", "Tenant") - .WithMany() - .HasForeignKey("TenantId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Tenant"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Entitlements.RolePermissionMappings", b => - { - b.HasOne("Marco.Pms.Model.Entitlements.ApplicationRole", null) - .WithMany() - .HasForeignKey("ApplicationRoleId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Marco.Pms.Model.Entitlements.FeaturePermission", null) - .WithMany() - .HasForeignKey("FeaturePermissionId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Marco.Pms.Model.Entitlements.StatusMaster", b => - { - b.HasOne("Marco.Pms.Model.Entitlements.Tenant", "Tenant") - .WithMany() - .HasForeignKey("TenantId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Tenant"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Projects.Building", b => - { - b.HasOne("Marco.Pms.Model.Entitlements.Tenant", "Tenant") - .WithMany() - .HasForeignKey("TenantId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Tenant"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Projects.Floor", b => - { - b.HasOne("Marco.Pms.Model.Projects.Building", "Building") - .WithMany() - .HasForeignKey("BuildingId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Marco.Pms.Model.Entitlements.Tenant", "Tenant") - .WithMany() - .HasForeignKey("TenantId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Building"); - - b.Navigation("Tenant"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Projects.Project", b => - { - b.HasOne("Marco.Pms.Model.Entitlements.StatusMaster", "ProjectStatus") - .WithMany() - .HasForeignKey("ProjectStatusId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Marco.Pms.Model.Entitlements.Tenant", "Tenant") - .WithMany() - .HasForeignKey("TenantId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("ProjectStatus"); - - b.Navigation("Tenant"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Projects.ProjectAllocation", b => - { - b.HasOne("Marco.Pms.Model.Employees.Employee", "Employee") - .WithMany() - .HasForeignKey("EmployeeId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Marco.Pms.Model.Projects.Project", "Project") - .WithMany() - .HasForeignKey("ProjectId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Marco.Pms.Model.Entitlements.Tenant", "Tenant") - .WithMany() - .HasForeignKey("TenantId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Employee"); - - b.Navigation("Project"); - - b.Navigation("Tenant"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Projects.WorkArea", b => - { - b.HasOne("Marco.Pms.Model.Projects.Floor", "Floor") - .WithMany() - .HasForeignKey("FloorId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Marco.Pms.Model.Entitlements.Tenant", "Tenant") - .WithMany() - .HasForeignKey("TenantId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Floor"); - - b.Navigation("Tenant"); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim", b => - { - b.HasOne("Microsoft.AspNetCore.Identity.IdentityRole", null) - .WithMany() - .HasForeignKey("RoleId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim", b => - { - b.HasOne("Microsoft.AspNetCore.Identity.IdentityUser", null) - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin", b => - { - b.HasOne("Microsoft.AspNetCore.Identity.IdentityUser", null) - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole", b => - { - b.HasOne("Microsoft.AspNetCore.Identity.IdentityRole", null) - .WithMany() - .HasForeignKey("RoleId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Microsoft.AspNetCore.Identity.IdentityUser", null) - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken", b => - { - b.HasOne("Microsoft.AspNetCore.Identity.IdentityUser", null) - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Marco.Pms.Model.Activities.TaskAllocation", b => - { - b.Navigation("AllotedTask"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Entitlements.Feature", b => - { - b.Navigation("FeaturePermissions"); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/Marco.Pms.DataAccess/Migrations/20250318053416_addJobRoleIdInProjectAllocation.cs b/Marco.Pms.DataAccess/Migrations/20250318053416_addJobRoleIdInProjectAllocation.cs deleted file mode 100644 index 60ecfbf..0000000 --- a/Marco.Pms.DataAccess/Migrations/20250318053416_addJobRoleIdInProjectAllocation.cs +++ /dev/null @@ -1,40 +0,0 @@ -using System; -using Microsoft.EntityFrameworkCore.Migrations; - -#nullable disable - -namespace Marco.Pms.DataAccess.Migrations -{ - /// - public partial class addJobRoleIdInProjectAllocation : Migration - { - /// - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropColumn( - name: "EmployeeRoleId", - table: "ProjectAllocations"); - - migrationBuilder.AddColumn( - name: "JobRoleId", - table: "ProjectAllocations", - type: "int", - nullable: true); - } - - /// - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropColumn( - name: "JobRoleId", - table: "ProjectAllocations"); - - migrationBuilder.AddColumn( - name: "EmployeeRoleId", - table: "ProjectAllocations", - type: "char(36)", - nullable: true, - collation: "ascii_general_ci"); - } - } -} diff --git a/Marco.Pms.DataAccess/Migrations/20250321010050_addJoiningDateToEmployee.cs b/Marco.Pms.DataAccess/Migrations/20250321010050_addJoiningDateToEmployee.cs deleted file mode 100644 index 1bc5bee..0000000 --- a/Marco.Pms.DataAccess/Migrations/20250321010050_addJoiningDateToEmployee.cs +++ /dev/null @@ -1,29 +0,0 @@ -using System; -using Microsoft.EntityFrameworkCore.Migrations; - -#nullable disable - -namespace Marco.Pms.DataAccess.Migrations -{ - /// - public partial class addJoiningDateToEmployee : Migration - { - /// - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.AddColumn( - name: "JoiningDate", - table: "Employees", - type: "datetime(6)", - nullable: true); - } - - /// - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropColumn( - name: "JoiningDate", - table: "Employees"); - } - } -} diff --git a/Marco.Pms.DataAccess/Migrations/20250321010050_addJoiningDateToEmployee.Designer.cs b/Marco.Pms.DataAccess/Migrations/20250326054022_initmigration.Designer.cs similarity index 99% rename from Marco.Pms.DataAccess/Migrations/20250321010050_addJoiningDateToEmployee.Designer.cs rename to Marco.Pms.DataAccess/Migrations/20250326054022_initmigration.Designer.cs index f8f45ac..bb11114 100644 --- a/Marco.Pms.DataAccess/Migrations/20250321010050_addJoiningDateToEmployee.Designer.cs +++ b/Marco.Pms.DataAccess/Migrations/20250326054022_initmigration.Designer.cs @@ -12,8 +12,8 @@ using Microsoft.EntityFrameworkCore.Storage.ValueConversion; namespace Marco.Pms.DataAccess.Migrations { [DbContext(typeof(ApplicationDbContext))] - [Migration("20250321010050_addJoiningDateToEmployee")] - partial class addJoiningDateToEmployee + [Migration("20250326054022_initmigration")] + partial class initmigration { /// protected override void BuildTargetModel(ModelBuilder modelBuilder) diff --git a/Marco.Pms.DataAccess/Migrations/20250124111814_initiateapp.cs b/Marco.Pms.DataAccess/Migrations/20250326054022_initmigration.cs similarity index 78% rename from Marco.Pms.DataAccess/Migrations/20250124111814_initiateapp.cs rename to Marco.Pms.DataAccess/Migrations/20250326054022_initmigration.cs index 9b73bf4..f4e52b1 100644 --- a/Marco.Pms.DataAccess/Migrations/20250124111814_initiateapp.cs +++ b/Marco.Pms.DataAccess/Migrations/20250326054022_initmigration.cs @@ -9,7 +9,7 @@ using Microsoft.EntityFrameworkCore.Migrations; namespace Marco.Pms.DataAccess.Migrations { /// - public partial class initiateapp : Migration + public partial class initmigration : Migration { /// protected override void Up(MigrationBuilder migrationBuilder) @@ -77,6 +77,25 @@ namespace Marco.Pms.DataAccess.Migrations }) .Annotation("MySql:CharSet", "utf8mb4"); + migrationBuilder.CreateTable( + name: "Modules", + columns: table => new + { + Id = table.Column(type: "int", nullable: false) + .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), + Name = table.Column(type: "longtext", nullable: false) + .Annotation("MySql:CharSet", "utf8mb4"), + Description = table.Column(type: "longtext", nullable: false) + .Annotation("MySql:CharSet", "utf8mb4"), + Key = table.Column(type: "longtext", nullable: false) + .Annotation("MySql:CharSet", "utf8mb4") + }, + constraints: table => + { + table.PrimaryKey("PK_Modules", x => x.Id); + }) + .Annotation("MySql:CharSet", "utf8mb4"); + migrationBuilder.CreateTable( name: "Tenants", columns: table => new @@ -256,6 +275,53 @@ namespace Marco.Pms.DataAccess.Migrations }) .Annotation("MySql:CharSet", "utf8mb4"); + migrationBuilder.CreateTable( + name: "Features", + columns: table => new + { + Id = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), + ModuleId = table.Column(type: "int", nullable: false), + Name = table.Column(type: "longtext", nullable: false) + .Annotation("MySql:CharSet", "utf8mb4"), + Description = table.Column(type: "longtext", nullable: false) + .Annotation("MySql:CharSet", "utf8mb4"), + IsActive = table.Column(type: "tinyint(1)", nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_Features", x => x.Id); + table.ForeignKey( + name: "FK_Features_Modules_ModuleId", + column: x => x.ModuleId, + principalTable: "Modules", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + }) + .Annotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.CreateTable( + name: "ApplicationRoles", + columns: table => new + { + Id = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), + Role = table.Column(type: "longtext", nullable: false) + .Annotation("MySql:CharSet", "utf8mb4"), + Description = table.Column(type: "longtext", nullable: false) + .Annotation("MySql:CharSet", "utf8mb4"), + TenantId = table.Column(type: "int", nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_ApplicationRoles", x => x.Id); + table.ForeignKey( + name: "FK_ApplicationRoles_Tenants_TenantId", + column: x => x.TenantId, + principalTable: "Tenants", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + }) + .Annotation("MySql:CharSet", "utf8mb4"); + migrationBuilder.CreateTable( name: "Buildings", columns: table => new @@ -282,42 +348,22 @@ namespace Marco.Pms.DataAccess.Migrations .Annotation("MySql:CharSet", "utf8mb4"); migrationBuilder.CreateTable( - name: "EmployeeRoles", + name: "JobRoles", columns: table => new { - Id = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), - Role = table.Column(type: "longtext", nullable: false) - .Annotation("MySql:CharSet", "utf8mb4"), - TenantId = table.Column(type: "int", nullable: false) - }, - constraints: table => - { - table.PrimaryKey("PK_EmployeeRoles", x => x.Id); - table.ForeignKey( - name: "FK_EmployeeRoles_Tenants_TenantId", - column: x => x.TenantId, - principalTable: "Tenants", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); - }) - .Annotation("MySql:CharSet", "utf8mb4"); - - migrationBuilder.CreateTable( - name: "Feature", - columns: table => new - { - Id = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), + Id = table.Column(type: "int", nullable: false) + .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), Name = table.Column(type: "longtext", nullable: false) .Annotation("MySql:CharSet", "utf8mb4"), - Description = table.Column(type: "longtext", nullable: false) + Description = table.Column(type: "longtext", nullable: true) .Annotation("MySql:CharSet", "utf8mb4"), TenantId = table.Column(type: "int", nullable: false) }, constraints: table => { - table.PrimaryKey("PK_Feature", x => x.Id); + table.PrimaryKey("PK_JobRoles", x => x.Id); table.ForeignKey( - name: "FK_Feature_Tenants_TenantId", + name: "FK_JobRoles_Tenants_TenantId", column: x => x.TenantId, principalTable: "Tenants", principalColumn: "Id", @@ -371,6 +417,30 @@ namespace Marco.Pms.DataAccess.Migrations }) .Annotation("MySql:CharSet", "utf8mb4"); + migrationBuilder.CreateTable( + name: "FeaturePermissions", + columns: table => new + { + Id = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), + FeatureId = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), + Name = table.Column(type: "longtext", nullable: false) + .Annotation("MySql:CharSet", "utf8mb4"), + Description = table.Column(type: "longtext", nullable: false) + .Annotation("MySql:CharSet", "utf8mb4"), + IsEnabled = table.Column(type: "tinyint(1)", nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_FeaturePermissions", x => x.Id); + table.ForeignKey( + name: "FK_FeaturePermissions_Features_FeatureId", + column: x => x.FeatureId, + principalTable: "Features", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + }) + .Annotation("MySql:CharSet", "utf8mb4"); + migrationBuilder.CreateTable( name: "Floor", columns: table => new @@ -417,6 +487,7 @@ namespace Marco.Pms.DataAccess.Migrations Gender = table.Column(type: "longtext", nullable: false) .Annotation("MySql:CharSet", "utf8mb4"), BirthDate = table.Column(type: "datetime(6)", nullable: true), + JoiningDate = table.Column(type: "datetime(6)", nullable: true), PeramnentAddress = table.Column(type: "longtext", nullable: false) .Annotation("MySql:CharSet", "utf8mb4"), CurrentAddress = table.Column(type: "longtext", nullable: false) @@ -425,6 +496,8 @@ namespace Marco.Pms.DataAccess.Migrations .Annotation("MySql:CharSet", "utf8mb4"), EmergencyPhoneNumber = table.Column(type: "longtext", nullable: false) .Annotation("MySql:CharSet", "utf8mb4"), + EmergencyContactPerson = table.Column(type: "longtext", nullable: false) + .Annotation("MySql:CharSet", "utf8mb4"), AadharNumber = table.Column(type: "longtext", nullable: true) .Annotation("MySql:CharSet", "utf8mb4"), PanNumber = table.Column(type: "longtext", nullable: true) @@ -433,7 +506,9 @@ namespace Marco.Pms.DataAccess.Migrations ApplicationUserId = table.Column(type: "varchar(255)", nullable: true) .Annotation("MySql:CharSet", "utf8mb4"), TenantId = table.Column(type: "int", nullable: false), - RoleId = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci") + IsActive = table.Column(type: "tinyint(1)", nullable: false), + RoleId = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), + JobRoleId = table.Column(type: "int", nullable: true) }, constraints: table => { @@ -444,11 +519,10 @@ namespace Marco.Pms.DataAccess.Migrations principalTable: "AspNetUsers", principalColumn: "Id"); table.ForeignKey( - name: "FK_Employees_EmployeeRoles_RoleId", - column: x => x.RoleId, - principalTable: "EmployeeRoles", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); + name: "FK_Employees_JobRoles_JobRoleId", + column: x => x.JobRoleId, + principalTable: "JobRoles", + principalColumn: "Id"); table.ForeignKey( name: "FK_Employees_Tenants_TenantId", column: x => x.TenantId, @@ -458,40 +532,6 @@ namespace Marco.Pms.DataAccess.Migrations }) .Annotation("MySql:CharSet", "utf8mb4"); - migrationBuilder.CreateTable( - name: "FeaturePermission", - columns: table => new - { - Id = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), - FeatureId = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), - RoleId = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), - IsEnabled = table.Column(type: "tinyint(1)", nullable: false), - TenantId = table.Column(type: "int", nullable: false) - }, - constraints: table => - { - table.PrimaryKey("PK_FeaturePermission", x => x.Id); - table.ForeignKey( - name: "FK_FeaturePermission_EmployeeRoles_RoleId", - column: x => x.RoleId, - principalTable: "EmployeeRoles", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); - table.ForeignKey( - name: "FK_FeaturePermission_Feature_FeatureId", - column: x => x.FeatureId, - principalTable: "Feature", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); - table.ForeignKey( - name: "FK_FeaturePermission_Tenants_TenantId", - column: x => x.TenantId, - principalTable: "Tenants", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); - }) - .Annotation("MySql:CharSet", "utf8mb4"); - migrationBuilder.CreateTable( name: "Projects", columns: table => new @@ -527,6 +567,31 @@ namespace Marco.Pms.DataAccess.Migrations }) .Annotation("MySql:CharSet", "utf8mb4"); + migrationBuilder.CreateTable( + name: "RolePermissionMappings", + columns: table => new + { + ApplicationRoleId = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), + FeaturePermissionId = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci") + }, + constraints: table => + { + table.PrimaryKey("PK_RolePermissionMappings", x => new { x.ApplicationRoleId, x.FeaturePermissionId }); + table.ForeignKey( + name: "FK_RolePermissionMappings_ApplicationRoles_ApplicationRoleId", + column: x => x.ApplicationRoleId, + principalTable: "ApplicationRoles", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + table.ForeignKey( + name: "FK_RolePermissionMappings_FeaturePermissions_FeaturePermissionId", + column: x => x.FeaturePermissionId, + principalTable: "FeaturePermissions", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + }) + .Annotation("MySql:CharSet", "utf8mb4"); + migrationBuilder.CreateTable( name: "WorkAreas", columns: table => new @@ -557,7 +622,7 @@ namespace Marco.Pms.DataAccess.Migrations .Annotation("MySql:CharSet", "utf8mb4"); migrationBuilder.CreateTable( - name: "AttendanceLogs", + name: "Attendes", columns: table => new { Id = table.Column(type: "int", nullable: false) @@ -565,28 +630,61 @@ namespace Marco.Pms.DataAccess.Migrations Comment = table.Column(type: "longtext", nullable: false) .Annotation("MySql:CharSet", "utf8mb4"), EmployeeID = table.Column(type: "int", nullable: false), - CheckTime = table.Column(type: "datetime(6)", nullable: true), - IsCheckIn = table.Column(type: "tinyint(1)", nullable: false), - Photo = table.Column(type: "longblob", nullable: true), - Latitude = table.Column(type: "longtext", nullable: true) - .Annotation("MySql:CharSet", "utf8mb4"), - Longitude = table.Column(type: "longtext", nullable: true) - .Annotation("MySql:CharSet", "utf8mb4"), - TenantId = table.Column(type: "int", nullable: false), - UpdatedBy = table.Column(type: "longtext", nullable: true) - .Annotation("MySql:CharSet", "utf8mb4") + Date = table.Column(type: "datetime(6)", nullable: false), + ProjectID = table.Column(type: "int", nullable: false), + AttendanceDate = table.Column(type: "datetime(6)", nullable: false), + InTime = table.Column(type: "datetime(6)", nullable: true), + OutTime = table.Column(type: "datetime(6)", nullable: true), + IsApproved = table.Column(type: "tinyint(1)", nullable: false), + Activity = table.Column(type: "int", nullable: false), + ApprovedBy = table.Column(type: "int", nullable: true), + TenantId = table.Column(type: "int", nullable: false) }, constraints: table => { - table.PrimaryKey("PK_AttendanceLogs", x => x.Id); + table.PrimaryKey("PK_Attendes", x => x.Id); table.ForeignKey( - name: "FK_AttendanceLogs_Employees_EmployeeID", + name: "FK_Attendes_Employees_EmployeeID", column: x => x.EmployeeID, principalTable: "Employees", principalColumn: "Id", onDelete: ReferentialAction.Cascade); table.ForeignKey( - name: "FK_AttendanceLogs_Tenants_TenantId", + name: "FK_Attendes_Tenants_TenantId", + column: x => x.TenantId, + principalTable: "Tenants", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + }) + .Annotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.CreateTable( + name: "EmployeeRoleMappings", + columns: table => new + { + Id = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), + EmployeeId = table.Column(type: "int", nullable: false), + RoleId = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), + IsEnabled = table.Column(type: "tinyint(1)", nullable: false), + TenantId = table.Column(type: "int", nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_EmployeeRoleMappings", x => x.Id); + table.ForeignKey( + name: "FK_EmployeeRoleMappings_ApplicationRoles_RoleId", + column: x => x.RoleId, + principalTable: "ApplicationRoles", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + table.ForeignKey( + name: "FK_EmployeeRoleMappings_Employees_EmployeeId", + column: x => x.EmployeeId, + principalTable: "Employees", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + table.ForeignKey( + name: "FK_EmployeeRoleMappings_Tenants_TenantId", column: x => x.TenantId, principalTable: "Tenants", principalColumn: "Id", @@ -601,7 +699,8 @@ namespace Marco.Pms.DataAccess.Migrations Id = table.Column(type: "int", nullable: false) .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), EmployeeId = table.Column(type: "int", nullable: false), - EmployeeRoleId = table.Column(type: "char(36)", nullable: true, collation: "ascii_general_ci"), + JobRoleId = table.Column(type: "int", nullable: true), + IsActive = table.Column(type: "tinyint(1)", nullable: false), ProjectId = table.Column(type: "int", nullable: false), AllocationDate = table.Column(type: "datetime(6)", nullable: false), ReAllocationDate = table.Column(type: "datetime(6)", nullable: true), @@ -683,43 +782,48 @@ namespace Marco.Pms.DataAccess.Migrations .Annotation("MySql:CharSet", "utf8mb4"); migrationBuilder.CreateTable( - name: "Attendances", + name: "AttendanceLogs", columns: table => new { Id = table.Column(type: "int", nullable: false) .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), Comment = table.Column(type: "longtext", nullable: false) .Annotation("MySql:CharSet", "utf8mb4"), + AttendanceId = table.Column(type: "int", nullable: false), EmployeeID = table.Column(type: "int", nullable: false), - Date = table.Column(type: "datetime(6)", nullable: false), - InTimeID = table.Column(type: "int", nullable: true), - OutTimeID = table.Column(type: "int", nullable: true), - IsApproved = table.Column(type: "tinyint(1)", nullable: false), - ApprovedBy = table.Column(type: "longtext", nullable: true) + ActivityTime = table.Column(type: "datetime(6)", nullable: true), + Activity = table.Column(type: "int", nullable: false), + Photo = table.Column(type: "longblob", nullable: true), + Latitude = table.Column(type: "longtext", nullable: true) .Annotation("MySql:CharSet", "utf8mb4"), + Longitude = table.Column(type: "longtext", nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + UpdatedOn = table.Column(type: "datetime(6)", nullable: false), + UpdatedBy = table.Column(type: "int", nullable: true), TenantId = table.Column(type: "int", nullable: false) }, constraints: table => { - table.PrimaryKey("PK_Attendances", x => x.Id); + table.PrimaryKey("PK_AttendanceLogs", x => x.Id); table.ForeignKey( - name: "FK_Attendances_AttendanceLogs_InTimeID", - column: x => x.InTimeID, - principalTable: "AttendanceLogs", - principalColumn: "Id"); + name: "FK_AttendanceLogs_Attendes_AttendanceId", + column: x => x.AttendanceId, + principalTable: "Attendes", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); table.ForeignKey( - name: "FK_Attendances_AttendanceLogs_OutTimeID", - column: x => x.OutTimeID, - principalTable: "AttendanceLogs", - principalColumn: "Id"); - table.ForeignKey( - name: "FK_Attendances_Employees_EmployeeID", + name: "FK_AttendanceLogs_Employees_EmployeeID", column: x => x.EmployeeID, principalTable: "Employees", principalColumn: "Id", onDelete: ReferentialAction.Cascade); table.ForeignKey( - name: "FK_Attendances_Tenants_TenantId", + name: "FK_AttendanceLogs_Employees_UpdatedBy", + column: x => x.UpdatedBy, + principalTable: "Employees", + principalColumn: "Id"); + table.ForeignKey( + name: "FK_AttendanceLogs_Tenants_TenantId", column: x => x.TenantId, principalTable: "Tenants", principalColumn: "Id", @@ -828,6 +932,16 @@ namespace Marco.Pms.DataAccess.Migrations }) .Annotation("MySql:CharSet", "utf8mb4"); + migrationBuilder.InsertData( + table: "Modules", + columns: new[] { "Id", "Description", "Key", "Name" }, + values: new object[,] + { + { 1, "Project Module", "b04da7e9-0406-409c-ac7f-b97256e6ea02", "Project" }, + { 2, "Employee Module", "0971c7fb-6ce1-458a-ae3f-8d3205893637", "Employee" }, + { 3, "Masters Module", "504ec132-e6a9-422f-8f85-050602cfce05", "Masters" } + }); + migrationBuilder.InsertData( table: "Tenants", columns: new[] { "Id", "ContactName", "ContactNumber", "Description", "DomainName", "Name", "OnBoardingDate" }, @@ -855,15 +969,30 @@ namespace Marco.Pms.DataAccess.Migrations }); migrationBuilder.InsertData( - table: "EmployeeRoles", - columns: new[] { "Id", "Role", "TenantId" }, + table: "ApplicationRoles", + columns: new[] { "Id", "Description", "Role", "TenantId" }, values: new object[,] { - { new Guid("2c8d0808-c421-11ef-9b93-0242ac110002"), "Admin", 1 }, - { new Guid("62e0918d-c421-11ef-9b93-0242ac110002"), "Welder", 1 }, - { new Guid("68823f1f-c421-11ef-9b93-0242ac110002"), "Helper", 1 }, - { new Guid("6d3a7c72-c421-11ef-9b93-0242ac110002"), "Site Engineer", 1 }, - { new Guid("6d3aad72-c421-11ef-9b93-0242ac110002"), "Project Manager", 1 } + { new Guid("2c8d0808-c421-11ef-9b93-0242ac110002"), "", "Admin", 1 }, + { new Guid("62e0918d-c421-11ef-9b93-0242ac110002"), "", "Welder", 1 }, + { new Guid("68823f1f-c421-11ef-9b93-0242ac110002"), "", "Helper", 1 }, + { new Guid("6d3a7c72-c421-11ef-9b93-0242ac110002"), "", "Site Engineer", 1 }, + { new Guid("6d3aad72-c421-11ef-9b93-0242ac110002"), "", "Project Manager", 1 } + }); + + migrationBuilder.InsertData( + table: "Features", + columns: new[] { "Id", "Description", "IsActive", "ModuleId", "Name" }, + values: new object[,] + { + { new Guid("39e66f81-efc6-446c-95bd-46bff6cfb606"), "Assign and Update Tasks Progress", true, 1, "Assign and Update Tasks Progress" }, + { new Guid("52c9cf54-1eb2-44d2-81bb-524cf29c0a94"), "Attendance", true, 2, "Attendance" }, + { new Guid("53176ebf-c75d-42e5-839f-4508ffac3def"), "Manage Project", true, 1, "Manage Project" }, + { new Guid("660131a4-788c-4739-a082-cbbf7879cbf2"), "Tenant Masters", true, 3, "Tenant Masters" }, + { new Guid("81ab8a87-8ccd-4015-a917-0627cee6a100"), "Manage Employee", true, 2, "Manage Employee" }, + { new Guid("9666de86-d7c7-4d3d-acaa-fcd6d6b81f3c"), "Manage Infra", true, 1, "Manage Infra" }, + { new Guid("9d4b5489-2079-40b9-bd77-6e1bf90bc19f"), "Manage Tasks", true, 1, "Manage Tasks" }, + { new Guid("be3b3afc-6ccf-4566-b9b6-aafcb65546be"), "Global Masters", true, 3, "Global Masters" } }); migrationBuilder.InsertData( @@ -877,6 +1006,31 @@ namespace Marco.Pms.DataAccess.Migrations { 4, "Completed", 1 } }); + migrationBuilder.InsertData( + table: "FeaturePermissions", + columns: new[] { "Id", "Description", "FeatureId", "IsEnabled", "Name" }, + values: new object[,] + { + { new Guid("08752f33-3b29-4816-b76b-ea8a968ed3c5"), "", new Guid("9d4b5489-2079-40b9-bd77-6e1bf90bc19f"), true, "Manage Task" }, + { new Guid("172fc9b6-755b-4f62-ab26-55c34a330614"), "", new Guid("53176ebf-c75d-42e5-839f-4508ffac3def"), true, "Manage Project" }, + { new Guid("57802c4a-00aa-4a1f-a048-fd2f70dd44b6"), "", new Guid("52c9cf54-1eb2-44d2-81bb-524cf29c0a94"), true, "Regularize Attendance" }, + { new Guid("588a8824-f924-4955-82d8-fc51956cf323"), "", new Guid("be3b3afc-6ccf-4566-b9b6-aafcb65546be"), true, "Manage Masters" }, + { new Guid("5ffbafe0-7ab0-48b1-bb50-c1bf76b65f9d"), "", new Guid("be3b3afc-6ccf-4566-b9b6-aafcb65546be"), true, "View Masters" }, + { new Guid("6b1a6d97-a951-4de5-9b19-709bac7c4f18"), "", new Guid("660131a4-788c-4739-a082-cbbf7879cbf2"), true, "Manage Masters" }, + { new Guid("6ea44136-987e-44ba-9e5d-1cf8f5837ebc"), "", new Guid("53176ebf-c75d-42e5-839f-4508ffac3def"), true, "View Project" }, + { new Guid("915e6bff-65f6-4e3f-aea8-3fd217d3ea9e"), "", new Guid("52c9cf54-1eb2-44d2-81bb-524cf29c0a94"), true, "Perform Attendance " }, + { new Guid("9fcc5f87-25e3-4846-90ac-67a71ab92e3c"), "", new Guid("9d4b5489-2079-40b9-bd77-6e1bf90bc19f"), true, "View Task" }, + { new Guid("a97d366a-c2bb-448d-be93-402bd2324566"), "", new Guid("81ab8a87-8ccd-4015-a917-0627cee6a100"), true, "Manage Employee" }, + { new Guid("b82d2b7e-0d52-45f3-997b-c008ea460e7f"), "", new Guid("81ab8a87-8ccd-4015-a917-0627cee6a100"), true, "View Employee" }, + { new Guid("b94802ce-0689-4643-9e1d-11c86950c35b"), "", new Guid("53176ebf-c75d-42e5-839f-4508ffac3def"), true, "Manage Team" }, + { new Guid("c7b68e33-72f0-474f-bd96-77636427ecc8"), "", new Guid("9666de86-d7c7-4d3d-acaa-fcd6d6b81f3c"), true, "View Project Infra" }, + { new Guid("cb8ec407-46d4-4467-930c-69127cda6dec"), "", new Guid("660131a4-788c-4739-a082-cbbf7879cbf2"), true, "View Masters" }, + { new Guid("d135a4b0-4f9a-4903-ab9c-4843839ebdee"), "", new Guid("39e66f81-efc6-446c-95bd-46bff6cfb606"), true, "Assign Task and Report Progress" }, + { new Guid("ed99ecd4-1bed-42e1-b7b3-d64c04493823"), "", new Guid("39e66f81-efc6-446c-95bd-46bff6cfb606"), true, "Approve Task" }, + { new Guid("f2aee20a-b754-4537-8166-f9507b44585b"), "", new Guid("9666de86-d7c7-4d3d-acaa-fcd6d6b81f3c"), true, "Manage Project Infra" }, + { new Guid("fbd213e0-0250-46f1-9f5f-4b2a1e6e76a3"), "", new Guid("81ab8a87-8ccd-4015-a917-0627cee6a100"), true, "Assign To Project" } + }); + migrationBuilder.InsertData( table: "Projects", columns: new[] { "Id", "ContactPerson", "EndDate", "Name", "ProjectAddress", "ProjectStatusId", "StartDate", "TenantId" }, @@ -897,6 +1051,11 @@ namespace Marco.Pms.DataAccess.Migrations table: "ActivityMasters", column: "TenantId"); + migrationBuilder.CreateIndex( + name: "IX_ApplicationRoles_TenantId", + table: "ApplicationRoles", + column: "TenantId"); + migrationBuilder.CreateIndex( name: "IX_AspNetRoleClaims_RoleId", table: "AspNetRoleClaims", @@ -934,6 +1093,11 @@ namespace Marco.Pms.DataAccess.Migrations column: "NormalizedUserName", unique: true); + migrationBuilder.CreateIndex( + name: "IX_AttendanceLogs_AttendanceId", + table: "AttendanceLogs", + column: "AttendanceId"); + migrationBuilder.CreateIndex( name: "IX_AttendanceLogs_EmployeeID", table: "AttendanceLogs", @@ -945,23 +1109,18 @@ namespace Marco.Pms.DataAccess.Migrations column: "TenantId"); migrationBuilder.CreateIndex( - name: "IX_Attendances_EmployeeID", - table: "Attendances", + name: "IX_AttendanceLogs_UpdatedBy", + table: "AttendanceLogs", + column: "UpdatedBy"); + + migrationBuilder.CreateIndex( + name: "IX_Attendes_EmployeeID", + table: "Attendes", column: "EmployeeID"); migrationBuilder.CreateIndex( - name: "IX_Attendances_InTimeID", - table: "Attendances", - column: "InTimeID"); - - migrationBuilder.CreateIndex( - name: "IX_Attendances_OutTimeID", - table: "Attendances", - column: "OutTimeID"); - - migrationBuilder.CreateIndex( - name: "IX_Attendances_TenantId", - table: "Attendances", + name: "IX_Attendes_TenantId", + table: "Attendes", column: "TenantId"); migrationBuilder.CreateIndex( @@ -970,8 +1129,18 @@ namespace Marco.Pms.DataAccess.Migrations column: "TenantId"); migrationBuilder.CreateIndex( - name: "IX_EmployeeRoles_TenantId", - table: "EmployeeRoles", + name: "IX_EmployeeRoleMappings_EmployeeId", + table: "EmployeeRoleMappings", + column: "EmployeeId"); + + migrationBuilder.CreateIndex( + name: "IX_EmployeeRoleMappings_RoleId", + table: "EmployeeRoleMappings", + column: "RoleId"); + + migrationBuilder.CreateIndex( + name: "IX_EmployeeRoleMappings_TenantId", + table: "EmployeeRoleMappings", column: "TenantId"); migrationBuilder.CreateIndex( @@ -980,9 +1149,9 @@ namespace Marco.Pms.DataAccess.Migrations column: "ApplicationUserId"); migrationBuilder.CreateIndex( - name: "IX_Employees_RoleId", + name: "IX_Employees_JobRoleId", table: "Employees", - column: "RoleId"); + column: "JobRoleId"); migrationBuilder.CreateIndex( name: "IX_Employees_TenantId", @@ -990,24 +1159,14 @@ namespace Marco.Pms.DataAccess.Migrations column: "TenantId"); migrationBuilder.CreateIndex( - name: "IX_Feature_TenantId", - table: "Feature", - column: "TenantId"); - - migrationBuilder.CreateIndex( - name: "IX_FeaturePermission_FeatureId", - table: "FeaturePermission", + name: "IX_FeaturePermissions_FeatureId", + table: "FeaturePermissions", column: "FeatureId"); migrationBuilder.CreateIndex( - name: "IX_FeaturePermission_RoleId", - table: "FeaturePermission", - column: "RoleId"); - - migrationBuilder.CreateIndex( - name: "IX_FeaturePermission_TenantId", - table: "FeaturePermission", - column: "TenantId"); + name: "IX_Features_ModuleId", + table: "Features", + column: "ModuleId"); migrationBuilder.CreateIndex( name: "IX_Floor_BuildingId", @@ -1019,6 +1178,11 @@ namespace Marco.Pms.DataAccess.Migrations table: "Floor", column: "TenantId"); + migrationBuilder.CreateIndex( + name: "IX_JobRoles_TenantId", + table: "JobRoles", + column: "TenantId"); + migrationBuilder.CreateIndex( name: "IX_ProjectAllocations_EmployeeId", table: "ProjectAllocations", @@ -1049,6 +1213,11 @@ namespace Marco.Pms.DataAccess.Migrations table: "RefreshTokens", column: "UserId"); + migrationBuilder.CreateIndex( + name: "IX_RolePermissionMappings_FeaturePermissionId", + table: "RolePermissionMappings", + column: "FeaturePermissionId"); + migrationBuilder.CreateIndex( name: "IX_StatusMasters_TenantId", table: "StatusMasters", @@ -1144,10 +1313,10 @@ namespace Marco.Pms.DataAccess.Migrations name: "AspNetUserTokens"); migrationBuilder.DropTable( - name: "Attendances"); + name: "AttendanceLogs"); migrationBuilder.DropTable( - name: "FeaturePermission"); + name: "EmployeeRoleMappings"); migrationBuilder.DropTable( name: "ProjectAllocations"); @@ -1155,6 +1324,9 @@ namespace Marco.Pms.DataAccess.Migrations migrationBuilder.DropTable( name: "RefreshTokens"); + migrationBuilder.DropTable( + name: "RolePermissionMappings"); + migrationBuilder.DropTable( name: "WorkItemMapping"); @@ -1165,17 +1337,26 @@ namespace Marco.Pms.DataAccess.Migrations name: "AspNetRoles"); migrationBuilder.DropTable( - name: "AttendanceLogs"); + name: "Attendes"); migrationBuilder.DropTable( - name: "Feature"); + name: "ApplicationRoles"); + + migrationBuilder.DropTable( + name: "FeaturePermissions"); migrationBuilder.DropTable( name: "WorkItems"); + migrationBuilder.DropTable( + name: "Features"); + migrationBuilder.DropTable( name: "ActivityMasters"); + migrationBuilder.DropTable( + name: "Modules"); + migrationBuilder.DropTable( name: "TaskAllocations"); @@ -1192,7 +1373,7 @@ namespace Marco.Pms.DataAccess.Migrations name: "AspNetUsers"); migrationBuilder.DropTable( - name: "EmployeeRoles"); + name: "JobRoles"); migrationBuilder.DropTable( name: "StatusMasters");