diff --git a/Marco.Pms.DataAccess/Data/ApplicationDbContext.cs b/Marco.Pms.DataAccess/Data/ApplicationDbContext.cs index 1cb769f..0db8812 100644 --- a/Marco.Pms.DataAccess/Data/ApplicationDbContext.cs +++ b/Marco.Pms.DataAccess/Data/ApplicationDbContext.cs @@ -1,4 +1,5 @@ -using Marco.Pms.Model.Activities; +using System.Globalization; +using Marco.Pms.Model.Activities; using Marco.Pms.Model.AttendanceModule; using Marco.Pms.Model.Authentication; using Marco.Pms.Model.DocumentManager; @@ -95,48 +96,48 @@ namespace Marco.Pms.DataAccess.Data ManageApplicationStructure(modelBuilder); - modelBuilder.Entity().HasData( - new ApplicationRole - { - Id = new Guid("2c8d0808-c421-11ef-9b93-0242ac110002"), - Role = "Admin", - Description = "", - TenantId = 1 - }, - new ApplicationRole - { - Id = new Guid("62e0918d-c421-11ef-9b93-0242ac110002"), - Role = "Welder", - Description = "", + //modelBuilder.Entity().HasData( + // new ApplicationRole + // { + // Id = new Guid("2c8d0808-c421-11ef-9b93-0242ac110002"), + // Role = "Super User", + // Description = "Super User", + // TenantId = Guid.Parse("b3466e83-7e11-464c-b93a-daf047838b26") + // }, + // new ApplicationRole + // { + // Id = new Guid("62e0918d-c421-11ef-9b93-0242ac110002"), + // Role = "Welder", + // Description = "", - TenantId = 1 - }, - new ApplicationRole - { - Id = new Guid("68823f1f-c421-11ef-9b93-0242ac110002"), - Role = "Helper", - Description = "", + // TenantId = Guid.Parse("b3466e83-7e11-464c-b93a-daf047838b26") + // }, + // new ApplicationRole + // { + // Id = new Guid("68823f1f-c421-11ef-9b93-0242ac110002"), + // Role = "Helper", + // Description = "", - TenantId = 1 - }, - new ApplicationRole - { - Id = new Guid("6d3a7c72-c421-11ef-9b93-0242ac110002"), - Role = "Site Engineer", - Description = "", + // TenantId = Guid.Parse("b3466e83-7e11-464c-b93a-daf047838b26") + // }, + // new ApplicationRole + // { + // Id = new Guid("6d3a7c72-c421-11ef-9b93-0242ac110002"), + // Role = "Site Engineer", + // Description = "", - TenantId = 1 - } - , - new ApplicationRole - { - Id = new Guid("6d3aad72-c421-11ef-9b93-0242ac110002"), - Role = "Project Manager", - Description = "", + // TenantId = Guid.Parse("b3466e83-7e11-464c-b93a-daf047838b26") + // } + // , + // new ApplicationRole + // { + // Id = new Guid("6d3aad72-c421-11ef-9b93-0242ac110002"), + // Role = "Project Manager", + // Description = "", - TenantId = 1 - } - ); + // TenantId = Guid.Parse("b3466e83-7e11-464c-b93a-daf047838b26") + // } + // ); modelBuilder.Entity(entity => { @@ -148,60 +149,66 @@ namespace Marco.Pms.DataAccess.Data }); modelBuilder.Entity().HasData( - new Tenant { Id = 1, Name = "MarcoBMS", ContactName = "Admin", ContactNumber = "123456789", Description = "", DomainName = "www.marcobms.org", IndustryId = 1, OnBoardingDate = DateTime.MinValue } - ); + new Tenant { Id = Guid.Parse("b3466e83-7e11-464c-b93a-daf047838b26"), OragnizationSize = "100-200", Name = "MarcoBMS", ContactName = "Admin", ContactNumber = "123456789", Description = "", DomainName = "www.marcobms.org", IndustryId = Guid.Parse("15436ee3-a650-469e-bfc2-59993f7514bb"), OnBoardingDate = DateTime.MinValue } + ); modelBuilder.Entity().HasData( new StatusMaster { - Id = 1, + Id = new Guid("b74da4c2-d07e-46f2-9919-e75e49b12731"), Status = "Active", - TenantId = 1 + TenantId = Guid.Parse("b3466e83-7e11-464c-b93a-daf047838b26") }, new StatusMaster { - Id = 2, + Id = new Guid("603e994b-a27f-4e5d-a251-f3d69b0498ba"), Status = "In Progress", - TenantId = 1 + TenantId = Guid.Parse("b3466e83-7e11-464c-b93a-daf047838b26") }, new StatusMaster { - Id = 3, + Id = new Guid("ef1c356e-0fe0-42df-a5d3-8daee355492d"), Status = "On Hold", - TenantId = 1 + TenantId = Guid.Parse("b3466e83-7e11-464c-b93a-daf047838b26") }, new StatusMaster { - Id = 4, + Id = new Guid("33deaef9-9af1-4f2a-b443-681ea0d04f81"), Status = "Completed", - TenantId = 1 + TenantId = Guid.Parse("b3466e83-7e11-464c-b93a-daf047838b26") } ); modelBuilder.Entity().HasData( new Project { - Id = 1, + Id = new Guid("85bf587b-7ca9-4685-b77c-d817f5847e85"), Name = "Project 1", ProjectAddress = "Project 1 Address", ContactPerson = "Project 1 Contact Person", - ProjectStatusId = 1, - TenantId = 1 + StartDate = DateTime.ParseExact("2025-04-20 10:11:17.588000", "yyyy-MM-dd HH:mm:ss.ffffff", CultureInfo.InvariantCulture), + EndDate = DateTime.ParseExact("2026-04-20 10:11:17.588000", "yyyy-MM-dd HH:mm:ss.ffffff", CultureInfo.InvariantCulture), + ProjectStatusId = new Guid("b74da4c2-d07e-46f2-9919-e75e49b12731"), + TenantId = Guid.Parse("b3466e83-7e11-464c-b93a-daf047838b26") }, new Project { - Id = 2, + Id = new Guid("3ef56a12-f5e5-4193-87d6-9e110ed10b86"), Name = "Project 2", ProjectAddress = "Project 2 Address", ContactPerson = "Project 2 Contact Person", - ProjectStatusId = 2, - TenantId = 1 + StartDate = DateTime.ParseExact("2025-04-20 10:11:17.588000", "yyyy-MM-dd HH:mm:ss.ffffff", CultureInfo.InvariantCulture), + EndDate = DateTime.ParseExact("2026-04-20 10:11:17.588000", "yyyy-MM-dd HH:mm:ss.ffffff", CultureInfo.InvariantCulture), + ProjectStatusId = new Guid("ef1c356e-0fe0-42df-a5d3-8daee355492d"), + TenantId = Guid.Parse("b3466e83-7e11-464c-b93a-daf047838b26") }, new Project { - Id = 3, + Id = new Guid("54d013e3-0a2b-48be-85c7-5ef03492a18c"), Name = "Project 3", ProjectAddress = "Project 3 Address", ContactPerson = "Project 3 Contact Person", - ProjectStatusId = 3, - TenantId = 1 + StartDate = DateTime.ParseExact("2025-04-20 10:11:17.588000", "yyyy-MM-dd HH:mm:ss.ffffff", CultureInfo.InvariantCulture), + EndDate = DateTime.ParseExact("2026-04-20 10:11:17.588000", "yyyy-MM-dd HH:mm:ss.ffffff", CultureInfo.InvariantCulture), + ProjectStatusId = new Guid("33deaef9-9af1-4f2a-b443-681ea0d04f81"), + TenantId = Guid.Parse("b3466e83-7e11-464c-b93a-daf047838b26") }); @@ -211,100 +218,58 @@ namespace Marco.Pms.DataAccess.Data .HasData( new ActivityMaster { - Id = 1, + Id = new Guid("4117b7de-ef6c-461f-a2c2-64eaac5f9a11"), ActivityName = "Core Cutting", UnitOfMeasurement = UnitOfMeasurement.Number.ToString(), - TenantId = 1 + TenantId = Guid.Parse("b3466e83-7e11-464c-b93a-daf047838b26") }, new ActivityMaster { - Id = 2, + Id = new Guid("1714f64d-7591-4419-bee5-118d21bb2855"), ActivityName = "Fabrication", UnitOfMeasurement = UnitOfMeasurement.Meter.ToString(), - TenantId = 1 + TenantId = Guid.Parse("b3466e83-7e11-464c-b93a-daf047838b26") }, new ActivityMaster { - Id = 3, - ActivityName = "Lifting", - UnitOfMeasurement = UnitOfMeasurement.Meter.ToString(), - TenantId = 1 - }, new ActivityMaster - { - Id = 4, - ActivityName = "Hanging", - UnitOfMeasurement = UnitOfMeasurement.Meter.ToString(), - TenantId = 1 - }, new ActivityMaster - { - Id = 5, - ActivityName = "Tapping", - UnitOfMeasurement = UnitOfMeasurement.Meter.ToString(), - TenantId = 1 - }, new ActivityMaster - { - Id = 6, + Id = new Guid("b3f51a93-dde6-45f9-8b22-f1bf017a640b"), ActivityName = "Welding", UnitOfMeasurement = UnitOfMeasurement.Meter.ToString(), - TenantId = 1 + TenantId = Guid.Parse("b3466e83-7e11-464c-b93a-daf047838b26") }, new ActivityMaster { - Id = 7, - ActivityName = "Testing", - UnitOfMeasurement = UnitOfMeasurement.Area.ToString(), - TenantId = 1 - }, new ActivityMaster - { - Id = 8, - ActivityName = "Painting", - UnitOfMeasurement = UnitOfMeasurement.Meter.ToString(), - TenantId = 1 - }, new ActivityMaster - { - Id = 9, - ActivityName = "Marking Area", - UnitOfMeasurement = UnitOfMeasurement.Meter.ToString(), - TenantId = 1 - }, new ActivityMaster - { - Id = 10, - ActivityName = "Drilling", - UnitOfMeasurement = UnitOfMeasurement.Number.ToString(), - TenantId = 1 - }, new ActivityMaster - { - Id = 11, + Id = new Guid("53eedf44-4076-445f-be93-fedef17117e7"), ActivityName = "MS Support Fabrication", UnitOfMeasurement = UnitOfMeasurement.Number.ToString(), - TenantId = 1 + TenantId = Guid.Parse("b3466e83-7e11-464c-b93a-daf047838b26") }, new ActivityMaster { - Id = 12, + Id = new Guid("715b9ddb-d9e2-4afa-8987-d9918905cea4"), ActivityName = "MS Support Hanging", UnitOfMeasurement = UnitOfMeasurement.Number.ToString(), - TenantId = 1 + TenantId = Guid.Parse("b3466e83-7e11-464c-b93a-daf047838b26") }, new ActivityMaster { - Id = 13, + Id = new Guid("a3d191a7-a5aa-4dd8-a525-12c99263bbd6"), ActivityName = "Hydrant Volve", UnitOfMeasurement = UnitOfMeasurement.Number.ToString(), - TenantId = 1 + TenantId = Guid.Parse("b3466e83-7e11-464c-b93a-daf047838b26") }, new ActivityMaster { - Id = 14, + Id = new Guid("c138a7de-713a-4bd4-8292-b0b265be77a3"), ActivityName = "Sprinkler Installation", UnitOfMeasurement = UnitOfMeasurement.Number.ToString(), - TenantId = 1 + TenantId = Guid.Parse("b3466e83-7e11-464c-b93a-daf047838b26") } ); modelBuilder.Entity().HasData( - new Industry { Id = 1, Name = "Information Technology (IT) Services" }, - new Industry { Id = 2, Name = "Manufacturing & Production" }, - new Industry { Id = 3, Name = "Energy & Resources" }, - new Industry { Id = 4, Name = "Finance & Professional Services" }, - new Industry { Id = 5, Name = "Hospitals and Healthcare Services" }, - new Industry { Id = 6, Name = "Social Services" }, - new Industry { Id = 7, Name = "Retail & Consumer Services" }, - new Industry { Id = 8, Name = "Transportation & Logistics" }, - new Industry { Id = 9, Name = "Education & Training" } + new Industry { Id = Guid.Parse("15436ee3-a650-469e-bfc2-59993f7514bb"), Name = "Information Technology (IT) Services" }, + new Industry { Id = Guid.Parse("0a63e657-2c5f-49b5-854b-42c978293154"), Name = "Manufacturing & Production" }, + new Industry { Id = Guid.Parse("bdc61e3b-69ea-4394-bab6-079ec135b5bd"), Name = "Energy & Resources" }, + new Industry { Id = Guid.Parse("5ca200ac-00d7-415e-a410-b948e27ac9d2"), Name = "Finance & Professional Services" }, + new Industry { Id = Guid.Parse("d5621700-cd87-441f-8cdb-6051ddfc83b4"), Name = "Hospitals and Healthcare Services" }, + new Industry { Id = Guid.Parse("23608891-657e-40f0-bbd4-2b0a2ec1a76f"), Name = "Social Services" }, + new Industry { Id = Guid.Parse("a493f4e3-16b1-4411-be3c-6bf2987a3168"), Name = "Retail & Consumer Services" }, + new Industry { Id = Guid.Parse("e9d8ce92-9371-4ed9-9831-83c07f78edec"), Name = "Transportation & Logistics" }, + new Industry { Id = Guid.Parse("8a0d6134-2dbe-4e0a-b250-ff34cb7b9df0"), Name = "Education & Training" } ); modelBuilder.Entity().HasData( @@ -315,7 +280,7 @@ namespace Marco.Pms.DataAccess.Data Description = "This is a newly created issue.", ColorCode = "#FFCC99", IsDefault = true, - TenantId = 1 + TenantId = Guid.Parse("b3466e83-7e11-464c-b93a-daf047838b26") }, new TicketStatusMaster { @@ -324,7 +289,7 @@ namespace Marco.Pms.DataAccess.Data Description = "Assigned to employee or team of employees", ColorCode = "#E6FF99", IsDefault = true, - TenantId = 1 + TenantId = Guid.Parse("b3466e83-7e11-464c-b93a-daf047838b26") }, new TicketStatusMaster { @@ -333,7 +298,7 @@ namespace Marco.Pms.DataAccess.Data Description = "These issues are currently in progress", ColorCode = "#99E6FF", IsDefault = true, - TenantId = 1 + TenantId = Guid.Parse("b3466e83-7e11-464c-b93a-daf047838b26") }, new TicketStatusMaster { @@ -342,7 +307,7 @@ namespace Marco.Pms.DataAccess.Data Description = "These issues are currently under review", ColorCode = "#6c757d", IsDefault = true, - TenantId = 1 + TenantId = Guid.Parse("b3466e83-7e11-464c-b93a-daf047838b26") }, new TicketStatusMaster { @@ -351,7 +316,7 @@ namespace Marco.Pms.DataAccess.Data Description = "The following issues are resolved and closed", ColorCode = "#B399FF", IsDefault = true, - TenantId = 1 + TenantId = Guid.Parse("b3466e83-7e11-464c-b93a-daf047838b26") } ); modelBuilder.Entity().HasData( @@ -361,7 +326,7 @@ namespace Marco.Pms.DataAccess.Data Name = "Quality Issue", Description = "An identified problem that affects the performance, reliability, or standards of a product or service", IsDefault = true, - TenantId = 1 + TenantId = Guid.Parse("b3466e83-7e11-464c-b93a-daf047838b26") }, new TicketTypeMaster { @@ -369,7 +334,7 @@ namespace Marco.Pms.DataAccess.Data Name = "Help Desk", Description = "A support service that assists users with technical issues, requests, or inquiries.", IsDefault = true, - TenantId = 1 + TenantId = Guid.Parse("b3466e83-7e11-464c-b93a-daf047838b26") } ); modelBuilder.Entity().HasData( @@ -380,7 +345,7 @@ namespace Marco.Pms.DataAccess.Data ColorCode = "008000", Level = 1, IsDefault = true, - TenantId = 1 + TenantId = Guid.Parse("b3466e83-7e11-464c-b93a-daf047838b26") }, new TicketPriorityMaster { @@ -389,7 +354,7 @@ namespace Marco.Pms.DataAccess.Data ColorCode = "FFFF00", Level = 2, IsDefault = true, - TenantId = 1 + TenantId = Guid.Parse("b3466e83-7e11-464c-b93a-daf047838b26") }, new TicketPriorityMaster { Id = new Guid("a13b7e59-16fd-4665-b5cf-a97399e8445a"), @@ -397,7 +362,7 @@ namespace Marco.Pms.DataAccess.Data ColorCode = "#FFA500", Level = 3, IsDefault = true, - TenantId = 1 + TenantId = Guid.Parse("b3466e83-7e11-464c-b93a-daf047838b26") }, new TicketPriorityMaster { Id = new Guid("f340fbc3-c9fd-46aa-b063-0093418830e4"), @@ -405,7 +370,7 @@ namespace Marco.Pms.DataAccess.Data ColorCode = "#FFA500", Level = 4, IsDefault = true, - TenantId = 1 + TenantId = Guid.Parse("b3466e83-7e11-464c-b93a-daf047838b26") }, new TicketPriorityMaster { @@ -414,7 +379,7 @@ namespace Marco.Pms.DataAccess.Data ColorCode = "#FF0000", Level = 5, IsDefault = true, - TenantId = 1 + TenantId = Guid.Parse("b3466e83-7e11-464c-b93a-daf047838b26") } ); modelBuilder.Entity().HasData( @@ -424,7 +389,7 @@ namespace Marco.Pms.DataAccess.Data Name = "Quality Issue", ColorCode = "#e59866", IsDefault = true, - TenantId = 1 + TenantId = Guid.Parse("b3466e83-7e11-464c-b93a-daf047838b26") }, new TicketTagMaster { @@ -432,7 +397,7 @@ namespace Marco.Pms.DataAccess.Data Name = "Help Desk", ColorCode = "#85c1e9", IsDefault = true, - TenantId = 1 + TenantId = Guid.Parse("b3466e83-7e11-464c-b93a-daf047838b26") } ); } @@ -463,19 +428,19 @@ namespace Marco.Pms.DataAccess.Data modelBuilder.Entity().HasData(new Module { - Id = 1, + Id = new Guid("bf59fd88-b57a-4d67-bf01-3780f385896b"), Name = "Project", Description = "Project Module", Key = "b04da7e9-0406-409c-ac7f-b97256e6ea02" }, new Module { - Id = 2, + Id = new Guid("2a231490-bcb1-4bdd-91f1-f25fb7f25b23"), Name = "Employee", Description = "Employee Module", Key = "0971c7fb-6ce1-458a-ae3f-8d3205893637" }, new Module { - Id = 3, + Id = new Guid("c43db8c7-ab73-47f4-9d3b-f83e81357924"), Name = "Masters", Description = "Masters Module", Key = "504ec132-e6a9-422f-8f85-050602cfce05" @@ -484,19 +449,19 @@ namespace Marco.Pms.DataAccess.Data modelBuilder.Entity().HasData( - new Feature { Id = new Guid("53176ebf-c75d-42e5-839f-4508ffac3def"), Description = "Manage Project", Name = "Manage Project", ModuleId = 1, IsActive = true }, - new Feature { Id = new Guid("9666de86-d7c7-4d3d-acaa-fcd6d6b81f3c"), Description = "Manage Infra", Name = "Manage Infra", ModuleId = 1, IsActive = true }, + new Feature { Id = new Guid("53176ebf-c75d-42e5-839f-4508ffac3def"), Description = "Manage Project", Name = "Manage Project", ModuleId = new Guid("bf59fd88-b57a-4d67-bf01-3780f385896b"), IsActive = true }, + new Feature { Id = new Guid("9666de86-d7c7-4d3d-acaa-fcd6d6b81f3c"), Description = "Manage Infra", Name = "Manage Infra", ModuleId = new Guid("bf59fd88-b57a-4d67-bf01-3780f385896b"), IsActive = true }, - new Feature { Id = new Guid("9d4b5489-2079-40b9-bd77-6e1bf90bc19f"), Description = "Manage Tasks", Name = "Manage Tasks", ModuleId = 1, IsActive = true }, + new Feature { Id = new Guid("9d4b5489-2079-40b9-bd77-6e1bf90bc19f"), Description = "Manage Tasks", Name = "Manage Tasks", ModuleId = new Guid("bf59fd88-b57a-4d67-bf01-3780f385896b"), IsActive = true }, - new Feature { Id = new Guid("39e66f81-efc6-446c-95bd-46bff6cfb606"), Description = "Assign and Update Tasks Progress", Name = "Assign and Update Tasks Progress", ModuleId = 1, IsActive = true }, + new Feature { Id = new Guid("39e66f81-efc6-446c-95bd-46bff6cfb606"), Description = "Assign and Update Tasks Progress", Name = "Assign and Update Tasks Progress", ModuleId = new Guid("bf59fd88-b57a-4d67-bf01-3780f385896b"), IsActive = true }, - new Feature { Id = new Guid("81ab8a87-8ccd-4015-a917-0627cee6a100"), Description = "Manage Employee", Name = "Manage Employee", ModuleId = 2, IsActive = true }, - new Feature { Id = new Guid("52c9cf54-1eb2-44d2-81bb-524cf29c0a94"), Description = "Attendance", Name = "Attendance", ModuleId = 2, IsActive = true }, + new Feature { Id = new Guid("81ab8a87-8ccd-4015-a917-0627cee6a100"), Description = "Manage Employee", Name = "Manage Employee", ModuleId = new Guid("2a231490-bcb1-4bdd-91f1-f25fb7f25b23"), IsActive = true }, + new Feature { Id = new Guid("52c9cf54-1eb2-44d2-81bb-524cf29c0a94"), Description = "Attendance", Name = "Attendance", ModuleId = new Guid("2a231490-bcb1-4bdd-91f1-f25fb7f25b23"), IsActive = true }, - new Feature { Id = new Guid("be3b3afc-6ccf-4566-b9b6-aafcb65546be"), Description = "Global Masters", Name = "Global Masters", ModuleId = 3, IsActive = true }, - new Feature { Id = new Guid("660131a4-788c-4739-a082-cbbf7879cbf2"), Description = "Tenant Masters", Name = "Tenant Masters", ModuleId = 3, IsActive = true } + new Feature { Id = new Guid("be3b3afc-6ccf-4566-b9b6-aafcb65546be"), Description = "Global Masters", Name = "Global Masters", ModuleId = new Guid("c43db8c7-ab73-47f4-9d3b-f83e81357924"), IsActive = true }, + new Feature { Id = new Guid("660131a4-788c-4739-a082-cbbf7879cbf2"), Description = "Tenant Masters", Name = "Tenant Masters", ModuleId = new Guid("c43db8c7-ab73-47f4-9d3b-f83e81357924"), IsActive = true } ); modelBuilder.Entity().HasData( diff --git a/Marco.Pms.DataAccess/Initializer/DBInitializer.cs b/Marco.Pms.DataAccess/Initializer/DBInitializer.cs index 9115703..5c3dfd2 100644 --- a/Marco.Pms.DataAccess/Initializer/DBInitializer.cs +++ b/Marco.Pms.DataAccess/Initializer/DBInitializer.cs @@ -62,7 +62,7 @@ namespace Marco.Pms.DataAccess.Initializer // State = "State", // Postalcode = "1234567890", // City = "City", - TenantId = 1, + TenantId = Guid.Parse("b3466e83-7e11-464c-b93a-daf047838b26"), IsRootUser = true, }, "User@123").GetAwaiter().GetResult(); diff --git a/Marco.Pms.DataAccess/Marco.Pms.DataAccess.csproj b/Marco.Pms.DataAccess/Marco.Pms.DataAccess.csproj index 0a1fc83..e80b921 100644 --- a/Marco.Pms.DataAccess/Marco.Pms.DataAccess.csproj +++ b/Marco.Pms.DataAccess/Marco.Pms.DataAccess.csproj @@ -12,13 +12,6 @@ - - - - - - - @@ -32,8 +25,4 @@ - - - - diff --git a/Marco.Pms.DataAccess/Migrations/20250326054022_initmigration.Designer.cs b/Marco.Pms.DataAccess/Migrations/20250326054022_initmigration.Designer.cs deleted file mode 100644 index bb11114..0000000 --- a/Marco.Pms.DataAccess/Migrations/20250326054022_initmigration.Designer.cs +++ /dev/null @@ -1,1946 +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("20250326054022_initmigration")] - partial class initmigration - { - /// - 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("JoiningDate") - .HasColumnType("datetime(6)"); - - 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/20250331105744_Add_Industry_Table.Designer.cs b/Marco.Pms.DataAccess/Migrations/20250331105744_Add_Industry_Table.Designer.cs deleted file mode 100644 index 32d02de..0000000 --- a/Marco.Pms.DataAccess/Migrations/20250331105744_Add_Industry_Table.Designer.cs +++ /dev/null @@ -1,2031 +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("20250331105744_Add_Industry_Table")] - partial class Add_Industry_Table - { - /// - 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("JoiningDate") - .HasColumnType("datetime(6)"); - - 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("IndustryId") - .HasColumnType("int"); - - b.Property("IsActive") - .HasColumnType("tinyint(1)"); - - b.Property("Name") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("OnBoardingDate") - .HasColumnType("datetime(6)"); - - b.Property("OragnizationSize") - .HasColumnType("longtext"); - - b.HasKey("Id"); - - b.HasIndex("IndustryId"); - - b.ToTable("Tenants"); - - b.HasData( - new - { - Id = 1, - ContactName = "Admin", - ContactNumber = "123456789", - Description = "", - DomainName = "www.marcobms.org", - IndustryId = 1, - IsActive = true, - Name = "MarcoBMS", - OnBoardingDate = new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified) - }); - }); - - modelBuilder.Entity("Marco.Pms.Model.Industries.Industry", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - - b.Property("Name") - .IsRequired() - .HasColumnType("longtext"); - - b.HasKey("Id"); - - b.ToTable("Industries"); - - b.HasData( - new - { - Id = 1, - Name = "Information Technology (IT) Services" - }, - new - { - Id = 2, - Name = "Manufacturing & Production" - }, - new - { - Id = 3, - Name = "Energy & Resources" - }, - new - { - Id = 4, - Name = "Finance & Professional Services" - }, - new - { - Id = 5, - Name = "Hospitals and Healthcare Services" - }, - new - { - Id = 6, - Name = "Social Services" - }, - new - { - Id = 7, - Name = "Retail & Consumer Services" - }, - new - { - Id = 8, - Name = "Transportation & Logistics" - }, - new - { - Id = 9, - Name = "Education & Training" - }); - }); - - 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("IsActive") - .HasColumnType("tinyint(1)"); - - b.Property("IsRootUser") - .HasColumnType("tinyint(1)"); - - 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.Entitlements.Tenant", b => - { - b.HasOne("Marco.Pms.Model.Industries.Industry", "Industry") - .WithMany() - .HasForeignKey("IndustryId"); - - b.Navigation("Industry"); - }); - - 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/20250331105744_Add_Industry_Table.cs b/Marco.Pms.DataAccess/Migrations/20250331105744_Add_Industry_Table.cs deleted file mode 100644 index 9fc39a3..0000000 --- a/Marco.Pms.DataAccess/Migrations/20250331105744_Add_Industry_Table.cs +++ /dev/null @@ -1,135 +0,0 @@ -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 Add_Industry_Table : Migration - { - /// - protected override void Up(MigrationBuilder migrationBuilder) - { - //migrationBuilder.DropColumn( - // name: "Role", - // table: "AspNetUsers"); - - migrationBuilder.AddColumn( - name: "IndustryId", - table: "Tenants", - type: "int", - nullable: true); - - migrationBuilder.AddColumn( - name: "IsActive", - table: "Tenants", - type: "tinyint(1)", - nullable: false, - defaultValue: false); - - migrationBuilder.AddColumn( - name: "OragnizationSize", - table: "Tenants", - type: "longtext", - nullable: true) - .Annotation("MySql:CharSet", "utf8mb4"); - - migrationBuilder.AddColumn( - name: "IsActive", - table: "AspNetUsers", - type: "tinyint(1)", - nullable: true); - - migrationBuilder.CreateTable( - name: "Industries", - 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") - }, - constraints: table => - { - table.PrimaryKey("PK_Industries", x => x.Id); - }) - .Annotation("MySql:CharSet", "utf8mb4"); - - migrationBuilder.InsertData( - table: "Industries", - columns: new[] { "Id", "Name" }, - values: new object[,] - { - { 1, "Information Technology (IT) Services" }, - { 2, "Manufacturing & Production" }, - { 3, "Energy & Resources" }, - { 4, "Finance & Professional Services" }, - { 5, "Hospitals and Healthcare Services" }, - { 6, "Social Services" }, - { 7, "Retail & Consumer Services" }, - { 8, "Transportation & Logistics" }, - { 9, "Education & Training" } - }); - - migrationBuilder.UpdateData( - table: "Tenants", - keyColumn: "Id", - keyValue: 1, - columns: new[] { "IndustryId", "IsActive", "OragnizationSize" }, - values: new object[] { 1, true, null }); - - migrationBuilder.CreateIndex( - name: "IX_Tenants_IndustryId", - table: "Tenants", - column: "IndustryId"); - - migrationBuilder.AddForeignKey( - name: "FK_Tenants_Industries_IndustryId", - table: "Tenants", - column: "IndustryId", - principalTable: "Industries", - principalColumn: "Id"); - } - - /// - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropForeignKey( - name: "FK_Tenants_Industries_IndustryId", - table: "Tenants"); - - migrationBuilder.DropTable( - name: "Industries"); - - migrationBuilder.DropIndex( - name: "IX_Tenants_IndustryId", - table: "Tenants"); - - migrationBuilder.DropColumn( - name: "IndustryId", - table: "Tenants"); - - migrationBuilder.DropColumn( - name: "IsActive", - table: "Tenants"); - - migrationBuilder.DropColumn( - name: "OragnizationSize", - table: "Tenants"); - - migrationBuilder.DropColumn( - name: "IsActive", - table: "AspNetUsers"); - - migrationBuilder.AddColumn( - name: "Role", - table: "AspNetUsers", - type: "longtext", - nullable: true) - .Annotation("MySql:CharSet", "utf8mb4"); - } - } -} diff --git a/Marco.Pms.DataAccess/Migrations/20250402124701_TaskAllocationModels.Designer.cs b/Marco.Pms.DataAccess/Migrations/20250402124701_TaskAllocationModels.Designer.cs deleted file mode 100644 index 1ae3e22..0000000 --- a/Marco.Pms.DataAccess/Migrations/20250402124701_TaskAllocationModels.Designer.cs +++ /dev/null @@ -1,2128 +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("20250402124701_TaskAllocationModels")] - partial class TaskAllocationModels - { - /// - 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("bigint"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - - b.Property("AssignedBy") - .HasColumnType("int"); - - b.Property("AssignmentDate") - .HasColumnType("datetime(6)"); - - b.Property("CompletedTask") - .HasColumnType("double"); - - b.Property("Description") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("PlannedTask") - .HasColumnType("double"); - - b.Property("ReportedDate") - .HasColumnType("datetime(6)"); - - b.Property("TenantId") - .HasColumnType("int"); - - b.Property("WorkItemId") - .HasColumnType("int"); - - b.Property("WorkItemMappingId") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("AssignedBy"); - - b.HasIndex("TenantId"); - - b.HasIndex("WorkItemId"); - - b.HasIndex("WorkItemMappingId"); - - b.ToTable("TaskAllocations"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Activities.TaskComment", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - - b.Property("Comment") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("CommentDate") - .HasColumnType("datetime(6)"); - - b.Property("CommentedBy") - .HasColumnType("int"); - - b.Property("TaskAllocationId") - .HasColumnType("bigint"); - - b.Property("TenantId") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("CommentedBy"); - - b.HasIndex("TaskAllocationId"); - - b.HasIndex("TenantId"); - - b.ToTable("TaskComments"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Activities.TaskMembers", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - - b.Property("EmployeeId") - .HasColumnType("int"); - - b.Property("TaskAllocationId") - .HasColumnType("bigint"); - - b.Property("TenantId") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("EmployeeId"); - - b.HasIndex("TaskAllocationId"); - - b.HasIndex("TenantId"); - - b.ToTable("TaskMembers"); - }); - - 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("JoiningDate") - .HasColumnType("datetime(6)"); - - 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("TenantId") - .HasColumnType("int"); - - b.Property("UnitOfMeasurement") - .IsRequired() - .HasColumnType("longtext"); - - b.HasKey("Id"); - - 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("IndustryId") - .HasColumnType("int"); - - b.Property("IsActive") - .HasColumnType("tinyint(1)"); - - b.Property("Name") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("OnBoardingDate") - .HasColumnType("datetime(6)"); - - b.Property("OragnizationSize") - .HasColumnType("longtext"); - - b.HasKey("Id"); - - b.HasIndex("IndustryId"); - - b.ToTable("Tenants"); - - b.HasData( - new - { - Id = 1, - ContactName = "Admin", - ContactNumber = "123456789", - Description = "", - DomainName = "www.marcobms.org", - IndustryId = 1, - IsActive = true, - Name = "MarcoBMS", - OnBoardingDate = new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified) - }); - }); - - modelBuilder.Entity("Marco.Pms.Model.Industries.Industry", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - - b.Property("Name") - .IsRequired() - .HasColumnType("longtext"); - - b.HasKey("Id"); - - b.ToTable("Industries"); - - b.HasData( - new - { - Id = 1, - Name = "Information Technology (IT) Services" - }, - new - { - Id = 2, - Name = "Manufacturing & Production" - }, - new - { - Id = 3, - Name = "Energy & Resources" - }, - new - { - Id = 4, - Name = "Finance & Professional Services" - }, - new - { - Id = 5, - Name = "Hospitals and Healthcare Services" - }, - new - { - Id = 6, - Name = "Social Services" - }, - new - { - Id = 7, - Name = "Retail & Consumer Services" - }, - new - { - Id = 8, - Name = "Transportation & Logistics" - }, - new - { - Id = 9, - Name = "Education & Training" - }); - }); - - 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("Marco.Pms.Model.Projects.WorkItem", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - - b.Property("ActivityId") - .HasColumnType("int"); - - b.Property("CompletedWork") - .HasColumnType("double"); - - b.Property("PlannedWork") - .HasColumnType("double"); - - 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.Projects.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("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("IsActive") - .HasColumnType("tinyint(1)"); - - b.Property("IsRootUser") - .HasColumnType("tinyint(1)"); - - b.Property("TenantId") - .HasColumnType("int"); - - b.HasDiscriminator().HasValue("ApplicationUser"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Activities.TaskAllocation", b => - { - b.HasOne("Marco.Pms.Model.Employees.Employee", "Employee") - .WithMany() - .HasForeignKey("AssignedBy") - .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.WorkItem", "WorkItem") - .WithMany() - .HasForeignKey("WorkItemId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Marco.Pms.Model.Projects.WorkItemMapping", "WorkItemMapping") - .WithMany() - .HasForeignKey("WorkItemMappingId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Employee"); - - b.Navigation("Tenant"); - - b.Navigation("WorkItem"); - - b.Navigation("WorkItemMapping"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Activities.TaskComment", b => - { - b.HasOne("Marco.Pms.Model.Employees.Employee", "Employee") - .WithMany() - .HasForeignKey("CommentedBy") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Marco.Pms.Model.Activities.TaskAllocation", "TaskAllocation") - .WithMany() - .HasForeignKey("TaskAllocationId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Marco.Pms.Model.Entitlements.Tenant", "Tenant") - .WithMany() - .HasForeignKey("TenantId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Employee"); - - b.Navigation("TaskAllocation"); - - b.Navigation("Tenant"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Activities.TaskMembers", b => - { - b.HasOne("Marco.Pms.Model.Employees.Employee", "Employee") - .WithMany() - .HasForeignKey("EmployeeId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Marco.Pms.Model.Activities.TaskAllocation", "TaskAllocation") - .WithMany() - .HasForeignKey("TaskAllocationId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Marco.Pms.Model.Entitlements.Tenant", "Tenant") - .WithMany() - .HasForeignKey("TenantId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Employee"); - - b.Navigation("TaskAllocation"); - - 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.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.Entitlements.Tenant", b => - { - b.HasOne("Marco.Pms.Model.Industries.Industry", "Industry") - .WithMany() - .HasForeignKey("IndustryId"); - - b.Navigation("Industry"); - }); - - 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("Marco.Pms.Model.Projects.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.Projects.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.Projects.WorkItem", "WorkItem") - .WithMany() - .HasForeignKey("WorkItemId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Tenant"); - - b.Navigation("WorkArea"); - - b.Navigation("WorkItem"); - }); - - 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.Entitlements.Feature", b => - { - b.Navigation("FeaturePermissions"); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/Marco.Pms.DataAccess/Migrations/20250402124701_TaskAllocationModels.cs b/Marco.Pms.DataAccess/Migrations/20250402124701_TaskAllocationModels.cs deleted file mode 100644 index 0762084..0000000 --- a/Marco.Pms.DataAccess/Migrations/20250402124701_TaskAllocationModels.cs +++ /dev/null @@ -1,543 +0,0 @@ -using System; -using Microsoft.EntityFrameworkCore.Metadata; -using Microsoft.EntityFrameworkCore.Migrations; - -#nullable disable - -namespace Marco.Pms.DataAccess.Migrations -{ - /// - public partial class TaskAllocationModels : Migration - { - /// - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropForeignKey( - name: "FK_ActivityMasters_TaskAllocations_TaskAllocationId", - table: "ActivityMasters"); - - migrationBuilder.DropForeignKey( - name: "FK_TaskAllocations_Buildings_BuildingId", - table: "TaskAllocations"); - - migrationBuilder.DropForeignKey( - name: "FK_TaskAllocations_Employees_EmployeeId", - table: "TaskAllocations"); - - migrationBuilder.DropForeignKey( - name: "FK_TaskAllocations_Projects_ProjectId", - table: "TaskAllocations"); - - migrationBuilder.DropForeignKey( - name: "FK_TaskAllocations_WorkAreas_WorkAreaId", - table: "TaskAllocations"); - - migrationBuilder.DropIndex( - name: "IX_TaskAllocations_BuildingId", - table: "TaskAllocations"); - - migrationBuilder.DropIndex( - name: "IX_TaskAllocations_EmployeeId", - table: "TaskAllocations"); - - migrationBuilder.DropIndex( - name: "IX_ActivityMasters_TaskAllocationId", - table: "ActivityMasters"); - - migrationBuilder.DropColumn( - name: "BuildingId", - table: "TaskAllocations"); - - migrationBuilder.DropColumn( - name: "EmployeeId", - table: "TaskAllocations"); - - migrationBuilder.DropColumn( - name: "TaskAllocationId", - table: "ActivityMasters"); - - migrationBuilder.RenameColumn( - name: "WorkAreaId", - table: "TaskAllocations", - newName: "WorkItemMappingId"); - - migrationBuilder.RenameColumn( - name: "ReAllocationDate", - table: "TaskAllocations", - newName: "ReportedDate"); - - migrationBuilder.RenameColumn( - name: "ProjectId", - table: "TaskAllocations", - newName: "WorkItemId"); - - migrationBuilder.RenameColumn( - name: "EmployeeRole", - table: "TaskAllocations", - newName: "AssignedBy"); - - migrationBuilder.RenameColumn( - name: "AllocationDate", - table: "TaskAllocations", - newName: "AssignmentDate"); - - migrationBuilder.RenameIndex( - name: "IX_TaskAllocations_WorkAreaId", - table: "TaskAllocations", - newName: "IX_TaskAllocations_WorkItemMappingId"); - - migrationBuilder.RenameIndex( - name: "IX_TaskAllocations_ProjectId", - table: "TaskAllocations", - newName: "IX_TaskAllocations_WorkItemId"); - - migrationBuilder.AlterColumn( - name: "PlannedWork", - table: "WorkItems", - type: "double", - nullable: false, - oldClrType: typeof(int), - oldType: "int"); - - migrationBuilder.AlterColumn( - name: "CompletedWork", - table: "WorkItems", - type: "double", - nullable: false, - oldClrType: typeof(int), - oldType: "int"); - - migrationBuilder.AlterColumn( - name: "Id", - table: "TaskAllocations", - type: "bigint", - nullable: false, - oldClrType: typeof(int), - oldType: "int") - .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn) - .OldAnnotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn); - - migrationBuilder.AddColumn( - name: "CompletedTask", - table: "TaskAllocations", - type: "double", - nullable: false, - defaultValue: 0.0); - - migrationBuilder.AddColumn( - name: "Description", - table: "TaskAllocations", - type: "longtext", - nullable: false) - .Annotation("MySql:CharSet", "utf8mb4"); - - migrationBuilder.AddColumn( - name: "PlannedTask", - table: "TaskAllocations", - type: "double", - nullable: false, - defaultValue: 0.0); - - migrationBuilder.CreateTable( - name: "TaskComments", - columns: table => new - { - Id = table.Column(type: "bigint", nullable: false) - .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), - TaskAllocationId = table.Column(type: "bigint", nullable: false), - CommentDate = table.Column(type: "datetime(6)", nullable: false), - Comment = table.Column(type: "longtext", nullable: false) - .Annotation("MySql:CharSet", "utf8mb4"), - CommentedBy = table.Column(type: "int", nullable: false), - TenantId = table.Column(type: "int", nullable: false) - }, - constraints: table => - { - table.PrimaryKey("PK_TaskComments", x => x.Id); - table.ForeignKey( - name: "FK_TaskComments_Employees_CommentedBy", - column: x => x.CommentedBy, - principalTable: "Employees", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); - table.ForeignKey( - name: "FK_TaskComments_TaskAllocations_TaskAllocationId", - column: x => x.TaskAllocationId, - principalTable: "TaskAllocations", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); - table.ForeignKey( - name: "FK_TaskComments_Tenants_TenantId", - column: x => x.TenantId, - principalTable: "Tenants", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); - }) - .Annotation("MySql:CharSet", "utf8mb4"); - - migrationBuilder.CreateTable( - name: "TaskMembers", - columns: table => new - { - Id = table.Column(type: "bigint", nullable: false) - .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), - TaskAllocationId = table.Column(type: "bigint", nullable: false), - EmployeeId = table.Column(type: "int", nullable: false), - TenantId = table.Column(type: "int", nullable: false) - }, - constraints: table => - { - table.PrimaryKey("PK_TaskMembers", x => x.Id); - table.ForeignKey( - name: "FK_TaskMembers_Employees_EmployeeId", - column: x => x.EmployeeId, - principalTable: "Employees", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); - table.ForeignKey( - name: "FK_TaskMembers_TaskAllocations_TaskAllocationId", - column: x => x.TaskAllocationId, - principalTable: "TaskAllocations", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); - table.ForeignKey( - name: "FK_TaskMembers_Tenants_TenantId", - column: x => x.TenantId, - principalTable: "Tenants", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); - }) - .Annotation("MySql:CharSet", "utf8mb4"); - - migrationBuilder.CreateIndex( - name: "IX_TaskAllocations_AssignedBy", - table: "TaskAllocations", - column: "AssignedBy"); - - migrationBuilder.CreateIndex( - name: "IX_TaskComments_CommentedBy", - table: "TaskComments", - column: "CommentedBy"); - - migrationBuilder.CreateIndex( - name: "IX_TaskComments_TaskAllocationId", - table: "TaskComments", - column: "TaskAllocationId"); - - migrationBuilder.CreateIndex( - name: "IX_TaskComments_TenantId", - table: "TaskComments", - column: "TenantId"); - - migrationBuilder.CreateIndex( - name: "IX_TaskMembers_EmployeeId", - table: "TaskMembers", - column: "EmployeeId"); - - migrationBuilder.CreateIndex( - name: "IX_TaskMembers_TaskAllocationId", - table: "TaskMembers", - column: "TaskAllocationId"); - - migrationBuilder.CreateIndex( - name: "IX_TaskMembers_TenantId", - table: "TaskMembers", - column: "TenantId"); - - migrationBuilder.AddForeignKey( - name: "FK_TaskAllocations_Employees_AssignedBy", - table: "TaskAllocations", - column: "AssignedBy", - principalTable: "Employees", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); - - migrationBuilder.AddForeignKey( - name: "FK_TaskAllocations_WorkItemMapping_WorkItemMappingId", - table: "TaskAllocations", - column: "WorkItemMappingId", - principalTable: "WorkItemMapping", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); - - migrationBuilder.AddForeignKey( - name: "FK_TaskAllocations_WorkItems_WorkItemId", - table: "TaskAllocations", - column: "WorkItemId", - principalTable: "WorkItems", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); - } - - /// - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropForeignKey( - name: "FK_TaskAllocations_Employees_AssignedBy", - table: "TaskAllocations"); - - migrationBuilder.DropForeignKey( - name: "FK_TaskAllocations_WorkItemMapping_WorkItemMappingId", - table: "TaskAllocations"); - - migrationBuilder.DropForeignKey( - name: "FK_TaskAllocations_WorkItems_WorkItemId", - table: "TaskAllocations"); - - migrationBuilder.DropTable( - name: "TaskComments"); - - migrationBuilder.DropTable( - name: "TaskMembers"); - - migrationBuilder.DropIndex( - name: "IX_TaskAllocations_AssignedBy", - table: "TaskAllocations"); - - migrationBuilder.DropColumn( - name: "CompletedTask", - table: "TaskAllocations"); - - migrationBuilder.DropColumn( - name: "Description", - table: "TaskAllocations"); - - migrationBuilder.DropColumn( - name: "PlannedTask", - table: "TaskAllocations"); - - migrationBuilder.RenameColumn( - name: "WorkItemMappingId", - table: "TaskAllocations", - newName: "WorkAreaId"); - - migrationBuilder.RenameColumn( - name: "WorkItemId", - table: "TaskAllocations", - newName: "ProjectId"); - - migrationBuilder.RenameColumn( - name: "ReportedDate", - table: "TaskAllocations", - newName: "ReAllocationDate"); - - migrationBuilder.RenameColumn( - name: "AssignmentDate", - table: "TaskAllocations", - newName: "AllocationDate"); - - migrationBuilder.RenameColumn( - name: "AssignedBy", - table: "TaskAllocations", - newName: "EmployeeRole"); - - migrationBuilder.RenameIndex( - name: "IX_TaskAllocations_WorkItemMappingId", - table: "TaskAllocations", - newName: "IX_TaskAllocations_WorkAreaId"); - - migrationBuilder.RenameIndex( - name: "IX_TaskAllocations_WorkItemId", - table: "TaskAllocations", - newName: "IX_TaskAllocations_ProjectId"); - - migrationBuilder.AlterColumn( - name: "PlannedWork", - table: "WorkItems", - type: "int", - nullable: false, - oldClrType: typeof(double), - oldType: "double"); - - migrationBuilder.AlterColumn( - name: "CompletedWork", - table: "WorkItems", - type: "int", - nullable: false, - oldClrType: typeof(double), - oldType: "double"); - - migrationBuilder.AlterColumn( - name: "Id", - table: "TaskAllocations", - type: "int", - nullable: false, - oldClrType: typeof(long), - oldType: "bigint") - .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn) - .OldAnnotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn); - - migrationBuilder.AddColumn( - name: "BuildingId", - table: "TaskAllocations", - type: "int", - nullable: false, - defaultValue: 0); - - migrationBuilder.AddColumn( - name: "EmployeeId", - table: "TaskAllocations", - type: "int", - nullable: false, - defaultValue: 0); - - migrationBuilder.AddColumn( - name: "TaskAllocationId", - table: "ActivityMasters", - type: "int", - nullable: true); - - migrationBuilder.UpdateData( - table: "ActivityMasters", - keyColumn: "Id", - keyValue: 1, - column: "TaskAllocationId", - value: null); - - migrationBuilder.UpdateData( - table: "ActivityMasters", - keyColumn: "Id", - keyValue: 2, - column: "TaskAllocationId", - value: null); - - migrationBuilder.UpdateData( - table: "ActivityMasters", - keyColumn: "Id", - keyValue: 3, - column: "TaskAllocationId", - value: null); - - migrationBuilder.UpdateData( - table: "ActivityMasters", - keyColumn: "Id", - keyValue: 4, - column: "TaskAllocationId", - value: null); - - migrationBuilder.UpdateData( - table: "ActivityMasters", - keyColumn: "Id", - keyValue: 5, - column: "TaskAllocationId", - value: null); - - migrationBuilder.UpdateData( - table: "ActivityMasters", - keyColumn: "Id", - keyValue: 6, - column: "TaskAllocationId", - value: null); - - migrationBuilder.UpdateData( - table: "ActivityMasters", - keyColumn: "Id", - keyValue: 7, - column: "TaskAllocationId", - value: null); - - migrationBuilder.UpdateData( - table: "ActivityMasters", - keyColumn: "Id", - keyValue: 8, - column: "TaskAllocationId", - value: null); - - migrationBuilder.UpdateData( - table: "ActivityMasters", - keyColumn: "Id", - keyValue: 9, - column: "TaskAllocationId", - value: null); - - migrationBuilder.UpdateData( - table: "ActivityMasters", - keyColumn: "Id", - keyValue: 10, - column: "TaskAllocationId", - value: null); - - migrationBuilder.UpdateData( - table: "ActivityMasters", - keyColumn: "Id", - keyValue: 11, - column: "TaskAllocationId", - value: null); - - migrationBuilder.UpdateData( - table: "ActivityMasters", - keyColumn: "Id", - keyValue: 12, - column: "TaskAllocationId", - value: null); - - migrationBuilder.UpdateData( - table: "ActivityMasters", - keyColumn: "Id", - keyValue: 13, - column: "TaskAllocationId", - value: null); - - migrationBuilder.UpdateData( - table: "ActivityMasters", - keyColumn: "Id", - keyValue: 14, - column: "TaskAllocationId", - value: null); - - migrationBuilder.CreateIndex( - name: "IX_TaskAllocations_BuildingId", - table: "TaskAllocations", - column: "BuildingId"); - - migrationBuilder.CreateIndex( - name: "IX_TaskAllocations_EmployeeId", - table: "TaskAllocations", - column: "EmployeeId"); - - migrationBuilder.CreateIndex( - name: "IX_ActivityMasters_TaskAllocationId", - table: "ActivityMasters", - column: "TaskAllocationId"); - - migrationBuilder.AddForeignKey( - name: "FK_ActivityMasters_TaskAllocations_TaskAllocationId", - table: "ActivityMasters", - column: "TaskAllocationId", - principalTable: "TaskAllocations", - principalColumn: "Id"); - - migrationBuilder.AddForeignKey( - name: "FK_TaskAllocations_Buildings_BuildingId", - table: "TaskAllocations", - column: "BuildingId", - principalTable: "Buildings", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); - - migrationBuilder.AddForeignKey( - name: "FK_TaskAllocations_Employees_EmployeeId", - table: "TaskAllocations", - column: "EmployeeId", - principalTable: "Employees", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); - - migrationBuilder.AddForeignKey( - name: "FK_TaskAllocations_Projects_ProjectId", - table: "TaskAllocations", - column: "ProjectId", - principalTable: "Projects", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); - - migrationBuilder.AddForeignKey( - name: "FK_TaskAllocations_WorkAreas_WorkAreaId", - table: "TaskAllocations", - column: "WorkAreaId", - principalTable: "WorkAreas", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); - } - } -} diff --git a/Marco.Pms.DataAccess/Migrations/20250403055023_Make_ReportDate_Nullable.Designer.cs b/Marco.Pms.DataAccess/Migrations/20250403055023_Make_ReportDate_Nullable.Designer.cs deleted file mode 100644 index dfd9b7b..0000000 --- a/Marco.Pms.DataAccess/Migrations/20250403055023_Make_ReportDate_Nullable.Designer.cs +++ /dev/null @@ -1,2128 +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("20250403055023_Make_ReportDate_Nullable")] - partial class Make_ReportDate_Nullable - { - /// - 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("bigint"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - - b.Property("AssignedBy") - .HasColumnType("int"); - - b.Property("AssignmentDate") - .HasColumnType("datetime(6)"); - - b.Property("CompletedTask") - .HasColumnType("double"); - - b.Property("Description") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("PlannedTask") - .HasColumnType("double"); - - b.Property("ReportedDate") - .HasColumnType("datetime(6)"); - - b.Property("TenantId") - .HasColumnType("int"); - - b.Property("WorkItemId") - .HasColumnType("int"); - - b.Property("WorkItemMappingId") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("AssignedBy"); - - b.HasIndex("TenantId"); - - b.HasIndex("WorkItemId"); - - b.HasIndex("WorkItemMappingId"); - - b.ToTable("TaskAllocations"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Activities.TaskComment", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - - b.Property("Comment") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("CommentDate") - .HasColumnType("datetime(6)"); - - b.Property("CommentedBy") - .HasColumnType("int"); - - b.Property("TaskAllocationId") - .HasColumnType("bigint"); - - b.Property("TenantId") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("CommentedBy"); - - b.HasIndex("TaskAllocationId"); - - b.HasIndex("TenantId"); - - b.ToTable("TaskComments"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Activities.TaskMembers", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - - b.Property("EmployeeId") - .HasColumnType("int"); - - b.Property("TaskAllocationId") - .HasColumnType("bigint"); - - b.Property("TenantId") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("EmployeeId"); - - b.HasIndex("TaskAllocationId"); - - b.HasIndex("TenantId"); - - b.ToTable("TaskMembers"); - }); - - 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("JoiningDate") - .HasColumnType("datetime(6)"); - - 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("TenantId") - .HasColumnType("int"); - - b.Property("UnitOfMeasurement") - .IsRequired() - .HasColumnType("longtext"); - - b.HasKey("Id"); - - 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("IndustryId") - .HasColumnType("int"); - - b.Property("IsActive") - .HasColumnType("tinyint(1)"); - - b.Property("Name") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("OnBoardingDate") - .HasColumnType("datetime(6)"); - - b.Property("OragnizationSize") - .HasColumnType("longtext"); - - b.HasKey("Id"); - - b.HasIndex("IndustryId"); - - b.ToTable("Tenants"); - - b.HasData( - new - { - Id = 1, - ContactName = "Admin", - ContactNumber = "123456789", - Description = "", - DomainName = "www.marcobms.org", - IndustryId = 1, - IsActive = true, - Name = "MarcoBMS", - OnBoardingDate = new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified) - }); - }); - - modelBuilder.Entity("Marco.Pms.Model.Industries.Industry", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - - b.Property("Name") - .IsRequired() - .HasColumnType("longtext"); - - b.HasKey("Id"); - - b.ToTable("Industries"); - - b.HasData( - new - { - Id = 1, - Name = "Information Technology (IT) Services" - }, - new - { - Id = 2, - Name = "Manufacturing & Production" - }, - new - { - Id = 3, - Name = "Energy & Resources" - }, - new - { - Id = 4, - Name = "Finance & Professional Services" - }, - new - { - Id = 5, - Name = "Hospitals and Healthcare Services" - }, - new - { - Id = 6, - Name = "Social Services" - }, - new - { - Id = 7, - Name = "Retail & Consumer Services" - }, - new - { - Id = 8, - Name = "Transportation & Logistics" - }, - new - { - Id = 9, - Name = "Education & Training" - }); - }); - - 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("Marco.Pms.Model.Projects.WorkItem", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - - b.Property("ActivityId") - .HasColumnType("int"); - - b.Property("CompletedWork") - .HasColumnType("double"); - - b.Property("PlannedWork") - .HasColumnType("double"); - - 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.Projects.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("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("IsActive") - .HasColumnType("tinyint(1)"); - - b.Property("IsRootUser") - .HasColumnType("tinyint(1)"); - - b.Property("TenantId") - .HasColumnType("int"); - - b.HasDiscriminator().HasValue("ApplicationUser"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Activities.TaskAllocation", b => - { - b.HasOne("Marco.Pms.Model.Employees.Employee", "Employee") - .WithMany() - .HasForeignKey("AssignedBy") - .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.WorkItem", "WorkItem") - .WithMany() - .HasForeignKey("WorkItemId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Marco.Pms.Model.Projects.WorkItemMapping", "WorkItemMapping") - .WithMany() - .HasForeignKey("WorkItemMappingId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Employee"); - - b.Navigation("Tenant"); - - b.Navigation("WorkItem"); - - b.Navigation("WorkItemMapping"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Activities.TaskComment", b => - { - b.HasOne("Marco.Pms.Model.Employees.Employee", "Employee") - .WithMany() - .HasForeignKey("CommentedBy") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Marco.Pms.Model.Activities.TaskAllocation", "TaskAllocation") - .WithMany() - .HasForeignKey("TaskAllocationId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Marco.Pms.Model.Entitlements.Tenant", "Tenant") - .WithMany() - .HasForeignKey("TenantId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Employee"); - - b.Navigation("TaskAllocation"); - - b.Navigation("Tenant"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Activities.TaskMembers", b => - { - b.HasOne("Marco.Pms.Model.Employees.Employee", "Employee") - .WithMany() - .HasForeignKey("EmployeeId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Marco.Pms.Model.Activities.TaskAllocation", "TaskAllocation") - .WithMany() - .HasForeignKey("TaskAllocationId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Marco.Pms.Model.Entitlements.Tenant", "Tenant") - .WithMany() - .HasForeignKey("TenantId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Employee"); - - b.Navigation("TaskAllocation"); - - 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.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.Entitlements.Tenant", b => - { - b.HasOne("Marco.Pms.Model.Industries.Industry", "Industry") - .WithMany() - .HasForeignKey("IndustryId"); - - b.Navigation("Industry"); - }); - - 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("Marco.Pms.Model.Projects.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.Projects.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.Projects.WorkItem", "WorkItem") - .WithMany() - .HasForeignKey("WorkItemId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Tenant"); - - b.Navigation("WorkArea"); - - b.Navigation("WorkItem"); - }); - - 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.Entitlements.Feature", b => - { - b.Navigation("FeaturePermissions"); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/Marco.Pms.DataAccess/Migrations/20250403055023_Make_ReportDate_Nullable.cs b/Marco.Pms.DataAccess/Migrations/20250403055023_Make_ReportDate_Nullable.cs deleted file mode 100644 index ff729ee..0000000 --- a/Marco.Pms.DataAccess/Migrations/20250403055023_Make_ReportDate_Nullable.cs +++ /dev/null @@ -1,37 +0,0 @@ -using System; -using Microsoft.EntityFrameworkCore.Migrations; - -#nullable disable - -namespace Marco.Pms.DataAccess.Migrations -{ - /// - public partial class Make_ReportDate_Nullable : Migration - { - /// - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.AlterColumn( - name: "ReportedDate", - table: "TaskAllocations", - type: "datetime(6)", - nullable: true, - oldClrType: typeof(DateTime), - oldType: "datetime(6)"); - } - - /// - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.AlterColumn( - name: "ReportedDate", - table: "TaskAllocations", - type: "datetime(6)", - nullable: false, - defaultValue: new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), - oldClrType: typeof(DateTime), - oldType: "datetime(6)", - oldNullable: true); - } - } -} diff --git a/Marco.Pms.DataAccess/Migrations/20250403133824_Removed_WorkItemMapping.Designer.cs b/Marco.Pms.DataAccess/Migrations/20250403133824_Removed_WorkItemMapping.Designer.cs deleted file mode 100644 index 2bd9269..0000000 --- a/Marco.Pms.DataAccess/Migrations/20250403133824_Removed_WorkItemMapping.Designer.cs +++ /dev/null @@ -1,2059 +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("20250403133824_Removed_WorkItemMapping")] - partial class Removed_WorkItemMapping - { - /// - 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("bigint"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - - b.Property("AssignedBy") - .HasColumnType("int"); - - b.Property("AssignmentDate") - .HasColumnType("datetime(6)"); - - b.Property("CompletedTask") - .HasColumnType("double"); - - b.Property("Description") - .HasColumnType("longtext"); - - b.Property("PlannedTask") - .HasColumnType("double"); - - b.Property("ReportedDate") - .HasColumnType("datetime(6)"); - - b.Property("TenantId") - .HasColumnType("int"); - - b.Property("WorkItemId") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("AssignedBy"); - - b.HasIndex("TenantId"); - - b.HasIndex("WorkItemId"); - - b.ToTable("TaskAllocations"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Activities.TaskComment", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - - b.Property("Comment") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("CommentDate") - .HasColumnType("datetime(6)"); - - b.Property("CommentedBy") - .HasColumnType("int"); - - b.Property("TaskAllocationId") - .HasColumnType("bigint"); - - b.Property("TenantId") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("CommentedBy"); - - b.HasIndex("TaskAllocationId"); - - b.HasIndex("TenantId"); - - b.ToTable("TaskComments"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Activities.TaskMembers", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - - b.Property("EmployeeId") - .HasColumnType("int"); - - b.Property("TaskAllocationId") - .HasColumnType("bigint"); - - b.Property("TenantId") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("EmployeeId"); - - b.HasIndex("TaskAllocationId"); - - b.HasIndex("TenantId"); - - b.ToTable("TaskMembers"); - }); - - 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("JoiningDate") - .HasColumnType("datetime(6)"); - - 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("TenantId") - .HasColumnType("int"); - - b.Property("UnitOfMeasurement") - .IsRequired() - .HasColumnType("longtext"); - - b.HasKey("Id"); - - 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("IndustryId") - .HasColumnType("int"); - - b.Property("IsActive") - .HasColumnType("tinyint(1)"); - - b.Property("Name") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("OnBoardingDate") - .HasColumnType("datetime(6)"); - - b.Property("OragnizationSize") - .HasColumnType("longtext"); - - b.HasKey("Id"); - - b.HasIndex("IndustryId"); - - b.ToTable("Tenants"); - - b.HasData( - new - { - Id = 1, - ContactName = "Admin", - ContactNumber = "123456789", - Description = "", - DomainName = "www.marcobms.org", - IndustryId = 1, - IsActive = true, - Name = "MarcoBMS", - OnBoardingDate = new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified) - }); - }); - - modelBuilder.Entity("Marco.Pms.Model.Industries.Industry", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - - b.Property("Name") - .IsRequired() - .HasColumnType("longtext"); - - b.HasKey("Id"); - - b.ToTable("Industries"); - - b.HasData( - new - { - Id = 1, - Name = "Information Technology (IT) Services" - }, - new - { - Id = 2, - Name = "Manufacturing & Production" - }, - new - { - Id = 3, - Name = "Energy & Resources" - }, - new - { - Id = 4, - Name = "Finance & Professional Services" - }, - new - { - Id = 5, - Name = "Hospitals and Healthcare Services" - }, - new - { - Id = 6, - Name = "Social Services" - }, - new - { - Id = 7, - Name = "Retail & Consumer Services" - }, - new - { - Id = 8, - Name = "Transportation & Logistics" - }, - new - { - Id = 9, - Name = "Education & Training" - }); - }); - - 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("Marco.Pms.Model.Projects.WorkItem", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - - b.Property("ActivityId") - .HasColumnType("int"); - - b.Property("CompletedWork") - .HasColumnType("double"); - - b.Property("PlannedWork") - .HasColumnType("double"); - - 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("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("IsActive") - .HasColumnType("tinyint(1)"); - - b.Property("IsRootUser") - .HasColumnType("tinyint(1)"); - - b.Property("TenantId") - .HasColumnType("int"); - - b.HasDiscriminator().HasValue("ApplicationUser"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Activities.TaskAllocation", b => - { - b.HasOne("Marco.Pms.Model.Employees.Employee", "Employee") - .WithMany() - .HasForeignKey("AssignedBy") - .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.WorkItem", "WorkItem") - .WithMany() - .HasForeignKey("WorkItemId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Employee"); - - b.Navigation("Tenant"); - - b.Navigation("WorkItem"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Activities.TaskComment", b => - { - b.HasOne("Marco.Pms.Model.Employees.Employee", "Employee") - .WithMany() - .HasForeignKey("CommentedBy") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Marco.Pms.Model.Activities.TaskAllocation", "TaskAllocation") - .WithMany() - .HasForeignKey("TaskAllocationId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Marco.Pms.Model.Entitlements.Tenant", "Tenant") - .WithMany() - .HasForeignKey("TenantId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Employee"); - - b.Navigation("TaskAllocation"); - - b.Navigation("Tenant"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Activities.TaskMembers", b => - { - b.HasOne("Marco.Pms.Model.Employees.Employee", "Employee") - .WithMany() - .HasForeignKey("EmployeeId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Marco.Pms.Model.Activities.TaskAllocation", "TaskAllocation") - .WithMany() - .HasForeignKey("TaskAllocationId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Marco.Pms.Model.Entitlements.Tenant", "Tenant") - .WithMany() - .HasForeignKey("TenantId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Employee"); - - b.Navigation("TaskAllocation"); - - 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.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.Entitlements.Tenant", b => - { - b.HasOne("Marco.Pms.Model.Industries.Industry", "Industry") - .WithMany() - .HasForeignKey("IndustryId"); - - b.Navigation("Industry"); - }); - - 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("Marco.Pms.Model.Projects.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("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.Entitlements.Feature", b => - { - b.Navigation("FeaturePermissions"); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/Marco.Pms.DataAccess/Migrations/20250403133824_Removed_WorkItemMapping.cs b/Marco.Pms.DataAccess/Migrations/20250403133824_Removed_WorkItemMapping.cs deleted file mode 100644 index db47ab0..0000000 --- a/Marco.Pms.DataAccess/Migrations/20250403133824_Removed_WorkItemMapping.cs +++ /dev/null @@ -1,131 +0,0 @@ -using Microsoft.EntityFrameworkCore.Metadata; -using Microsoft.EntityFrameworkCore.Migrations; - -#nullable disable - -namespace Marco.Pms.DataAccess.Migrations -{ - /// - public partial class Removed_WorkItemMapping : Migration - { - /// - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropForeignKey( - name: "FK_TaskAllocations_WorkItemMapping_WorkItemMappingId", - table: "TaskAllocations"); - - migrationBuilder.DropTable( - name: "WorkItemMapping"); - - migrationBuilder.DropIndex( - name: "IX_TaskAllocations_WorkItemMappingId", - table: "TaskAllocations"); - - migrationBuilder.DropColumn( - name: "WorkItemMappingId", - table: "TaskAllocations"); - - migrationBuilder.AlterColumn( - name: "Description", - table: "TaskAllocations", - type: "longtext", - nullable: true, - oldClrType: typeof(string), - oldType: "longtext") - .Annotation("MySql:CharSet", "utf8mb4") - .OldAnnotation("MySql:CharSet", "utf8mb4"); - } - - /// - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.UpdateData( - table: "TaskAllocations", - keyColumn: "Description", - keyValue: null, - column: "Description", - value: ""); - - migrationBuilder.AlterColumn( - name: "Description", - table: "TaskAllocations", - type: "longtext", - nullable: false, - oldClrType: typeof(string), - oldType: "longtext", - oldNullable: true) - .Annotation("MySql:CharSet", "utf8mb4") - .OldAnnotation("MySql:CharSet", "utf8mb4"); - - migrationBuilder.AddColumn( - name: "WorkItemMappingId", - table: "TaskAllocations", - type: "int", - nullable: false, - defaultValue: 0); - - migrationBuilder.CreateTable( - name: "WorkItemMapping", - columns: table => new - { - Id = table.Column(type: "int", nullable: false) - .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), - TenantId = table.Column(type: "int", nullable: false), - WorkAreaId = table.Column(type: "int", nullable: false), - WorkItemId = table.Column(type: "int", nullable: false) - }, - constraints: table => - { - table.PrimaryKey("PK_WorkItemMapping", x => x.Id); - table.ForeignKey( - name: "FK_WorkItemMapping_Tenants_TenantId", - column: x => x.TenantId, - principalTable: "Tenants", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); - table.ForeignKey( - name: "FK_WorkItemMapping_WorkAreas_WorkAreaId", - column: x => x.WorkAreaId, - principalTable: "WorkAreas", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); - table.ForeignKey( - name: "FK_WorkItemMapping_WorkItems_WorkItemId", - column: x => x.WorkItemId, - principalTable: "WorkItems", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); - }) - .Annotation("MySql:CharSet", "utf8mb4"); - - migrationBuilder.CreateIndex( - name: "IX_TaskAllocations_WorkItemMappingId", - table: "TaskAllocations", - column: "WorkItemMappingId"); - - migrationBuilder.CreateIndex( - name: "IX_WorkItemMapping_TenantId", - table: "WorkItemMapping", - column: "TenantId"); - - migrationBuilder.CreateIndex( - name: "IX_WorkItemMapping_WorkAreaId", - table: "WorkItemMapping", - column: "WorkAreaId"); - - migrationBuilder.CreateIndex( - name: "IX_WorkItemMapping_WorkItemId", - table: "WorkItemMapping", - column: "WorkItemId"); - - migrationBuilder.AddForeignKey( - name: "FK_TaskAllocations_WorkItemMapping_WorkItemMappingId", - table: "TaskAllocations", - column: "WorkItemMappingId", - principalTable: "WorkItemMapping", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); - } - } -} diff --git a/Marco.Pms.DataAccess/Migrations/20250414053152_Added_Check_List_Table.Designer.cs b/Marco.Pms.DataAccess/Migrations/20250414053152_Added_Check_List_Table.Designer.cs deleted file mode 100644 index 05fd29d..0000000 --- a/Marco.Pms.DataAccess/Migrations/20250414053152_Added_Check_List_Table.Designer.cs +++ /dev/null @@ -1,2073 +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("20250414053152_Added_Check_List_Table")] - partial class Added_Check_List_Table - { - /// - 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("bigint"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - - b.Property("AssignedBy") - .HasColumnType("int"); - - b.Property("AssignmentDate") - .HasColumnType("datetime(6)"); - - b.Property("CompletedTask") - .HasColumnType("double"); - - b.Property("Description") - .HasColumnType("longtext"); - - b.Property("PlannedTask") - .HasColumnType("double"); - - b.Property("ReportedDate") - .HasColumnType("datetime(6)"); - - b.Property("TenantId") - .HasColumnType("int"); - - b.Property("WorkItemId") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("AssignedBy"); - - b.HasIndex("TenantId"); - - b.HasIndex("WorkItemId"); - - b.ToTable("TaskAllocations"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Activities.TaskComment", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - - b.Property("Comment") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("CommentDate") - .HasColumnType("datetime(6)"); - - b.Property("CommentedBy") - .HasColumnType("int"); - - b.Property("TaskAllocationId") - .HasColumnType("bigint"); - - b.Property("TenantId") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("CommentedBy"); - - b.HasIndex("TaskAllocationId"); - - b.HasIndex("TenantId"); - - b.ToTable("TaskComments"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Activities.TaskMembers", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - - b.Property("EmployeeId") - .HasColumnType("int"); - - b.Property("TaskAllocationId") - .HasColumnType("bigint"); - - b.Property("TenantId") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("EmployeeId"); - - b.HasIndex("TaskAllocationId"); - - b.HasIndex("TenantId"); - - b.ToTable("TaskMembers"); - }); - - 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") - .HasColumnType("longtext"); - - b.Property("UserId") - .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") - .HasColumnType("longtext"); - - b.Property("Email") - .HasColumnType("longtext"); - - b.Property("EmergencyContactPerson") - .HasColumnType("longtext"); - - b.Property("EmergencyPhoneNumber") - .HasColumnType("longtext"); - - b.Property("FirstName") - .HasColumnType("longtext"); - - b.Property("Gender") - .HasColumnType("longtext"); - - b.Property("IsActive") - .HasColumnType("tinyint(1)"); - - b.Property("JobRoleId") - .HasColumnType("int"); - - b.Property("JoiningDate") - .HasColumnType("datetime(6)"); - - b.Property("LastName") - .HasColumnType("longtext"); - - b.Property("MiddleName") - .HasColumnType("longtext"); - - b.Property("PanNumber") - .HasColumnType("longtext"); - - b.Property("PermanentAddress") - .HasColumnType("longtext"); - - b.Property("PhoneNumber") - .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") - .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.ActivityCheckList", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - - b.Property("ActivityId") - .HasColumnType("int"); - - b.Property("Description") - .HasColumnType("longtext"); - - b.Property("IsChecked") - .HasColumnType("tinyint(1)"); - - b.Property("IsMandatory") - .HasColumnType("tinyint(1)"); - - b.Property("TenantId") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.ToTable("ActivityCheckLists"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Entitlements.ActivityMaster", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - - b.Property("ActivityName") - .HasColumnType("longtext"); - - b.Property("IsActive") - .HasColumnType("tinyint(1)"); - - b.Property("TenantId") - .HasColumnType("int"); - - b.Property("UnitOfMeasurement") - .HasColumnType("longtext"); - - b.HasKey("Id"); - - b.HasIndex("TenantId"); - - b.ToTable("ActivityMasters"); - - b.HasData( - new - { - Id = 1, - ActivityName = "Core Cutting", - IsActive = true, - TenantId = 1, - UnitOfMeasurement = "Number" - }, - new - { - Id = 2, - ActivityName = "Fabrication", - IsActive = true, - TenantId = 1, - UnitOfMeasurement = "Meter" - }, - new - { - Id = 3, - ActivityName = "Lifting", - IsActive = true, - TenantId = 1, - UnitOfMeasurement = "Meter" - }, - new - { - Id = 4, - ActivityName = "Hanging", - IsActive = true, - TenantId = 1, - UnitOfMeasurement = "Meter" - }, - new - { - Id = 5, - ActivityName = "Tapping", - IsActive = true, - TenantId = 1, - UnitOfMeasurement = "Meter" - }, - new - { - Id = 6, - ActivityName = "Welding", - IsActive = true, - TenantId = 1, - UnitOfMeasurement = "Meter" - }, - new - { - Id = 7, - ActivityName = "Testing", - IsActive = true, - TenantId = 1, - UnitOfMeasurement = "Area" - }, - new - { - Id = 8, - ActivityName = "Painting", - IsActive = true, - TenantId = 1, - UnitOfMeasurement = "Meter" - }, - new - { - Id = 9, - ActivityName = "Marking Area", - IsActive = true, - TenantId = 1, - UnitOfMeasurement = "Meter" - }, - new - { - Id = 10, - ActivityName = "Drilling", - IsActive = true, - TenantId = 1, - UnitOfMeasurement = "Number" - }, - new - { - Id = 11, - ActivityName = "MS Support Fabrication", - IsActive = true, - TenantId = 1, - UnitOfMeasurement = "Number" - }, - new - { - Id = 12, - ActivityName = "MS Support Hanging", - IsActive = true, - TenantId = 1, - UnitOfMeasurement = "Number" - }, - new - { - Id = 13, - ActivityName = "Hydrant Volve", - IsActive = true, - TenantId = 1, - UnitOfMeasurement = "Number" - }, - new - { - Id = 14, - ActivityName = "Sprinkler Installation", - IsActive = true, - TenantId = 1, - UnitOfMeasurement = "Number" - }); - }); - - modelBuilder.Entity("Marco.Pms.Model.Entitlements.ApplicationRole", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("char(36)"); - - b.Property("Description") - .HasColumnType("longtext"); - - b.Property("Role") - .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") - .HasColumnType("longtext"); - - b.Property("IsActive") - .HasColumnType("tinyint(1)"); - - b.Property("ModuleId") - .HasColumnType("int"); - - b.Property("Name") - .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") - .HasColumnType("longtext"); - - b.Property("FeatureId") - .HasColumnType("char(36)"); - - b.Property("IsEnabled") - .HasColumnType("tinyint(1)"); - - b.Property("Name") - .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") - .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") - .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") - .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") - .HasColumnType("longtext"); - - b.Property("ContactNumber") - .HasColumnType("longtext"); - - b.Property("Description") - .HasColumnType("longtext"); - - b.Property("DomainName") - .HasColumnType("longtext"); - - b.Property("IndustryId") - .HasColumnType("int"); - - b.Property("IsActive") - .HasColumnType("tinyint(1)"); - - b.Property("Name") - .HasColumnType("longtext"); - - b.Property("OnBoardingDate") - .HasColumnType("datetime(6)"); - - b.Property("OragnizationSize") - .HasColumnType("longtext"); - - b.HasKey("Id"); - - b.HasIndex("IndustryId"); - - b.ToTable("Tenants"); - - b.HasData( - new - { - Id = 1, - ContactName = "Admin", - ContactNumber = "123456789", - Description = "", - DomainName = "www.marcobms.org", - IndustryId = 1, - IsActive = true, - Name = "MarcoBMS", - OnBoardingDate = new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified) - }); - }); - - modelBuilder.Entity("Marco.Pms.Model.Industries.Industry", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - - b.Property("Name") - .HasColumnType("longtext"); - - b.HasKey("Id"); - - b.ToTable("Industries"); - - b.HasData( - new - { - Id = 1, - Name = "Information Technology (IT) Services" - }, - new - { - Id = 2, - Name = "Manufacturing & Production" - }, - new - { - Id = 3, - Name = "Energy & Resources" - }, - new - { - Id = 4, - Name = "Finance & Professional Services" - }, - new - { - Id = 5, - Name = "Hospitals and Healthcare Services" - }, - new - { - Id = 6, - Name = "Social Services" - }, - new - { - Id = 7, - Name = "Retail & Consumer Services" - }, - new - { - Id = 8, - Name = "Transportation & Logistics" - }, - new - { - Id = 9, - Name = "Education & Training" - }); - }); - - 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") - .HasColumnType("longtext"); - - b.Property("EndDate") - .HasColumnType("datetime(6)"); - - b.Property("Name") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("ProjectAddress") - .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("Marco.Pms.Model.Projects.WorkItem", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - - b.Property("ActivityId") - .HasColumnType("int"); - - b.Property("CompletedWork") - .HasColumnType("double"); - - b.Property("PlannedWork") - .HasColumnType("double"); - - 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("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("IsActive") - .HasColumnType("tinyint(1)"); - - b.Property("IsRootUser") - .HasColumnType("tinyint(1)"); - - b.Property("TenantId") - .HasColumnType("int"); - - b.HasDiscriminator().HasValue("ApplicationUser"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Activities.TaskAllocation", b => - { - b.HasOne("Marco.Pms.Model.Employees.Employee", "Employee") - .WithMany() - .HasForeignKey("AssignedBy") - .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.WorkItem", "WorkItem") - .WithMany() - .HasForeignKey("WorkItemId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Employee"); - - b.Navigation("Tenant"); - - b.Navigation("WorkItem"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Activities.TaskComment", b => - { - b.HasOne("Marco.Pms.Model.Employees.Employee", "Employee") - .WithMany() - .HasForeignKey("CommentedBy") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Marco.Pms.Model.Activities.TaskAllocation", "TaskAllocation") - .WithMany() - .HasForeignKey("TaskAllocationId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Marco.Pms.Model.Entitlements.Tenant", "Tenant") - .WithMany() - .HasForeignKey("TenantId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Employee"); - - b.Navigation("TaskAllocation"); - - b.Navigation("Tenant"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Activities.TaskMembers", b => - { - b.HasOne("Marco.Pms.Model.Employees.Employee", "Employee") - .WithMany() - .HasForeignKey("EmployeeId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Marco.Pms.Model.Activities.TaskAllocation", "TaskAllocation") - .WithMany() - .HasForeignKey("TaskAllocationId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Marco.Pms.Model.Entitlements.Tenant", "Tenant") - .WithMany() - .HasForeignKey("TenantId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Employee"); - - b.Navigation("TaskAllocation"); - - 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); - - 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.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.Entitlements.Tenant", b => - { - b.HasOne("Marco.Pms.Model.Industries.Industry", "Industry") - .WithMany() - .HasForeignKey("IndustryId"); - - b.Navigation("Industry"); - }); - - 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("Marco.Pms.Model.Projects.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("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.Entitlements.Feature", b => - { - b.Navigation("FeaturePermissions"); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/Marco.Pms.DataAccess/Migrations/20250414053152_Added_Check_List_Table.cs b/Marco.Pms.DataAccess/Migrations/20250414053152_Added_Check_List_Table.cs deleted file mode 100644 index 8455204..0000000 --- a/Marco.Pms.DataAccess/Migrations/20250414053152_Added_Check_List_Table.cs +++ /dev/null @@ -1,984 +0,0 @@ -using Microsoft.EntityFrameworkCore.Metadata; -using Microsoft.EntityFrameworkCore.Migrations; - -#nullable disable - -namespace Marco.Pms.DataAccess.Migrations -{ - /// - public partial class Added_Check_List_Table : Migration - { - /// - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropColumn( - name: "PeramnentAddress", - table: "Employees"); - - migrationBuilder.AlterColumn( - name: "Name", - table: "WorkShifts", - type: "longtext", - nullable: true, - oldClrType: typeof(string), - oldType: "longtext") - .Annotation("MySql:CharSet", "utf8mb4") - .OldAnnotation("MySql:CharSet", "utf8mb4"); - - migrationBuilder.AlterColumn( - name: "Name", - table: "Tenants", - type: "longtext", - nullable: true, - oldClrType: typeof(string), - oldType: "longtext") - .Annotation("MySql:CharSet", "utf8mb4") - .OldAnnotation("MySql:CharSet", "utf8mb4"); - - migrationBuilder.AlterColumn( - name: "DomainName", - table: "Tenants", - type: "longtext", - nullable: true, - oldClrType: typeof(string), - oldType: "longtext") - .Annotation("MySql:CharSet", "utf8mb4") - .OldAnnotation("MySql:CharSet", "utf8mb4"); - - migrationBuilder.AlterColumn( - name: "Description", - table: "Tenants", - type: "longtext", - nullable: true, - oldClrType: typeof(string), - oldType: "longtext") - .Annotation("MySql:CharSet", "utf8mb4") - .OldAnnotation("MySql:CharSet", "utf8mb4"); - - migrationBuilder.AlterColumn( - name: "ContactNumber", - table: "Tenants", - type: "longtext", - nullable: true, - oldClrType: typeof(string), - oldType: "longtext") - .Annotation("MySql:CharSet", "utf8mb4") - .OldAnnotation("MySql:CharSet", "utf8mb4"); - - migrationBuilder.AlterColumn( - name: "ContactName", - table: "Tenants", - type: "longtext", - nullable: true, - oldClrType: typeof(string), - oldType: "longtext") - .Annotation("MySql:CharSet", "utf8mb4") - .OldAnnotation("MySql:CharSet", "utf8mb4"); - - migrationBuilder.AlterColumn( - name: "Status", - table: "StatusMasters", - type: "longtext", - nullable: true, - oldClrType: typeof(string), - oldType: "longtext") - .Annotation("MySql:CharSet", "utf8mb4") - .OldAnnotation("MySql:CharSet", "utf8mb4"); - - migrationBuilder.AlterColumn( - name: "UserId", - table: "RefreshTokens", - type: "varchar(255)", - nullable: true, - oldClrType: typeof(string), - oldType: "varchar(255)") - .Annotation("MySql:CharSet", "utf8mb4") - .OldAnnotation("MySql:CharSet", "utf8mb4"); - - migrationBuilder.AlterColumn( - name: "Token", - table: "RefreshTokens", - type: "longtext", - nullable: true, - oldClrType: typeof(string), - oldType: "longtext") - .Annotation("MySql:CharSet", "utf8mb4") - .OldAnnotation("MySql:CharSet", "utf8mb4"); - - migrationBuilder.AlterColumn( - name: "ProjectAddress", - table: "Projects", - type: "longtext", - nullable: true, - oldClrType: typeof(string), - oldType: "longtext") - .Annotation("MySql:CharSet", "utf8mb4") - .OldAnnotation("MySql:CharSet", "utf8mb4"); - - migrationBuilder.AlterColumn( - name: "ContactPerson", - table: "Projects", - type: "longtext", - nullable: true, - oldClrType: typeof(string), - oldType: "longtext") - .Annotation("MySql:CharSet", "utf8mb4") - .OldAnnotation("MySql:CharSet", "utf8mb4"); - - migrationBuilder.AlterColumn( - name: "Description", - table: "Modules", - type: "longtext", - nullable: true, - oldClrType: typeof(string), - oldType: "longtext") - .Annotation("MySql:CharSet", "utf8mb4") - .OldAnnotation("MySql:CharSet", "utf8mb4"); - - migrationBuilder.AlterColumn( - name: "Name", - table: "JobRoles", - type: "longtext", - nullable: true, - oldClrType: typeof(string), - oldType: "longtext") - .Annotation("MySql:CharSet", "utf8mb4") - .OldAnnotation("MySql:CharSet", "utf8mb4"); - - migrationBuilder.AlterColumn( - name: "Name", - table: "Industries", - type: "longtext", - nullable: true, - oldClrType: typeof(string), - oldType: "longtext") - .Annotation("MySql:CharSet", "utf8mb4") - .OldAnnotation("MySql:CharSet", "utf8mb4"); - - migrationBuilder.AlterColumn( - name: "Name", - table: "Features", - type: "longtext", - nullable: true, - oldClrType: typeof(string), - oldType: "longtext") - .Annotation("MySql:CharSet", "utf8mb4") - .OldAnnotation("MySql:CharSet", "utf8mb4"); - - migrationBuilder.AlterColumn( - name: "Description", - table: "Features", - type: "longtext", - nullable: true, - oldClrType: typeof(string), - oldType: "longtext") - .Annotation("MySql:CharSet", "utf8mb4") - .OldAnnotation("MySql:CharSet", "utf8mb4"); - - migrationBuilder.AlterColumn( - name: "Name", - table: "FeaturePermissions", - type: "longtext", - nullable: true, - oldClrType: typeof(string), - oldType: "longtext") - .Annotation("MySql:CharSet", "utf8mb4") - .OldAnnotation("MySql:CharSet", "utf8mb4"); - - migrationBuilder.AlterColumn( - name: "Description", - table: "FeaturePermissions", - type: "longtext", - nullable: true, - oldClrType: typeof(string), - oldType: "longtext") - .Annotation("MySql:CharSet", "utf8mb4") - .OldAnnotation("MySql:CharSet", "utf8mb4"); - - migrationBuilder.AlterColumn( - name: "PhoneNumber", - table: "Employees", - type: "longtext", - nullable: true, - oldClrType: typeof(string), - oldType: "longtext") - .Annotation("MySql:CharSet", "utf8mb4") - .OldAnnotation("MySql:CharSet", "utf8mb4"); - - migrationBuilder.AlterColumn( - name: "LastName", - table: "Employees", - type: "longtext", - nullable: true, - oldClrType: typeof(string), - oldType: "longtext") - .Annotation("MySql:CharSet", "utf8mb4") - .OldAnnotation("MySql:CharSet", "utf8mb4"); - - migrationBuilder.AlterColumn( - name: "Gender", - table: "Employees", - type: "longtext", - nullable: true, - oldClrType: typeof(string), - oldType: "longtext") - .Annotation("MySql:CharSet", "utf8mb4") - .OldAnnotation("MySql:CharSet", "utf8mb4"); - - migrationBuilder.AlterColumn( - name: "FirstName", - table: "Employees", - type: "longtext", - nullable: true, - oldClrType: typeof(string), - oldType: "longtext") - .Annotation("MySql:CharSet", "utf8mb4") - .OldAnnotation("MySql:CharSet", "utf8mb4"); - - migrationBuilder.AlterColumn( - name: "EmergencyPhoneNumber", - table: "Employees", - type: "longtext", - nullable: true, - oldClrType: typeof(string), - oldType: "longtext") - .Annotation("MySql:CharSet", "utf8mb4") - .OldAnnotation("MySql:CharSet", "utf8mb4"); - - migrationBuilder.AlterColumn( - name: "EmergencyContactPerson", - table: "Employees", - type: "longtext", - nullable: true, - oldClrType: typeof(string), - oldType: "longtext") - .Annotation("MySql:CharSet", "utf8mb4") - .OldAnnotation("MySql:CharSet", "utf8mb4"); - - migrationBuilder.AlterColumn( - name: "CurrentAddress", - table: "Employees", - type: "longtext", - nullable: true, - oldClrType: typeof(string), - oldType: "longtext") - .Annotation("MySql:CharSet", "utf8mb4") - .OldAnnotation("MySql:CharSet", "utf8mb4"); - - migrationBuilder.AddColumn( - name: "PermanentAddress", - table: "Employees", - type: "longtext", - nullable: true) - .Annotation("MySql:CharSet", "utf8mb4"); - - migrationBuilder.AlterColumn( - name: "Role", - table: "ApplicationRoles", - type: "longtext", - nullable: true, - oldClrType: typeof(string), - oldType: "longtext") - .Annotation("MySql:CharSet", "utf8mb4") - .OldAnnotation("MySql:CharSet", "utf8mb4"); - - migrationBuilder.AlterColumn( - name: "Description", - table: "ApplicationRoles", - type: "longtext", - nullable: true, - oldClrType: typeof(string), - oldType: "longtext") - .Annotation("MySql:CharSet", "utf8mb4") - .OldAnnotation("MySql:CharSet", "utf8mb4"); - - migrationBuilder.AlterColumn( - name: "UnitOfMeasurement", - table: "ActivityMasters", - type: "longtext", - nullable: true, - oldClrType: typeof(string), - oldType: "longtext") - .Annotation("MySql:CharSet", "utf8mb4") - .OldAnnotation("MySql:CharSet", "utf8mb4"); - - migrationBuilder.AlterColumn( - name: "ActivityName", - table: "ActivityMasters", - type: "longtext", - nullable: true, - oldClrType: typeof(string), - oldType: "longtext") - .Annotation("MySql:CharSet", "utf8mb4") - .OldAnnotation("MySql:CharSet", "utf8mb4"); - - migrationBuilder.AddColumn( - name: "IsActive", - table: "ActivityMasters", - type: "tinyint(1)", - nullable: false, - defaultValue: false); - - migrationBuilder.CreateTable( - name: "ActivityCheckLists", - columns: table => new - { - Id = table.Column(type: "int", nullable: false) - .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), - ActivityId = table.Column(type: "int", nullable: false), - Description = table.Column(type: "longtext", nullable: true) - .Annotation("MySql:CharSet", "utf8mb4"), - IsChecked = table.Column(type: "tinyint(1)", nullable: false), - IsMandatory = table.Column(type: "tinyint(1)", nullable: false), - TenantId = table.Column(type: "int", nullable: false) - }, - constraints: table => - { - table.PrimaryKey("PK_ActivityCheckLists", x => x.Id); - }) - .Annotation("MySql:CharSet", "utf8mb4"); - - migrationBuilder.UpdateData( - table: "ActivityMasters", - keyColumn: "Id", - keyValue: 1, - column: "IsActive", - value: true); - - migrationBuilder.UpdateData( - table: "ActivityMasters", - keyColumn: "Id", - keyValue: 2, - column: "IsActive", - value: true); - - migrationBuilder.UpdateData( - table: "ActivityMasters", - keyColumn: "Id", - keyValue: 3, - column: "IsActive", - value: true); - - migrationBuilder.UpdateData( - table: "ActivityMasters", - keyColumn: "Id", - keyValue: 4, - column: "IsActive", - value: true); - - migrationBuilder.UpdateData( - table: "ActivityMasters", - keyColumn: "Id", - keyValue: 5, - column: "IsActive", - value: true); - - migrationBuilder.UpdateData( - table: "ActivityMasters", - keyColumn: "Id", - keyValue: 6, - column: "IsActive", - value: true); - - migrationBuilder.UpdateData( - table: "ActivityMasters", - keyColumn: "Id", - keyValue: 7, - column: "IsActive", - value: true); - - migrationBuilder.UpdateData( - table: "ActivityMasters", - keyColumn: "Id", - keyValue: 8, - column: "IsActive", - value: true); - - migrationBuilder.UpdateData( - table: "ActivityMasters", - keyColumn: "Id", - keyValue: 9, - column: "IsActive", - value: true); - - migrationBuilder.UpdateData( - table: "ActivityMasters", - keyColumn: "Id", - keyValue: 10, - column: "IsActive", - value: true); - - migrationBuilder.UpdateData( - table: "ActivityMasters", - keyColumn: "Id", - keyValue: 11, - column: "IsActive", - value: true); - - migrationBuilder.UpdateData( - table: "ActivityMasters", - keyColumn: "Id", - keyValue: 12, - column: "IsActive", - value: true); - - migrationBuilder.UpdateData( - table: "ActivityMasters", - keyColumn: "Id", - keyValue: 13, - column: "IsActive", - value: true); - - migrationBuilder.UpdateData( - table: "ActivityMasters", - keyColumn: "Id", - keyValue: 14, - column: "IsActive", - value: true); - } - - /// - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropTable( - name: "ActivityCheckLists"); - - migrationBuilder.DropColumn( - name: "PermanentAddress", - table: "Employees"); - - migrationBuilder.DropColumn( - name: "IsActive", - table: "ActivityMasters"); - - migrationBuilder.UpdateData( - table: "WorkShifts", - keyColumn: "Name", - keyValue: null, - column: "Name", - value: ""); - - migrationBuilder.AlterColumn( - name: "Name", - table: "WorkShifts", - type: "longtext", - nullable: false, - oldClrType: typeof(string), - oldType: "longtext", - oldNullable: true) - .Annotation("MySql:CharSet", "utf8mb4") - .OldAnnotation("MySql:CharSet", "utf8mb4"); - - migrationBuilder.UpdateData( - table: "Tenants", - keyColumn: "Name", - keyValue: null, - column: "Name", - value: ""); - - migrationBuilder.AlterColumn( - name: "Name", - table: "Tenants", - type: "longtext", - nullable: false, - oldClrType: typeof(string), - oldType: "longtext", - oldNullable: true) - .Annotation("MySql:CharSet", "utf8mb4") - .OldAnnotation("MySql:CharSet", "utf8mb4"); - - migrationBuilder.UpdateData( - table: "Tenants", - keyColumn: "DomainName", - keyValue: null, - column: "DomainName", - value: ""); - - migrationBuilder.AlterColumn( - name: "DomainName", - table: "Tenants", - type: "longtext", - nullable: false, - oldClrType: typeof(string), - oldType: "longtext", - oldNullable: true) - .Annotation("MySql:CharSet", "utf8mb4") - .OldAnnotation("MySql:CharSet", "utf8mb4"); - - migrationBuilder.UpdateData( - table: "Tenants", - keyColumn: "Description", - keyValue: null, - column: "Description", - value: ""); - - migrationBuilder.AlterColumn( - name: "Description", - table: "Tenants", - type: "longtext", - nullable: false, - oldClrType: typeof(string), - oldType: "longtext", - oldNullable: true) - .Annotation("MySql:CharSet", "utf8mb4") - .OldAnnotation("MySql:CharSet", "utf8mb4"); - - migrationBuilder.UpdateData( - table: "Tenants", - keyColumn: "ContactNumber", - keyValue: null, - column: "ContactNumber", - value: ""); - - migrationBuilder.AlterColumn( - name: "ContactNumber", - table: "Tenants", - type: "longtext", - nullable: false, - oldClrType: typeof(string), - oldType: "longtext", - oldNullable: true) - .Annotation("MySql:CharSet", "utf8mb4") - .OldAnnotation("MySql:CharSet", "utf8mb4"); - - migrationBuilder.UpdateData( - table: "Tenants", - keyColumn: "ContactName", - keyValue: null, - column: "ContactName", - value: ""); - - migrationBuilder.AlterColumn( - name: "ContactName", - table: "Tenants", - type: "longtext", - nullable: false, - oldClrType: typeof(string), - oldType: "longtext", - oldNullable: true) - .Annotation("MySql:CharSet", "utf8mb4") - .OldAnnotation("MySql:CharSet", "utf8mb4"); - - migrationBuilder.UpdateData( - table: "StatusMasters", - keyColumn: "Status", - keyValue: null, - column: "Status", - value: ""); - - migrationBuilder.AlterColumn( - name: "Status", - table: "StatusMasters", - type: "longtext", - nullable: false, - oldClrType: typeof(string), - oldType: "longtext", - oldNullable: true) - .Annotation("MySql:CharSet", "utf8mb4") - .OldAnnotation("MySql:CharSet", "utf8mb4"); - - migrationBuilder.UpdateData( - table: "RefreshTokens", - keyColumn: "UserId", - keyValue: null, - column: "UserId", - value: ""); - - migrationBuilder.AlterColumn( - name: "UserId", - table: "RefreshTokens", - type: "varchar(255)", - nullable: false, - oldClrType: typeof(string), - oldType: "varchar(255)", - oldNullable: true) - .Annotation("MySql:CharSet", "utf8mb4") - .OldAnnotation("MySql:CharSet", "utf8mb4"); - - migrationBuilder.UpdateData( - table: "RefreshTokens", - keyColumn: "Token", - keyValue: null, - column: "Token", - value: ""); - - migrationBuilder.AlterColumn( - name: "Token", - table: "RefreshTokens", - type: "longtext", - nullable: false, - oldClrType: typeof(string), - oldType: "longtext", - oldNullable: true) - .Annotation("MySql:CharSet", "utf8mb4") - .OldAnnotation("MySql:CharSet", "utf8mb4"); - - migrationBuilder.UpdateData( - table: "Projects", - keyColumn: "ProjectAddress", - keyValue: null, - column: "ProjectAddress", - value: ""); - - migrationBuilder.AlterColumn( - name: "ProjectAddress", - table: "Projects", - type: "longtext", - nullable: false, - oldClrType: typeof(string), - oldType: "longtext", - oldNullable: true) - .Annotation("MySql:CharSet", "utf8mb4") - .OldAnnotation("MySql:CharSet", "utf8mb4"); - - migrationBuilder.UpdateData( - table: "Projects", - keyColumn: "ContactPerson", - keyValue: null, - column: "ContactPerson", - value: ""); - - migrationBuilder.AlterColumn( - name: "ContactPerson", - table: "Projects", - type: "longtext", - nullable: false, - oldClrType: typeof(string), - oldType: "longtext", - oldNullable: true) - .Annotation("MySql:CharSet", "utf8mb4") - .OldAnnotation("MySql:CharSet", "utf8mb4"); - - migrationBuilder.UpdateData( - table: "Modules", - keyColumn: "Description", - keyValue: null, - column: "Description", - value: ""); - - migrationBuilder.AlterColumn( - name: "Description", - table: "Modules", - type: "longtext", - nullable: false, - oldClrType: typeof(string), - oldType: "longtext", - oldNullable: true) - .Annotation("MySql:CharSet", "utf8mb4") - .OldAnnotation("MySql:CharSet", "utf8mb4"); - - migrationBuilder.UpdateData( - table: "JobRoles", - keyColumn: "Name", - keyValue: null, - column: "Name", - value: ""); - - migrationBuilder.AlterColumn( - name: "Name", - table: "JobRoles", - type: "longtext", - nullable: false, - oldClrType: typeof(string), - oldType: "longtext", - oldNullable: true) - .Annotation("MySql:CharSet", "utf8mb4") - .OldAnnotation("MySql:CharSet", "utf8mb4"); - - migrationBuilder.UpdateData( - table: "Industries", - keyColumn: "Name", - keyValue: null, - column: "Name", - value: ""); - - migrationBuilder.AlterColumn( - name: "Name", - table: "Industries", - type: "longtext", - nullable: false, - oldClrType: typeof(string), - oldType: "longtext", - oldNullable: true) - .Annotation("MySql:CharSet", "utf8mb4") - .OldAnnotation("MySql:CharSet", "utf8mb4"); - - migrationBuilder.UpdateData( - table: "Features", - keyColumn: "Name", - keyValue: null, - column: "Name", - value: ""); - - migrationBuilder.AlterColumn( - name: "Name", - table: "Features", - type: "longtext", - nullable: false, - oldClrType: typeof(string), - oldType: "longtext", - oldNullable: true) - .Annotation("MySql:CharSet", "utf8mb4") - .OldAnnotation("MySql:CharSet", "utf8mb4"); - - migrationBuilder.UpdateData( - table: "Features", - keyColumn: "Description", - keyValue: null, - column: "Description", - value: ""); - - migrationBuilder.AlterColumn( - name: "Description", - table: "Features", - type: "longtext", - nullable: false, - oldClrType: typeof(string), - oldType: "longtext", - oldNullable: true) - .Annotation("MySql:CharSet", "utf8mb4") - .OldAnnotation("MySql:CharSet", "utf8mb4"); - - migrationBuilder.UpdateData( - table: "FeaturePermissions", - keyColumn: "Name", - keyValue: null, - column: "Name", - value: ""); - - migrationBuilder.AlterColumn( - name: "Name", - table: "FeaturePermissions", - type: "longtext", - nullable: false, - oldClrType: typeof(string), - oldType: "longtext", - oldNullable: true) - .Annotation("MySql:CharSet", "utf8mb4") - .OldAnnotation("MySql:CharSet", "utf8mb4"); - - migrationBuilder.UpdateData( - table: "FeaturePermissions", - keyColumn: "Description", - keyValue: null, - column: "Description", - value: ""); - - migrationBuilder.AlterColumn( - name: "Description", - table: "FeaturePermissions", - type: "longtext", - nullable: false, - oldClrType: typeof(string), - oldType: "longtext", - oldNullable: true) - .Annotation("MySql:CharSet", "utf8mb4") - .OldAnnotation("MySql:CharSet", "utf8mb4"); - - migrationBuilder.UpdateData( - table: "Employees", - keyColumn: "PhoneNumber", - keyValue: null, - column: "PhoneNumber", - value: ""); - - migrationBuilder.AlterColumn( - name: "PhoneNumber", - table: "Employees", - type: "longtext", - nullable: false, - oldClrType: typeof(string), - oldType: "longtext", - oldNullable: true) - .Annotation("MySql:CharSet", "utf8mb4") - .OldAnnotation("MySql:CharSet", "utf8mb4"); - - migrationBuilder.UpdateData( - table: "Employees", - keyColumn: "LastName", - keyValue: null, - column: "LastName", - value: ""); - - migrationBuilder.AlterColumn( - name: "LastName", - table: "Employees", - type: "longtext", - nullable: false, - oldClrType: typeof(string), - oldType: "longtext", - oldNullable: true) - .Annotation("MySql:CharSet", "utf8mb4") - .OldAnnotation("MySql:CharSet", "utf8mb4"); - - migrationBuilder.UpdateData( - table: "Employees", - keyColumn: "Gender", - keyValue: null, - column: "Gender", - value: ""); - - migrationBuilder.AlterColumn( - name: "Gender", - table: "Employees", - type: "longtext", - nullable: false, - oldClrType: typeof(string), - oldType: "longtext", - oldNullable: true) - .Annotation("MySql:CharSet", "utf8mb4") - .OldAnnotation("MySql:CharSet", "utf8mb4"); - - migrationBuilder.UpdateData( - table: "Employees", - keyColumn: "FirstName", - keyValue: null, - column: "FirstName", - value: ""); - - migrationBuilder.AlterColumn( - name: "FirstName", - table: "Employees", - type: "longtext", - nullable: false, - oldClrType: typeof(string), - oldType: "longtext", - oldNullable: true) - .Annotation("MySql:CharSet", "utf8mb4") - .OldAnnotation("MySql:CharSet", "utf8mb4"); - - migrationBuilder.UpdateData( - table: "Employees", - keyColumn: "EmergencyPhoneNumber", - keyValue: null, - column: "EmergencyPhoneNumber", - value: ""); - - migrationBuilder.AlterColumn( - name: "EmergencyPhoneNumber", - table: "Employees", - type: "longtext", - nullable: false, - oldClrType: typeof(string), - oldType: "longtext", - oldNullable: true) - .Annotation("MySql:CharSet", "utf8mb4") - .OldAnnotation("MySql:CharSet", "utf8mb4"); - - migrationBuilder.UpdateData( - table: "Employees", - keyColumn: "EmergencyContactPerson", - keyValue: null, - column: "EmergencyContactPerson", - value: ""); - - migrationBuilder.AlterColumn( - name: "EmergencyContactPerson", - table: "Employees", - type: "longtext", - nullable: false, - oldClrType: typeof(string), - oldType: "longtext", - oldNullable: true) - .Annotation("MySql:CharSet", "utf8mb4") - .OldAnnotation("MySql:CharSet", "utf8mb4"); - - migrationBuilder.UpdateData( - table: "Employees", - keyColumn: "CurrentAddress", - keyValue: null, - column: "CurrentAddress", - value: ""); - - migrationBuilder.AlterColumn( - name: "CurrentAddress", - table: "Employees", - type: "longtext", - nullable: false, - oldClrType: typeof(string), - oldType: "longtext", - oldNullable: true) - .Annotation("MySql:CharSet", "utf8mb4") - .OldAnnotation("MySql:CharSet", "utf8mb4"); - - migrationBuilder.AddColumn( - name: "PeramnentAddress", - table: "Employees", - type: "longtext", - nullable: false) - .Annotation("MySql:CharSet", "utf8mb4"); - - migrationBuilder.UpdateData( - table: "ApplicationRoles", - keyColumn: "Role", - keyValue: null, - column: "Role", - value: ""); - - migrationBuilder.AlterColumn( - name: "Role", - table: "ApplicationRoles", - type: "longtext", - nullable: false, - oldClrType: typeof(string), - oldType: "longtext", - oldNullable: true) - .Annotation("MySql:CharSet", "utf8mb4") - .OldAnnotation("MySql:CharSet", "utf8mb4"); - - migrationBuilder.UpdateData( - table: "ApplicationRoles", - keyColumn: "Description", - keyValue: null, - column: "Description", - value: ""); - - migrationBuilder.AlterColumn( - name: "Description", - table: "ApplicationRoles", - type: "longtext", - nullable: false, - oldClrType: typeof(string), - oldType: "longtext", - oldNullable: true) - .Annotation("MySql:CharSet", "utf8mb4") - .OldAnnotation("MySql:CharSet", "utf8mb4"); - - migrationBuilder.UpdateData( - table: "ActivityMasters", - keyColumn: "UnitOfMeasurement", - keyValue: null, - column: "UnitOfMeasurement", - value: ""); - - migrationBuilder.AlterColumn( - name: "UnitOfMeasurement", - table: "ActivityMasters", - type: "longtext", - nullable: false, - oldClrType: typeof(string), - oldType: "longtext", - oldNullable: true) - .Annotation("MySql:CharSet", "utf8mb4") - .OldAnnotation("MySql:CharSet", "utf8mb4"); - - migrationBuilder.UpdateData( - table: "ActivityMasters", - keyColumn: "ActivityName", - keyValue: null, - column: "ActivityName", - value: ""); - - migrationBuilder.AlterColumn( - name: "ActivityName", - table: "ActivityMasters", - type: "longtext", - nullable: false, - oldClrType: typeof(string), - oldType: "longtext", - oldNullable: true) - .Annotation("MySql:CharSet", "utf8mb4") - .OldAnnotation("MySql:CharSet", "utf8mb4"); - } - } -} diff --git a/Marco.Pms.DataAccess/Migrations/20250415111241_Added_CheckListMappings_Table.Designer.cs b/Marco.Pms.DataAccess/Migrations/20250415111241_Added_CheckListMappings_Table.Designer.cs deleted file mode 100644 index b2221b8..0000000 --- a/Marco.Pms.DataAccess/Migrations/20250415111241_Added_CheckListMappings_Table.Designer.cs +++ /dev/null @@ -1,2092 +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("20250415111241_Added_CheckListMappings_Table")] - partial class Added_CheckListMappings_Table - { - /// - 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("bigint"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - - b.Property("AssignedBy") - .HasColumnType("int"); - - b.Property("AssignmentDate") - .HasColumnType("datetime(6)"); - - b.Property("CompletedTask") - .HasColumnType("double"); - - b.Property("Description") - .HasColumnType("longtext"); - - b.Property("PlannedTask") - .HasColumnType("double"); - - b.Property("ReportedDate") - .HasColumnType("datetime(6)"); - - b.Property("TenantId") - .HasColumnType("int"); - - b.Property("WorkItemId") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("AssignedBy"); - - b.HasIndex("TenantId"); - - b.HasIndex("WorkItemId"); - - b.ToTable("TaskAllocations"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Activities.TaskComment", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - - b.Property("Comment") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("CommentDate") - .HasColumnType("datetime(6)"); - - b.Property("CommentedBy") - .HasColumnType("int"); - - b.Property("TaskAllocationId") - .HasColumnType("bigint"); - - b.Property("TenantId") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("CommentedBy"); - - b.HasIndex("TaskAllocationId"); - - b.HasIndex("TenantId"); - - b.ToTable("TaskComments"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Activities.TaskMembers", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - - b.Property("EmployeeId") - .HasColumnType("int"); - - b.Property("TaskAllocationId") - .HasColumnType("bigint"); - - b.Property("TenantId") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("EmployeeId"); - - b.HasIndex("TaskAllocationId"); - - b.HasIndex("TenantId"); - - b.ToTable("TaskMembers"); - }); - - 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") - .HasColumnType("longtext"); - - b.Property("UserId") - .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") - .HasColumnType("longtext"); - - b.Property("Email") - .HasColumnType("longtext"); - - b.Property("EmergencyContactPerson") - .HasColumnType("longtext"); - - b.Property("EmergencyPhoneNumber") - .HasColumnType("longtext"); - - b.Property("FirstName") - .HasColumnType("longtext"); - - b.Property("Gender") - .HasColumnType("longtext"); - - b.Property("IsActive") - .HasColumnType("tinyint(1)"); - - b.Property("JobRoleId") - .HasColumnType("int"); - - b.Property("JoiningDate") - .HasColumnType("datetime(6)"); - - b.Property("LastName") - .HasColumnType("longtext"); - - b.Property("MiddleName") - .HasColumnType("longtext"); - - b.Property("PanNumber") - .HasColumnType("longtext"); - - b.Property("PermanentAddress") - .HasColumnType("longtext"); - - b.Property("PhoneNumber") - .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") - .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.ActivityCheckList", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - - b.Property("ActivityMasterId") - .HasColumnType("int"); - - b.Property("Check") - .HasColumnType("longtext"); - - b.Property("IsChecked") - .HasColumnType("tinyint(1)"); - - b.Property("IsMandatory") - .HasColumnType("tinyint(1)"); - - b.Property("TenantId") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.ToTable("ActivityCheckLists"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Entitlements.ActivityMaster", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - - b.Property("ActivityName") - .HasColumnType("longtext"); - - b.Property("IsActive") - .HasColumnType("tinyint(1)"); - - b.Property("TenantId") - .HasColumnType("int"); - - b.Property("UnitOfMeasurement") - .HasColumnType("longtext"); - - b.HasKey("Id"); - - b.HasIndex("TenantId"); - - b.ToTable("ActivityMasters"); - - b.HasData( - new - { - Id = 1, - ActivityName = "Core Cutting", - IsActive = true, - TenantId = 1, - UnitOfMeasurement = "Number" - }, - new - { - Id = 2, - ActivityName = "Fabrication", - IsActive = true, - TenantId = 1, - UnitOfMeasurement = "Meter" - }, - new - { - Id = 3, - ActivityName = "Lifting", - IsActive = true, - TenantId = 1, - UnitOfMeasurement = "Meter" - }, - new - { - Id = 4, - ActivityName = "Hanging", - IsActive = true, - TenantId = 1, - UnitOfMeasurement = "Meter" - }, - new - { - Id = 5, - ActivityName = "Tapping", - IsActive = true, - TenantId = 1, - UnitOfMeasurement = "Meter" - }, - new - { - Id = 6, - ActivityName = "Welding", - IsActive = true, - TenantId = 1, - UnitOfMeasurement = "Meter" - }, - new - { - Id = 7, - ActivityName = "Testing", - IsActive = true, - TenantId = 1, - UnitOfMeasurement = "Area" - }, - new - { - Id = 8, - ActivityName = "Painting", - IsActive = true, - TenantId = 1, - UnitOfMeasurement = "Meter" - }, - new - { - Id = 9, - ActivityName = "Marking Area", - IsActive = true, - TenantId = 1, - UnitOfMeasurement = "Meter" - }, - new - { - Id = 10, - ActivityName = "Drilling", - IsActive = true, - TenantId = 1, - UnitOfMeasurement = "Number" - }, - new - { - Id = 11, - ActivityName = "MS Support Fabrication", - IsActive = true, - TenantId = 1, - UnitOfMeasurement = "Number" - }, - new - { - Id = 12, - ActivityName = "MS Support Hanging", - IsActive = true, - TenantId = 1, - UnitOfMeasurement = "Number" - }, - new - { - Id = 13, - ActivityName = "Hydrant Volve", - IsActive = true, - TenantId = 1, - UnitOfMeasurement = "Number" - }, - new - { - Id = 14, - ActivityName = "Sprinkler Installation", - IsActive = true, - TenantId = 1, - UnitOfMeasurement = "Number" - }); - }); - - modelBuilder.Entity("Marco.Pms.Model.Entitlements.ApplicationRole", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("char(36)"); - - b.Property("Description") - .HasColumnType("longtext"); - - b.Property("Role") - .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.CheckListMappings", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - - b.Property("CheckListId") - .HasColumnType("int"); - - b.Property("TaskAllocationId") - .HasColumnType("bigint"); - - b.HasKey("Id"); - - b.ToTable("CheckListMappings"); - }); - - 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") - .HasColumnType("longtext"); - - b.Property("IsActive") - .HasColumnType("tinyint(1)"); - - b.Property("ModuleId") - .HasColumnType("int"); - - b.Property("Name") - .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") - .HasColumnType("longtext"); - - b.Property("FeatureId") - .HasColumnType("char(36)"); - - b.Property("IsEnabled") - .HasColumnType("tinyint(1)"); - - b.Property("Name") - .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") - .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") - .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") - .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") - .HasColumnType("longtext"); - - b.Property("ContactNumber") - .HasColumnType("longtext"); - - b.Property("Description") - .HasColumnType("longtext"); - - b.Property("DomainName") - .HasColumnType("longtext"); - - b.Property("IndustryId") - .HasColumnType("int"); - - b.Property("IsActive") - .HasColumnType("tinyint(1)"); - - b.Property("Name") - .HasColumnType("longtext"); - - b.Property("OnBoardingDate") - .HasColumnType("datetime(6)"); - - b.Property("OragnizationSize") - .HasColumnType("longtext"); - - b.HasKey("Id"); - - b.HasIndex("IndustryId"); - - b.ToTable("Tenants"); - - b.HasData( - new - { - Id = 1, - ContactName = "Admin", - ContactNumber = "123456789", - Description = "", - DomainName = "www.marcobms.org", - IndustryId = 1, - IsActive = true, - Name = "MarcoBMS", - OnBoardingDate = new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified) - }); - }); - - modelBuilder.Entity("Marco.Pms.Model.Industries.Industry", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - - b.Property("Name") - .HasColumnType("longtext"); - - b.HasKey("Id"); - - b.ToTable("Industries"); - - b.HasData( - new - { - Id = 1, - Name = "Information Technology (IT) Services" - }, - new - { - Id = 2, - Name = "Manufacturing & Production" - }, - new - { - Id = 3, - Name = "Energy & Resources" - }, - new - { - Id = 4, - Name = "Finance & Professional Services" - }, - new - { - Id = 5, - Name = "Hospitals and Healthcare Services" - }, - new - { - Id = 6, - Name = "Social Services" - }, - new - { - Id = 7, - Name = "Retail & Consumer Services" - }, - new - { - Id = 8, - Name = "Transportation & Logistics" - }, - new - { - Id = 9, - Name = "Education & Training" - }); - }); - - 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") - .HasColumnType("longtext"); - - b.Property("EndDate") - .HasColumnType("datetime(6)"); - - b.Property("Name") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("ProjectAddress") - .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("Marco.Pms.Model.Projects.WorkItem", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - - b.Property("ActivityId") - .HasColumnType("int"); - - b.Property("CompletedWork") - .HasColumnType("double"); - - b.Property("PlannedWork") - .HasColumnType("double"); - - 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("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("IsActive") - .HasColumnType("tinyint(1)"); - - b.Property("IsRootUser") - .HasColumnType("tinyint(1)"); - - b.Property("TenantId") - .HasColumnType("int"); - - b.HasDiscriminator().HasValue("ApplicationUser"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Activities.TaskAllocation", b => - { - b.HasOne("Marco.Pms.Model.Employees.Employee", "Employee") - .WithMany() - .HasForeignKey("AssignedBy") - .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.WorkItem", "WorkItem") - .WithMany() - .HasForeignKey("WorkItemId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Employee"); - - b.Navigation("Tenant"); - - b.Navigation("WorkItem"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Activities.TaskComment", b => - { - b.HasOne("Marco.Pms.Model.Employees.Employee", "Employee") - .WithMany() - .HasForeignKey("CommentedBy") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Marco.Pms.Model.Activities.TaskAllocation", "TaskAllocation") - .WithMany() - .HasForeignKey("TaskAllocationId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Marco.Pms.Model.Entitlements.Tenant", "Tenant") - .WithMany() - .HasForeignKey("TenantId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Employee"); - - b.Navigation("TaskAllocation"); - - b.Navigation("Tenant"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Activities.TaskMembers", b => - { - b.HasOne("Marco.Pms.Model.Employees.Employee", "Employee") - .WithMany() - .HasForeignKey("EmployeeId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Marco.Pms.Model.Activities.TaskAllocation", "TaskAllocation") - .WithMany() - .HasForeignKey("TaskAllocationId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Marco.Pms.Model.Entitlements.Tenant", "Tenant") - .WithMany() - .HasForeignKey("TenantId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Employee"); - - b.Navigation("TaskAllocation"); - - 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); - - 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.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.Entitlements.Tenant", b => - { - b.HasOne("Marco.Pms.Model.Industries.Industry", "Industry") - .WithMany() - .HasForeignKey("IndustryId"); - - b.Navigation("Industry"); - }); - - 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("Marco.Pms.Model.Projects.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("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.Entitlements.Feature", b => - { - b.Navigation("FeaturePermissions"); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/Marco.Pms.DataAccess/Migrations/20250415111241_Added_CheckListMappings_Table.cs b/Marco.Pms.DataAccess/Migrations/20250415111241_Added_CheckListMappings_Table.cs deleted file mode 100644 index 9a55d5a..0000000 --- a/Marco.Pms.DataAccess/Migrations/20250415111241_Added_CheckListMappings_Table.cs +++ /dev/null @@ -1,37 +0,0 @@ -using Microsoft.EntityFrameworkCore.Metadata; -using Microsoft.EntityFrameworkCore.Migrations; - -#nullable disable - -namespace Marco.Pms.DataAccess.Migrations -{ - /// - public partial class Added_CheckListMappings_Table : Migration - { - /// - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.CreateTable( - name: "CheckListMappings", - columns: table => new - { - Id = table.Column(type: "int", nullable: false) - .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), - TaskAllocationId = table.Column(type: "bigint", nullable: false), - CheckListId = table.Column(type: "int", nullable: false) - }, - constraints: table => - { - table.PrimaryKey("PK_CheckListMappings", x => x.Id); - }) - .Annotation("MySql:CharSet", "utf8mb4"); - } - - /// - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropTable( - name: "CheckListMappings"); - } - } -} diff --git a/Marco.Pms.DataAccess/Migrations/20250418073455_Added_Inquiries_table.Designer.cs b/Marco.Pms.DataAccess/Migrations/20250418073455_Added_Inquiries_table.Designer.cs deleted file mode 100644 index 631debd..0000000 --- a/Marco.Pms.DataAccess/Migrations/20250418073455_Added_Inquiries_table.Designer.cs +++ /dev/null @@ -1,2126 +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("20250418073455_Added_Inquiries_table")] - partial class Added_Inquiries_table - { - /// - 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("bigint"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - - b.Property("AssignedBy") - .HasColumnType("int"); - - b.Property("AssignmentDate") - .HasColumnType("datetime(6)"); - - b.Property("CompletedTask") - .HasColumnType("double"); - - b.Property("Description") - .HasColumnType("longtext"); - - b.Property("PlannedTask") - .HasColumnType("double"); - - b.Property("ReportedDate") - .HasColumnType("datetime(6)"); - - b.Property("TenantId") - .HasColumnType("int"); - - b.Property("WorkItemId") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("AssignedBy"); - - b.HasIndex("TenantId"); - - b.HasIndex("WorkItemId"); - - b.ToTable("TaskAllocations"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Activities.TaskComment", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - - b.Property("Comment") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("CommentDate") - .HasColumnType("datetime(6)"); - - b.Property("CommentedBy") - .HasColumnType("int"); - - b.Property("TaskAllocationId") - .HasColumnType("bigint"); - - b.Property("TenantId") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("CommentedBy"); - - b.HasIndex("TaskAllocationId"); - - b.HasIndex("TenantId"); - - b.ToTable("TaskComments"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Activities.TaskMembers", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - - b.Property("EmployeeId") - .HasColumnType("int"); - - b.Property("TaskAllocationId") - .HasColumnType("bigint"); - - b.Property("TenantId") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("EmployeeId"); - - b.HasIndex("TaskAllocationId"); - - b.HasIndex("TenantId"); - - b.ToTable("TaskMembers"); - }); - - 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") - .HasColumnType("longtext"); - - b.Property("UserId") - .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") - .HasColumnType("longtext"); - - b.Property("Email") - .HasColumnType("longtext"); - - b.Property("EmergencyContactPerson") - .HasColumnType("longtext"); - - b.Property("EmergencyPhoneNumber") - .HasColumnType("longtext"); - - b.Property("FirstName") - .HasColumnType("longtext"); - - b.Property("Gender") - .HasColumnType("longtext"); - - b.Property("IsActive") - .HasColumnType("tinyint(1)"); - - b.Property("JobRoleId") - .HasColumnType("int"); - - b.Property("JoiningDate") - .HasColumnType("datetime(6)"); - - b.Property("LastName") - .HasColumnType("longtext"); - - b.Property("MiddleName") - .HasColumnType("longtext"); - - b.Property("PanNumber") - .HasColumnType("longtext"); - - b.Property("PermanentAddress") - .HasColumnType("longtext"); - - b.Property("PhoneNumber") - .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") - .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.ActivityCheckList", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - - b.Property("ActivityId") - .HasColumnType("int"); - - b.Property("Description") - .HasColumnType("longtext"); - - b.Property("IsChecked") - .HasColumnType("tinyint(1)"); - - b.Property("IsMandatory") - .HasColumnType("tinyint(1)"); - - b.Property("TenantId") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.ToTable("ActivityCheckLists"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Entitlements.ActivityMaster", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - - b.Property("ActivityName") - .HasColumnType("longtext"); - - b.Property("IsActive") - .HasColumnType("tinyint(1)"); - - b.Property("TenantId") - .HasColumnType("int"); - - b.Property("UnitOfMeasurement") - .HasColumnType("longtext"); - - b.HasKey("Id"); - - b.HasIndex("TenantId"); - - b.ToTable("ActivityMasters"); - - b.HasData( - new - { - Id = 1, - ActivityName = "Core Cutting", - IsActive = true, - TenantId = 1, - UnitOfMeasurement = "Number" - }, - new - { - Id = 2, - ActivityName = "Fabrication", - IsActive = true, - TenantId = 1, - UnitOfMeasurement = "Meter" - }, - new - { - Id = 3, - ActivityName = "Lifting", - IsActive = true, - TenantId = 1, - UnitOfMeasurement = "Meter" - }, - new - { - Id = 4, - ActivityName = "Hanging", - IsActive = true, - TenantId = 1, - UnitOfMeasurement = "Meter" - }, - new - { - Id = 5, - ActivityName = "Tapping", - IsActive = true, - TenantId = 1, - UnitOfMeasurement = "Meter" - }, - new - { - Id = 6, - ActivityName = "Welding", - IsActive = true, - TenantId = 1, - UnitOfMeasurement = "Meter" - }, - new - { - Id = 7, - ActivityName = "Testing", - IsActive = true, - TenantId = 1, - UnitOfMeasurement = "Area" - }, - new - { - Id = 8, - ActivityName = "Painting", - IsActive = true, - TenantId = 1, - UnitOfMeasurement = "Meter" - }, - new - { - Id = 9, - ActivityName = "Marking Area", - IsActive = true, - TenantId = 1, - UnitOfMeasurement = "Meter" - }, - new - { - Id = 10, - ActivityName = "Drilling", - IsActive = true, - TenantId = 1, - UnitOfMeasurement = "Number" - }, - new - { - Id = 11, - ActivityName = "MS Support Fabrication", - IsActive = true, - TenantId = 1, - UnitOfMeasurement = "Number" - }, - new - { - Id = 12, - ActivityName = "MS Support Hanging", - IsActive = true, - TenantId = 1, - UnitOfMeasurement = "Number" - }, - new - { - Id = 13, - ActivityName = "Hydrant Volve", - IsActive = true, - TenantId = 1, - UnitOfMeasurement = "Number" - }, - new - { - Id = 14, - ActivityName = "Sprinkler Installation", - IsActive = true, - TenantId = 1, - UnitOfMeasurement = "Number" - }); - }); - - modelBuilder.Entity("Marco.Pms.Model.Entitlements.ApplicationRole", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("char(36)"); - - b.Property("Description") - .HasColumnType("longtext"); - - b.Property("Role") - .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.CheckListMappings", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - - b.Property("CheckListId") - .HasColumnType("int"); - - b.Property("TaskAllocationId") - .HasColumnType("bigint"); - - b.HasKey("Id"); - - b.ToTable("CheckListMappings"); - }); - - 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") - .HasColumnType("longtext"); - - b.Property("IsActive") - .HasColumnType("tinyint(1)"); - - b.Property("ModuleId") - .HasColumnType("int"); - - b.Property("Name") - .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") - .HasColumnType("longtext"); - - b.Property("FeatureId") - .HasColumnType("char(36)"); - - b.Property("IsEnabled") - .HasColumnType("tinyint(1)"); - - b.Property("Name") - .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") - .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") - .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") - .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") - .HasColumnType("longtext"); - - b.Property("ContactNumber") - .HasColumnType("longtext"); - - b.Property("Description") - .HasColumnType("longtext"); - - b.Property("DomainName") - .HasColumnType("longtext"); - - b.Property("IndustryId") - .HasColumnType("int"); - - b.Property("IsActive") - .HasColumnType("tinyint(1)"); - - b.Property("Name") - .HasColumnType("longtext"); - - b.Property("OnBoardingDate") - .HasColumnType("datetime(6)"); - - b.Property("OragnizationSize") - .HasColumnType("longtext"); - - b.HasKey("Id"); - - b.HasIndex("IndustryId"); - - b.ToTable("Tenants"); - - b.HasData( - new - { - Id = 1, - ContactName = "Admin", - ContactNumber = "123456789", - Description = "", - DomainName = "www.marcobms.org", - IndustryId = 1, - IsActive = true, - Name = "MarcoBMS", - OnBoardingDate = new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified) - }); - }); - - modelBuilder.Entity("Marco.Pms.Model.Industries.Industry", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - - b.Property("Name") - .HasColumnType("longtext"); - - b.HasKey("Id"); - - b.ToTable("Industries"); - - b.HasData( - new - { - Id = 1, - Name = "Information Technology (IT) Services" - }, - new - { - Id = 2, - Name = "Manufacturing & Production" - }, - new - { - Id = 3, - Name = "Energy & Resources" - }, - new - { - Id = 4, - Name = "Finance & Professional Services" - }, - new - { - Id = 5, - Name = "Hospitals and Healthcare Services" - }, - new - { - Id = 6, - Name = "Social Services" - }, - new - { - Id = 7, - Name = "Retail & Consumer Services" - }, - new - { - Id = 8, - Name = "Transportation & Logistics" - }, - new - { - Id = 9, - Name = "Education & Training" - }); - }); - - 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") - .HasColumnType("longtext"); - - b.Property("EndDate") - .HasColumnType("datetime(6)"); - - b.Property("Name") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("ProjectAddress") - .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("Marco.Pms.Model.Projects.WorkItem", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - - b.Property("ActivityId") - .HasColumnType("int"); - - b.Property("CompletedWork") - .HasColumnType("double"); - - b.Property("PlannedWork") - .HasColumnType("double"); - - 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.Utilities.Inquiries", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - - b.Property("About") - .HasColumnType("longtext"); - - b.Property("ContactNumber") - .HasColumnType("longtext"); - - b.Property("ContactPerson") - .HasColumnType("longtext"); - - b.Property("Email") - .HasColumnType("longtext"); - - b.Property("IndustryId") - .HasColumnType("int"); - - b.Property("OragnizationSize") - .HasColumnType("longtext"); - - b.Property("OrganizatioinName") - .HasColumnType("longtext"); - - b.HasKey("Id"); - - b.ToTable("Inquiries"); - }); - - 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("IsActive") - .HasColumnType("tinyint(1)"); - - b.Property("IsRootUser") - .HasColumnType("tinyint(1)"); - - b.Property("TenantId") - .HasColumnType("int"); - - b.HasDiscriminator().HasValue("ApplicationUser"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Activities.TaskAllocation", b => - { - b.HasOne("Marco.Pms.Model.Employees.Employee", "Employee") - .WithMany() - .HasForeignKey("AssignedBy") - .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.WorkItem", "WorkItem") - .WithMany() - .HasForeignKey("WorkItemId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Employee"); - - b.Navigation("Tenant"); - - b.Navigation("WorkItem"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Activities.TaskComment", b => - { - b.HasOne("Marco.Pms.Model.Employees.Employee", "Employee") - .WithMany() - .HasForeignKey("CommentedBy") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Marco.Pms.Model.Activities.TaskAllocation", "TaskAllocation") - .WithMany() - .HasForeignKey("TaskAllocationId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Marco.Pms.Model.Entitlements.Tenant", "Tenant") - .WithMany() - .HasForeignKey("TenantId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Employee"); - - b.Navigation("TaskAllocation"); - - b.Navigation("Tenant"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Activities.TaskMembers", b => - { - b.HasOne("Marco.Pms.Model.Employees.Employee", "Employee") - .WithMany() - .HasForeignKey("EmployeeId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Marco.Pms.Model.Activities.TaskAllocation", "TaskAllocation") - .WithMany() - .HasForeignKey("TaskAllocationId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Marco.Pms.Model.Entitlements.Tenant", "Tenant") - .WithMany() - .HasForeignKey("TenantId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Employee"); - - b.Navigation("TaskAllocation"); - - 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); - - 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.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.Entitlements.Tenant", b => - { - b.HasOne("Marco.Pms.Model.Industries.Industry", "Industry") - .WithMany() - .HasForeignKey("IndustryId"); - - b.Navigation("Industry"); - }); - - 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("Marco.Pms.Model.Projects.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("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.Entitlements.Feature", b => - { - b.Navigation("FeaturePermissions"); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/Marco.Pms.DataAccess/Migrations/20250418073455_Added_Inquiries_table.cs b/Marco.Pms.DataAccess/Migrations/20250418073455_Added_Inquiries_table.cs deleted file mode 100644 index 3645b85..0000000 --- a/Marco.Pms.DataAccess/Migrations/20250418073455_Added_Inquiries_table.cs +++ /dev/null @@ -1,48 +0,0 @@ -using Microsoft.EntityFrameworkCore.Metadata; -using Microsoft.EntityFrameworkCore.Migrations; - -#nullable disable - -namespace Marco.Pms.DataAccess.Migrations -{ - /// - public partial class Added_Inquiries_table : Migration - { - /// - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.CreateTable( - name: "Inquiries", - columns: table => new - { - Id = table.Column(type: "int", nullable: false) - .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), - OrganizatioinName = table.Column(type: "longtext", nullable: true) - .Annotation("MySql:CharSet", "utf8mb4"), - Email = table.Column(type: "longtext", nullable: true) - .Annotation("MySql:CharSet", "utf8mb4"), - About = table.Column(type: "longtext", nullable: true) - .Annotation("MySql:CharSet", "utf8mb4"), - OragnizationSize = table.Column(type: "longtext", nullable: true) - .Annotation("MySql:CharSet", "utf8mb4"), - IndustryId = table.Column(type: "int", nullable: false), - ContactPerson = table.Column(type: "longtext", nullable: true) - .Annotation("MySql:CharSet", "utf8mb4"), - ContactNumber = table.Column(type: "longtext", nullable: true) - .Annotation("MySql:CharSet", "utf8mb4") - }, - constraints: table => - { - table.PrimaryKey("PK_Inquiries", x => x.Id); - }) - .Annotation("MySql:CharSet", "utf8mb4"); - } - - /// - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropTable( - name: "Inquiries"); - } - } -} diff --git a/Marco.Pms.DataAccess/Migrations/20250423090827_Added_Forum_Tables.Designer.cs b/Marco.Pms.DataAccess/Migrations/20250423090827_Added_Forum_Tables.Designer.cs deleted file mode 100644 index bf769a7..0000000 --- a/Marco.Pms.DataAccess/Migrations/20250423090827_Added_Forum_Tables.Designer.cs +++ /dev/null @@ -1,2632 +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("20250423090827_Added_Forum_Tables")] - partial class Added_Forum_Tables - { - /// - 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("bigint"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - - b.Property("AssignedBy") - .HasColumnType("int"); - - b.Property("AssignmentDate") - .HasColumnType("datetime(6)"); - - b.Property("CompletedTask") - .HasColumnType("double"); - - b.Property("Description") - .HasColumnType("longtext"); - - b.Property("PlannedTask") - .HasColumnType("double"); - - b.Property("ReportedDate") - .HasColumnType("datetime(6)"); - - b.Property("TenantId") - .HasColumnType("int"); - - b.Property("WorkItemId") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("AssignedBy"); - - b.HasIndex("TenantId"); - - b.HasIndex("WorkItemId"); - - b.ToTable("TaskAllocations"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Activities.TaskComment", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - - b.Property("Comment") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("CommentDate") - .HasColumnType("datetime(6)"); - - b.Property("CommentedBy") - .HasColumnType("int"); - - b.Property("TaskAllocationId") - .HasColumnType("bigint"); - - b.Property("TenantId") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("CommentedBy"); - - b.HasIndex("TaskAllocationId"); - - b.HasIndex("TenantId"); - - b.ToTable("TaskComments"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Activities.TaskMembers", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - - b.Property("EmployeeId") - .HasColumnType("int"); - - b.Property("TaskAllocationId") - .HasColumnType("bigint"); - - b.Property("TenantId") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("EmployeeId"); - - b.HasIndex("TaskAllocationId"); - - b.HasIndex("TenantId"); - - b.ToTable("TaskMembers"); - }); - - 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") - .HasColumnType("longtext"); - - b.Property("UserId") - .HasColumnType("varchar(255)"); - - b.HasKey("Id"); - - b.HasIndex("UserId"); - - b.ToTable("RefreshTokens"); - }); - - modelBuilder.Entity("Marco.Pms.Model.DocumentManager.Document", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("char(36)"); - - b.Property("Base64Data") - .HasColumnType("longtext"); - - b.Property("BatchId") - .HasColumnType("char(36)"); - - b.Property("ContentType") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("FileName") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("FileSize") - .HasColumnType("bigint"); - - b.Property("S3Key") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("TenantId") - .HasColumnType("int"); - - b.Property("ThumbS3Key") - .HasColumnType("longtext"); - - b.Property("UploadedAt") - .HasColumnType("datetime(6)"); - - b.HasKey("Id"); - - b.HasIndex("TenantId"); - - b.ToTable("Documents"); - }); - - 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") - .HasColumnType("longtext"); - - b.Property("Email") - .HasColumnType("longtext"); - - b.Property("EmergencyContactPerson") - .HasColumnType("longtext"); - - b.Property("EmergencyPhoneNumber") - .HasColumnType("longtext"); - - b.Property("FirstName") - .HasColumnType("longtext"); - - b.Property("Gender") - .HasColumnType("longtext"); - - b.Property("IsActive") - .HasColumnType("tinyint(1)"); - - b.Property("JobRoleId") - .HasColumnType("int"); - - b.Property("JoiningDate") - .HasColumnType("datetime(6)"); - - b.Property("LastName") - .HasColumnType("longtext"); - - b.Property("MiddleName") - .HasColumnType("longtext"); - - b.Property("PanNumber") - .HasColumnType("longtext"); - - b.Property("PermanentAddress") - .HasColumnType("longtext"); - - b.Property("PhoneNumber") - .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") - .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.ActivityCheckList", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - - b.Property("ActivityId") - .HasColumnType("int"); - - b.Property("Description") - .HasColumnType("longtext"); - - b.Property("IsChecked") - .HasColumnType("tinyint(1)"); - - b.Property("IsMandatory") - .HasColumnType("tinyint(1)"); - - b.Property("TenantId") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.ToTable("ActivityCheckLists"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Entitlements.ActivityMaster", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - - b.Property("ActivityName") - .HasColumnType("longtext"); - - b.Property("IsActive") - .HasColumnType("tinyint(1)"); - - b.Property("TenantId") - .HasColumnType("int"); - - b.Property("UnitOfMeasurement") - .HasColumnType("longtext"); - - b.HasKey("Id"); - - b.HasIndex("TenantId"); - - b.ToTable("ActivityMasters"); - - b.HasData( - new - { - Id = 1, - ActivityName = "Core Cutting", - IsActive = true, - TenantId = 1, - UnitOfMeasurement = "Number" - }, - new - { - Id = 2, - ActivityName = "Fabrication", - IsActive = true, - TenantId = 1, - UnitOfMeasurement = "Meter" - }, - new - { - Id = 3, - ActivityName = "Lifting", - IsActive = true, - TenantId = 1, - UnitOfMeasurement = "Meter" - }, - new - { - Id = 4, - ActivityName = "Hanging", - IsActive = true, - TenantId = 1, - UnitOfMeasurement = "Meter" - }, - new - { - Id = 5, - ActivityName = "Tapping", - IsActive = true, - TenantId = 1, - UnitOfMeasurement = "Meter" - }, - new - { - Id = 6, - ActivityName = "Welding", - IsActive = true, - TenantId = 1, - UnitOfMeasurement = "Meter" - }, - new - { - Id = 7, - ActivityName = "Testing", - IsActive = true, - TenantId = 1, - UnitOfMeasurement = "Area" - }, - new - { - Id = 8, - ActivityName = "Painting", - IsActive = true, - TenantId = 1, - UnitOfMeasurement = "Meter" - }, - new - { - Id = 9, - ActivityName = "Marking Area", - IsActive = true, - TenantId = 1, - UnitOfMeasurement = "Meter" - }, - new - { - Id = 10, - ActivityName = "Drilling", - IsActive = true, - TenantId = 1, - UnitOfMeasurement = "Number" - }, - new - { - Id = 11, - ActivityName = "MS Support Fabrication", - IsActive = true, - TenantId = 1, - UnitOfMeasurement = "Number" - }, - new - { - Id = 12, - ActivityName = "MS Support Hanging", - IsActive = true, - TenantId = 1, - UnitOfMeasurement = "Number" - }, - new - { - Id = 13, - ActivityName = "Hydrant Volve", - IsActive = true, - TenantId = 1, - UnitOfMeasurement = "Number" - }, - new - { - Id = 14, - ActivityName = "Sprinkler Installation", - IsActive = true, - TenantId = 1, - UnitOfMeasurement = "Number" - }); - }); - - modelBuilder.Entity("Marco.Pms.Model.Entitlements.ApplicationRole", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("char(36)"); - - b.Property("Description") - .HasColumnType("longtext"); - - b.Property("Role") - .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.CheckListMappings", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - - b.Property("CheckListId") - .HasColumnType("int"); - - b.Property("TaskAllocationId") - .HasColumnType("bigint"); - - b.HasKey("Id"); - - b.ToTable("CheckListMappings"); - }); - - 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") - .HasColumnType("longtext"); - - b.Property("IsActive") - .HasColumnType("tinyint(1)"); - - b.Property("ModuleId") - .HasColumnType("int"); - - b.Property("Name") - .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") - .HasColumnType("longtext"); - - b.Property("FeatureId") - .HasColumnType("char(36)"); - - b.Property("IsEnabled") - .HasColumnType("tinyint(1)"); - - b.Property("Name") - .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") - .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") - .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") - .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") - .HasColumnType("longtext"); - - b.Property("ContactNumber") - .HasColumnType("longtext"); - - b.Property("Description") - .HasColumnType("longtext"); - - b.Property("DomainName") - .HasColumnType("longtext"); - - b.Property("IndustryId") - .HasColumnType("int"); - - b.Property("IsActive") - .HasColumnType("tinyint(1)"); - - b.Property("Name") - .HasColumnType("longtext"); - - b.Property("OnBoardingDate") - .HasColumnType("datetime(6)"); - - b.Property("OragnizationSize") - .HasColumnType("longtext"); - - b.HasKey("Id"); - - b.HasIndex("IndustryId"); - - b.ToTable("Tenants"); - - b.HasData( - new - { - Id = 1, - ContactName = "Admin", - ContactNumber = "123456789", - Description = "", - DomainName = "www.marcobms.org", - IndustryId = 1, - IsActive = true, - Name = "MarcoBMS", - OnBoardingDate = new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified) - }); - }); - - modelBuilder.Entity("Marco.Pms.Model.Forum.TicketAttachment", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("char(36)"); - - b.Property("CommentId") - .HasColumnType("char(36)"); - - b.Property("FileId") - .HasColumnType("char(36)"); - - b.Property("FileName") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("TicketId") - .HasColumnType("char(36)"); - - b.HasKey("Id"); - - b.HasIndex("CommentId"); - - b.HasIndex("TicketId"); - - b.ToTable("TicketAttachments"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Forum.TicketComment", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("char(36)"); - - b.Property("AuthorId") - .HasColumnType("char(36)"); - - b.Property("MessageText") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("ParentMessageId") - .HasColumnType("char(36)"); - - b.Property("SentAt") - .HasColumnType("datetime(6)"); - - b.Property("TenantId") - .HasColumnType("int"); - - b.Property("TicketId") - .HasColumnType("char(36)"); - - b.HasKey("Id"); - - b.HasIndex("TenantId"); - - b.ToTable("TicketComments"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Forum.TicketForum", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("char(36)"); - - b.Property("CreatedAt") - .HasColumnType("datetime(6)"); - - b.Property("CreatedById") - .HasColumnType("int"); - - b.Property("Description") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("LinkedActivityId") - .HasColumnType("int"); - - b.Property("PriorityId") - .HasColumnType("char(36)"); - - b.Property("StatusId") - .HasColumnType("char(36)"); - - b.Property("Subject") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("TenantId") - .HasColumnType("int"); - - b.Property("TypeId") - .HasColumnType("char(36)"); - - b.HasKey("Id"); - - b.HasIndex("PriorityId"); - - b.HasIndex("StatusId"); - - b.HasIndex("TenantId"); - - b.HasIndex("TypeId"); - - b.ToTable("Tickets"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Forum.TicketPriorityMaster", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("char(36)"); - - b.Property("ColorCode") - .HasColumnType("longtext"); - - b.Property("IsDefault") - .HasColumnType("tinyint(1)"); - - b.Property("Level") - .HasColumnType("int"); - - b.Property("Name") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("TenantId") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.ToTable("TicketPriorityMasters"); - - b.HasData( - new - { - Id = new Guid("188d29b3-10f3-42d0-9587-1a46ae7a0320"), - ColorCode = "008000", - IsDefault = true, - Level = 1, - Name = "Low", - TenantId = 1 - }, - new - { - Id = new Guid("0919bc84-9f82-4ecf-98c7-962755dd9a97"), - ColorCode = "FFFF00", - IsDefault = true, - Level = 2, - Name = "Medium", - TenantId = 1 - }, - new - { - Id = new Guid("a13b7e59-16fd-4665-b5cf-a97399e8445a"), - ColorCode = "#FFA500", - IsDefault = true, - Level = 3, - Name = "High", - TenantId = 1 - }, - new - { - Id = new Guid("f340fbc3-c9fd-46aa-b063-0093418830e4"), - ColorCode = "#FFA500", - IsDefault = true, - Level = 4, - Name = "Critical", - TenantId = 1 - }, - new - { - Id = new Guid("44a7b91d-a0dd-45d1-8616-4d2f71e16401"), - ColorCode = "#FF0000", - IsDefault = true, - Level = 5, - Name = "Urgent", - TenantId = 1 - }); - }); - - modelBuilder.Entity("Marco.Pms.Model.Forum.TicketStatusMaster", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("char(36)"); - - b.Property("ColorCode") - .HasColumnType("longtext"); - - b.Property("Description") - .HasColumnType("longtext"); - - b.Property("IsDefault") - .HasColumnType("tinyint(1)"); - - b.Property("Name") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("TenantId") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.ToTable("TicketStatusMasters"); - - b.HasData( - new - { - Id = new Guid("6b0c409b-3e80-4165-8b39-f3fcacb4c797"), - ColorCode = "#FFCC99", - Description = "This is a newly created issue.", - IsDefault = true, - Name = "New", - TenantId = 1 - }, - new - { - Id = new Guid("6c5ac37d-5b7d-40f3-adec-2dabaa5cca86"), - ColorCode = "#E6FF99", - Description = "Assigned to employee or team of employees", - IsDefault = true, - Name = "Assigned", - TenantId = 1 - }, - new - { - Id = new Guid("7f96bcd5-0c66-411b-8a1d-9d1a4785194e"), - ColorCode = "#99E6FF", - Description = "These issues are currently in progress", - IsDefault = true, - Name = "In Progress", - TenantId = 1 - }, - new - { - Id = new Guid("5c72b630-6923-4215-bf2c-b1622afd76e7"), - ColorCode = "#6c757d", - Description = "These issues are currently under review", - IsDefault = true, - Name = "In Review", - TenantId = 1 - }, - new - { - Id = new Guid("8ff85685-a875-4f21-aa95-d99551315fcc"), - ColorCode = "#B399FF", - Description = "The following issues are resolved and closed", - IsDefault = true, - Name = "Done", - TenantId = 1 - }); - }); - - modelBuilder.Entity("Marco.Pms.Model.Forum.TicketTag", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - - b.Property("TagId") - .HasColumnType("char(36)"); - - b.Property("TicketId") - .HasColumnType("char(36)"); - - b.HasKey("Id"); - - b.HasIndex("TagId"); - - b.HasIndex("TicketId"); - - b.ToTable("TicketTags"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Forum.TicketTagMaster", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("char(36)"); - - b.Property("ColorCode") - .HasColumnType("longtext"); - - b.Property("IsDefault") - .HasColumnType("tinyint(1)"); - - b.Property("Name") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("TenantId") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.ToTable("TicketTagMasters"); - - b.HasData( - new - { - Id = new Guid("ef6c2a65-f61d-4537-9650-a7ab7f8d98db"), - ColorCode = "#e59866", - IsDefault = true, - Name = "Quality Issue", - TenantId = 1 - }, - new - { - Id = new Guid("5a168569-8ad7-4422-8db6-51ef25caddeb"), - ColorCode = "#85c1e9", - IsDefault = true, - Name = "Help Desk", - TenantId = 1 - }); - }); - - modelBuilder.Entity("Marco.Pms.Model.Forum.TicketTypeMaster", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("char(36)"); - - b.Property("Description") - .HasColumnType("longtext"); - - b.Property("IsDefault") - .HasColumnType("tinyint(1)"); - - b.Property("Name") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("TenantId") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.ToTable("TicketTypeMasters"); - - b.HasData( - new - { - Id = new Guid("c74e5480-2b71-483c-8f4a-1a9c69c32603"), - Description = "An identified problem that affects the performance, reliability, or standards of a product or service", - IsDefault = true, - Name = "Quality Issue", - TenantId = 1 - }, - new - { - Id = new Guid("d1f55eab-9898-4e46-9f03-b263e33e5d38"), - Description = "A support service that assists users with technical issues, requests, or inquiries.", - IsDefault = true, - Name = "Help Desk", - TenantId = 1 - }); - }); - - modelBuilder.Entity("Marco.Pms.Model.Industries.Industry", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - - b.Property("Name") - .HasColumnType("longtext"); - - b.HasKey("Id"); - - b.ToTable("Industries"); - - b.HasData( - new - { - Id = 1, - Name = "Information Technology (IT) Services" - }, - new - { - Id = 2, - Name = "Manufacturing & Production" - }, - new - { - Id = 3, - Name = "Energy & Resources" - }, - new - { - Id = 4, - Name = "Finance & Professional Services" - }, - new - { - Id = 5, - Name = "Hospitals and Healthcare Services" - }, - new - { - Id = 6, - Name = "Social Services" - }, - new - { - Id = 7, - Name = "Retail & Consumer Services" - }, - new - { - Id = 8, - Name = "Transportation & Logistics" - }, - new - { - Id = 9, - Name = "Education & Training" - }); - }); - - 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") - .HasColumnType("longtext"); - - b.Property("EndDate") - .HasColumnType("datetime(6)"); - - b.Property("Name") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("ProjectAddress") - .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("Marco.Pms.Model.Projects.WorkItem", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - - b.Property("ActivityId") - .HasColumnType("int"); - - b.Property("CompletedWork") - .HasColumnType("double"); - - b.Property("PlannedWork") - .HasColumnType("double"); - - 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.Utilities.Inquiries", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - - b.Property("About") - .HasColumnType("longtext"); - - b.Property("ContactNumber") - .HasColumnType("longtext"); - - b.Property("ContactPerson") - .HasColumnType("longtext"); - - b.Property("Email") - .HasColumnType("longtext"); - - b.Property("IndustryId") - .HasColumnType("int"); - - b.Property("OragnizationSize") - .HasColumnType("longtext"); - - b.Property("OrganizatioinName") - .HasColumnType("longtext"); - - b.HasKey("Id"); - - b.ToTable("Inquiries"); - }); - - 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("IsActive") - .HasColumnType("tinyint(1)"); - - b.Property("IsRootUser") - .HasColumnType("tinyint(1)"); - - b.Property("TenantId") - .HasColumnType("int"); - - b.HasDiscriminator().HasValue("ApplicationUser"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Activities.TaskAllocation", b => - { - b.HasOne("Marco.Pms.Model.Employees.Employee", "Employee") - .WithMany() - .HasForeignKey("AssignedBy") - .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.WorkItem", "WorkItem") - .WithMany() - .HasForeignKey("WorkItemId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Employee"); - - b.Navigation("Tenant"); - - b.Navigation("WorkItem"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Activities.TaskComment", b => - { - b.HasOne("Marco.Pms.Model.Employees.Employee", "Employee") - .WithMany() - .HasForeignKey("CommentedBy") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Marco.Pms.Model.Activities.TaskAllocation", "TaskAllocation") - .WithMany() - .HasForeignKey("TaskAllocationId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Marco.Pms.Model.Entitlements.Tenant", "Tenant") - .WithMany() - .HasForeignKey("TenantId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Employee"); - - b.Navigation("TaskAllocation"); - - b.Navigation("Tenant"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Activities.TaskMembers", b => - { - b.HasOne("Marco.Pms.Model.Employees.Employee", "Employee") - .WithMany() - .HasForeignKey("EmployeeId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Marco.Pms.Model.Activities.TaskAllocation", "TaskAllocation") - .WithMany() - .HasForeignKey("TaskAllocationId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Marco.Pms.Model.Entitlements.Tenant", "Tenant") - .WithMany() - .HasForeignKey("TenantId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Employee"); - - b.Navigation("TaskAllocation"); - - 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); - - b.Navigation("User"); - }); - - modelBuilder.Entity("Marco.Pms.Model.DocumentManager.Document", b => - { - b.HasOne("Marco.Pms.Model.Entitlements.Tenant", "Tenant") - .WithMany() - .HasForeignKey("TenantId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - 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.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.Entitlements.Tenant", b => - { - b.HasOne("Marco.Pms.Model.Industries.Industry", "Industry") - .WithMany() - .HasForeignKey("IndustryId"); - - b.Navigation("Industry"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Forum.TicketAttachment", b => - { - b.HasOne("Marco.Pms.Model.Forum.TicketComment", "TicketComment") - .WithMany("Attachments") - .HasForeignKey("CommentId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Marco.Pms.Model.Forum.TicketForum", "Ticket") - .WithMany() - .HasForeignKey("TicketId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Ticket"); - - b.Navigation("TicketComment"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Forum.TicketComment", b => - { - b.HasOne("Marco.Pms.Model.Entitlements.Tenant", "Tenant") - .WithMany() - .HasForeignKey("TenantId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Tenant"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Forum.TicketForum", b => - { - b.HasOne("Marco.Pms.Model.Forum.TicketPriorityMaster", "Priority") - .WithMany() - .HasForeignKey("PriorityId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Marco.Pms.Model.Forum.TicketStatusMaster", "TicketStatusMaster") - .WithMany() - .HasForeignKey("StatusId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Marco.Pms.Model.Entitlements.Tenant", "Tenant") - .WithMany() - .HasForeignKey("TenantId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Marco.Pms.Model.Forum.TicketTypeMaster", "TicketTypeMaster") - .WithMany() - .HasForeignKey("TypeId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Priority"); - - b.Navigation("Tenant"); - - b.Navigation("TicketStatusMaster"); - - b.Navigation("TicketTypeMaster"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Forum.TicketTag", b => - { - b.HasOne("Marco.Pms.Model.Forum.TicketTagMaster", "Tag") - .WithMany() - .HasForeignKey("TagId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Marco.Pms.Model.Forum.TicketForum", "Ticket") - .WithMany() - .HasForeignKey("TicketId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Tag"); - - b.Navigation("Ticket"); - }); - - 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("Marco.Pms.Model.Projects.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("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.Entitlements.Feature", b => - { - b.Navigation("FeaturePermissions"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Forum.TicketComment", b => - { - b.Navigation("Attachments"); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/Marco.Pms.DataAccess/Migrations/20250423090827_Added_Forum_Tables.cs b/Marco.Pms.DataAccess/Migrations/20250423090827_Added_Forum_Tables.cs deleted file mode 100644 index 69b04a8..0000000 --- a/Marco.Pms.DataAccess/Migrations/20250423090827_Added_Forum_Tables.cs +++ /dev/null @@ -1,376 +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 Added_Forum_Tables : Migration - { - /// - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.CreateTable( - name: "Documents", - columns: table => new - { - Id = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), - BatchId = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), - FileName = table.Column(type: "longtext", nullable: false) - .Annotation("MySql:CharSet", "utf8mb4"), - S3Key = table.Column(type: "longtext", nullable: false) - .Annotation("MySql:CharSet", "utf8mb4"), - ThumbS3Key = table.Column(type: "longtext", nullable: true) - .Annotation("MySql:CharSet", "utf8mb4"), - Base64Data = table.Column(type: "longtext", nullable: true) - .Annotation("MySql:CharSet", "utf8mb4"), - FileSize = table.Column(type: "bigint", nullable: false), - ContentType = table.Column(type: "longtext", nullable: false) - .Annotation("MySql:CharSet", "utf8mb4"), - UploadedAt = table.Column(type: "datetime(6)", nullable: false), - TenantId = table.Column(type: "int", nullable: false) - }, - constraints: table => - { - table.PrimaryKey("PK_Documents", x => x.Id); - table.ForeignKey( - name: "FK_Documents_Tenants_TenantId", - column: x => x.TenantId, - principalTable: "Tenants", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); - }) - .Annotation("MySql:CharSet", "utf8mb4"); - - migrationBuilder.CreateTable( - name: "TicketComments", - columns: table => new - { - Id = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), - TicketId = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), - AuthorId = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), - MessageText = table.Column(type: "longtext", nullable: false) - .Annotation("MySql:CharSet", "utf8mb4"), - SentAt = table.Column(type: "datetime(6)", nullable: false), - ParentMessageId = table.Column(type: "char(36)", nullable: true, collation: "ascii_general_ci"), - TenantId = table.Column(type: "int", nullable: false) - }, - constraints: table => - { - table.PrimaryKey("PK_TicketComments", x => x.Id); - table.ForeignKey( - name: "FK_TicketComments_Tenants_TenantId", - column: x => x.TenantId, - principalTable: "Tenants", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); - }) - .Annotation("MySql:CharSet", "utf8mb4"); - - migrationBuilder.CreateTable( - name: "TicketPriorityMasters", - columns: table => new - { - Id = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), - Name = table.Column(type: "longtext", nullable: false) - .Annotation("MySql:CharSet", "utf8mb4"), - Level = table.Column(type: "int", nullable: false), - ColorCode = table.Column(type: "longtext", nullable: true) - .Annotation("MySql:CharSet", "utf8mb4"), - IsDefault = table.Column(type: "tinyint(1)", nullable: false), - TenantId = table.Column(type: "int", nullable: false) - }, - constraints: table => - { - table.PrimaryKey("PK_TicketPriorityMasters", x => x.Id); - }) - .Annotation("MySql:CharSet", "utf8mb4"); - - migrationBuilder.CreateTable( - name: "TicketStatusMasters", - columns: table => new - { - Id = 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: true) - .Annotation("MySql:CharSet", "utf8mb4"), - ColorCode = table.Column(type: "longtext", nullable: true) - .Annotation("MySql:CharSet", "utf8mb4"), - IsDefault = table.Column(type: "tinyint(1)", nullable: false), - TenantId = table.Column(type: "int", nullable: false) - }, - constraints: table => - { - table.PrimaryKey("PK_TicketStatusMasters", x => x.Id); - }) - .Annotation("MySql:CharSet", "utf8mb4"); - - migrationBuilder.CreateTable( - name: "TicketTagMasters", - columns: table => new - { - Id = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), - Name = table.Column(type: "longtext", nullable: false) - .Annotation("MySql:CharSet", "utf8mb4"), - ColorCode = table.Column(type: "longtext", nullable: true) - .Annotation("MySql:CharSet", "utf8mb4"), - TenantId = table.Column(type: "int", nullable: false), - IsDefault = table.Column(type: "tinyint(1)", nullable: false) - }, - constraints: table => - { - table.PrimaryKey("PK_TicketTagMasters", x => x.Id); - }) - .Annotation("MySql:CharSet", "utf8mb4"); - - migrationBuilder.CreateTable( - name: "TicketTypeMasters", - columns: table => new - { - Id = 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: true) - .Annotation("MySql:CharSet", "utf8mb4"), - IsDefault = table.Column(type: "tinyint(1)", nullable: false), - TenantId = table.Column(type: "int", nullable: false) - }, - constraints: table => - { - table.PrimaryKey("PK_TicketTypeMasters", x => x.Id); - }) - .Annotation("MySql:CharSet", "utf8mb4"); - - migrationBuilder.CreateTable( - name: "Tickets", - columns: table => new - { - Id = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), - Subject = table.Column(type: "longtext", nullable: false) - .Annotation("MySql:CharSet", "utf8mb4"), - Description = table.Column(type: "longtext", nullable: false) - .Annotation("MySql:CharSet", "utf8mb4"), - StatusId = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), - TypeId = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), - CreatedById = table.Column(type: "int", nullable: false), - CreatedAt = table.Column(type: "datetime(6)", nullable: false), - LinkedActivityId = table.Column(type: "int", nullable: false), - PriorityId = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), - TenantId = table.Column(type: "int", nullable: false) - }, - constraints: table => - { - table.PrimaryKey("PK_Tickets", x => x.Id); - table.ForeignKey( - name: "FK_Tickets_Tenants_TenantId", - column: x => x.TenantId, - principalTable: "Tenants", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); - table.ForeignKey( - name: "FK_Tickets_TicketPriorityMasters_PriorityId", - column: x => x.PriorityId, - principalTable: "TicketPriorityMasters", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); - table.ForeignKey( - name: "FK_Tickets_TicketStatusMasters_StatusId", - column: x => x.StatusId, - principalTable: "TicketStatusMasters", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); - table.ForeignKey( - name: "FK_Tickets_TicketTypeMasters_TypeId", - column: x => x.TypeId, - principalTable: "TicketTypeMasters", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); - }) - .Annotation("MySql:CharSet", "utf8mb4"); - - migrationBuilder.CreateTable( - name: "TicketAttachments", - columns: table => new - { - Id = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), - TicketId = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), - CommentId = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), - FileName = table.Column(type: "longtext", nullable: false) - .Annotation("MySql:CharSet", "utf8mb4"), - FileId = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci") - }, - constraints: table => - { - table.PrimaryKey("PK_TicketAttachments", x => x.Id); - table.ForeignKey( - name: "FK_TicketAttachments_TicketComments_CommentId", - column: x => x.CommentId, - principalTable: "TicketComments", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); - table.ForeignKey( - name: "FK_TicketAttachments_Tickets_TicketId", - column: x => x.TicketId, - principalTable: "Tickets", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); - }) - .Annotation("MySql:CharSet", "utf8mb4"); - - migrationBuilder.CreateTable( - name: "TicketTags", - columns: table => new - { - Id = table.Column(type: "int", nullable: false) - .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), - TicketId = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), - TagId = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci") - }, - constraints: table => - { - table.PrimaryKey("PK_TicketTags", x => x.Id); - table.ForeignKey( - name: "FK_TicketTags_TicketTagMasters_TagId", - column: x => x.TagId, - principalTable: "TicketTagMasters", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); - table.ForeignKey( - name: "FK_TicketTags_Tickets_TicketId", - column: x => x.TicketId, - principalTable: "Tickets", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); - }) - .Annotation("MySql:CharSet", "utf8mb4"); - - migrationBuilder.InsertData( - table: "TicketPriorityMasters", - columns: new[] { "Id", "ColorCode", "IsDefault", "Level", "Name", "TenantId" }, - values: new object[,] - { - { new Guid("0919bc84-9f82-4ecf-98c7-962755dd9a97"), "FFFF00", true, 2, "Medium", 1 }, - { new Guid("188d29b3-10f3-42d0-9587-1a46ae7a0320"), "008000", true, 1, "Low", 1 }, - { new Guid("44a7b91d-a0dd-45d1-8616-4d2f71e16401"), "#FF0000", true, 5, "Urgent", 1 }, - { new Guid("a13b7e59-16fd-4665-b5cf-a97399e8445a"), "#FFA500", true, 3, "High", 1 }, - { new Guid("f340fbc3-c9fd-46aa-b063-0093418830e4"), "#FFA500", true, 4, "Critical", 1 } - }); - - migrationBuilder.InsertData( - table: "TicketStatusMasters", - columns: new[] { "Id", "ColorCode", "Description", "IsDefault", "Name", "TenantId" }, - values: new object[,] - { - { new Guid("5c72b630-6923-4215-bf2c-b1622afd76e7"), "#6c757d", "These issues are currently under review", true, "In Review", 1 }, - { new Guid("6b0c409b-3e80-4165-8b39-f3fcacb4c797"), "#FFCC99", "This is a newly created issue.", true, "New", 1 }, - { new Guid("6c5ac37d-5b7d-40f3-adec-2dabaa5cca86"), "#E6FF99", "Assigned to employee or team of employees", true, "Assigned", 1 }, - { new Guid("7f96bcd5-0c66-411b-8a1d-9d1a4785194e"), "#99E6FF", "These issues are currently in progress", true, "In Progress", 1 }, - { new Guid("8ff85685-a875-4f21-aa95-d99551315fcc"), "#B399FF", "The following issues are resolved and closed", true, "Done", 1 } - }); - - migrationBuilder.InsertData( - table: "TicketTagMasters", - columns: new[] { "Id", "ColorCode", "IsDefault", "Name", "TenantId" }, - values: new object[,] - { - { new Guid("5a168569-8ad7-4422-8db6-51ef25caddeb"), "#85c1e9", true, "Help Desk", 1 }, - { new Guid("ef6c2a65-f61d-4537-9650-a7ab7f8d98db"), "#e59866", true, "Quality Issue", 1 } - }); - - migrationBuilder.InsertData( - table: "TicketTypeMasters", - columns: new[] { "Id", "Description", "IsDefault", "Name", "TenantId" }, - values: new object[,] - { - { new Guid("c74e5480-2b71-483c-8f4a-1a9c69c32603"), "An identified problem that affects the performance, reliability, or standards of a product or service", true, "Quality Issue", 1 }, - { new Guid("d1f55eab-9898-4e46-9f03-b263e33e5d38"), "A support service that assists users with technical issues, requests, or inquiries.", true, "Help Desk", 1 } - }); - - migrationBuilder.CreateIndex( - name: "IX_Documents_TenantId", - table: "Documents", - column: "TenantId"); - - migrationBuilder.CreateIndex( - name: "IX_TicketAttachments_CommentId", - table: "TicketAttachments", - column: "CommentId"); - - migrationBuilder.CreateIndex( - name: "IX_TicketAttachments_TicketId", - table: "TicketAttachments", - column: "TicketId"); - - migrationBuilder.CreateIndex( - name: "IX_TicketComments_TenantId", - table: "TicketComments", - column: "TenantId"); - - migrationBuilder.CreateIndex( - name: "IX_Tickets_PriorityId", - table: "Tickets", - column: "PriorityId"); - - migrationBuilder.CreateIndex( - name: "IX_Tickets_StatusId", - table: "Tickets", - column: "StatusId"); - - migrationBuilder.CreateIndex( - name: "IX_Tickets_TenantId", - table: "Tickets", - column: "TenantId"); - - migrationBuilder.CreateIndex( - name: "IX_Tickets_TypeId", - table: "Tickets", - column: "TypeId"); - - migrationBuilder.CreateIndex( - name: "IX_TicketTags_TagId", - table: "TicketTags", - column: "TagId"); - - migrationBuilder.CreateIndex( - name: "IX_TicketTags_TicketId", - table: "TicketTags", - column: "TicketId"); - } - - /// - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropTable( - name: "Documents"); - - migrationBuilder.DropTable( - name: "TicketAttachments"); - - migrationBuilder.DropTable( - name: "TicketTags"); - - migrationBuilder.DropTable( - name: "TicketComments"); - - migrationBuilder.DropTable( - name: "TicketTagMasters"); - - migrationBuilder.DropTable( - name: "Tickets"); - - migrationBuilder.DropTable( - name: "TicketPriorityMasters"); - - migrationBuilder.DropTable( - name: "TicketStatusMasters"); - - migrationBuilder.DropTable( - name: "TicketTypeMasters"); - } - } -} diff --git a/Marco.Pms.DataAccess/Migrations/20250423091727_Added_Foreign_Key_In_Attendance_Log.Designer.cs b/Marco.Pms.DataAccess/Migrations/20250423091727_Added_Foreign_Key_In_Attendance_Log.Designer.cs deleted file mode 100644 index 87b92e2..0000000 --- a/Marco.Pms.DataAccess/Migrations/20250423091727_Added_Foreign_Key_In_Attendance_Log.Designer.cs +++ /dev/null @@ -1,2643 +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("20250423091727_Added_Foreign_Key_In_Attendance_Log")] - partial class Added_Foreign_Key_In_Attendance_Log - { - /// - 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("bigint"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - - b.Property("AssignedBy") - .HasColumnType("int"); - - b.Property("AssignmentDate") - .HasColumnType("datetime(6)"); - - b.Property("CompletedTask") - .HasColumnType("double"); - - b.Property("Description") - .HasColumnType("longtext"); - - b.Property("PlannedTask") - .HasColumnType("double"); - - b.Property("ReportedDate") - .HasColumnType("datetime(6)"); - - b.Property("TenantId") - .HasColumnType("int"); - - b.Property("WorkItemId") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("AssignedBy"); - - b.HasIndex("TenantId"); - - b.HasIndex("WorkItemId"); - - b.ToTable("TaskAllocations"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Activities.TaskComment", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - - b.Property("Comment") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("CommentDate") - .HasColumnType("datetime(6)"); - - b.Property("CommentedBy") - .HasColumnType("int"); - - b.Property("TaskAllocationId") - .HasColumnType("bigint"); - - b.Property("TenantId") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("CommentedBy"); - - b.HasIndex("TaskAllocationId"); - - b.HasIndex("TenantId"); - - b.ToTable("TaskComments"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Activities.TaskMembers", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - - b.Property("EmployeeId") - .HasColumnType("int"); - - b.Property("TaskAllocationId") - .HasColumnType("bigint"); - - b.Property("TenantId") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("EmployeeId"); - - b.HasIndex("TaskAllocationId"); - - b.HasIndex("TenantId"); - - b.ToTable("TaskMembers"); - }); - - 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("DocumentId") - .HasColumnType("char(36)"); - - 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("DocumentId"); - - 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") - .HasColumnType("longtext"); - - b.Property("UserId") - .HasColumnType("varchar(255)"); - - b.HasKey("Id"); - - b.HasIndex("UserId"); - - b.ToTable("RefreshTokens"); - }); - - modelBuilder.Entity("Marco.Pms.Model.DocumentManager.Document", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("char(36)"); - - b.Property("Base64Data") - .HasColumnType("longtext"); - - b.Property("BatchId") - .HasColumnType("char(36)"); - - b.Property("ContentType") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("FileName") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("FileSize") - .HasColumnType("bigint"); - - b.Property("S3Key") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("TenantId") - .HasColumnType("int"); - - b.Property("ThumbS3Key") - .HasColumnType("longtext"); - - b.Property("UploadedAt") - .HasColumnType("datetime(6)"); - - b.HasKey("Id"); - - b.HasIndex("TenantId"); - - b.ToTable("Documents"); - }); - - 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") - .HasColumnType("longtext"); - - b.Property("Email") - .HasColumnType("longtext"); - - b.Property("EmergencyContactPerson") - .HasColumnType("longtext"); - - b.Property("EmergencyPhoneNumber") - .HasColumnType("longtext"); - - b.Property("FirstName") - .HasColumnType("longtext"); - - b.Property("Gender") - .HasColumnType("longtext"); - - b.Property("IsActive") - .HasColumnType("tinyint(1)"); - - b.Property("JobRoleId") - .HasColumnType("int"); - - b.Property("JoiningDate") - .HasColumnType("datetime(6)"); - - b.Property("LastName") - .HasColumnType("longtext"); - - b.Property("MiddleName") - .HasColumnType("longtext"); - - b.Property("PanNumber") - .HasColumnType("longtext"); - - b.Property("PermanentAddress") - .HasColumnType("longtext"); - - b.Property("PhoneNumber") - .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") - .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.ActivityCheckList", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - - b.Property("ActivityId") - .HasColumnType("int"); - - b.Property("Description") - .HasColumnType("longtext"); - - b.Property("IsChecked") - .HasColumnType("tinyint(1)"); - - b.Property("IsMandatory") - .HasColumnType("tinyint(1)"); - - b.Property("TenantId") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.ToTable("ActivityCheckLists"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Entitlements.ActivityMaster", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - - b.Property("ActivityName") - .HasColumnType("longtext"); - - b.Property("IsActive") - .HasColumnType("tinyint(1)"); - - b.Property("TenantId") - .HasColumnType("int"); - - b.Property("UnitOfMeasurement") - .HasColumnType("longtext"); - - b.HasKey("Id"); - - b.HasIndex("TenantId"); - - b.ToTable("ActivityMasters"); - - b.HasData( - new - { - Id = 1, - ActivityName = "Core Cutting", - IsActive = true, - TenantId = 1, - UnitOfMeasurement = "Number" - }, - new - { - Id = 2, - ActivityName = "Fabrication", - IsActive = true, - TenantId = 1, - UnitOfMeasurement = "Meter" - }, - new - { - Id = 3, - ActivityName = "Lifting", - IsActive = true, - TenantId = 1, - UnitOfMeasurement = "Meter" - }, - new - { - Id = 4, - ActivityName = "Hanging", - IsActive = true, - TenantId = 1, - UnitOfMeasurement = "Meter" - }, - new - { - Id = 5, - ActivityName = "Tapping", - IsActive = true, - TenantId = 1, - UnitOfMeasurement = "Meter" - }, - new - { - Id = 6, - ActivityName = "Welding", - IsActive = true, - TenantId = 1, - UnitOfMeasurement = "Meter" - }, - new - { - Id = 7, - ActivityName = "Testing", - IsActive = true, - TenantId = 1, - UnitOfMeasurement = "Area" - }, - new - { - Id = 8, - ActivityName = "Painting", - IsActive = true, - TenantId = 1, - UnitOfMeasurement = "Meter" - }, - new - { - Id = 9, - ActivityName = "Marking Area", - IsActive = true, - TenantId = 1, - UnitOfMeasurement = "Meter" - }, - new - { - Id = 10, - ActivityName = "Drilling", - IsActive = true, - TenantId = 1, - UnitOfMeasurement = "Number" - }, - new - { - Id = 11, - ActivityName = "MS Support Fabrication", - IsActive = true, - TenantId = 1, - UnitOfMeasurement = "Number" - }, - new - { - Id = 12, - ActivityName = "MS Support Hanging", - IsActive = true, - TenantId = 1, - UnitOfMeasurement = "Number" - }, - new - { - Id = 13, - ActivityName = "Hydrant Volve", - IsActive = true, - TenantId = 1, - UnitOfMeasurement = "Number" - }, - new - { - Id = 14, - ActivityName = "Sprinkler Installation", - IsActive = true, - TenantId = 1, - UnitOfMeasurement = "Number" - }); - }); - - modelBuilder.Entity("Marco.Pms.Model.Entitlements.ApplicationRole", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("char(36)"); - - b.Property("Description") - .HasColumnType("longtext"); - - b.Property("Role") - .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.CheckListMappings", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - - b.Property("CheckListId") - .HasColumnType("int"); - - b.Property("TaskAllocationId") - .HasColumnType("bigint"); - - b.HasKey("Id"); - - b.ToTable("CheckListMappings"); - }); - - 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") - .HasColumnType("longtext"); - - b.Property("IsActive") - .HasColumnType("tinyint(1)"); - - b.Property("ModuleId") - .HasColumnType("int"); - - b.Property("Name") - .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") - .HasColumnType("longtext"); - - b.Property("FeatureId") - .HasColumnType("char(36)"); - - b.Property("IsEnabled") - .HasColumnType("tinyint(1)"); - - b.Property("Name") - .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") - .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") - .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") - .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") - .HasColumnType("longtext"); - - b.Property("ContactNumber") - .HasColumnType("longtext"); - - b.Property("Description") - .HasColumnType("longtext"); - - b.Property("DomainName") - .HasColumnType("longtext"); - - b.Property("IndustryId") - .HasColumnType("int"); - - b.Property("IsActive") - .HasColumnType("tinyint(1)"); - - b.Property("Name") - .HasColumnType("longtext"); - - b.Property("OnBoardingDate") - .HasColumnType("datetime(6)"); - - b.Property("OragnizationSize") - .HasColumnType("longtext"); - - b.HasKey("Id"); - - b.HasIndex("IndustryId"); - - b.ToTable("Tenants"); - - b.HasData( - new - { - Id = 1, - ContactName = "Admin", - ContactNumber = "123456789", - Description = "", - DomainName = "www.marcobms.org", - IndustryId = 1, - IsActive = true, - Name = "MarcoBMS", - OnBoardingDate = new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified) - }); - }); - - modelBuilder.Entity("Marco.Pms.Model.Forum.TicketAttachment", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("char(36)"); - - b.Property("CommentId") - .HasColumnType("char(36)"); - - b.Property("FileId") - .HasColumnType("char(36)"); - - b.Property("FileName") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("TicketId") - .HasColumnType("char(36)"); - - b.HasKey("Id"); - - b.HasIndex("CommentId"); - - b.HasIndex("TicketId"); - - b.ToTable("TicketAttachments"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Forum.TicketComment", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("char(36)"); - - b.Property("AuthorId") - .HasColumnType("char(36)"); - - b.Property("MessageText") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("ParentMessageId") - .HasColumnType("char(36)"); - - b.Property("SentAt") - .HasColumnType("datetime(6)"); - - b.Property("TenantId") - .HasColumnType("int"); - - b.Property("TicketId") - .HasColumnType("char(36)"); - - b.HasKey("Id"); - - b.HasIndex("TenantId"); - - b.ToTable("TicketComments"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Forum.TicketForum", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("char(36)"); - - b.Property("CreatedAt") - .HasColumnType("datetime(6)"); - - b.Property("CreatedById") - .HasColumnType("int"); - - b.Property("Description") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("LinkedActivityId") - .HasColumnType("int"); - - b.Property("PriorityId") - .HasColumnType("char(36)"); - - b.Property("StatusId") - .HasColumnType("char(36)"); - - b.Property("Subject") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("TenantId") - .HasColumnType("int"); - - b.Property("TypeId") - .HasColumnType("char(36)"); - - b.HasKey("Id"); - - b.HasIndex("PriorityId"); - - b.HasIndex("StatusId"); - - b.HasIndex("TenantId"); - - b.HasIndex("TypeId"); - - b.ToTable("Tickets"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Forum.TicketPriorityMaster", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("char(36)"); - - b.Property("ColorCode") - .HasColumnType("longtext"); - - b.Property("IsDefault") - .HasColumnType("tinyint(1)"); - - b.Property("Level") - .HasColumnType("int"); - - b.Property("Name") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("TenantId") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.ToTable("TicketPriorityMasters"); - - b.HasData( - new - { - Id = new Guid("188d29b3-10f3-42d0-9587-1a46ae7a0320"), - ColorCode = "008000", - IsDefault = true, - Level = 1, - Name = "Low", - TenantId = 1 - }, - new - { - Id = new Guid("0919bc84-9f82-4ecf-98c7-962755dd9a97"), - ColorCode = "FFFF00", - IsDefault = true, - Level = 2, - Name = "Medium", - TenantId = 1 - }, - new - { - Id = new Guid("a13b7e59-16fd-4665-b5cf-a97399e8445a"), - ColorCode = "#FFA500", - IsDefault = true, - Level = 3, - Name = "High", - TenantId = 1 - }, - new - { - Id = new Guid("f340fbc3-c9fd-46aa-b063-0093418830e4"), - ColorCode = "#FFA500", - IsDefault = true, - Level = 4, - Name = "Critical", - TenantId = 1 - }, - new - { - Id = new Guid("44a7b91d-a0dd-45d1-8616-4d2f71e16401"), - ColorCode = "#FF0000", - IsDefault = true, - Level = 5, - Name = "Urgent", - TenantId = 1 - }); - }); - - modelBuilder.Entity("Marco.Pms.Model.Forum.TicketStatusMaster", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("char(36)"); - - b.Property("ColorCode") - .HasColumnType("longtext"); - - b.Property("Description") - .HasColumnType("longtext"); - - b.Property("IsDefault") - .HasColumnType("tinyint(1)"); - - b.Property("Name") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("TenantId") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.ToTable("TicketStatusMasters"); - - b.HasData( - new - { - Id = new Guid("6b0c409b-3e80-4165-8b39-f3fcacb4c797"), - ColorCode = "#FFCC99", - Description = "This is a newly created issue.", - IsDefault = true, - Name = "New", - TenantId = 1 - }, - new - { - Id = new Guid("6c5ac37d-5b7d-40f3-adec-2dabaa5cca86"), - ColorCode = "#E6FF99", - Description = "Assigned to employee or team of employees", - IsDefault = true, - Name = "Assigned", - TenantId = 1 - }, - new - { - Id = new Guid("7f96bcd5-0c66-411b-8a1d-9d1a4785194e"), - ColorCode = "#99E6FF", - Description = "These issues are currently in progress", - IsDefault = true, - Name = "In Progress", - TenantId = 1 - }, - new - { - Id = new Guid("5c72b630-6923-4215-bf2c-b1622afd76e7"), - ColorCode = "#6c757d", - Description = "These issues are currently under review", - IsDefault = true, - Name = "In Review", - TenantId = 1 - }, - new - { - Id = new Guid("8ff85685-a875-4f21-aa95-d99551315fcc"), - ColorCode = "#B399FF", - Description = "The following issues are resolved and closed", - IsDefault = true, - Name = "Done", - TenantId = 1 - }); - }); - - modelBuilder.Entity("Marco.Pms.Model.Forum.TicketTag", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - - b.Property("TagId") - .HasColumnType("char(36)"); - - b.Property("TicketId") - .HasColumnType("char(36)"); - - b.HasKey("Id"); - - b.HasIndex("TagId"); - - b.HasIndex("TicketId"); - - b.ToTable("TicketTags"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Forum.TicketTagMaster", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("char(36)"); - - b.Property("ColorCode") - .HasColumnType("longtext"); - - b.Property("IsDefault") - .HasColumnType("tinyint(1)"); - - b.Property("Name") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("TenantId") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.ToTable("TicketTagMasters"); - - b.HasData( - new - { - Id = new Guid("ef6c2a65-f61d-4537-9650-a7ab7f8d98db"), - ColorCode = "#e59866", - IsDefault = true, - Name = "Quality Issue", - TenantId = 1 - }, - new - { - Id = new Guid("5a168569-8ad7-4422-8db6-51ef25caddeb"), - ColorCode = "#85c1e9", - IsDefault = true, - Name = "Help Desk", - TenantId = 1 - }); - }); - - modelBuilder.Entity("Marco.Pms.Model.Forum.TicketTypeMaster", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("char(36)"); - - b.Property("Description") - .HasColumnType("longtext"); - - b.Property("IsDefault") - .HasColumnType("tinyint(1)"); - - b.Property("Name") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("TenantId") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.ToTable("TicketTypeMasters"); - - b.HasData( - new - { - Id = new Guid("c74e5480-2b71-483c-8f4a-1a9c69c32603"), - Description = "An identified problem that affects the performance, reliability, or standards of a product or service", - IsDefault = true, - Name = "Quality Issue", - TenantId = 1 - }, - new - { - Id = new Guid("d1f55eab-9898-4e46-9f03-b263e33e5d38"), - Description = "A support service that assists users with technical issues, requests, or inquiries.", - IsDefault = true, - Name = "Help Desk", - TenantId = 1 - }); - }); - - modelBuilder.Entity("Marco.Pms.Model.Industries.Industry", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - - b.Property("Name") - .HasColumnType("longtext"); - - b.HasKey("Id"); - - b.ToTable("Industries"); - - b.HasData( - new - { - Id = 1, - Name = "Information Technology (IT) Services" - }, - new - { - Id = 2, - Name = "Manufacturing & Production" - }, - new - { - Id = 3, - Name = "Energy & Resources" - }, - new - { - Id = 4, - Name = "Finance & Professional Services" - }, - new - { - Id = 5, - Name = "Hospitals and Healthcare Services" - }, - new - { - Id = 6, - Name = "Social Services" - }, - new - { - Id = 7, - Name = "Retail & Consumer Services" - }, - new - { - Id = 8, - Name = "Transportation & Logistics" - }, - new - { - Id = 9, - Name = "Education & Training" - }); - }); - - 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") - .HasColumnType("longtext"); - - b.Property("EndDate") - .HasColumnType("datetime(6)"); - - b.Property("Name") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("ProjectAddress") - .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("Marco.Pms.Model.Projects.WorkItem", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - - b.Property("ActivityId") - .HasColumnType("int"); - - b.Property("CompletedWork") - .HasColumnType("double"); - - b.Property("PlannedWork") - .HasColumnType("double"); - - 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.Utilities.Inquiries", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - - b.Property("About") - .HasColumnType("longtext"); - - b.Property("ContactNumber") - .HasColumnType("longtext"); - - b.Property("ContactPerson") - .HasColumnType("longtext"); - - b.Property("Email") - .HasColumnType("longtext"); - - b.Property("IndustryId") - .HasColumnType("int"); - - b.Property("OragnizationSize") - .HasColumnType("longtext"); - - b.Property("OrganizatioinName") - .HasColumnType("longtext"); - - b.HasKey("Id"); - - b.ToTable("Inquiries"); - }); - - 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("IsActive") - .HasColumnType("tinyint(1)"); - - b.Property("IsRootUser") - .HasColumnType("tinyint(1)"); - - b.Property("TenantId") - .HasColumnType("int"); - - b.HasDiscriminator().HasValue("ApplicationUser"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Activities.TaskAllocation", b => - { - b.HasOne("Marco.Pms.Model.Employees.Employee", "Employee") - .WithMany() - .HasForeignKey("AssignedBy") - .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.WorkItem", "WorkItem") - .WithMany() - .HasForeignKey("WorkItemId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Employee"); - - b.Navigation("Tenant"); - - b.Navigation("WorkItem"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Activities.TaskComment", b => - { - b.HasOne("Marco.Pms.Model.Employees.Employee", "Employee") - .WithMany() - .HasForeignKey("CommentedBy") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Marco.Pms.Model.Activities.TaskAllocation", "TaskAllocation") - .WithMany() - .HasForeignKey("TaskAllocationId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Marco.Pms.Model.Entitlements.Tenant", "Tenant") - .WithMany() - .HasForeignKey("TenantId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Employee"); - - b.Navigation("TaskAllocation"); - - b.Navigation("Tenant"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Activities.TaskMembers", b => - { - b.HasOne("Marco.Pms.Model.Employees.Employee", "Employee") - .WithMany() - .HasForeignKey("EmployeeId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Marco.Pms.Model.Activities.TaskAllocation", "TaskAllocation") - .WithMany() - .HasForeignKey("TaskAllocationId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Marco.Pms.Model.Entitlements.Tenant", "Tenant") - .WithMany() - .HasForeignKey("TenantId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Employee"); - - b.Navigation("TaskAllocation"); - - 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.DocumentManager.Document", "Document") - .WithMany() - .HasForeignKey("DocumentId"); - - 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("Document"); - - 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); - - b.Navigation("User"); - }); - - modelBuilder.Entity("Marco.Pms.Model.DocumentManager.Document", b => - { - b.HasOne("Marco.Pms.Model.Entitlements.Tenant", "Tenant") - .WithMany() - .HasForeignKey("TenantId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - 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.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.Entitlements.Tenant", b => - { - b.HasOne("Marco.Pms.Model.Industries.Industry", "Industry") - .WithMany() - .HasForeignKey("IndustryId"); - - b.Navigation("Industry"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Forum.TicketAttachment", b => - { - b.HasOne("Marco.Pms.Model.Forum.TicketComment", "TicketComment") - .WithMany("Attachments") - .HasForeignKey("CommentId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Marco.Pms.Model.Forum.TicketForum", "Ticket") - .WithMany() - .HasForeignKey("TicketId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Ticket"); - - b.Navigation("TicketComment"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Forum.TicketComment", b => - { - b.HasOne("Marco.Pms.Model.Entitlements.Tenant", "Tenant") - .WithMany() - .HasForeignKey("TenantId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Tenant"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Forum.TicketForum", b => - { - b.HasOne("Marco.Pms.Model.Forum.TicketPriorityMaster", "Priority") - .WithMany() - .HasForeignKey("PriorityId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Marco.Pms.Model.Forum.TicketStatusMaster", "TicketStatusMaster") - .WithMany() - .HasForeignKey("StatusId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Marco.Pms.Model.Entitlements.Tenant", "Tenant") - .WithMany() - .HasForeignKey("TenantId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Marco.Pms.Model.Forum.TicketTypeMaster", "TicketTypeMaster") - .WithMany() - .HasForeignKey("TypeId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Priority"); - - b.Navigation("Tenant"); - - b.Navigation("TicketStatusMaster"); - - b.Navigation("TicketTypeMaster"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Forum.TicketTag", b => - { - b.HasOne("Marco.Pms.Model.Forum.TicketTagMaster", "Tag") - .WithMany() - .HasForeignKey("TagId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Marco.Pms.Model.Forum.TicketForum", "Ticket") - .WithMany() - .HasForeignKey("TicketId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Tag"); - - b.Navigation("Ticket"); - }); - - 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("Marco.Pms.Model.Projects.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("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.Entitlements.Feature", b => - { - b.Navigation("FeaturePermissions"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Forum.TicketComment", b => - { - b.Navigation("Attachments"); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/Marco.Pms.DataAccess/Migrations/20250423091727_Added_Foreign_Key_In_Attendance_Log.cs b/Marco.Pms.DataAccess/Migrations/20250423091727_Added_Foreign_Key_In_Attendance_Log.cs deleted file mode 100644 index f087f15..0000000 --- a/Marco.Pms.DataAccess/Migrations/20250423091727_Added_Foreign_Key_In_Attendance_Log.cs +++ /dev/null @@ -1,50 +0,0 @@ -using System; -using Microsoft.EntityFrameworkCore.Migrations; - -#nullable disable - -namespace Marco.Pms.DataAccess.Migrations -{ - /// - public partial class Added_Foreign_Key_In_Attendance_Log : Migration - { - /// - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.AddColumn( - name: "DocumentId", - table: "AttendanceLogs", - type: "char(36)", - nullable: true, - collation: "ascii_general_ci"); - - migrationBuilder.CreateIndex( - name: "IX_AttendanceLogs_DocumentId", - table: "AttendanceLogs", - column: "DocumentId"); - - migrationBuilder.AddForeignKey( - name: "FK_AttendanceLogs_Documents_DocumentId", - table: "AttendanceLogs", - column: "DocumentId", - principalTable: "Documents", - principalColumn: "Id"); - } - - /// - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropForeignKey( - name: "FK_AttendanceLogs_Documents_DocumentId", - table: "AttendanceLogs"); - - migrationBuilder.DropIndex( - name: "IX_AttendanceLogs_DocumentId", - table: "AttendanceLogs"); - - migrationBuilder.DropColumn( - name: "DocumentId", - table: "AttendanceLogs"); - } - } -} diff --git a/Marco.Pms.DataAccess/Migrations/20250423095655_Made_BatchId_Nullable_In_Document.Designer.cs b/Marco.Pms.DataAccess/Migrations/20250423095655_Made_BatchId_Nullable_In_Document.Designer.cs deleted file mode 100644 index 600b12e..0000000 --- a/Marco.Pms.DataAccess/Migrations/20250423095655_Made_BatchId_Nullable_In_Document.Designer.cs +++ /dev/null @@ -1,2643 +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("20250423095655_Made_BatchId_Nullable_In_Document")] - partial class Made_BatchId_Nullable_In_Document - { - /// - 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("bigint"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - - b.Property("AssignedBy") - .HasColumnType("int"); - - b.Property("AssignmentDate") - .HasColumnType("datetime(6)"); - - b.Property("CompletedTask") - .HasColumnType("double"); - - b.Property("Description") - .HasColumnType("longtext"); - - b.Property("PlannedTask") - .HasColumnType("double"); - - b.Property("ReportedDate") - .HasColumnType("datetime(6)"); - - b.Property("TenantId") - .HasColumnType("int"); - - b.Property("WorkItemId") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("AssignedBy"); - - b.HasIndex("TenantId"); - - b.HasIndex("WorkItemId"); - - b.ToTable("TaskAllocations"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Activities.TaskComment", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - - b.Property("Comment") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("CommentDate") - .HasColumnType("datetime(6)"); - - b.Property("CommentedBy") - .HasColumnType("int"); - - b.Property("TaskAllocationId") - .HasColumnType("bigint"); - - b.Property("TenantId") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("CommentedBy"); - - b.HasIndex("TaskAllocationId"); - - b.HasIndex("TenantId"); - - b.ToTable("TaskComments"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Activities.TaskMembers", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - - b.Property("EmployeeId") - .HasColumnType("int"); - - b.Property("TaskAllocationId") - .HasColumnType("bigint"); - - b.Property("TenantId") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("EmployeeId"); - - b.HasIndex("TaskAllocationId"); - - b.HasIndex("TenantId"); - - b.ToTable("TaskMembers"); - }); - - 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("DocumentId") - .HasColumnType("char(36)"); - - 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("DocumentId"); - - 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") - .HasColumnType("longtext"); - - b.Property("UserId") - .HasColumnType("varchar(255)"); - - b.HasKey("Id"); - - b.HasIndex("UserId"); - - b.ToTable("RefreshTokens"); - }); - - modelBuilder.Entity("Marco.Pms.Model.DocumentManager.Document", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("char(36)"); - - b.Property("Base64Data") - .HasColumnType("longtext"); - - b.Property("BatchId") - .HasColumnType("char(36)"); - - b.Property("ContentType") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("FileName") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("FileSize") - .HasColumnType("bigint"); - - b.Property("S3Key") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("TenantId") - .HasColumnType("int"); - - b.Property("ThumbS3Key") - .HasColumnType("longtext"); - - b.Property("UploadedAt") - .HasColumnType("datetime(6)"); - - b.HasKey("Id"); - - b.HasIndex("TenantId"); - - b.ToTable("Documents"); - }); - - 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") - .HasColumnType("longtext"); - - b.Property("Email") - .HasColumnType("longtext"); - - b.Property("EmergencyContactPerson") - .HasColumnType("longtext"); - - b.Property("EmergencyPhoneNumber") - .HasColumnType("longtext"); - - b.Property("FirstName") - .HasColumnType("longtext"); - - b.Property("Gender") - .HasColumnType("longtext"); - - b.Property("IsActive") - .HasColumnType("tinyint(1)"); - - b.Property("JobRoleId") - .HasColumnType("int"); - - b.Property("JoiningDate") - .HasColumnType("datetime(6)"); - - b.Property("LastName") - .HasColumnType("longtext"); - - b.Property("MiddleName") - .HasColumnType("longtext"); - - b.Property("PanNumber") - .HasColumnType("longtext"); - - b.Property("PermanentAddress") - .HasColumnType("longtext"); - - b.Property("PhoneNumber") - .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") - .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.ActivityCheckList", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - - b.Property("ActivityId") - .HasColumnType("int"); - - b.Property("Description") - .HasColumnType("longtext"); - - b.Property("IsChecked") - .HasColumnType("tinyint(1)"); - - b.Property("IsMandatory") - .HasColumnType("tinyint(1)"); - - b.Property("TenantId") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.ToTable("ActivityCheckLists"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Entitlements.ActivityMaster", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - - b.Property("ActivityName") - .HasColumnType("longtext"); - - b.Property("IsActive") - .HasColumnType("tinyint(1)"); - - b.Property("TenantId") - .HasColumnType("int"); - - b.Property("UnitOfMeasurement") - .HasColumnType("longtext"); - - b.HasKey("Id"); - - b.HasIndex("TenantId"); - - b.ToTable("ActivityMasters"); - - b.HasData( - new - { - Id = 1, - ActivityName = "Core Cutting", - IsActive = true, - TenantId = 1, - UnitOfMeasurement = "Number" - }, - new - { - Id = 2, - ActivityName = "Fabrication", - IsActive = true, - TenantId = 1, - UnitOfMeasurement = "Meter" - }, - new - { - Id = 3, - ActivityName = "Lifting", - IsActive = true, - TenantId = 1, - UnitOfMeasurement = "Meter" - }, - new - { - Id = 4, - ActivityName = "Hanging", - IsActive = true, - TenantId = 1, - UnitOfMeasurement = "Meter" - }, - new - { - Id = 5, - ActivityName = "Tapping", - IsActive = true, - TenantId = 1, - UnitOfMeasurement = "Meter" - }, - new - { - Id = 6, - ActivityName = "Welding", - IsActive = true, - TenantId = 1, - UnitOfMeasurement = "Meter" - }, - new - { - Id = 7, - ActivityName = "Testing", - IsActive = true, - TenantId = 1, - UnitOfMeasurement = "Area" - }, - new - { - Id = 8, - ActivityName = "Painting", - IsActive = true, - TenantId = 1, - UnitOfMeasurement = "Meter" - }, - new - { - Id = 9, - ActivityName = "Marking Area", - IsActive = true, - TenantId = 1, - UnitOfMeasurement = "Meter" - }, - new - { - Id = 10, - ActivityName = "Drilling", - IsActive = true, - TenantId = 1, - UnitOfMeasurement = "Number" - }, - new - { - Id = 11, - ActivityName = "MS Support Fabrication", - IsActive = true, - TenantId = 1, - UnitOfMeasurement = "Number" - }, - new - { - Id = 12, - ActivityName = "MS Support Hanging", - IsActive = true, - TenantId = 1, - UnitOfMeasurement = "Number" - }, - new - { - Id = 13, - ActivityName = "Hydrant Volve", - IsActive = true, - TenantId = 1, - UnitOfMeasurement = "Number" - }, - new - { - Id = 14, - ActivityName = "Sprinkler Installation", - IsActive = true, - TenantId = 1, - UnitOfMeasurement = "Number" - }); - }); - - modelBuilder.Entity("Marco.Pms.Model.Entitlements.ApplicationRole", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("char(36)"); - - b.Property("Description") - .HasColumnType("longtext"); - - b.Property("Role") - .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.CheckListMappings", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - - b.Property("CheckListId") - .HasColumnType("int"); - - b.Property("TaskAllocationId") - .HasColumnType("bigint"); - - b.HasKey("Id"); - - b.ToTable("CheckListMappings"); - }); - - 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") - .HasColumnType("longtext"); - - b.Property("IsActive") - .HasColumnType("tinyint(1)"); - - b.Property("ModuleId") - .HasColumnType("int"); - - b.Property("Name") - .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") - .HasColumnType("longtext"); - - b.Property("FeatureId") - .HasColumnType("char(36)"); - - b.Property("IsEnabled") - .HasColumnType("tinyint(1)"); - - b.Property("Name") - .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") - .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") - .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") - .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") - .HasColumnType("longtext"); - - b.Property("ContactNumber") - .HasColumnType("longtext"); - - b.Property("Description") - .HasColumnType("longtext"); - - b.Property("DomainName") - .HasColumnType("longtext"); - - b.Property("IndustryId") - .HasColumnType("int"); - - b.Property("IsActive") - .HasColumnType("tinyint(1)"); - - b.Property("Name") - .HasColumnType("longtext"); - - b.Property("OnBoardingDate") - .HasColumnType("datetime(6)"); - - b.Property("OragnizationSize") - .HasColumnType("longtext"); - - b.HasKey("Id"); - - b.HasIndex("IndustryId"); - - b.ToTable("Tenants"); - - b.HasData( - new - { - Id = 1, - ContactName = "Admin", - ContactNumber = "123456789", - Description = "", - DomainName = "www.marcobms.org", - IndustryId = 1, - IsActive = true, - Name = "MarcoBMS", - OnBoardingDate = new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified) - }); - }); - - modelBuilder.Entity("Marco.Pms.Model.Forum.TicketAttachment", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("char(36)"); - - b.Property("CommentId") - .HasColumnType("char(36)"); - - b.Property("FileId") - .HasColumnType("char(36)"); - - b.Property("FileName") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("TicketId") - .HasColumnType("char(36)"); - - b.HasKey("Id"); - - b.HasIndex("CommentId"); - - b.HasIndex("TicketId"); - - b.ToTable("TicketAttachments"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Forum.TicketComment", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("char(36)"); - - b.Property("AuthorId") - .HasColumnType("char(36)"); - - b.Property("MessageText") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("ParentMessageId") - .HasColumnType("char(36)"); - - b.Property("SentAt") - .HasColumnType("datetime(6)"); - - b.Property("TenantId") - .HasColumnType("int"); - - b.Property("TicketId") - .HasColumnType("char(36)"); - - b.HasKey("Id"); - - b.HasIndex("TenantId"); - - b.ToTable("TicketComments"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Forum.TicketForum", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("char(36)"); - - b.Property("CreatedAt") - .HasColumnType("datetime(6)"); - - b.Property("CreatedById") - .HasColumnType("int"); - - b.Property("Description") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("LinkedActivityId") - .HasColumnType("int"); - - b.Property("PriorityId") - .HasColumnType("char(36)"); - - b.Property("StatusId") - .HasColumnType("char(36)"); - - b.Property("Subject") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("TenantId") - .HasColumnType("int"); - - b.Property("TypeId") - .HasColumnType("char(36)"); - - b.HasKey("Id"); - - b.HasIndex("PriorityId"); - - b.HasIndex("StatusId"); - - b.HasIndex("TenantId"); - - b.HasIndex("TypeId"); - - b.ToTable("Tickets"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Forum.TicketPriorityMaster", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("char(36)"); - - b.Property("ColorCode") - .HasColumnType("longtext"); - - b.Property("IsDefault") - .HasColumnType("tinyint(1)"); - - b.Property("Level") - .HasColumnType("int"); - - b.Property("Name") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("TenantId") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.ToTable("TicketPriorityMasters"); - - b.HasData( - new - { - Id = new Guid("188d29b3-10f3-42d0-9587-1a46ae7a0320"), - ColorCode = "008000", - IsDefault = true, - Level = 1, - Name = "Low", - TenantId = 1 - }, - new - { - Id = new Guid("0919bc84-9f82-4ecf-98c7-962755dd9a97"), - ColorCode = "FFFF00", - IsDefault = true, - Level = 2, - Name = "Medium", - TenantId = 1 - }, - new - { - Id = new Guid("a13b7e59-16fd-4665-b5cf-a97399e8445a"), - ColorCode = "#FFA500", - IsDefault = true, - Level = 3, - Name = "High", - TenantId = 1 - }, - new - { - Id = new Guid("f340fbc3-c9fd-46aa-b063-0093418830e4"), - ColorCode = "#FFA500", - IsDefault = true, - Level = 4, - Name = "Critical", - TenantId = 1 - }, - new - { - Id = new Guid("44a7b91d-a0dd-45d1-8616-4d2f71e16401"), - ColorCode = "#FF0000", - IsDefault = true, - Level = 5, - Name = "Urgent", - TenantId = 1 - }); - }); - - modelBuilder.Entity("Marco.Pms.Model.Forum.TicketStatusMaster", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("char(36)"); - - b.Property("ColorCode") - .HasColumnType("longtext"); - - b.Property("Description") - .HasColumnType("longtext"); - - b.Property("IsDefault") - .HasColumnType("tinyint(1)"); - - b.Property("Name") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("TenantId") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.ToTable("TicketStatusMasters"); - - b.HasData( - new - { - Id = new Guid("6b0c409b-3e80-4165-8b39-f3fcacb4c797"), - ColorCode = "#FFCC99", - Description = "This is a newly created issue.", - IsDefault = true, - Name = "New", - TenantId = 1 - }, - new - { - Id = new Guid("6c5ac37d-5b7d-40f3-adec-2dabaa5cca86"), - ColorCode = "#E6FF99", - Description = "Assigned to employee or team of employees", - IsDefault = true, - Name = "Assigned", - TenantId = 1 - }, - new - { - Id = new Guid("7f96bcd5-0c66-411b-8a1d-9d1a4785194e"), - ColorCode = "#99E6FF", - Description = "These issues are currently in progress", - IsDefault = true, - Name = "In Progress", - TenantId = 1 - }, - new - { - Id = new Guid("5c72b630-6923-4215-bf2c-b1622afd76e7"), - ColorCode = "#6c757d", - Description = "These issues are currently under review", - IsDefault = true, - Name = "In Review", - TenantId = 1 - }, - new - { - Id = new Guid("8ff85685-a875-4f21-aa95-d99551315fcc"), - ColorCode = "#B399FF", - Description = "The following issues are resolved and closed", - IsDefault = true, - Name = "Done", - TenantId = 1 - }); - }); - - modelBuilder.Entity("Marco.Pms.Model.Forum.TicketTag", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - - b.Property("TagId") - .HasColumnType("char(36)"); - - b.Property("TicketId") - .HasColumnType("char(36)"); - - b.HasKey("Id"); - - b.HasIndex("TagId"); - - b.HasIndex("TicketId"); - - b.ToTable("TicketTags"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Forum.TicketTagMaster", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("char(36)"); - - b.Property("ColorCode") - .HasColumnType("longtext"); - - b.Property("IsDefault") - .HasColumnType("tinyint(1)"); - - b.Property("Name") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("TenantId") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.ToTable("TicketTagMasters"); - - b.HasData( - new - { - Id = new Guid("ef6c2a65-f61d-4537-9650-a7ab7f8d98db"), - ColorCode = "#e59866", - IsDefault = true, - Name = "Quality Issue", - TenantId = 1 - }, - new - { - Id = new Guid("5a168569-8ad7-4422-8db6-51ef25caddeb"), - ColorCode = "#85c1e9", - IsDefault = true, - Name = "Help Desk", - TenantId = 1 - }); - }); - - modelBuilder.Entity("Marco.Pms.Model.Forum.TicketTypeMaster", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("char(36)"); - - b.Property("Description") - .HasColumnType("longtext"); - - b.Property("IsDefault") - .HasColumnType("tinyint(1)"); - - b.Property("Name") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("TenantId") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.ToTable("TicketTypeMasters"); - - b.HasData( - new - { - Id = new Guid("c74e5480-2b71-483c-8f4a-1a9c69c32603"), - Description = "An identified problem that affects the performance, reliability, or standards of a product or service", - IsDefault = true, - Name = "Quality Issue", - TenantId = 1 - }, - new - { - Id = new Guid("d1f55eab-9898-4e46-9f03-b263e33e5d38"), - Description = "A support service that assists users with technical issues, requests, or inquiries.", - IsDefault = true, - Name = "Help Desk", - TenantId = 1 - }); - }); - - modelBuilder.Entity("Marco.Pms.Model.Industries.Industry", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - - b.Property("Name") - .HasColumnType("longtext"); - - b.HasKey("Id"); - - b.ToTable("Industries"); - - b.HasData( - new - { - Id = 1, - Name = "Information Technology (IT) Services" - }, - new - { - Id = 2, - Name = "Manufacturing & Production" - }, - new - { - Id = 3, - Name = "Energy & Resources" - }, - new - { - Id = 4, - Name = "Finance & Professional Services" - }, - new - { - Id = 5, - Name = "Hospitals and Healthcare Services" - }, - new - { - Id = 6, - Name = "Social Services" - }, - new - { - Id = 7, - Name = "Retail & Consumer Services" - }, - new - { - Id = 8, - Name = "Transportation & Logistics" - }, - new - { - Id = 9, - Name = "Education & Training" - }); - }); - - 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") - .HasColumnType("longtext"); - - b.Property("EndDate") - .HasColumnType("datetime(6)"); - - b.Property("Name") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("ProjectAddress") - .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("Marco.Pms.Model.Projects.WorkItem", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - - b.Property("ActivityId") - .HasColumnType("int"); - - b.Property("CompletedWork") - .HasColumnType("double"); - - b.Property("PlannedWork") - .HasColumnType("double"); - - 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.Utilities.Inquiries", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - - b.Property("About") - .HasColumnType("longtext"); - - b.Property("ContactNumber") - .HasColumnType("longtext"); - - b.Property("ContactPerson") - .HasColumnType("longtext"); - - b.Property("Email") - .HasColumnType("longtext"); - - b.Property("IndustryId") - .HasColumnType("int"); - - b.Property("OragnizationSize") - .HasColumnType("longtext"); - - b.Property("OrganizatioinName") - .HasColumnType("longtext"); - - b.HasKey("Id"); - - b.ToTable("Inquiries"); - }); - - 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("IsActive") - .HasColumnType("tinyint(1)"); - - b.Property("IsRootUser") - .HasColumnType("tinyint(1)"); - - b.Property("TenantId") - .HasColumnType("int"); - - b.HasDiscriminator().HasValue("ApplicationUser"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Activities.TaskAllocation", b => - { - b.HasOne("Marco.Pms.Model.Employees.Employee", "Employee") - .WithMany() - .HasForeignKey("AssignedBy") - .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.WorkItem", "WorkItem") - .WithMany() - .HasForeignKey("WorkItemId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Employee"); - - b.Navigation("Tenant"); - - b.Navigation("WorkItem"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Activities.TaskComment", b => - { - b.HasOne("Marco.Pms.Model.Employees.Employee", "Employee") - .WithMany() - .HasForeignKey("CommentedBy") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Marco.Pms.Model.Activities.TaskAllocation", "TaskAllocation") - .WithMany() - .HasForeignKey("TaskAllocationId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Marco.Pms.Model.Entitlements.Tenant", "Tenant") - .WithMany() - .HasForeignKey("TenantId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Employee"); - - b.Navigation("TaskAllocation"); - - b.Navigation("Tenant"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Activities.TaskMembers", b => - { - b.HasOne("Marco.Pms.Model.Employees.Employee", "Employee") - .WithMany() - .HasForeignKey("EmployeeId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Marco.Pms.Model.Activities.TaskAllocation", "TaskAllocation") - .WithMany() - .HasForeignKey("TaskAllocationId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Marco.Pms.Model.Entitlements.Tenant", "Tenant") - .WithMany() - .HasForeignKey("TenantId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Employee"); - - b.Navigation("TaskAllocation"); - - 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.DocumentManager.Document", "Document") - .WithMany() - .HasForeignKey("DocumentId"); - - 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("Document"); - - 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); - - b.Navigation("User"); - }); - - modelBuilder.Entity("Marco.Pms.Model.DocumentManager.Document", b => - { - b.HasOne("Marco.Pms.Model.Entitlements.Tenant", "Tenant") - .WithMany() - .HasForeignKey("TenantId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - 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.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.Entitlements.Tenant", b => - { - b.HasOne("Marco.Pms.Model.Industries.Industry", "Industry") - .WithMany() - .HasForeignKey("IndustryId"); - - b.Navigation("Industry"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Forum.TicketAttachment", b => - { - b.HasOne("Marco.Pms.Model.Forum.TicketComment", "TicketComment") - .WithMany("Attachments") - .HasForeignKey("CommentId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Marco.Pms.Model.Forum.TicketForum", "Ticket") - .WithMany() - .HasForeignKey("TicketId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Ticket"); - - b.Navigation("TicketComment"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Forum.TicketComment", b => - { - b.HasOne("Marco.Pms.Model.Entitlements.Tenant", "Tenant") - .WithMany() - .HasForeignKey("TenantId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Tenant"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Forum.TicketForum", b => - { - b.HasOne("Marco.Pms.Model.Forum.TicketPriorityMaster", "Priority") - .WithMany() - .HasForeignKey("PriorityId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Marco.Pms.Model.Forum.TicketStatusMaster", "TicketStatusMaster") - .WithMany() - .HasForeignKey("StatusId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Marco.Pms.Model.Entitlements.Tenant", "Tenant") - .WithMany() - .HasForeignKey("TenantId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Marco.Pms.Model.Forum.TicketTypeMaster", "TicketTypeMaster") - .WithMany() - .HasForeignKey("TypeId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Priority"); - - b.Navigation("Tenant"); - - b.Navigation("TicketStatusMaster"); - - b.Navigation("TicketTypeMaster"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Forum.TicketTag", b => - { - b.HasOne("Marco.Pms.Model.Forum.TicketTagMaster", "Tag") - .WithMany() - .HasForeignKey("TagId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Marco.Pms.Model.Forum.TicketForum", "Ticket") - .WithMany() - .HasForeignKey("TicketId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Tag"); - - b.Navigation("Ticket"); - }); - - 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("Marco.Pms.Model.Projects.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("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.Entitlements.Feature", b => - { - b.Navigation("FeaturePermissions"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Forum.TicketComment", b => - { - b.Navigation("Attachments"); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/Marco.Pms.DataAccess/Migrations/20250423095655_Made_BatchId_Nullable_In_Document.cs b/Marco.Pms.DataAccess/Migrations/20250423095655_Made_BatchId_Nullable_In_Document.cs deleted file mode 100644 index 7735664..0000000 --- a/Marco.Pms.DataAccess/Migrations/20250423095655_Made_BatchId_Nullable_In_Document.cs +++ /dev/null @@ -1,41 +0,0 @@ -using System; -using Microsoft.EntityFrameworkCore.Migrations; - -#nullable disable - -namespace Marco.Pms.DataAccess.Migrations -{ - /// - public partial class Made_BatchId_Nullable_In_Document : Migration - { - /// - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.AlterColumn( - name: "BatchId", - table: "Documents", - type: "char(36)", - nullable: true, - collation: "ascii_general_ci", - oldClrType: typeof(Guid), - oldType: "char(36)") - .OldAnnotation("Relational:Collation", "ascii_general_ci"); - } - - /// - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.AlterColumn( - name: "BatchId", - table: "Documents", - type: "char(36)", - nullable: false, - defaultValue: new Guid("00000000-0000-0000-0000-000000000000"), - collation: "ascii_general_ci", - oldClrType: typeof(Guid), - oldType: "char(36)", - oldNullable: true) - .OldAnnotation("Relational:Collation", "ascii_general_ci"); - } - } -} diff --git a/Marco.Pms.DataAccess/Migrations/20250424060618_Made_ComentId_Nullable_In_TicketAttachment.cs b/Marco.Pms.DataAccess/Migrations/20250424060618_Made_ComentId_Nullable_In_TicketAttachment.cs deleted file mode 100644 index e96867f..0000000 --- a/Marco.Pms.DataAccess/Migrations/20250424060618_Made_ComentId_Nullable_In_TicketAttachment.cs +++ /dev/null @@ -1,64 +0,0 @@ -using System; -using Microsoft.EntityFrameworkCore.Migrations; - -#nullable disable - -namespace Marco.Pms.DataAccess.Migrations -{ - /// - public partial class Made_ComentId_Nullable_In_TicketAttachment : Migration - { - /// - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropForeignKey( - name: "FK_TicketAttachments_TicketComments_CommentId", - table: "TicketAttachments"); - - migrationBuilder.AlterColumn( - name: "CommentId", - table: "TicketAttachments", - type: "char(36)", - nullable: true, - collation: "ascii_general_ci", - oldClrType: typeof(Guid), - oldType: "char(36)") - .OldAnnotation("Relational:Collation", "ascii_general_ci"); - - migrationBuilder.AddForeignKey( - name: "FK_TicketAttachments_TicketComments_CommentId", - table: "TicketAttachments", - column: "CommentId", - principalTable: "TicketComments", - principalColumn: "Id"); - } - - /// - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropForeignKey( - name: "FK_TicketAttachments_TicketComments_CommentId", - table: "TicketAttachments"); - - migrationBuilder.AlterColumn( - name: "CommentId", - table: "TicketAttachments", - type: "char(36)", - nullable: false, - defaultValue: new Guid("00000000-0000-0000-0000-000000000000"), - collation: "ascii_general_ci", - oldClrType: typeof(Guid), - oldType: "char(36)", - oldNullable: true) - .OldAnnotation("Relational:Collation", "ascii_general_ci"); - - migrationBuilder.AddForeignKey( - name: "FK_TicketAttachments_TicketComments_CommentId", - table: "TicketAttachments", - column: "CommentId", - principalTable: "TicketComments", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); - } - } -} diff --git a/Marco.Pms.DataAccess/Migrations/20250425153821_Added_ProjectId_Column_In_TicketForum_Table.Designer.cs b/Marco.Pms.DataAccess/Migrations/20250425153821_Added_ProjectId_Column_In_TicketForum_Table.Designer.cs deleted file mode 100644 index 92ee30b..0000000 --- a/Marco.Pms.DataAccess/Migrations/20250425153821_Added_ProjectId_Column_In_TicketForum_Table.Designer.cs +++ /dev/null @@ -1,2644 +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("20250425153821_Added_ProjectId_Column_In_TicketForum_Table")] - partial class Added_ProjectId_Column_In_TicketForum_Table - { - /// - 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("bigint"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - - b.Property("AssignedBy") - .HasColumnType("int"); - - b.Property("AssignmentDate") - .HasColumnType("datetime(6)"); - - b.Property("CompletedTask") - .HasColumnType("double"); - - b.Property("Description") - .HasColumnType("longtext"); - - b.Property("PlannedTask") - .HasColumnType("double"); - - b.Property("ReportedDate") - .HasColumnType("datetime(6)"); - - b.Property("TenantId") - .HasColumnType("int"); - - b.Property("WorkItemId") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("AssignedBy"); - - b.HasIndex("TenantId"); - - b.HasIndex("WorkItemId"); - - b.ToTable("TaskAllocations"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Activities.TaskComment", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - - b.Property("Comment") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("CommentDate") - .HasColumnType("datetime(6)"); - - b.Property("CommentedBy") - .HasColumnType("int"); - - b.Property("TaskAllocationId") - .HasColumnType("bigint"); - - b.Property("TenantId") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("CommentedBy"); - - b.HasIndex("TaskAllocationId"); - - b.HasIndex("TenantId"); - - b.ToTable("TaskComments"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Activities.TaskMembers", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - - b.Property("EmployeeId") - .HasColumnType("int"); - - b.Property("TaskAllocationId") - .HasColumnType("bigint"); - - b.Property("TenantId") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("EmployeeId"); - - b.HasIndex("TaskAllocationId"); - - b.HasIndex("TenantId"); - - b.ToTable("TaskMembers"); - }); - - 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("DocumentId") - .HasColumnType("char(36)"); - - 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("DocumentId"); - - 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") - .HasColumnType("longtext"); - - b.Property("UserId") - .HasColumnType("varchar(255)"); - - b.HasKey("Id"); - - b.HasIndex("UserId"); - - b.ToTable("RefreshTokens"); - }); - - modelBuilder.Entity("Marco.Pms.Model.DocumentManager.Document", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("char(36)"); - - b.Property("Base64Data") - .HasColumnType("longtext"); - - b.Property("BatchId") - .HasColumnType("char(36)"); - - b.Property("ContentType") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("FileName") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("FileSize") - .HasColumnType("bigint"); - - b.Property("S3Key") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("TenantId") - .HasColumnType("int"); - - b.Property("ThumbS3Key") - .HasColumnType("longtext"); - - b.Property("UploadedAt") - .HasColumnType("datetime(6)"); - - b.HasKey("Id"); - - b.HasIndex("TenantId"); - - b.ToTable("Documents"); - }); - - 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") - .HasColumnType("longtext"); - - b.Property("Email") - .HasColumnType("longtext"); - - b.Property("EmergencyContactPerson") - .HasColumnType("longtext"); - - b.Property("EmergencyPhoneNumber") - .HasColumnType("longtext"); - - b.Property("FirstName") - .HasColumnType("longtext"); - - b.Property("Gender") - .HasColumnType("longtext"); - - b.Property("IsActive") - .HasColumnType("tinyint(1)"); - - b.Property("JobRoleId") - .HasColumnType("int"); - - b.Property("JoiningDate") - .HasColumnType("datetime(6)"); - - b.Property("LastName") - .HasColumnType("longtext"); - - b.Property("MiddleName") - .HasColumnType("longtext"); - - b.Property("PanNumber") - .HasColumnType("longtext"); - - b.Property("PermanentAddress") - .HasColumnType("longtext"); - - b.Property("PhoneNumber") - .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") - .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.ActivityCheckList", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - - b.Property("ActivityId") - .HasColumnType("int"); - - b.Property("Description") - .HasColumnType("longtext"); - - b.Property("IsChecked") - .HasColumnType("tinyint(1)"); - - b.Property("IsMandatory") - .HasColumnType("tinyint(1)"); - - b.Property("TenantId") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.ToTable("ActivityCheckLists"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Entitlements.ActivityMaster", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - - b.Property("ActivityName") - .HasColumnType("longtext"); - - b.Property("IsActive") - .HasColumnType("tinyint(1)"); - - b.Property("TenantId") - .HasColumnType("int"); - - b.Property("UnitOfMeasurement") - .HasColumnType("longtext"); - - b.HasKey("Id"); - - b.HasIndex("TenantId"); - - b.ToTable("ActivityMasters"); - - b.HasData( - new - { - Id = 1, - ActivityName = "Core Cutting", - IsActive = true, - TenantId = 1, - UnitOfMeasurement = "Number" - }, - new - { - Id = 2, - ActivityName = "Fabrication", - IsActive = true, - TenantId = 1, - UnitOfMeasurement = "Meter" - }, - new - { - Id = 3, - ActivityName = "Lifting", - IsActive = true, - TenantId = 1, - UnitOfMeasurement = "Meter" - }, - new - { - Id = 4, - ActivityName = "Hanging", - IsActive = true, - TenantId = 1, - UnitOfMeasurement = "Meter" - }, - new - { - Id = 5, - ActivityName = "Tapping", - IsActive = true, - TenantId = 1, - UnitOfMeasurement = "Meter" - }, - new - { - Id = 6, - ActivityName = "Welding", - IsActive = true, - TenantId = 1, - UnitOfMeasurement = "Meter" - }, - new - { - Id = 7, - ActivityName = "Testing", - IsActive = true, - TenantId = 1, - UnitOfMeasurement = "Area" - }, - new - { - Id = 8, - ActivityName = "Painting", - IsActive = true, - TenantId = 1, - UnitOfMeasurement = "Meter" - }, - new - { - Id = 9, - ActivityName = "Marking Area", - IsActive = true, - TenantId = 1, - UnitOfMeasurement = "Meter" - }, - new - { - Id = 10, - ActivityName = "Drilling", - IsActive = true, - TenantId = 1, - UnitOfMeasurement = "Number" - }, - new - { - Id = 11, - ActivityName = "MS Support Fabrication", - IsActive = true, - TenantId = 1, - UnitOfMeasurement = "Number" - }, - new - { - Id = 12, - ActivityName = "MS Support Hanging", - IsActive = true, - TenantId = 1, - UnitOfMeasurement = "Number" - }, - new - { - Id = 13, - ActivityName = "Hydrant Volve", - IsActive = true, - TenantId = 1, - UnitOfMeasurement = "Number" - }, - new - { - Id = 14, - ActivityName = "Sprinkler Installation", - IsActive = true, - TenantId = 1, - UnitOfMeasurement = "Number" - }); - }); - - modelBuilder.Entity("Marco.Pms.Model.Entitlements.ApplicationRole", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("char(36)"); - - b.Property("Description") - .HasColumnType("longtext"); - - b.Property("Role") - .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.CheckListMappings", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - - b.Property("CheckListId") - .HasColumnType("int"); - - b.Property("TaskAllocationId") - .HasColumnType("bigint"); - - b.HasKey("Id"); - - b.ToTable("CheckListMappings"); - }); - - 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") - .HasColumnType("longtext"); - - b.Property("IsActive") - .HasColumnType("tinyint(1)"); - - b.Property("ModuleId") - .HasColumnType("int"); - - b.Property("Name") - .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") - .HasColumnType("longtext"); - - b.Property("FeatureId") - .HasColumnType("char(36)"); - - b.Property("IsEnabled") - .HasColumnType("tinyint(1)"); - - b.Property("Name") - .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") - .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") - .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") - .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") - .HasColumnType("longtext"); - - b.Property("ContactNumber") - .HasColumnType("longtext"); - - b.Property("Description") - .HasColumnType("longtext"); - - b.Property("DomainName") - .HasColumnType("longtext"); - - b.Property("IndustryId") - .HasColumnType("int"); - - b.Property("IsActive") - .HasColumnType("tinyint(1)"); - - b.Property("Name") - .HasColumnType("longtext"); - - b.Property("OnBoardingDate") - .HasColumnType("datetime(6)"); - - b.Property("OragnizationSize") - .HasColumnType("longtext"); - - b.HasKey("Id"); - - b.HasIndex("IndustryId"); - - b.ToTable("Tenants"); - - b.HasData( - new - { - Id = 1, - ContactName = "Admin", - ContactNumber = "123456789", - Description = "", - DomainName = "www.marcobms.org", - IndustryId = 1, - IsActive = true, - Name = "MarcoBMS", - OnBoardingDate = new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified) - }); - }); - - modelBuilder.Entity("Marco.Pms.Model.Forum.TicketAttachment", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("char(36)"); - - b.Property("CommentId") - .HasColumnType("char(36)"); - - b.Property("FileId") - .HasColumnType("char(36)"); - - b.Property("FileName") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("TicketId") - .HasColumnType("char(36)"); - - b.HasKey("Id"); - - b.HasIndex("CommentId"); - - b.HasIndex("TicketId"); - - b.ToTable("TicketAttachments"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Forum.TicketComment", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("char(36)"); - - b.Property("AuthorId") - .HasColumnType("char(36)"); - - b.Property("MessageText") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("ParentMessageId") - .HasColumnType("char(36)"); - - b.Property("SentAt") - .HasColumnType("datetime(6)"); - - b.Property("TenantId") - .HasColumnType("int"); - - b.Property("TicketId") - .HasColumnType("char(36)"); - - b.HasKey("Id"); - - b.HasIndex("TenantId"); - - b.ToTable("TicketComments"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Forum.TicketForum", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("char(36)"); - - b.Property("CreatedAt") - .HasColumnType("datetime(6)"); - - b.Property("CreatedById") - .HasColumnType("int"); - - b.Property("Description") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("LinkedActivityId") - .HasColumnType("int"); - - b.Property("LinkedProjectId") - .HasColumnType("int"); - - b.Property("PriorityId") - .HasColumnType("char(36)"); - - b.Property("StatusId") - .HasColumnType("char(36)"); - - b.Property("Subject") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("TenantId") - .HasColumnType("int"); - - b.Property("TypeId") - .HasColumnType("char(36)"); - - b.HasKey("Id"); - - b.HasIndex("PriorityId"); - - b.HasIndex("StatusId"); - - b.HasIndex("TenantId"); - - b.HasIndex("TypeId"); - - b.ToTable("Tickets"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Forum.TicketPriorityMaster", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("char(36)"); - - b.Property("ColorCode") - .HasColumnType("longtext"); - - b.Property("IsDefault") - .HasColumnType("tinyint(1)"); - - b.Property("Level") - .HasColumnType("int"); - - b.Property("Name") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("TenantId") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.ToTable("TicketPriorityMasters"); - - b.HasData( - new - { - Id = new Guid("188d29b3-10f3-42d0-9587-1a46ae7a0320"), - ColorCode = "008000", - IsDefault = true, - Level = 1, - Name = "Low", - TenantId = 1 - }, - new - { - Id = new Guid("0919bc84-9f82-4ecf-98c7-962755dd9a97"), - ColorCode = "FFFF00", - IsDefault = true, - Level = 2, - Name = "Medium", - TenantId = 1 - }, - new - { - Id = new Guid("a13b7e59-16fd-4665-b5cf-a97399e8445a"), - ColorCode = "#FFA500", - IsDefault = true, - Level = 3, - Name = "High", - TenantId = 1 - }, - new - { - Id = new Guid("f340fbc3-c9fd-46aa-b063-0093418830e4"), - ColorCode = "#FFA500", - IsDefault = true, - Level = 4, - Name = "Critical", - TenantId = 1 - }, - new - { - Id = new Guid("44a7b91d-a0dd-45d1-8616-4d2f71e16401"), - ColorCode = "#FF0000", - IsDefault = true, - Level = 5, - Name = "Urgent", - TenantId = 1 - }); - }); - - modelBuilder.Entity("Marco.Pms.Model.Forum.TicketStatusMaster", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("char(36)"); - - b.Property("ColorCode") - .HasColumnType("longtext"); - - b.Property("Description") - .HasColumnType("longtext"); - - b.Property("IsDefault") - .HasColumnType("tinyint(1)"); - - b.Property("Name") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("TenantId") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.ToTable("TicketStatusMasters"); - - b.HasData( - new - { - Id = new Guid("6b0c409b-3e80-4165-8b39-f3fcacb4c797"), - ColorCode = "#FFCC99", - Description = "This is a newly created issue.", - IsDefault = true, - Name = "New", - TenantId = 1 - }, - new - { - Id = new Guid("6c5ac37d-5b7d-40f3-adec-2dabaa5cca86"), - ColorCode = "#E6FF99", - Description = "Assigned to employee or team of employees", - IsDefault = true, - Name = "Assigned", - TenantId = 1 - }, - new - { - Id = new Guid("7f96bcd5-0c66-411b-8a1d-9d1a4785194e"), - ColorCode = "#99E6FF", - Description = "These issues are currently in progress", - IsDefault = true, - Name = "In Progress", - TenantId = 1 - }, - new - { - Id = new Guid("5c72b630-6923-4215-bf2c-b1622afd76e7"), - ColorCode = "#6c757d", - Description = "These issues are currently under review", - IsDefault = true, - Name = "In Review", - TenantId = 1 - }, - new - { - Id = new Guid("8ff85685-a875-4f21-aa95-d99551315fcc"), - ColorCode = "#B399FF", - Description = "The following issues are resolved and closed", - IsDefault = true, - Name = "Done", - TenantId = 1 - }); - }); - - modelBuilder.Entity("Marco.Pms.Model.Forum.TicketTag", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - - b.Property("TagId") - .HasColumnType("char(36)"); - - b.Property("TicketId") - .HasColumnType("char(36)"); - - b.HasKey("Id"); - - b.HasIndex("TagId"); - - b.HasIndex("TicketId"); - - b.ToTable("TicketTags"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Forum.TicketTagMaster", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("char(36)"); - - b.Property("ColorCode") - .HasColumnType("longtext"); - - b.Property("IsDefault") - .HasColumnType("tinyint(1)"); - - b.Property("Name") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("TenantId") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.ToTable("TicketTagMasters"); - - b.HasData( - new - { - Id = new Guid("ef6c2a65-f61d-4537-9650-a7ab7f8d98db"), - ColorCode = "#e59866", - IsDefault = true, - Name = "Quality Issue", - TenantId = 1 - }, - new - { - Id = new Guid("5a168569-8ad7-4422-8db6-51ef25caddeb"), - ColorCode = "#85c1e9", - IsDefault = true, - Name = "Help Desk", - TenantId = 1 - }); - }); - - modelBuilder.Entity("Marco.Pms.Model.Forum.TicketTypeMaster", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("char(36)"); - - b.Property("Description") - .HasColumnType("longtext"); - - b.Property("IsDefault") - .HasColumnType("tinyint(1)"); - - b.Property("Name") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("TenantId") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.ToTable("TicketTypeMasters"); - - b.HasData( - new - { - Id = new Guid("c74e5480-2b71-483c-8f4a-1a9c69c32603"), - Description = "An identified problem that affects the performance, reliability, or standards of a product or service", - IsDefault = true, - Name = "Quality Issue", - TenantId = 1 - }, - new - { - Id = new Guid("d1f55eab-9898-4e46-9f03-b263e33e5d38"), - Description = "A support service that assists users with technical issues, requests, or inquiries.", - IsDefault = true, - Name = "Help Desk", - TenantId = 1 - }); - }); - - modelBuilder.Entity("Marco.Pms.Model.Industries.Industry", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - - b.Property("Name") - .HasColumnType("longtext"); - - b.HasKey("Id"); - - b.ToTable("Industries"); - - b.HasData( - new - { - Id = 1, - Name = "Information Technology (IT) Services" - }, - new - { - Id = 2, - Name = "Manufacturing & Production" - }, - new - { - Id = 3, - Name = "Energy & Resources" - }, - new - { - Id = 4, - Name = "Finance & Professional Services" - }, - new - { - Id = 5, - Name = "Hospitals and Healthcare Services" - }, - new - { - Id = 6, - Name = "Social Services" - }, - new - { - Id = 7, - Name = "Retail & Consumer Services" - }, - new - { - Id = 8, - Name = "Transportation & Logistics" - }, - new - { - Id = 9, - Name = "Education & Training" - }); - }); - - 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") - .HasColumnType("longtext"); - - b.Property("EndDate") - .HasColumnType("datetime(6)"); - - b.Property("Name") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("ProjectAddress") - .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("Marco.Pms.Model.Projects.WorkItem", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - - b.Property("ActivityId") - .HasColumnType("int"); - - b.Property("CompletedWork") - .HasColumnType("double"); - - b.Property("PlannedWork") - .HasColumnType("double"); - - 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.Utilities.Inquiries", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - - b.Property("About") - .HasColumnType("longtext"); - - b.Property("ContactNumber") - .HasColumnType("longtext"); - - b.Property("ContactPerson") - .HasColumnType("longtext"); - - b.Property("Email") - .HasColumnType("longtext"); - - b.Property("IndustryId") - .HasColumnType("int"); - - b.Property("OragnizationSize") - .HasColumnType("longtext"); - - b.Property("OrganizatioinName") - .HasColumnType("longtext"); - - b.HasKey("Id"); - - b.ToTable("Inquiries"); - }); - - 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("IsActive") - .HasColumnType("tinyint(1)"); - - b.Property("IsRootUser") - .HasColumnType("tinyint(1)"); - - b.Property("TenantId") - .HasColumnType("int"); - - b.HasDiscriminator().HasValue("ApplicationUser"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Activities.TaskAllocation", b => - { - b.HasOne("Marco.Pms.Model.Employees.Employee", "Employee") - .WithMany() - .HasForeignKey("AssignedBy") - .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.WorkItem", "WorkItem") - .WithMany() - .HasForeignKey("WorkItemId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Employee"); - - b.Navigation("Tenant"); - - b.Navigation("WorkItem"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Activities.TaskComment", b => - { - b.HasOne("Marco.Pms.Model.Employees.Employee", "Employee") - .WithMany() - .HasForeignKey("CommentedBy") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Marco.Pms.Model.Activities.TaskAllocation", "TaskAllocation") - .WithMany() - .HasForeignKey("TaskAllocationId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Marco.Pms.Model.Entitlements.Tenant", "Tenant") - .WithMany() - .HasForeignKey("TenantId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Employee"); - - b.Navigation("TaskAllocation"); - - b.Navigation("Tenant"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Activities.TaskMembers", b => - { - b.HasOne("Marco.Pms.Model.Employees.Employee", "Employee") - .WithMany() - .HasForeignKey("EmployeeId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Marco.Pms.Model.Activities.TaskAllocation", "TaskAllocation") - .WithMany() - .HasForeignKey("TaskAllocationId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Marco.Pms.Model.Entitlements.Tenant", "Tenant") - .WithMany() - .HasForeignKey("TenantId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Employee"); - - b.Navigation("TaskAllocation"); - - 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.DocumentManager.Document", "Document") - .WithMany() - .HasForeignKey("DocumentId"); - - 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("Document"); - - 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); - - b.Navigation("User"); - }); - - modelBuilder.Entity("Marco.Pms.Model.DocumentManager.Document", b => - { - b.HasOne("Marco.Pms.Model.Entitlements.Tenant", "Tenant") - .WithMany() - .HasForeignKey("TenantId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - 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.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.Entitlements.Tenant", b => - { - b.HasOne("Marco.Pms.Model.Industries.Industry", "Industry") - .WithMany() - .HasForeignKey("IndustryId"); - - b.Navigation("Industry"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Forum.TicketAttachment", b => - { - b.HasOne("Marco.Pms.Model.Forum.TicketComment", "TicketComment") - .WithMany("Attachments") - .HasForeignKey("CommentId"); - - b.HasOne("Marco.Pms.Model.Forum.TicketForum", "Ticket") - .WithMany() - .HasForeignKey("TicketId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Ticket"); - - b.Navigation("TicketComment"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Forum.TicketComment", b => - { - b.HasOne("Marco.Pms.Model.Entitlements.Tenant", "Tenant") - .WithMany() - .HasForeignKey("TenantId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Tenant"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Forum.TicketForum", b => - { - b.HasOne("Marco.Pms.Model.Forum.TicketPriorityMaster", "Priority") - .WithMany() - .HasForeignKey("PriorityId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Marco.Pms.Model.Forum.TicketStatusMaster", "TicketStatusMaster") - .WithMany() - .HasForeignKey("StatusId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Marco.Pms.Model.Entitlements.Tenant", "Tenant") - .WithMany() - .HasForeignKey("TenantId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Marco.Pms.Model.Forum.TicketTypeMaster", "TicketTypeMaster") - .WithMany() - .HasForeignKey("TypeId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Priority"); - - b.Navigation("Tenant"); - - b.Navigation("TicketStatusMaster"); - - b.Navigation("TicketTypeMaster"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Forum.TicketTag", b => - { - b.HasOne("Marco.Pms.Model.Forum.TicketTagMaster", "Tag") - .WithMany() - .HasForeignKey("TagId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Marco.Pms.Model.Forum.TicketForum", "Ticket") - .WithMany() - .HasForeignKey("TicketId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Tag"); - - b.Navigation("Ticket"); - }); - - 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("Marco.Pms.Model.Projects.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("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.Entitlements.Feature", b => - { - b.Navigation("FeaturePermissions"); - }); - - modelBuilder.Entity("Marco.Pms.Model.Forum.TicketComment", b => - { - b.Navigation("Attachments"); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/Marco.Pms.DataAccess/Migrations/20250425153821_Added_ProjectId_Column_In_TicketForum_Table.cs b/Marco.Pms.DataAccess/Migrations/20250425153821_Added_ProjectId_Column_In_TicketForum_Table.cs deleted file mode 100644 index b60099f..0000000 --- a/Marco.Pms.DataAccess/Migrations/20250425153821_Added_ProjectId_Column_In_TicketForum_Table.cs +++ /dev/null @@ -1,47 +0,0 @@ -using Microsoft.EntityFrameworkCore.Migrations; - -#nullable disable - -namespace Marco.Pms.DataAccess.Migrations -{ - /// - public partial class Added_ProjectId_Column_In_TicketForum_Table : Migration - { - /// - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.AlterColumn( - name: "LinkedActivityId", - table: "Tickets", - type: "int", - nullable: true, - oldClrType: typeof(int), - oldType: "int"); - - migrationBuilder.AddColumn( - name: "LinkedProjectId", - table: "Tickets", - type: "int", - nullable: false, - defaultValue: 0); - } - - /// - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropColumn( - name: "LinkedProjectId", - table: "Tickets"); - - migrationBuilder.AlterColumn( - name: "LinkedActivityId", - table: "Tickets", - type: "int", - nullable: false, - defaultValue: 0, - oldClrType: typeof(int), - oldType: "int", - oldNullable: true); - } - } -} diff --git a/Marco.Pms.DataAccess/Migrations/20250424060618_Made_ComentId_Nullable_In_TicketAttachment.Designer.cs b/Marco.Pms.DataAccess/Migrations/20250501162003_Initmigration.Designer.cs similarity index 83% rename from Marco.Pms.DataAccess/Migrations/20250424060618_Made_ComentId_Nullable_In_TicketAttachment.Designer.cs rename to Marco.Pms.DataAccess/Migrations/20250501162003_Initmigration.Designer.cs index 4cd1787..fcb6e0b 100644 --- a/Marco.Pms.DataAccess/Migrations/20250424060618_Made_ComentId_Nullable_In_TicketAttachment.Designer.cs +++ b/Marco.Pms.DataAccess/Migrations/20250501162003_Initmigration.Designer.cs @@ -12,8 +12,8 @@ using Microsoft.EntityFrameworkCore.Storage.ValueConversion; namespace Marco.Pms.DataAccess.Migrations { [DbContext(typeof(ApplicationDbContext))] - [Migration("20250424060618_Made_ComentId_Nullable_In_TicketAttachment")] - partial class Made_ComentId_Nullable_In_TicketAttachment + [Migration("20250501162003_Initmigration")] + partial class Initmigration { /// protected override void BuildTargetModel(ModelBuilder modelBuilder) @@ -27,14 +27,12 @@ namespace Marco.Pms.DataAccess.Migrations modelBuilder.Entity("Marco.Pms.Model.Activities.TaskAllocation", b => { - b.Property("Id") + b.Property("Id") .ValueGeneratedOnAdd() - .HasColumnType("bigint"); + .HasColumnType("char(36)"); - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - - b.Property("AssignedBy") - .HasColumnType("int"); + b.Property("AssignedBy") + .HasColumnType("char(36)"); b.Property("AssignmentDate") .HasColumnType("datetime(6)"); @@ -51,11 +49,11 @@ namespace Marco.Pms.DataAccess.Migrations b.Property("ReportedDate") .HasColumnType("datetime(6)"); - b.Property("TenantId") - .HasColumnType("int"); + b.Property("TenantId") + .HasColumnType("char(36)"); - b.Property("WorkItemId") - .HasColumnType("int"); + b.Property("WorkItemId") + .HasColumnType("char(36)"); b.HasKey("Id"); @@ -70,11 +68,9 @@ namespace Marco.Pms.DataAccess.Migrations modelBuilder.Entity("Marco.Pms.Model.Activities.TaskComment", b => { - b.Property("Id") + b.Property("Id") .ValueGeneratedOnAdd() - .HasColumnType("bigint"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); + .HasColumnType("char(36)"); b.Property("Comment") .IsRequired() @@ -83,14 +79,14 @@ namespace Marco.Pms.DataAccess.Migrations b.Property("CommentDate") .HasColumnType("datetime(6)"); - b.Property("CommentedBy") - .HasColumnType("int"); + b.Property("CommentedBy") + .HasColumnType("char(36)"); - b.Property("TaskAllocationId") - .HasColumnType("bigint"); + b.Property("TaskAllocationId") + .HasColumnType("char(36)"); - b.Property("TenantId") - .HasColumnType("int"); + b.Property("TenantId") + .HasColumnType("char(36)"); b.HasKey("Id"); @@ -105,20 +101,18 @@ namespace Marco.Pms.DataAccess.Migrations modelBuilder.Entity("Marco.Pms.Model.Activities.TaskMembers", b => { - b.Property("Id") + b.Property("Id") .ValueGeneratedOnAdd() - .HasColumnType("bigint"); + .HasColumnType("char(36)"); - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); + b.Property("EmployeeId") + .HasColumnType("char(36)"); - b.Property("EmployeeId") - .HasColumnType("int"); + b.Property("TaskAllocationId") + .HasColumnType("char(36)"); - b.Property("TaskAllocationId") - .HasColumnType("bigint"); - - b.Property("TenantId") - .HasColumnType("int"); + b.Property("TenantId") + .HasColumnType("char(36)"); b.HasKey("Id"); @@ -133,11 +127,9 @@ namespace Marco.Pms.DataAccess.Migrations modelBuilder.Entity("Marco.Pms.Model.AttendanceModule.Attendance", b => { - b.Property("Id") + b.Property("Id") .ValueGeneratedOnAdd() - .HasColumnType("int"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); + .HasColumnType("char(36)"); b.Property("Activity") .HasColumnType("int"); @@ -155,8 +147,8 @@ namespace Marco.Pms.DataAccess.Migrations b.Property("Date") .HasColumnType("datetime(6)"); - b.Property("EmployeeID") - .HasColumnType("int"); + b.Property("EmployeeID") + .HasColumnType("char(36)"); b.Property("InTime") .HasColumnType("datetime(6)"); @@ -167,11 +159,11 @@ namespace Marco.Pms.DataAccess.Migrations b.Property("OutTime") .HasColumnType("datetime(6)"); - b.Property("ProjectID") - .HasColumnType("int"); + b.Property("ProjectID") + .HasColumnType("char(36)"); - b.Property("TenantId") - .HasColumnType("int"); + b.Property("TenantId") + .HasColumnType("char(36)"); b.HasKey("Id"); @@ -184,11 +176,9 @@ namespace Marco.Pms.DataAccess.Migrations modelBuilder.Entity("Marco.Pms.Model.AttendanceModule.AttendanceLog", b => { - b.Property("Id") + b.Property("Id") .ValueGeneratedOnAdd() - .HasColumnType("int"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); + .HasColumnType("char(36)"); b.Property("Activity") .HasColumnType("int"); @@ -196,8 +186,8 @@ namespace Marco.Pms.DataAccess.Migrations b.Property("ActivityTime") .HasColumnType("datetime(6)"); - b.Property("AttendanceId") - .HasColumnType("int"); + b.Property("AttendanceId") + .HasColumnType("char(36)"); b.Property("Comment") .IsRequired() @@ -206,8 +196,8 @@ namespace Marco.Pms.DataAccess.Migrations b.Property("DocumentId") .HasColumnType("char(36)"); - b.Property("EmployeeID") - .HasColumnType("int"); + b.Property("EmployeeID") + .HasColumnType("char(36)"); b.Property("Latitude") .HasColumnType("longtext"); @@ -218,11 +208,11 @@ namespace Marco.Pms.DataAccess.Migrations b.Property("Photo") .HasColumnType("longblob"); - b.Property("TenantId") - .HasColumnType("int"); + b.Property("TenantId") + .HasColumnType("char(36)"); - b.Property("UpdatedBy") - .HasColumnType("int"); + b.Property("UpdatedBy") + .HasColumnType("char(36)"); b.Property("UpdatedOn") .HasColumnType("datetime(6)"); @@ -244,11 +234,9 @@ namespace Marco.Pms.DataAccess.Migrations modelBuilder.Entity("Marco.Pms.Model.Authentication.RefreshToken", b => { - b.Property("Id") + b.Property("Id") .ValueGeneratedOnAdd() - .HasColumnType("int"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); + .HasColumnType("char(36)"); b.Property("CreatedAt") .HasColumnType("datetime(6)"); @@ -305,8 +293,8 @@ namespace Marco.Pms.DataAccess.Migrations .IsRequired() .HasColumnType("longtext"); - b.Property("TenantId") - .HasColumnType("int"); + b.Property("TenantId") + .HasColumnType("char(36)"); b.Property("ThumbS3Key") .HasColumnType("longtext"); @@ -323,11 +311,9 @@ namespace Marco.Pms.DataAccess.Migrations modelBuilder.Entity("Marco.Pms.Model.Employees.Employee", b => { - b.Property("Id") + b.Property("Id") .ValueGeneratedOnAdd() - .HasColumnType("int"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); + .HasColumnType("char(36)"); b.Property("AadharNumber") .HasColumnType("longtext"); @@ -359,8 +345,8 @@ namespace Marco.Pms.DataAccess.Migrations b.Property("IsActive") .HasColumnType("tinyint(1)"); - b.Property("JobRoleId") - .HasColumnType("int"); + b.Property("JobRoleId") + .HasColumnType("char(36)"); b.Property("JoiningDate") .HasColumnType("datetime(6)"); @@ -386,8 +372,8 @@ namespace Marco.Pms.DataAccess.Migrations b.Property("RoleId") .HasColumnType("char(36)"); - b.Property("TenantId") - .HasColumnType("int"); + b.Property("TenantId") + .HasColumnType("char(36)"); b.HasKey("Id"); @@ -402,11 +388,9 @@ namespace Marco.Pms.DataAccess.Migrations modelBuilder.Entity("Marco.Pms.Model.Employees.WorkShift", b => { - b.Property("Id") + b.Property("Id") .ValueGeneratedOnAdd() - .HasColumnType("int"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); + .HasColumnType("char(36)"); b.Property("EndTime") .HasColumnType("time(6)"); @@ -417,8 +401,8 @@ namespace Marco.Pms.DataAccess.Migrations b.Property("StartTime") .HasColumnType("time(6)"); - b.Property("TenantId") - .HasColumnType("int"); + b.Property("TenantId") + .HasColumnType("char(36)"); b.HasKey("Id"); @@ -429,14 +413,12 @@ namespace Marco.Pms.DataAccess.Migrations modelBuilder.Entity("Marco.Pms.Model.Entitlements.ActivityCheckList", b => { - b.Property("Id") + b.Property("Id") .ValueGeneratedOnAdd() - .HasColumnType("int"); + .HasColumnType("char(36)"); - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - - b.Property("ActivityId") - .HasColumnType("int"); + b.Property("ActivityId") + .HasColumnType("char(36)"); b.Property("Description") .HasColumnType("longtext"); @@ -447,8 +429,8 @@ namespace Marco.Pms.DataAccess.Migrations b.Property("IsMandatory") .HasColumnType("tinyint(1)"); - b.Property("TenantId") - .HasColumnType("int"); + b.Property("TenantId") + .HasColumnType("char(36)"); b.HasKey("Id"); @@ -457,11 +439,9 @@ namespace Marco.Pms.DataAccess.Migrations modelBuilder.Entity("Marco.Pms.Model.Entitlements.ActivityMaster", b => { - b.Property("Id") + b.Property("Id") .ValueGeneratedOnAdd() - .HasColumnType("int"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); + .HasColumnType("char(36)"); b.Property("ActivityName") .HasColumnType("longtext"); @@ -469,8 +449,8 @@ namespace Marco.Pms.DataAccess.Migrations b.Property("IsActive") .HasColumnType("tinyint(1)"); - b.Property("TenantId") - .HasColumnType("int"); + b.Property("TenantId") + .HasColumnType("char(36)"); b.Property("UnitOfMeasurement") .HasColumnType("longtext"); @@ -484,114 +464,58 @@ namespace Marco.Pms.DataAccess.Migrations b.HasData( new { - Id = 1, + Id = new Guid("4117b7de-ef6c-461f-a2c2-64eaac5f9a11"), ActivityName = "Core Cutting", IsActive = true, - TenantId = 1, + TenantId = new Guid("b3466e83-7e11-464c-b93a-daf047838b26"), UnitOfMeasurement = "Number" }, new { - Id = 2, + Id = new Guid("1714f64d-7591-4419-bee5-118d21bb2855"), ActivityName = "Fabrication", IsActive = true, - TenantId = 1, + TenantId = new Guid("b3466e83-7e11-464c-b93a-daf047838b26"), UnitOfMeasurement = "Meter" }, new { - Id = 3, - ActivityName = "Lifting", - IsActive = true, - TenantId = 1, - UnitOfMeasurement = "Meter" - }, - new - { - Id = 4, - ActivityName = "Hanging", - IsActive = true, - TenantId = 1, - UnitOfMeasurement = "Meter" - }, - new - { - Id = 5, - ActivityName = "Tapping", - IsActive = true, - TenantId = 1, - UnitOfMeasurement = "Meter" - }, - new - { - Id = 6, + Id = new Guid("b3f51a93-dde6-45f9-8b22-f1bf017a640b"), ActivityName = "Welding", IsActive = true, - TenantId = 1, + TenantId = new Guid("b3466e83-7e11-464c-b93a-daf047838b26"), UnitOfMeasurement = "Meter" }, new { - Id = 7, - ActivityName = "Testing", - IsActive = true, - TenantId = 1, - UnitOfMeasurement = "Area" - }, - new - { - Id = 8, - ActivityName = "Painting", - IsActive = true, - TenantId = 1, - UnitOfMeasurement = "Meter" - }, - new - { - Id = 9, - ActivityName = "Marking Area", - IsActive = true, - TenantId = 1, - UnitOfMeasurement = "Meter" - }, - new - { - Id = 10, - ActivityName = "Drilling", - IsActive = true, - TenantId = 1, - UnitOfMeasurement = "Number" - }, - new - { - Id = 11, + Id = new Guid("53eedf44-4076-445f-be93-fedef17117e7"), ActivityName = "MS Support Fabrication", IsActive = true, - TenantId = 1, + TenantId = new Guid("b3466e83-7e11-464c-b93a-daf047838b26"), UnitOfMeasurement = "Number" }, new { - Id = 12, + Id = new Guid("715b9ddb-d9e2-4afa-8987-d9918905cea4"), ActivityName = "MS Support Hanging", IsActive = true, - TenantId = 1, + TenantId = new Guid("b3466e83-7e11-464c-b93a-daf047838b26"), UnitOfMeasurement = "Number" }, new { - Id = 13, + Id = new Guid("a3d191a7-a5aa-4dd8-a525-12c99263bbd6"), ActivityName = "Hydrant Volve", IsActive = true, - TenantId = 1, + TenantId = new Guid("b3466e83-7e11-464c-b93a-daf047838b26"), UnitOfMeasurement = "Number" }, new { - Id = 14, + Id = new Guid("c138a7de-713a-4bd4-8292-b0b265be77a3"), ActivityName = "Sprinkler Installation", IsActive = true, - TenantId = 1, + TenantId = new Guid("b3466e83-7e11-464c-b93a-daf047838b26"), UnitOfMeasurement = "Number" }); }); @@ -608,66 +532,27 @@ namespace Marco.Pms.DataAccess.Migrations b.Property("Role") .HasColumnType("longtext"); - b.Property("TenantId") - .HasColumnType("int"); + b.Property("TenantId") + .HasColumnType("char(36)"); 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.CheckListMappings", b => { - b.Property("Id") + b.Property("Id") .ValueGeneratedOnAdd() - .HasColumnType("int"); + .HasColumnType("char(36)"); - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); + b.Property("CheckListId") + .HasColumnType("char(36)"); - b.Property("CheckListId") - .HasColumnType("int"); - - b.Property("TaskAllocationId") - .HasColumnType("bigint"); + b.Property("TaskAllocationId") + .HasColumnType("char(36)"); b.HasKey("Id"); @@ -680,8 +565,8 @@ namespace Marco.Pms.DataAccess.Migrations .ValueGeneratedOnAdd() .HasColumnType("char(36)"); - b.Property("EmployeeId") - .HasColumnType("int"); + b.Property("EmployeeId") + .HasColumnType("char(36)"); b.Property("IsEnabled") .HasColumnType("tinyint(1)"); @@ -689,8 +574,8 @@ namespace Marco.Pms.DataAccess.Migrations b.Property("RoleId") .HasColumnType("char(36)"); - b.Property("TenantId") - .HasColumnType("int"); + b.Property("TenantId") + .HasColumnType("char(36)"); b.HasKey("Id"); @@ -715,8 +600,8 @@ namespace Marco.Pms.DataAccess.Migrations b.Property("IsActive") .HasColumnType("tinyint(1)"); - b.Property("ModuleId") - .HasColumnType("int"); + b.Property("ModuleId") + .HasColumnType("char(36)"); b.Property("Name") .HasColumnType("longtext"); @@ -733,7 +618,7 @@ namespace Marco.Pms.DataAccess.Migrations Id = new Guid("53176ebf-c75d-42e5-839f-4508ffac3def"), Description = "Manage Project", IsActive = true, - ModuleId = 1, + ModuleId = new Guid("bf59fd88-b57a-4d67-bf01-3780f385896b"), Name = "Manage Project" }, new @@ -741,7 +626,7 @@ namespace Marco.Pms.DataAccess.Migrations Id = new Guid("9666de86-d7c7-4d3d-acaa-fcd6d6b81f3c"), Description = "Manage Infra", IsActive = true, - ModuleId = 1, + ModuleId = new Guid("bf59fd88-b57a-4d67-bf01-3780f385896b"), Name = "Manage Infra" }, new @@ -749,7 +634,7 @@ namespace Marco.Pms.DataAccess.Migrations Id = new Guid("9d4b5489-2079-40b9-bd77-6e1bf90bc19f"), Description = "Manage Tasks", IsActive = true, - ModuleId = 1, + ModuleId = new Guid("bf59fd88-b57a-4d67-bf01-3780f385896b"), Name = "Manage Tasks" }, new @@ -757,7 +642,7 @@ namespace Marco.Pms.DataAccess.Migrations Id = new Guid("39e66f81-efc6-446c-95bd-46bff6cfb606"), Description = "Assign and Update Tasks Progress", IsActive = true, - ModuleId = 1, + ModuleId = new Guid("bf59fd88-b57a-4d67-bf01-3780f385896b"), Name = "Assign and Update Tasks Progress" }, new @@ -765,7 +650,7 @@ namespace Marco.Pms.DataAccess.Migrations Id = new Guid("81ab8a87-8ccd-4015-a917-0627cee6a100"), Description = "Manage Employee", IsActive = true, - ModuleId = 2, + ModuleId = new Guid("2a231490-bcb1-4bdd-91f1-f25fb7f25b23"), Name = "Manage Employee" }, new @@ -773,7 +658,7 @@ namespace Marco.Pms.DataAccess.Migrations Id = new Guid("52c9cf54-1eb2-44d2-81bb-524cf29c0a94"), Description = "Attendance", IsActive = true, - ModuleId = 2, + ModuleId = new Guid("2a231490-bcb1-4bdd-91f1-f25fb7f25b23"), Name = "Attendance" }, new @@ -781,7 +666,7 @@ namespace Marco.Pms.DataAccess.Migrations Id = new Guid("be3b3afc-6ccf-4566-b9b6-aafcb65546be"), Description = "Global Masters", IsActive = true, - ModuleId = 3, + ModuleId = new Guid("c43db8c7-ab73-47f4-9d3b-f83e81357924"), Name = "Global Masters" }, new @@ -789,7 +674,7 @@ namespace Marco.Pms.DataAccess.Migrations Id = new Guid("660131a4-788c-4739-a082-cbbf7879cbf2"), Description = "Tenant Masters", IsActive = true, - ModuleId = 3, + ModuleId = new Guid("c43db8c7-ab73-47f4-9d3b-f83e81357924"), Name = "Tenant Masters" }); }); @@ -967,11 +852,9 @@ namespace Marco.Pms.DataAccess.Migrations modelBuilder.Entity("Marco.Pms.Model.Entitlements.JobRole", b => { - b.Property("Id") + b.Property("Id") .ValueGeneratedOnAdd() - .HasColumnType("int"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); + .HasColumnType("char(36)"); b.Property("Description") .HasColumnType("longtext"); @@ -979,8 +862,8 @@ namespace Marco.Pms.DataAccess.Migrations b.Property("Name") .HasColumnType("longtext"); - b.Property("TenantId") - .HasColumnType("int"); + b.Property("TenantId") + .HasColumnType("char(36)"); b.HasKey("Id"); @@ -991,11 +874,9 @@ namespace Marco.Pms.DataAccess.Migrations modelBuilder.Entity("Marco.Pms.Model.Entitlements.Module", b => { - b.Property("Id") + b.Property("Id") .ValueGeneratedOnAdd() - .HasColumnType("int"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); + .HasColumnType("char(36)"); b.Property("Description") .HasColumnType("longtext"); @@ -1015,21 +896,21 @@ namespace Marco.Pms.DataAccess.Migrations b.HasData( new { - Id = 1, + Id = new Guid("bf59fd88-b57a-4d67-bf01-3780f385896b"), Description = "Project Module", Key = "b04da7e9-0406-409c-ac7f-b97256e6ea02", Name = "Project" }, new { - Id = 2, + Id = new Guid("2a231490-bcb1-4bdd-91f1-f25fb7f25b23"), Description = "Employee Module", Key = "0971c7fb-6ce1-458a-ae3f-8d3205893637", Name = "Employee" }, new { - Id = 3, + Id = new Guid("c43db8c7-ab73-47f4-9d3b-f83e81357924"), Description = "Masters Module", Key = "504ec132-e6a9-422f-8f85-050602cfce05", Name = "Masters" @@ -1053,17 +934,15 @@ namespace Marco.Pms.DataAccess.Migrations modelBuilder.Entity("Marco.Pms.Model.Entitlements.StatusMaster", b => { - b.Property("Id") + b.Property("Id") .ValueGeneratedOnAdd() - .HasColumnType("int"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); + .HasColumnType("char(36)"); b.Property("Status") .HasColumnType("longtext"); - b.Property("TenantId") - .HasColumnType("int"); + b.Property("TenantId") + .HasColumnType("char(36)"); b.HasKey("Id"); @@ -1074,37 +953,35 @@ namespace Marco.Pms.DataAccess.Migrations b.HasData( new { - Id = 1, + Id = new Guid("b74da4c2-d07e-46f2-9919-e75e49b12731"), Status = "Active", - TenantId = 1 + TenantId = new Guid("b3466e83-7e11-464c-b93a-daf047838b26") }, new { - Id = 2, + Id = new Guid("603e994b-a27f-4e5d-a251-f3d69b0498ba"), Status = "In Progress", - TenantId = 1 + TenantId = new Guid("b3466e83-7e11-464c-b93a-daf047838b26") }, new { - Id = 3, + Id = new Guid("ef1c356e-0fe0-42df-a5d3-8daee355492d"), Status = "On Hold", - TenantId = 1 + TenantId = new Guid("b3466e83-7e11-464c-b93a-daf047838b26") }, new { - Id = 4, + Id = new Guid("33deaef9-9af1-4f2a-b443-681ea0d04f81"), Status = "Completed", - TenantId = 1 + TenantId = new Guid("b3466e83-7e11-464c-b93a-daf047838b26") }); }); modelBuilder.Entity("Marco.Pms.Model.Entitlements.Tenant", b => { - b.Property("Id") + b.Property("Id") .ValueGeneratedOnAdd() - .HasColumnType("int"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); + .HasColumnType("char(36)"); b.Property("ContactName") .HasColumnType("longtext"); @@ -1118,8 +995,8 @@ namespace Marco.Pms.DataAccess.Migrations b.Property("DomainName") .HasColumnType("longtext"); - b.Property("IndustryId") - .HasColumnType("int"); + b.Property("IndustryId") + .HasColumnType("char(36)"); b.Property("IsActive") .HasColumnType("tinyint(1)"); @@ -1142,15 +1019,16 @@ namespace Marco.Pms.DataAccess.Migrations b.HasData( new { - Id = 1, + Id = new Guid("b3466e83-7e11-464c-b93a-daf047838b26"), ContactName = "Admin", ContactNumber = "123456789", Description = "", DomainName = "www.marcobms.org", - IndustryId = 1, + IndustryId = new Guid("15436ee3-a650-469e-bfc2-59993f7514bb"), IsActive = true, Name = "MarcoBMS", - OnBoardingDate = new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified) + OnBoardingDate = new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), + OragnizationSize = "100-200" }); }); @@ -1201,8 +1079,8 @@ namespace Marco.Pms.DataAccess.Migrations b.Property("SentAt") .HasColumnType("datetime(6)"); - b.Property("TenantId") - .HasColumnType("int"); + b.Property("TenantId") + .HasColumnType("char(36)"); b.Property("TicketId") .HasColumnType("char(36)"); @@ -1223,15 +1101,18 @@ namespace Marco.Pms.DataAccess.Migrations b.Property("CreatedAt") .HasColumnType("datetime(6)"); - b.Property("CreatedById") - .HasColumnType("int"); + b.Property("CreatedById") + .HasColumnType("char(36)"); b.Property("Description") .IsRequired() .HasColumnType("longtext"); - b.Property("LinkedActivityId") - .HasColumnType("int"); + b.Property("LinkedActivityId") + .HasColumnType("char(36)"); + + b.Property("LinkedProjectId") + .HasColumnType("char(36)"); b.Property("PriorityId") .HasColumnType("char(36)"); @@ -1243,8 +1124,8 @@ namespace Marco.Pms.DataAccess.Migrations .IsRequired() .HasColumnType("longtext"); - b.Property("TenantId") - .HasColumnType("int"); + b.Property("TenantId") + .HasColumnType("char(36)"); b.Property("TypeId") .HasColumnType("char(36)"); @@ -1281,8 +1162,8 @@ namespace Marco.Pms.DataAccess.Migrations .IsRequired() .HasColumnType("longtext"); - b.Property("TenantId") - .HasColumnType("int"); + b.Property("TenantId") + .HasColumnType("char(36)"); b.HasKey("Id"); @@ -1296,7 +1177,7 @@ namespace Marco.Pms.DataAccess.Migrations IsDefault = true, Level = 1, Name = "Low", - TenantId = 1 + TenantId = new Guid("b3466e83-7e11-464c-b93a-daf047838b26") }, new { @@ -1305,7 +1186,7 @@ namespace Marco.Pms.DataAccess.Migrations IsDefault = true, Level = 2, Name = "Medium", - TenantId = 1 + TenantId = new Guid("b3466e83-7e11-464c-b93a-daf047838b26") }, new { @@ -1314,7 +1195,7 @@ namespace Marco.Pms.DataAccess.Migrations IsDefault = true, Level = 3, Name = "High", - TenantId = 1 + TenantId = new Guid("b3466e83-7e11-464c-b93a-daf047838b26") }, new { @@ -1323,7 +1204,7 @@ namespace Marco.Pms.DataAccess.Migrations IsDefault = true, Level = 4, Name = "Critical", - TenantId = 1 + TenantId = new Guid("b3466e83-7e11-464c-b93a-daf047838b26") }, new { @@ -1332,7 +1213,7 @@ namespace Marco.Pms.DataAccess.Migrations IsDefault = true, Level = 5, Name = "Urgent", - TenantId = 1 + TenantId = new Guid("b3466e83-7e11-464c-b93a-daf047838b26") }); }); @@ -1355,8 +1236,8 @@ namespace Marco.Pms.DataAccess.Migrations .IsRequired() .HasColumnType("longtext"); - b.Property("TenantId") - .HasColumnType("int"); + b.Property("TenantId") + .HasColumnType("char(36)"); b.HasKey("Id"); @@ -1370,7 +1251,7 @@ namespace Marco.Pms.DataAccess.Migrations Description = "This is a newly created issue.", IsDefault = true, Name = "New", - TenantId = 1 + TenantId = new Guid("b3466e83-7e11-464c-b93a-daf047838b26") }, new { @@ -1379,7 +1260,7 @@ namespace Marco.Pms.DataAccess.Migrations Description = "Assigned to employee or team of employees", IsDefault = true, Name = "Assigned", - TenantId = 1 + TenantId = new Guid("b3466e83-7e11-464c-b93a-daf047838b26") }, new { @@ -1388,7 +1269,7 @@ namespace Marco.Pms.DataAccess.Migrations Description = "These issues are currently in progress", IsDefault = true, Name = "In Progress", - TenantId = 1 + TenantId = new Guid("b3466e83-7e11-464c-b93a-daf047838b26") }, new { @@ -1397,7 +1278,7 @@ namespace Marco.Pms.DataAccess.Migrations Description = "These issues are currently under review", IsDefault = true, Name = "In Review", - TenantId = 1 + TenantId = new Guid("b3466e83-7e11-464c-b93a-daf047838b26") }, new { @@ -1406,17 +1287,15 @@ namespace Marco.Pms.DataAccess.Migrations Description = "The following issues are resolved and closed", IsDefault = true, Name = "Done", - TenantId = 1 + TenantId = new Guid("b3466e83-7e11-464c-b93a-daf047838b26") }); }); modelBuilder.Entity("Marco.Pms.Model.Forum.TicketTag", b => { - b.Property("Id") + b.Property("Id") .ValueGeneratedOnAdd() - .HasColumnType("int"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); + .HasColumnType("char(36)"); b.Property("TagId") .HasColumnType("char(36)"); @@ -1449,8 +1328,8 @@ namespace Marco.Pms.DataAccess.Migrations .IsRequired() .HasColumnType("longtext"); - b.Property("TenantId") - .HasColumnType("int"); + b.Property("TenantId") + .HasColumnType("char(36)"); b.HasKey("Id"); @@ -1463,7 +1342,7 @@ namespace Marco.Pms.DataAccess.Migrations ColorCode = "#e59866", IsDefault = true, Name = "Quality Issue", - TenantId = 1 + TenantId = new Guid("b3466e83-7e11-464c-b93a-daf047838b26") }, new { @@ -1471,7 +1350,7 @@ namespace Marco.Pms.DataAccess.Migrations ColorCode = "#85c1e9", IsDefault = true, Name = "Help Desk", - TenantId = 1 + TenantId = new Guid("b3466e83-7e11-464c-b93a-daf047838b26") }); }); @@ -1491,8 +1370,8 @@ namespace Marco.Pms.DataAccess.Migrations .IsRequired() .HasColumnType("longtext"); - b.Property("TenantId") - .HasColumnType("int"); + b.Property("TenantId") + .HasColumnType("char(36)"); b.HasKey("Id"); @@ -1505,7 +1384,7 @@ namespace Marco.Pms.DataAccess.Migrations Description = "An identified problem that affects the performance, reliability, or standards of a product or service", IsDefault = true, Name = "Quality Issue", - TenantId = 1 + TenantId = new Guid("b3466e83-7e11-464c-b93a-daf047838b26") }, new { @@ -1513,17 +1392,15 @@ namespace Marco.Pms.DataAccess.Migrations Description = "A support service that assists users with technical issues, requests, or inquiries.", IsDefault = true, Name = "Help Desk", - TenantId = 1 + TenantId = new Guid("b3466e83-7e11-464c-b93a-daf047838b26") }); }); modelBuilder.Entity("Marco.Pms.Model.Industries.Industry", b => { - b.Property("Id") + b.Property("Id") .ValueGeneratedOnAdd() - .HasColumnType("int"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); + .HasColumnType("char(36)"); b.Property("Name") .HasColumnType("longtext"); @@ -1535,58 +1412,56 @@ namespace Marco.Pms.DataAccess.Migrations b.HasData( new { - Id = 1, + Id = new Guid("15436ee3-a650-469e-bfc2-59993f7514bb"), Name = "Information Technology (IT) Services" }, new { - Id = 2, + Id = new Guid("0a63e657-2c5f-49b5-854b-42c978293154"), Name = "Manufacturing & Production" }, new { - Id = 3, + Id = new Guid("bdc61e3b-69ea-4394-bab6-079ec135b5bd"), Name = "Energy & Resources" }, new { - Id = 4, + Id = new Guid("5ca200ac-00d7-415e-a410-b948e27ac9d2"), Name = "Finance & Professional Services" }, new { - Id = 5, + Id = new Guid("d5621700-cd87-441f-8cdb-6051ddfc83b4"), Name = "Hospitals and Healthcare Services" }, new { - Id = 6, + Id = new Guid("23608891-657e-40f0-bbd4-2b0a2ec1a76f"), Name = "Social Services" }, new { - Id = 7, + Id = new Guid("a493f4e3-16b1-4411-be3c-6bf2987a3168"), Name = "Retail & Consumer Services" }, new { - Id = 8, + Id = new Guid("e9d8ce92-9371-4ed9-9831-83c07f78edec"), Name = "Transportation & Logistics" }, new { - Id = 9, + Id = new Guid("8a0d6134-2dbe-4e0a-b250-ff34cb7b9df0"), Name = "Education & Training" }); }); modelBuilder.Entity("Marco.Pms.Model.Projects.Building", b => { - b.Property("Id") + b.Property("Id") .ValueGeneratedOnAdd() - .HasColumnType("int"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); + .HasColumnType("char(36)"); b.Property("Description") .HasColumnType("longtext"); @@ -1595,11 +1470,11 @@ namespace Marco.Pms.DataAccess.Migrations .IsRequired() .HasColumnType("longtext"); - b.Property("ProjectId") - .HasColumnType("int"); + b.Property("ProjectId") + .HasColumnType("char(36)"); - b.Property("TenantId") - .HasColumnType("int"); + b.Property("TenantId") + .HasColumnType("char(36)"); b.HasKey("Id"); @@ -1610,21 +1485,19 @@ namespace Marco.Pms.DataAccess.Migrations modelBuilder.Entity("Marco.Pms.Model.Projects.Floor", b => { - b.Property("Id") + b.Property("Id") .ValueGeneratedOnAdd() - .HasColumnType("int"); + .HasColumnType("char(36)"); - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - - b.Property("BuildingId") - .HasColumnType("int"); + b.Property("BuildingId") + .HasColumnType("char(36)"); b.Property("FloorName") .IsRequired() .HasColumnType("longtext"); - b.Property("TenantId") - .HasColumnType("int"); + b.Property("TenantId") + .HasColumnType("char(36)"); b.HasKey("Id"); @@ -1637,11 +1510,9 @@ namespace Marco.Pms.DataAccess.Migrations modelBuilder.Entity("Marco.Pms.Model.Projects.Project", b => { - b.Property("Id") + b.Property("Id") .ValueGeneratedOnAdd() - .HasColumnType("int"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); + .HasColumnType("char(36)"); b.Property("ContactPerson") .HasColumnType("longtext"); @@ -1656,14 +1527,14 @@ namespace Marco.Pms.DataAccess.Migrations b.Property("ProjectAddress") .HasColumnType("longtext"); - b.Property("ProjectStatusId") - .HasColumnType("int"); + b.Property("ProjectStatusId") + .HasColumnType("char(36)"); b.Property("StartDate") .HasColumnType("datetime(6)"); - b.Property("TenantId") - .HasColumnType("int"); + b.Property("TenantId") + .HasColumnType("char(36)"); b.HasKey("Id"); @@ -1676,61 +1547,65 @@ namespace Marco.Pms.DataAccess.Migrations b.HasData( new { - Id = 1, + Id = new Guid("85bf587b-7ca9-4685-b77c-d817f5847e85"), ContactPerson = "Project 1 Contact Person", + EndDate = new DateTime(2026, 4, 20, 10, 11, 17, 588, DateTimeKind.Unspecified), Name = "Project 1", ProjectAddress = "Project 1 Address", - ProjectStatusId = 1, - TenantId = 1 + ProjectStatusId = new Guid("b74da4c2-d07e-46f2-9919-e75e49b12731"), + StartDate = new DateTime(2025, 4, 20, 10, 11, 17, 588, DateTimeKind.Unspecified), + TenantId = new Guid("b3466e83-7e11-464c-b93a-daf047838b26") }, new { - Id = 2, + Id = new Guid("3ef56a12-f5e5-4193-87d6-9e110ed10b86"), ContactPerson = "Project 2 Contact Person", + EndDate = new DateTime(2026, 4, 20, 10, 11, 17, 588, DateTimeKind.Unspecified), Name = "Project 2", ProjectAddress = "Project 2 Address", - ProjectStatusId = 2, - TenantId = 1 + ProjectStatusId = new Guid("ef1c356e-0fe0-42df-a5d3-8daee355492d"), + StartDate = new DateTime(2025, 4, 20, 10, 11, 17, 588, DateTimeKind.Unspecified), + TenantId = new Guid("b3466e83-7e11-464c-b93a-daf047838b26") }, new { - Id = 3, + Id = new Guid("54d013e3-0a2b-48be-85c7-5ef03492a18c"), ContactPerson = "Project 3 Contact Person", + EndDate = new DateTime(2026, 4, 20, 10, 11, 17, 588, DateTimeKind.Unspecified), Name = "Project 3", ProjectAddress = "Project 3 Address", - ProjectStatusId = 3, - TenantId = 1 + ProjectStatusId = new Guid("33deaef9-9af1-4f2a-b443-681ea0d04f81"), + StartDate = new DateTime(2025, 4, 20, 10, 11, 17, 588, DateTimeKind.Unspecified), + TenantId = new Guid("b3466e83-7e11-464c-b93a-daf047838b26") }); }); modelBuilder.Entity("Marco.Pms.Model.Projects.ProjectAllocation", b => { - b.Property("Id") + b.Property("Id") .ValueGeneratedOnAdd() - .HasColumnType("int"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); + .HasColumnType("char(36)"); b.Property("AllocationDate") .HasColumnType("datetime(6)"); - b.Property("EmployeeId") - .HasColumnType("int"); + b.Property("EmployeeId") + .HasColumnType("char(36)"); b.Property("IsActive") .HasColumnType("tinyint(1)"); - b.Property("JobRoleId") - .HasColumnType("int"); + b.Property("JobRoleId") + .HasColumnType("char(36)"); - b.Property("ProjectId") - .HasColumnType("int"); + b.Property("ProjectId") + .HasColumnType("char(36)"); b.Property("ReAllocationDate") .HasColumnType("datetime(6)"); - b.Property("TenantId") - .HasColumnType("int"); + b.Property("TenantId") + .HasColumnType("char(36)"); b.HasKey("Id"); @@ -1745,21 +1620,19 @@ namespace Marco.Pms.DataAccess.Migrations modelBuilder.Entity("Marco.Pms.Model.Projects.WorkArea", b => { - b.Property("Id") + b.Property("Id") .ValueGeneratedOnAdd() - .HasColumnType("int"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); + .HasColumnType("char(36)"); b.Property("AreaName") .IsRequired() .HasColumnType("longtext"); - b.Property("FloorId") - .HasColumnType("int"); + b.Property("FloorId") + .HasColumnType("char(36)"); - b.Property("TenantId") - .HasColumnType("int"); + b.Property("TenantId") + .HasColumnType("char(36)"); b.HasKey("Id"); @@ -1772,14 +1645,12 @@ namespace Marco.Pms.DataAccess.Migrations modelBuilder.Entity("Marco.Pms.Model.Projects.WorkItem", b => { - b.Property("Id") + b.Property("Id") .ValueGeneratedOnAdd() - .HasColumnType("int"); + .HasColumnType("char(36)"); - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - - b.Property("ActivityId") - .HasColumnType("int"); + b.Property("ActivityId") + .HasColumnType("char(36)"); b.Property("CompletedWork") .HasColumnType("double"); @@ -1790,11 +1661,11 @@ namespace Marco.Pms.DataAccess.Migrations b.Property("TaskDate") .HasColumnType("datetime(6)"); - b.Property("TenantId") - .HasColumnType("int"); + b.Property("TenantId") + .HasColumnType("char(36)"); - b.Property("WorkAreaId") - .HasColumnType("int"); + b.Property("WorkAreaId") + .HasColumnType("char(36)"); b.HasKey("Id"); @@ -1809,11 +1680,9 @@ namespace Marco.Pms.DataAccess.Migrations modelBuilder.Entity("Marco.Pms.Model.Utilities.Inquiries", b => { - b.Property("Id") + b.Property("Id") .ValueGeneratedOnAdd() - .HasColumnType("int"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); + .HasColumnType("char(36)"); b.Property("About") .HasColumnType("longtext"); @@ -1827,8 +1696,8 @@ namespace Marco.Pms.DataAccess.Migrations b.Property("Email") .HasColumnType("longtext"); - b.Property("IndustryId") - .HasColumnType("int"); + b.Property("IndustryId") + .HasColumnType("char(36)"); b.Property("OragnizationSize") .HasColumnType("longtext"); @@ -2056,8 +1925,8 @@ namespace Marco.Pms.DataAccess.Migrations b.Property("IsRootUser") .HasColumnType("tinyint(1)"); - b.Property("TenantId") - .HasColumnType("int"); + b.Property("TenantId") + .HasColumnType("char(36)"); b.HasDiscriminator().HasValue("ApplicationUser"); }); diff --git a/Marco.Pms.DataAccess/Migrations/20250326054022_initmigration.cs b/Marco.Pms.DataAccess/Migrations/20250501162003_Initmigration.cs similarity index 58% rename from Marco.Pms.DataAccess/Migrations/20250326054022_initmigration.cs rename to Marco.Pms.DataAccess/Migrations/20250501162003_Initmigration.cs index f4e52b1..fddc3ff 100644 --- a/Marco.Pms.DataAccess/Migrations/20250326054022_initmigration.cs +++ b/Marco.Pms.DataAccess/Migrations/20250501162003_Initmigration.cs @@ -9,7 +9,7 @@ using Microsoft.EntityFrameworkCore.Migrations; namespace Marco.Pms.DataAccess.Migrations { /// - public partial class initmigration : Migration + public partial class Initmigration : Migration { /// protected override void Up(MigrationBuilder migrationBuilder) @@ -17,6 +17,24 @@ namespace Marco.Pms.DataAccess.Migrations migrationBuilder.AlterDatabase() .Annotation("MySql:CharSet", "utf8mb4"); + migrationBuilder.CreateTable( + name: "ActivityCheckLists", + columns: table => new + { + Id = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), + ActivityId = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), + Description = table.Column(type: "longtext", nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + IsChecked = table.Column(type: "tinyint(1)", nullable: false), + IsMandatory = table.Column(type: "tinyint(1)", nullable: false), + TenantId = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci") + }, + constraints: table => + { + table.PrimaryKey("PK_ActivityCheckLists", x => x.Id); + }) + .Annotation("MySql:CharSet", "utf8mb4"); + migrationBuilder.CreateTable( name: "AspNetRoles", columns: table => new @@ -44,10 +62,9 @@ namespace Marco.Pms.DataAccess.Migrations .Annotation("MySql:CharSet", "utf8mb4"), Discriminator = table.Column(type: "varchar(21)", maxLength: 21, nullable: false) .Annotation("MySql:CharSet", "utf8mb4"), - Role = table.Column(type: "longtext", nullable: true) - .Annotation("MySql:CharSet", "utf8mb4"), - TenantId = table.Column(type: "int", nullable: true), + TenantId = table.Column(type: "char(36)", nullable: true, collation: "ascii_general_ci"), IsRootUser = table.Column(type: "tinyint(1)", nullable: true), + IsActive = table.Column(type: "tinyint(1)", nullable: true), UserName = table.Column(type: "varchar(256)", maxLength: 256, nullable: true) .Annotation("MySql:CharSet", "utf8mb4"), NormalizedUserName = table.Column(type: "varchar(256)", maxLength: 256, nullable: true) @@ -77,15 +94,67 @@ namespace Marco.Pms.DataAccess.Migrations }) .Annotation("MySql:CharSet", "utf8mb4"); + migrationBuilder.CreateTable( + name: "CheckListMappings", + columns: table => new + { + Id = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), + TaskAllocationId = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), + CheckListId = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci") + }, + constraints: table => + { + table.PrimaryKey("PK_CheckListMappings", x => x.Id); + }) + .Annotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.CreateTable( + name: "Industries", + columns: table => new + { + Id = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), + Name = table.Column(type: "longtext", nullable: true) + .Annotation("MySql:CharSet", "utf8mb4") + }, + constraints: table => + { + table.PrimaryKey("PK_Industries", x => x.Id); + }) + .Annotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.CreateTable( + name: "Inquiries", + columns: table => new + { + Id = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), + OrganizatioinName = table.Column(type: "longtext", nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + Email = table.Column(type: "longtext", nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + About = table.Column(type: "longtext", nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + OragnizationSize = table.Column(type: "longtext", nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + IndustryId = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), + ContactPerson = table.Column(type: "longtext", nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + ContactNumber = table.Column(type: "longtext", nullable: true) + .Annotation("MySql:CharSet", "utf8mb4") + }, + constraints: table => + { + table.PrimaryKey("PK_Inquiries", x => x.Id); + }) + .Annotation("MySql:CharSet", "utf8mb4"); + migrationBuilder.CreateTable( name: "Modules", columns: table => new { - Id = table.Column(type: "int", nullable: false) - .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), + Id = 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) + Description = table.Column(type: "longtext", nullable: true) .Annotation("MySql:CharSet", "utf8mb4"), Key = table.Column(type: "longtext", nullable: false) .Annotation("MySql:CharSet", "utf8mb4") @@ -97,26 +166,77 @@ namespace Marco.Pms.DataAccess.Migrations .Annotation("MySql:CharSet", "utf8mb4"); migrationBuilder.CreateTable( - name: "Tenants", + name: "TicketPriorityMasters", columns: table => new { - Id = table.Column(type: "int", nullable: false) - .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), + Id = 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) + Level = table.Column(type: "int", nullable: false), + ColorCode = table.Column(type: "longtext", nullable: true) .Annotation("MySql:CharSet", "utf8mb4"), - DomainName = table.Column(type: "longtext", nullable: false) - .Annotation("MySql:CharSet", "utf8mb4"), - ContactName = table.Column(type: "longtext", nullable: false) - .Annotation("MySql:CharSet", "utf8mb4"), - ContactNumber = table.Column(type: "longtext", nullable: false) - .Annotation("MySql:CharSet", "utf8mb4"), - OnBoardingDate = table.Column(type: "datetime(6)", nullable: false) + IsDefault = table.Column(type: "tinyint(1)", nullable: false), + TenantId = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci") }, constraints: table => { - table.PrimaryKey("PK_Tenants", x => x.Id); + table.PrimaryKey("PK_TicketPriorityMasters", x => x.Id); + }) + .Annotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.CreateTable( + name: "TicketStatusMasters", + columns: table => new + { + Id = 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: true) + .Annotation("MySql:CharSet", "utf8mb4"), + ColorCode = table.Column(type: "longtext", nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + IsDefault = table.Column(type: "tinyint(1)", nullable: false), + TenantId = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci") + }, + constraints: table => + { + table.PrimaryKey("PK_TicketStatusMasters", x => x.Id); + }) + .Annotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.CreateTable( + name: "TicketTagMasters", + columns: table => new + { + Id = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), + Name = table.Column(type: "longtext", nullable: false) + .Annotation("MySql:CharSet", "utf8mb4"), + ColorCode = table.Column(type: "longtext", nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + TenantId = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), + IsDefault = table.Column(type: "tinyint(1)", nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_TicketTagMasters", x => x.Id); + }) + .Annotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.CreateTable( + name: "TicketTypeMasters", + columns: table => new + { + Id = 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: true) + .Annotation("MySql:CharSet", "utf8mb4"), + IsDefault = table.Column(type: "tinyint(1)", nullable: false), + TenantId = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci") + }, + constraints: table => + { + table.PrimaryKey("PK_TicketTypeMasters", x => x.Id); }) .Annotation("MySql:CharSet", "utf8mb4"); @@ -251,11 +371,10 @@ namespace Marco.Pms.DataAccess.Migrations name: "RefreshTokens", columns: table => new { - Id = table.Column(type: "int", nullable: false) - .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), - Token = table.Column(type: "longtext", nullable: false) + Id = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), + Token = table.Column(type: "longtext", nullable: true) .Annotation("MySql:CharSet", "utf8mb4"), - UserId = table.Column(type: "varchar(255)", nullable: false) + UserId = table.Column(type: "varchar(255)", nullable: true) .Annotation("MySql:CharSet", "utf8mb4"), ExpiryDate = table.Column(type: "datetime(6)", nullable: false), IsRevoked = table.Column(type: "tinyint(1)", nullable: false), @@ -275,15 +394,47 @@ namespace Marco.Pms.DataAccess.Migrations }) .Annotation("MySql:CharSet", "utf8mb4"); + migrationBuilder.CreateTable( + name: "Tenants", + columns: table => new + { + Id = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), + Name = table.Column(type: "longtext", nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + Description = table.Column(type: "longtext", nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + DomainName = table.Column(type: "longtext", nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + ContactName = table.Column(type: "longtext", nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + ContactNumber = table.Column(type: "longtext", nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + OnBoardingDate = table.Column(type: "datetime(6)", nullable: false), + OragnizationSize = table.Column(type: "longtext", nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + IndustryId = table.Column(type: "char(36)", nullable: true, collation: "ascii_general_ci"), + IsActive = table.Column(type: "tinyint(1)", nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_Tenants", x => x.Id); + table.ForeignKey( + name: "FK_Tenants_Industries_IndustryId", + column: x => x.IndustryId, + principalTable: "Industries", + principalColumn: "Id"); + }) + .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) + ModuleId = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), + Name = table.Column(type: "longtext", nullable: true) .Annotation("MySql:CharSet", "utf8mb4"), - Description = table.Column(type: "longtext", nullable: false) + Description = table.Column(type: "longtext", nullable: true) .Annotation("MySql:CharSet", "utf8mb4"), IsActive = table.Column(type: "tinyint(1)", nullable: false) }, @@ -299,16 +450,40 @@ namespace Marco.Pms.DataAccess.Migrations }) .Annotation("MySql:CharSet", "utf8mb4"); + migrationBuilder.CreateTable( + name: "ActivityMasters", + columns: table => new + { + Id = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), + ActivityName = table.Column(type: "longtext", nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + UnitOfMeasurement = table.Column(type: "longtext", nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + IsActive = table.Column(type: "tinyint(1)", nullable: false), + TenantId = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci") + }, + constraints: table => + { + table.PrimaryKey("PK_ActivityMasters", x => x.Id); + table.ForeignKey( + name: "FK_ActivityMasters_Tenants_TenantId", + column: x => x.TenantId, + principalTable: "Tenants", + 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) + Role = table.Column(type: "longtext", nullable: true) .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) + TenantId = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci") }, constraints: table => { @@ -326,14 +501,13 @@ namespace Marco.Pms.DataAccess.Migrations name: "Buildings", columns: table => new { - Id = table.Column(type: "int", nullable: false) - .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), + Id = 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: true) .Annotation("MySql:CharSet", "utf8mb4"), - ProjectId = table.Column(type: "int", nullable: false), - TenantId = table.Column(type: "int", nullable: false) + ProjectId = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), + TenantId = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci") }, constraints: table => { @@ -347,17 +521,48 @@ namespace Marco.Pms.DataAccess.Migrations }) .Annotation("MySql:CharSet", "utf8mb4"); + migrationBuilder.CreateTable( + name: "Documents", + columns: table => new + { + Id = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), + BatchId = table.Column(type: "char(36)", nullable: true, collation: "ascii_general_ci"), + FileName = table.Column(type: "longtext", nullable: false) + .Annotation("MySql:CharSet", "utf8mb4"), + S3Key = table.Column(type: "longtext", nullable: false) + .Annotation("MySql:CharSet", "utf8mb4"), + ThumbS3Key = table.Column(type: "longtext", nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + Base64Data = table.Column(type: "longtext", nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + FileSize = table.Column(type: "bigint", nullable: false), + ContentType = table.Column(type: "longtext", nullable: false) + .Annotation("MySql:CharSet", "utf8mb4"), + UploadedAt = table.Column(type: "datetime(6)", nullable: false), + TenantId = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci") + }, + constraints: table => + { + table.PrimaryKey("PK_Documents", x => x.Id); + table.ForeignKey( + name: "FK_Documents_Tenants_TenantId", + column: x => x.TenantId, + principalTable: "Tenants", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + }) + .Annotation("MySql:CharSet", "utf8mb4"); + 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) + Id = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), + Name = table.Column(type: "longtext", nullable: true) .Annotation("MySql:CharSet", "utf8mb4"), Description = table.Column(type: "longtext", nullable: true) .Annotation("MySql:CharSet", "utf8mb4"), - TenantId = table.Column(type: "int", nullable: false) + TenantId = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci") }, constraints: table => { @@ -375,11 +580,10 @@ namespace Marco.Pms.DataAccess.Migrations name: "StatusMasters", columns: table => new { - Id = table.Column(type: "int", nullable: false) - .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), - Status = table.Column(type: "longtext", nullable: false) + Id = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), + Status = table.Column(type: "longtext", nullable: true) .Annotation("MySql:CharSet", "utf8mb4"), - TenantId = table.Column(type: "int", nullable: false) + TenantId = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci") }, constraints: table => { @@ -393,17 +597,89 @@ namespace Marco.Pms.DataAccess.Migrations }) .Annotation("MySql:CharSet", "utf8mb4"); + migrationBuilder.CreateTable( + name: "TicketComments", + columns: table => new + { + Id = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), + TicketId = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), + AuthorId = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), + MessageText = table.Column(type: "longtext", nullable: false) + .Annotation("MySql:CharSet", "utf8mb4"), + SentAt = table.Column(type: "datetime(6)", nullable: false), + ParentMessageId = table.Column(type: "char(36)", nullable: true, collation: "ascii_general_ci"), + TenantId = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci") + }, + constraints: table => + { + table.PrimaryKey("PK_TicketComments", x => x.Id); + table.ForeignKey( + name: "FK_TicketComments_Tenants_TenantId", + column: x => x.TenantId, + principalTable: "Tenants", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + }) + .Annotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.CreateTable( + name: "Tickets", + columns: table => new + { + Id = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), + Subject = table.Column(type: "longtext", nullable: false) + .Annotation("MySql:CharSet", "utf8mb4"), + Description = table.Column(type: "longtext", nullable: false) + .Annotation("MySql:CharSet", "utf8mb4"), + StatusId = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), + TypeId = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), + CreatedById = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), + CreatedAt = table.Column(type: "datetime(6)", nullable: false), + LinkedProjectId = table.Column(type: "char(36)", nullable: true, collation: "ascii_general_ci"), + LinkedActivityId = table.Column(type: "char(36)", nullable: true, collation: "ascii_general_ci"), + PriorityId = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), + TenantId = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci") + }, + constraints: table => + { + table.PrimaryKey("PK_Tickets", x => x.Id); + table.ForeignKey( + name: "FK_Tickets_Tenants_TenantId", + column: x => x.TenantId, + principalTable: "Tenants", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + table.ForeignKey( + name: "FK_Tickets_TicketPriorityMasters_PriorityId", + column: x => x.PriorityId, + principalTable: "TicketPriorityMasters", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + table.ForeignKey( + name: "FK_Tickets_TicketStatusMasters_StatusId", + column: x => x.StatusId, + principalTable: "TicketStatusMasters", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + table.ForeignKey( + name: "FK_Tickets_TicketTypeMasters_TypeId", + column: x => x.TypeId, + principalTable: "TicketTypeMasters", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + }) + .Annotation("MySql:CharSet", "utf8mb4"); + migrationBuilder.CreateTable( name: "WorkShifts", columns: table => new { - Id = table.Column(type: "int", nullable: false) - .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), - Name = table.Column(type: "longtext", nullable: false) + Id = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), + Name = table.Column(type: "longtext", nullable: true) .Annotation("MySql:CharSet", "utf8mb4"), StartTime = table.Column(type: "time(6)", nullable: false), EndTime = table.Column(type: "time(6)", nullable: false), - TenantId = table.Column(type: "int", nullable: false) + TenantId = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci") }, constraints: table => { @@ -423,9 +699,9 @@ namespace Marco.Pms.DataAccess.Migrations { 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) + Name = table.Column(type: "longtext", nullable: true) .Annotation("MySql:CharSet", "utf8mb4"), - Description = table.Column(type: "longtext", nullable: false) + Description = table.Column(type: "longtext", nullable: true) .Annotation("MySql:CharSet", "utf8mb4"), IsEnabled = table.Column(type: "tinyint(1)", nullable: false) }, @@ -445,12 +721,11 @@ namespace Marco.Pms.DataAccess.Migrations name: "Floor", columns: table => new { - Id = table.Column(type: "int", nullable: false) - .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), + Id = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), FloorName = table.Column(type: "longtext", nullable: false) .Annotation("MySql:CharSet", "utf8mb4"), - BuildingId = table.Column(type: "int", nullable: false), - TenantId = table.Column(type: "int", nullable: false) + BuildingId = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), + TenantId = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci") }, constraints: table => { @@ -474,29 +749,28 @@ namespace Marco.Pms.DataAccess.Migrations name: "Employees", columns: table => new { - Id = table.Column(type: "int", nullable: false) - .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), - FirstName = table.Column(type: "longtext", nullable: false) + Id = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), + FirstName = table.Column(type: "longtext", nullable: true) .Annotation("MySql:CharSet", "utf8mb4"), - LastName = table.Column(type: "longtext", nullable: false) + LastName = table.Column(type: "longtext", nullable: true) .Annotation("MySql:CharSet", "utf8mb4"), MiddleName = table.Column(type: "longtext", nullable: true) .Annotation("MySql:CharSet", "utf8mb4"), Email = table.Column(type: "longtext", nullable: true) .Annotation("MySql:CharSet", "utf8mb4"), - Gender = table.Column(type: "longtext", nullable: false) + Gender = table.Column(type: "longtext", nullable: true) .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) + PermanentAddress = table.Column(type: "longtext", nullable: true) .Annotation("MySql:CharSet", "utf8mb4"), - CurrentAddress = table.Column(type: "longtext", nullable: false) + CurrentAddress = table.Column(type: "longtext", nullable: true) .Annotation("MySql:CharSet", "utf8mb4"), - PhoneNumber = table.Column(type: "longtext", nullable: false) + PhoneNumber = table.Column(type: "longtext", nullable: true) .Annotation("MySql:CharSet", "utf8mb4"), - EmergencyPhoneNumber = table.Column(type: "longtext", nullable: false) + EmergencyPhoneNumber = table.Column(type: "longtext", nullable: true) .Annotation("MySql:CharSet", "utf8mb4"), - EmergencyContactPerson = table.Column(type: "longtext", nullable: false) + EmergencyContactPerson = table.Column(type: "longtext", nullable: true) .Annotation("MySql:CharSet", "utf8mb4"), AadharNumber = table.Column(type: "longtext", nullable: true) .Annotation("MySql:CharSet", "utf8mb4"), @@ -505,10 +779,10 @@ namespace Marco.Pms.DataAccess.Migrations Photo = table.Column(type: "longblob", nullable: true), ApplicationUserId = table.Column(type: "varchar(255)", nullable: true) .Annotation("MySql:CharSet", "utf8mb4"), - TenantId = table.Column(type: "int", nullable: false), 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) + JobRoleId = table.Column(type: "char(36)", nullable: true, collation: "ascii_general_ci"), + TenantId = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci") }, constraints: table => { @@ -536,18 +810,17 @@ namespace Marco.Pms.DataAccess.Migrations name: "Projects", columns: table => new { - Id = table.Column(type: "int", nullable: false) - .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), + Id = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), Name = table.Column(type: "longtext", nullable: false) .Annotation("MySql:CharSet", "utf8mb4"), - ProjectAddress = table.Column(type: "longtext", nullable: false) + ProjectAddress = table.Column(type: "longtext", nullable: true) .Annotation("MySql:CharSet", "utf8mb4"), - ContactPerson = table.Column(type: "longtext", nullable: false) + ContactPerson = table.Column(type: "longtext", nullable: true) .Annotation("MySql:CharSet", "utf8mb4"), StartDate = table.Column(type: "datetime(6)", nullable: true), EndDate = table.Column(type: "datetime(6)", nullable: true), - ProjectStatusId = table.Column(type: "int", nullable: false), - TenantId = table.Column(type: "int", nullable: false) + ProjectStatusId = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), + TenantId = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci") }, constraints: table => { @@ -567,6 +840,60 @@ namespace Marco.Pms.DataAccess.Migrations }) .Annotation("MySql:CharSet", "utf8mb4"); + migrationBuilder.CreateTable( + name: "TicketAttachments", + columns: table => new + { + Id = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), + TicketId = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), + CommentId = table.Column(type: "char(36)", nullable: true, collation: "ascii_general_ci"), + FileName = table.Column(type: "longtext", nullable: false) + .Annotation("MySql:CharSet", "utf8mb4"), + FileId = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci") + }, + constraints: table => + { + table.PrimaryKey("PK_TicketAttachments", x => x.Id); + table.ForeignKey( + name: "FK_TicketAttachments_TicketComments_CommentId", + column: x => x.CommentId, + principalTable: "TicketComments", + principalColumn: "Id"); + table.ForeignKey( + name: "FK_TicketAttachments_Tickets_TicketId", + column: x => x.TicketId, + principalTable: "Tickets", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + }) + .Annotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.CreateTable( + name: "TicketTags", + columns: table => new + { + Id = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), + TicketId = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), + TagId = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci") + }, + constraints: table => + { + table.PrimaryKey("PK_TicketTags", x => x.Id); + table.ForeignKey( + name: "FK_TicketTags_TicketTagMasters_TagId", + column: x => x.TagId, + principalTable: "TicketTagMasters", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + table.ForeignKey( + name: "FK_TicketTags_Tickets_TicketId", + column: x => x.TicketId, + principalTable: "Tickets", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + }) + .Annotation("MySql:CharSet", "utf8mb4"); + migrationBuilder.CreateTable( name: "RolePermissionMappings", columns: table => new @@ -596,12 +923,11 @@ namespace Marco.Pms.DataAccess.Migrations name: "WorkAreas", columns: table => new { - Id = table.Column(type: "int", nullable: false) - .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), + Id = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), AreaName = table.Column(type: "longtext", nullable: false) .Annotation("MySql:CharSet", "utf8mb4"), - FloorId = table.Column(type: "int", nullable: false), - TenantId = table.Column(type: "int", nullable: false) + FloorId = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), + TenantId = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci") }, constraints: table => { @@ -625,20 +951,19 @@ namespace Marco.Pms.DataAccess.Migrations name: "Attendes", columns: table => new { - Id = table.Column(type: "int", nullable: false) - .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), + Id = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), Comment = table.Column(type: "longtext", nullable: false) .Annotation("MySql:CharSet", "utf8mb4"), - EmployeeID = table.Column(type: "int", nullable: false), + EmployeeID = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), Date = table.Column(type: "datetime(6)", nullable: false), - ProjectID = table.Column(type: "int", nullable: false), + ProjectID = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), 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) + TenantId = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci") }, constraints: table => { @@ -663,10 +988,10 @@ namespace Marco.Pms.DataAccess.Migrations columns: table => new { Id = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), - EmployeeId = table.Column(type: "int", nullable: false), + EmployeeId = 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) + TenantId = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci") }, constraints: table => { @@ -696,15 +1021,14 @@ namespace Marco.Pms.DataAccess.Migrations name: "ProjectAllocations", columns: table => new { - Id = table.Column(type: "int", nullable: false) - .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), - EmployeeId = table.Column(type: "int", nullable: false), - JobRoleId = table.Column(type: "int", nullable: true), + Id = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), + EmployeeId = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), + JobRoleId = table.Column(type: "char(36)", nullable: true, collation: "ascii_general_ci"), IsActive = table.Column(type: "tinyint(1)", nullable: false), - ProjectId = table.Column(type: "int", nullable: false), + ProjectId = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), AllocationDate = table.Column(type: "datetime(6)", nullable: false), ReAllocationDate = table.Column(type: "datetime(6)", nullable: true), - TenantId = table.Column(type: "int", nullable: false) + TenantId = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci") }, constraints: table => { @@ -730,149 +1054,17 @@ namespace Marco.Pms.DataAccess.Migrations }) .Annotation("MySql:CharSet", "utf8mb4"); - migrationBuilder.CreateTable( - name: "TaskAllocations", - columns: table => new - { - Id = table.Column(type: "int", nullable: false) - .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), - EmployeeId = table.Column(type: "int", nullable: false), - EmployeeRole = table.Column(type: "int", nullable: false), - ProjectId = table.Column(type: "int", nullable: false), - BuildingId = table.Column(type: "int", nullable: false), - AllocationDate = table.Column(type: "datetime(6)", nullable: false), - ReAllocationDate = table.Column(type: "datetime(6)", nullable: false), - WorkAreaId = table.Column(type: "int", nullable: false), - TenantId = table.Column(type: "int", nullable: false) - }, - constraints: table => - { - table.PrimaryKey("PK_TaskAllocations", x => x.Id); - table.ForeignKey( - name: "FK_TaskAllocations_Buildings_BuildingId", - column: x => x.BuildingId, - principalTable: "Buildings", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); - table.ForeignKey( - name: "FK_TaskAllocations_Employees_EmployeeId", - column: x => x.EmployeeId, - principalTable: "Employees", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); - table.ForeignKey( - name: "FK_TaskAllocations_Projects_ProjectId", - column: x => x.ProjectId, - principalTable: "Projects", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); - table.ForeignKey( - name: "FK_TaskAllocations_Tenants_TenantId", - column: x => x.TenantId, - principalTable: "Tenants", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); - table.ForeignKey( - name: "FK_TaskAllocations_WorkAreas_WorkAreaId", - column: x => x.WorkAreaId, - principalTable: "WorkAreas", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); - }) - .Annotation("MySql:CharSet", "utf8mb4"); - - 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_Attendes_AttendanceId", - column: x => x.AttendanceId, - principalTable: "Attendes", - 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.CreateTable( - name: "ActivityMasters", - columns: table => new - { - Id = table.Column(type: "int", nullable: false) - .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), - ActivityName = table.Column(type: "longtext", nullable: false) - .Annotation("MySql:CharSet", "utf8mb4"), - UnitOfMeasurement = table.Column(type: "longtext", nullable: false) - .Annotation("MySql:CharSet", "utf8mb4"), - TenantId = table.Column(type: "int", nullable: false), - TaskAllocationId = table.Column(type: "int", nullable: true) - }, - constraints: table => - { - table.PrimaryKey("PK_ActivityMasters", x => x.Id); - table.ForeignKey( - name: "FK_ActivityMasters_TaskAllocations_TaskAllocationId", - column: x => x.TaskAllocationId, - principalTable: "TaskAllocations", - principalColumn: "Id"); - table.ForeignKey( - name: "FK_ActivityMasters_Tenants_TenantId", - column: x => x.TenantId, - principalTable: "Tenants", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); - }) - .Annotation("MySql:CharSet", "utf8mb4"); - migrationBuilder.CreateTable( name: "WorkItems", columns: table => new { - Id = table.Column(type: "int", nullable: false) - .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), - ActivityId = table.Column(type: "int", nullable: false), - WorkAreaId = table.Column(type: "int", nullable: false), - PlannedWork = table.Column(type: "int", nullable: false), - CompletedWork = table.Column(type: "int", nullable: false), + Id = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), + ActivityId = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), + WorkAreaId = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), + PlannedWork = table.Column(type: "double", nullable: false), + CompletedWork = table.Column(type: "double", nullable: false), TaskDate = table.Column(type: "datetime(6)", nullable: false), - TenantId = table.Column(type: "int", nullable: false) + TenantId = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci") }, constraints: table => { @@ -899,32 +1091,92 @@ namespace Marco.Pms.DataAccess.Migrations .Annotation("MySql:CharSet", "utf8mb4"); migrationBuilder.CreateTable( - name: "WorkItemMapping", + name: "AttendanceLogs", columns: table => new { - Id = table.Column(type: "int", nullable: false) - .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), - WorkAreaId = table.Column(type: "int", nullable: false), - WorkItemId = table.Column(type: "int", nullable: false), - TenantId = table.Column(type: "int", nullable: false) + Id = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), + Comment = table.Column(type: "longtext", nullable: false) + .Annotation("MySql:CharSet", "utf8mb4"), + AttendanceId = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), + EmployeeID = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), + 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: "char(36)", nullable: true, collation: "ascii_general_ci"), + DocumentId = table.Column(type: "char(36)", nullable: true, collation: "ascii_general_ci"), + TenantId = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci") }, constraints: table => { - table.PrimaryKey("PK_WorkItemMapping", x => x.Id); + table.PrimaryKey("PK_AttendanceLogs", x => x.Id); table.ForeignKey( - name: "FK_WorkItemMapping_Tenants_TenantId", + name: "FK_AttendanceLogs_Attendes_AttendanceId", + column: x => x.AttendanceId, + principalTable: "Attendes", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + table.ForeignKey( + name: "FK_AttendanceLogs_Documents_DocumentId", + column: x => x.DocumentId, + principalTable: "Documents", + principalColumn: "Id"); + 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.CreateTable( + name: "TaskAllocations", + columns: table => new + { + Id = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), + AssignmentDate = table.Column(type: "datetime(6)", nullable: false), + PlannedTask = table.Column(type: "double", nullable: false), + CompletedTask = table.Column(type: "double", nullable: false), + ReportedDate = table.Column(type: "datetime(6)", nullable: true), + Description = table.Column(type: "longtext", nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + AssignedBy = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), + WorkItemId = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), + TenantId = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci") + }, + constraints: table => + { + table.PrimaryKey("PK_TaskAllocations", x => x.Id); + table.ForeignKey( + name: "FK_TaskAllocations_Employees_AssignedBy", + column: x => x.AssignedBy, + principalTable: "Employees", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + table.ForeignKey( + name: "FK_TaskAllocations_Tenants_TenantId", column: x => x.TenantId, principalTable: "Tenants", principalColumn: "Id", onDelete: ReferentialAction.Cascade); table.ForeignKey( - name: "FK_WorkItemMapping_WorkAreas_WorkAreaId", - column: x => x.WorkAreaId, - principalTable: "WorkAreas", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); - table.ForeignKey( - name: "FK_WorkItemMapping_WorkItems_WorkItemId", + name: "FK_TaskAllocations_WorkItems_WorkItemId", column: x => x.WorkItemId, principalTable: "WorkItems", principalColumn: "Id", @@ -932,52 +1184,141 @@ namespace Marco.Pms.DataAccess.Migrations }) .Annotation("MySql:CharSet", "utf8mb4"); + migrationBuilder.CreateTable( + name: "TaskComments", + columns: table => new + { + Id = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), + TaskAllocationId = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), + CommentDate = table.Column(type: "datetime(6)", nullable: false), + Comment = table.Column(type: "longtext", nullable: false) + .Annotation("MySql:CharSet", "utf8mb4"), + CommentedBy = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), + TenantId = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci") + }, + constraints: table => + { + table.PrimaryKey("PK_TaskComments", x => x.Id); + table.ForeignKey( + name: "FK_TaskComments_Employees_CommentedBy", + column: x => x.CommentedBy, + principalTable: "Employees", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + table.ForeignKey( + name: "FK_TaskComments_TaskAllocations_TaskAllocationId", + column: x => x.TaskAllocationId, + principalTable: "TaskAllocations", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + table.ForeignKey( + name: "FK_TaskComments_Tenants_TenantId", + column: x => x.TenantId, + principalTable: "Tenants", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + }) + .Annotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.CreateTable( + name: "TaskMembers", + columns: table => new + { + Id = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), + TaskAllocationId = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), + EmployeeId = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), + TenantId = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci") + }, + constraints: table => + { + table.PrimaryKey("PK_TaskMembers", x => x.Id); + table.ForeignKey( + name: "FK_TaskMembers_Employees_EmployeeId", + column: x => x.EmployeeId, + principalTable: "Employees", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + table.ForeignKey( + name: "FK_TaskMembers_TaskAllocations_TaskAllocationId", + column: x => x.TaskAllocationId, + principalTable: "TaskAllocations", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + table.ForeignKey( + name: "FK_TaskMembers_Tenants_TenantId", + column: x => x.TenantId, + principalTable: "Tenants", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + }) + .Annotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.InsertData( + table: "Industries", + columns: new[] { "Id", "Name" }, + values: new object[,] + { + { new Guid("0a63e657-2c5f-49b5-854b-42c978293154"), "Manufacturing & Production" }, + { new Guid("15436ee3-a650-469e-bfc2-59993f7514bb"), "Information Technology (IT) Services" }, + { new Guid("23608891-657e-40f0-bbd4-2b0a2ec1a76f"), "Social Services" }, + { new Guid("5ca200ac-00d7-415e-a410-b948e27ac9d2"), "Finance & Professional Services" }, + { new Guid("8a0d6134-2dbe-4e0a-b250-ff34cb7b9df0"), "Education & Training" }, + { new Guid("a493f4e3-16b1-4411-be3c-6bf2987a3168"), "Retail & Consumer Services" }, + { new Guid("bdc61e3b-69ea-4394-bab6-079ec135b5bd"), "Energy & Resources" }, + { new Guid("d5621700-cd87-441f-8cdb-6051ddfc83b4"), "Hospitals and Healthcare Services" }, + { new Guid("e9d8ce92-9371-4ed9-9831-83c07f78edec"), "Transportation & Logistics" } + }); + 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" } + { new Guid("2a231490-bcb1-4bdd-91f1-f25fb7f25b23"), "Employee Module", "0971c7fb-6ce1-458a-ae3f-8d3205893637", "Employee" }, + { new Guid("bf59fd88-b57a-4d67-bf01-3780f385896b"), "Project Module", "b04da7e9-0406-409c-ac7f-b97256e6ea02", "Project" }, + { new Guid("c43db8c7-ab73-47f4-9d3b-f83e81357924"), "Masters Module", "504ec132-e6a9-422f-8f85-050602cfce05", "Masters" } }); migrationBuilder.InsertData( - table: "Tenants", - columns: new[] { "Id", "ContactName", "ContactNumber", "Description", "DomainName", "Name", "OnBoardingDate" }, - values: new object[] { 1, "Admin", "123456789", "", "www.marcobms.org", "MarcoBMS", new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified) }); - - migrationBuilder.InsertData( - table: "ActivityMasters", - columns: new[] { "Id", "ActivityName", "TaskAllocationId", "TenantId", "UnitOfMeasurement" }, + table: "TicketPriorityMasters", + columns: new[] { "Id", "ColorCode", "IsDefault", "Level", "Name", "TenantId" }, values: new object[,] { - { 1, "Core Cutting", null, 1, "Number" }, - { 2, "Fabrication", null, 1, "Meter" }, - { 3, "Lifting", null, 1, "Meter" }, - { 4, "Hanging", null, 1, "Meter" }, - { 5, "Tapping", null, 1, "Meter" }, - { 6, "Welding", null, 1, "Meter" }, - { 7, "Testing", null, 1, "Area" }, - { 8, "Painting", null, 1, "Meter" }, - { 9, "Marking Area", null, 1, "Meter" }, - { 10, "Drilling", null, 1, "Number" }, - { 11, "MS Support Fabrication", null, 1, "Number" }, - { 12, "MS Support Hanging", null, 1, "Number" }, - { 13, "Hydrant Volve", null, 1, "Number" }, - { 14, "Sprinkler Installation", null, 1, "Number" } + { new Guid("0919bc84-9f82-4ecf-98c7-962755dd9a97"), "FFFF00", true, 2, "Medium", new Guid("b3466e83-7e11-464c-b93a-daf047838b26") }, + { new Guid("188d29b3-10f3-42d0-9587-1a46ae7a0320"), "008000", true, 1, "Low", new Guid("b3466e83-7e11-464c-b93a-daf047838b26") }, + { new Guid("44a7b91d-a0dd-45d1-8616-4d2f71e16401"), "#FF0000", true, 5, "Urgent", new Guid("b3466e83-7e11-464c-b93a-daf047838b26") }, + { new Guid("a13b7e59-16fd-4665-b5cf-a97399e8445a"), "#FFA500", true, 3, "High", new Guid("b3466e83-7e11-464c-b93a-daf047838b26") }, + { new Guid("f340fbc3-c9fd-46aa-b063-0093418830e4"), "#FFA500", true, 4, "Critical", new Guid("b3466e83-7e11-464c-b93a-daf047838b26") } }); migrationBuilder.InsertData( - table: "ApplicationRoles", - columns: new[] { "Id", "Description", "Role", "TenantId" }, + table: "TicketStatusMasters", + columns: new[] { "Id", "ColorCode", "Description", "IsDefault", "Name", "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("5c72b630-6923-4215-bf2c-b1622afd76e7"), "#6c757d", "These issues are currently under review", true, "In Review", new Guid("b3466e83-7e11-464c-b93a-daf047838b26") }, + { new Guid("6b0c409b-3e80-4165-8b39-f3fcacb4c797"), "#FFCC99", "This is a newly created issue.", true, "New", new Guid("b3466e83-7e11-464c-b93a-daf047838b26") }, + { new Guid("6c5ac37d-5b7d-40f3-adec-2dabaa5cca86"), "#E6FF99", "Assigned to employee or team of employees", true, "Assigned", new Guid("b3466e83-7e11-464c-b93a-daf047838b26") }, + { new Guid("7f96bcd5-0c66-411b-8a1d-9d1a4785194e"), "#99E6FF", "These issues are currently in progress", true, "In Progress", new Guid("b3466e83-7e11-464c-b93a-daf047838b26") }, + { new Guid("8ff85685-a875-4f21-aa95-d99551315fcc"), "#B399FF", "The following issues are resolved and closed", true, "Done", new Guid("b3466e83-7e11-464c-b93a-daf047838b26") } + }); + + migrationBuilder.InsertData( + table: "TicketTagMasters", + columns: new[] { "Id", "ColorCode", "IsDefault", "Name", "TenantId" }, + values: new object[,] + { + { new Guid("5a168569-8ad7-4422-8db6-51ef25caddeb"), "#85c1e9", true, "Help Desk", new Guid("b3466e83-7e11-464c-b93a-daf047838b26") }, + { new Guid("ef6c2a65-f61d-4537-9650-a7ab7f8d98db"), "#e59866", true, "Quality Issue", new Guid("b3466e83-7e11-464c-b93a-daf047838b26") } + }); + + migrationBuilder.InsertData( + table: "TicketTypeMasters", + columns: new[] { "Id", "Description", "IsDefault", "Name", "TenantId" }, + values: new object[,] + { + { new Guid("c74e5480-2b71-483c-8f4a-1a9c69c32603"), "An identified problem that affects the performance, reliability, or standards of a product or service", true, "Quality Issue", new Guid("b3466e83-7e11-464c-b93a-daf047838b26") }, + { new Guid("d1f55eab-9898-4e46-9f03-b263e33e5d38"), "A support service that assists users with technical issues, requests, or inquiries.", true, "Help Desk", new Guid("b3466e83-7e11-464c-b93a-daf047838b26") } }); migrationBuilder.InsertData( @@ -985,25 +1326,33 @@ namespace Marco.Pms.DataAccess.Migrations 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" } + { new Guid("39e66f81-efc6-446c-95bd-46bff6cfb606"), "Assign and Update Tasks Progress", true, new Guid("bf59fd88-b57a-4d67-bf01-3780f385896b"), "Assign and Update Tasks Progress" }, + { new Guid("52c9cf54-1eb2-44d2-81bb-524cf29c0a94"), "Attendance", true, new Guid("2a231490-bcb1-4bdd-91f1-f25fb7f25b23"), "Attendance" }, + { new Guid("53176ebf-c75d-42e5-839f-4508ffac3def"), "Manage Project", true, new Guid("bf59fd88-b57a-4d67-bf01-3780f385896b"), "Manage Project" }, + { new Guid("660131a4-788c-4739-a082-cbbf7879cbf2"), "Tenant Masters", true, new Guid("c43db8c7-ab73-47f4-9d3b-f83e81357924"), "Tenant Masters" }, + { new Guid("81ab8a87-8ccd-4015-a917-0627cee6a100"), "Manage Employee", true, new Guid("2a231490-bcb1-4bdd-91f1-f25fb7f25b23"), "Manage Employee" }, + { new Guid("9666de86-d7c7-4d3d-acaa-fcd6d6b81f3c"), "Manage Infra", true, new Guid("bf59fd88-b57a-4d67-bf01-3780f385896b"), "Manage Infra" }, + { new Guid("9d4b5489-2079-40b9-bd77-6e1bf90bc19f"), "Manage Tasks", true, new Guid("bf59fd88-b57a-4d67-bf01-3780f385896b"), "Manage Tasks" }, + { new Guid("be3b3afc-6ccf-4566-b9b6-aafcb65546be"), "Global Masters", true, new Guid("c43db8c7-ab73-47f4-9d3b-f83e81357924"), "Global Masters" } }); migrationBuilder.InsertData( - table: "StatusMasters", - columns: new[] { "Id", "Status", "TenantId" }, + table: "Tenants", + columns: new[] { "Id", "ContactName", "ContactNumber", "Description", "DomainName", "IndustryId", "IsActive", "Name", "OnBoardingDate", "OragnizationSize" }, + values: new object[] { new Guid("b3466e83-7e11-464c-b93a-daf047838b26"), "Admin", "123456789", "", "www.marcobms.org", new Guid("15436ee3-a650-469e-bfc2-59993f7514bb"), true, "MarcoBMS", new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), "100-200" }); + + migrationBuilder.InsertData( + table: "ActivityMasters", + columns: new[] { "Id", "ActivityName", "IsActive", "TenantId", "UnitOfMeasurement" }, values: new object[,] { - { 1, "Active", 1 }, - { 2, "In Progress", 1 }, - { 3, "On Hold", 1 }, - { 4, "Completed", 1 } + { new Guid("1714f64d-7591-4419-bee5-118d21bb2855"), "Fabrication", true, new Guid("b3466e83-7e11-464c-b93a-daf047838b26"), "Meter" }, + { new Guid("4117b7de-ef6c-461f-a2c2-64eaac5f9a11"), "Core Cutting", true, new Guid("b3466e83-7e11-464c-b93a-daf047838b26"), "Number" }, + { new Guid("53eedf44-4076-445f-be93-fedef17117e7"), "MS Support Fabrication", true, new Guid("b3466e83-7e11-464c-b93a-daf047838b26"), "Number" }, + { new Guid("715b9ddb-d9e2-4afa-8987-d9918905cea4"), "MS Support Hanging", true, new Guid("b3466e83-7e11-464c-b93a-daf047838b26"), "Number" }, + { new Guid("a3d191a7-a5aa-4dd8-a525-12c99263bbd6"), "Hydrant Volve", true, new Guid("b3466e83-7e11-464c-b93a-daf047838b26"), "Number" }, + { new Guid("b3f51a93-dde6-45f9-8b22-f1bf017a640b"), "Welding", true, new Guid("b3466e83-7e11-464c-b93a-daf047838b26"), "Meter" }, + { new Guid("c138a7de-713a-4bd4-8292-b0b265be77a3"), "Sprinkler Installation", true, new Guid("b3466e83-7e11-464c-b93a-daf047838b26"), "Number" } }); migrationBuilder.InsertData( @@ -1031,21 +1380,27 @@ namespace Marco.Pms.DataAccess.Migrations { new Guid("fbd213e0-0250-46f1-9f5f-4b2a1e6e76a3"), "", new Guid("81ab8a87-8ccd-4015-a917-0627cee6a100"), true, "Assign To Project" } }); + migrationBuilder.InsertData( + table: "StatusMasters", + columns: new[] { "Id", "Status", "TenantId" }, + values: new object[,] + { + { new Guid("33deaef9-9af1-4f2a-b443-681ea0d04f81"), "Completed", new Guid("b3466e83-7e11-464c-b93a-daf047838b26") }, + { new Guid("603e994b-a27f-4e5d-a251-f3d69b0498ba"), "In Progress", new Guid("b3466e83-7e11-464c-b93a-daf047838b26") }, + { new Guid("b74da4c2-d07e-46f2-9919-e75e49b12731"), "Active", new Guid("b3466e83-7e11-464c-b93a-daf047838b26") }, + { new Guid("ef1c356e-0fe0-42df-a5d3-8daee355492d"), "On Hold", new Guid("b3466e83-7e11-464c-b93a-daf047838b26") } + }); + migrationBuilder.InsertData( table: "Projects", columns: new[] { "Id", "ContactPerson", "EndDate", "Name", "ProjectAddress", "ProjectStatusId", "StartDate", "TenantId" }, values: new object[,] { - { 1, "Project 1 Contact Person", null, "Project 1", "Project 1 Address", 1, null, 1 }, - { 2, "Project 2 Contact Person", null, "Project 2", "Project 2 Address", 2, null, 1 }, - { 3, "Project 3 Contact Person", null, "Project 3", "Project 3 Address", 3, null, 1 } + { new Guid("3ef56a12-f5e5-4193-87d6-9e110ed10b86"), "Project 2 Contact Person", new DateTime(2026, 4, 20, 10, 11, 17, 588, DateTimeKind.Unspecified), "Project 2", "Project 2 Address", new Guid("ef1c356e-0fe0-42df-a5d3-8daee355492d"), new DateTime(2025, 4, 20, 10, 11, 17, 588, DateTimeKind.Unspecified), new Guid("b3466e83-7e11-464c-b93a-daf047838b26") }, + { new Guid("54d013e3-0a2b-48be-85c7-5ef03492a18c"), "Project 3 Contact Person", new DateTime(2026, 4, 20, 10, 11, 17, 588, DateTimeKind.Unspecified), "Project 3", "Project 3 Address", new Guid("33deaef9-9af1-4f2a-b443-681ea0d04f81"), new DateTime(2025, 4, 20, 10, 11, 17, 588, DateTimeKind.Unspecified), new Guid("b3466e83-7e11-464c-b93a-daf047838b26") }, + { new Guid("85bf587b-7ca9-4685-b77c-d817f5847e85"), "Project 1 Contact Person", new DateTime(2026, 4, 20, 10, 11, 17, 588, DateTimeKind.Unspecified), "Project 1", "Project 1 Address", new Guid("b74da4c2-d07e-46f2-9919-e75e49b12731"), new DateTime(2025, 4, 20, 10, 11, 17, 588, DateTimeKind.Unspecified), new Guid("b3466e83-7e11-464c-b93a-daf047838b26") } }); - migrationBuilder.CreateIndex( - name: "IX_ActivityMasters_TaskAllocationId", - table: "ActivityMasters", - column: "TaskAllocationId"); - migrationBuilder.CreateIndex( name: "IX_ActivityMasters_TenantId", table: "ActivityMasters", @@ -1098,6 +1453,11 @@ namespace Marco.Pms.DataAccess.Migrations table: "AttendanceLogs", column: "AttendanceId"); + migrationBuilder.CreateIndex( + name: "IX_AttendanceLogs_DocumentId", + table: "AttendanceLogs", + column: "DocumentId"); + migrationBuilder.CreateIndex( name: "IX_AttendanceLogs_EmployeeID", table: "AttendanceLogs", @@ -1128,6 +1488,11 @@ namespace Marco.Pms.DataAccess.Migrations table: "Buildings", column: "TenantId"); + migrationBuilder.CreateIndex( + name: "IX_Documents_TenantId", + table: "Documents", + column: "TenantId"); + migrationBuilder.CreateIndex( name: "IX_EmployeeRoleMappings_EmployeeId", table: "EmployeeRoleMappings", @@ -1224,19 +1589,9 @@ namespace Marco.Pms.DataAccess.Migrations column: "TenantId"); migrationBuilder.CreateIndex( - name: "IX_TaskAllocations_BuildingId", + name: "IX_TaskAllocations_AssignedBy", table: "TaskAllocations", - column: "BuildingId"); - - migrationBuilder.CreateIndex( - name: "IX_TaskAllocations_EmployeeId", - table: "TaskAllocations", - column: "EmployeeId"); - - migrationBuilder.CreateIndex( - name: "IX_TaskAllocations_ProjectId", - table: "TaskAllocations", - column: "ProjectId"); + column: "AssignedBy"); migrationBuilder.CreateIndex( name: "IX_TaskAllocations_TenantId", @@ -1244,9 +1599,89 @@ namespace Marco.Pms.DataAccess.Migrations column: "TenantId"); migrationBuilder.CreateIndex( - name: "IX_TaskAllocations_WorkAreaId", + name: "IX_TaskAllocations_WorkItemId", table: "TaskAllocations", - column: "WorkAreaId"); + column: "WorkItemId"); + + migrationBuilder.CreateIndex( + name: "IX_TaskComments_CommentedBy", + table: "TaskComments", + column: "CommentedBy"); + + migrationBuilder.CreateIndex( + name: "IX_TaskComments_TaskAllocationId", + table: "TaskComments", + column: "TaskAllocationId"); + + migrationBuilder.CreateIndex( + name: "IX_TaskComments_TenantId", + table: "TaskComments", + column: "TenantId"); + + migrationBuilder.CreateIndex( + name: "IX_TaskMembers_EmployeeId", + table: "TaskMembers", + column: "EmployeeId"); + + migrationBuilder.CreateIndex( + name: "IX_TaskMembers_TaskAllocationId", + table: "TaskMembers", + column: "TaskAllocationId"); + + migrationBuilder.CreateIndex( + name: "IX_TaskMembers_TenantId", + table: "TaskMembers", + column: "TenantId"); + + migrationBuilder.CreateIndex( + name: "IX_Tenants_IndustryId", + table: "Tenants", + column: "IndustryId"); + + migrationBuilder.CreateIndex( + name: "IX_TicketAttachments_CommentId", + table: "TicketAttachments", + column: "CommentId"); + + migrationBuilder.CreateIndex( + name: "IX_TicketAttachments_TicketId", + table: "TicketAttachments", + column: "TicketId"); + + migrationBuilder.CreateIndex( + name: "IX_TicketComments_TenantId", + table: "TicketComments", + column: "TenantId"); + + migrationBuilder.CreateIndex( + name: "IX_Tickets_PriorityId", + table: "Tickets", + column: "PriorityId"); + + migrationBuilder.CreateIndex( + name: "IX_Tickets_StatusId", + table: "Tickets", + column: "StatusId"); + + migrationBuilder.CreateIndex( + name: "IX_Tickets_TenantId", + table: "Tickets", + column: "TenantId"); + + migrationBuilder.CreateIndex( + name: "IX_Tickets_TypeId", + table: "Tickets", + column: "TypeId"); + + migrationBuilder.CreateIndex( + name: "IX_TicketTags_TagId", + table: "TicketTags", + column: "TagId"); + + migrationBuilder.CreateIndex( + name: "IX_TicketTags_TicketId", + table: "TicketTags", + column: "TicketId"); migrationBuilder.CreateIndex( name: "IX_WorkAreas_FloorId", @@ -1258,21 +1693,6 @@ namespace Marco.Pms.DataAccess.Migrations table: "WorkAreas", column: "TenantId"); - migrationBuilder.CreateIndex( - name: "IX_WorkItemMapping_TenantId", - table: "WorkItemMapping", - column: "TenantId"); - - migrationBuilder.CreateIndex( - name: "IX_WorkItemMapping_WorkAreaId", - table: "WorkItemMapping", - column: "WorkAreaId"); - - migrationBuilder.CreateIndex( - name: "IX_WorkItemMapping_WorkItemId", - table: "WorkItemMapping", - column: "WorkItemId"); - migrationBuilder.CreateIndex( name: "IX_WorkItems_ActivityId", table: "WorkItems", @@ -1297,6 +1717,9 @@ namespace Marco.Pms.DataAccess.Migrations /// protected override void Down(MigrationBuilder migrationBuilder) { + migrationBuilder.DropTable( + name: "ActivityCheckLists"); + migrationBuilder.DropTable( name: "AspNetRoleClaims"); @@ -1315,9 +1738,15 @@ namespace Marco.Pms.DataAccess.Migrations migrationBuilder.DropTable( name: "AttendanceLogs"); + migrationBuilder.DropTable( + name: "CheckListMappings"); + migrationBuilder.DropTable( name: "EmployeeRoleMappings"); + migrationBuilder.DropTable( + name: "Inquiries"); + migrationBuilder.DropTable( name: "ProjectAllocations"); @@ -1328,7 +1757,16 @@ namespace Marco.Pms.DataAccess.Migrations name: "RolePermissionMappings"); migrationBuilder.DropTable( - name: "WorkItemMapping"); + name: "TaskComments"); + + migrationBuilder.DropTable( + name: "TaskMembers"); + + migrationBuilder.DropTable( + name: "TicketAttachments"); + + migrationBuilder.DropTable( + name: "TicketTags"); migrationBuilder.DropTable( name: "WorkShifts"); @@ -1339,6 +1777,12 @@ namespace Marco.Pms.DataAccess.Migrations migrationBuilder.DropTable( name: "Attendes"); + migrationBuilder.DropTable( + name: "Documents"); + + migrationBuilder.DropTable( + name: "Projects"); + migrationBuilder.DropTable( name: "ApplicationRoles"); @@ -1346,28 +1790,40 @@ namespace Marco.Pms.DataAccess.Migrations name: "FeaturePermissions"); migrationBuilder.DropTable( - name: "WorkItems"); + name: "TaskAllocations"); + + migrationBuilder.DropTable( + name: "TicketComments"); + + migrationBuilder.DropTable( + name: "TicketTagMasters"); + + migrationBuilder.DropTable( + name: "Tickets"); + + migrationBuilder.DropTable( + name: "StatusMasters"); migrationBuilder.DropTable( name: "Features"); - migrationBuilder.DropTable( - name: "ActivityMasters"); - - migrationBuilder.DropTable( - name: "Modules"); - - migrationBuilder.DropTable( - name: "TaskAllocations"); - migrationBuilder.DropTable( name: "Employees"); migrationBuilder.DropTable( - name: "Projects"); + name: "WorkItems"); migrationBuilder.DropTable( - name: "WorkAreas"); + name: "TicketPriorityMasters"); + + migrationBuilder.DropTable( + name: "TicketStatusMasters"); + + migrationBuilder.DropTable( + name: "TicketTypeMasters"); + + migrationBuilder.DropTable( + name: "Modules"); migrationBuilder.DropTable( name: "AspNetUsers"); @@ -1376,7 +1832,10 @@ namespace Marco.Pms.DataAccess.Migrations name: "JobRoles"); migrationBuilder.DropTable( - name: "StatusMasters"); + name: "ActivityMasters"); + + migrationBuilder.DropTable( + name: "WorkAreas"); migrationBuilder.DropTable( name: "Floor"); @@ -1386,6 +1845,9 @@ namespace Marco.Pms.DataAccess.Migrations migrationBuilder.DropTable( name: "Tenants"); + + migrationBuilder.DropTable( + name: "Industries"); } } } diff --git a/Marco.Pms.DataAccess/Migrations/ApplicationDbContextModelSnapshot.cs b/Marco.Pms.DataAccess/Migrations/ApplicationDbContextModelSnapshot.cs index 9b59702..900856a 100644 --- a/Marco.Pms.DataAccess/Migrations/ApplicationDbContextModelSnapshot.cs +++ b/Marco.Pms.DataAccess/Migrations/ApplicationDbContextModelSnapshot.cs @@ -24,14 +24,12 @@ namespace Marco.Pms.DataAccess.Migrations modelBuilder.Entity("Marco.Pms.Model.Activities.TaskAllocation", b => { - b.Property("Id") + b.Property("Id") .ValueGeneratedOnAdd() - .HasColumnType("bigint"); + .HasColumnType("char(36)"); - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - - b.Property("AssignedBy") - .HasColumnType("int"); + b.Property("AssignedBy") + .HasColumnType("char(36)"); b.Property("AssignmentDate") .HasColumnType("datetime(6)"); @@ -48,11 +46,11 @@ namespace Marco.Pms.DataAccess.Migrations b.Property("ReportedDate") .HasColumnType("datetime(6)"); - b.Property("TenantId") - .HasColumnType("int"); + b.Property("TenantId") + .HasColumnType("char(36)"); - b.Property("WorkItemId") - .HasColumnType("int"); + b.Property("WorkItemId") + .HasColumnType("char(36)"); b.HasKey("Id"); @@ -67,11 +65,9 @@ namespace Marco.Pms.DataAccess.Migrations modelBuilder.Entity("Marco.Pms.Model.Activities.TaskComment", b => { - b.Property("Id") + b.Property("Id") .ValueGeneratedOnAdd() - .HasColumnType("bigint"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); + .HasColumnType("char(36)"); b.Property("Comment") .IsRequired() @@ -80,14 +76,14 @@ namespace Marco.Pms.DataAccess.Migrations b.Property("CommentDate") .HasColumnType("datetime(6)"); - b.Property("CommentedBy") - .HasColumnType("int"); + b.Property("CommentedBy") + .HasColumnType("char(36)"); - b.Property("TaskAllocationId") - .HasColumnType("bigint"); + b.Property("TaskAllocationId") + .HasColumnType("char(36)"); - b.Property("TenantId") - .HasColumnType("int"); + b.Property("TenantId") + .HasColumnType("char(36)"); b.HasKey("Id"); @@ -102,20 +98,18 @@ namespace Marco.Pms.DataAccess.Migrations modelBuilder.Entity("Marco.Pms.Model.Activities.TaskMembers", b => { - b.Property("Id") + b.Property("Id") .ValueGeneratedOnAdd() - .HasColumnType("bigint"); + .HasColumnType("char(36)"); - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); + b.Property("EmployeeId") + .HasColumnType("char(36)"); - b.Property("EmployeeId") - .HasColumnType("int"); + b.Property("TaskAllocationId") + .HasColumnType("char(36)"); - b.Property("TaskAllocationId") - .HasColumnType("bigint"); - - b.Property("TenantId") - .HasColumnType("int"); + b.Property("TenantId") + .HasColumnType("char(36)"); b.HasKey("Id"); @@ -130,11 +124,9 @@ namespace Marco.Pms.DataAccess.Migrations modelBuilder.Entity("Marco.Pms.Model.AttendanceModule.Attendance", b => { - b.Property("Id") + b.Property("Id") .ValueGeneratedOnAdd() - .HasColumnType("int"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); + .HasColumnType("char(36)"); b.Property("Activity") .HasColumnType("int"); @@ -152,8 +144,8 @@ namespace Marco.Pms.DataAccess.Migrations b.Property("Date") .HasColumnType("datetime(6)"); - b.Property("EmployeeID") - .HasColumnType("int"); + b.Property("EmployeeID") + .HasColumnType("char(36)"); b.Property("InTime") .HasColumnType("datetime(6)"); @@ -164,11 +156,11 @@ namespace Marco.Pms.DataAccess.Migrations b.Property("OutTime") .HasColumnType("datetime(6)"); - b.Property("ProjectID") - .HasColumnType("int"); + b.Property("ProjectID") + .HasColumnType("char(36)"); - b.Property("TenantId") - .HasColumnType("int"); + b.Property("TenantId") + .HasColumnType("char(36)"); b.HasKey("Id"); @@ -181,11 +173,9 @@ namespace Marco.Pms.DataAccess.Migrations modelBuilder.Entity("Marco.Pms.Model.AttendanceModule.AttendanceLog", b => { - b.Property("Id") + b.Property("Id") .ValueGeneratedOnAdd() - .HasColumnType("int"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); + .HasColumnType("char(36)"); b.Property("Activity") .HasColumnType("int"); @@ -193,8 +183,8 @@ namespace Marco.Pms.DataAccess.Migrations b.Property("ActivityTime") .HasColumnType("datetime(6)"); - b.Property("AttendanceId") - .HasColumnType("int"); + b.Property("AttendanceId") + .HasColumnType("char(36)"); b.Property("Comment") .IsRequired() @@ -203,8 +193,8 @@ namespace Marco.Pms.DataAccess.Migrations b.Property("DocumentId") .HasColumnType("char(36)"); - b.Property("EmployeeID") - .HasColumnType("int"); + b.Property("EmployeeID") + .HasColumnType("char(36)"); b.Property("Latitude") .HasColumnType("longtext"); @@ -215,11 +205,11 @@ namespace Marco.Pms.DataAccess.Migrations b.Property("Photo") .HasColumnType("longblob"); - b.Property("TenantId") - .HasColumnType("int"); + b.Property("TenantId") + .HasColumnType("char(36)"); - b.Property("UpdatedBy") - .HasColumnType("int"); + b.Property("UpdatedBy") + .HasColumnType("char(36)"); b.Property("UpdatedOn") .HasColumnType("datetime(6)"); @@ -241,11 +231,9 @@ namespace Marco.Pms.DataAccess.Migrations modelBuilder.Entity("Marco.Pms.Model.Authentication.RefreshToken", b => { - b.Property("Id") + b.Property("Id") .ValueGeneratedOnAdd() - .HasColumnType("int"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); + .HasColumnType("char(36)"); b.Property("CreatedAt") .HasColumnType("datetime(6)"); @@ -302,8 +290,8 @@ namespace Marco.Pms.DataAccess.Migrations .IsRequired() .HasColumnType("longtext"); - b.Property("TenantId") - .HasColumnType("int"); + b.Property("TenantId") + .HasColumnType("char(36)"); b.Property("ThumbS3Key") .HasColumnType("longtext"); @@ -320,11 +308,9 @@ namespace Marco.Pms.DataAccess.Migrations modelBuilder.Entity("Marco.Pms.Model.Employees.Employee", b => { - b.Property("Id") + b.Property("Id") .ValueGeneratedOnAdd() - .HasColumnType("int"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); + .HasColumnType("char(36)"); b.Property("AadharNumber") .HasColumnType("longtext"); @@ -356,8 +342,8 @@ namespace Marco.Pms.DataAccess.Migrations b.Property("IsActive") .HasColumnType("tinyint(1)"); - b.Property("JobRoleId") - .HasColumnType("int"); + b.Property("JobRoleId") + .HasColumnType("char(36)"); b.Property("JoiningDate") .HasColumnType("datetime(6)"); @@ -383,8 +369,8 @@ namespace Marco.Pms.DataAccess.Migrations b.Property("RoleId") .HasColumnType("char(36)"); - b.Property("TenantId") - .HasColumnType("int"); + b.Property("TenantId") + .HasColumnType("char(36)"); b.HasKey("Id"); @@ -399,11 +385,9 @@ namespace Marco.Pms.DataAccess.Migrations modelBuilder.Entity("Marco.Pms.Model.Employees.WorkShift", b => { - b.Property("Id") + b.Property("Id") .ValueGeneratedOnAdd() - .HasColumnType("int"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); + .HasColumnType("char(36)"); b.Property("EndTime") .HasColumnType("time(6)"); @@ -414,8 +398,8 @@ namespace Marco.Pms.DataAccess.Migrations b.Property("StartTime") .HasColumnType("time(6)"); - b.Property("TenantId") - .HasColumnType("int"); + b.Property("TenantId") + .HasColumnType("char(36)"); b.HasKey("Id"); @@ -426,14 +410,12 @@ namespace Marco.Pms.DataAccess.Migrations modelBuilder.Entity("Marco.Pms.Model.Entitlements.ActivityCheckList", b => { - b.Property("Id") + b.Property("Id") .ValueGeneratedOnAdd() - .HasColumnType("int"); + .HasColumnType("char(36)"); - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - - b.Property("ActivityId") - .HasColumnType("int"); + b.Property("ActivityId") + .HasColumnType("char(36)"); b.Property("Description") .HasColumnType("longtext"); @@ -444,8 +426,8 @@ namespace Marco.Pms.DataAccess.Migrations b.Property("IsMandatory") .HasColumnType("tinyint(1)"); - b.Property("TenantId") - .HasColumnType("int"); + b.Property("TenantId") + .HasColumnType("char(36)"); b.HasKey("Id"); @@ -454,11 +436,9 @@ namespace Marco.Pms.DataAccess.Migrations modelBuilder.Entity("Marco.Pms.Model.Entitlements.ActivityMaster", b => { - b.Property("Id") + b.Property("Id") .ValueGeneratedOnAdd() - .HasColumnType("int"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); + .HasColumnType("char(36)"); b.Property("ActivityName") .HasColumnType("longtext"); @@ -466,8 +446,8 @@ namespace Marco.Pms.DataAccess.Migrations b.Property("IsActive") .HasColumnType("tinyint(1)"); - b.Property("TenantId") - .HasColumnType("int"); + b.Property("TenantId") + .HasColumnType("char(36)"); b.Property("UnitOfMeasurement") .HasColumnType("longtext"); @@ -481,114 +461,58 @@ namespace Marco.Pms.DataAccess.Migrations b.HasData( new { - Id = 1, + Id = new Guid("4117b7de-ef6c-461f-a2c2-64eaac5f9a11"), ActivityName = "Core Cutting", IsActive = true, - TenantId = 1, + TenantId = new Guid("b3466e83-7e11-464c-b93a-daf047838b26"), UnitOfMeasurement = "Number" }, new { - Id = 2, + Id = new Guid("1714f64d-7591-4419-bee5-118d21bb2855"), ActivityName = "Fabrication", IsActive = true, - TenantId = 1, + TenantId = new Guid("b3466e83-7e11-464c-b93a-daf047838b26"), UnitOfMeasurement = "Meter" }, new { - Id = 3, - ActivityName = "Lifting", - IsActive = true, - TenantId = 1, - UnitOfMeasurement = "Meter" - }, - new - { - Id = 4, - ActivityName = "Hanging", - IsActive = true, - TenantId = 1, - UnitOfMeasurement = "Meter" - }, - new - { - Id = 5, - ActivityName = "Tapping", - IsActive = true, - TenantId = 1, - UnitOfMeasurement = "Meter" - }, - new - { - Id = 6, + Id = new Guid("b3f51a93-dde6-45f9-8b22-f1bf017a640b"), ActivityName = "Welding", IsActive = true, - TenantId = 1, + TenantId = new Guid("b3466e83-7e11-464c-b93a-daf047838b26"), UnitOfMeasurement = "Meter" }, new { - Id = 7, - ActivityName = "Testing", - IsActive = true, - TenantId = 1, - UnitOfMeasurement = "Area" - }, - new - { - Id = 8, - ActivityName = "Painting", - IsActive = true, - TenantId = 1, - UnitOfMeasurement = "Meter" - }, - new - { - Id = 9, - ActivityName = "Marking Area", - IsActive = true, - TenantId = 1, - UnitOfMeasurement = "Meter" - }, - new - { - Id = 10, - ActivityName = "Drilling", - IsActive = true, - TenantId = 1, - UnitOfMeasurement = "Number" - }, - new - { - Id = 11, + Id = new Guid("53eedf44-4076-445f-be93-fedef17117e7"), ActivityName = "MS Support Fabrication", IsActive = true, - TenantId = 1, + TenantId = new Guid("b3466e83-7e11-464c-b93a-daf047838b26"), UnitOfMeasurement = "Number" }, new { - Id = 12, + Id = new Guid("715b9ddb-d9e2-4afa-8987-d9918905cea4"), ActivityName = "MS Support Hanging", IsActive = true, - TenantId = 1, + TenantId = new Guid("b3466e83-7e11-464c-b93a-daf047838b26"), UnitOfMeasurement = "Number" }, new { - Id = 13, + Id = new Guid("a3d191a7-a5aa-4dd8-a525-12c99263bbd6"), ActivityName = "Hydrant Volve", IsActive = true, - TenantId = 1, + TenantId = new Guid("b3466e83-7e11-464c-b93a-daf047838b26"), UnitOfMeasurement = "Number" }, new { - Id = 14, + Id = new Guid("c138a7de-713a-4bd4-8292-b0b265be77a3"), ActivityName = "Sprinkler Installation", IsActive = true, - TenantId = 1, + TenantId = new Guid("b3466e83-7e11-464c-b93a-daf047838b26"), UnitOfMeasurement = "Number" }); }); @@ -605,66 +529,27 @@ namespace Marco.Pms.DataAccess.Migrations b.Property("Role") .HasColumnType("longtext"); - b.Property("TenantId") - .HasColumnType("int"); + b.Property("TenantId") + .HasColumnType("char(36)"); 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.CheckListMappings", b => { - b.Property("Id") + b.Property("Id") .ValueGeneratedOnAdd() - .HasColumnType("int"); + .HasColumnType("char(36)"); - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); + b.Property("CheckListId") + .HasColumnType("char(36)"); - b.Property("CheckListId") - .HasColumnType("int"); - - b.Property("TaskAllocationId") - .HasColumnType("bigint"); + b.Property("TaskAllocationId") + .HasColumnType("char(36)"); b.HasKey("Id"); @@ -677,8 +562,8 @@ namespace Marco.Pms.DataAccess.Migrations .ValueGeneratedOnAdd() .HasColumnType("char(36)"); - b.Property("EmployeeId") - .HasColumnType("int"); + b.Property("EmployeeId") + .HasColumnType("char(36)"); b.Property("IsEnabled") .HasColumnType("tinyint(1)"); @@ -686,8 +571,8 @@ namespace Marco.Pms.DataAccess.Migrations b.Property("RoleId") .HasColumnType("char(36)"); - b.Property("TenantId") - .HasColumnType("int"); + b.Property("TenantId") + .HasColumnType("char(36)"); b.HasKey("Id"); @@ -712,8 +597,8 @@ namespace Marco.Pms.DataAccess.Migrations b.Property("IsActive") .HasColumnType("tinyint(1)"); - b.Property("ModuleId") - .HasColumnType("int"); + b.Property("ModuleId") + .HasColumnType("char(36)"); b.Property("Name") .HasColumnType("longtext"); @@ -730,7 +615,7 @@ namespace Marco.Pms.DataAccess.Migrations Id = new Guid("53176ebf-c75d-42e5-839f-4508ffac3def"), Description = "Manage Project", IsActive = true, - ModuleId = 1, + ModuleId = new Guid("bf59fd88-b57a-4d67-bf01-3780f385896b"), Name = "Manage Project" }, new @@ -738,7 +623,7 @@ namespace Marco.Pms.DataAccess.Migrations Id = new Guid("9666de86-d7c7-4d3d-acaa-fcd6d6b81f3c"), Description = "Manage Infra", IsActive = true, - ModuleId = 1, + ModuleId = new Guid("bf59fd88-b57a-4d67-bf01-3780f385896b"), Name = "Manage Infra" }, new @@ -746,7 +631,7 @@ namespace Marco.Pms.DataAccess.Migrations Id = new Guid("9d4b5489-2079-40b9-bd77-6e1bf90bc19f"), Description = "Manage Tasks", IsActive = true, - ModuleId = 1, + ModuleId = new Guid("bf59fd88-b57a-4d67-bf01-3780f385896b"), Name = "Manage Tasks" }, new @@ -754,7 +639,7 @@ namespace Marco.Pms.DataAccess.Migrations Id = new Guid("39e66f81-efc6-446c-95bd-46bff6cfb606"), Description = "Assign and Update Tasks Progress", IsActive = true, - ModuleId = 1, + ModuleId = new Guid("bf59fd88-b57a-4d67-bf01-3780f385896b"), Name = "Assign and Update Tasks Progress" }, new @@ -762,7 +647,7 @@ namespace Marco.Pms.DataAccess.Migrations Id = new Guid("81ab8a87-8ccd-4015-a917-0627cee6a100"), Description = "Manage Employee", IsActive = true, - ModuleId = 2, + ModuleId = new Guid("2a231490-bcb1-4bdd-91f1-f25fb7f25b23"), Name = "Manage Employee" }, new @@ -770,7 +655,7 @@ namespace Marco.Pms.DataAccess.Migrations Id = new Guid("52c9cf54-1eb2-44d2-81bb-524cf29c0a94"), Description = "Attendance", IsActive = true, - ModuleId = 2, + ModuleId = new Guid("2a231490-bcb1-4bdd-91f1-f25fb7f25b23"), Name = "Attendance" }, new @@ -778,7 +663,7 @@ namespace Marco.Pms.DataAccess.Migrations Id = new Guid("be3b3afc-6ccf-4566-b9b6-aafcb65546be"), Description = "Global Masters", IsActive = true, - ModuleId = 3, + ModuleId = new Guid("c43db8c7-ab73-47f4-9d3b-f83e81357924"), Name = "Global Masters" }, new @@ -786,7 +671,7 @@ namespace Marco.Pms.DataAccess.Migrations Id = new Guid("660131a4-788c-4739-a082-cbbf7879cbf2"), Description = "Tenant Masters", IsActive = true, - ModuleId = 3, + ModuleId = new Guid("c43db8c7-ab73-47f4-9d3b-f83e81357924"), Name = "Tenant Masters" }); }); @@ -964,11 +849,9 @@ namespace Marco.Pms.DataAccess.Migrations modelBuilder.Entity("Marco.Pms.Model.Entitlements.JobRole", b => { - b.Property("Id") + b.Property("Id") .ValueGeneratedOnAdd() - .HasColumnType("int"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); + .HasColumnType("char(36)"); b.Property("Description") .HasColumnType("longtext"); @@ -976,8 +859,8 @@ namespace Marco.Pms.DataAccess.Migrations b.Property("Name") .HasColumnType("longtext"); - b.Property("TenantId") - .HasColumnType("int"); + b.Property("TenantId") + .HasColumnType("char(36)"); b.HasKey("Id"); @@ -988,11 +871,9 @@ namespace Marco.Pms.DataAccess.Migrations modelBuilder.Entity("Marco.Pms.Model.Entitlements.Module", b => { - b.Property("Id") + b.Property("Id") .ValueGeneratedOnAdd() - .HasColumnType("int"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); + .HasColumnType("char(36)"); b.Property("Description") .HasColumnType("longtext"); @@ -1012,21 +893,21 @@ namespace Marco.Pms.DataAccess.Migrations b.HasData( new { - Id = 1, + Id = new Guid("bf59fd88-b57a-4d67-bf01-3780f385896b"), Description = "Project Module", Key = "b04da7e9-0406-409c-ac7f-b97256e6ea02", Name = "Project" }, new { - Id = 2, + Id = new Guid("2a231490-bcb1-4bdd-91f1-f25fb7f25b23"), Description = "Employee Module", Key = "0971c7fb-6ce1-458a-ae3f-8d3205893637", Name = "Employee" }, new { - Id = 3, + Id = new Guid("c43db8c7-ab73-47f4-9d3b-f83e81357924"), Description = "Masters Module", Key = "504ec132-e6a9-422f-8f85-050602cfce05", Name = "Masters" @@ -1050,17 +931,15 @@ namespace Marco.Pms.DataAccess.Migrations modelBuilder.Entity("Marco.Pms.Model.Entitlements.StatusMaster", b => { - b.Property("Id") + b.Property("Id") .ValueGeneratedOnAdd() - .HasColumnType("int"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); + .HasColumnType("char(36)"); b.Property("Status") .HasColumnType("longtext"); - b.Property("TenantId") - .HasColumnType("int"); + b.Property("TenantId") + .HasColumnType("char(36)"); b.HasKey("Id"); @@ -1071,37 +950,35 @@ namespace Marco.Pms.DataAccess.Migrations b.HasData( new { - Id = 1, + Id = new Guid("b74da4c2-d07e-46f2-9919-e75e49b12731"), Status = "Active", - TenantId = 1 + TenantId = new Guid("b3466e83-7e11-464c-b93a-daf047838b26") }, new { - Id = 2, + Id = new Guid("603e994b-a27f-4e5d-a251-f3d69b0498ba"), Status = "In Progress", - TenantId = 1 + TenantId = new Guid("b3466e83-7e11-464c-b93a-daf047838b26") }, new { - Id = 3, + Id = new Guid("ef1c356e-0fe0-42df-a5d3-8daee355492d"), Status = "On Hold", - TenantId = 1 + TenantId = new Guid("b3466e83-7e11-464c-b93a-daf047838b26") }, new { - Id = 4, + Id = new Guid("33deaef9-9af1-4f2a-b443-681ea0d04f81"), Status = "Completed", - TenantId = 1 + TenantId = new Guid("b3466e83-7e11-464c-b93a-daf047838b26") }); }); modelBuilder.Entity("Marco.Pms.Model.Entitlements.Tenant", b => { - b.Property("Id") + b.Property("Id") .ValueGeneratedOnAdd() - .HasColumnType("int"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); + .HasColumnType("char(36)"); b.Property("ContactName") .HasColumnType("longtext"); @@ -1115,8 +992,8 @@ namespace Marco.Pms.DataAccess.Migrations b.Property("DomainName") .HasColumnType("longtext"); - b.Property("IndustryId") - .HasColumnType("int"); + b.Property("IndustryId") + .HasColumnType("char(36)"); b.Property("IsActive") .HasColumnType("tinyint(1)"); @@ -1139,15 +1016,16 @@ namespace Marco.Pms.DataAccess.Migrations b.HasData( new { - Id = 1, + Id = new Guid("b3466e83-7e11-464c-b93a-daf047838b26"), ContactName = "Admin", ContactNumber = "123456789", Description = "", DomainName = "www.marcobms.org", - IndustryId = 1, + IndustryId = new Guid("15436ee3-a650-469e-bfc2-59993f7514bb"), IsActive = true, Name = "MarcoBMS", - OnBoardingDate = new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified) + OnBoardingDate = new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), + OragnizationSize = "100-200" }); }); @@ -1198,8 +1076,8 @@ namespace Marco.Pms.DataAccess.Migrations b.Property("SentAt") .HasColumnType("datetime(6)"); - b.Property("TenantId") - .HasColumnType("int"); + b.Property("TenantId") + .HasColumnType("char(36)"); b.Property("TicketId") .HasColumnType("char(36)"); @@ -1220,18 +1098,18 @@ namespace Marco.Pms.DataAccess.Migrations b.Property("CreatedAt") .HasColumnType("datetime(6)"); - b.Property("CreatedById") - .HasColumnType("int"); + b.Property("CreatedById") + .HasColumnType("char(36)"); b.Property("Description") .IsRequired() .HasColumnType("longtext"); - b.Property("LinkedActivityId") - .HasColumnType("int"); + b.Property("LinkedActivityId") + .HasColumnType("char(36)"); - b.Property("LinkedProjectId") - .HasColumnType("int"); + b.Property("LinkedProjectId") + .HasColumnType("char(36)"); b.Property("PriorityId") .HasColumnType("char(36)"); @@ -1243,8 +1121,8 @@ namespace Marco.Pms.DataAccess.Migrations .IsRequired() .HasColumnType("longtext"); - b.Property("TenantId") - .HasColumnType("int"); + b.Property("TenantId") + .HasColumnType("char(36)"); b.Property("TypeId") .HasColumnType("char(36)"); @@ -1281,8 +1159,8 @@ namespace Marco.Pms.DataAccess.Migrations .IsRequired() .HasColumnType("longtext"); - b.Property("TenantId") - .HasColumnType("int"); + b.Property("TenantId") + .HasColumnType("char(36)"); b.HasKey("Id"); @@ -1296,7 +1174,7 @@ namespace Marco.Pms.DataAccess.Migrations IsDefault = true, Level = 1, Name = "Low", - TenantId = 1 + TenantId = new Guid("b3466e83-7e11-464c-b93a-daf047838b26") }, new { @@ -1305,7 +1183,7 @@ namespace Marco.Pms.DataAccess.Migrations IsDefault = true, Level = 2, Name = "Medium", - TenantId = 1 + TenantId = new Guid("b3466e83-7e11-464c-b93a-daf047838b26") }, new { @@ -1314,7 +1192,7 @@ namespace Marco.Pms.DataAccess.Migrations IsDefault = true, Level = 3, Name = "High", - TenantId = 1 + TenantId = new Guid("b3466e83-7e11-464c-b93a-daf047838b26") }, new { @@ -1323,7 +1201,7 @@ namespace Marco.Pms.DataAccess.Migrations IsDefault = true, Level = 4, Name = "Critical", - TenantId = 1 + TenantId = new Guid("b3466e83-7e11-464c-b93a-daf047838b26") }, new { @@ -1332,7 +1210,7 @@ namespace Marco.Pms.DataAccess.Migrations IsDefault = true, Level = 5, Name = "Urgent", - TenantId = 1 + TenantId = new Guid("b3466e83-7e11-464c-b93a-daf047838b26") }); }); @@ -1355,8 +1233,8 @@ namespace Marco.Pms.DataAccess.Migrations .IsRequired() .HasColumnType("longtext"); - b.Property("TenantId") - .HasColumnType("int"); + b.Property("TenantId") + .HasColumnType("char(36)"); b.HasKey("Id"); @@ -1370,7 +1248,7 @@ namespace Marco.Pms.DataAccess.Migrations Description = "This is a newly created issue.", IsDefault = true, Name = "New", - TenantId = 1 + TenantId = new Guid("b3466e83-7e11-464c-b93a-daf047838b26") }, new { @@ -1379,7 +1257,7 @@ namespace Marco.Pms.DataAccess.Migrations Description = "Assigned to employee or team of employees", IsDefault = true, Name = "Assigned", - TenantId = 1 + TenantId = new Guid("b3466e83-7e11-464c-b93a-daf047838b26") }, new { @@ -1388,7 +1266,7 @@ namespace Marco.Pms.DataAccess.Migrations Description = "These issues are currently in progress", IsDefault = true, Name = "In Progress", - TenantId = 1 + TenantId = new Guid("b3466e83-7e11-464c-b93a-daf047838b26") }, new { @@ -1397,7 +1275,7 @@ namespace Marco.Pms.DataAccess.Migrations Description = "These issues are currently under review", IsDefault = true, Name = "In Review", - TenantId = 1 + TenantId = new Guid("b3466e83-7e11-464c-b93a-daf047838b26") }, new { @@ -1406,17 +1284,15 @@ namespace Marco.Pms.DataAccess.Migrations Description = "The following issues are resolved and closed", IsDefault = true, Name = "Done", - TenantId = 1 + TenantId = new Guid("b3466e83-7e11-464c-b93a-daf047838b26") }); }); modelBuilder.Entity("Marco.Pms.Model.Forum.TicketTag", b => { - b.Property("Id") + b.Property("Id") .ValueGeneratedOnAdd() - .HasColumnType("int"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); + .HasColumnType("char(36)"); b.Property("TagId") .HasColumnType("char(36)"); @@ -1449,8 +1325,8 @@ namespace Marco.Pms.DataAccess.Migrations .IsRequired() .HasColumnType("longtext"); - b.Property("TenantId") - .HasColumnType("int"); + b.Property("TenantId") + .HasColumnType("char(36)"); b.HasKey("Id"); @@ -1463,7 +1339,7 @@ namespace Marco.Pms.DataAccess.Migrations ColorCode = "#e59866", IsDefault = true, Name = "Quality Issue", - TenantId = 1 + TenantId = new Guid("b3466e83-7e11-464c-b93a-daf047838b26") }, new { @@ -1471,7 +1347,7 @@ namespace Marco.Pms.DataAccess.Migrations ColorCode = "#85c1e9", IsDefault = true, Name = "Help Desk", - TenantId = 1 + TenantId = new Guid("b3466e83-7e11-464c-b93a-daf047838b26") }); }); @@ -1491,8 +1367,8 @@ namespace Marco.Pms.DataAccess.Migrations .IsRequired() .HasColumnType("longtext"); - b.Property("TenantId") - .HasColumnType("int"); + b.Property("TenantId") + .HasColumnType("char(36)"); b.HasKey("Id"); @@ -1505,7 +1381,7 @@ namespace Marco.Pms.DataAccess.Migrations Description = "An identified problem that affects the performance, reliability, or standards of a product or service", IsDefault = true, Name = "Quality Issue", - TenantId = 1 + TenantId = new Guid("b3466e83-7e11-464c-b93a-daf047838b26") }, new { @@ -1513,17 +1389,15 @@ namespace Marco.Pms.DataAccess.Migrations Description = "A support service that assists users with technical issues, requests, or inquiries.", IsDefault = true, Name = "Help Desk", - TenantId = 1 + TenantId = new Guid("b3466e83-7e11-464c-b93a-daf047838b26") }); }); modelBuilder.Entity("Marco.Pms.Model.Industries.Industry", b => { - b.Property("Id") + b.Property("Id") .ValueGeneratedOnAdd() - .HasColumnType("int"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); + .HasColumnType("char(36)"); b.Property("Name") .HasColumnType("longtext"); @@ -1535,58 +1409,56 @@ namespace Marco.Pms.DataAccess.Migrations b.HasData( new { - Id = 1, + Id = new Guid("15436ee3-a650-469e-bfc2-59993f7514bb"), Name = "Information Technology (IT) Services" }, new { - Id = 2, + Id = new Guid("0a63e657-2c5f-49b5-854b-42c978293154"), Name = "Manufacturing & Production" }, new { - Id = 3, + Id = new Guid("bdc61e3b-69ea-4394-bab6-079ec135b5bd"), Name = "Energy & Resources" }, new { - Id = 4, + Id = new Guid("5ca200ac-00d7-415e-a410-b948e27ac9d2"), Name = "Finance & Professional Services" }, new { - Id = 5, + Id = new Guid("d5621700-cd87-441f-8cdb-6051ddfc83b4"), Name = "Hospitals and Healthcare Services" }, new { - Id = 6, + Id = new Guid("23608891-657e-40f0-bbd4-2b0a2ec1a76f"), Name = "Social Services" }, new { - Id = 7, + Id = new Guid("a493f4e3-16b1-4411-be3c-6bf2987a3168"), Name = "Retail & Consumer Services" }, new { - Id = 8, + Id = new Guid("e9d8ce92-9371-4ed9-9831-83c07f78edec"), Name = "Transportation & Logistics" }, new { - Id = 9, + Id = new Guid("8a0d6134-2dbe-4e0a-b250-ff34cb7b9df0"), Name = "Education & Training" }); }); modelBuilder.Entity("Marco.Pms.Model.Projects.Building", b => { - b.Property("Id") + b.Property("Id") .ValueGeneratedOnAdd() - .HasColumnType("int"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); + .HasColumnType("char(36)"); b.Property("Description") .HasColumnType("longtext"); @@ -1595,11 +1467,11 @@ namespace Marco.Pms.DataAccess.Migrations .IsRequired() .HasColumnType("longtext"); - b.Property("ProjectId") - .HasColumnType("int"); + b.Property("ProjectId") + .HasColumnType("char(36)"); - b.Property("TenantId") - .HasColumnType("int"); + b.Property("TenantId") + .HasColumnType("char(36)"); b.HasKey("Id"); @@ -1610,21 +1482,19 @@ namespace Marco.Pms.DataAccess.Migrations modelBuilder.Entity("Marco.Pms.Model.Projects.Floor", b => { - b.Property("Id") + b.Property("Id") .ValueGeneratedOnAdd() - .HasColumnType("int"); + .HasColumnType("char(36)"); - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - - b.Property("BuildingId") - .HasColumnType("int"); + b.Property("BuildingId") + .HasColumnType("char(36)"); b.Property("FloorName") .IsRequired() .HasColumnType("longtext"); - b.Property("TenantId") - .HasColumnType("int"); + b.Property("TenantId") + .HasColumnType("char(36)"); b.HasKey("Id"); @@ -1637,11 +1507,9 @@ namespace Marco.Pms.DataAccess.Migrations modelBuilder.Entity("Marco.Pms.Model.Projects.Project", b => { - b.Property("Id") + b.Property("Id") .ValueGeneratedOnAdd() - .HasColumnType("int"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); + .HasColumnType("char(36)"); b.Property("ContactPerson") .HasColumnType("longtext"); @@ -1656,14 +1524,14 @@ namespace Marco.Pms.DataAccess.Migrations b.Property("ProjectAddress") .HasColumnType("longtext"); - b.Property("ProjectStatusId") - .HasColumnType("int"); + b.Property("ProjectStatusId") + .HasColumnType("char(36)"); b.Property("StartDate") .HasColumnType("datetime(6)"); - b.Property("TenantId") - .HasColumnType("int"); + b.Property("TenantId") + .HasColumnType("char(36)"); b.HasKey("Id"); @@ -1676,61 +1544,65 @@ namespace Marco.Pms.DataAccess.Migrations b.HasData( new { - Id = 1, + Id = new Guid("85bf587b-7ca9-4685-b77c-d817f5847e85"), ContactPerson = "Project 1 Contact Person", + EndDate = new DateTime(2026, 4, 20, 10, 11, 17, 588, DateTimeKind.Unspecified), Name = "Project 1", ProjectAddress = "Project 1 Address", - ProjectStatusId = 1, - TenantId = 1 + ProjectStatusId = new Guid("b74da4c2-d07e-46f2-9919-e75e49b12731"), + StartDate = new DateTime(2025, 4, 20, 10, 11, 17, 588, DateTimeKind.Unspecified), + TenantId = new Guid("b3466e83-7e11-464c-b93a-daf047838b26") }, new { - Id = 2, + Id = new Guid("3ef56a12-f5e5-4193-87d6-9e110ed10b86"), ContactPerson = "Project 2 Contact Person", + EndDate = new DateTime(2026, 4, 20, 10, 11, 17, 588, DateTimeKind.Unspecified), Name = "Project 2", ProjectAddress = "Project 2 Address", - ProjectStatusId = 2, - TenantId = 1 + ProjectStatusId = new Guid("ef1c356e-0fe0-42df-a5d3-8daee355492d"), + StartDate = new DateTime(2025, 4, 20, 10, 11, 17, 588, DateTimeKind.Unspecified), + TenantId = new Guid("b3466e83-7e11-464c-b93a-daf047838b26") }, new { - Id = 3, + Id = new Guid("54d013e3-0a2b-48be-85c7-5ef03492a18c"), ContactPerson = "Project 3 Contact Person", + EndDate = new DateTime(2026, 4, 20, 10, 11, 17, 588, DateTimeKind.Unspecified), Name = "Project 3", ProjectAddress = "Project 3 Address", - ProjectStatusId = 3, - TenantId = 1 + ProjectStatusId = new Guid("33deaef9-9af1-4f2a-b443-681ea0d04f81"), + StartDate = new DateTime(2025, 4, 20, 10, 11, 17, 588, DateTimeKind.Unspecified), + TenantId = new Guid("b3466e83-7e11-464c-b93a-daf047838b26") }); }); modelBuilder.Entity("Marco.Pms.Model.Projects.ProjectAllocation", b => { - b.Property("Id") + b.Property("Id") .ValueGeneratedOnAdd() - .HasColumnType("int"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); + .HasColumnType("char(36)"); b.Property("AllocationDate") .HasColumnType("datetime(6)"); - b.Property("EmployeeId") - .HasColumnType("int"); + b.Property("EmployeeId") + .HasColumnType("char(36)"); b.Property("IsActive") .HasColumnType("tinyint(1)"); - b.Property("JobRoleId") - .HasColumnType("int"); + b.Property("JobRoleId") + .HasColumnType("char(36)"); - b.Property("ProjectId") - .HasColumnType("int"); + b.Property("ProjectId") + .HasColumnType("char(36)"); b.Property("ReAllocationDate") .HasColumnType("datetime(6)"); - b.Property("TenantId") - .HasColumnType("int"); + b.Property("TenantId") + .HasColumnType("char(36)"); b.HasKey("Id"); @@ -1745,21 +1617,19 @@ namespace Marco.Pms.DataAccess.Migrations modelBuilder.Entity("Marco.Pms.Model.Projects.WorkArea", b => { - b.Property("Id") + b.Property("Id") .ValueGeneratedOnAdd() - .HasColumnType("int"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); + .HasColumnType("char(36)"); b.Property("AreaName") .IsRequired() .HasColumnType("longtext"); - b.Property("FloorId") - .HasColumnType("int"); + b.Property("FloorId") + .HasColumnType("char(36)"); - b.Property("TenantId") - .HasColumnType("int"); + b.Property("TenantId") + .HasColumnType("char(36)"); b.HasKey("Id"); @@ -1772,14 +1642,12 @@ namespace Marco.Pms.DataAccess.Migrations modelBuilder.Entity("Marco.Pms.Model.Projects.WorkItem", b => { - b.Property("Id") + b.Property("Id") .ValueGeneratedOnAdd() - .HasColumnType("int"); + .HasColumnType("char(36)"); - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - - b.Property("ActivityId") - .HasColumnType("int"); + b.Property("ActivityId") + .HasColumnType("char(36)"); b.Property("CompletedWork") .HasColumnType("double"); @@ -1790,11 +1658,11 @@ namespace Marco.Pms.DataAccess.Migrations b.Property("TaskDate") .HasColumnType("datetime(6)"); - b.Property("TenantId") - .HasColumnType("int"); + b.Property("TenantId") + .HasColumnType("char(36)"); - b.Property("WorkAreaId") - .HasColumnType("int"); + b.Property("WorkAreaId") + .HasColumnType("char(36)"); b.HasKey("Id"); @@ -1809,11 +1677,9 @@ namespace Marco.Pms.DataAccess.Migrations modelBuilder.Entity("Marco.Pms.Model.Utilities.Inquiries", b => { - b.Property("Id") + b.Property("Id") .ValueGeneratedOnAdd() - .HasColumnType("int"); - - MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); + .HasColumnType("char(36)"); b.Property("About") .HasColumnType("longtext"); @@ -1827,8 +1693,8 @@ namespace Marco.Pms.DataAccess.Migrations b.Property("Email") .HasColumnType("longtext"); - b.Property("IndustryId") - .HasColumnType("int"); + b.Property("IndustryId") + .HasColumnType("char(36)"); b.Property("OragnizationSize") .HasColumnType("longtext"); @@ -2056,8 +1922,8 @@ namespace Marco.Pms.DataAccess.Migrations b.Property("IsRootUser") .HasColumnType("tinyint(1)"); - b.Property("TenantId") - .HasColumnType("int"); + b.Property("TenantId") + .HasColumnType("char(36)"); b.HasDiscriminator().HasValue("ApplicationUser"); }); diff --git a/Marco.Pms.Model/Activities/TaskAllocation.cs b/Marco.Pms.Model/Activities/TaskAllocation.cs index 98580be..3347cef 100644 --- a/Marco.Pms.Model/Activities/TaskAllocation.cs +++ b/Marco.Pms.Model/Activities/TaskAllocation.cs @@ -1,15 +1,15 @@ using System.ComponentModel.DataAnnotations.Schema; using Marco.Pms.Model.Employees; -using Marco.Pms.Model.Entitlements; using Marco.Pms.Model.Projects; +using Marco.Pms.Model.Utilities; using Microsoft.AspNetCore.Mvc.ModelBinding.Validation; namespace Marco.Pms.Model.Activities { - public class TaskAllocation + public class TaskAllocation : TenantRelation { - public long Id { get; set; } + public Guid Id { get; set; } public DateTime AssignmentDate { get; set; } @@ -24,20 +24,15 @@ namespace Marco.Pms.Model.Activities //[ValidateNever] //public WorkItemMapping? WorkItemMapping { get; set; } - public int AssignedBy { get; set; } //Employee Id + public Guid AssignedBy { get; set; } //Employee Id [ForeignKey("AssignedBy")] [ValidateNever] public Employee? Employee { get; set; } - public int WorkItemId { get; set; } + public Guid WorkItemId { get; set; } [ForeignKey("WorkItemId")] [ValidateNever] public WorkItem? WorkItem { get; set; } - public int TenantId { get; set; } - - [ValidateNever] - [ForeignKey(nameof(TenantId))] - public Tenant? Tenant { get; set; } } } diff --git a/Marco.Pms.Model/Activities/TaskComment.cs b/Marco.Pms.Model/Activities/TaskComment.cs index 2c7d2d0..e90e848 100644 --- a/Marco.Pms.Model/Activities/TaskComment.cs +++ b/Marco.Pms.Model/Activities/TaskComment.cs @@ -5,22 +5,22 @@ using Microsoft.AspNetCore.Mvc.ModelBinding.Validation; namespace Marco.Pms.Model.Activities { - public class TaskComment : TenantTest + public class TaskComment : TenantRelation { - public long Id { get; set; } + public Guid Id { get; set; } - public long TaskAllocationId { get; set; } + public Guid TaskAllocationId { get; set; } [ValidateNever] [ForeignKey(nameof(TaskAllocationId))] public TaskAllocation? TaskAllocation { get; set; } public DateTime CommentDate { get; set; } public string Comment { get; set; } = string.Empty; - public int CommentedBy { get; set; } + public Guid CommentedBy { get; set; } [ForeignKey("CommentedBy")] [ValidateNever] public Employee? Employee { get; set; } - + } } diff --git a/Marco.Pms.Model/Activities/TaskImages.cs b/Marco.Pms.Model/Activities/TaskImages.cs index fd82c18..6171ae2 100644 --- a/Marco.Pms.Model/Activities/TaskImages.cs +++ b/Marco.Pms.Model/Activities/TaskImages.cs @@ -1,13 +1,13 @@ -using Microsoft.AspNetCore.Mvc.ModelBinding.Validation; -using System.ComponentModel.DataAnnotations.Schema; +using System.ComponentModel.DataAnnotations.Schema; +using Microsoft.AspNetCore.Mvc.ModelBinding.Validation; namespace Marco.Pms.Model.Activities { public class TaskImages { - public long Id { get; set; } + public Guid Id { get; set; } - public long TaskAllocationId { get; set; } + public Guid TaskAllocationId { get; set; } [ValidateNever] [ForeignKey(nameof(TaskAllocationId))] public TaskAllocation? TaskAllocation { get; set; } diff --git a/Marco.Pms.Model/Activities/TaskMembers.cs b/Marco.Pms.Model/Activities/TaskMembers.cs index bafdb49..f2c198d 100644 --- a/Marco.Pms.Model/Activities/TaskMembers.cs +++ b/Marco.Pms.Model/Activities/TaskMembers.cs @@ -1,27 +1,22 @@ using System.ComponentModel.DataAnnotations.Schema; using Marco.Pms.Model.Employees; -using Marco.Pms.Model.Entitlements; +using Marco.Pms.Model.Utilities; using Microsoft.AspNetCore.Mvc.ModelBinding.Validation; namespace Marco.Pms.Model.Activities { - public class TaskMembers + public class TaskMembers : TenantRelation { - public long Id { get; set; } + public Guid Id { get; set; } - public long TaskAllocationId { get; set; } + public Guid TaskAllocationId { get; set; } [ValidateNever] [ForeignKey(nameof(TaskAllocationId))] public TaskAllocation? TaskAllocation { get; set; } - public int EmployeeId { get; set; } + public Guid EmployeeId { get; set; } [ForeignKey("EmployeeId")] [ValidateNever] public Employee? Employee { get; set; } - public int TenantId { get; set; } - - [ValidateNever] - [ForeignKey(nameof(TenantId))] - public Tenant? Tenant { get; set; } } } diff --git a/Marco.Pms.Model/AttendanceModule/Attendance.cs b/Marco.Pms.Model/AttendanceModule/Attendance.cs index 67c2110..102934e 100644 --- a/Marco.Pms.Model/AttendanceModule/Attendance.cs +++ b/Marco.Pms.Model/AttendanceModule/Attendance.cs @@ -1,21 +1,20 @@ -using System.ComponentModel; -using System.ComponentModel.DataAnnotations.Schema; +using System.ComponentModel.DataAnnotations.Schema; using Marco.Pms.Model.Dtos.Attendance; using Marco.Pms.Model.Employees; -using Marco.Pms.Model.Entitlements; +using Marco.Pms.Model.Utilities; using Microsoft.AspNetCore.Mvc.ModelBinding.Validation; namespace Marco.Pms.Model.AttendanceModule { - public class Attendance + public class Attendance : TenantRelation { - public int Id { get; set; } + public Guid Id { get; set; } public string Comment { get; set; } = string.Empty; - public int EmployeeID { get; set; } + public Guid EmployeeID { get; set; } public DateTime Date { get; set; } - public int ProjectID { get; set; } + public Guid ProjectID { get; set; } public DateTime AttendanceDate { get; set; } public DateTime? InTime { get; set; } @@ -27,13 +26,5 @@ namespace Marco.Pms.Model.AttendanceModule [ForeignKey("EmployeeID")] [ValidateNever] public Employee? Approver { get; set; } - - - [DisplayName("TenantId")] - public int TenantId { get; set; } - [ValidateNever] - [ForeignKey(nameof(TenantId))] - public Tenant? Tenant { get; set; } - } } diff --git a/Marco.Pms.Model/AttendanceModule/AttendanceLog.cs b/Marco.Pms.Model/AttendanceModule/AttendanceLog.cs index 5a01aba..a032a8c 100644 --- a/Marco.Pms.Model/AttendanceModule/AttendanceLog.cs +++ b/Marco.Pms.Model/AttendanceModule/AttendanceLog.cs @@ -1,24 +1,23 @@ -using System.ComponentModel; -using System.ComponentModel.DataAnnotations.Schema; +using System.ComponentModel.DataAnnotations.Schema; using Marco.Pms.Model.DocumentManager; using Marco.Pms.Model.Dtos.Attendance; using Marco.Pms.Model.Employees; -using Marco.Pms.Model.Entitlements; +using Marco.Pms.Model.Utilities; using Microsoft.AspNetCore.Mvc.ModelBinding.Validation; namespace Marco.Pms.Model.AttendanceModule { - public class AttendanceLog + public class AttendanceLog : TenantRelation { - public int Id { get; set; } + public Guid Id { get; set; } public string Comment { get; set; } = string.Empty; - public int AttendanceId { get; set; } + public Guid AttendanceId { get; set; } [ForeignKey("AttendanceId")] [ValidateNever] public Attendance? Attendance { get; set; } - public int EmployeeID { get; set; } + public Guid EmployeeID { get; set; } [ForeignKey("EmployeeID")] [ValidateNever] public Employee? Employee { get; set; } @@ -37,7 +36,7 @@ namespace Marco.Pms.Model.AttendanceModule public DateTime UpdatedOn { get; set; } - public int? UpdatedBy { get; set; } + public Guid? UpdatedBy { get; set; } [ForeignKey("UpdatedBy")] [ValidateNever] public Employee? UpdatedByEmployee { get; set; } @@ -47,10 +46,5 @@ namespace Marco.Pms.Model.AttendanceModule [ValidateNever] public Document? Document { get; set; } - [DisplayName("TenantId")] - public int TenantId { get; set; } - [ValidateNever] - [ForeignKey(nameof(TenantId))] - public Tenant? Tenant { get; set; } } } diff --git a/Marco.Pms.Model/Authentication/RefreshToken.cs b/Marco.Pms.Model/Authentication/RefreshToken.cs index b60c5ae..2c0d177 100644 --- a/Marco.Pms.Model/Authentication/RefreshToken.cs +++ b/Marco.Pms.Model/Authentication/RefreshToken.cs @@ -4,7 +4,7 @@ namespace Marco.Pms.Model.Authentication { public class RefreshToken { - public int Id { get; set; } + public Guid Id { get; set; } public string? Token { get; set; } public string? UserId { get; set; } public DateTime ExpiryDate { get; set; } diff --git a/Marco.Pms.Model/DocumentManager/Document.cs b/Marco.Pms.Model/DocumentManager/Document.cs index 3161513..3652774 100644 --- a/Marco.Pms.Model/DocumentManager/Document.cs +++ b/Marco.Pms.Model/DocumentManager/Document.cs @@ -1,10 +1,8 @@ -using System.ComponentModel.DataAnnotations.Schema; -using Marco.Pms.Model.Entitlements; -using Microsoft.AspNetCore.Mvc.ModelBinding.Validation; +using Marco.Pms.Model.Utilities; namespace Marco.Pms.Model.DocumentManager { - public class Document + public class Document : TenantRelation { public Guid Id { get; set; } public Guid? BatchId { get; set; } @@ -23,11 +21,5 @@ namespace Marco.Pms.Model.DocumentManager public long FileSize { get; set; } public string ContentType { get; set; } = string.Empty; public DateTime UploadedAt { get; set; } - - public int TenantId { get; set; } - - [ValidateNever] - [ForeignKey(nameof(TenantId))] - public Tenant? Tenant { get; set; } } } diff --git a/Marco.Pms.Model/Dtos/Activities/AssignTaskDto.cs b/Marco.Pms.Model/Dtos/Activities/AssignTaskDto.cs index b068e63..671902e 100644 --- a/Marco.Pms.Model/Dtos/Activities/AssignTaskDto.cs +++ b/Marco.Pms.Model/Dtos/Activities/AssignTaskDto.cs @@ -5,8 +5,8 @@ public DateTime AssignmentDate { get; set; } public double PlannedTask { get; set; } public string? Description { get; set; } - public List? TaskTeam { get; set; } //Employee Ids - public int WorkItemId { get; set; } + public List? TaskTeam { get; set; } //Employee Ids + public Guid WorkItemId { get; set; } } } diff --git a/Marco.Pms.Model/Dtos/Activities/CreateCheckListDto.cs b/Marco.Pms.Model/Dtos/Activities/CreateCheckListDto.cs index 0e0bbd2..2ef79dc 100644 --- a/Marco.Pms.Model/Dtos/Activities/CreateCheckListDto.cs +++ b/Marco.Pms.Model/Dtos/Activities/CreateCheckListDto.cs @@ -2,7 +2,7 @@ { public class CreateCheckListDto { - public int Id { get; set; } + public Guid? Id { get; set; } public string? Description { get; set; } public bool IsMandatory { get; set; } } diff --git a/Marco.Pms.Model/Dtos/Activities/CreateCommentDto.cs b/Marco.Pms.Model/Dtos/Activities/CreateCommentDto.cs index e31aedd..9a2518c 100644 --- a/Marco.Pms.Model/Dtos/Activities/CreateCommentDto.cs +++ b/Marco.Pms.Model/Dtos/Activities/CreateCommentDto.cs @@ -2,7 +2,7 @@ { public class CreateCommentDto { - public long TaskAllocationId { get; set; } + public Guid TaskAllocationId { get; set; } public DateTime CommentDate { get; set; } public string? Comment { get; set; } diff --git a/Marco.Pms.Model/Dtos/Activities/ReportCheckListDto.cs b/Marco.Pms.Model/Dtos/Activities/ReportCheckListDto.cs index b6b1a3f..4f3d8df 100644 --- a/Marco.Pms.Model/Dtos/Activities/ReportCheckListDto.cs +++ b/Marco.Pms.Model/Dtos/Activities/ReportCheckListDto.cs @@ -2,8 +2,8 @@ { public class ReportCheckListDto { - public int Id { get; set; } - public string Description { get; set; }= string.Empty; + public Guid Id { get; set; } + public string Description { get; set; } = string.Empty; public bool IsMandatory { get; set; } public bool IsChecked { get; set; } } diff --git a/Marco.Pms.Model/Dtos/Activities/ReportTaskDto.cs b/Marco.Pms.Model/Dtos/Activities/ReportTaskDto.cs index 07f38ff..551f024 100644 --- a/Marco.Pms.Model/Dtos/Activities/ReportTaskDto.cs +++ b/Marco.Pms.Model/Dtos/Activities/ReportTaskDto.cs @@ -2,7 +2,7 @@ { public class ReportTaskDto { - public long Id { get; set; } + public Guid Id { get; set; } public double CompletedTask { get; set; } public DateTime ReportedDate { get; set; } public string? Comment { get; set; } diff --git a/Marco.Pms.Model/Dtos/Attendance/RecordAttendanceDot.cs b/Marco.Pms.Model/Dtos/Attendance/RecordAttendanceDot.cs index d750861..14967e8 100644 --- a/Marco.Pms.Model/Dtos/Attendance/RecordAttendanceDot.cs +++ b/Marco.Pms.Model/Dtos/Attendance/RecordAttendanceDot.cs @@ -4,10 +4,10 @@ namespace Marco.Pms.Model.Dtos.Attendance { public class RecordAttendanceDot { - public int? Id { get; set; } + public Guid? Id { get; set; } public string? Comment { get; set; } - public int EmployeeID { get; set; } - public int ProjectID { get; set; } + public Guid EmployeeID { get; set; } + public Guid ProjectID { get; set; } public DateTime Date { get; set; } diff --git a/Marco.Pms.Model/Dtos/Employees/ApplicationUserDto.cs b/Marco.Pms.Model/Dtos/Employees/ApplicationUserDto.cs index ba9f471..39dc865 100644 --- a/Marco.Pms.Model/Dtos/Employees/ApplicationUserDto.cs +++ b/Marco.Pms.Model/Dtos/Employees/ApplicationUserDto.cs @@ -1,9 +1,8 @@ -using Marco.Pms.Model.Employees; -using Microsoft.AspNetCore.Http; +using Microsoft.AspNetCore.Http; namespace Marco.Pms.Model.Dtos.Employees { - public class ApplicationUserDto + public class ApplicationUserDto { public ApplicationUserDto() { } public int? Id { get; set; } @@ -32,7 +31,7 @@ namespace Marco.Pms.Model.Dtos.Employees public Guid RoleId { get; set; } - public int TenantId { get; set; } + public Guid TenantId { get; set; } } } diff --git a/Marco.Pms.Model/Dtos/Employees/CreateUserDto.cs b/Marco.Pms.Model/Dtos/Employees/CreateUserDto.cs index da35cab..13ddffb 100644 --- a/Marco.Pms.Model/Dtos/Employees/CreateUserDto.cs +++ b/Marco.Pms.Model/Dtos/Employees/CreateUserDto.cs @@ -2,7 +2,7 @@ { public class CreateUserDto { - public int Id { get; set; } + public Guid? Id { get; set; } public string? FirstName { get; set; } public string? LastName { get; set; } public string? MiddleName { get; set; } @@ -13,7 +13,7 @@ public string? JoiningDate { get; set; } public string? PermanentAddress { get; set; } - public string? CurrentAddress { get; set; } + public string? CurrentAddress { get; set; } public string? PhoneNumber { get; set; } public string? EmergencyPhoneNumber { get; set; } @@ -26,17 +26,17 @@ //public IFormFile? Photo { get; set; } // To store the captured photo //public List? Documents { get; set; } - public string? JobRoleId { get; set; } + public Guid? JobRoleId { get; set; } - // public int TenantId { get; set; } + // public int TenantId { get; set; } } public class CreateQuickUserDto { - public int Id { get; set; } + public Guid Id { get; set; } public string? FirstName { get; set; } - public string? LastName { get; set; } + public string? LastName { get; set; } - public string? Gender { get; set; } + public string? Gender { get; set; } public string? CurrentAddress { get; set; } public string? PhoneNumber { get; set; } @@ -44,7 +44,7 @@ public string? EmergencyPhoneNumber { get; set; } public string? EmergencyContactPerson { get; set; } - public string? JobRoleId { get; set; } + public Guid? JobRoleId { get; set; } } } diff --git a/Marco.Pms.Model/Dtos/Employees/EmployeeRoleDot.cs b/Marco.Pms.Model/Dtos/Employees/EmployeeRoleDot.cs index 48c1873..db114da 100644 --- a/Marco.Pms.Model/Dtos/Employees/EmployeeRoleDot.cs +++ b/Marco.Pms.Model/Dtos/Employees/EmployeeRoleDot.cs @@ -4,7 +4,7 @@ { public string Id { get; set; } = string.Empty; - public int EmployeeId { get; set; } + public Guid EmployeeId { get; set; } public Guid RoleId { get; set; } public bool IsEnabled { get; set; } } diff --git a/Marco.Pms.Model/Dtos/Forum/CreateTicketDto.cs b/Marco.Pms.Model/Dtos/Forum/CreateTicketDto.cs index 57b7cee..9b6479a 100644 --- a/Marco.Pms.Model/Dtos/Forum/CreateTicketDto.cs +++ b/Marco.Pms.Model/Dtos/Forum/CreateTicketDto.cs @@ -6,10 +6,10 @@ public string Description { get; set; } = string.Empty; public Guid StatusId { get; set; } public Guid TypeId { get; set; } // QualityIssue, HelpDesk, Feedback - public int CreatedById { get; set; } + public Guid CreatedById { get; set; } public DateTime CreatedAt { get; set; } - public int LinkedProjectId { get; set; } - public int? LinkedActivityId { get; set; } // task or project ID + public Guid? LinkedProjectId { get; set; } + public Guid? LinkedActivityId { get; set; } // task or project ID public ICollection? Attachments { get; set; } public Guid PriorityId { get; set; } public ICollection? TagIds { get; set; } diff --git a/Marco.Pms.Model/Dtos/Forum/TicketPriorityMasterDto.cs b/Marco.Pms.Model/Dtos/Forum/TicketPriorityMasterDto.cs index ddadf60..80412ec 100644 --- a/Marco.Pms.Model/Dtos/Forum/TicketPriorityMasterDto.cs +++ b/Marco.Pms.Model/Dtos/Forum/TicketPriorityMasterDto.cs @@ -7,6 +7,5 @@ public int Level { get; set; } // 1 = Low, 2 = Medium... public string? ColorCode { get; set; } public bool IsDefault { get; set; } - public int TenantId { get; set; } } } diff --git a/Marco.Pms.Model/Dtos/Forum/TicketStatusMasterDto.cs b/Marco.Pms.Model/Dtos/Forum/TicketStatusMasterDto.cs index cb786ab..90657d4 100644 --- a/Marco.Pms.Model/Dtos/Forum/TicketStatusMasterDto.cs +++ b/Marco.Pms.Model/Dtos/Forum/TicketStatusMasterDto.cs @@ -7,6 +7,5 @@ public string? Description { get; set; } public string? ColorCode { get; set; } // e.g., "#FF0000" public bool IsDefault { get; set; } // true for system defaults - public int TenantId { get; set; } } } diff --git a/Marco.Pms.Model/Dtos/Forum/TicketTagMasterDto.cs b/Marco.Pms.Model/Dtos/Forum/TicketTagMasterDto.cs index 21c7e02..b2c3e27 100644 --- a/Marco.Pms.Model/Dtos/Forum/TicketTagMasterDto.cs +++ b/Marco.Pms.Model/Dtos/Forum/TicketTagMasterDto.cs @@ -5,7 +5,6 @@ public Guid Id { get; set; } public string Name { get; set; } = string.Empty; // e.g., "Bug", "UI", "Urgent" public string? ColorCode { get; set; } - public int TenantId { get; set; } public bool IsDefault { get; set; } } } diff --git a/Marco.Pms.Model/Dtos/Forum/TicketTypeMasterDto.cs b/Marco.Pms.Model/Dtos/Forum/TicketTypeMasterDto.cs index ad3dd78..5752bae 100644 --- a/Marco.Pms.Model/Dtos/Forum/TicketTypeMasterDto.cs +++ b/Marco.Pms.Model/Dtos/Forum/TicketTypeMasterDto.cs @@ -6,6 +6,5 @@ public string Name { get; set; } = string.Empty; // e.g., "Quality Issue" public string? Description { get; set; } public bool IsDefault { get; set; } // true for system defaults - public int TenantId { get; set; } } } diff --git a/Marco.Pms.Model/Dtos/Forum/UpdateTicketDto.cs b/Marco.Pms.Model/Dtos/Forum/UpdateTicketDto.cs index 730b9c7..66fa1e8 100644 --- a/Marco.Pms.Model/Dtos/Forum/UpdateTicketDto.cs +++ b/Marco.Pms.Model/Dtos/Forum/UpdateTicketDto.cs @@ -14,6 +14,5 @@ public ICollection? Attachments { get; set; } public Guid PriorityId { get; set; } public ICollection? TagIds { get; set; } - public int TenantId { get; set; } } } diff --git a/Marco.Pms.Model/Dtos/Project/BuildingDot.cs b/Marco.Pms.Model/Dtos/Project/BuildingDot.cs index 18756c7..a5b160b 100644 --- a/Marco.Pms.Model/Dtos/Project/BuildingDot.cs +++ b/Marco.Pms.Model/Dtos/Project/BuildingDot.cs @@ -6,14 +6,11 @@ namespace Marco.Pms.Model.Dtos.Project public class BuildingDot { [Key] - public int Id { get; set; } + public Guid? Id { get; set; } [Required] [DisplayName("Building Name")] public string? Name { get; set; } public string? Description { get; set; } - public int ProjectId { get; set; } - - [DisplayName("TenantId")] - public int TenantId { get; set; } + public Guid ProjectId { get; set; } } } diff --git a/Marco.Pms.Model/Dtos/Project/BuildingVM.cs b/Marco.Pms.Model/Dtos/Project/BuildingVM.cs index b9a0bd9..40f6ea2 100644 --- a/Marco.Pms.Model/Dtos/Project/BuildingVM.cs +++ b/Marco.Pms.Model/Dtos/Project/BuildingVM.cs @@ -4,7 +4,7 @@ namespace Marco.Pms.Model.Dtos.Project { public class BuildingVM { - public int Id { get; set; } + public Guid Id { get; set; } public string? Name { get; set; } public string? Description { get; set; } diff --git a/Marco.Pms.Model/Dtos/Project/CreateProjectDto.cs b/Marco.Pms.Model/Dtos/Project/CreateProjectDto.cs index 85abcee..46474d0 100644 --- a/Marco.Pms.Model/Dtos/Project/CreateProjectDto.cs +++ b/Marco.Pms.Model/Dtos/Project/CreateProjectDto.cs @@ -5,7 +5,6 @@ namespace Marco.Pms.Model.Dtos.Project { public class CreateProjectDto { - //public int Id { get; set; } [Required(ErrorMessage = "Project Name is required!")] [DisplayName("Project Name")] public string? Name { get; set; } @@ -24,8 +23,6 @@ namespace Marco.Pms.Model.Dtos.Project [DisplayName("Project Status")] [Required(ErrorMessage = "Project Status is required!")] - public int ProjectStatusId { get; set; } - - public int TenantId { get; set; } + public Guid ProjectStatusId { get; set; } } } diff --git a/Marco.Pms.Model/Dtos/Project/FloorDot.cs b/Marco.Pms.Model/Dtos/Project/FloorDot.cs index c6f4885..a3d1c86 100644 --- a/Marco.Pms.Model/Dtos/Project/FloorDot.cs +++ b/Marco.Pms.Model/Dtos/Project/FloorDot.cs @@ -5,17 +5,14 @@ namespace Marco.Pms.Model.Dtos.Project { public class FloorDot { - public int Id { get; set; } + public Guid? Id { get; set; } [Required] [DisplayName("Floor Name")] public string? FloorName { get; set; } - public int BuildingId { get; set; } + public Guid BuildingId { get; set; } - - [DisplayName("TenantId")] - public int TenantId { get; set; } } } diff --git a/Marco.Pms.Model/Dtos/Project/FloorsVM.cs b/Marco.Pms.Model/Dtos/Project/FloorsVM.cs index 05d936c..6674629 100644 --- a/Marco.Pms.Model/Dtos/Project/FloorsVM.cs +++ b/Marco.Pms.Model/Dtos/Project/FloorsVM.cs @@ -5,7 +5,7 @@ namespace Marco.Pms.Model.Dtos.Project { public class FloorsVM { - public int Id { get; set; } + public Guid Id { get; set; } [Required] [DisplayName("Floor Name")] diff --git a/Marco.Pms.Model/Dtos/Project/ProjectAllocationDot.cs b/Marco.Pms.Model/Dtos/Project/ProjectAllocationDot.cs index 6d5604e..1634a84 100644 --- a/Marco.Pms.Model/Dtos/Project/ProjectAllocationDot.cs +++ b/Marco.Pms.Model/Dtos/Project/ProjectAllocationDot.cs @@ -2,9 +2,9 @@ { public class ProjectAllocationDot { - public int EmpID { get; set; } - public int JobRoleId { get; set; } - public int ProjectId { get; set; } + public Guid EmpID { get; set; } + public Guid JobRoleId { get; set; } + public Guid ProjectId { get; set; } public bool Status { get; set; } } diff --git a/Marco.Pms.Model/Dtos/Project/ProjectDto.cs b/Marco.Pms.Model/Dtos/Project/ProjectDto.cs index 3daa757..1e0af72 100644 --- a/Marco.Pms.Model/Dtos/Project/ProjectDto.cs +++ b/Marco.Pms.Model/Dtos/Project/ProjectDto.cs @@ -4,8 +4,8 @@ using System.ComponentModel.DataAnnotations; namespace Marco.Pms.Model.Dtos.Project { public class ProjectDto - { - public int Id { get; set; } + { + public Guid Id { get; set; } [Required(ErrorMessage = "Project Name is required!")] [DisplayName("Project Name")] public string? Name { get; set; } @@ -24,8 +24,7 @@ namespace Marco.Pms.Model.Dtos.Project [DisplayName("Project Status")] [Required(ErrorMessage = "Project Status is required!")] - public int ProjectStatusId { get; set; } - public int TenantId { get; set; } + public Guid ProjectStatusId { get; set; } } diff --git a/Marco.Pms.Model/Dtos/Project/UpdateProjectDto.cs b/Marco.Pms.Model/Dtos/Project/UpdateProjectDto.cs index d3ac144..e527836 100644 --- a/Marco.Pms.Model/Dtos/Project/UpdateProjectDto.cs +++ b/Marco.Pms.Model/Dtos/Project/UpdateProjectDto.cs @@ -5,7 +5,7 @@ namespace Marco.Pms.Model.Dtos.Project { public class UpdateProjectDto { - public int Id { get; set; } + public Guid Id { get; set; } [Required(ErrorMessage = "Project Name is required!")] [DisplayName("Project Name")] public string? Name { get; set; } @@ -24,8 +24,6 @@ namespace Marco.Pms.Model.Dtos.Project [DisplayName("Project Status")] [Required(ErrorMessage = "Project Status is required!")] - public int ProjectStatusId { get; set; } - - public int TenantId { get; set; } + public Guid ProjectStatusId { get; set; } } } diff --git a/Marco.Pms.Model/Dtos/Project/WorkAreaDot.cs b/Marco.Pms.Model/Dtos/Project/WorkAreaDot.cs index 8cf8d98..604ee3e 100644 --- a/Marco.Pms.Model/Dtos/Project/WorkAreaDot.cs +++ b/Marco.Pms.Model/Dtos/Project/WorkAreaDot.cs @@ -6,16 +6,13 @@ namespace Marco.Pms.Model.Dtos.Project public class WorkAreaDot { [Key] - public int Id { get; set; } + public Guid? Id { get; set; } [Required] [DisplayName("Area Name")] public string? AreaName { get; set; } - public int FloorId { get; set; } - - [DisplayName("TenantId")] - public int TenantId { get; set; } + public Guid FloorId { get; set; } } } diff --git a/Marco.Pms.Model/Dtos/Project/WorkAreaVM.cs b/Marco.Pms.Model/Dtos/Project/WorkAreaVM.cs index 9fc27ba..127fe4b 100644 --- a/Marco.Pms.Model/Dtos/Project/WorkAreaVM.cs +++ b/Marco.Pms.Model/Dtos/Project/WorkAreaVM.cs @@ -5,7 +5,7 @@ namespace Marco.Pms.Model.Dtos.Project { public class WorkAreaVM { - public int Id { get; set; } + public Guid Id { get; set; } [Required] [DisplayName("Area Name")] diff --git a/Marco.Pms.Model/Dtos/Project/WorkItemDot.cs b/Marco.Pms.Model/Dtos/Project/WorkItemDot.cs index 831b536..08460b1 100644 --- a/Marco.Pms.Model/Dtos/Project/WorkItemDot.cs +++ b/Marco.Pms.Model/Dtos/Project/WorkItemDot.cs @@ -5,12 +5,11 @@ namespace Marco.Pms.Model.Dtos.Project public class WorkItemDot { [Key] - public int Id { get; set; } - public int WorkAreaID { get; set; } + public Guid? Id { get; set; } + public Guid WorkAreaID { get; set; } - public int ActivityID { get; set; } + public Guid ActivityID { get; set; } public int PlannedWork { get; set; } public int CompletedWork { get; set; } - public int TenantId { get; set; } } } diff --git a/Marco.Pms.Model/Dtos/Project/WorkItemVM.cs b/Marco.Pms.Model/Dtos/Project/WorkItemVM.cs index d62161a..adf93e8 100644 --- a/Marco.Pms.Model/Dtos/Project/WorkItemVM.cs +++ b/Marco.Pms.Model/Dtos/Project/WorkItemVM.cs @@ -4,7 +4,7 @@ namespace Marco.Pms.Model.Dtos.Project { public class WorkItemVM { - public int WorkItemId { get; set; } + public Guid WorkItemId { get; set; } public WorkItem? WorkItem { get; set; } } } diff --git a/Marco.Pms.Model/Dtos/Roles/UpdateJobRoleDto.cs b/Marco.Pms.Model/Dtos/Roles/UpdateJobRoleDto.cs index e3d56af..a756455 100644 --- a/Marco.Pms.Model/Dtos/Roles/UpdateJobRoleDto.cs +++ b/Marco.Pms.Model/Dtos/Roles/UpdateJobRoleDto.cs @@ -2,7 +2,7 @@ { public class UpdateJobRoleDto { - public int Id { get; set; } + public Guid Id { get; set; } public string? Name { get; set; } public string? Description { get; set; } } diff --git a/Marco.Pms.Model/Dtos/Util/InquiryDto.cs b/Marco.Pms.Model/Dtos/Util/InquiryDto.cs index 677a1d0..dc98d7f 100644 --- a/Marco.Pms.Model/Dtos/Util/InquiryDto.cs +++ b/Marco.Pms.Model/Dtos/Util/InquiryDto.cs @@ -6,7 +6,7 @@ public string? Email { get; set; } public string? About { get; set; } public string? OragnizationSize { get; set; } - public int IndustryId { get; set; } + public Guid IndustryId { get; set; } public string? ContactPerson { get; set; } public string? ContactNumber { get; set; } } diff --git a/Marco.Pms.Model/Employees/Employee.cs b/Marco.Pms.Model/Employees/Employee.cs index feeaaae..40943cd 100644 --- a/Marco.Pms.Model/Employees/Employee.cs +++ b/Marco.Pms.Model/Employees/Employee.cs @@ -1,13 +1,13 @@ -using Marco.Pms.Model.Entitlements; +using System.ComponentModel.DataAnnotations.Schema; +using Marco.Pms.Model.Entitlements; +using Marco.Pms.Model.Utilities; using Microsoft.AspNetCore.Mvc.ModelBinding.Validation; -using System.ComponentModel; -using System.ComponentModel.DataAnnotations.Schema; namespace Marco.Pms.Model.Employees { - public class Employee + public class Employee : TenantRelation { - public int Id { get; set; } + public Guid Id { get; set; } public string? FirstName { get; set; } public string? LastName { get; set; } public string? MiddleName { get; set; } @@ -35,19 +35,15 @@ namespace Marco.Pms.Model.Employees [ForeignKey("ApplicationUserId")] [ValidateNever] public ApplicationUser? ApplicationUser { get; set; } - [DisplayName("TenantId")] - public int TenantId { get; set; } + public bool IsActive { get; set; } = true; - [ValidateNever] - [ForeignKey(nameof(TenantId))] - public Tenant? Tenant { get; set; } public Guid RoleId { get; set; } //[ForeignKey(nameof(RoleId))] //public EmployeeRole EmployeeRole { get; set; } - public int? JobRoleId { get; set; } + public Guid? JobRoleId { get; set; } [ForeignKey("JobRoleId")] [ValidateNever] public JobRole? JobRole { get; set; } diff --git a/Marco.Pms.Model/Employees/WorkShift.cs b/Marco.Pms.Model/Employees/WorkShift.cs index 087f795..b207615 100644 --- a/Marco.Pms.Model/Employees/WorkShift.cs +++ b/Marco.Pms.Model/Employees/WorkShift.cs @@ -1,24 +1,16 @@ -using Marco.Pms.Model.Entitlements; -using Microsoft.AspNetCore.Mvc.ModelBinding.Validation; -using System.ComponentModel; -using System.ComponentModel.DataAnnotations.Schema; +using System.ComponentModel; +using Marco.Pms.Model.Utilities; namespace Marco.Pms.Model.Employees { - public class WorkShift + public class WorkShift : TenantRelation { - public int Id { get; set; } + public Guid Id { get; set; } [DisplayName("Shift Name")] public string? Name { get; set; } public TimeOnly StartTime { get; set; } public TimeOnly EndTime { get; set; } - [DisplayName("TenantId")] - public int TenantId { get; set; } - - [ValidateNever] - [ForeignKey(nameof(TenantId))] - public Tenant? Tenant { get; set; } } } diff --git a/Marco.Pms.Model/Entitlements/ActivityCheckList.cs b/Marco.Pms.Model/Entitlements/ActivityCheckList.cs index 04f4ddd..1dca575 100644 --- a/Marco.Pms.Model/Entitlements/ActivityCheckList.cs +++ b/Marco.Pms.Model/Entitlements/ActivityCheckList.cs @@ -2,11 +2,11 @@ { public class ActivityCheckList { - public int Id { get; set; } - public int ActivityId { get; set; } + public Guid Id { get; set; } + public Guid ActivityId { get; set; } public string? Description { get; set; } = string.Empty; public bool IsChecked { get; set; } = false; public bool IsMandatory { get; set; } - public int TenantId { get; set; } + public Guid TenantId { get; set; } } } diff --git a/Marco.Pms.Model/Entitlements/ActivityMaster.cs b/Marco.Pms.Model/Entitlements/ActivityMaster.cs index 46b8d33..977dbdd 100644 --- a/Marco.Pms.Model/Entitlements/ActivityMaster.cs +++ b/Marco.Pms.Model/Entitlements/ActivityMaster.cs @@ -1,22 +1,14 @@ -using System.ComponentModel; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.AspNetCore.Mvc.ModelBinding.Validation; +using Marco.Pms.Model.Utilities; namespace Marco.Pms.Model.Entitlements { - public class ActivityMaster + public class ActivityMaster : TenantRelation { - public int Id { get; set; } + public Guid Id { get; set; } public string? ActivityName { get; set; } public string? UnitOfMeasurement { get; set; } - - [DisplayName("TenantId")] - public int TenantId { get; set; } - [ValidateNever] - [ForeignKey(nameof(TenantId))] - public Tenant? Tenant { get; set; } public bool IsActive { get; set; } = true; } } diff --git a/Marco.Pms.Model/Entitlements/ApplicationRole.cs b/Marco.Pms.Model/Entitlements/ApplicationRole.cs index 02bc534..7ab93aa 100644 --- a/Marco.Pms.Model/Entitlements/ApplicationRole.cs +++ b/Marco.Pms.Model/Entitlements/ApplicationRole.cs @@ -6,9 +6,9 @@ public string? Role { get; set; } public string? Description { get; set; } - public int TenantId { get; set; } + public Guid TenantId { get; set; } } - + } diff --git a/Marco.Pms.Model/Entitlements/ApplicationUser.cs b/Marco.Pms.Model/Entitlements/ApplicationUser.cs index 8b464cd..c49b5cd 100644 --- a/Marco.Pms.Model/Entitlements/ApplicationUser.cs +++ b/Marco.Pms.Model/Entitlements/ApplicationUser.cs @@ -1,9 +1,5 @@ -using Microsoft.AspNetCore.Identity; -using Microsoft.AspNetCore.Mvc.ModelBinding.Validation; -using Microsoft.Extensions.Logging; -using System.ComponentModel; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; +using System.ComponentModel; +using Microsoft.AspNetCore.Identity; namespace Marco.Pms.Model.Entitlements { @@ -14,7 +10,7 @@ namespace Marco.Pms.Model.Entitlements [DisplayName("TenantId")] - public int TenantId { get; set; } + public Guid TenantId { get; set; } public bool? IsRootUser { get; set; } = false; diff --git a/Marco.Pms.Model/Entitlements/CheckListMappings.cs b/Marco.Pms.Model/Entitlements/CheckListMappings.cs index 6aa2631..c3ec46c 100644 --- a/Marco.Pms.Model/Entitlements/CheckListMappings.cs +++ b/Marco.Pms.Model/Entitlements/CheckListMappings.cs @@ -2,8 +2,8 @@ { public class CheckListMappings { - public int Id { get; set; } - public long TaskAllocationId { get; set; } - public int CheckListId { get; set; } + public Guid Id { get; set; } + public Guid TaskAllocationId { get; set; } + public Guid CheckListId { get; set; } } } diff --git a/Marco.Pms.Model/Entitlements/Client.cs b/Marco.Pms.Model/Entitlements/Client.cs index df6cf01..d424b10 100644 --- a/Marco.Pms.Model/Entitlements/Client.cs +++ b/Marco.Pms.Model/Entitlements/Client.cs @@ -6,7 +6,7 @@ namespace Marco.Pms.Model.Entitlements { public class Tenant { - public int Id { get; set; } + public Guid Id { get; set; } public string? Name { get; set; } public string? Description { get; set; } public string? DomainName { get; set; } @@ -14,11 +14,11 @@ namespace Marco.Pms.Model.Entitlements public string? ContactNumber { get; set; } public DateTime OnBoardingDate { get; set; } public string? OragnizationSize { get; set; } - public int? IndustryId { get;set; } + public Guid? IndustryId { get; set; } [ForeignKey("IndustryId")] [ValidateNever] - public Industry? Industry{ get; set; } + public Industry? Industry { get; set; } public bool IsActive { get; set; } = true; } diff --git a/Marco.Pms.Model/Entitlements/EmployeeRoleMapping.cs b/Marco.Pms.Model/Entitlements/EmployeeRoleMapping.cs index 905301d..5e070e3 100644 --- a/Marco.Pms.Model/Entitlements/EmployeeRoleMapping.cs +++ b/Marco.Pms.Model/Entitlements/EmployeeRoleMapping.cs @@ -1,13 +1,14 @@ using System.ComponentModel.DataAnnotations.Schema; using Marco.Pms.Model.Employees; +using Marco.Pms.Model.Utilities; using Microsoft.AspNetCore.Mvc.ModelBinding.Validation; namespace Marco.Pms.Model.Entitlements { - public class EmployeeRoleMapping + public class EmployeeRoleMapping : TenantRelation { public Guid Id { get; set; } - public int EmployeeId { get; set; } + public Guid EmployeeId { get; set; } [ValidateNever] [ForeignKey(nameof(EmployeeId))] public Employee? Employee { get; set; } // Navigation property to Employee @@ -19,12 +20,7 @@ namespace Marco.Pms.Model.Entitlements public bool IsEnabled { get; set; } - public int TenantId { get; set; } - [ValidateNever] - [ForeignKey(nameof(TenantId))] - public Tenant? Tenant { get; set; } - - } + } } diff --git a/Marco.Pms.Model/Entitlements/Feature.cs b/Marco.Pms.Model/Entitlements/Feature.cs index 13abcdc..6ddd7ef 100644 --- a/Marco.Pms.Model/Entitlements/Feature.cs +++ b/Marco.Pms.Model/Entitlements/Feature.cs @@ -1,12 +1,12 @@ -using Microsoft.AspNetCore.Mvc.ModelBinding.Validation; -using System.ComponentModel.DataAnnotations.Schema; +using System.ComponentModel.DataAnnotations.Schema; +using Microsoft.AspNetCore.Mvc.ModelBinding.Validation; namespace Marco.Pms.Model.Entitlements { public class Feature { public Guid Id { get; set; } // Unique identifier for the feature - public int ModuleId { get; set; } + public Guid ModuleId { get; set; } [ValidateNever] [ForeignKey(nameof(ModuleId))] public Module? Module { get; set; } diff --git a/Marco.Pms.Model/Entitlements/JobRole.cs b/Marco.Pms.Model/Entitlements/JobRole.cs index 457a5fe..d7daf9a 100644 --- a/Marco.Pms.Model/Entitlements/JobRole.cs +++ b/Marco.Pms.Model/Entitlements/JobRole.cs @@ -1,17 +1,12 @@ -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.AspNetCore.Mvc.ModelBinding.Validation; +using Marco.Pms.Model.Utilities; namespace Marco.Pms.Model.Entitlements { - public class JobRole + public class JobRole : TenantRelation { - public int Id { get; set; } + public Guid Id { get; set; } public string? Name { get; set; } public string? Description { get; set; } - public int TenantId { get; set; } - [ValidateNever] - [ForeignKey(nameof(TenantId))] - public Tenant? Tenant { get; set; } } } diff --git a/Marco.Pms.Model/Entitlements/Module.cs b/Marco.Pms.Model/Entitlements/Module.cs index 2504f6f..3705ecd 100644 --- a/Marco.Pms.Model/Entitlements/Module.cs +++ b/Marco.Pms.Model/Entitlements/Module.cs @@ -10,14 +10,14 @@ namespace Marco.Pms.Model.Entitlements Key = Guid.NewGuid().ToString(); } [Key] - public int Id { get; set; } + public Guid Id { get; set; } [Required] public string? Name { get; set; } public string? Description { get; set; } - + public string Key { get; set; } diff --git a/Marco.Pms.Model/Entitlements/StatusMaster.cs b/Marco.Pms.Model/Entitlements/StatusMaster.cs index 8c983d0..945cd49 100644 --- a/Marco.Pms.Model/Entitlements/StatusMaster.cs +++ b/Marco.Pms.Model/Entitlements/StatusMaster.cs @@ -1,19 +1,11 @@ -using System.ComponentModel; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.AspNetCore.Mvc.ModelBinding.Validation; +using Marco.Pms.Model.Utilities; namespace Marco.Pms.Model.Entitlements { - public class StatusMaster + public class StatusMaster : TenantRelation { - public int Id { get; set; } + public Guid Id { get; set; } public string? Status { get; set; } - [DisplayName("TenantId")] - public int TenantId { get; set; } - - [ValidateNever] - [ForeignKey(nameof(TenantId))] - public Tenant? Tenant { get; set; } } } diff --git a/Marco.Pms.Model/Forum/TicketComment.cs b/Marco.Pms.Model/Forum/TicketComment.cs index 7ed0e67..d055e7e 100644 --- a/Marco.Pms.Model/Forum/TicketComment.cs +++ b/Marco.Pms.Model/Forum/TicketComment.cs @@ -1,11 +1,8 @@ -using Marco.Pms.Model.Entitlements; -using Microsoft.AspNetCore.Mvc.ModelBinding.Validation; -using System.ComponentModel.DataAnnotations.Schema; -using System.ComponentModel; +using Marco.Pms.Model.Utilities; namespace Marco.Pms.Model.Forum { - public class TicketComment + public class TicketComment : TenantRelation { public Guid Id { get; set; } public Guid TicketId { get; set; } @@ -16,12 +13,5 @@ namespace Marco.Pms.Model.Forum public ICollection? Attachments { get; set; } - [DisplayName("TenantId")] - public int TenantId { get; set; } - - [ValidateNever] - [ForeignKey(nameof(TenantId))] - public Tenant? Tenant { get; set; } - } } diff --git a/Marco.Pms.Model/Forum/TicketForum.cs b/Marco.Pms.Model/Forum/TicketForum.cs index 3aaf56e..b3e01c4 100644 --- a/Marco.Pms.Model/Forum/TicketForum.cs +++ b/Marco.Pms.Model/Forum/TicketForum.cs @@ -1,11 +1,10 @@ -using System.ComponentModel; -using System.ComponentModel.DataAnnotations.Schema; -using Marco.Pms.Model.Entitlements; +using System.ComponentModel.DataAnnotations.Schema; +using Marco.Pms.Model.Utilities; using Microsoft.AspNetCore.Mvc.ModelBinding.Validation; namespace Marco.Pms.Model.Forum { - public class TicketForum + public class TicketForum : TenantRelation { public Guid Id { get; set; } public string Subject { get; set; } = string.Empty; @@ -18,11 +17,11 @@ namespace Marco.Pms.Model.Forum [ValidateNever] [ForeignKey(nameof(TypeId))] public TicketTypeMaster? TicketTypeMaster { get; set; } - public int CreatedById { get; set; } + public Guid CreatedById { get; set; } public DateTime CreatedAt { get; set; } - public int LinkedProjectId { get; set; } - public int? LinkedActivityId { get; set; } // task or project ID + public Guid? LinkedProjectId { get; set; } + public Guid? LinkedActivityId { get; set; } // task or project ID //public ICollection? Comments { get; set; } // view model //public ICollection? Attachments { get; set; } // view model @@ -33,14 +32,6 @@ namespace Marco.Pms.Model.Forum public TicketPriorityMaster? Priority { get; set; } //public ICollection? Tags { get; set; } // view model - - - [DisplayName("TenantId")] - public int TenantId { get; set; } - - [ValidateNever] - [ForeignKey(nameof(TenantId))] - public Tenant? Tenant { get; set; } } } diff --git a/Marco.Pms.Model/Forum/TicketPriorityMaster.cs b/Marco.Pms.Model/Forum/TicketPriorityMaster.cs index f7aad11..1c5da55 100644 --- a/Marco.Pms.Model/Forum/TicketPriorityMaster.cs +++ b/Marco.Pms.Model/Forum/TicketPriorityMaster.cs @@ -7,7 +7,7 @@ public int Level { get; set; } // 1 = Low, 2 = Medium... public string? ColorCode { get; set; } public bool IsDefault { get; set; } - public int TenantId { get; set; } + public Guid TenantId { get; set; } } } diff --git a/Marco.Pms.Model/Forum/TicketStatusMaster.cs b/Marco.Pms.Model/Forum/TicketStatusMaster.cs index ddeb34e..1dfab31 100644 --- a/Marco.Pms.Model/Forum/TicketStatusMaster.cs +++ b/Marco.Pms.Model/Forum/TicketStatusMaster.cs @@ -7,7 +7,7 @@ public string? Description { get; set; } public string? ColorCode { get; set; } // e.g., "#FF0000" public bool IsDefault { get; set; } // true for system defaults - public int TenantId { get; set; } // or nullable if global + public Guid TenantId { get; set; } // or nullable if global } } diff --git a/Marco.Pms.Model/Forum/TicketTag.cs b/Marco.Pms.Model/Forum/TicketTag.cs index 98b6f4d..04f60f2 100644 --- a/Marco.Pms.Model/Forum/TicketTag.cs +++ b/Marco.Pms.Model/Forum/TicketTag.cs @@ -2,7 +2,7 @@ { public class TicketTag { - public int Id { get; set; } + public Guid Id { get; set; } public Guid TicketId { get; set; } public TicketForum? Ticket { get; set; } diff --git a/Marco.Pms.Model/Forum/TicketTagMaster.cs b/Marco.Pms.Model/Forum/TicketTagMaster.cs index 758ed03..7815c57 100644 --- a/Marco.Pms.Model/Forum/TicketTagMaster.cs +++ b/Marco.Pms.Model/Forum/TicketTagMaster.cs @@ -5,7 +5,7 @@ public Guid Id { get; set; } public string Name { get; set; } = string.Empty; // e.g., "Bug", "UI", "Urgent" public string? ColorCode { get; set; } - public int TenantId { get; set; } + public Guid TenantId { get; set; } public bool IsDefault { get; set; } } diff --git a/Marco.Pms.Model/Forum/TicketTypeMaster.cs b/Marco.Pms.Model/Forum/TicketTypeMaster.cs index 2a584be..0516ec9 100644 --- a/Marco.Pms.Model/Forum/TicketTypeMaster.cs +++ b/Marco.Pms.Model/Forum/TicketTypeMaster.cs @@ -6,7 +6,7 @@ public string Name { get; set; } = string.Empty; // e.g., "Quality Issue" public string? Description { get; set; } public bool IsDefault { get; set; } // true for system defaults - public int TenantId { get; set; } + public Guid TenantId { get; set; } } } diff --git a/Marco.Pms.Model/Industries/Industry.cs b/Marco.Pms.Model/Industries/Industry.cs index 73e7a1e..6333bd0 100644 --- a/Marco.Pms.Model/Industries/Industry.cs +++ b/Marco.Pms.Model/Industries/Industry.cs @@ -2,7 +2,7 @@ { public class Industry { - public int Id { get; set; } + public Guid Id { get; set; } public string? Name { get; set; } } } diff --git a/Marco.Pms.Model/Mapper/ActivitiesMapper.cs b/Marco.Pms.Model/Mapper/ActivitiesMapper.cs index f101674..459feef 100644 --- a/Marco.Pms.Model/Mapper/ActivitiesMapper.cs +++ b/Marco.Pms.Model/Mapper/ActivitiesMapper.cs @@ -2,12 +2,12 @@ using Marco.Pms.Model.Dtos.Activities; using Marco.Pms.Model.Entitlements; using Marco.Pms.Model.ViewModels.Activities; -#nullable disable + namespace Marco.Pms.Model.Mapper { public static class ActivitiesMapper { - public static TaskAllocation ToTaskAllocationFromAssignTaskDto(this AssignTaskDto assignTask, int EmployeeId,int tenantId) + public static TaskAllocation ToTaskAllocationFromAssignTaskDto(this AssignTaskDto assignTask, Guid EmployeeId, Guid tenantId) { return new TaskAllocation { @@ -20,27 +20,29 @@ namespace Marco.Pms.Model.Mapper TenantId = tenantId }; } - public static TaskComment ToCommentFromReportTaskDto(this ReportTaskDto reportTask, int tenantId, int EmployeeId) + public static TaskComment ToCommentFromReportTaskDto(this ReportTaskDto reportTask, Guid tenantId, Guid EmployeeId) { return new TaskComment { TaskAllocationId = reportTask.Id, CommentDate = reportTask.ReportedDate, - Comment = reportTask.Comment, + Comment = reportTask.Comment ?? string.Empty, CommentedBy = EmployeeId, TenantId = tenantId }; } - public static TaskComment ToCommentFromCommentDto(this CreateCommentDto createComment, int tenantId, int EmployeeId) { - return new TaskComment { + public static TaskComment ToCommentFromCommentDto(this CreateCommentDto createComment, Guid tenantId, Guid EmployeeId) + { + return new TaskComment + { TaskAllocationId = createComment.TaskAllocationId, CommentDate = createComment.CommentDate, - Comment = createComment.Comment, + Comment = createComment.Comment ?? string.Empty, CommentedBy = EmployeeId, TenantId = tenantId }; } - public static TaskVM TaskAllocationToTaskVM(this TaskAllocation taskAllocation,string employeeName,string tenant ) + public static TaskVM TaskAllocationToTaskVM(this TaskAllocation taskAllocation, string employeeName) { return new TaskVM { @@ -51,7 +53,6 @@ namespace Marco.Pms.Model.Mapper ReportedDate = taskAllocation.ReportedDate, Description = taskAllocation.Description, AssignBy = employeeName, - Tenant = tenant, WorkItem = taskAllocation.WorkItem }; } @@ -63,11 +64,10 @@ namespace Marco.Pms.Model.Mapper AssignmentDate = taskAllocation.AssignmentDate, PlannedTask = taskAllocation.PlannedTask, CompletedTask = taskAllocation.CompletedTask, - ReportedDate= taskAllocation.ReportedDate, + ReportedDate = taskAllocation.ReportedDate, Description = taskAllocation.Description, - AssignedBy = taskAllocation.Employee.ToEmployeeVMFromEmployee(), - WorkItemId = taskAllocation.WorkItemId, - TenantId = taskAllocation.TenantId + AssignedBy = taskAllocation.Employee != null ? taskAllocation.Employee.ToEmployeeVMFromEmployee() : new ViewModels.Employee.EmployeeVM(), + WorkItemId = taskAllocation.WorkItemId }; } public static ReportTaskVM ToReportTaskVMFromTaskAllocation(this TaskAllocation taskAllocation) @@ -81,11 +81,10 @@ namespace Marco.Pms.Model.Mapper ReportedDate = taskAllocation.ReportedDate, Description = taskAllocation.Description, AssignedBy = taskAllocation.AssignedBy, - WorkItemId = taskAllocation.WorkItemId, - TenantId = taskAllocation.TenantId + WorkItemId = taskAllocation.WorkItemId }; } - public static ActivityMaster ToActivityMasterFromCreateActivityMasterDto(this CreateActivityMasterDto createActivity,int tenantId) + public static ActivityMaster ToActivityMasterFromCreateActivityMasterDto(this CreateActivityMasterDto createActivity, Guid tenantId) { return new ActivityMaster { @@ -103,11 +102,9 @@ namespace Marco.Pms.Model.Mapper AssignmentDate = taskAllocation.AssignmentDate, PlannedTask = taskAllocation.PlannedTask, CompletedTask = taskAllocation.CompletedTask, - AssignedBy = taskAllocation.Employee.ToBasicEmployeeVMFromEmployee(), + AssignedBy = taskAllocation.Employee != null ? taskAllocation.Employee.ToBasicEmployeeVMFromEmployee() : new BasicEmployeeVM(), WorkItemId = taskAllocation.WorkItemId, - WorkItem = taskAllocation.WorkItem, - TenantId = taskAllocation.TenantId, - //CheckList = + WorkItem = taskAllocation.WorkItem }; } public static CommentVM ToCommentVMFromTaskComment(this TaskComment comment) @@ -119,11 +116,11 @@ namespace Marco.Pms.Model.Mapper CommentDate = comment.CommentDate, Comment = comment.Comment, CommentedBy = comment.CommentedBy, - Employee = comment.Employee.ToBasicEmployeeVMFromEmployee() + Employee = comment.Employee != null ? comment.Employee.ToBasicEmployeeVMFromEmployee() : new BasicEmployeeVM() }; } - public static ActivityVM ToActivityVMFromActivityMaster(this ActivityMaster activity,List checkList) + public static ActivityVM ToActivityVMFromActivityMaster(this ActivityMaster activity, List checkList) { return new ActivityVM { @@ -133,7 +130,7 @@ namespace Marco.Pms.Model.Mapper CheckLists = checkList, }; } - public static CheckListVM ToCheckListVMFromActivityCheckList(this ActivityCheckList checkList,int activityId,bool IsChecked) + public static CheckListVM ToCheckListVMFromActivityCheckList(this ActivityCheckList checkList, Guid activityId, bool IsChecked) { return new CheckListVM { @@ -144,18 +141,18 @@ namespace Marco.Pms.Model.Mapper IsMandatory = checkList.IsMandatory, }; } - public static ActivityCheckList ToActivityCheckListFromCreateCheckListDto(this CreateCheckListDto checkListDto,int tenantId,int activityId) + public static ActivityCheckList ToActivityCheckListFromCreateCheckListDto(this CreateCheckListDto checkListDto, Guid tenantId, Guid activityId) { return new ActivityCheckList { - Id = checkListDto.Id, + Id = checkListDto.Id != null ? checkListDto.Id.Value : Guid.Empty, Description = checkListDto.Description, ActivityId = activityId, IsMandatory = checkListDto.IsMandatory, TenantId = tenantId }; } - public static CheckListVM ToCheckListVMFromReportCheckListDto(this ReportCheckListDto checkListDto, int activityId) + public static CheckListVM ToCheckListVMFromReportCheckListDto(this ReportCheckListDto checkListDto, Guid activityId) { return new CheckListVM { diff --git a/Marco.Pms.Model/Mapper/ApplicationRoleMapper.cs b/Marco.Pms.Model/Mapper/ApplicationRoleMapper.cs index 887f260..0fed632 100644 --- a/Marco.Pms.Model/Mapper/ApplicationRoleMapper.cs +++ b/Marco.Pms.Model/Mapper/ApplicationRoleMapper.cs @@ -16,7 +16,7 @@ namespace Marco.Pms.Model.Mapper //FeaturePermission = model.FeaturePermissions }; } - public static ApplicationRole ToApplicationRoleFromCreateDto(this CreateApplicationRoleDto model, int TenantId) + public static ApplicationRole ToApplicationRoleFromCreateDto(this CreateApplicationRoleDto model, Guid TenantId) { return new ApplicationRole { @@ -27,7 +27,7 @@ namespace Marco.Pms.Model.Mapper }; } - public static ApplicationRole ToApplicationRoleFromUpdateDto(this UpdateApplicationRoleDto model, int TenantId) + public static ApplicationRole ToApplicationRoleFromUpdateDto(this UpdateApplicationRoleDto model, Guid TenantId) { return new ApplicationRole { @@ -39,7 +39,7 @@ namespace Marco.Pms.Model.Mapper }; } - public static JobRole ToJobRoleFromCreateJobRoleDot(this CreateJobRoleDto model, int TenantId) + public static JobRole ToJobRoleFromCreateJobRoleDot(this CreateJobRoleDto model, Guid TenantId) { return new JobRole { @@ -50,7 +50,7 @@ namespace Marco.Pms.Model.Mapper }; } - public static JobRole ToJobRoleFromUpdateJobRoleDot(this UpdateJobRoleDto model, int TenantId) + public static JobRole ToJobRoleFromUpdateJobRoleDot(this UpdateJobRoleDto model, Guid TenantId) { return new JobRole { diff --git a/Marco.Pms.Model/Mapper/EmployeeMapper.cs b/Marco.Pms.Model/Mapper/EmployeeMapper.cs index 4a3c527..31c1062 100644 --- a/Marco.Pms.Model/Mapper/EmployeeMapper.cs +++ b/Marco.Pms.Model/Mapper/EmployeeMapper.cs @@ -34,18 +34,6 @@ namespace Marco.Pms.Model.Mapper } public static BasicEmployeeVM ToBasicEmployeeVMFromEmployee(this Employee employee) { - if (employee.JobRole == null) - { - return new BasicEmployeeVM - { - Id = employee.Id, - FirstName = employee.FirstName, - LastName = employee.LastName, - Photo = employee.Photo, - JobRoleId = employee.JobRoleId, - JobRoleName = "" - }; - } return new BasicEmployeeVM { Id = employee.Id, @@ -53,7 +41,7 @@ namespace Marco.Pms.Model.Mapper LastName = employee.LastName, Photo = employee.Photo, JobRoleId = employee.JobRoleId, - JobRoleName = employee.JobRole.Name + JobRoleName = employee.JobRole != null ? employee.JobRole.Name : "" }; } } diff --git a/Marco.Pms.Model/Mapper/EmployeeRoleMapper.cs b/Marco.Pms.Model/Mapper/EmployeeRoleMapper.cs index fa442d3..1fceb96 100644 --- a/Marco.Pms.Model/Mapper/EmployeeRoleMapper.cs +++ b/Marco.Pms.Model/Mapper/EmployeeRoleMapper.cs @@ -15,12 +15,12 @@ namespace Marco.Pms.Model.Mapper // Features = model.Features // }; //} - public static EmployeeRoleMapping ToEmployeeRoleMappingFromEmployeeRoleDot(this EmployeeRoleDot model, int TenantId) + public static EmployeeRoleMapping ToEmployeeRoleMappingFromEmployeeRoleDot(this EmployeeRoleDot model, Guid TenantId) { - Guid id = (string.IsNullOrEmpty(model.Id ) ?Guid.NewGuid() : new Guid(model.Id)); + Guid id = (string.IsNullOrEmpty(model.Id) ? Guid.NewGuid() : new Guid(model.Id)); return new EmployeeRoleMapping { - Id = id, + Id = id, RoleId = model.RoleId, EmployeeId = model.EmployeeId, IsEnabled = model.IsEnabled, @@ -28,7 +28,7 @@ namespace Marco.Pms.Model.Mapper }; } - + //public static EmployeeRole ToEmployeeRoleFromUpdateDto(this UpdateApplicationRoleDto model, int TenantId) //{ // return new EmployeeRole diff --git a/Marco.Pms.Model/Mapper/ForumMapper.cs b/Marco.Pms.Model/Mapper/ForumMapper.cs index a9f5d2c..9978786 100644 --- a/Marco.Pms.Model/Mapper/ForumMapper.cs +++ b/Marco.Pms.Model/Mapper/ForumMapper.cs @@ -8,7 +8,7 @@ namespace Marco.Pms.Model.Mapper { public static class ForumMapper { - public static TicketForum ToTicketForumFromCreateTicketDto(this CreateTicketDto createTicketDto, int tenantId) + public static TicketForum ToTicketForumFromCreateTicketDto(this CreateTicketDto createTicketDto, Guid tenantId) { return new TicketForum { @@ -42,7 +42,7 @@ namespace Marco.Pms.Model.Mapper }; } - public static TicketComment ToTicketCommentFromAddCommentDto(this AddCommentDto commentDto, int tenantId) + public static TicketComment ToTicketCommentFromAddCommentDto(this AddCommentDto commentDto, Guid tenantId) { return new TicketComment { @@ -54,7 +54,7 @@ namespace Marco.Pms.Model.Mapper TenantId = tenantId, }; } - public static TicketComment ToTicketCommentFromUpdateCommentDto(this UpdateCommentDto updateComment, int tenantId, TicketComment comment) + public static TicketComment ToTicketCommentFromUpdateCommentDto(this UpdateCommentDto updateComment, Guid tenantId, TicketComment comment) { return new TicketComment { @@ -88,7 +88,7 @@ namespace Marco.Pms.Model.Mapper }; } - public static Document ToDocumentFromForumAttachmentDto(this ForumAttachmentDto AttachmentDto, string objectKey, string thumbS3Key, DateTime uploadedAt, int tenantId) + public static Document ToDocumentFromForumAttachmentDto(this ForumAttachmentDto AttachmentDto, string objectKey, string thumbS3Key, DateTime uploadedAt, Guid tenantId) { return new Document { @@ -102,7 +102,7 @@ namespace Marco.Pms.Model.Mapper TenantId = tenantId }; } - public static Document ToDocumentFromUpdateAttachmentDto(this UpdateAttachmentDto AttachmentDto, string objectKey, string thumbS3Key, DateTime uploadedAt, int tenantId) + public static Document ToDocumentFromUpdateAttachmentDto(this UpdateAttachmentDto AttachmentDto, string objectKey, string thumbS3Key, DateTime uploadedAt, Guid tenantId) { return new Document { @@ -168,7 +168,7 @@ namespace Marco.Pms.Model.Mapper IsDefault = statusMaster.IsDefault }; } - public static TicketStatusMaster ToTicketStatusMasterFromTicketStatusMasterDto(this TicketStatusMasterDto statusMasterDto) + public static TicketStatusMaster ToTicketStatusMasterFromTicketStatusMasterDto(this TicketStatusMasterDto statusMasterDto, Guid tenantId) { return new TicketStatusMaster { @@ -177,7 +177,7 @@ namespace Marco.Pms.Model.Mapper Description = statusMasterDto.Description, ColorCode = statusMasterDto.ColorCode, IsDefault = statusMasterDto.IsDefault, - TenantId = statusMasterDto.TenantId + TenantId = tenantId }; } @@ -192,7 +192,7 @@ namespace Marco.Pms.Model.Mapper IsDefault = priorityMaster.IsDefault }; } - public static TicketPriorityMaster ToTicketPriorityMasterFromTicketPriorityMasterDto(this TicketPriorityMasterDto priorityMasterDto) + public static TicketPriorityMaster ToTicketPriorityMasterFromTicketPriorityMasterDto(this TicketPriorityMasterDto priorityMasterDto, Guid tenantId) { return new TicketPriorityMaster { @@ -201,7 +201,7 @@ namespace Marco.Pms.Model.Mapper Level = priorityMasterDto.Level, ColorCode = priorityMasterDto.ColorCode, IsDefault = priorityMasterDto.IsDefault, - TenantId = priorityMasterDto.TenantId + TenantId = tenantId }; } public static TicketTypeVM ToTicketTypeVMFromTicketTypeMaster(this TicketTypeMaster typeMaster) @@ -214,7 +214,7 @@ namespace Marco.Pms.Model.Mapper IsDefault = typeMaster.IsDefault }; } - public static TicketTypeMaster ToTicketTypeMasterFromTicketTypeMasterDto(this TicketTypeMasterDto typeMasterDto) + public static TicketTypeMaster ToTicketTypeMasterFromTicketTypeMasterDto(this TicketTypeMasterDto typeMasterDto, Guid tenantId) { return new TicketTypeMaster { @@ -222,7 +222,7 @@ namespace Marco.Pms.Model.Mapper Name = typeMasterDto.Name, Description = typeMasterDto.Description, IsDefault = typeMasterDto.IsDefault, - TenantId = typeMasterDto.TenantId + TenantId = tenantId }; } public static TicketTagVM ToTicketTagVMFromTicketTagMaster(this TicketTagMaster tagMaster) @@ -235,7 +235,7 @@ namespace Marco.Pms.Model.Mapper IsDefault = tagMaster.IsDefault }; } - public static TicketTagMaster ToTicketTagMasterFromTicketTagMasterDto(this TicketTagMasterDto tagMasterDto) + public static TicketTagMaster ToTicketTagMasterFromTicketTagMasterDto(this TicketTagMasterDto tagMasterDto, Guid tenantId) { return new TicketTagMaster { @@ -243,7 +243,7 @@ namespace Marco.Pms.Model.Mapper Name = tagMasterDto.Name, ColorCode = tagMasterDto.ColorCode, IsDefault = tagMasterDto.IsDefault, - TenantId = tagMasterDto.TenantId + TenantId = tenantId }; } } diff --git a/Marco.Pms.Model/Mapper/InfraMapper.cs b/Marco.Pms.Model/Mapper/InfraMapper.cs index ca76047..142c6f9 100644 --- a/Marco.Pms.Model/Mapper/InfraMapper.cs +++ b/Marco.Pms.Model/Mapper/InfraMapper.cs @@ -5,60 +5,60 @@ namespace Marco.Pms.Model.Mapper { public static class BuildingMapper { - public static Building ToBuildingFromBuildingDto(this BuildingDot model) + public static Building ToBuildingFromBuildingDto(this BuildingDot model, Guid tenantId) { return new Building { - Id = model.Id, + Id = model.Id != null ? model.Id.Value : Guid.Empty, Description = model.Description, Name = model.Name, ProjectId = model.ProjectId, - TenantId = model.TenantId, + TenantId = tenantId, }; } } public static class FloorMapper { - public static Floor ToFloorFromFloorDto(this FloorDot model) + public static Floor ToFloorFromFloorDto(this FloorDot model, Guid tenantId) { return new Floor { - Id = model.Id, + Id = model.Id != null ? model.Id.Value : Guid.Empty, FloorName = model.FloorName, BuildingId = model.BuildingId, - TenantId = model.TenantId + TenantId = tenantId }; } } public static class WorAreaMapper { - public static WorkArea ToWorkAreaFromWorkAreaDto(this WorkAreaDot model) + public static WorkArea ToWorkAreaFromWorkAreaDto(this WorkAreaDot model, Guid tenantId) { return new WorkArea { - Id = model.Id, + Id = model.Id != null ? model.Id.Value : Guid.Empty, AreaName = model.AreaName, FloorId = model.FloorId, - TenantId = model.TenantId - + TenantId = tenantId + }; } } public static class WorkItemMapper { - public static WorkItem ToWorkItemFromWorkItemDto(this WorkItemDot model) + public static WorkItem ToWorkItemFromWorkItemDto(this WorkItemDot model, Guid tenantId) { return new WorkItem { - Id = model.Id, + Id = model.Id != null ? model.Id.Value : Guid.Empty, ActivityId = model.ActivityID, CompletedWork = model.CompletedWork, PlannedWork = model.PlannedWork, TaskDate = DateTime.Now, - TenantId = model.TenantId, - WorkAreaId = model.WorkAreaID + TenantId = tenantId, + WorkAreaId = model.WorkAreaID }; } diff --git a/Marco.Pms.Model/Mapper/InquiryMapper.cs b/Marco.Pms.Model/Mapper/InquiryMapper.cs index 7d6452e..276195b 100644 --- a/Marco.Pms.Model/Mapper/InquiryMapper.cs +++ b/Marco.Pms.Model/Mapper/InquiryMapper.cs @@ -5,10 +5,11 @@ namespace Marco.Pms.Model.Mapper { public static class InquiryMapper { - public static Inquiries ToInquiriesFromInquiriesDto(this InquiryDto inquiryDto) { + public static Inquiries ToInquiriesFromInquiriesDto(this InquiryDto inquiryDto) + { return new Inquiries { - Id = 0, + Id = Guid.Empty, OrganizatioinName = inquiryDto.OrganizatioinName, OragnizationSize = inquiryDto.OragnizationSize, IndustryId = inquiryDto.IndustryId, @@ -19,7 +20,7 @@ namespace Marco.Pms.Model.Mapper }; } - public static InquiryEmailObject ToInquiryEmailObjectFromInquiriesDto(this InquiryDto inquiryDto,string industryName) + public static InquiryEmailObject ToInquiryEmailObjectFromInquiriesDto(this InquiryDto inquiryDto, string industryName) { return new InquiryEmailObject { diff --git a/Marco.Pms.Model/Mapper/ProjectMapper.cs b/Marco.Pms.Model/Mapper/ProjectMapper.cs index 1cfccaf..b357441 100644 --- a/Marco.Pms.Model/Mapper/ProjectMapper.cs +++ b/Marco.Pms.Model/Mapper/ProjectMapper.cs @@ -16,12 +16,11 @@ namespace Marco.Pms.Model.Mapper Name = projectModel.Name, EndDate = projectModel.EndDate, StartDate = projectModel.StartDate, - TenantId = projectModel.TenantId, ProjectStatusId = projectModel.ProjectStatusId }; } - public static Project ToProjectFromCreateProjectDto(this CreateProjectDto projectModel, int TenantId) + public static Project ToProjectFromCreateProjectDto(this CreateProjectDto projectModel, Guid TenantId) { return new Project { @@ -35,7 +34,7 @@ namespace Marco.Pms.Model.Mapper }; } - public static Project ToProjectFromUpdateProjectDto(this UpdateProjectDto projectModel, int TenantId,int id) + public static Project ToProjectFromUpdateProjectDto(this UpdateProjectDto projectModel, Guid TenantId, Guid id) { return new Project { @@ -50,7 +49,7 @@ namespace Marco.Pms.Model.Mapper }; } - public static ProjectAllocation ToProjectAllocationFromProjectAllocationDto(this ProjectAllocationDot model, int TenantId) + public static ProjectAllocation ToProjectAllocationFromProjectAllocationDto(this ProjectAllocationDot model, Guid TenantId) { return new ProjectAllocation { @@ -73,7 +72,6 @@ namespace Marco.Pms.Model.Mapper ContactPerson = project.ContactPerson, StartDate = project.StartDate, EndDate = project.EndDate, - TenantId = project.TenantId }; } } diff --git a/Marco.Pms.Model/Projects/Building.cs b/Marco.Pms.Model/Projects/Building.cs index d0cbc39..0b60feb 100644 --- a/Marco.Pms.Model/Projects/Building.cs +++ b/Marco.Pms.Model/Projects/Building.cs @@ -1,28 +1,18 @@ -using Marco.Pms.Model.Entitlements; -using Microsoft.AspNetCore.Mvc.ModelBinding.Validation; -using System.ComponentModel; +using System.ComponentModel; using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; +using Marco.Pms.Model.Utilities; namespace Marco.Pms.Model.Projects { - public class Building + public class Building : TenantRelation { [Key] - public int Id { get; set; } + public Guid Id { get; set; } [Required] [DisplayName("Building Name")] public string? Name { get; set; } public string? Description { get; set; } - public int ProjectId { get; set; } - - - [DisplayName("TenantId")] - public int TenantId { get; set; } - - [ValidateNever] - [ForeignKey(nameof(TenantId))] - public Tenant? Tenant { get; set; } + public Guid ProjectId { get; set; } } } diff --git a/Marco.Pms.Model/Projects/Floor.cs b/Marco.Pms.Model/Projects/Floor.cs index 9041158..33dd465 100644 --- a/Marco.Pms.Model/Projects/Floor.cs +++ b/Marco.Pms.Model/Projects/Floor.cs @@ -1,32 +1,24 @@ using System.ComponentModel; using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema; -using Marco.Pms.Model.Entitlements; +using Marco.Pms.Model.Utilities; using Microsoft.AspNetCore.Mvc.ModelBinding.Validation; namespace Marco.Pms.Model.Projects { - public class Floor + public class Floor : TenantRelation { - public int Id { get; set; } + public Guid Id { get; set; } [Required] [DisplayName("Floor Name")] public string? FloorName { get; set; } - public int BuildingId { get; set; } + public Guid BuildingId { get; set; } [ForeignKey("BuildingId")] [ValidateNever] public Building? Building { get; set; } - - - [DisplayName("TenantId")] - public int TenantId { get; set; } - - [ValidateNever] - [ForeignKey(nameof(TenantId))] - public Tenant? Tenant { get; set; } } } diff --git a/Marco.Pms.Model/Projects/PhotoGallary.cs b/Marco.Pms.Model/Projects/PhotoGallary.cs index 71786c1..4bca52b 100644 --- a/Marco.Pms.Model/Projects/PhotoGallary.cs +++ b/Marco.Pms.Model/Projects/PhotoGallary.cs @@ -1,12 +1,12 @@ -using Marco.Pms.Model.Entitlements; +using System.ComponentModel.DataAnnotations.Schema; +using Marco.Pms.Model.Entitlements; using Microsoft.AspNetCore.Mvc.ModelBinding.Validation; -using System.ComponentModel.DataAnnotations.Schema; namespace Marco.Pms.Model.Projects { public class PhotoGallary { - public int Id { get; set; } + public Guid Id { get; set; } public string? Description { get; set; } public int ProjectId { get; set; } [ValidateNever] @@ -15,8 +15,8 @@ namespace Marco.Pms.Model.Projects public string? AddedBy { get; set; } [ValidateNever] [ForeignKey(nameof(AddedBy))] - public ApplicationUser? ApplicationUser { get; set; } - public DateTime AddedOn { get; set; } + public ApplicationUser? ApplicationUser { get; set; } + public DateTime AddedOn { get; set; } public required string Imagebase64 { get; set; } } } diff --git a/Marco.Pms.Model/Projects/Project.cs b/Marco.Pms.Model/Projects/Project.cs index 5fb8619..c3c47a1 100644 --- a/Marco.Pms.Model/Projects/Project.cs +++ b/Marco.Pms.Model/Projects/Project.cs @@ -2,14 +2,15 @@ using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema; using Marco.Pms.Model.Entitlements; +using Marco.Pms.Model.Utilities; using Microsoft.AspNetCore.Mvc.ModelBinding.Validation; namespace Marco.Pms.Model.Projects { - public class Project + public class Project : TenantRelation { [Key] - public int Id { get; set; } + public Guid Id { get; set; } [Required] [DisplayName("Project Name")] public string? Name { get; set; } @@ -25,17 +26,10 @@ namespace Marco.Pms.Model.Projects public DateTime? EndDate { get; set; } [DisplayName("Project Status")] - public int ProjectStatusId { get; set; } + public Guid ProjectStatusId { get; set; } [ValidateNever] [ForeignKey(nameof(ProjectStatusId))] public StatusMaster? ProjectStatus { get; set; } - - [DisplayName("TenantId")] - public int TenantId { get; set; } - - [ValidateNever] - [ForeignKey(nameof(TenantId))] - public Tenant? Tenant { get; set; } } } diff --git a/Marco.Pms.Model/Projects/ProjectAllocation.cs b/Marco.Pms.Model/Projects/ProjectAllocation.cs index 67c484b..365a31f 100644 --- a/Marco.Pms.Model/Projects/ProjectAllocation.cs +++ b/Marco.Pms.Model/Projects/ProjectAllocation.cs @@ -1,27 +1,26 @@ -using System.ComponentModel; -using System.ComponentModel.DataAnnotations.Schema; +using System.ComponentModel.DataAnnotations.Schema; using Marco.Pms.Model.Employees; -using Marco.Pms.Model.Entitlements; +using Marco.Pms.Model.Utilities; using Microsoft.AspNetCore.Mvc.ModelBinding.Validation; namespace Marco.Pms.Model.Projects { - public class ProjectAllocation + public class ProjectAllocation : TenantRelation { - public int Id { get; set; } - public int EmployeeId { get; set; } + public Guid Id { get; set; } + public Guid EmployeeId { get; set; } [ForeignKey("EmployeeId")] [ValidateNever] public Employee? Employee { get; set; } - public int? JobRoleId { get; set; } + public Guid? JobRoleId { get; set; } //[ForeignKey("EmployeeRoleId")] //[ValidateNever] //public EmployeeRole EmployeeRole { get; set; } public bool IsActive { get; set; } = true; - public int ProjectId { get; set; } + public Guid ProjectId { get; set; } [ForeignKey("ProjectId")] [ValidateNever] public Project? Project { get; set; } @@ -29,12 +28,5 @@ namespace Marco.Pms.Model.Projects public DateTime AllocationDate { get; set; } public DateTime? ReAllocationDate { get; set; } - - - [DisplayName("TenantId")] - public int TenantId { get; set; } - [ValidateNever] - [ForeignKey(nameof(TenantId))] - public Tenant? Tenant { get; set; } } } diff --git a/Marco.Pms.Model/Projects/WorkArea.cs b/Marco.Pms.Model/Projects/WorkArea.cs index 9a4d4f0..0c17d9c 100644 --- a/Marco.Pms.Model/Projects/WorkArea.cs +++ b/Marco.Pms.Model/Projects/WorkArea.cs @@ -1,21 +1,21 @@ using System.ComponentModel; using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema; -using Marco.Pms.Model.Entitlements; +using Marco.Pms.Model.Utilities; using Microsoft.AspNetCore.Mvc.ModelBinding.Validation; namespace Marco.Pms.Model.Projects { - public class WorkArea + public class WorkArea : TenantRelation { [Key] - public int Id { get; set; } + public Guid Id { get; set; } [Required] [DisplayName("Area Name")] public string? AreaName { get; set; } - public int FloorId { get; set; } + public Guid FloorId { get; set; } [ForeignKey("FloorId")] [ValidateNever] @@ -24,12 +24,5 @@ namespace Marco.Pms.Model.Projects //[ValidateNever] //public List WorkItems { get; set; } - [DisplayName("TenantId")] - public int TenantId { get; set; } - - [ValidateNever] - [ForeignKey(nameof(TenantId))] - public Tenant? Tenant { get; set; } - - } } +} diff --git a/Marco.Pms.Model/Projects/WorkItem.cs b/Marco.Pms.Model/Projects/WorkItem.cs index 2ec28a5..841a3a7 100644 --- a/Marco.Pms.Model/Projects/WorkItem.cs +++ b/Marco.Pms.Model/Projects/WorkItem.cs @@ -1,16 +1,16 @@ -using System.ComponentModel; -using System.ComponentModel.DataAnnotations.Schema; +using System.ComponentModel.DataAnnotations.Schema; using Marco.Pms.Model.Entitlements; +using Marco.Pms.Model.Utilities; using Microsoft.AspNetCore.Mvc.ModelBinding.Validation; namespace Marco.Pms.Model.Projects { - public class WorkItem + public class WorkItem : TenantRelation { - public int Id { get; set; } - public int ActivityId { get; set; } + public Guid Id { get; set; } + public Guid ActivityId { get; set; } - public int WorkAreaId { get; set; } + public Guid WorkAreaId { get; set; } [ForeignKey("WorkAreaId")] [ValidateNever] public WorkArea? WorkArea { get; set; } @@ -23,12 +23,5 @@ namespace Marco.Pms.Model.Projects public double PlannedWork { get; set; } public double CompletedWork { get; set; } public DateTime TaskDate { get; set; } - - [DisplayName("TenantId")] - public int TenantId { get; set; } - - [ValidateNever] - [ForeignKey(nameof(TenantId))] - public Tenant? Tenant { get; set; } } } diff --git a/Marco.Pms.Model/Projects/WorkItemMapping.cs b/Marco.Pms.Model/Projects/WorkItemMapping.cs index a974e91..6730817 100644 --- a/Marco.Pms.Model/Projects/WorkItemMapping.cs +++ b/Marco.Pms.Model/Projects/WorkItemMapping.cs @@ -1,13 +1,12 @@ -using Marco.Pms.Model.Entitlements; +using System.ComponentModel.DataAnnotations.Schema; +using Marco.Pms.Model.Utilities; using Microsoft.AspNetCore.Mvc.ModelBinding.Validation; -using System.ComponentModel; -using System.ComponentModel.DataAnnotations.Schema; namespace Marco.Pms.Model.Projects { - public class WorkItemMapping1 + public class WorkItemMapping : TenantRelation { - public int Id { get; set; } + public Guid Id { get; set; } public int WorkAreaId { get; set; } [ForeignKey("WorkAreaId")] [ValidateNever] @@ -16,13 +15,5 @@ namespace Marco.Pms.Model.Projects [ForeignKey("WorkItemId")] [ValidateNever] public WorkItem? WorkItem { get; set; } - - [DisplayName("TenantId")] - public int TenantId { get; set; } - - [ValidateNever] - [ForeignKey(nameof(TenantId))] - public Tenant? Tenant { get; set; } - } } diff --git a/Marco.Pms.Model/Utilities/FileDetails.cs b/Marco.Pms.Model/Utilities/FileDetails.cs index 46665cd..94bf123 100644 --- a/Marco.Pms.Model/Utilities/FileDetails.cs +++ b/Marco.Pms.Model/Utilities/FileDetails.cs @@ -1,14 +1,8 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace Marco.Pms.Model.Utilities +namespace Marco.Pms.Model.Utilities { public class FileDetails { - public int Id { get; set; } + public Guid Id { get; set; } public byte[]? FileData { get; set; } // Byte array for the file public string? FileName { get; set; } public string? ContentType { get; set; } diff --git a/Marco.Pms.Model/Utilities/Inquiries.cs b/Marco.Pms.Model/Utilities/Inquiries.cs index ec80a0f..7f61866 100644 --- a/Marco.Pms.Model/Utilities/Inquiries.cs +++ b/Marco.Pms.Model/Utilities/Inquiries.cs @@ -2,12 +2,12 @@ { public class Inquiries { - public int Id { get; set; } + public Guid Id { get; set; } public string? OrganizatioinName { get; set; } public string? Email { get; set; } public string? About { get; set; } public string? OragnizationSize { get; set; } - public int IndustryId { get; set; } + public Guid IndustryId { get; set; } public string? ContactPerson { get; set; } public string? ContactNumber { get; set; } } diff --git a/Marco.Pms.Model/Utilities/TenantTest.cs b/Marco.Pms.Model/Utilities/TenantRelation.cs similarity index 80% rename from Marco.Pms.Model/Utilities/TenantTest.cs rename to Marco.Pms.Model/Utilities/TenantRelation.cs index 2650224..fa41adf 100644 --- a/Marco.Pms.Model/Utilities/TenantTest.cs +++ b/Marco.Pms.Model/Utilities/TenantRelation.cs @@ -4,9 +4,9 @@ using Microsoft.AspNetCore.Mvc.ModelBinding.Validation; namespace Marco.Pms.Model.Utilities { - public class TenantTest + public class TenantRelation { - public int TenantId { get; set; } + public Guid TenantId { get; set; } [ValidateNever] [ForeignKey(nameof(TenantId))] diff --git a/Marco.Pms.Model/ViewModels/Activities/ActivityVM.cs b/Marco.Pms.Model/ViewModels/Activities/ActivityVM.cs index 83b4a78..38c9d9f 100644 --- a/Marco.Pms.Model/ViewModels/Activities/ActivityVM.cs +++ b/Marco.Pms.Model/ViewModels/Activities/ActivityVM.cs @@ -2,7 +2,7 @@ { public class ActivityVM { - public int Id { get; set; } + public Guid Id { get; set; } public string? ActivityName { get; set; } public string? UnitOfMeasurement { get; set; } diff --git a/Marco.Pms.Model/ViewModels/Activities/AssignedTaskVM.cs b/Marco.Pms.Model/ViewModels/Activities/AssignedTaskVM.cs index 03cf13f..6204518 100644 --- a/Marco.Pms.Model/ViewModels/Activities/AssignedTaskVM.cs +++ b/Marco.Pms.Model/ViewModels/Activities/AssignedTaskVM.cs @@ -1,12 +1,11 @@ -using Marco.Pms.Model.Activities; -using Marco.Pms.Model.ViewModels.Employee; +using Marco.Pms.Model.ViewModels.Employee; namespace Marco.Pms.Model.ViewModels.Activities { public class AssignedTaskVM { - public long Id { get; set; } + public Guid Id { get; set; } public DateTime AssignmentDate { get; set; } @@ -18,9 +17,8 @@ namespace Marco.Pms.Model.ViewModels.Activities public EmployeeVM? AssignedBy { get; set; } - public int WorkItemId { get; set; } - public int TenantId { get; set; } - public List? teamMembers { get; set; } + public Guid WorkItemId { get; set; } + public List? teamMembers { get; set; } } } diff --git a/Marco.Pms.Model/ViewModels/Activities/BasicEmployeeVM.cs b/Marco.Pms.Model/ViewModels/Activities/BasicEmployeeVM.cs index 51a254a..ac22b3b 100644 --- a/Marco.Pms.Model/ViewModels/Activities/BasicEmployeeVM.cs +++ b/Marco.Pms.Model/ViewModels/Activities/BasicEmployeeVM.cs @@ -2,11 +2,11 @@ { public class BasicEmployeeVM { - public int Id { get; set; } + public Guid Id { get; set; } public string? FirstName { get; set; } public string? LastName { get; set; } public byte[]? Photo { get; set; } - public int? JobRoleId { get; set; } + public Guid? JobRoleId { get; set; } public string? JobRoleName { get; set; } } } diff --git a/Marco.Pms.Model/ViewModels/Activities/CheckListVM.cs b/Marco.Pms.Model/ViewModels/Activities/CheckListVM.cs index fa9bd12..6fa0bb4 100644 --- a/Marco.Pms.Model/ViewModels/Activities/CheckListVM.cs +++ b/Marco.Pms.Model/ViewModels/Activities/CheckListVM.cs @@ -2,8 +2,8 @@ { public class CheckListVM { - public int Id { get; set; } - public int ActivityId { get; set; } + public Guid Id { get; set; } + public Guid ActivityId { get; set; } public string? Description { get; set; } public bool IsChecked { get; set; } public bool IsMandatory { get; set; } diff --git a/Marco.Pms.Model/ViewModels/Activities/CommentVM.cs b/Marco.Pms.Model/ViewModels/Activities/CommentVM.cs index 3b68ced..fec0069 100644 --- a/Marco.Pms.Model/ViewModels/Activities/CommentVM.cs +++ b/Marco.Pms.Model/ViewModels/Activities/CommentVM.cs @@ -1,14 +1,12 @@ -using Marco.Pms.Model.ViewModels.Employee; - -namespace Marco.Pms.Model.ViewModels.Activities +namespace Marco.Pms.Model.ViewModels.Activities { public class CommentVM { - public long Id { get; set; } - public long TaskAllocationId { get; set; } + public Guid Id { get; set; } + public Guid TaskAllocationId { get; set; } public DateTime CommentDate { get; set; } public string? Comment { get; set; } - public int CommentedBy { get; set; } + public Guid CommentedBy { get; set; } public BasicEmployeeVM? Employee { get; set; } } } diff --git a/Marco.Pms.Model/ViewModels/Activities/ListTaskVM.cs b/Marco.Pms.Model/ViewModels/Activities/ListTaskVM.cs index 21d276c..e4c5a85 100644 --- a/Marco.Pms.Model/ViewModels/Activities/ListTaskVM.cs +++ b/Marco.Pms.Model/ViewModels/Activities/ListTaskVM.cs @@ -1,20 +1,18 @@ using Marco.Pms.Model.Projects; -using Marco.Pms.Model.ViewModels.Employee; namespace Marco.Pms.Model.ViewModels.Activities { public class ListTaskVM { - public long Id { get; set; } + public Guid Id { get; set; } public DateTime AssignmentDate { get; set; } public double PlannedTask { get; set; } public double CompletedTask { get; set; } public BasicEmployeeVM? AssignedBy { get; set; } - public int WorkItemId { get; set; } + public Guid WorkItemId { get; set; } public WorkItem? WorkItem { get; set; } - public int TenantId { get; set; } public List? teamMembers { get; set; } public List? comments { get; set; } - public List? CheckList { get; set; } + public List? CheckList { get; set; } } } diff --git a/Marco.Pms.Model/ViewModels/Activities/ReportTaskVM.cs b/Marco.Pms.Model/ViewModels/Activities/ReportTaskVM.cs index 71e6831..c7b8357 100644 --- a/Marco.Pms.Model/ViewModels/Activities/ReportTaskVM.cs +++ b/Marco.Pms.Model/ViewModels/Activities/ReportTaskVM.cs @@ -1,18 +1,15 @@ -using Marco.Pms.Model.Activities; - -namespace Marco.Pms.Model.ViewModels.Activities +namespace Marco.Pms.Model.ViewModels.Activities { public class ReportTaskVM { - public long Id { get; set; } + public Guid Id { get; set; } public DateTime AssignmentDate { get; set; } public double PlannedTask { get; set; } public double CompletedTask { get; set; } public DateTime? ReportedDate { get; set; } public string? Description { get; set; } - public int AssignedBy { get; set; } - public int WorkItemId { get; set; } - public int TenantId { get; set; } + public Guid AssignedBy { get; set; } + public Guid WorkItemId { get; set; } public List? Comments { get; set; } public List? checkList { get; set; } diff --git a/Marco.Pms.Model/ViewModels/Activities/TaskVM.cs b/Marco.Pms.Model/ViewModels/Activities/TaskVM.cs index 59108ed..d6a09a9 100644 --- a/Marco.Pms.Model/ViewModels/Activities/TaskVM.cs +++ b/Marco.Pms.Model/ViewModels/Activities/TaskVM.cs @@ -1,12 +1,11 @@ -using Marco.Pms.Model.Activities; -using Marco.Pms.Model.Projects; +using Marco.Pms.Model.Projects; using Marco.Pms.Model.ViewModels.Employee; namespace Marco.Pms.Model.ViewModels.Activities { public class TaskVM { - public long Id { get; set; } + public Guid Id { get; set; } public DateTime AssignmentDate { get; set; } public double PlannedTask { get; set; } public double CompletedTask { get; set; } @@ -14,8 +13,6 @@ namespace Marco.Pms.Model.ViewModels.Activities public string? Description { get; set; } public string? AssignBy { get; set; } public WorkItem? WorkItem { get; set; } - public string? Tenant { get; set; } - public List? Comments { get; set; } public List? TeamMembers { get; set; } } diff --git a/Marco.Pms.Model/ViewModels/Activities/TasksVM.cs b/Marco.Pms.Model/ViewModels/Activities/TasksVM.cs index 3b7d3ab..7d20e83 100644 --- a/Marco.Pms.Model/ViewModels/Activities/TasksVM.cs +++ b/Marco.Pms.Model/ViewModels/Activities/TasksVM.cs @@ -2,7 +2,7 @@ { public class TasksVM { - public long Id { get; set; } + public Guid Id { get; set; } public string? ActivityName { get; set; } public double TotalPlannedTask { get; set; } public double PlannedTask { get; set; } diff --git a/Marco.Pms.Model/ViewModels/Activities/WorkItemVM.cs b/Marco.Pms.Model/ViewModels/Activities/WorkItemVM.cs index c0909cd..01ff996 100644 --- a/Marco.Pms.Model/ViewModels/Activities/WorkItemVM.cs +++ b/Marco.Pms.Model/ViewModels/Activities/WorkItemVM.cs @@ -2,7 +2,7 @@ { public class WorkItemVm { - public int Id { get; set; } + public Guid Id { get; set; } public string? ActivityName { get; set; } public double PlannedWork { get; set; } public double CompletedWork { get; set; } diff --git a/Marco.Pms.Model/ViewModels/AttendanceVM/AttendanceLogVM.cs b/Marco.Pms.Model/ViewModels/AttendanceVM/AttendanceLogVM.cs index fd2a9db..f62fb5c 100644 --- a/Marco.Pms.Model/ViewModels/AttendanceVM/AttendanceLogVM.cs +++ b/Marco.Pms.Model/ViewModels/AttendanceVM/AttendanceLogVM.cs @@ -5,7 +5,7 @@ namespace Marco.Pms.Model.ViewModels.AttendanceVM { public class AttendanceLogVM { - public int Id { get; set; } + public Guid Id { get; set; } public string Comment { get; set; } = string.Empty; public BasicEmployeeVM? Employee { get; set; } public DateTime? ActivityTime { get; set; } diff --git a/Marco.Pms.Model/ViewModels/AttendanceVM/EmployeeAttendanceVM.cs b/Marco.Pms.Model/ViewModels/AttendanceVM/EmployeeAttendanceVM.cs index 8d05d5c..e0d8893 100644 --- a/Marco.Pms.Model/ViewModels/AttendanceVM/EmployeeAttendanceVM.cs +++ b/Marco.Pms.Model/ViewModels/AttendanceVM/EmployeeAttendanceVM.cs @@ -4,8 +4,8 @@ namespace Marco.Pms.Model.ViewModels.AttendanceVM { public class EmployeeAttendanceVM { - public int Id { get; set; } - public int EmployeeId { get; set; } + public Guid Id { get; set; } + public Guid EmployeeId { get; set; } public string? FirstName { get; set; } public string? LastName { get; set; } public string? EmployeeAvatar { get; set; } diff --git a/Marco.Pms.Model/ViewModels/DashBoard/ProjectProgressionVM.cs b/Marco.Pms.Model/ViewModels/DashBoard/ProjectProgressionVM.cs index 8c6004c..53196cc 100644 --- a/Marco.Pms.Model/ViewModels/DashBoard/ProjectProgressionVM.cs +++ b/Marco.Pms.Model/ViewModels/DashBoard/ProjectProgressionVM.cs @@ -2,7 +2,7 @@ { public class ProjectProgressionVM { - public int ProjectId { get; set; } + public Guid ProjectId { get; set; } public string? ProjectName { get; set; } public double PlannedTask { get; set; } public double CompletedTask { get; set; } diff --git a/Marco.Pms.Model/ViewModels/Employee/EmployeeVM.cs b/Marco.Pms.Model/ViewModels/Employee/EmployeeVM.cs index 4ca84c0..52ecf1a 100644 --- a/Marco.Pms.Model/ViewModels/Employee/EmployeeVM.cs +++ b/Marco.Pms.Model/ViewModels/Employee/EmployeeVM.cs @@ -2,14 +2,14 @@ { public class EmployeeVM { - public int Id { get; set; } + public Guid Id { get; set; } public string? FirstName { get; set; } public string? LastName { get; set; } public string? MiddleName { get; set; } public string? Email { get; set; } public string? Gender { get; set; } - public DateTime? BirthDate { get; set; } + public DateTime? BirthDate { get; set; } public DateTime? JoiningDate { get; set; } public string? PermanentAddress { get; set; } public string? CurrentAddress { get; set; } @@ -26,8 +26,8 @@ public byte[]? Photo { get; set; } // To store the captured photo public string? ApplicationUserId { get; set; } - - public int? JobRoleId { get; set; } + + public Guid? JobRoleId { get; set; } public string? JobRole { get; set; } } diff --git a/Marco.Pms.Model/ViewModels/EmployeeRolesVM.cs b/Marco.Pms.Model/ViewModels/EmployeeRolesVM.cs index 9362944..8b1509c 100644 --- a/Marco.Pms.Model/ViewModels/EmployeeRolesVM.cs +++ b/Marco.Pms.Model/ViewModels/EmployeeRolesVM.cs @@ -3,7 +3,7 @@ public class EmployeeRolesVM { public Guid Id { get; set; } - public int EmployeeId { get; set; } + public Guid EmployeeId { get; set; } public Guid RoleId { get; set; } public string? Name { get; set; } public string? Description { get; set; } diff --git a/Marco.Pms.Model/ViewModels/FeatureVM.cs b/Marco.Pms.Model/ViewModels/FeatureVM.cs index 0f14530..4fe470f 100644 --- a/Marco.Pms.Model/ViewModels/FeatureVM.cs +++ b/Marco.Pms.Model/ViewModels/FeatureVM.cs @@ -7,7 +7,7 @@ public string? Name { get; set; } // Feature name public string? Description { get; set; } // Feature description public bool IsActive { get; set; } - public int? ModuleId { get; set; } + public Guid? ModuleId { get; set; } public string? ModuleName { get; set; } public string? ModuleKey { get; set; } diff --git a/Marco.Pms.Model/ViewModels/Forum/ForumTicketVM.cs b/Marco.Pms.Model/ViewModels/Forum/ForumTicketVM.cs index 37afa35..d2fd90e 100644 --- a/Marco.Pms.Model/ViewModels/Forum/ForumTicketVM.cs +++ b/Marco.Pms.Model/ViewModels/Forum/ForumTicketVM.cs @@ -12,9 +12,9 @@ namespace Marco.Pms.Model.ViewModels.Forum public TicketPriorityVM? Priority { get; set; } public BasicEmployeeVM? CreatedBy { get; set; } public DateTime CreatedAt { get; set; } - public int LinkedProjectId { get; set; } + public Guid? LinkedProjectId { get; set; } public string? ProjectName { get; set; } - public int? LinkedActivityId { get; set; } // task or project ID + public Guid? LinkedActivityId { get; set; } // task or project ID public string? ActivityName { get; set; } public ICollection? Comments { get; set; } // view model public ICollection? Attachments { get; set; } // view model diff --git a/Marco.Pms.Model/ViewModels/JobRoleVM.cs b/Marco.Pms.Model/ViewModels/JobRoleVM.cs index 06a817b..57ab563 100644 --- a/Marco.Pms.Model/ViewModels/JobRoleVM.cs +++ b/Marco.Pms.Model/ViewModels/JobRoleVM.cs @@ -3,9 +3,9 @@ public class JobRoleVM { - public int? Id { get; set; } - public string? Name { get; set; } - public string? Description { get; set; } - + public Guid? Id { get; set; } + public string? Name { get; set; } + public string? Description { get; set; } + } } diff --git a/Marco.Pms.Model/ViewModels/ProjectListVM.cs b/Marco.Pms.Model/ViewModels/ProjectListVM.cs index ae42584..888d64b 100644 --- a/Marco.Pms.Model/ViewModels/ProjectListVM.cs +++ b/Marco.Pms.Model/ViewModels/ProjectListVM.cs @@ -2,15 +2,14 @@ { public class ProjectListVM { - public int Id { get; set; } + public Guid Id { get; set; } public string? Name { get; set; } public string? ProjectAddress { get; set; } public string? ContactPerson { get; set; } public DateTime? StartDate { get; set; } public DateTime? EndDate { get; set; } - public int ProjectStatusId { get; set; } - public int TenantId { get; set; } + public Guid ProjectStatusId { get; set; } public int TeamSize { get; set; } public double CompletedWork { get; set; } public double PlannedWork { get; set; } diff --git a/Marco.Pms.Services/Controllers/AttendanceController.cs b/Marco.Pms.Services/Controllers/AttendanceController.cs index 81a0f30..6af54d7 100644 --- a/Marco.Pms.Services/Controllers/AttendanceController.cs +++ b/Marco.Pms.Services/Controllers/AttendanceController.cs @@ -42,7 +42,7 @@ namespace MarcoBMS.Services.Controllers _logger = logger; } - private int GetTenantId() + private Guid GetTenantId() { return _userHelper.GetTenantId(); //var tenant = User.FindFirst("TenantId")?.Value; @@ -51,9 +51,9 @@ namespace MarcoBMS.Services.Controllers [HttpGet("log/attendance/{attendanceid}")] - public async Task GetAttendanceLogById(int attendanceid) + public async Task GetAttendanceLogById(Guid attendanceid) { - int TenantId = GetTenantId(); + Guid TenantId = GetTenantId(); List lstAttendance = await _context.AttendanceLogs.Include(a => a.Document).Include(a => a.Employee).Include(a => a.UpdatedByEmployee).Where(c => c.AttendanceId == attendanceid && c.TenantId == TenantId).ToListAsync(); List attendanceLogVMs = new List(); @@ -69,9 +69,9 @@ namespace MarcoBMS.Services.Controllers } [HttpGet("log/employee/{employeeid}")] - public async Task GetAttendanceLogByEmployeeId(int employeeid, [FromQuery] string? date = null) + public async Task GetAttendanceLogByEmployeeId(Guid employeeid, [FromQuery] string? date = null) { - int TenantId = GetTenantId(); + Guid TenantId = GetTenantId(); DateOnly forDate = new DateOnly(); if (date != null && DateOnly.TryParse(date, out forDate) == false) @@ -95,9 +95,9 @@ namespace MarcoBMS.Services.Controllers /// [HttpGet("project/log")] - public async Task EmployeeAttendanceByDateRange([FromQuery] int projectId, [FromQuery] string? dateFrom = null, [FromQuery] string? dateTo = null) + public async Task EmployeeAttendanceByDateRange([FromQuery] Guid projectId, [FromQuery] string? dateFrom = null, [FromQuery] string? dateTo = null) { - int TenantId = GetTenantId(); + Guid TenantId = GetTenantId(); DateTime fromDate = new DateTime(); DateTime toDate = new DateTime(); @@ -112,7 +112,7 @@ namespace MarcoBMS.Services.Controllers return BadRequest(ApiResponse.ErrorResponse("Invalid Date", "Invalid Date", 400)); } - if (projectId <= 0) + if (projectId == Guid.Empty) { _logger.LogError("The project Id sent by user is less than or equal to zero"); return BadRequest(ApiResponse.ErrorResponse("Project ID is required and must be greater than zero.", "Project ID is required and must be greater than zero.", 400)); @@ -163,9 +163,9 @@ namespace MarcoBMS.Services.Controllers /// [HttpGet("project/team")] - public async Task EmployeeAttendanceByProject([FromQuery] int projectId, [FromQuery] bool IncludeInActive, [FromQuery] string? date = null) + public async Task EmployeeAttendanceByProject([FromQuery] Guid projectId, [FromQuery] bool IncludeInActive, [FromQuery] string? date = null) { - int TenantId = GetTenantId(); + Guid TenantId = GetTenantId(); DateTime forDate = new DateTime(); if (date != null && DateTime.TryParse(date, out forDate) == false) @@ -174,7 +174,7 @@ namespace MarcoBMS.Services.Controllers return BadRequest(ApiResponse.ErrorResponse("Invalid Date", "Invalid Date", 400)); } - if (projectId <= 0) + if (projectId == Guid.Empty) { _logger.LogError("The project Id sent by user is less than or equal to zero"); return BadRequest(ApiResponse.ErrorResponse("Project ID is required and must be greater than zero.", "Project ID is required and must be greater than zero.", 400)); @@ -234,9 +234,9 @@ namespace MarcoBMS.Services.Controllers [HttpGet("regularize")] - public async Task GetRequestRegularizeAttendance([FromQuery] int projectId, [FromQuery] bool IncludeInActive) + public async Task GetRequestRegularizeAttendance([FromQuery] Guid projectId, [FromQuery] bool IncludeInActive) { - int TenantId = GetTenantId(); + Guid TenantId = GetTenantId(); var result = new List(); List lstAttendance = await _context.Attendes.Where(c => c.ProjectID == projectId && c.Activity == ATTENDANCE_MARK_TYPE.REQUEST_REGULARIZE && c.TenantId == TenantId).ToListAsync(); @@ -293,7 +293,7 @@ namespace MarcoBMS.Services.Controllers return BadRequest(ApiResponse.ErrorResponse("Invalid data", errors, 400)); } - int TenantId = GetTenantId(); + Guid TenantId = GetTenantId(); using var transaction = await _context.Database.BeginTransactionAsync(); try @@ -452,7 +452,7 @@ namespace MarcoBMS.Services.Controllers return BadRequest(ApiResponse.ErrorResponse("Invalid data", errors, 400)); } - int TenantId = GetTenantId(); + Guid TenantId = GetTenantId(); using var transaction = await _context.Database.BeginTransactionAsync(); try diff --git a/Marco.Pms.Services/Controllers/AuthController.cs b/Marco.Pms.Services/Controllers/AuthController.cs index b50ed8f..32e3305 100644 --- a/Marco.Pms.Services/Controllers/AuthController.cs +++ b/Marco.Pms.Services/Controllers/AuthController.cs @@ -18,7 +18,7 @@ namespace MarcoBMS.Services.Controllers [Route("api/[controller]")] public class AuthController : ControllerBase { - private readonly UserManager _userManager; + private readonly UserManager _userManager; private readonly ApplicationDbContext _context; private readonly JwtSettings _jwtSettings; private readonly RefreshTokenService _refreshTokenService; @@ -26,7 +26,7 @@ namespace MarcoBMS.Services.Controllers private readonly IConfiguration _configuration; private readonly EmployeeHelper _employeeHelper; //string tenentId = "1"; - public AuthController(UserManager userManager, ApplicationDbContext context, JwtSettings jwtSettings, RefreshTokenService refreshTokenService, + public AuthController(UserManager userManager, ApplicationDbContext context, JwtSettings jwtSettings, RefreshTokenService refreshTokenService, IEmailSender emailSender, IConfiguration configuration, EmployeeHelper employeeHelper) { _userManager = userManager; @@ -57,7 +57,7 @@ namespace MarcoBMS.Services.Controllers //var refreshToken = GenerateRefreshToken(); if (user.UserName == null) return NotFound(ApiResponse.ErrorResponse("UserName Not found", "UserName Not found", 404)); ; - var token = _refreshTokenService.GenerateJwtToken(user.UserName, emp.TenantId.ToString(), _jwtSettings); + var token = _refreshTokenService.GenerateJwtToken(user.UserName, emp.TenantId, _jwtSettings); var refreshToken = await _refreshTokenService.CreateRefreshToken(user.Id, emp.TenantId.ToString(), _jwtSettings); @@ -122,7 +122,7 @@ namespace MarcoBMS.Services.Controllers if (user.UserName == null) return NotFound(ApiResponse.ErrorResponse("UserName Not found", "UserName Not found", 404)); - var newJwtToken = _refreshTokenService.GenerateJwtToken(user.UserName, emp.TenantId.ToString(), _jwtSettings); + var newJwtToken = _refreshTokenService.GenerateJwtToken(user.UserName, emp.TenantId, _jwtSettings); var newRefreshToken = await _refreshTokenService.CreateRefreshToken(user.Id, emp.TenantId.ToString(), _jwtSettings); return Ok(ApiResponse.SuccessResponse(new { token = newJwtToken, refreshToken = newRefreshToken }, "User refresh token generated successfully.", 200)); diff --git a/Marco.Pms.Services/Controllers/DashboardController.cs b/Marco.Pms.Services/Controllers/DashboardController.cs index 446a36b..a6983ee 100644 --- a/Marco.Pms.Services/Controllers/DashboardController.cs +++ b/Marco.Pms.Services/Controllers/DashboardController.cs @@ -23,7 +23,7 @@ namespace Marco.Pms.Services.Controllers _userHelper = userHelper; } [HttpGet("progression")] - public async Task GetGraph([FromQuery] double days, [FromQuery] int projectId, [FromQuery] string? FromDate) + public async Task GetGraph([FromQuery] double days, [FromQuery] string FromDate, [FromQuery] Guid? projectId) { var tenantId = _userHelper.GetTenantId(); DateTime fromDate = new DateTime(); @@ -48,7 +48,7 @@ namespace Marco.Pms.Services.Controllers { toDate = firstTask.AssignmentDate; } - if (projectId == 0) + if (projectId == null) { List tasks = await _context.TaskAllocations.Where(t => t.AssignmentDate.Date <= fromDate.Date && t.AssignmentDate.Date >= toDate.Date && t.TenantId == tenantId).ToListAsync(); @@ -56,7 +56,7 @@ namespace Marco.Pms.Services.Controllers while (negativeDays < flagDays) { ProjectProgressionVM ProjectProgressionVM = new ProjectProgressionVM(); - ProjectProgressionVM.ProjectId = projectId; + ProjectProgressionVM.ProjectId = projectId != null ? projectId.Value : Guid.Empty; ProjectProgressionVM.ProjectName = ""; var date = fromDate.AddDays(flagDays); if (date >= (firstTask != null ? firstTask.AssignmentDate.Date : null)) @@ -83,7 +83,7 @@ namespace Marco.Pms.Services.Controllers { var project = await _context.Projects.FirstOrDefaultAsync(p => p.Id == projectId); List buildings = await _context.Buildings.Where(b => b.ProjectId == projectId && b.TenantId == tenantId).ToListAsync(); - List idList = buildings.Select(b => b.Id).ToList(); + List idList = buildings.Select(b => b.Id).ToList(); List floors = await _context.Floor.Where(f => idList.Contains(f.BuildingId) && f.TenantId == tenantId).ToListAsync(); idList = floors.Select(f => f.Id).ToList(); @@ -101,7 +101,7 @@ namespace Marco.Pms.Services.Controllers while (negativeDays < flagDays) { ProjectProgressionVM projectProgressionVM = new ProjectProgressionVM(); - projectProgressionVM.ProjectId = projectId; + projectProgressionVM.ProjectId = projectId.Value; projectProgressionVM.ProjectName = project.Name; var date = fromDate.AddDays(flagDays); if (date >= (firstTask != null ? firstTask.AssignmentDate.Date : null)) @@ -136,7 +136,9 @@ namespace Marco.Pms.Services.Controllers var tenantId = _userHelper.GetTenantId(); var projects = await _context.Projects.Where(p => p.TenantId == tenantId).ToListAsync(); - var ongoingProjects = projects.Where(p => p.ProjectStatusId == 1 || p.ProjectStatusId == 2).ToList(); + var projectStatus = await _context.StatusMasters.Where(s => s.Status == "Active" || s.Status == "In Progress").ToListAsync(); + var projectStatusIds = projectStatus.Select(s => s.Id).ToList(); + var ongoingProjects = projects.Where(p => projectStatusIds.Contains(p.ProjectStatusId)).ToList(); ProjectDashboardVM projectDashboardVM = new ProjectDashboardVM { diff --git a/Marco.Pms.Services/Controllers/EmployeeController.cs b/Marco.Pms.Services/Controllers/EmployeeController.cs index 978ec11..3ccbd1f 100644 --- a/Marco.Pms.Services/Controllers/EmployeeController.cs +++ b/Marco.Pms.Services/Controllers/EmployeeController.cs @@ -25,14 +25,14 @@ namespace MarcoBMS.Services.Controllers { private readonly ApplicationDbContext _context; - private readonly UserManager _userManager; + private readonly UserManager _userManager; private readonly IEmailSender _emailSender; private readonly EmployeeHelper _employeeHelper; private readonly UserHelper _userHelper; private readonly IConfiguration _configuration; - public EmployeeController(UserManager userManager, IEmailSender emailSender, + public EmployeeController(UserManager userManager, IEmailSender emailSender, ApplicationDbContext context, EmployeeHelper employeeHelper, UserHelper userHelper, IConfiguration configuration) { _context = context; @@ -45,7 +45,7 @@ namespace MarcoBMS.Services.Controllers [HttpGet] [Route("roles/{employeeId?}")] - public async Task GetRoles(int employeeId) + public async Task GetRoles(Guid employeeId) { if (!ModelState.IsValid) { @@ -55,7 +55,7 @@ namespace MarcoBMS.Services.Controllers .ToList(); return BadRequest(ApiResponse.ErrorResponse("Invalid data", errors, 400)); } - int tenantId = GetTenantId(); + Guid tenantId = GetTenantId(); var empRoles = await _context.EmployeeRoleMappings.Where(c => c.EmployeeId == employeeId).Include(c => c.Role).Include(c => c.Employee).ToListAsync(); if (empRoles.Any()) @@ -95,7 +95,7 @@ namespace MarcoBMS.Services.Controllers return BadRequest(ApiResponse.ErrorResponse("Invalid data", errors, 400)); } - int TenantId = GetTenantId(); + Guid TenantId = GetTenantId(); try { foreach (EmployeeRoleDot role in employeeRoleDots) @@ -129,7 +129,7 @@ namespace MarcoBMS.Services.Controllers [HttpGet] [Route("list/{projectid?}")] - public async Task GetEmployeesByProject(int? projectid) + public async Task GetEmployeesByProject(Guid? projectid) { if (!ModelState.IsValid) { @@ -146,7 +146,7 @@ namespace MarcoBMS.Services.Controllers } [HttpGet] [Route("search/{name}/{projectid?}")] - public async Task SearchEmployee(string name, int? projectid) + public async Task SearchEmployee(string name, Guid? projectid) { if (!ModelState.IsValid) { @@ -164,7 +164,7 @@ namespace MarcoBMS.Services.Controllers [HttpGet] [Route("profile/get/{employeeId}")] - public async Task GetEmployeeProfileById(int employeeId) + public async Task GetEmployeeProfileById(Guid employeeId) { if (!ModelState.IsValid) { @@ -181,7 +181,7 @@ namespace MarcoBMS.Services.Controllers return Ok(ApiResponse.SuccessResponse(employeeVM, "Employee Profile.", 200)); } - private int GetTenantId() + private Guid GetTenantId() { return _userHelper.GetTenantId(); } @@ -195,11 +195,10 @@ namespace MarcoBMS.Services.Controllers [HttpPost("manage")] public async Task CreateUser([FromForm] CreateUserDto model) { - int tenantId = _userHelper.GetTenantId(); + Guid tenantId = _userHelper.GetTenantId(); if (model == null) return BadRequest(ApiResponse.ErrorResponse("Invalid data", "Invaild Data", 400)); - int TenantId = GetTenantId(); string responsemessage = ""; if (model.Email != null) @@ -250,7 +249,7 @@ namespace MarcoBMS.Services.Controllers if (existingEmployee == null) { - Employee newEmployee = GetNewEmployeeModel(model, TenantId, user.Id); + Employee newEmployee = GetNewEmployeeModel(model, tenantId, user.Id); _context.Employees.Add(newEmployee); await _context.SaveChangesAsync(); @@ -300,7 +299,7 @@ namespace MarcoBMS.Services.Controllers else { // Create Employee record if missing - Employee newEmployee = GetNewEmployeeModel(model, TenantId, null); + Employee newEmployee = GetNewEmployeeModel(model, tenantId, null); _context.Employees.Add(newEmployee); } @@ -311,7 +310,7 @@ namespace MarcoBMS.Services.Controllers return Ok(ApiResponse.SuccessResponse("Success.", responsemessage, 200)); } #nullable disable - private static Employee GetNewEmployeeModel(CreateUserDto model, int TenantId, string ApplicationUserId) + private static Employee GetNewEmployeeModel(CreateUserDto model, Guid TenantId, string ApplicationUserId) { var newEmployee = new Employee { @@ -331,7 +330,7 @@ namespace MarcoBMS.Services.Controllers PermanentAddress = model.PermanentAddress, PhoneNumber = model.PhoneNumber, Photo = null, // GetFileDetails(model.Photo).Result.FileData, - JobRoleId = Convert.ToInt32(model.JobRoleId), + JobRoleId = model.JobRoleId, JoiningDate = Convert.ToDateTime(model.JoiningDate), }; @@ -358,7 +357,7 @@ namespace MarcoBMS.Services.Controllers existingEmployee.PermanentAddress = model.PermanentAddress; existingEmployee.PhoneNumber = model.PhoneNumber; existingEmployee.Photo = null; // GetFileDetails(model.Photo).Result.FileData, - existingEmployee.JobRoleId = Convert.ToInt32(model.JobRoleId); + existingEmployee.JobRoleId = model.JobRoleId; return existingEmployee; } diff --git a/Marco.Pms.Services/Controllers/FeatureController.cs b/Marco.Pms.Services/Controllers/FeatureController.cs index 755e8ed..ea8c539 100644 --- a/Marco.Pms.Services/Controllers/FeatureController.cs +++ b/Marco.Pms.Services/Controllers/FeatureController.cs @@ -3,7 +3,6 @@ using Marco.Pms.Model.Entitlements; using Marco.Pms.Model.Mapper; using Marco.Pms.Model.Utilities; using Marco.Pms.Model.ViewModels; -using Microsoft.AspNetCore.Identity; using Microsoft.AspNetCore.Mvc; using Microsoft.EntityFrameworkCore; @@ -16,12 +15,10 @@ namespace MarcoBMS.Services.Controllers { private readonly ApplicationDbContext _context; - private readonly UserManager _userManager; - public FeatureController(UserManager userManager, ApplicationDbContext context) + public FeatureController(ApplicationDbContext context) { _context = context; - _userManager = userManager; } private ICollection GetFeaturePermissionVMs(Feature model) diff --git a/Marco.Pms.Services/Controllers/FileController.cs b/Marco.Pms.Services/Controllers/FileController.cs index 86e5517..ac8282a 100644 --- a/Marco.Pms.Services/Controllers/FileController.cs +++ b/Marco.Pms.Services/Controllers/FileController.cs @@ -20,7 +20,7 @@ namespace MarcoBMS.Services.Controllers [HttpPost("fileupload")] public async Task FileUploadDemo([FromForm] DemoEmployeeModel model) { - if(model.ImageFile == null) {return BadRequest(ApiResponse.ErrorResponse("Error.", "Error.", 400));} + if (model.ImageFile == null) { return BadRequest(ApiResponse.ErrorResponse("Error.", "Error.", 400)); } string imageName = await Saveimage(model.ImageFile); return Ok(ApiResponse.SuccessResponse("Success.", "Success.", 200)); } diff --git a/Marco.Pms.Services/Controllers/ForumController.cs b/Marco.Pms.Services/Controllers/ForumController.cs index d587e03..130bc0d 100644 --- a/Marco.Pms.Services/Controllers/ForumController.cs +++ b/Marco.Pms.Services/Controllers/ForumController.cs @@ -46,7 +46,7 @@ namespace Marco.Pms.Services.Controllers _logger.LogError("{error}", errors); return BadRequest(ApiResponse.ErrorResponse("Invalid data", errors, 400)); } - int tenantId = _userHelper.GetTenantId(); + Guid tenantId = _userHelper.GetTenantId(); TicketForum ticketForum = createTicketDto.ToTicketForumFromCreateTicketDto(tenantId); _context.Tickets.Add(ticketForum); await _context.SaveChangesAsync(); @@ -124,7 +124,7 @@ namespace Marco.Pms.Services.Controllers ticketVM.Attachments = attachmentVMs; Project project = await _context.Projects.FirstOrDefaultAsync(p => p.Id == ticketForum.LinkedProjectId) ?? new Project(); ticketVM.ProjectName = project.Name; - if (createTicketDto.LinkedActivityId != null && createTicketDto.LinkedActivityId != 0) + if (createTicketDto.LinkedActivityId != null && createTicketDto.LinkedActivityId != null) { WorkItem workItem = await _context.WorkItems.Include(w => w.ActivityMaster).FirstOrDefaultAsync(w => w.Id == ticketForum.LinkedActivityId) ?? new WorkItem(); if (workItem.ActivityMaster != null) @@ -151,169 +151,164 @@ namespace Marco.Pms.Services.Controllers _logger.LogError("{error}", errors); return BadRequest(ApiResponse.ErrorResponse("Invalid data", errors, 400)); } - int tenantId = _userHelper.GetTenantId(); - if (tenantId == updateTicketDto.TenantId) + Guid tenantId = _userHelper.GetTenantId(); + var existingTicket = await _context.Tickets.Include(t => t.TicketTypeMaster).Include(t => t.TicketStatusMaster).Include(t => t.Priority).AsNoTracking().FirstOrDefaultAsync(t => t.Id == updateTicketDto.Id); + if (existingTicket != null) { - var existingTicket = await _context.Tickets.Include(t => t.TicketTypeMaster).Include(t => t.TicketStatusMaster).Include(t => t.Priority).AsNoTracking().FirstOrDefaultAsync(t => t.Id == updateTicketDto.Id); - if (existingTicket != null) + TicketForum ticketForum = updateTicketDto.ToTicketForumFromUpdateTicketDto(existingTicket); + _context.Tickets.Update(ticketForum); + await _context.SaveChangesAsync(); + + + List attachments = new List(); + List ticketTags = new List(); + List tagVMs = new List(); + + List existingAttachments = await _context.TicketAttachments.Where(a => a.TicketId == updateTicketDto.Id).ToListAsync(); + var existingattachmentids = existingAttachments.Select(a => a.Id).ToList(); + List attachmentDtoids = new List(); + if (updateTicketDto.Attachments != null) { - TicketForum ticketForum = updateTicketDto.ToTicketForumFromUpdateTicketDto(existingTicket); - _context.Tickets.Update(ticketForum); - await _context.SaveChangesAsync(); - - - List attachments = new List(); - List ticketTags = new List(); - List tagVMs = new List(); - - List existingAttachments = await _context.TicketAttachments.Where(a => a.TicketId == updateTicketDto.Id).ToListAsync(); - var existingattachmentids = existingAttachments.Select(a => a.Id).ToList(); - List attachmentDtoids = new List(); - if (updateTicketDto.Attachments != null) + attachmentDtoids = updateTicketDto.Attachments.Select(a => a.Id).ToList(); + foreach (var attachmentDto in updateTicketDto.Attachments) { - attachmentDtoids = updateTicketDto.Attachments.Select(a => a.Id).ToList(); - foreach (var attachmentDto in updateTicketDto.Attachments) + if (!existingattachmentids.Contains(attachmentDto.Id) && attachmentDto.TicketId != updateTicketDto.Id) { - if (!existingattachmentids.Contains(attachmentDto.Id) && attachmentDto.TicketId != updateTicketDto.Id) + var Image = attachmentDto; + if (string.IsNullOrEmpty(Image.Base64Data)) { - var Image = attachmentDto; - if (string.IsNullOrEmpty(Image.Base64Data)) - { - _logger.LogError("Base64 data is missing"); - return BadRequest(ApiResponse.ErrorResponse("Base64 data is missing", "Base64 data is missing", 400)); - } - - var objectKey = await _s3Service.UploadFileAsync(Image.Base64Data, tenantId, "forum"); - - Document document = attachmentDto.ToDocumentFromUpdateAttachmentDto(objectKey, objectKey, updateTicketDto.CreatedAt, tenantId); - _context.Documents.Add(document); - await _context.SaveChangesAsync(); - - var attachment = attachmentDto.ToTicketAttachmentFromUpdateAttachmentDto(ticketForum.Id, document.Id); - attachments.Add(attachment); + _logger.LogError("Base64 data is missing"); + return BadRequest(ApiResponse.ErrorResponse("Base64 data is missing", "Base64 data is missing", 400)); } + + var objectKey = await _s3Service.UploadFileAsync(Image.Base64Data, tenantId, "forum"); + + Document document = attachmentDto.ToDocumentFromUpdateAttachmentDto(objectKey, objectKey, updateTicketDto.CreatedAt, tenantId); + _context.Documents.Add(document); + await _context.SaveChangesAsync(); + + var attachment = attachmentDto.ToTicketAttachmentFromUpdateAttachmentDto(ticketForum.Id, document.Id); + attachments.Add(attachment); } } - if (attachments.Count != 0) - { - _context.TicketAttachments.AddRange(attachments); - } - var deletedAttachments = existingAttachments.Where(a => !attachmentDtoids.Contains(a.Id) && a.CommentId == null).ToList(); - var deletedFileIds = deletedAttachments.Select(a => a.FileId).ToList(); - if (deletedFileIds.Count != 0) - { - List existingDocuments = await _context.Documents.Where(d => deletedFileIds.Contains(d.Id)).ToListAsync(); - foreach (var existingDocument in existingDocuments) - { - await _s3Service.DeleteFileAsync(existingDocument.S3Key); - //await _s3Service.DeleteFileAsync(existingDocument.ThumbS3Key); - } - _context.TicketAttachments.RemoveRange(deletedAttachments); - } - - List existingTicketTags = await _context.TicketTags.Where(t => t.TicketId == updateTicketDto.Id).ToListAsync(); - List? tagMasters = await _context.TicketTagMasters.Where(t => updateTicketDto.TagIds != null ? updateTicketDto.TagIds.Contains(t.Id) : false).ToListAsync(); - var existingTicketTagIds = existingTicketTags.Select(t => t.TagId).ToList(); - - foreach (var ticketTag in tagMasters) - { - TicketTagVM tagVM = ticketTag.ToTicketTagVMFromTicketTagMaster(); - - TicketTag tag = new TicketTag - { - TicketId = ticketForum.Id, - TagId = ticketTag.Id - }; - tagVMs.Add(tagVM); - var demo = !existingTicketTagIds.Contains(tag.TagId); - if (!existingTicketTagIds.Contains(tag.TagId)) - { - ticketTags.Add(tag); - } - } - - if (ticketTags != null) - { - _context.TicketTags.AddRange(ticketTags); - } - var deletedTicketTags = existingTicketTags.Where(t => updateTicketDto.TagIds != null ? !updateTicketDto.TagIds.Contains(t.TagId) : true).ToList(); - if (deletedTicketTags.Count != 0) - { - _context.TicketTags.RemoveRange(deletedTicketTags); - } - await _context.SaveChangesAsync(); - - var ticket = await _context.Tickets.Include(t => t.TicketTypeMaster).Include(t => t.TicketStatusMaster).Include(t => t.Priority).FirstOrDefaultAsync(t => t.Id == ticketForum.Id); - ForumTicketVM ticketVM = new ForumTicketVM(); - if (ticket != null) - { - List comments = await _context.TicketComments.Where(c => c.TicketId == ticket.Id).ToListAsync(); - var authorIds = comments.Select(c => c.AuthorId.ToString()).ToList(); - - List? employees = await _context.Employees.Where(e => e.Id == ticketForum.CreatedById || authorIds.Contains(e.ApplicationUserId ?? "")).ToListAsync(); - - Employee employee = employees.Find(e => e.Id == ticketForum.CreatedById) ?? new Employee(); - ticketVM = ticket.ToForumTicketVMFromTicketForum(employee); - - ticketVM.Tags = tagVMs; - - List commentVMs = new List(); - foreach (var comment in comments) - { - employee = employees.Find(e => e.ApplicationUserId == comment.AuthorId.ToString()) ?? new Employee(); - commentVMs.Add(comment.ToTicketCommentVMFromTicketComment(employee)); - } - - attachments = await _context.TicketAttachments.Where(a => a.TicketId == updateTicketDto.Id).ToListAsync(); - var fileIds = attachments.Select(a => a.FileId).ToList(); - List documents = await _context.Documents.Where(d => fileIds.Contains(d.Id)).ToListAsync(); - List ticketAttachmentVMs = new List(); - foreach (var attachment in attachments) - { - var document = documents.Find(d => d.Id == attachment.FileId); - string preSignedUrl = string.Empty; - if (document != null) - { - preSignedUrl = _s3Service.GeneratePreSignedUrlAsync(document.S3Key); - } - if (attachment.CommentId == null) - { - ticketAttachmentVMs.Add(attachment.ToTicketAttachmentVMFromTicketAttachment(preSignedUrl, preSignedUrl)); - } - else - { - var commentVM = commentVMs.Find(c => c.Id == attachment.CommentId); - if (commentVM != null && commentVM.Attachments != null) - { - commentVM.Attachments.Add(attachment.ToTicketAttachmentVMFromTicketAttachment(preSignedUrl, preSignedUrl)); - } - } - } - ticketVM.Comments = commentVMs; - ticketVM.Attachments = ticketAttachmentVMs; - Project project = await _context.Projects.FirstOrDefaultAsync(p => p.Id == ticketForum.LinkedProjectId) ?? new Project(); - ticketVM.ProjectName = project.Name; - if (updateTicketDto.LinkedActivityId != null && updateTicketDto.LinkedActivityId != 0) - { - WorkItem workItem = await _context.WorkItems.Include(w => w.ActivityMaster).FirstOrDefaultAsync(w => w.Id == ticketForum.LinkedActivityId) ?? new WorkItem(); - if (workItem.ActivityMaster != null) - { - ticketVM.ActivityName = workItem.ActivityMaster.ActivityName; - } - else - { - ticketVM.ActivityName = ""; - } - } - } - _logger.LogInfo("Ticket {TicketId} updated", updateTicketDto.Id); - return Ok(ApiResponse.SuccessResponse(ticketVM, "Ticket Updated Successfully", 200)); } - _logger.LogError("Ticket {TicketId} not Found in database", updateTicketDto.Id); - return NotFound(ApiResponse.ErrorResponse("Ticket not Found", "Ticket not Found", 404)); + if (attachments.Count != 0) + { + _context.TicketAttachments.AddRange(attachments); + } + var deletedAttachments = existingAttachments.Where(a => !attachmentDtoids.Contains(a.Id) && a.CommentId == null).ToList(); + var deletedFileIds = deletedAttachments.Select(a => a.FileId).ToList(); + if (deletedFileIds.Count != 0) + { + List existingDocuments = await _context.Documents.Where(d => deletedFileIds.Contains(d.Id)).ToListAsync(); + foreach (var existingDocument in existingDocuments) + { + await _s3Service.DeleteFileAsync(existingDocument.S3Key); + //await _s3Service.DeleteFileAsync(existingDocument.ThumbS3Key); + } + _context.TicketAttachments.RemoveRange(deletedAttachments); + } + + List existingTicketTags = await _context.TicketTags.Where(t => t.TicketId == updateTicketDto.Id).ToListAsync(); + List? tagMasters = await _context.TicketTagMasters.Where(t => updateTicketDto.TagIds != null ? updateTicketDto.TagIds.Contains(t.Id) : false).ToListAsync(); + var existingTicketTagIds = existingTicketTags.Select(t => t.TagId).ToList(); + + foreach (var ticketTag in tagMasters) + { + TicketTagVM tagVM = ticketTag.ToTicketTagVMFromTicketTagMaster(); + + TicketTag tag = new TicketTag + { + TicketId = ticketForum.Id, + TagId = ticketTag.Id + }; + tagVMs.Add(tagVM); + var demo = !existingTicketTagIds.Contains(tag.TagId); + if (!existingTicketTagIds.Contains(tag.TagId)) + { + ticketTags.Add(tag); + } + } + + if (ticketTags != null) + { + _context.TicketTags.AddRange(ticketTags); + } + var deletedTicketTags = existingTicketTags.Where(t => updateTicketDto.TagIds != null ? !updateTicketDto.TagIds.Contains(t.TagId) : true).ToList(); + if (deletedTicketTags.Count != 0) + { + _context.TicketTags.RemoveRange(deletedTicketTags); + } + await _context.SaveChangesAsync(); + + var ticket = await _context.Tickets.Include(t => t.TicketTypeMaster).Include(t => t.TicketStatusMaster).Include(t => t.Priority).FirstOrDefaultAsync(t => t.Id == ticketForum.Id); + ForumTicketVM ticketVM = new ForumTicketVM(); + if (ticket != null) + { + List comments = await _context.TicketComments.Where(c => c.TicketId == ticket.Id).ToListAsync(); + var authorIds = comments.Select(c => c.AuthorId.ToString()).ToList(); + + List? employees = await _context.Employees.Where(e => e.Id == ticketForum.CreatedById || authorIds.Contains(e.ApplicationUserId ?? "")).ToListAsync(); + + Employee employee = employees.Find(e => e.Id == ticketForum.CreatedById) ?? new Employee(); + ticketVM = ticket.ToForumTicketVMFromTicketForum(employee); + + ticketVM.Tags = tagVMs; + + List commentVMs = new List(); + foreach (var comment in comments) + { + employee = employees.Find(e => e.ApplicationUserId == comment.AuthorId.ToString()) ?? new Employee(); + commentVMs.Add(comment.ToTicketCommentVMFromTicketComment(employee)); + } + + attachments = await _context.TicketAttachments.Where(a => a.TicketId == updateTicketDto.Id).ToListAsync(); + var fileIds = attachments.Select(a => a.FileId).ToList(); + List documents = await _context.Documents.Where(d => fileIds.Contains(d.Id)).ToListAsync(); + List ticketAttachmentVMs = new List(); + foreach (var attachment in attachments) + { + var document = documents.Find(d => d.Id == attachment.FileId); + string preSignedUrl = string.Empty; + if (document != null) + { + preSignedUrl = _s3Service.GeneratePreSignedUrlAsync(document.S3Key); + } + if (attachment.CommentId == null) + { + ticketAttachmentVMs.Add(attachment.ToTicketAttachmentVMFromTicketAttachment(preSignedUrl, preSignedUrl)); + } + else + { + var commentVM = commentVMs.Find(c => c.Id == attachment.CommentId); + if (commentVM != null && commentVM.Attachments != null) + { + commentVM.Attachments.Add(attachment.ToTicketAttachmentVMFromTicketAttachment(preSignedUrl, preSignedUrl)); + } + } + } + ticketVM.Comments = commentVMs; + ticketVM.Attachments = ticketAttachmentVMs; + Project project = await _context.Projects.FirstOrDefaultAsync(p => p.Id == ticketForum.LinkedProjectId) ?? new Project(); + ticketVM.ProjectName = project.Name; + if (updateTicketDto.LinkedActivityId != null && updateTicketDto.LinkedActivityId != 0) + { + WorkItem workItem = await _context.WorkItems.Include(w => w.ActivityMaster).FirstOrDefaultAsync(w => w.Id == ticketForum.LinkedActivityId) ?? new WorkItem(); + if (workItem.ActivityMaster != null) + { + ticketVM.ActivityName = workItem.ActivityMaster.ActivityName; + } + else + { + ticketVM.ActivityName = ""; + } + } + } + _logger.LogInfo("Ticket {TicketId} updated", updateTicketDto.Id); + return Ok(ApiResponse.SuccessResponse(ticketVM, "Ticket Updated Successfully", 200)); } - _logger.LogWarning("Employee {EmployeeId} tries to create ticket in different Tenant", updateTicketDto.CreatedById); - return Unauthorized(ApiResponse.ErrorResponse("Not Authorized", "Not Authorized", 401)); + _logger.LogError("Ticket {TicketId} not Found in database", updateTicketDto.Id); + return NotFound(ApiResponse.ErrorResponse("Ticket not Found", "Ticket not Found", 404)); } [HttpPost("ticket/comment")] @@ -329,7 +324,7 @@ namespace Marco.Pms.Services.Controllers return BadRequest(ApiResponse.ErrorResponse("Invalid data", errors, 400)); } - int tenantId = _userHelper.GetTenantId(); + Guid tenantId = _userHelper.GetTenantId(); List attachments = new List(); List documents = new List(); @@ -397,7 +392,7 @@ namespace Marco.Pms.Services.Controllers return BadRequest(ApiResponse.ErrorResponse("Invalid data", errors, 400)); } - int tenantId = _userHelper.GetTenantId(); + Guid tenantId = _userHelper.GetTenantId(); List attachments = new List(); TicketComment existingComment = await _context.TicketComments.AsNoTracking().FirstOrDefaultAsync(c => c.Id == updateCommentDto.Id) ?? new TicketComment(); @@ -492,7 +487,7 @@ namespace Marco.Pms.Services.Controllers return BadRequest(ApiResponse.ErrorResponse("Invalid data", errors, 400)); } - int tenantId = _userHelper.GetTenantId(); + Guid tenantId = _userHelper.GetTenantId(); List ticketAttachmentVMs = new List(); TicketAttachment attachment = new TicketAttachment(); @@ -535,7 +530,7 @@ namespace Marco.Pms.Services.Controllers [HttpPatch("ticket/status/{id}")] public async Task UpdateTicketStatus(Guid id, [FromQuery] Guid statusId) { - int tenantId = _userHelper.GetTenantId(); + Guid tenantId = _userHelper.GetTenantId(); TicketForum ticket = await _context.Tickets.FirstOrDefaultAsync(t => t.Id == id && t.TenantId == tenantId) ?? new TicketForum(); ticket.StatusId = statusId; await _context.SaveChangesAsync(); @@ -599,7 +594,7 @@ namespace Marco.Pms.Services.Controllers ticketVM.Attachments = ticketAttachmentVMs; Project project = await _context.Projects.FirstOrDefaultAsync(p => p.Id == ticket.LinkedProjectId) ?? new Project(); ticketVM.ProjectName = project.Name; - if (ticket.LinkedActivityId != null && ticket.LinkedActivityId != 0) + if (ticket.LinkedActivityId != null && ticket.LinkedActivityId != null) { WorkItem workItem = await _context.WorkItems.Include(w => w.ActivityMaster).FirstOrDefaultAsync(w => w.Id == ticket.LinkedActivityId) ?? new WorkItem(); if (workItem.ActivityMaster != null) @@ -611,13 +606,13 @@ namespace Marco.Pms.Services.Controllers ticketVM.ActivityName = ""; } } - _logger.LogInfo("Status of Ticket {TicketId} in project {ProjectId} is changes to {status}", id, ticket.LinkedProjectId, ticket.TicketStatusMaster != null ? ticket.TicketStatusMaster.Name : string.Empty); + _logger.LogInfo("Status of Ticket {TicketId} in project {ProjectId} is changes to {status}", id, ticket.LinkedProjectId ?? Guid.Empty, ticket.TicketStatusMaster != null ? ticket.TicketStatusMaster.Name : string.Empty); return Ok(ApiResponse.SuccessResponse(ticketVM, "Ticket Fetched Successfully", 200)); } [HttpGet("ticket/{id}")] public async Task GetTicketDetail(Guid id) { - int tenantId = _userHelper.GetTenantId(); + Guid tenantId = _userHelper.GetTenantId(); TicketForum ticket = await _context.Tickets.Include(t => t.TicketTypeMaster).Include(t => t.TicketStatusMaster).Include(t => t.Priority).FirstOrDefaultAsync(t => t.Id == id && t.TenantId == tenantId) ?? new TicketForum(); List comments = await _context.TicketComments.Where(c => c.TicketId == ticket.Id).ToListAsync(); var authorIds = comments.Select(c => c.AuthorId.ToString()).ToList(); @@ -677,7 +672,7 @@ namespace Marco.Pms.Services.Controllers ticketVM.Attachments = ticketAttachmentVMs; Project project = await _context.Projects.FirstOrDefaultAsync(p => p.Id == ticket.LinkedProjectId) ?? new Project(); ticketVM.ProjectName = project.Name; - if (ticket.LinkedActivityId != null && ticket.LinkedActivityId != 0) + if (ticket.LinkedActivityId != null && ticket.LinkedActivityId != null) { WorkItem workItem = await _context.WorkItems.Include(w => w.ActivityMaster).FirstOrDefaultAsync(w => w.Id == ticket.LinkedActivityId) ?? new WorkItem(); if (workItem.ActivityMaster != null) @@ -689,14 +684,14 @@ namespace Marco.Pms.Services.Controllers ticketVM.ActivityName = ""; } } - _logger.LogInfo("Fetched Ticket {TicketId} form project {ProjectId}", id, ticket.LinkedProjectId); + _logger.LogInfo("Fetched Ticket {TicketId} form project {ProjectId}", id, ticket.LinkedProjectId ?? Guid.Empty); return Ok(ApiResponse.SuccessResponse(ticketVM, "Ticket Fetched Successfully", 200)); } [HttpGet("tickets")] public async Task ListTickets() { - int tenantId = _userHelper.GetTenantId(); + Guid tenantId = _userHelper.GetTenantId(); List tickets = await _context.Tickets.Include(t => t.TicketTypeMaster).Include(t => t.TicketStatusMaster).Include(t => t.Priority).Where(t => t.TenantId == tenantId).ToListAsync(); var createdByIds = tickets.Select(t => t.CreatedById).ToList(); var ticketIds = tickets.Select(t => t.Id).ToList(); @@ -780,7 +775,7 @@ namespace Marco.Pms.Services.Controllers ticketVM.Tags = tagVMs; Project project = projects.Find(p => p.Id == ticket.LinkedProjectId) ?? new Project(); ticketVM.ProjectName = project.Name; - if (ticket.LinkedActivityId != null && ticket.LinkedActivityId != 0) + if (ticket.LinkedActivityId != null && ticket.LinkedActivityId != null) { WorkItem workItem = workItems.Find(w => w.Id == ticket.LinkedActivityId) ?? new WorkItem(); if (workItem.ActivityMaster != null) diff --git a/Marco.Pms.Services/Controllers/MarketController.cs b/Marco.Pms.Services/Controllers/MarketController.cs index a9b5b5d..56ee1db 100644 --- a/Marco.Pms.Services/Controllers/MarketController.cs +++ b/Marco.Pms.Services/Controllers/MarketController.cs @@ -18,7 +18,7 @@ namespace Marco.Pms.Services.Controllers private readonly UserHelper _userHelper; private readonly IEmailSender _emailSender; private readonly IConfiguration _configuration; - public MarketController(ApplicationDbContext context, UserHelper userHelper, RefreshTokenService refreshTokenService, + public MarketController(ApplicationDbContext context, UserHelper userHelper, RefreshTokenService refreshTokenService, IEmailSender emailSender, IConfiguration configuration, EmployeeHelper employeeHelper) { _context = context; diff --git a/Marco.Pms.Services/Controllers/MasterController.cs b/Marco.Pms.Services/Controllers/MasterController.cs index b22acf0..26ceb59 100644 --- a/Marco.Pms.Services/Controllers/MasterController.cs +++ b/Marco.Pms.Services/Controllers/MasterController.cs @@ -33,7 +33,7 @@ namespace Marco.Pms.Services.Controllers [Route("activities")] public async Task GetActivitiesMaster() { - var tenantId = _userHelper.GetTenantId(); + Guid tenantId = _userHelper.GetTenantId(); var activities = await _context.ActivityMasters.Where(c => c.TenantId == tenantId && c.IsActive == true).ToListAsync(); List activitiesVM = new List(); foreach (var activity in activities) @@ -59,7 +59,7 @@ namespace Marco.Pms.Services.Controllers [HttpPost("activity")] public async Task CreateActivity([FromBody] CreateActivityMasterDto createActivity) { - var tenantId = _userHelper.GetTenantId(); + Guid tenantId = _userHelper.GetTenantId(); var employee = await _userHelper.GetCurrentEmployeeAsync(); if (employee.TenantId != tenantId) { @@ -95,9 +95,9 @@ namespace Marco.Pms.Services.Controllers } [HttpPost("activity/edit/{id}")] - public async Task UpdateActivity(int id, [FromBody] CreateActivityMasterDto createActivity) + public async Task UpdateActivity(Guid id, [FromBody] CreateActivityMasterDto createActivity) { - var tenantId = _userHelper.GetTenantId(); + Guid tenantId = _userHelper.GetTenantId(); var employee = await _userHelper.GetCurrentEmployeeAsync(); ActivityMaster? activity = await _context.ActivityMasters.FirstOrDefaultAsync(x => x.Id == id && x.IsActive == true && x.TenantId == tenantId); if (activity != null && createActivity.UnitOfMeasurement != null && createActivity.ActivityName != null) @@ -115,11 +115,11 @@ namespace Marco.Pms.Services.Controllers List updateCheckList = new List(); List deleteCheckList = new List(); - if (newCheckIds.Contains(0)) + if (newCheckIds.Contains(null)) { foreach (var check in createActivity.CheckList) { - if (check.Id == 0) + if (check.Id == null) { ActivityCheckList checkList = check.ToActivityCheckListFromCreateCheckListDto(tenantId, activity.Id); updateCheckList.Add(checkList); @@ -131,7 +131,7 @@ namespace Marco.Pms.Services.Controllers if (newCheckIds.Contains(check.Id)) { var updatedCheck = createActivity.CheckList.Find(c => c.Id == check.Id); - ActivityCheckList checkList = updatedCheck.ToActivityCheckListFromCreateCheckListDto(tenantId, activity.Id); + ActivityCheckList checkList = updatedCheck != null ? updatedCheck.ToActivityCheckListFromCreateCheckListDto(tenantId, activity.Id) : new ActivityCheckList(); updateCheckList.Add(checkList); } else @@ -166,9 +166,9 @@ namespace Marco.Pms.Services.Controllers } [HttpDelete("activity/delete/{id}")] - public async Task DeleteActivity(int Id) + public async Task DeleteActivity(Guid Id) { - int tenantId = _userHelper.GetTenantId(); + Guid tenantId = _userHelper.GetTenantId(); var activity = await _context.ActivityMasters.FirstOrDefaultAsync(a => a.Id == Id && a.TenantId == tenantId); if (activity != null) { @@ -182,7 +182,7 @@ namespace Marco.Pms.Services.Controllers [Route("industries")] public async Task GetIndustries() { - var tenantId = _userHelper.GetTenantId(); + Guid tenantId = _userHelper.GetTenantId(); var industries = await _context.Industries.ToListAsync(); _logger.LogInfo("{count} industry records fetched successfully from tenant {tenantId}", industries.Count, tenantId); @@ -192,7 +192,7 @@ namespace Marco.Pms.Services.Controllers [HttpGet("ticket-status")] public async Task GetTicketStatusMaster() { - var tenantId = _userHelper.GetTenantId(); + Guid tenantId = _userHelper.GetTenantId(); List statusVMs = new List(); List statusMasters = await _context.TicketStatusMasters.Where(s => s.TenantId == tenantId).ToListAsync(); foreach (var statusMaster in statusMasters) @@ -207,7 +207,7 @@ namespace Marco.Pms.Services.Controllers [HttpGet("ticket-types")] public async Task GetTicketTypeMaster() { - var tenantId = _userHelper.GetTenantId(); + Guid tenantId = _userHelper.GetTenantId(); List typeVMs = new List(); List typeMasters = await _context.TicketTypeMasters.Where(s => s.TenantId == tenantId).ToListAsync(); foreach (var typeMaster in typeMasters) @@ -222,7 +222,7 @@ namespace Marco.Pms.Services.Controllers [HttpGet("ticket-priorities")] public async Task GetTicketPriorityMaster() { - var tenantId = _userHelper.GetTenantId(); + Guid tenantId = _userHelper.GetTenantId(); List priorityVMs = new List(); List priorityMasters = await _context.TicketPriorityMasters.Where(s => s.TenantId == tenantId).ToListAsync(); foreach (var priorityMaster in priorityMasters) @@ -237,7 +237,7 @@ namespace Marco.Pms.Services.Controllers [HttpGet("ticket-tags")] public async Task GetTicketTagMaster() { - var tenantId = _userHelper.GetTenantId(); + Guid tenantId = _userHelper.GetTenantId(); List tagVMs = new List(); List tagMasters = await _context.TicketTagMasters.Where(s => s.TenantId == tenantId).ToListAsync(); foreach (var tagMaster in tagMasters) @@ -252,10 +252,10 @@ namespace Marco.Pms.Services.Controllers [HttpPost("ticket-status")] public async Task CreateTicketStatusMaster(TicketStatusMasterDto statusMasterDto) { - var tenantId = _userHelper.GetTenantId(); + Guid tenantId = _userHelper.GetTenantId(); if (statusMasterDto != null) { - TicketStatusMaster? statusMaster = statusMasterDto.ToTicketStatusMasterFromTicketStatusMasterDto(); + TicketStatusMaster? statusMaster = statusMasterDto.ToTicketStatusMasterFromTicketStatusMasterDto(tenantId); _context.TicketStatusMasters.Add(statusMaster); await _context.SaveChangesAsync(); @@ -270,10 +270,10 @@ namespace Marco.Pms.Services.Controllers [HttpPost("ticket-types")] public async Task CreateTicketTypeMaster(TicketTypeMasterDto typeMasterDto) { - var tenantId = _userHelper.GetTenantId(); + Guid tenantId = _userHelper.GetTenantId(); if (typeMasterDto != null) { - TicketTypeMaster? typeMaster = typeMasterDto.ToTicketTypeMasterFromTicketTypeMasterDto(); + TicketTypeMaster? typeMaster = typeMasterDto.ToTicketTypeMasterFromTicketTypeMasterDto(tenantId); _context.TicketTypeMasters.Update(typeMaster); await _context.SaveChangesAsync(); @@ -290,10 +290,10 @@ namespace Marco.Pms.Services.Controllers public async Task CreateTicketPriorityMaster(TicketPriorityMasterDto priorityMasterDto) { - var tenantId = _userHelper.GetTenantId(); + Guid tenantId = _userHelper.GetTenantId(); if (priorityMasterDto != null) { - TicketPriorityMaster? typeMaster = priorityMasterDto.ToTicketPriorityMasterFromTicketPriorityMasterDto(); + TicketPriorityMaster? typeMaster = priorityMasterDto.ToTicketPriorityMasterFromTicketPriorityMasterDto(tenantId); _context.TicketPriorityMasters.Update(typeMaster); await _context.SaveChangesAsync(); @@ -309,10 +309,10 @@ namespace Marco.Pms.Services.Controllers [HttpPost("ticket-tags")] public async Task CreateTicketTagMaster(TicketTagMasterDto tagMasterDto) { - var tenantId = _userHelper.GetTenantId(); + Guid tenantId = _userHelper.GetTenantId(); if (tagMasterDto != null) { - TicketTagMaster? tagMaster = tagMasterDto.ToTicketTagMasterFromTicketTagMasterDto(); + TicketTagMaster? tagMaster = tagMasterDto.ToTicketTagMasterFromTicketTagMasterDto(tenantId); _context.TicketTagMasters.Update(tagMaster); await _context.SaveChangesAsync(); @@ -327,13 +327,13 @@ namespace Marco.Pms.Services.Controllers [HttpPost("ticket-status/edit")] public async Task UpdateTicketStatusMaster(TicketStatusMasterDto statusMasterDto) { - var tenantId = _userHelper.GetTenantId(); + Guid tenantId = _userHelper.GetTenantId(); if (statusMasterDto != null) { TicketStatusMaster? statusMaster = await _context.TicketStatusMasters.FirstOrDefaultAsync(s => s.TenantId == tenantId && s.Id == statusMasterDto.Id); if (statusMaster != null) { - statusMaster = statusMasterDto.ToTicketStatusMasterFromTicketStatusMasterDto(); + statusMaster = statusMasterDto.ToTicketStatusMasterFromTicketStatusMasterDto(tenantId); _context.TicketStatusMasters.Update(statusMaster); await _context.SaveChangesAsync(); @@ -351,13 +351,13 @@ namespace Marco.Pms.Services.Controllers [HttpPost("ticket-types/edit")] public async Task UpdateTicketTypeMaster(TicketTypeMasterDto typeMasterDto) { - var tenantId = _userHelper.GetTenantId(); + Guid tenantId = _userHelper.GetTenantId(); if (typeMasterDto != null) { TicketTypeMaster? typeMaster = await _context.TicketTypeMasters.FirstOrDefaultAsync(s => s.TenantId == tenantId && s.Id == typeMasterDto.Id); if (typeMaster != null) { - typeMaster = typeMasterDto.ToTicketTypeMasterFromTicketTypeMasterDto(); + typeMaster = typeMasterDto.ToTicketTypeMasterFromTicketTypeMasterDto(tenantId); _context.TicketTypeMasters.Update(typeMaster); await _context.SaveChangesAsync(); @@ -375,13 +375,13 @@ namespace Marco.Pms.Services.Controllers [HttpPost("ticket-priorities/edit")] public async Task UpdateTicketPriorityMaster(TicketPriorityMasterDto priorityMasterDto) { - var tenantId = _userHelper.GetTenantId(); + Guid tenantId = _userHelper.GetTenantId(); if (priorityMasterDto != null) { TicketPriorityMaster? typeMaster = await _context.TicketPriorityMasters.FirstOrDefaultAsync(s => s.TenantId == tenantId && s.Id == priorityMasterDto.Id); if (typeMaster != null) { - typeMaster = priorityMasterDto.ToTicketPriorityMasterFromTicketPriorityMasterDto(); + typeMaster = priorityMasterDto.ToTicketPriorityMasterFromTicketPriorityMasterDto(tenantId); _context.TicketPriorityMasters.Update(typeMaster); await _context.SaveChangesAsync(); @@ -405,7 +405,7 @@ namespace Marco.Pms.Services.Controllers TicketTagMaster? tagMaster = await _context.TicketTagMasters.FirstOrDefaultAsync(s => s.TenantId == tenantId && s.Id == tagMasterDto.Id); if (tagMaster != null) { - tagMaster = tagMasterDto.ToTicketTagMasterFromTicketTagMasterDto(); + tagMaster = tagMasterDto.ToTicketTagMasterFromTicketTagMasterDto(tenantId); _context.TicketTagMasters.Update(tagMaster); await _context.SaveChangesAsync(); diff --git a/Marco.Pms.Services/Controllers/ProjectController.cs b/Marco.Pms.Services/Controllers/ProjectController.cs index beee9f2..79b6c24 100644 --- a/Marco.Pms.Services/Controllers/ProjectController.cs +++ b/Marco.Pms.Services/Controllers/ProjectController.cs @@ -19,20 +19,13 @@ namespace MarcoBMS.Services.Controllers [Authorize] public class ProjectController : ControllerBase { - //private readonly IUnitOfWork _unitOfWork; private readonly ApplicationDbContext _context; - //private ApplicationUser _applicationUser; - // private readonly IProjectRepository _projectrepo; - //private readonly UserManager _userManager; private readonly UserHelper _userHelper; public ProjectController(ApplicationDbContext context, UserHelper userHelper) { - //_unitOfWork = unitOfWork; _context = context; - //_projectrepo = projectrepo; - //_userManager = userManager; _userHelper = userHelper; } [HttpGet("list")] @@ -47,8 +40,8 @@ namespace MarcoBMS.Services.Controllers return BadRequest(ApiResponse.ErrorResponse("Invalid data", errors, 400)); } - var tenantId = _userHelper.GetTenantId(); - List projects = await _context.Projects.Where(c => c.TenantId == _userHelper.GetTenantId()).ToListAsync(); + Guid tenantId = _userHelper.GetTenantId(); + List projects = await _context.Projects.Where(c => c.TenantId == tenantId).ToListAsync(); List response = new List(); @@ -60,7 +53,7 @@ namespace MarcoBMS.Services.Controllers result.TeamSize = team.Count(); List buildings = await _context.Buildings.Where(b => b.ProjectId == project.Id && b.TenantId == tenantId).ToListAsync(); - List idList = buildings.Select(b => b.Id).ToList(); + List idList = buildings.Select(b => b.Id).ToList(); List floors = await _context.Floor.Where(f => idList.Contains(f.BuildingId) && f.TenantId == tenantId).ToListAsync(); idList = floors.Select(f => f.Id).ToList(); @@ -84,8 +77,8 @@ namespace MarcoBMS.Services.Controllers return Ok(ApiResponse.SuccessResponse(response, "Success.", 200)); } - [HttpGet("get/{id:int}")] - public async Task Get([FromRoute] int id) + [HttpGet("get/{id}")] + public async Task Get([FromRoute] Guid id) { if (!ModelState.IsValid) { @@ -102,8 +95,8 @@ namespace MarcoBMS.Services.Controllers return Ok(ApiResponse.SuccessResponse(project, "Success.", 200)); } - [HttpGet("details/{id:int}")] - public async Task Details([FromRoute] int id) + [HttpGet("details/{id}")] + public async Task Details([FromRoute] Guid id) { // ProjectDetailsVM vm = new ProjectDetailsVM(); @@ -197,13 +190,13 @@ namespace MarcoBMS.Services.Controllers } - private async Task GetProjectViewModel(int? id, Project project) + private async Task GetProjectViewModel(Guid? id, Project project) { ProjectDetailsVM vm = new ProjectDetailsVM(); // List buildings = _unitOfWork.Building.GetAll(c => c.ProjectId == id).ToList(); List buildings = await _context.Buildings.Where(c => c.ProjectId == id).ToListAsync(); - List idList = buildings.Select(o => o.Id).ToList(); + List idList = buildings.Select(o => o.Id).ToList(); // List floors = _unitOfWork.Floor.GetAll(c => idList.Contains(c.Id)).ToList(); List floors = await _context.Floor.Where(c => idList.Contains(c.BuildingId)).ToListAsync(); idList = floors.Select(o => o.Id).ToList(); @@ -224,7 +217,7 @@ namespace MarcoBMS.Services.Controllers return vm; } - private int GetTenantId() + private Guid GetTenantId() { return _userHelper.GetTenantId(); //var tenant = User.FindFirst("TenantId")?.Value; @@ -244,7 +237,7 @@ namespace MarcoBMS.Services.Controllers } - int TenantId = GetTenantId(); + Guid TenantId = GetTenantId(); var project = projectDto.ToProjectFromCreateProjectDto(TenantId); _context.Projects.Add(project); @@ -255,8 +248,8 @@ namespace MarcoBMS.Services.Controllers } [HttpPut] - [Route("update/{id:int}")] - public async Task Update([FromRoute] int id, [FromBody] UpdateProjectDto updateProjectDto) + [Route("update/{id}")] + public async Task Update([FromRoute] Guid id, [FromBody] UpdateProjectDto updateProjectDto) { if (!ModelState.IsValid) { @@ -269,8 +262,7 @@ namespace MarcoBMS.Services.Controllers } try { - int TenantId = GetTenantId(); - updateProjectDto.TenantId = TenantId; + Guid TenantId = GetTenantId(); Project project = updateProjectDto.ToProjectFromUpdateProjectDto(TenantId, id); _context.Projects.Update(project); @@ -334,7 +326,7 @@ namespace MarcoBMS.Services.Controllers [HttpGet] [Route("employees/get/{projectid?}/{includeInactive?}")] - public async Task GetEmployeeByProjectID(int? projectid, bool includeInactive = false) + public async Task GetEmployeeByProjectID(Guid? projectid, bool includeInactive = false) { if (!ModelState.IsValid) { @@ -345,7 +337,7 @@ namespace MarcoBMS.Services.Controllers return BadRequest(ApiResponse.ErrorResponse("Invalid data", errors, 400)); } - int TenantId = GetTenantId(); + Guid TenantId = GetTenantId(); if (projectid != null) { @@ -386,8 +378,8 @@ namespace MarcoBMS.Services.Controllers } [HttpGet] - [Route("allocation/{projectId:int}")] - public async Task GetProjectAllocation(int? projectId) + [Route("allocation/{projectId}")] + public async Task GetProjectAllocation(Guid? projectId) { if (!ModelState.IsValid) { @@ -398,7 +390,7 @@ namespace MarcoBMS.Services.Controllers return BadRequest(ApiResponse.ErrorResponse("Invalid data", errors, 400)); } - int TenantId = GetTenantId(); + Guid TenantId = GetTenantId(); var employees = await _context.ProjectAllocations @@ -426,7 +418,7 @@ namespace MarcoBMS.Services.Controllers { if (projectAllocationDot != null) { - int TenentID = GetTenantId(); + Guid TenentID = GetTenantId(); List? result = new List(); foreach (var item in projectAllocationDot) @@ -496,15 +488,15 @@ namespace MarcoBMS.Services.Controllers [HttpPost("task")] public async Task CreateProjectTask(List workItemDot) { + Guid tenantId = GetTenantId(); List workItems = new List { }; if (workItemDot != null) { foreach (var item in workItemDot) { - item.TenantId = GetTenantId(); - WorkItem workItem = item.ToWorkItemFromWorkItemDto(); + WorkItem workItem = item.ToWorkItemFromWorkItemDto(tenantId); - if (item.Id > 0) + if (item.Id != null) { //update _context.WorkItems.Update(workItem); @@ -533,6 +525,7 @@ namespace MarcoBMS.Services.Controllers [HttpPost("manage-infra")] public async Task ManageProjectInfra(List infraDots) { + Guid tenantId = GetTenantId(); var responseData = new InfraVM { }; if (infraDots != null) { @@ -541,10 +534,10 @@ namespace MarcoBMS.Services.Controllers if (item.Building != null) { - Building building = item.Building.ToBuildingFromBuildingDto(); + Building building = item.Building.ToBuildingFromBuildingDto(tenantId); building.TenantId = GetTenantId(); - if (item.Building.Id == 0) + if (item.Building.Id == null) { //create _context.Buildings.Add(building); @@ -562,10 +555,10 @@ namespace MarcoBMS.Services.Controllers } if (item.Floor != null) { - Floor floor = item.Floor.ToFloorFromFloorDto(); + Floor floor = item.Floor.ToFloorFromFloorDto(tenantId); floor.TenantId = GetTenantId(); - if (item.Floor.Id == 0) + if (item.Floor.Id == null) { //create _context.Floor.Add(floor); @@ -582,10 +575,10 @@ namespace MarcoBMS.Services.Controllers } if (item.WorkArea != null) { - WorkArea workArea = item.WorkArea.ToWorkAreaFromWorkAreaDto(); + WorkArea workArea = item.WorkArea.ToWorkAreaFromWorkAreaDto(tenantId); workArea.TenantId = GetTenantId(); - if (item.WorkArea.Id == 0) + if (item.WorkArea.Id == null) { //create _context.WorkAreas.Add(workArea); diff --git a/Marco.Pms.Services/Controllers/RolesController.cs b/Marco.Pms.Services/Controllers/RolesController.cs index badc6f0..c545215 100644 --- a/Marco.Pms.Services/Controllers/RolesController.cs +++ b/Marco.Pms.Services/Controllers/RolesController.cs @@ -20,28 +20,28 @@ namespace MarcoBMS.Services.Controllers { private readonly ApplicationDbContext _context; private readonly RolesHelper _rolesHelper; + private readonly UserHelper _userHelper; - private readonly UserManager _userManager; + private readonly UserManager _userManager; - public RolesController(UserManager userManager, ApplicationDbContext context, RolesHelper rolesHelper) + public RolesController(UserManager userManager, ApplicationDbContext context, RolesHelper rolesHelper, UserHelper userHelper) { _context = context; _userManager = userManager; _rolesHelper = rolesHelper; - + _userHelper = userHelper; } - private int GetTenantId() + private Guid GetTenantId() { - var tenant = User.FindFirst("TenantId")?.Value; - return (tenant != null ? Convert.ToInt32(tenant) : 1); + return _userHelper.GetTenantId(); } [HttpGet("jobrole")] public async Task GetAllJobRoles() { - int TenantId = GetTenantId(); + Guid TenantId = GetTenantId(); var roles = await _context.JobRoles.Where(c => c.TenantId == TenantId).Select(x => new JobRoleVM() { Id = x.Id, @@ -56,7 +56,7 @@ namespace MarcoBMS.Services.Controllers { - int TenantId = GetTenantId(); + Guid TenantId = GetTenantId(); if (await _context.JobRoles.AnyAsync(c => c.Name.ToLower() == createJobRoleDto.Name.ToLower() && c.TenantId == TenantId)) { return BadRequest(ApiResponse.ErrorResponse("Role with same name already Exists.", "Role with same name already Exists.", 400)); @@ -82,11 +82,11 @@ namespace MarcoBMS.Services.Controllers return BadRequest(ApiResponse.ErrorResponse("Invalid data", errors, 400)); } if (id != updateRoleDto.Id.ToString()) - return BadRequest(ApiResponse.ErrorResponse("Role ID mismatch", "Role ID mismatch",400)); + return BadRequest(ApiResponse.ErrorResponse("Role ID mismatch", "Role ID mismatch", 400)); try { - int TenantId = GetTenantId(); + Guid TenantId = GetTenantId(); JobRole jr = updateRoleDto.ToJobRoleFromUpdateJobRoleDot(TenantId); _context.JobRoles.Update(jr); @@ -104,7 +104,7 @@ namespace MarcoBMS.Services.Controllers [HttpGet] public async Task GetAllRoles() { - int TenantId = GetTenantId(); + Guid TenantId = GetTenantId(); var roles = await _context.ApplicationRoles.Where(c => c.TenantId == TenantId).ToListAsync(); @@ -177,7 +177,7 @@ namespace MarcoBMS.Services.Controllers return BadRequest(ApiResponse.ErrorResponse("Invalid data", errors, 400)); } - int TenantId = GetTenantId(); + Guid TenantId = GetTenantId(); if (createRoleDto.FeaturesPermission == null || (createRoleDto.FeaturesPermission != null && createRoleDto.FeaturesPermission.Count == 0)) { @@ -208,7 +208,7 @@ namespace MarcoBMS.Services.Controllers } [HttpPut("{id}")] - public async Task UpdateRole(string id, [FromBody] UpdateApplicationRoleDto updateRoleDto) + public async Task UpdateRole(Guid id, [FromBody] UpdateApplicationRoleDto updateRoleDto) { if (!ModelState.IsValid) { @@ -218,13 +218,13 @@ namespace MarcoBMS.Services.Controllers .ToList(); return BadRequest(ApiResponse.ErrorResponse("Invalid data", errors, 400)); } - if (id != updateRoleDto.Id.ToString()) + if (id != updateRoleDto.Id) return BadRequest("Role ID mismatch"); try { - int TenantId = GetTenantId(); + Guid TenantId = GetTenantId(); ApplicationRole role = updateRoleDto.ToApplicationRoleFromUpdateDto(TenantId); @@ -235,7 +235,7 @@ namespace MarcoBMS.Services.Controllers if (projectModel == null) { - return NotFound(ApiResponse.ErrorResponse("Project not found", "Project not found",404)); + return NotFound(ApiResponse.ErrorResponse("Project not found", "Project not found", 404)); } bool modified = false; @@ -265,7 +265,7 @@ namespace MarcoBMS.Services.Controllers } catch (Exception ex) { - return BadRequest(ApiResponse.ErrorResponse(ex.Message,ex, 400)); + return BadRequest(ApiResponse.ErrorResponse(ex.Message, ex, 400)); } } @@ -273,7 +273,7 @@ namespace MarcoBMS.Services.Controllers [HttpGet("{id}")] public async Task GetRoleById(Guid id) { - int TenantId = GetTenantId(); + Guid TenantId = GetTenantId(); var role = await _context.ApplicationRoles.FindAsync(id); diff --git a/Marco.Pms.Services/Controllers/TaskController.cs b/Marco.Pms.Services/Controllers/TaskController.cs index 0f0482c..ab2af78 100644 --- a/Marco.Pms.Services/Controllers/TaskController.cs +++ b/Marco.Pms.Services/Controllers/TaskController.cs @@ -31,7 +31,7 @@ namespace MarcoBMS.Services.Controllers _userHelper = userHelper; } - private int GetTenantId() + private Guid GetTenantId() { return _userHelper.GetTenantId(); } @@ -75,10 +75,10 @@ namespace MarcoBMS.Services.Controllers var idList = teamMembers.Select(m => m.EmployeeId); List employees = await _context.Employees.Where(e => idList.Contains(e.Id)).ToListAsync(); - List team = new List(); + List team = new List(); foreach (var employee in employees) { - team.Add(employee.ToEmployeeVMFromEmployee()); + team.Add(employee.ToBasicEmployeeVMFromEmployee()); } response.teamMembers = team; return Ok(ApiResponse.SuccessResponse(response, "Task assignned successfully", 200)); @@ -102,7 +102,7 @@ namespace MarcoBMS.Services.Controllers var taskAllocation = await _context.TaskAllocations.Include(t => t.WorkItem).FirstOrDefaultAsync(t => t.Id == reportTask.Id); - var checkListIds = reportTask.CheckList != null ? reportTask.CheckList.Select(c => c.Id).ToList() : new List(); + var checkListIds = reportTask.CheckList != null ? reportTask.CheckList.Select(c => c.Id).ToList() : new List(); var checkList = await _context.ActivityCheckLists.Where(c => checkListIds.Contains(c.Id)).ToListAsync(); if (taskAllocation == null) { @@ -124,7 +124,7 @@ namespace MarcoBMS.Services.Controllers { foreach (var checkDto in reportTask.CheckList) { - checkListVMs.Add(checkDto.ToCheckListVMFromReportCheckListDto(taskAllocation.WorkItem != null ? taskAllocation.WorkItem.ActivityId : 0)); + checkListVMs.Add(checkDto.ToCheckListVMFromReportCheckListDto(taskAllocation.WorkItem != null ? taskAllocation.WorkItem.ActivityId : Guid.Empty)); if (checkDto.IsChecked) { var check = checkList.Find(c => c.Id == checkDto.Id); @@ -173,9 +173,9 @@ namespace MarcoBMS.Services.Controllers } [HttpGet("list")] - public async Task GetTasksList([FromQuery] int projectId, [FromQuery] string? dateFrom = null, [FromQuery] string? dateTo = null) + public async Task GetTasksList([FromQuery] Guid projectId, [FromQuery] string? dateFrom = null, [FromQuery] string? dateTo = null) { - int tenantId = GetTenantId(); + Guid tenantId = GetTenantId(); DateTime fromDate = new DateTime(); DateTime toDate = new DateTime(); @@ -195,7 +195,7 @@ namespace MarcoBMS.Services.Controllers var jobroles = await _context.JobRoles.Where(r => r.TenantId == tenantId).ToListAsync(); //var taskAllocations = await _context.TaskAllocations.Where(t => t.WorkItem.WorkArea.Floor.Building.ProjectId == projectId && t.AssignmentDate >= fromDate && t.AssignmentDate <= toDate && t.TenantId == tenantId).Include(t => t.WorkItemId).ToListAsync(); List buildings = await _context.Buildings.Where(b => b.ProjectId == projectId && b.TenantId == tenantId).ToListAsync(); - List idList = buildings.Select(b => b.Id).ToList(); + List idList = buildings.Select(b => b.Id).ToList(); List floors = await _context.Floor.Where(f => idList.Contains(f.BuildingId) && f.TenantId == tenantId).ToListAsync(); idList = floors.Select(f => f.Id).ToList(); @@ -240,7 +240,7 @@ namespace MarcoBMS.Services.Controllers { commentVM.Add(comment.ToCommentVMFromTaskComment()); } - List checkLists = await _context.ActivityCheckLists.Where(x => x.ActivityId == (taskAllocation.WorkItem != null ? taskAllocation.WorkItem.ActivityId : 0)).ToListAsync(); + List checkLists = await _context.ActivityCheckLists.Where(x => x.ActivityId == (taskAllocation.WorkItem != null ? taskAllocation.WorkItem.ActivityId : Guid.Empty)).ToListAsync(); List checkListMappings = await _context.CheckListMappings.Where(c => c.TaskAllocationId == taskAllocation.Id).ToListAsync(); List checkList = new List(); foreach (var check in checkLists) @@ -266,9 +266,9 @@ namespace MarcoBMS.Services.Controllers } [HttpGet("get/{taskId}")] - public async Task GetTask(long taskId) + public async Task GetTask(Guid taskId) { - if (taskId == 0) return BadRequest(ApiResponse.ErrorResponse("Invalid data", "Invalid data", 400)); + if (taskId == Guid.Empty) return BadRequest(ApiResponse.ErrorResponse("Invalid data", "Invalid data", 400)); var taskAllocation = await _context.TaskAllocations.Include(t => t.Tenant).Include(t => t.Employee).Include(t => t.WorkItem).FirstOrDefaultAsync(t => t.Id == taskId); if (taskAllocation != null && taskAllocation.Employee != null && taskAllocation.Tenant != null) @@ -278,7 +278,7 @@ namespace MarcoBMS.Services.Controllers string tenantName = taskAllocation.Tenant.ContactName ?? string.Empty; if (taskAllocation == null) return NotFound(ApiResponse.ErrorResponse("Task Not Found", "Task not found", 404)); - var taskVM = taskAllocation.TaskAllocationToTaskVM(employeeName, tenantName); + var taskVM = taskAllocation.TaskAllocationToTaskVM(employeeName); var comments = await _context.TaskComments.Where(c => c.TaskAllocationId == taskAllocation.Id).ToListAsync(); var team = await _context.TaskMembers.Where(m => m.TaskAllocationId == taskAllocation.Id).Include(m => m.Employee).ToListAsync(); var teamMembers = new List { }; diff --git a/Marco.Pms.Services/Helpers/EmployeeHelper.cs b/Marco.Pms.Services/Helpers/EmployeeHelper.cs index 4b01bfc..1ef20d6 100644 --- a/Marco.Pms.Services/Helpers/EmployeeHelper.cs +++ b/Marco.Pms.Services/Helpers/EmployeeHelper.cs @@ -17,7 +17,7 @@ namespace MarcoBMS.Services.Helpers _context = context; _logger = logger; } - public async Task GetEmployeeByID(int EmployeeID) + public async Task GetEmployeeByID(Guid EmployeeID) { return await _context.Employees.Include(e => e.JobRole).FirstOrDefaultAsync(e => e.Id == EmployeeID) ?? new Employee { }; @@ -38,7 +38,7 @@ namespace MarcoBMS.Services.Helpers } } - public async Task> SearchEmployeeByProjectId(int TenentId, string searchString, int? ProjectId) + public async Task> SearchEmployeeByProjectId(Guid TenentId, string searchString, Guid? ProjectId) { try { @@ -71,7 +71,7 @@ namespace MarcoBMS.Services.Helpers } } - public async Task> GetEmployeeByProjectId(int TenentId, int? ProjectId) + public async Task> GetEmployeeByProjectId(Guid TenentId, Guid? ProjectId) { try { diff --git a/Marco.Pms.Services/Helpers/ProjectHelper.cs b/Marco.Pms.Services/Helpers/ProjectHelper.cs index 67455aa..f1b688e 100644 --- a/Marco.Pms.Services/Helpers/ProjectHelper.cs +++ b/Marco.Pms.Services/Helpers/ProjectHelper.cs @@ -14,7 +14,7 @@ namespace ModelServices.Helpers _context = context; } - public async Task> GetTeamByProject(int TenantId, int ProjectId, bool IncludeInactive) + public async Task> GetTeamByProject(Guid TenantId, Guid ProjectId, bool IncludeInactive) { if (IncludeInactive) { @@ -29,9 +29,9 @@ namespace ModelServices.Helpers return employees; } - } - - - } + + + } +} diff --git a/Marco.Pms.Services/Helpers/ProjectsHelper.cs b/Marco.Pms.Services/Helpers/ProjectsHelper.cs index 7d306bc..74daf88 100644 --- a/Marco.Pms.Services/Helpers/ProjectsHelper.cs +++ b/Marco.Pms.Services/Helpers/ProjectsHelper.cs @@ -13,19 +13,19 @@ namespace MarcoBMS.Services.Helpers _context = context; } - public async Task> GetAllProjectByTanentID(int tanentID) + public async Task> GetAllProjectByTanentID(Guid tanentID) { List alloc = await _context.Projects.Where(c => c.TenantId == tanentID).ToListAsync(); return alloc; } - public async Task> GetProjectByEmployeeID(int employeeID) + public async Task> GetProjectByEmployeeID(Guid employeeID) { - List alloc = await _context.ProjectAllocations.Where(c => c.EmployeeId ==employeeID && c.IsActive == true).Include(c=>c.Project).ToListAsync(); + List alloc = await _context.ProjectAllocations.Where(c => c.EmployeeId == employeeID && c.IsActive == true).Include(c => c.Project).ToListAsync(); return alloc; } - public async Task> GetTeamByProject(int TenantId, int ProjectId, bool IncludeInactive) + public async Task> GetTeamByProject(Guid TenantId, Guid ProjectId, bool IncludeInactive) { if (IncludeInactive) { diff --git a/Marco.Pms.Services/Helpers/RolesHelper.cs b/Marco.Pms.Services/Helpers/RolesHelper.cs index 9bf16fd..b571d03 100644 --- a/Marco.Pms.Services/Helpers/RolesHelper.cs +++ b/Marco.Pms.Services/Helpers/RolesHelper.cs @@ -14,31 +14,31 @@ namespace MarcoBMS.Services.Helpers _context = context; } - public async Task> GetFeaturePermissionByEmployeeID(int EmployeeID) + public async Task> GetFeaturePermissionByEmployeeID(Guid EmployeeID) { - List roleMappings = await _context.EmployeeRoleMappings.Where(c => c.EmployeeId ==EmployeeID && c.IsEnabled == true).Select(c=>c.RoleId).ToListAsync(); + List roleMappings = await _context.EmployeeRoleMappings.Where(c => c.EmployeeId == EmployeeID && c.IsEnabled == true).Select(c => c.RoleId).ToListAsync(); - // _context.RolePermissionMappings + // _context.RolePermissionMappings - var result = await (from rpm in _context.RolePermissionMappings - join fp in _context.FeaturePermissions.Where(c=>c.IsEnabled == true).Include(fp => fp.Feature) // Include Feature - on rpm.FeaturePermissionId equals fp.Id - where roleMappings.Contains(rpm.ApplicationRoleId) - select fp) - .ToListAsync(); + var result = await (from rpm in _context.RolePermissionMappings + join fp in _context.FeaturePermissions.Where(c => c.IsEnabled == true).Include(fp => fp.Feature) // Include Feature + on rpm.FeaturePermissionId equals fp.Id + where roleMappings.Contains(rpm.ApplicationRoleId) + select fp) + .ToListAsync(); return result; - // return null; + // return null; } public async Task> GetFeaturePermissionByRoleID(Guid roleId) { - List roleMappings = await _context.RolePermissionMappings.Where(c => c.ApplicationRoleId == roleId ).Select(c => c.ApplicationRoleId).ToListAsync(); + List roleMappings = await _context.RolePermissionMappings.Where(c => c.ApplicationRoleId == roleId).Select(c => c.ApplicationRoleId).ToListAsync(); // _context.RolePermissionMappings - var result = await (from rpm in _context.RolePermissionMappings.Where(c=>c.ApplicationRoleId == roleId) + var result = await (from rpm in _context.RolePermissionMappings.Where(c => c.ApplicationRoleId == roleId) join fp in _context.FeaturePermissions.Where(c => c.IsEnabled == true).Include(fp => fp.Feature) // Include Feature on rpm.FeaturePermissionId equals fp.Id select fp) diff --git a/Marco.Pms.Services/Helpers/UserHelper.cs b/Marco.Pms.Services/Helpers/UserHelper.cs index 3b411e2..73590b8 100644 --- a/Marco.Pms.Services/Helpers/UserHelper.cs +++ b/Marco.Pms.Services/Helpers/UserHelper.cs @@ -1,6 +1,7 @@ using System.Security.Claims; using Marco.Pms.DataAccess.Data; using Marco.Pms.Model.Employees; +using Marco.Pms.Model.Entitlements; using Microsoft.AspNetCore.Identity; using Microsoft.EntityFrameworkCore; @@ -8,21 +9,21 @@ namespace MarcoBMS.Services.Helpers { public class UserHelper { - private readonly UserManager _userManager; + private readonly UserManager _userManager; private readonly IHttpContextAccessor _httpContextAccessor; private readonly ApplicationDbContext _context; - public UserHelper(UserManager userManager, IHttpContextAccessor httpContextAccessor,ApplicationDbContext context) + public UserHelper(UserManager userManager, IHttpContextAccessor httpContextAccessor, ApplicationDbContext context) { _userManager = userManager; _httpContextAccessor = httpContextAccessor; _context = context; } - public int GetTenantId() + public Guid GetTenantId() { var tenant = _httpContextAccessor.HttpContext?.User.FindFirst("TenantId")?.Value; - return (tenant != null ? Convert.ToInt32(tenant) : 1); + return (tenant != null ? Guid.Parse(tenant) : Guid.Empty); } public async Task GetCurrentUserAsync() @@ -31,7 +32,7 @@ namespace MarcoBMS.Services.Helpers if (string.IsNullOrEmpty(userId)) return null; - var user = await _userManager.FindByEmailAsync(userId); + var user = await _userManager.FindByEmailAsync(userId); return user; //await _userManager.FindByIdAsync(userId); } public async Task GetCurrentEmployeeAsync() diff --git a/Marco.Pms.Services/Middleware/LoggingMiddleware.cs b/Marco.Pms.Services/Middleware/LoggingMiddleware.cs index 28535b2..dd10d7d 100644 --- a/Marco.Pms.Services/Middleware/LoggingMiddleware.cs +++ b/Marco.Pms.Services/Middleware/LoggingMiddleware.cs @@ -1,7 +1,6 @@ -using MarcoBMS.Services.Helpers; +using System.Diagnostics; using MarcoBMS.Services.Service; using Serilog.Context; -using System.Diagnostics; namespace MarcoBMS.Services.Middleware { @@ -24,8 +23,7 @@ namespace MarcoBMS.Services.Middleware var stopwatch = Stopwatch.StartNew(); var response = context.Response; var request = context.Request; - var tenant = context.User.FindFirst("TenantId")?.Value; - int tenantId = (tenant != null ? Convert.ToInt32(tenant) : 1); + var tenantId = context.User.FindFirst("TenantId")?.Value; using (LogContext.PushProperty("TenantId", tenantId)) @@ -44,7 +42,7 @@ namespace MarcoBMS.Services.Middleware using (LogContext.PushProperty("StatusCode", response.StatusCode.ToString())) using (LogContext.PushProperty("ResponseTimeMs", stopwatch.ElapsedMilliseconds)) using (LogContext.PushProperty("LogLevel", "Information")) - _logger.LogInformation("HTTP {method} {path} responded {statusCode} in {timeTaken} ms", request.Method,request.Path, response.StatusCode.ToString(),stopwatch.ElapsedMilliseconds); + _logger.LogInformation("HTTP {method} {path} responded {statusCode} in {timeTaken} ms", request.Method, request.Path, response.StatusCode.ToString(), stopwatch.ElapsedMilliseconds); } catch (Exception ex) { diff --git a/Marco.Pms.Services/Middleware/TenantMiddleware.cs b/Marco.Pms.Services/Middleware/TenantMiddleware.cs index 37ac1af..3bc4be8 100644 --- a/Marco.Pms.Services/Middleware/TenantMiddleware.cs +++ b/Marco.Pms.Services/Middleware/TenantMiddleware.cs @@ -16,7 +16,7 @@ var tenantId = context.User.FindFirst("tenantId")?.Value; if (tenantId == null) { - tenantId = "1"; + tenantId = Guid.Empty.ToString(); } if (!string.IsNullOrEmpty(tenantId)) { diff --git a/Marco.Pms.Services/Program.cs b/Marco.Pms.Services/Program.cs index e731948..1d69193 100644 --- a/Marco.Pms.Services/Program.cs +++ b/Marco.Pms.Services/Program.cs @@ -1,6 +1,7 @@ using System.Text; using Marco.Pms.DataAccess.Data; using Marco.Pms.Model.Authentication; +using Marco.Pms.Model.Entitlements; using Marco.Pms.Model.Utilities; using Marco.Pms.Services.Service; using MarcoBMS.Services.Helpers; @@ -62,6 +63,7 @@ builder.Services.AddCors(options => }); // Add services to the container. +builder.Services.AddHostedService(); builder.Services.AddControllers(); // Learn more about configuring Swagger/OpenAPI at https://aka.ms/aspnetcore/swashbuckle builder.Services.AddEndpointsApiExplorer(); @@ -101,7 +103,7 @@ builder.Services.AddTransient(); builder.Services.Configure(builder.Configuration.GetSection("AWS")); // For uploading images to aws s3 builder.Services.AddTransient(); -builder.Services.AddIdentity().AddEntityFrameworkStores().AddDefaultTokenProviders(); +builder.Services.AddIdentity().AddEntityFrameworkStores().AddDefaultTokenProviders(); string? connString = builder.Configuration.GetConnectionString("DefaultConnectionString"); diff --git a/Marco.Pms.Services/Service/RefreshTokenService.cs b/Marco.Pms.Services/Service/RefreshTokenService.cs index 2cc1f7a..0ddfa16 100644 --- a/Marco.Pms.Services/Service/RefreshTokenService.cs +++ b/Marco.Pms.Services/Service/RefreshTokenService.cs @@ -24,7 +24,7 @@ namespace MarcoBMS.Services.Service _logger = logger; } - public string GenerateJwtToken(string username, string tenantId, JwtSettings _jwtSettings) + public string GenerateJwtToken(string username, Guid tenantId, JwtSettings _jwtSettings) { // Custom claims @@ -32,7 +32,7 @@ namespace MarcoBMS.Services.Service { new Claim(JwtRegisteredClaimNames.Jti, Guid.NewGuid().ToString()), new Claim(JwtRegisteredClaimNames.Sub, username), - new Claim("TenantId", tenantId), // Add TenantId claim + new Claim("TenantId", tenantId.ToString()), // Add TenantId claim new Claim(JwtRegisteredClaimNames.Jti, Guid.NewGuid().ToString()) }; var key = new SymmetricSecurityKey(Encoding.UTF8.GetBytes(_jwtSettings.Key)); @@ -82,14 +82,16 @@ namespace MarcoBMS.Services.Service }; // Check if the record exists - var existingEntity = await _context.RefreshTokens.AnyAsync(c=>c.UserId == userId); - if(existingEntity) { _context.RefreshTokens.Update(refreshToken); } else + var existingEntity = await _context.RefreshTokens.AnyAsync(c => c.UserId == userId); + if (existingEntity) { _context.RefreshTokens.Update(refreshToken); } + else { _context.RefreshTokens.Add(refreshToken); } await _context.SaveChangesAsync(); return strToken; - }catch(Exception ex) + } + catch (Exception ex) { _logger.LogError("{Error}", ex.Message); throw; diff --git a/Marco.Pms.Services/Service/S3UploadService.cs b/Marco.Pms.Services/Service/S3UploadService.cs index 88599b6..5e47245 100644 --- a/Marco.Pms.Services/Service/S3UploadService.cs +++ b/Marco.Pms.Services/Service/S3UploadService.cs @@ -28,7 +28,7 @@ namespace Marco.Pms.Services.Service _s3Client = new AmazonS3Client(settings.AccessKey, settings.SecretKey, region); } //public async Task UploadFileAsync(string fileName, string contentType) - public async Task UploadFileAsync(string base64Data, int tenantId, string tag) + public async Task UploadFileAsync(string base64Data, Guid tenantId, string tag) { byte[] fileBytes; @@ -118,7 +118,7 @@ namespace Marco.Pms.Services.Service return false; } } - public string GenerateFileName(string contentType, int tenantId, string? name) + public string GenerateFileName(string contentType, Guid tenantId, string? name) { string extenstion = GetExtensionFromMimeType(contentType); diff --git a/Marco.Pms.Services/Service/StartupDataSeeder.cs b/Marco.Pms.Services/Service/StartupDataSeeder.cs new file mode 100644 index 0000000..c643592 --- /dev/null +++ b/Marco.Pms.Services/Service/StartupDataSeeder.cs @@ -0,0 +1,136 @@ +using Marco.Pms.DataAccess.Data; +using Marco.Pms.Model.Employees; +using Marco.Pms.Model.Entitlements; +using Microsoft.AspNetCore.Identity; +using Microsoft.EntityFrameworkCore; + +namespace Marco.Pms.Services.Service +{ + public class StartupUserSeeder : IHostedService + { + private readonly IServiceProvider _serviceProvider; + + public StartupUserSeeder(IServiceProvider serviceProvider) + { + _serviceProvider = serviceProvider; + } + + public async Task StartAsync(CancellationToken cancellationToken) + { + using var scope = _serviceProvider.CreateScope(); + var userManager = scope.ServiceProvider.GetRequiredService>(); + var dbContext = scope.ServiceProvider.GetRequiredService(); + + var userEmail = "admin@marcoaiot.com"; + + var user = await userManager.FindByEmailAsync(userEmail); + var newUser = new ApplicationUser + { + UserName = userEmail, + Email = userEmail, + EmailConfirmed = true, + IsRootUser = true, + TenantId = Guid.Parse("b3466e83-7e11-464c-b93a-daf047838b26") + }; + var result = new IdentityResult(); + + if (user == null) + { + result = await userManager.CreateAsync(newUser, "User@123"); + } + else + { + newUser = user; + } + + var jobRole = new JobRole + { + Id = Guid.Empty, + Name = "Admin", + Description = "Admin", + TenantId = Guid.Parse("b3466e83-7e11-464c-b93a-daf047838b26"), + }; + + if (!await dbContext.JobRoles.AnyAsync()) + { + await dbContext.JobRoles.AddAsync(jobRole); + } + else + { + jobRole = await dbContext.JobRoles.FirstOrDefaultAsync(); + } + var role = new ApplicationRole + { + Role = "Super User", + Description = "Super User", + TenantId = Guid.Parse("b3466e83-7e11-464c-b93a-daf047838b26") + }; + if (!await dbContext.ApplicationRoles.AnyAsync()) + { + await dbContext.ApplicationRoles.AddAsync(role); + } + else + { + role = await dbContext.ApplicationRoles.FirstOrDefaultAsync(); + } + await dbContext.SaveChangesAsync(); + var employee = new Employee + { + ApplicationUserId = newUser.Id, + FirstName = "Admin", + LastName = "", + Email = userEmail, + TenantId = Guid.Parse("b3466e83-7e11-464c-b93a-daf047838b26"), + CurrentAddress = "", + BirthDate = Convert.ToDateTime("1965-04-20 10:11:17.588000"), + EmergencyPhoneNumber = "", + EmergencyContactPerson = "", + AadharNumber = "", + Gender = "", + MiddleName = "", + PanNumber = "", + PermanentAddress = "", + PhoneNumber = "9876543210", + Photo = null, // GetFileDetails(model.Photo).Result.FileData, + JobRoleId = jobRole != null ? jobRole.Id : Guid.Empty, + JoiningDate = Convert.ToDateTime("2000-04-20 10:11:17.588000"), + }; + if ((!await dbContext.Employees.AnyAsync()) && (jobRole != null ? jobRole.Id : Guid.Empty) != Guid.Empty) + { + await dbContext.Employees.AddAsync(employee); + } + else + { + employee = await dbContext.Employees.FirstOrDefaultAsync(); + } + await dbContext.SaveChangesAsync(); + if (!await dbContext.EmployeeRoleMappings.AnyAsync()) + { + await dbContext.EmployeeRoleMappings.AddAsync(new EmployeeRoleMapping + { + EmployeeId = employee != null ? employee.Id : Guid.Empty, + IsEnabled = true, + TenantId = Guid.Parse("b3466e83-7e11-464c-b93a-daf047838b26"), + RoleId = role != null ? role.Id : Guid.Empty + }); + } + if (!await dbContext.RolePermissionMappings.AnyAsync()) + { + List permissions = await dbContext.FeaturePermissions.ToListAsync(); + List rolesMapping = new List(); + foreach (var permission in permissions) + { + rolesMapping.Add(new RolePermissionMappings + { + ApplicationRoleId = role != null ? role.Id : Guid.Empty, + FeaturePermissionId = permission.Id + }); + } + await dbContext.RolePermissionMappings.AddRangeAsync(rolesMapping); + } + await dbContext.SaveChangesAsync(); + } + + public Task StopAsync(CancellationToken cancellationToken) => Task.CompletedTask; + } +}