diff --git a/Marco.Pms.DataAccess/Data/ApplicationDbContext.cs b/Marco.Pms.DataAccess/Data/ApplicationDbContext.cs index 7601e60..781344e 100644 --- a/Marco.Pms.DataAccess/Data/ApplicationDbContext.cs +++ b/Marco.Pms.DataAccess/Data/ApplicationDbContext.cs @@ -1,11 +1,11 @@ -using System.Globalization; -using Marco.Pms.Model.Activities; +using Marco.Pms.Model.Activities; using Marco.Pms.Model.AttendanceModule; using Marco.Pms.Model.Authentication; using Marco.Pms.Model.Directory; using Marco.Pms.Model.DocumentManager; using Marco.Pms.Model.Employees; using Marco.Pms.Model.Entitlements; +using Marco.Pms.Model.Expenses; using Marco.Pms.Model.Forum; using Marco.Pms.Model.Mail; using Marco.Pms.Model.Master; @@ -16,6 +16,7 @@ using Microsoft.AspNetCore.Http; using Microsoft.AspNetCore.Identity; using Microsoft.AspNetCore.Identity.EntityFrameworkCore; using Microsoft.EntityFrameworkCore; +using System.Globalization; namespace Marco.Pms.DataAccess.Data { @@ -89,6 +90,15 @@ namespace Marco.Pms.DataAccess.Data public DbSet OTPDetails { get; set; } public DbSet MPINDetails { get; set; } + public DbSet Expenses { get; set; } + public DbSet ExpensesTypeMaster { get; set; } + public DbSet PaymentModeMatser { get; set; } + public DbSet ExpensesStatusMaster { get; set; } + public DbSet BillAttachments { get; set; } + public DbSet ExpensesReimburse { get; set; } + public DbSet ExpensesReimburseMapping { get; set; } + public DbSet StatusPermissionMapping { get; set; } + protected override void OnModelCreating(ModelBuilder modelBuilder) @@ -97,49 +107,6 @@ namespace Marco.Pms.DataAccess.Data ManageApplicationStructure(modelBuilder); - //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 = Guid.Parse("b3466e83-7e11-464c-b93a-daf047838b26") - // }, - // 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("6d3a7c72-c421-11ef-9b93-0242ac110002"), - // Role = "Site Engineer", - // Description = "", - - // TenantId = Guid.Parse("b3466e83-7e11-464c-b93a-daf047838b26") - // } - // , - // new ApplicationRole - // { - // Id = new Guid("6d3aad72-c421-11ef-9b93-0242ac110002"), - // Role = "Project Manager", - // Description = "", - - // TenantId = Guid.Parse("b3466e83-7e11-464c-b93a-daf047838b26") - // } - // ); - modelBuilder.Entity(entity => { entity.HasKey(e => e.Id); @@ -196,79 +163,11 @@ namespace Marco.Pms.DataAccess.Data ProjectStatusId = new Guid("b74da4c2-d07e-46f2-9919-e75e49b12731"), TenantId = Guid.Parse("b3466e83-7e11-464c-b93a-daf047838b26") } - //, new Project - //{ - // Id = new Guid("3ef56a12-f5e5-4193-87d6-9e110ed10b86"), - // Name = "Project 2", - // ProjectAddress = "Project 2 Address", - // ContactPerson = "Project 2 Contact Person", - // 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 = new Guid("54d013e3-0a2b-48be-85c7-5ef03492a18c"), - // Name = "Project 3", - // ProjectAddress = "Project 3 Address", - // ContactPerson = "Project 3 Contact Person", - // 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") - //} ); var tenantId = _httpContextAccessor.HttpContext?.Items["TenantId"]?.ToString(); - //modelBuilder.Entity() - // .HasData( - // new ActivityMaster - // { - // Id = new Guid("4117b7de-ef6c-461f-a2c2-64eaac5f9a11"), - // ActivityName = "Core Cutting", - // UnitOfMeasurement = UnitOfMeasurement.Number.ToString(), - // TenantId = Guid.Parse("b3466e83-7e11-464c-b93a-daf047838b26") - // }, new ActivityMaster - // { - // Id = new Guid("1714f64d-7591-4419-bee5-118d21bb2855"), - // ActivityName = "Fabrication", - // UnitOfMeasurement = UnitOfMeasurement.Meter.ToString(), - // TenantId = Guid.Parse("b3466e83-7e11-464c-b93a-daf047838b26") - // }, new ActivityMaster - // { - // Id = new Guid("b3f51a93-dde6-45f9-8b22-f1bf017a640b"), - // ActivityName = "Welding", - // UnitOfMeasurement = UnitOfMeasurement.Meter.ToString(), - // TenantId = Guid.Parse("b3466e83-7e11-464c-b93a-daf047838b26") - // }, new ActivityMaster - // { - // Id = new Guid("53eedf44-4076-445f-be93-fedef17117e7"), - // ActivityName = "MS Support Fabrication", - // UnitOfMeasurement = UnitOfMeasurement.Number.ToString(), - // TenantId = Guid.Parse("b3466e83-7e11-464c-b93a-daf047838b26") - // }, new ActivityMaster - // { - // Id = new Guid("715b9ddb-d9e2-4afa-8987-d9918905cea4"), - // ActivityName = "MS Support Hanging", - // UnitOfMeasurement = UnitOfMeasurement.Number.ToString(), - // TenantId = Guid.Parse("b3466e83-7e11-464c-b93a-daf047838b26") - // }, new ActivityMaster - // { - // Id = new Guid("a3d191a7-a5aa-4dd8-a525-12c99263bbd6"), - // ActivityName = "Hydrant Volve", - // UnitOfMeasurement = UnitOfMeasurement.Number.ToString(), - // TenantId = Guid.Parse("b3466e83-7e11-464c-b93a-daf047838b26") - // }, new ActivityMaster - // { - // Id = new Guid("c138a7de-713a-4bd4-8292-b0b265be77a3"), - // ActivityName = "Sprinkler Installation", - // UnitOfMeasurement = UnitOfMeasurement.Number.ToString(), - // TenantId = Guid.Parse("b3466e83-7e11-464c-b93a-daf047838b26") - // } - // ); - modelBuilder.Entity().HasData( 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" }, @@ -487,6 +386,223 @@ namespace Marco.Pms.DataAccess.Data + modelBuilder.Entity().HasData( + new ExpensesStatusMaster + { + Id = Guid.Parse("297e0d8f-f668-41b5-bfea-e03b354251c8"), + Name = "Draft", + Description = "Expense has been created but not yet submitted.", + IsSystem = true, + IsActive = true, + TenantId = Guid.Parse("b3466e83-7e11-464c-b93a-daf047838b26") + }, + new ExpensesStatusMaster + { + Id = Guid.Parse("6537018f-f4e9-4cb3-a210-6c3b2da999d7"), + Name = "Review Pending", + Description = "Reviewer is currently reviewing the expense.", + IsSystem = true, + IsActive = true, + TenantId = Guid.Parse("b3466e83-7e11-464c-b93a-daf047838b26") + }, + new ExpensesStatusMaster + { + Id = Guid.Parse("4068007f-c92f-4f37-a907-bc15fe57d4d8"), + Name = "Approval Pending", + Description = "Review is completed, waiting for action of approver.", + IsSystem = true, + IsActive = true, + TenantId = Guid.Parse("b3466e83-7e11-464c-b93a-daf047838b26") + }, + new ExpensesStatusMaster + { + Id = Guid.Parse("d1ee5eec-24b6-4364-8673-a8f859c60729"), + Name = "Rejected", + Description = "Expense was declined, often with a reason(either review rejected or approval rejected.", + IsSystem = true, + IsActive = true, + TenantId = Guid.Parse("b3466e83-7e11-464c-b93a-daf047838b26") + }, + new ExpensesStatusMaster + { + Id = Guid.Parse("f18c5cfd-7815-4341-8da2-2c2d65778e27"), + Name = "Process Pending", + Description = "Approved expense is awaiting final payment.", + IsSystem = true, + IsActive = true, + TenantId = Guid.Parse("b3466e83-7e11-464c-b93a-daf047838b26") + }, + new ExpensesStatusMaster + { + Id = Guid.Parse("61578360-3a49-4c34-8604-7b35a3787b95"), + Name = "Processed", + Description = "Expense has been settled.", + IsSystem = true, + IsActive = true, + TenantId = Guid.Parse("b3466e83-7e11-464c-b93a-daf047838b26") + } + ); + + modelBuilder.Entity().HasData( + // Process to processed + new StatusMapping + { + Id = Guid.Parse("5cf7f1df-9d1f-4289-add0-1775ad614f25"), + StatusId = Guid.Parse("f18c5cfd-7815-4341-8da2-2c2d65778e27"), + NextStatusId = Guid.Parse("f18c5cfd-7815-4341-8da2-2c2d65778e27"), + TenantId = Guid.Parse("b3466e83-7e11-464c-b93a-daf047838b26") + }, + // Approve to Rejected + new StatusMapping + { + Id = Guid.Parse("36c00548-241c-43ec-bc95-cacebedb925c"), + StatusId = Guid.Parse("4068007f-c92f-4f37-a907-bc15fe57d4d8"), + NextStatusId = Guid.Parse("d1ee5eec-24b6-4364-8673-a8f859c60729"), + TenantId = Guid.Parse("b3466e83-7e11-464c-b93a-daf047838b26") + }, + // Approve to Process + new StatusMapping + { + Id = Guid.Parse("1fca1700-1266-477d-bba4-9ac3753aa33c"), + StatusId = Guid.Parse("4068007f-c92f-4f37-a907-bc15fe57d4d8"), + NextStatusId = Guid.Parse("f18c5cfd-7815-4341-8da2-2c2d65778e27"), + TenantId = Guid.Parse("b3466e83-7e11-464c-b93a-daf047838b26") + }, + // Review to Rejected + new StatusMapping + { + Id = Guid.Parse("fddaaf20-4ccc-4f4e-a724-dd310272b356"), + StatusId = Guid.Parse("6537018f-f4e9-4cb3-a210-6c3b2da999d7"), + NextStatusId = Guid.Parse("d1ee5eec-24b6-4364-8673-a8f859c60729"), + TenantId = Guid.Parse("b3466e83-7e11-464c-b93a-daf047838b26") + }, + // Review to Aprrove + new StatusMapping + { + Id = Guid.Parse("ef1fcfbc-60e0-4f17-9308-c583a05d48fd"), + StatusId = Guid.Parse("6537018f-f4e9-4cb3-a210-6c3b2da999d7"), + NextStatusId = Guid.Parse("4068007f-c92f-4f37-a907-bc15fe57d4d8"), + TenantId = Guid.Parse("b3466e83-7e11-464c-b93a-daf047838b26") + }, + // Draft to Review + new StatusMapping + { + Id = Guid.Parse("af1e4492-98ee-4451-8ab7-fd8323f29c32"), + StatusId = Guid.Parse("297e0d8f-f668-41b5-bfea-e03b354251c8"), + NextStatusId = Guid.Parse("6537018f-f4e9-4cb3-a210-6c3b2da999d7"), + TenantId = Guid.Parse("b3466e83-7e11-464c-b93a-daf047838b26") + } + ); + + modelBuilder.Entity().HasData( + new ExpensesTypeMaster + { + Id = Guid.Parse("5e0c6227-d49d-41ff-9f1f-781f0aee2469"), + Name = "Procurement", + Description = "Materials, equipment and supplies purchased for site operations.", + NoOfPersonsRequired = false, + IsActive = true, + TenantId = Guid.Parse("b3466e83-7e11-464c-b93a-daf047838b26") + }, + new ExpensesTypeMaster + { + Id = Guid.Parse("2de53163-0dbd-404b-8e60-1b02e6b4886a"), + Name = "Transport", + Description = "Vehicle fuel, logistics services and delivery of goods or personnel.", + NoOfPersonsRequired = false, + IsActive = true, + TenantId = Guid.Parse("b3466e83-7e11-464c-b93a-daf047838b26") + }, + new ExpensesTypeMaster + { + Id = Guid.Parse("dd120bc4-ab0a-45ba-8450-5cd45ff221ca"), + Name = "Travelling", + Description = "Delivery of personnel.", + NoOfPersonsRequired = true, + IsActive = true, + TenantId = Guid.Parse("b3466e83-7e11-464c-b93a-daf047838b26") + }, + new ExpensesTypeMaster + { + Id = Guid.Parse("52484820-1b54-4865-8f0f-baa2b1d339b9"), + Name = "Mobilization", + Description = "Site setup costs including equipment deployment and temporary infrastructure.", + NoOfPersonsRequired = false, + IsActive = true, + TenantId = Guid.Parse("b3466e83-7e11-464c-b93a-daf047838b26") + }, + new ExpensesTypeMaster + { + Id = Guid.Parse("fc59eb90-98ea-481c-b421-54bfa9e42d8f"), + Name = "Employee Welfare", + Description = " Worker amenities like snacks, meals, safety gear, accommodation, medical support etc.", + NoOfPersonsRequired = true, + IsActive = true, + TenantId = Guid.Parse("b3466e83-7e11-464c-b93a-daf047838b26") + }, + new ExpensesTypeMaster + { + Id = Guid.Parse("77013784-9324-4d8b-bd36-d6f928e68942"), + Name = "Maintenance & Utilities", + Description = "Machinery servicing, electricity, water, and temporary office needs.", + NoOfPersonsRequired = false, + IsActive = true, + TenantId = Guid.Parse("b3466e83-7e11-464c-b93a-daf047838b26") + }, + new ExpensesTypeMaster + { + Id = Guid.Parse("1e2d697a-76b4-4be8-bc66-87144561a1a0"), + Name = "Vendor/Supplier Payments", + Description = "Scheduled payments for external services or goods.", + NoOfPersonsRequired = false, + IsActive = true, + TenantId = Guid.Parse("b3466e83-7e11-464c-b93a-daf047838b26") + }, + new ExpensesTypeMaster + { + Id = Guid.Parse("4842fa61-64eb-4241-aebd-8282065af9f9"), + Name = "Compliance & Safety", + Description = "Government fees, insurance, inspections and safety-related expenditures.", + NoOfPersonsRequired = false, + IsActive = true, + TenantId = Guid.Parse("b3466e83-7e11-464c-b93a-daf047838b26") + } + ); + + modelBuilder.Entity().HasData( + new PaymentModeMatser + { + Id = Guid.Parse("24e6b0df-7929-47d2-88a3-4cf14c1f28f9"), + Name = "Cash", + Description = "Physical currency; still used for small or informal transactions.", + IsActive = true, + TenantId = Guid.Parse("b3466e83-7e11-464c-b93a-daf047838b26") + }, + new PaymentModeMatser + { + Id = Guid.Parse("48d9b462-5d87-4dec-8dec-2bc943943172"), + Name = "Cheque", + Description = "Paper-based payment order; less common now due to processing delays and fraud risks.", + IsActive = true, + TenantId = Guid.Parse("b3466e83-7e11-464c-b93a-daf047838b26") + }, + new PaymentModeMatser + { + Id = Guid.Parse("ed667353-8eea-4fd1-8750-719405932480"), + Name = "NetBanking", + Description = "Online banking portals used to transfer funds directly between accounts", + IsActive = true, + TenantId = Guid.Parse("b3466e83-7e11-464c-b93a-daf047838b26") + }, + new PaymentModeMatser + { + Id = Guid.Parse("2e919e94-694c-41d9-9489-0a2b4208a027"), + Name = "UPI", + Description = "Real-time bank-to-bank transfer using mobile apps; widely used for peer-to-peer and merchant payments.", + IsActive = true, + TenantId = Guid.Parse("b3466e83-7e11-464c-b93a-daf047838b26") + } + ); modelBuilder.Entity().HasData(new Module { @@ -508,53 +624,63 @@ namespace Marco.Pms.DataAccess.Data Key = "504ec132-e6a9-422f-8f85-050602cfce05" }); - - modelBuilder.Entity().HasData( + // Project Module new Feature { Id = new Guid("53176ebf-c75d-42e5-839f-4508ffac3def"), Description = "Manage Project", Name = "Project Management", 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("a4e25142-449b-4334-a6e5-22f70e4732d7"), Description = "Expense Management is the systematic process of tracking, controlling, and reporting business-related expenditures.", Name = "Expense Management", ModuleId = new Guid("bf59fd88-b57a-4d67-bf01-3780f385896b"), IsActive = true }, new Feature { Id = new Guid("9d4b5489-2079-40b9-bd77-6e1bf90bc19f"), Description = "Manage Tasks", Name = "Task Management", ModuleId = new Guid("bf59fd88-b57a-4d67-bf01-3780f385896b"), IsActive = true }, + // Employee Module new Feature { Id = new Guid("81ab8a87-8ccd-4015-a917-0627cee6a100"), Description = "Manage Employee", Name = "Employee Management", ModuleId = new Guid("2a231490-bcb1-4bdd-91f1-f25fb7f25b23"), IsActive = true }, new Feature { Id = new Guid("52c9cf54-1eb2-44d2-81bb-524cf29c0a94"), Description = "Attendance", Name = "Attendance Management", ModuleId = new Guid("2a231490-bcb1-4bdd-91f1-f25fb7f25b23"), IsActive = true }, - new Feature { Id = new Guid("be3b3afc-6ccf-4566-b9b6-aafcb65546be"), Description = "Global Masters", Name = "Masters", ModuleId = new Guid("c43db8c7-ab73-47f4-9d3b-f83e81357924"), IsActive = true }, + // Master Module + new Feature { Id = new Guid("be3b3afc-6ccf-4566-b9b6-aafcb65546be"), Description = "Global Masters", Name = "Masters", ModuleId = new Guid("c43db8c7-ab73-47f4-9d3b-f83e81357924"), IsActive = true }, new Feature { Id = new Guid("39e66f81-efc6-446c-95bd-46bff6cfb606"), Description = "Managing all directory related rights", Name = "Directory Management", 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( + // Project Management Feature new FeaturePermission { Id = new Guid("6ea44136-987e-44ba-9e5d-1cf8f5837ebc"), FeatureId = new Guid("53176ebf-c75d-42e5-839f-4508ffac3def"), IsEnabled = true, Name = "View Project", Description = "Access all information related to the project." }, - new FeaturePermission { Id = new Guid("172fc9b6-755b-4f62-ab26-55c34a330614"), FeatureId = new Guid("53176ebf-c75d-42e5-839f-4508ffac3def"), IsEnabled = true, Name = "Manage Project", Description = "Potentially edit the project name, description, start/end dates, or status." }, - new FeaturePermission { Id = new Guid("b94802ce-0689-4643-9e1d-11c86950c35b"), FeatureId = new Guid("53176ebf-c75d-42e5-839f-4508ffac3def"), IsEnabled = true, Name = "Manage Team", Description = "The \"Manage Team\" feature allows authorized users to organize project personnel by adding, removing, and assigning employee to projects." }, - new FeaturePermission { Id = new Guid("8d7cc6e3-9147-41f7-aaa7-fa507e450bd4"), FeatureId = new Guid("53176ebf-c75d-42e5-839f-4508ffac3def"), IsEnabled = true, Name = "View Project Infra", Description = "Grants a user comprehensive read-only access to all details concerning the project's underlying systems, technologies, resources, and configurations" }, - new FeaturePermission { Id = new Guid("cf2825ad-453b-46aa-91d9-27c124d63373"), FeatureId = new Guid("53176ebf-c75d-42e5-839f-4508ffac3def"), IsEnabled = true, Name = "Manage Project Infra", Description = "This allows them to create, modify, and manage all aspects of the supporting infrastructure." }, + new FeaturePermission { Id = new Guid("172fc9b6-755b-4f62-ab26-55c34a330614"), FeatureId = new Guid("53176ebf-c75d-42e5-839f-4508ffac3def"), IsEnabled = true, Name = "Manage Project", Description = "Potentially edit the project name, description, start/end dates, or status." }, + new FeaturePermission { Id = new Guid("b94802ce-0689-4643-9e1d-11c86950c35b"), FeatureId = new Guid("53176ebf-c75d-42e5-839f-4508ffac3def"), IsEnabled = true, Name = "Manage Team", Description = "The \"Manage Team\" feature allows authorized users to organize project personnel by adding, removing, and assigning employee to projects." }, + new FeaturePermission { Id = new Guid("8d7cc6e3-9147-41f7-aaa7-fa507e450bd4"), FeatureId = new Guid("53176ebf-c75d-42e5-839f-4508ffac3def"), IsEnabled = true, Name = "View Project Infra", Description = "Grants a user comprehensive read-only access to all details concerning the project's underlying systems, technologies, resources, and configurations" }, + new FeaturePermission { Id = new Guid("cf2825ad-453b-46aa-91d9-27c124d63373"), FeatureId = new Guid("53176ebf-c75d-42e5-839f-4508ffac3def"), IsEnabled = true, Name = "Manage Project Infra", Description = "This allows them to create, modify, and manage all aspects of the supporting infrastructure." }, + // Task Management Feature + new FeaturePermission { Id = new Guid("9fcc5f87-25e3-4846-90ac-67a71ab92e3c"), FeatureId = new Guid("9d4b5489-2079-40b9-bd77-6e1bf90bc19f"), IsEnabled = true, Name = "View Task", Description = "Grants a user comprehensive read-only access to all details associated with tasks within a project. This includes task descriptions, statuses, assignees, due dates, dependencies, progress, history, and any related attachments or discussions." }, + new FeaturePermission { Id = new Guid("08752f33-3b29-4816-b76b-ea8a968ed3c5"), FeatureId = new Guid("9d4b5489-2079-40b9-bd77-6e1bf90bc19f"), IsEnabled = true, Name = "Add/Edit Task", Description = "This allows them to create new tasks, modify existing task attributes (description, status, assignee, due date, etc.)," }, + new FeaturePermission { Id = new Guid("6a32379b-8b3f-49a6-8c48-4b7ac1b55dc2"), FeatureId = new Guid("9d4b5489-2079-40b9-bd77-6e1bf90bc19f"), IsEnabled = true, Name = "Assign/Report Progress", Description = "Grants a user the ability to designate team members responsible for specific tasks and to update the completion status or provide progress updates for those tasks" }, + new FeaturePermission { Id = new Guid("db4e40c5-2ba9-4b6d-b8a6-a16a250ff99c"), FeatureId = new Guid("9d4b5489-2079-40b9-bd77-6e1bf90bc19f"), IsEnabled = true, Name = "Approve Task", Description = "Grants a user the authority to officially confirm the completion or acceptance of a task, often signifying that it meets the required standards or criteria" }, - new FeaturePermission { Id = new Guid("9fcc5f87-25e3-4846-90ac-67a71ab92e3c"), FeatureId = new Guid("9d4b5489-2079-40b9-bd77-6e1bf90bc19f"), IsEnabled = true, Name = "View Task", Description = "Grants a user comprehensive read-only access to all details associated with tasks within a project. This includes task descriptions, statuses, assignees, due dates, dependencies, progress, history, and any related attachments or discussions." }, - new FeaturePermission { Id = new Guid("08752f33-3b29-4816-b76b-ea8a968ed3c5"), FeatureId = new Guid("9d4b5489-2079-40b9-bd77-6e1bf90bc19f"), IsEnabled = true, Name = "Add/Edit Task", Description = "This allows them to create new tasks, modify existing task attributes (description, status, assignee, due date, etc.)," }, - new FeaturePermission { Id = new Guid("6a32379b-8b3f-49a6-8c48-4b7ac1b55dc2"), FeatureId = new Guid("9d4b5489-2079-40b9-bd77-6e1bf90bc19f"), IsEnabled = true, Name = "Assign/Report Progress", Description = "Grants a user the ability to designate team members responsible for specific tasks and to update the completion status or provide progress updates for those tasks" }, - new FeaturePermission { Id = new Guid("db4e40c5-2ba9-4b6d-b8a6-a16a250ff99c"), FeatureId = new Guid("9d4b5489-2079-40b9-bd77-6e1bf90bc19f"), IsEnabled = true, Name = "Approve Task", Description = "Grants a user the authority to officially confirm the completion or acceptance of a task, often signifying that it meets the required standards or criteria" }, + // Employee Management Feature + new FeaturePermission { Id = new Guid("60611762-7f8a-4fb5-b53f-b1139918796b"), FeatureId = new Guid("81ab8a87-8ccd-4015-a917-0627cee6a100"), IsEnabled = true, Name = "View All Employees", Description = "Grants a user read-only access to details about the all individuals within the system. This typically includes names, contact information, roles, departments, and potentially other relevant employee data" }, + new FeaturePermission { Id = new Guid("b82d2b7e-0d52-45f3-997b-c008ea460e7f"), FeatureId = new Guid("81ab8a87-8ccd-4015-a917-0627cee6a100"), IsEnabled = true, Name = "View Team Members", Description = "Grants a user read-only access to details about the individuals within the system which are is assigned to same projects as user. This typically includes names, contact information, roles, departments, and potentially other relevant employee data" }, + new FeaturePermission { Id = new Guid("a97d366a-c2bb-448d-be93-402bd2324566"), FeatureId = new Guid("81ab8a87-8ccd-4015-a917-0627cee6a100"), IsEnabled = true, Name = "Add/Edit Employee", Description = "Grants a user the authority to create new employee profiles and modify existing employee details within the system. This typically includes adding or updating information such as names, contact details, roles, departments, skills, and potentially other personal or professional data" }, + new FeaturePermission { Id = new Guid("fbd213e0-0250-46f1-9f5f-4b2a1e6e76a3"), FeatureId = new Guid("81ab8a87-8ccd-4015-a917-0627cee6a100"), IsEnabled = true, Name = "Assign Roles", Description = "Grants a user the authority to manage employee application roles, enabling them to assign or revoke access privileges within the system." }, + // Attendance Management Feature + new FeaturePermission { Id = new Guid("915e6bff-65f6-4e3f-aea8-3fd217d3ea9e"), FeatureId = new Guid("52c9cf54-1eb2-44d2-81bb-524cf29c0a94"), IsEnabled = true, Name = "Team Attendance ", Description = "Team Attendance refers to tracking and managing the attendance of all team members collectively, often monitored by a team lead or manager." }, + new FeaturePermission { Id = new Guid("57802c4a-00aa-4a1f-a048-fd2f70dd44b6"), FeatureId = new Guid("52c9cf54-1eb2-44d2-81bb-524cf29c0a94"), IsEnabled = true, Name = "Regularize Attendance", Description = "Grants a user the authority to approve requests from employees to adjust or correct their recorded attendance. This typically involves reviewing the reason for the regularization, verifying any supporting documentation, and then officially accepting the changes to the employee's attendance records" }, + new FeaturePermission { Id = new Guid("ccb0589f-712b-43de-92ed-5b6088e7dc4e"), FeatureId = new Guid("52c9cf54-1eb2-44d2-81bb-524cf29c0a94"), IsEnabled = true, Name = "Self Attendance", Description = "Team Attendance refers to tracking and managing the attendance of all team members collectively, often monitored by a team lead or manager." }, - new FeaturePermission { Id = new Guid("60611762-7f8a-4fb5-b53f-b1139918796b"), FeatureId = new Guid("81ab8a87-8ccd-4015-a917-0627cee6a100"), IsEnabled = true, Name = "View All Employees", Description = "Grants a user read-only access to details about the all individuals within the system. This typically includes names, contact information, roles, departments, and potentially other relevant employee data" }, - new FeaturePermission { Id = new Guid("b82d2b7e-0d52-45f3-997b-c008ea460e7f"), FeatureId = new Guid("81ab8a87-8ccd-4015-a917-0627cee6a100"), IsEnabled = true, Name = "View Team Members", Description = "Grants a user read-only access to details about the individuals within the system which are is assigned to same projects as user. This typically includes names, contact information, roles, departments, and potentially other relevant employee data" }, - new FeaturePermission { Id = new Guid("a97d366a-c2bb-448d-be93-402bd2324566"), FeatureId = new Guid("81ab8a87-8ccd-4015-a917-0627cee6a100"), IsEnabled = true, Name = "Add/Edit Employee", Description = "Grants a user the authority to create new employee profiles and modify existing employee details within the system. This typically includes adding or updating information such as names, contact details, roles, departments, skills, and potentially other personal or professional data" }, - new FeaturePermission { Id = new Guid("fbd213e0-0250-46f1-9f5f-4b2a1e6e76a3"), FeatureId = new Guid("81ab8a87-8ccd-4015-a917-0627cee6a100"), IsEnabled = true, Name = "Assign Roles", Description = "Grants a user the authority to manage employee application roles, enabling them to assign or revoke access privileges within the system." }, + // Masters Feature + new FeaturePermission { Id = new Guid("5ffbafe0-7ab0-48b1-bb50-c1bf76b65f9d"), FeatureId = new Guid("be3b3afc-6ccf-4566-b9b6-aafcb65546be"), IsEnabled = true, Name = "View Masters", Description = "Grants a user read-only access to foundational or reference data within the system. \"Masters\" typically refer to predefined lists, categories, or templates that are used throughout the application to standardize information and maintain consistency" }, + new FeaturePermission { Id = new Guid("588a8824-f924-4955-82d8-fc51956cf323"), FeatureId = new Guid("be3b3afc-6ccf-4566-b9b6-aafcb65546be"), IsEnabled = true, Name = "Manage Masters", Description = "Grants a user the authority to create, modify, and delete foundational or reference data within the system. These \"masters\" are typically the core lists, categories, and configurations that other data and functionalities rely upon, such as departments, job titles, product categories" }, + // Directory Management Feature + new FeaturePermission { Id = new Guid("4286a13b-bb40-4879-8c6d-18e9e393beda"), FeatureId = new Guid("39e66f81-efc6-446c-95bd-46bff6cfb606"), IsEnabled = true, Name = "Directory Admin", Description = "Full control over all directories, including the ability to manage permissions for all directories in the system." }, + new FeaturePermission { Id = new Guid("62668630-13ce-4f52-a0f0-db38af2230c5"), FeatureId = new Guid("39e66f81-efc6-446c-95bd-46bff6cfb606"), IsEnabled = true, Name = "Directory Manager", Description = "Full control over directories they created or have been assigned. Can also manage permissions for those directories." }, + new FeaturePermission { Id = new Guid("0f919170-92d4-4337-abd3-49b66fc871bb"), FeatureId = new Guid("39e66f81-efc6-446c-95bd-46bff6cfb606"), IsEnabled = true, Name = "Directory User", Description = "Full control over directories they created. Can view contacts in directories they either created or were assigned to. Can manage permissions only for directories they created." }, - new FeaturePermission { Id = new Guid("915e6bff-65f6-4e3f-aea8-3fd217d3ea9e"), FeatureId = new Guid("52c9cf54-1eb2-44d2-81bb-524cf29c0a94"), IsEnabled = true, Name = "Team Attendance ", Description = "Team Attendance refers to tracking and managing the attendance of all team members collectively, often monitored by a team lead or manager." }, - new FeaturePermission { Id = new Guid("57802c4a-00aa-4a1f-a048-fd2f70dd44b6"), FeatureId = new Guid("52c9cf54-1eb2-44d2-81bb-524cf29c0a94"), IsEnabled = true, Name = "Regularize Attendance", Description = "Grants a user the authority to approve requests from employees to adjust or correct their recorded attendance. This typically involves reviewing the reason for the regularization, verifying any supporting documentation, and then officially accepting the changes to the employee's attendance records" }, - new FeaturePermission { Id = new Guid("ccb0589f-712b-43de-92ed-5b6088e7dc4e"), FeatureId = new Guid("52c9cf54-1eb2-44d2-81bb-524cf29c0a94"), IsEnabled = true, Name = "Self Attendance", Description = "Team Attendance refers to tracking and managing the attendance of all team members collectively, often monitored by a team lead or manager." }, - - new FeaturePermission { Id = new Guid("5ffbafe0-7ab0-48b1-bb50-c1bf76b65f9d"), FeatureId = new Guid("be3b3afc-6ccf-4566-b9b6-aafcb65546be"), IsEnabled = true, Name = "View Masters", Description = "Grants a user read-only access to foundational or reference data within the system. \"Masters\" typically refer to predefined lists, categories, or templates that are used throughout the application to standardize information and maintain consistency" }, - new FeaturePermission { Id = new Guid("588a8824-f924-4955-82d8-fc51956cf323"), FeatureId = new Guid("be3b3afc-6ccf-4566-b9b6-aafcb65546be"), IsEnabled = true, Name = "Manage Masters", Description = "Grants a user the authority to create, modify, and delete foundational or reference data within the system. These \"masters\" are typically the core lists, categories, and configurations that other data and functionalities rely upon, such as departments, job titles, product categories" }, - - new FeaturePermission { Id = new Guid("4286a13b-bb40-4879-8c6d-18e9e393beda"), FeatureId = new Guid("39e66f81-efc6-446c-95bd-46bff6cfb606"), IsEnabled = true, Name = "Directory Admin", Description = "Full control over all directories, including the ability to manage permissions for all directories in the system." }, - new FeaturePermission { Id = new Guid("62668630-13ce-4f52-a0f0-db38af2230c5"), FeatureId = new Guid("39e66f81-efc6-446c-95bd-46bff6cfb606"), IsEnabled = true, Name = "Directory Manager", Description = "Full control over directories they created or have been assigned. Can also manage permissions for those directories." }, - new FeaturePermission { Id = new Guid("0f919170-92d4-4337-abd3-49b66fc871bb"), FeatureId = new Guid("39e66f81-efc6-446c-95bd-46bff6cfb606"), IsEnabled = true, Name = "Directory User", Description = "Full control over directories they created. Can view contacts in directories they either created or were assigned to. Can manage permissions only for directories they created." } - //new FeaturePermission { Id = new Guid("6b1a6d97-a951-4de5-9b19-709bac7c4f18"), FeatureId = new Guid("660131a4-788c-4739-a082-cbbf7879cbf2"), IsEnabled = true, Name = "Manage Masters", Description = "" } + // Expense Management Feature + new FeaturePermission { Id = new Guid("385be49f-8fde-440e-bdbc-3dffeb8dd116"), FeatureId = new Guid("a4e25142-449b-4334-a6e5-22f70e4732d7"), IsEnabled = true, Name = "View Self", Description = "Allows a user to view only the expense records that they have personally submitted" }, + new FeaturePermission { Id = new Guid("01e06444-9ca7-4df4-b900-8c3fa051b92f"), FeatureId = new Guid("a4e25142-449b-4334-a6e5-22f70e4732d7"), IsEnabled = true, Name = "View All", Description = "Allows a user to view all expense records across the organization or project, regardless of who submitted or paid them" }, + new FeaturePermission { Id = new Guid("0f57885d-bcb2-4711-ac95-d841ace6d5a7"), FeatureId = new Guid("a4e25142-449b-4334-a6e5-22f70e4732d7"), IsEnabled = true, Name = "Upload", Description = "Allows a user to create and submit new expense records, including attaching relevant documents like receipts or invoices." }, + new FeaturePermission { Id = new Guid("1f4bda08-1873-449a-bb66-3e8222bd871b"), FeatureId = new Guid("a4e25142-449b-4334-a6e5-22f70e4732d7"), IsEnabled = true, Name = "Review", Description = "Allows a user to examine submitted expenses for accuracy, completeness, and policy compliance before they are approved or rejected." }, + new FeaturePermission { Id = new Guid("eaafdd76-8aac-45f9-a530-315589c6deca"), FeatureId = new Guid("a4e25142-449b-4334-a6e5-22f70e4732d7"), IsEnabled = true, Name = "Approve", Description = "Allows a user to authorize or reject submitted expenses, making them officially accepted or declined within the system." }, + new FeaturePermission { Id = new Guid("ea5a1529-4ee8-4828-80ea-0e23c9d4dd11"), FeatureId = new Guid("a4e25142-449b-4334-a6e5-22f70e4732d7"), IsEnabled = true, Name = "Process", Description = "Allows a user to handle post-approval actions such as recording payments, updating financial records, or marking expenses as reimbursed or settled." }, + new FeaturePermission { Id = new Guid("bdee29a2-b73b-402d-8dd1-c4b1f81ccbc3"), FeatureId = new Guid("a4e25142-449b-4334-a6e5-22f70e4732d7"), IsEnabled = true, Name = "Manage", Description = "Allows a user to configure and control system settings, such as managing expense types, payment modes, permissions, and overall workflow rules." } ); } diff --git a/Marco.Pms.DataAccess/Migrations/20250719074035_Expenses_tables_Added.Designer.cs b/Marco.Pms.DataAccess/Migrations/20250719074035_Expenses_tables_Added.Designer.cs new file mode 100644 index 0000000..a126fc0 --- /dev/null +++ b/Marco.Pms.DataAccess/Migrations/20250719074035_Expenses_tables_Added.Designer.cs @@ -0,0 +1,4180 @@ +// +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("20250719074035_Expenses_tables_Added")] + partial class Expenses_tables_Added + { + /// + 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("char(36)"); + + b.Property("ApprovedById") + .HasColumnType("char(36)"); + + b.Property("ApprovedDate") + .HasColumnType("datetime(6)"); + + b.Property("AssignedBy") + .HasColumnType("char(36)"); + + b.Property("AssignmentDate") + .HasColumnType("datetime(6)"); + + b.Property("CompletedTask") + .HasColumnType("double"); + + b.Property("Description") + .HasColumnType("longtext"); + + b.Property("ParentTaskId") + .HasColumnType("char(36)"); + + b.Property("PlannedTask") + .HasColumnType("double"); + + b.Property("ReportedById") + .HasColumnType("char(36)"); + + b.Property("ReportedDate") + .HasColumnType("datetime(6)"); + + b.Property("ReportedTask") + .HasColumnType("double"); + + b.Property("TenantId") + .HasColumnType("char(36)"); + + b.Property("WorkItemId") + .HasColumnType("char(36)"); + + b.Property("WorkStatusId") + .HasColumnType("char(36)"); + + b.HasKey("Id"); + + b.HasIndex("ApprovedById"); + + b.HasIndex("AssignedBy"); + + b.HasIndex("ReportedById"); + + b.HasIndex("TenantId"); + + b.HasIndex("WorkItemId"); + + b.HasIndex("WorkStatusId"); + + b.ToTable("TaskAllocations"); + }); + + modelBuilder.Entity("Marco.Pms.Model.Activities.TaskAttachment", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("DocumentId") + .HasColumnType("char(36)"); + + b.Property("ReferenceId") + .HasColumnType("char(36)"); + + b.HasKey("Id"); + + b.ToTable("TaskAttachments"); + }); + + modelBuilder.Entity("Marco.Pms.Model.Activities.TaskComment", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("Comment") + .IsRequired() + .HasColumnType("longtext"); + + b.Property("CommentDate") + .HasColumnType("datetime(6)"); + + b.Property("CommentedBy") + .HasColumnType("char(36)"); + + b.Property("TaskAllocationId") + .HasColumnType("char(36)"); + + b.Property("TenantId") + .HasColumnType("char(36)"); + + 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("char(36)"); + + b.Property("EmployeeId") + .HasColumnType("char(36)"); + + b.Property("TaskAllocationId") + .HasColumnType("char(36)"); + + b.Property("TenantId") + .HasColumnType("char(36)"); + + 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("char(36)"); + + b.Property("Activity") + .HasColumnType("int"); + + b.Property("ApprovedBy") + .HasColumnType("char(36)"); + + b.Property("AttendanceDate") + .HasColumnType("datetime(6)"); + + b.Property("Comment") + .IsRequired() + .HasColumnType("longtext"); + + b.Property("Date") + .HasColumnType("datetime(6)"); + + b.Property("EmployeeID") + .HasColumnType("char(36)"); + + b.Property("InTime") + .HasColumnType("datetime(6)"); + + b.Property("IsApproved") + .HasColumnType("tinyint(1)"); + + b.Property("OutTime") + .HasColumnType("datetime(6)"); + + b.Property("ProjectID") + .HasColumnType("char(36)"); + + b.Property("TenantId") + .HasColumnType("char(36)"); + + 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("char(36)"); + + b.Property("Activity") + .HasColumnType("int"); + + b.Property("ActivityTime") + .HasColumnType("datetime(6)"); + + b.Property("AttendanceId") + .HasColumnType("char(36)"); + + b.Property("Comment") + .IsRequired() + .HasColumnType("longtext"); + + b.Property("DocumentId") + .HasColumnType("char(36)"); + + b.Property("EmployeeID") + .HasColumnType("char(36)"); + + b.Property("Latitude") + .HasColumnType("longtext"); + + b.Property("Longitude") + .HasColumnType("longtext"); + + b.Property("Photo") + .HasColumnType("longblob"); + + b.Property("TenantId") + .HasColumnType("char(36)"); + + b.Property("UpdatedBy") + .HasColumnType("char(36)"); + + 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.MPINDetails", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("MPIN") + .IsRequired() + .HasColumnType("longtext"); + + b.Property("MPINToken") + .IsRequired() + .HasColumnType("longtext"); + + b.Property("TenantId") + .HasColumnType("char(36)"); + + b.Property("TimeStamp") + .HasColumnType("datetime(6)"); + + b.Property("UserId") + .HasColumnType("char(36)"); + + b.HasKey("Id"); + + b.HasIndex("TenantId"); + + b.ToTable("MPINDetails"); + }); + + modelBuilder.Entity("Marco.Pms.Model.Authentication.OTPDetails", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("ExpriesInSec") + .HasColumnType("int"); + + b.Property("IsUsed") + .HasColumnType("tinyint(1)"); + + b.Property("OTP") + .IsRequired() + .HasColumnType("longtext"); + + b.Property("TenantId") + .HasColumnType("char(36)"); + + b.Property("TimeStamp") + .HasColumnType("datetime(6)"); + + b.Property("UserId") + .HasColumnType("char(36)"); + + b.HasKey("Id"); + + b.HasIndex("TenantId"); + + b.ToTable("OTPDetails"); + }); + + modelBuilder.Entity("Marco.Pms.Model.Authentication.RefreshToken", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + 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.Directory.Bucket", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("CreatedAt") + .HasColumnType("datetime(6)"); + + b.Property("CreatedByID") + .HasColumnType("char(36)"); + + b.Property("Description") + .IsRequired() + .HasColumnType("longtext"); + + b.Property("Name") + .IsRequired() + .HasColumnType("longtext"); + + b.Property("TenantId") + .HasColumnType("char(36)"); + + b.HasKey("Id"); + + b.HasIndex("CreatedByID"); + + b.HasIndex("TenantId"); + + b.ToTable("Buckets"); + }); + + modelBuilder.Entity("Marco.Pms.Model.Directory.Contact", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("Address") + .HasColumnType("longtext"); + + b.Property("ContactCategoryId") + .HasColumnType("char(36)"); + + b.Property("CreatedAt") + .HasColumnType("datetime(6)"); + + b.Property("CreatedById") + .HasColumnType("char(36)"); + + b.Property("Description") + .IsRequired() + .HasColumnType("longtext"); + + b.Property("IsActive") + .HasColumnType("tinyint(1)"); + + b.Property("Name") + .IsRequired() + .HasColumnType("longtext"); + + b.Property("Organization") + .IsRequired() + .HasColumnType("longtext"); + + b.Property("TenantId") + .HasColumnType("char(36)"); + + b.Property("UpdatedAt") + .HasColumnType("datetime(6)"); + + b.Property("UpdatedById") + .HasColumnType("char(36)"); + + b.HasKey("Id"); + + b.HasIndex("ContactCategoryId"); + + b.HasIndex("CreatedById"); + + b.HasIndex("TenantId"); + + b.HasIndex("UpdatedById"); + + b.ToTable("Contacts"); + }); + + modelBuilder.Entity("Marco.Pms.Model.Directory.ContactBucketMapping", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("BucketId") + .HasColumnType("char(36)"); + + b.Property("ContactId") + .HasColumnType("char(36)"); + + b.HasKey("Id"); + + b.HasIndex("BucketId"); + + b.HasIndex("ContactId"); + + b.ToTable("ContactBucketMappings"); + }); + + modelBuilder.Entity("Marco.Pms.Model.Directory.ContactCategoryMaster", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("Description") + .IsRequired() + .HasColumnType("longtext"); + + b.Property("Name") + .IsRequired() + .HasColumnType("longtext"); + + b.Property("TenantId") + .HasColumnType("char(36)"); + + b.HasKey("Id"); + + b.HasIndex("TenantId"); + + b.ToTable("ContactCategoryMasters"); + }); + + modelBuilder.Entity("Marco.Pms.Model.Directory.ContactEmail", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("ContactId") + .HasColumnType("char(36)"); + + b.Property("EmailAddress") + .IsRequired() + .HasColumnType("longtext"); + + b.Property("IsPrimary") + .HasColumnType("tinyint(1)"); + + b.Property("Label") + .IsRequired() + .HasColumnType("longtext"); + + b.Property("TenantId") + .HasColumnType("char(36)"); + + b.HasKey("Id"); + + b.HasIndex("ContactId"); + + b.ToTable("ContactsEmails"); + }); + + modelBuilder.Entity("Marco.Pms.Model.Directory.ContactNote", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("ContactId") + .HasColumnType("char(36)"); + + b.Property("CreatedAt") + .HasColumnType("datetime(6)"); + + b.Property("CreatedById") + .HasColumnType("char(36)"); + + b.Property("IsActive") + .HasColumnType("tinyint(1)"); + + b.Property("Note") + .IsRequired() + .HasColumnType("longtext"); + + b.Property("TenantId") + .HasColumnType("char(36)"); + + b.Property("UpdatedAt") + .HasColumnType("datetime(6)"); + + b.Property("UpdatedById") + .HasColumnType("char(36)"); + + b.HasKey("Id"); + + b.HasIndex("ContactId"); + + b.HasIndex("CreatedById"); + + b.HasIndex("TenantId"); + + b.HasIndex("UpdatedById"); + + b.ToTable("ContactNotes"); + }); + + modelBuilder.Entity("Marco.Pms.Model.Directory.ContactPhone", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("ContactId") + .HasColumnType("char(36)"); + + b.Property("IsPrimary") + .HasColumnType("tinyint(1)"); + + b.Property("Label") + .IsRequired() + .HasColumnType("longtext"); + + b.Property("PhoneNumber") + .IsRequired() + .HasColumnType("longtext"); + + b.Property("TenantId") + .HasColumnType("char(36)"); + + b.HasKey("Id"); + + b.HasIndex("ContactId"); + + b.ToTable("ContactsPhones"); + }); + + modelBuilder.Entity("Marco.Pms.Model.Directory.ContactProjectMapping", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("ContactId") + .HasColumnType("char(36)"); + + b.Property("ProjectId") + .HasColumnType("char(36)"); + + b.Property("TenantId") + .HasColumnType("char(36)"); + + b.HasKey("Id"); + + b.HasIndex("ContactId"); + + b.HasIndex("ProjectId"); + + b.HasIndex("TenantId"); + + b.ToTable("ContactProjectMappings"); + }); + + modelBuilder.Entity("Marco.Pms.Model.Directory.ContactTagMapping", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("ContactId") + .HasColumnType("char(36)"); + + b.Property("ContactTagId") + .HasColumnType("char(36)"); + + b.HasKey("Id"); + + b.HasIndex("ContactId"); + + b.HasIndex("ContactTagId"); + + b.ToTable("ContactTagMappings"); + }); + + modelBuilder.Entity("Marco.Pms.Model.Directory.ContactTagMaster", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("Description") + .IsRequired() + .HasColumnType("longtext"); + + b.Property("Name") + .IsRequired() + .HasColumnType("longtext"); + + b.Property("TenantId") + .HasColumnType("char(36)"); + + b.HasKey("Id"); + + b.HasIndex("TenantId"); + + b.ToTable("ContactTagMasters"); + }); + + modelBuilder.Entity("Marco.Pms.Model.Directory.DirectoryUpdateLog", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("RefereanceId") + .HasColumnType("char(36)"); + + b.Property("UpdateAt") + .HasColumnType("datetime(6)"); + + b.Property("UpdatedById") + .HasColumnType("char(36)"); + + b.HasKey("Id"); + + b.HasIndex("UpdatedById"); + + b.ToTable("DirectoryUpdateLogs"); + }); + + modelBuilder.Entity("Marco.Pms.Model.Directory.EmployeeBucketMapping", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("BucketId") + .HasColumnType("char(36)"); + + b.Property("EmployeeId") + .HasColumnType("char(36)"); + + b.HasKey("Id"); + + b.HasIndex("BucketId"); + + b.HasIndex("EmployeeId"); + + b.ToTable("EmployeeBucketMappings"); + }); + + 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("char(36)"); + + b.Property("ThumbS3Key") + .HasColumnType("longtext"); + + b.Property("UploadedAt") + .HasColumnType("datetime(6)"); + + b.Property("UploadedById") + .HasColumnType("char(36)"); + + b.HasKey("Id"); + + b.HasIndex("TenantId"); + + b.HasIndex("UploadedById"); + + b.ToTable("Documents"); + }); + + modelBuilder.Entity("Marco.Pms.Model.Employees.Employee", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + 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("IsSystem") + .HasColumnType("tinyint(1)"); + + b.Property("JobRoleId") + .HasColumnType("char(36)"); + + 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("char(36)"); + + b.HasKey("Id"); + + b.HasIndex("ApplicationUserId"); + + b.HasIndex("JobRoleId"); + + b.HasIndex("TenantId"); + + b.ToTable("Employees"); + }); + + modelBuilder.Entity("Marco.Pms.Model.Employees.EmployeeRoleMapping", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("EmployeeId") + .HasColumnType("char(36)"); + + b.Property("IsEnabled") + .HasColumnType("tinyint(1)"); + + b.Property("RoleId") + .HasColumnType("char(36)"); + + b.Property("TenantId") + .HasColumnType("char(36)"); + + b.HasKey("Id"); + + b.HasIndex("EmployeeId"); + + b.HasIndex("RoleId"); + + b.HasIndex("TenantId"); + + b.ToTable("EmployeeRoleMappings"); + }); + + modelBuilder.Entity("Marco.Pms.Model.Employees.WorkShift", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("EndTime") + .HasColumnType("time(6)"); + + b.Property("Name") + .HasColumnType("longtext"); + + b.Property("StartTime") + .HasColumnType("time(6)"); + + b.Property("TenantId") + .HasColumnType("char(36)"); + + b.HasKey("Id"); + + b.HasIndex("TenantId"); + + b.ToTable("WorkShifts"); + }); + + modelBuilder.Entity("Marco.Pms.Model.Entitlements.ActivityCheckList", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("ActivityId") + .HasColumnType("char(36)"); + + b.Property("Description") + .HasColumnType("longtext"); + + b.Property("IsChecked") + .HasColumnType("tinyint(1)"); + + b.Property("IsMandatory") + .HasColumnType("tinyint(1)"); + + b.Property("TenantId") + .HasColumnType("char(36)"); + + b.HasKey("Id"); + + b.ToTable("ActivityCheckLists"); + }); + + modelBuilder.Entity("Marco.Pms.Model.Entitlements.CheckListMappings", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("CheckListId") + .HasColumnType("char(36)"); + + b.Property("TaskAllocationId") + .HasColumnType("char(36)"); + + b.HasKey("Id"); + + b.ToTable("CheckListMappings"); + }); + + 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 = "Access all information related to the project.", + FeatureId = new Guid("53176ebf-c75d-42e5-839f-4508ffac3def"), + IsEnabled = true, + Name = "View Project" + }, + new + { + Id = new Guid("172fc9b6-755b-4f62-ab26-55c34a330614"), + Description = "Potentially edit the project name, description, start/end dates, or status.", + FeatureId = new Guid("53176ebf-c75d-42e5-839f-4508ffac3def"), + IsEnabled = true, + Name = "Manage Project" + }, + new + { + Id = new Guid("b94802ce-0689-4643-9e1d-11c86950c35b"), + Description = "The \"Manage Team\" feature allows authorized users to organize project personnel by adding, removing, and assigning employee to projects.", + FeatureId = new Guid("53176ebf-c75d-42e5-839f-4508ffac3def"), + IsEnabled = true, + Name = "Manage Team" + }, + new + { + Id = new Guid("8d7cc6e3-9147-41f7-aaa7-fa507e450bd4"), + Description = "Grants a user comprehensive read-only access to all details concerning the project's underlying systems, technologies, resources, and configurations", + FeatureId = new Guid("53176ebf-c75d-42e5-839f-4508ffac3def"), + IsEnabled = true, + Name = "View Project Infra" + }, + new + { + Id = new Guid("cf2825ad-453b-46aa-91d9-27c124d63373"), + Description = "This allows them to create, modify, and manage all aspects of the supporting infrastructure.", + FeatureId = new Guid("53176ebf-c75d-42e5-839f-4508ffac3def"), + IsEnabled = true, + Name = "Manage Project Infra" + }, + new + { + Id = new Guid("9fcc5f87-25e3-4846-90ac-67a71ab92e3c"), + Description = "Grants a user comprehensive read-only access to all details associated with tasks within a project. This includes task descriptions, statuses, assignees, due dates, dependencies, progress, history, and any related attachments or discussions.", + FeatureId = new Guid("9d4b5489-2079-40b9-bd77-6e1bf90bc19f"), + IsEnabled = true, + Name = "View Task" + }, + new + { + Id = new Guid("08752f33-3b29-4816-b76b-ea8a968ed3c5"), + Description = "This allows them to create new tasks, modify existing task attributes (description, status, assignee, due date, etc.),", + FeatureId = new Guid("9d4b5489-2079-40b9-bd77-6e1bf90bc19f"), + IsEnabled = true, + Name = "Add/Edit Task" + }, + new + { + Id = new Guid("6a32379b-8b3f-49a6-8c48-4b7ac1b55dc2"), + Description = "Grants a user the ability to designate team members responsible for specific tasks and to update the completion status or provide progress updates for those tasks", + FeatureId = new Guid("9d4b5489-2079-40b9-bd77-6e1bf90bc19f"), + IsEnabled = true, + Name = "Assign/Report Progress" + }, + new + { + Id = new Guid("db4e40c5-2ba9-4b6d-b8a6-a16a250ff99c"), + Description = "Grants a user the authority to officially confirm the completion or acceptance of a task, often signifying that it meets the required standards or criteria", + FeatureId = new Guid("9d4b5489-2079-40b9-bd77-6e1bf90bc19f"), + IsEnabled = true, + Name = "Approve Task" + }, + new + { + Id = new Guid("60611762-7f8a-4fb5-b53f-b1139918796b"), + Description = "Grants a user read-only access to details about the all individuals within the system. This typically includes names, contact information, roles, departments, and potentially other relevant employee data", + FeatureId = new Guid("81ab8a87-8ccd-4015-a917-0627cee6a100"), + IsEnabled = true, + Name = "View All Employees" + }, + new + { + Id = new Guid("b82d2b7e-0d52-45f3-997b-c008ea460e7f"), + Description = "Grants a user read-only access to details about the individuals within the system which are is assigned to same projects as user. This typically includes names, contact information, roles, departments, and potentially other relevant employee data", + FeatureId = new Guid("81ab8a87-8ccd-4015-a917-0627cee6a100"), + IsEnabled = true, + Name = "View Team Members" + }, + new + { + Id = new Guid("a97d366a-c2bb-448d-be93-402bd2324566"), + Description = "Grants a user the authority to create new employee profiles and modify existing employee details within the system. This typically includes adding or updating information such as names, contact details, roles, departments, skills, and potentially other personal or professional data", + FeatureId = new Guid("81ab8a87-8ccd-4015-a917-0627cee6a100"), + IsEnabled = true, + Name = "Add/Edit Employee" + }, + new + { + Id = new Guid("fbd213e0-0250-46f1-9f5f-4b2a1e6e76a3"), + Description = "Grants a user the authority to manage employee application roles, enabling them to assign or revoke access privileges within the system.", + FeatureId = new Guid("81ab8a87-8ccd-4015-a917-0627cee6a100"), + IsEnabled = true, + Name = "Assign Roles" + }, + new + { + Id = new Guid("915e6bff-65f6-4e3f-aea8-3fd217d3ea9e"), + Description = "Team Attendance refers to tracking and managing the attendance of all team members collectively, often monitored by a team lead or manager.", + FeatureId = new Guid("52c9cf54-1eb2-44d2-81bb-524cf29c0a94"), + IsEnabled = true, + Name = "Team Attendance " + }, + new + { + Id = new Guid("57802c4a-00aa-4a1f-a048-fd2f70dd44b6"), + Description = "Grants a user the authority to approve requests from employees to adjust or correct their recorded attendance. This typically involves reviewing the reason for the regularization, verifying any supporting documentation, and then officially accepting the changes to the employee's attendance records", + FeatureId = new Guid("52c9cf54-1eb2-44d2-81bb-524cf29c0a94"), + IsEnabled = true, + Name = "Regularize Attendance" + }, + new + { + Id = new Guid("ccb0589f-712b-43de-92ed-5b6088e7dc4e"), + Description = "Team Attendance refers to tracking and managing the attendance of all team members collectively, often monitored by a team lead or manager.", + FeatureId = new Guid("52c9cf54-1eb2-44d2-81bb-524cf29c0a94"), + IsEnabled = true, + Name = "Self Attendance" + }, + new + { + Id = new Guid("5ffbafe0-7ab0-48b1-bb50-c1bf76b65f9d"), + Description = "Grants a user read-only access to foundational or reference data within the system. \"Masters\" typically refer to predefined lists, categories, or templates that are used throughout the application to standardize information and maintain consistency", + FeatureId = new Guid("be3b3afc-6ccf-4566-b9b6-aafcb65546be"), + IsEnabled = true, + Name = "View Masters" + }, + new + { + Id = new Guid("588a8824-f924-4955-82d8-fc51956cf323"), + Description = "Grants a user the authority to create, modify, and delete foundational or reference data within the system. These \"masters\" are typically the core lists, categories, and configurations that other data and functionalities rely upon, such as departments, job titles, product categories", + FeatureId = new Guid("be3b3afc-6ccf-4566-b9b6-aafcb65546be"), + IsEnabled = true, + Name = "Manage Masters" + }, + new + { + Id = new Guid("4286a13b-bb40-4879-8c6d-18e9e393beda"), + Description = "Full control over all directories, including the ability to manage permissions for all directories in the system.", + FeatureId = new Guid("39e66f81-efc6-446c-95bd-46bff6cfb606"), + IsEnabled = true, + Name = "Directory Admin" + }, + new + { + Id = new Guid("62668630-13ce-4f52-a0f0-db38af2230c5"), + Description = "Full control over directories they created or have been assigned. Can also manage permissions for those directories.", + FeatureId = new Guid("39e66f81-efc6-446c-95bd-46bff6cfb606"), + IsEnabled = true, + Name = "Directory Manager" + }, + new + { + Id = new Guid("0f919170-92d4-4337-abd3-49b66fc871bb"), + Description = "Full control over directories they created. Can view contacts in directories they either created or were assigned to. Can manage permissions only for directories they created.", + FeatureId = new Guid("39e66f81-efc6-446c-95bd-46bff6cfb606"), + IsEnabled = true, + Name = "Directory User" + }, + new + { + Id = new Guid("385be49f-8fde-440e-bdbc-3dffeb8dd116"), + Description = "Allows a user to view only the expense records that they have personally submitted", + FeatureId = new Guid("a4e25142-449b-4334-a6e5-22f70e4732d7"), + IsEnabled = true, + Name = "View Self" + }, + new + { + Id = new Guid("01e06444-9ca7-4df4-b900-8c3fa051b92f"), + Description = "Allows a user to view all expense records across the organization or project, regardless of who submitted or paid them", + FeatureId = new Guid("a4e25142-449b-4334-a6e5-22f70e4732d7"), + IsEnabled = true, + Name = "View All" + }, + new + { + Id = new Guid("0f57885d-bcb2-4711-ac95-d841ace6d5a7"), + Description = "Allows a user to create and submit new expense records, including attaching relevant documents like receipts or invoices.", + FeatureId = new Guid("a4e25142-449b-4334-a6e5-22f70e4732d7"), + IsEnabled = true, + Name = "Upload" + }, + new + { + Id = new Guid("1f4bda08-1873-449a-bb66-3e8222bd871b"), + Description = "Allows a user to examine submitted expenses for accuracy, completeness, and policy compliance before they are approved or rejected.", + FeatureId = new Guid("a4e25142-449b-4334-a6e5-22f70e4732d7"), + IsEnabled = true, + Name = "Review" + }, + new + { + Id = new Guid("eaafdd76-8aac-45f9-a530-315589c6deca"), + Description = "Allows a user to authorize or reject submitted expenses, making them officially accepted or declined within the system.", + FeatureId = new Guid("a4e25142-449b-4334-a6e5-22f70e4732d7"), + IsEnabled = true, + Name = "Approve" + }, + new + { + Id = new Guid("ea5a1529-4ee8-4828-80ea-0e23c9d4dd11"), + Description = "Allows a user to handle post-approval actions such as recording payments, updating financial records, or marking expenses as reimbursed or settled.", + FeatureId = new Guid("a4e25142-449b-4334-a6e5-22f70e4732d7"), + IsEnabled = true, + Name = "Process" + }, + new + { + Id = new Guid("bdee29a2-b73b-402d-8dd1-c4b1f81ccbc3"), + Description = "Allows a user to configure and control system settings, such as managing expense types, payment modes, permissions, and overall workflow rules.", + FeatureId = new Guid("a4e25142-449b-4334-a6e5-22f70e4732d7"), + IsEnabled = true, + Name = "Manage" + }); + }); + + 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.Tenant", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("ContactName") + .HasColumnType("longtext"); + + b.Property("ContactNumber") + .HasColumnType("longtext"); + + b.Property("Description") + .HasColumnType("longtext"); + + b.Property("DomainName") + .HasColumnType("longtext"); + + b.Property("IndustryId") + .HasColumnType("char(36)"); + + 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 = new Guid("b3466e83-7e11-464c-b93a-daf047838b26"), + ContactName = "Admin", + ContactNumber = "123456789", + Description = "", + DomainName = "www.marcobms.org", + IndustryId = new Guid("15436ee3-a650-469e-bfc2-59993f7514bb"), + IsActive = true, + Name = "MarcoBMS", + OnBoardingDate = new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), + OragnizationSize = "100-200" + }); + }); + + modelBuilder.Entity("Marco.Pms.Model.Expenses.BillAttachments", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("DocumentId") + .HasColumnType("char(36)"); + + b.Property("ExpensesId") + .HasColumnType("char(36)"); + + b.Property("TenantId") + .HasColumnType("char(36)"); + + b.HasKey("Id"); + + b.HasIndex("DocumentId"); + + b.HasIndex("ExpensesId"); + + b.HasIndex("TenantId"); + + b.ToTable("BillAttachments"); + }); + + modelBuilder.Entity("Marco.Pms.Model.Expenses.Expenses", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("Amount") + .HasColumnType("double"); + + b.Property("Description") + .IsRequired() + .HasColumnType("longtext"); + + b.Property("ExpensesTypeId") + .HasColumnType("char(36)"); + + b.Property("GSTNumber") + .HasColumnType("longtext"); + + b.Property("IsActive") + .HasColumnType("tinyint(1)"); + + b.Property("Location") + .HasColumnType("longtext"); + + b.Property("NoOfPersons") + .HasColumnType("int"); + + b.Property("PaidById") + .HasColumnType("char(36)"); + + b.Property("PaymentModeId") + .HasColumnType("char(36)"); + + b.Property("PreApproved") + .HasColumnType("tinyint(1)"); + + b.Property("ProjectId") + .HasColumnType("char(36)"); + + b.Property("StatusId") + .HasColumnType("char(36)"); + + b.Property("SupplerName") + .IsRequired() + .HasColumnType("longtext"); + + b.Property("TenantId") + .HasColumnType("char(36)"); + + b.Property("TransactionDate") + .HasColumnType("datetime(6)"); + + b.Property("TransactionId") + .HasColumnType("longtext"); + + b.HasKey("Id"); + + b.HasIndex("ExpensesTypeId"); + + b.HasIndex("PaidById"); + + b.HasIndex("PaymentModeId"); + + b.HasIndex("ProjectId"); + + b.HasIndex("StatusId"); + + b.HasIndex("TenantId"); + + b.ToTable("Expenses"); + }); + + modelBuilder.Entity("Marco.Pms.Model.Expenses.ExpensesReimburse", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("ReimburseById") + .HasColumnType("char(36)"); + + b.Property("ReimburseDate") + .HasColumnType("datetime(6)"); + + b.Property("ReimburseNote") + .IsRequired() + .HasColumnType("longtext"); + + b.Property("ReimburseTransactionId") + .IsRequired() + .HasColumnType("longtext"); + + b.Property("TenantId") + .HasColumnType("char(36)"); + + b.HasKey("Id"); + + b.HasIndex("ReimburseById"); + + b.HasIndex("TenantId"); + + b.ToTable("ExpensesReimburse"); + }); + + modelBuilder.Entity("Marco.Pms.Model.Expenses.ExpensesReimburseMapping", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("ExpensesId") + .HasColumnType("char(36)"); + + b.Property("ExpensesReimburseId") + .HasColumnType("char(36)"); + + b.HasKey("Id"); + + b.HasIndex("ExpensesId"); + + b.HasIndex("ExpensesReimburseId"); + + b.ToTable("ExpensesReimburseMapping"); + }); + + modelBuilder.Entity("Marco.Pms.Model.Expenses.StatusMapping", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("ExpeStatusIdnsesId") + .HasColumnType("char(36)"); + + b.Property("NextStatusId") + .HasColumnType("char(36)"); + + b.Property("StatusId") + .HasColumnType("char(36)"); + + b.Property("TenantId") + .HasColumnType("char(36)"); + + b.HasKey("Id"); + + b.HasIndex("ExpeStatusIdnsesId"); + + b.HasIndex("NextStatusId"); + + b.HasIndex("TenantId"); + + b.ToTable("StatusMapping"); + + b.HasData( + new + { + Id = new Guid("5cf7f1df-9d1f-4289-add0-1775ad614f25"), + NextStatusId = new Guid("f18c5cfd-7815-4341-8da2-2c2d65778e27"), + StatusId = new Guid("f18c5cfd-7815-4341-8da2-2c2d65778e27"), + TenantId = new Guid("b3466e83-7e11-464c-b93a-daf047838b26") + }, + new + { + Id = new Guid("36c00548-241c-43ec-bc95-cacebedb925c"), + NextStatusId = new Guid("d1ee5eec-24b6-4364-8673-a8f859c60729"), + StatusId = new Guid("4068007f-c92f-4f37-a907-bc15fe57d4d8"), + TenantId = new Guid("b3466e83-7e11-464c-b93a-daf047838b26") + }, + new + { + Id = new Guid("1fca1700-1266-477d-bba4-9ac3753aa33c"), + NextStatusId = new Guid("f18c5cfd-7815-4341-8da2-2c2d65778e27"), + StatusId = new Guid("4068007f-c92f-4f37-a907-bc15fe57d4d8"), + TenantId = new Guid("b3466e83-7e11-464c-b93a-daf047838b26") + }, + new + { + Id = new Guid("fddaaf20-4ccc-4f4e-a724-dd310272b356"), + NextStatusId = new Guid("d1ee5eec-24b6-4364-8673-a8f859c60729"), + StatusId = new Guid("6537018f-f4e9-4cb3-a210-6c3b2da999d7"), + TenantId = new Guid("b3466e83-7e11-464c-b93a-daf047838b26") + }, + new + { + Id = new Guid("ef1fcfbc-60e0-4f17-9308-c583a05d48fd"), + NextStatusId = new Guid("4068007f-c92f-4f37-a907-bc15fe57d4d8"), + StatusId = new Guid("6537018f-f4e9-4cb3-a210-6c3b2da999d7"), + TenantId = new Guid("b3466e83-7e11-464c-b93a-daf047838b26") + }, + new + { + Id = new Guid("af1e4492-98ee-4451-8ab7-fd8323f29c32"), + NextStatusId = new Guid("6537018f-f4e9-4cb3-a210-6c3b2da999d7"), + StatusId = new Guid("297e0d8f-f668-41b5-bfea-e03b354251c8"), + TenantId = new Guid("b3466e83-7e11-464c-b93a-daf047838b26") + }); + }); + + modelBuilder.Entity("Marco.Pms.Model.Expenses.StatusPermissionMapping", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("PermissionId") + .HasColumnType("char(36)"); + + b.Property("StatusId") + .HasColumnType("char(36)"); + + b.HasKey("Id"); + + b.HasIndex("PermissionId"); + + b.HasIndex("StatusId"); + + b.ToTable("StatusPermissionMapping"); + }); + + 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("char(36)"); + + 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("char(36)"); + + b.Property("Description") + .IsRequired() + .HasColumnType("longtext"); + + b.Property("LinkedActivityId") + .HasColumnType("char(36)"); + + b.Property("LinkedProjectId") + .HasColumnType("char(36)"); + + b.Property("PriorityId") + .HasColumnType("char(36)"); + + b.Property("StatusId") + .HasColumnType("char(36)"); + + b.Property("Subject") + .IsRequired() + .HasColumnType("longtext"); + + b.Property("TenantId") + .HasColumnType("char(36)"); + + 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.TicketTag", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + 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.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("char(36)"); + + 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 = new Guid("b3466e83-7e11-464c-b93a-daf047838b26") + }, + 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 = new Guid("b3466e83-7e11-464c-b93a-daf047838b26") + }); + }); + + modelBuilder.Entity("Marco.Pms.Model.Mail.MailDetails", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("MailListId") + .HasColumnType("char(36)"); + + b.Property("ProjectId") + .HasColumnType("char(36)"); + + b.Property("Recipient") + .IsRequired() + .HasColumnType("longtext"); + + b.Property("Schedule") + .IsRequired() + .HasColumnType("longtext"); + + b.Property("TenantId") + .HasColumnType("char(36)"); + + b.HasKey("Id"); + + b.HasIndex("MailListId"); + + b.ToTable("MailDetails"); + }); + + modelBuilder.Entity("Marco.Pms.Model.Mail.MailLog", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("Body") + .IsRequired() + .HasColumnType("longtext"); + + b.Property("EmailId") + .IsRequired() + .HasColumnType("longtext"); + + b.Property("EmployeeId") + .HasColumnType("char(36)"); + + b.Property("ProjectId") + .HasColumnType("char(36)"); + + b.Property("TenantId") + .HasColumnType("char(36)"); + + b.Property("TimeStamp") + .HasColumnType("datetime(6)"); + + b.HasKey("Id"); + + b.ToTable("MailLogs"); + }); + + modelBuilder.Entity("Marco.Pms.Model.Mail.MailingList", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("Body") + .IsRequired() + .HasColumnType("longtext"); + + b.Property("Keywords") + .IsRequired() + .HasColumnType("longtext"); + + b.Property("Subject") + .IsRequired() + .HasColumnType("longtext"); + + b.Property("TenantId") + .HasColumnType("char(36)"); + + b.Property("Title") + .IsRequired() + .HasColumnType("longtext"); + + b.HasKey("Id"); + + b.ToTable("MailingList"); + }); + + modelBuilder.Entity("Marco.Pms.Model.Master.ActivityMaster", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("ActivityName") + .HasColumnType("longtext"); + + b.Property("IsActive") + .HasColumnType("tinyint(1)"); + + b.Property("TenantId") + .HasColumnType("char(36)"); + + b.Property("UnitOfMeasurement") + .HasColumnType("longtext"); + + b.HasKey("Id"); + + b.HasIndex("TenantId"); + + b.ToTable("ActivityMasters"); + }); + + modelBuilder.Entity("Marco.Pms.Model.Master.ExpensesStatusMaster", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("Description") + .IsRequired() + .HasColumnType("longtext"); + + b.Property("IsActive") + .HasColumnType("tinyint(1)"); + + b.Property("IsSystem") + .HasColumnType("tinyint(1)"); + + b.Property("Name") + .IsRequired() + .HasColumnType("longtext"); + + b.Property("TenantId") + .HasColumnType("char(36)"); + + b.HasKey("Id"); + + b.HasIndex("TenantId"); + + b.ToTable("ExpensesStatusMaster"); + + b.HasData( + new + { + Id = new Guid("297e0d8f-f668-41b5-bfea-e03b354251c8"), + Description = "Expense has been created but not yet submitted.", + IsActive = true, + IsSystem = true, + Name = "Draft", + TenantId = new Guid("b3466e83-7e11-464c-b93a-daf047838b26") + }, + new + { + Id = new Guid("6537018f-f4e9-4cb3-a210-6c3b2da999d7"), + Description = "Reviewer is currently reviewing the expense.", + IsActive = true, + IsSystem = true, + Name = "Review Pending", + TenantId = new Guid("b3466e83-7e11-464c-b93a-daf047838b26") + }, + new + { + Id = new Guid("4068007f-c92f-4f37-a907-bc15fe57d4d8"), + Description = "Review is completed, waiting for action of approver.", + IsActive = true, + IsSystem = true, + Name = "Approval Pending", + TenantId = new Guid("b3466e83-7e11-464c-b93a-daf047838b26") + }, + new + { + Id = new Guid("d1ee5eec-24b6-4364-8673-a8f859c60729"), + Description = "Expense was declined, often with a reason(either review rejected or approval rejected.", + IsActive = true, + IsSystem = true, + Name = "Rejected", + TenantId = new Guid("b3466e83-7e11-464c-b93a-daf047838b26") + }, + new + { + Id = new Guid("f18c5cfd-7815-4341-8da2-2c2d65778e27"), + Description = "Approved expense is awaiting final payment.", + IsActive = true, + IsSystem = true, + Name = "Process Pending", + TenantId = new Guid("b3466e83-7e11-464c-b93a-daf047838b26") + }, + new + { + Id = new Guid("61578360-3a49-4c34-8604-7b35a3787b95"), + Description = "Expense has been settled.", + IsActive = true, + IsSystem = true, + Name = "Processed", + TenantId = new Guid("b3466e83-7e11-464c-b93a-daf047838b26") + }); + }); + + modelBuilder.Entity("Marco.Pms.Model.Master.ExpensesTypeMaster", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("Description") + .IsRequired() + .HasColumnType("longtext"); + + b.Property("IsActive") + .HasColumnType("tinyint(1)"); + + b.Property("Name") + .IsRequired() + .HasColumnType("longtext"); + + b.Property("NoOfPersonsRequired") + .HasColumnType("tinyint(1)"); + + b.Property("TenantId") + .HasColumnType("char(36)"); + + b.HasKey("Id"); + + b.HasIndex("TenantId"); + + b.ToTable("ExpensesTypeMaster"); + + b.HasData( + new + { + Id = new Guid("5e0c6227-d49d-41ff-9f1f-781f0aee2469"), + Description = "Materials, equipment and supplies purchased for site operations.", + IsActive = true, + Name = "Procurement", + NoOfPersonsRequired = false, + TenantId = new Guid("b3466e83-7e11-464c-b93a-daf047838b26") + }, + new + { + Id = new Guid("2de53163-0dbd-404b-8e60-1b02e6b4886a"), + Description = "Vehicle fuel, logistics services and delivery of goods or personnel.", + IsActive = true, + Name = "Transport", + NoOfPersonsRequired = false, + TenantId = new Guid("b3466e83-7e11-464c-b93a-daf047838b26") + }, + new + { + Id = new Guid("dd120bc4-ab0a-45ba-8450-5cd45ff221ca"), + Description = "Delivery of personnel.", + IsActive = true, + Name = "Travelling", + NoOfPersonsRequired = true, + TenantId = new Guid("b3466e83-7e11-464c-b93a-daf047838b26") + }, + new + { + Id = new Guid("52484820-1b54-4865-8f0f-baa2b1d339b9"), + Description = "Site setup costs including equipment deployment and temporary infrastructure.", + IsActive = true, + Name = "Mobilization", + NoOfPersonsRequired = false, + TenantId = new Guid("b3466e83-7e11-464c-b93a-daf047838b26") + }, + new + { + Id = new Guid("fc59eb90-98ea-481c-b421-54bfa9e42d8f"), + Description = " Worker amenities like snacks, meals, safety gear, accommodation, medical support etc.", + IsActive = true, + Name = "Employee Welfare", + NoOfPersonsRequired = true, + TenantId = new Guid("b3466e83-7e11-464c-b93a-daf047838b26") + }, + new + { + Id = new Guid("77013784-9324-4d8b-bd36-d6f928e68942"), + Description = "Machinery servicing, electricity, water, and temporary office needs.", + IsActive = true, + Name = "Maintenance & Utilities", + NoOfPersonsRequired = false, + TenantId = new Guid("b3466e83-7e11-464c-b93a-daf047838b26") + }, + new + { + Id = new Guid("1e2d697a-76b4-4be8-bc66-87144561a1a0"), + Description = "Scheduled payments for external services or goods.", + IsActive = true, + Name = "Vendor/Supplier Payments", + NoOfPersonsRequired = false, + TenantId = new Guid("b3466e83-7e11-464c-b93a-daf047838b26") + }, + new + { + Id = new Guid("4842fa61-64eb-4241-aebd-8282065af9f9"), + Description = "Government fees, insurance, inspections and safety-related expenditures.", + IsActive = true, + Name = "Compliance & Safety", + NoOfPersonsRequired = false, + TenantId = new Guid("b3466e83-7e11-464c-b93a-daf047838b26") + }); + }); + + modelBuilder.Entity("Marco.Pms.Model.Master.Feature", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("Description") + .HasColumnType("longtext"); + + b.Property("IsActive") + .HasColumnType("tinyint(1)"); + + b.Property("ModuleId") + .HasColumnType("char(36)"); + + 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 = new Guid("bf59fd88-b57a-4d67-bf01-3780f385896b"), + Name = "Project Management" + }, + new + { + Id = new Guid("a4e25142-449b-4334-a6e5-22f70e4732d7"), + Description = "Expense Management is the systematic process of tracking, controlling, and reporting business-related expenditures.", + IsActive = true, + ModuleId = new Guid("bf59fd88-b57a-4d67-bf01-3780f385896b"), + Name = "Expense Management" + }, + new + { + Id = new Guid("9d4b5489-2079-40b9-bd77-6e1bf90bc19f"), + Description = "Manage Tasks", + IsActive = true, + ModuleId = new Guid("bf59fd88-b57a-4d67-bf01-3780f385896b"), + Name = "Task Management" + }, + new + { + Id = new Guid("81ab8a87-8ccd-4015-a917-0627cee6a100"), + Description = "Manage Employee", + IsActive = true, + ModuleId = new Guid("2a231490-bcb1-4bdd-91f1-f25fb7f25b23"), + Name = "Employee Management" + }, + new + { + Id = new Guid("52c9cf54-1eb2-44d2-81bb-524cf29c0a94"), + Description = "Attendance", + IsActive = true, + ModuleId = new Guid("2a231490-bcb1-4bdd-91f1-f25fb7f25b23"), + Name = "Attendance Management" + }, + new + { + Id = new Guid("be3b3afc-6ccf-4566-b9b6-aafcb65546be"), + Description = "Global Masters", + IsActive = true, + ModuleId = new Guid("c43db8c7-ab73-47f4-9d3b-f83e81357924"), + Name = "Masters" + }, + new + { + Id = new Guid("39e66f81-efc6-446c-95bd-46bff6cfb606"), + Description = "Managing all directory related rights", + IsActive = true, + ModuleId = new Guid("c43db8c7-ab73-47f4-9d3b-f83e81357924"), + Name = "Directory Management" + }); + }); + + modelBuilder.Entity("Marco.Pms.Model.Master.Industry", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("Name") + .HasColumnType("longtext"); + + b.HasKey("Id"); + + b.ToTable("Industries"); + + b.HasData( + new + { + Id = new Guid("15436ee3-a650-469e-bfc2-59993f7514bb"), + Name = "Information Technology (IT) Services" + }, + new + { + Id = new Guid("0a63e657-2c5f-49b5-854b-42c978293154"), + Name = "Manufacturing & Production" + }, + new + { + Id = new Guid("bdc61e3b-69ea-4394-bab6-079ec135b5bd"), + Name = "Energy & Resources" + }, + new + { + Id = new Guid("5ca200ac-00d7-415e-a410-b948e27ac9d2"), + Name = "Finance & Professional Services" + }, + new + { + Id = new Guid("d5621700-cd87-441f-8cdb-6051ddfc83b4"), + Name = "Hospitals and Healthcare Services" + }, + new + { + Id = new Guid("23608891-657e-40f0-bbd4-2b0a2ec1a76f"), + Name = "Social Services" + }, + new + { + Id = new Guid("a493f4e3-16b1-4411-be3c-6bf2987a3168"), + Name = "Retail & Consumer Services" + }, + new + { + Id = new Guid("e9d8ce92-9371-4ed9-9831-83c07f78edec"), + Name = "Transportation & Logistics" + }, + new + { + Id = new Guid("8a0d6134-2dbe-4e0a-b250-ff34cb7b9df0"), + Name = "Education & Training" + }); + }); + + modelBuilder.Entity("Marco.Pms.Model.Master.Module", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + 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 = new Guid("bf59fd88-b57a-4d67-bf01-3780f385896b"), + Description = "Project Module", + Key = "b04da7e9-0406-409c-ac7f-b97256e6ea02", + Name = "Project" + }, + new + { + Id = new Guid("2a231490-bcb1-4bdd-91f1-f25fb7f25b23"), + Description = "Employee Module", + Key = "0971c7fb-6ce1-458a-ae3f-8d3205893637", + Name = "Employee" + }, + new + { + Id = new Guid("c43db8c7-ab73-47f4-9d3b-f83e81357924"), + Description = "Masters Module", + Key = "504ec132-e6a9-422f-8f85-050602cfce05", + Name = "Masters" + }); + }); + + modelBuilder.Entity("Marco.Pms.Model.Master.PaymentModeMatser", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("Description") + .IsRequired() + .HasColumnType("longtext"); + + b.Property("IsActive") + .HasColumnType("tinyint(1)"); + + b.Property("Name") + .IsRequired() + .HasColumnType("longtext"); + + b.Property("TenantId") + .HasColumnType("char(36)"); + + b.HasKey("Id"); + + b.HasIndex("TenantId"); + + b.ToTable("PaymentModeMatser"); + + b.HasData( + new + { + Id = new Guid("24e6b0df-7929-47d2-88a3-4cf14c1f28f9"), + Description = "Physical currency; still used for small or informal transactions.", + IsActive = true, + Name = "Cash", + TenantId = new Guid("b3466e83-7e11-464c-b93a-daf047838b26") + }, + new + { + Id = new Guid("48d9b462-5d87-4dec-8dec-2bc943943172"), + Description = "Paper-based payment order; less common now due to processing delays and fraud risks.", + IsActive = true, + Name = "Cheque", + TenantId = new Guid("b3466e83-7e11-464c-b93a-daf047838b26") + }, + new + { + Id = new Guid("ed667353-8eea-4fd1-8750-719405932480"), + Description = "Online banking portals used to transfer funds directly between accounts", + IsActive = true, + Name = "NetBanking", + TenantId = new Guid("b3466e83-7e11-464c-b93a-daf047838b26") + }, + new + { + Id = new Guid("2e919e94-694c-41d9-9489-0a2b4208a027"), + Description = "Real-time bank-to-bank transfer using mobile apps; widely used for peer-to-peer and merchant payments.", + IsActive = true, + Name = "UPI", + TenantId = new Guid("b3466e83-7e11-464c-b93a-daf047838b26") + }); + }); + + modelBuilder.Entity("Marco.Pms.Model.Master.StatusMaster", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("Status") + .HasColumnType("longtext"); + + b.Property("TenantId") + .HasColumnType("char(36)"); + + b.HasKey("Id"); + + b.HasIndex("TenantId"); + + b.ToTable("StatusMasters"); + + b.HasData( + new + { + Id = new Guid("b74da4c2-d07e-46f2-9919-e75e49b12731"), + Status = "Active", + TenantId = new Guid("b3466e83-7e11-464c-b93a-daf047838b26") + }, + new + { + Id = new Guid("cdad86aa-8a56-4ff4-b633-9c629057dfef"), + Status = "In Progress", + TenantId = new Guid("b3466e83-7e11-464c-b93a-daf047838b26") + }, + new + { + Id = new Guid("603e994b-a27f-4e5d-a251-f3d69b0498ba"), + Status = "On Hold", + TenantId = new Guid("b3466e83-7e11-464c-b93a-daf047838b26") + }, + new + { + Id = new Guid("ef1c356e-0fe0-42df-a5d3-8daee355492d"), + Status = "In Active", + TenantId = new Guid("b3466e83-7e11-464c-b93a-daf047838b26") + }, + new + { + Id = new Guid("33deaef9-9af1-4f2a-b443-681ea0d04f81"), + Status = "Completed", + TenantId = new Guid("b3466e83-7e11-464c-b93a-daf047838b26") + }); + }); + + modelBuilder.Entity("Marco.Pms.Model.Master.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("char(36)"); + + 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 = new Guid("b3466e83-7e11-464c-b93a-daf047838b26") + }, + new + { + Id = new Guid("0919bc84-9f82-4ecf-98c7-962755dd9a97"), + ColorCode = "FFFF00", + IsDefault = true, + Level = 2, + Name = "Medium", + TenantId = new Guid("b3466e83-7e11-464c-b93a-daf047838b26") + }, + new + { + Id = new Guid("a13b7e59-16fd-4665-b5cf-a97399e8445a"), + ColorCode = "#FFA500", + IsDefault = true, + Level = 3, + Name = "High", + TenantId = new Guid("b3466e83-7e11-464c-b93a-daf047838b26") + }, + new + { + Id = new Guid("f340fbc3-c9fd-46aa-b063-0093418830e4"), + ColorCode = "#FFA500", + IsDefault = true, + Level = 4, + Name = "Critical", + TenantId = new Guid("b3466e83-7e11-464c-b93a-daf047838b26") + }, + new + { + Id = new Guid("44a7b91d-a0dd-45d1-8616-4d2f71e16401"), + ColorCode = "#FF0000", + IsDefault = true, + Level = 5, + Name = "Urgent", + TenantId = new Guid("b3466e83-7e11-464c-b93a-daf047838b26") + }); + }); + + modelBuilder.Entity("Marco.Pms.Model.Master.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("char(36)"); + + 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 = new Guid("b3466e83-7e11-464c-b93a-daf047838b26") + }, + new + { + Id = new Guid("6c5ac37d-5b7d-40f3-adec-2dabaa5cca86"), + ColorCode = "#E6FF99", + Description = "Assigned to employee or team of employees", + IsDefault = true, + Name = "Assigned", + TenantId = new Guid("b3466e83-7e11-464c-b93a-daf047838b26") + }, + new + { + Id = new Guid("7f96bcd5-0c66-411b-8a1d-9d1a4785194e"), + ColorCode = "#99E6FF", + Description = "These issues are currently in progress", + IsDefault = true, + Name = "In Progress", + TenantId = new Guid("b3466e83-7e11-464c-b93a-daf047838b26") + }, + new + { + Id = new Guid("5c72b630-6923-4215-bf2c-b1622afd76e7"), + ColorCode = "#6c757d", + Description = "These issues are currently under review", + IsDefault = true, + Name = "In Review", + TenantId = new Guid("b3466e83-7e11-464c-b93a-daf047838b26") + }, + new + { + Id = new Guid("8ff85685-a875-4f21-aa95-d99551315fcc"), + ColorCode = "#B399FF", + Description = "The following issues are resolved and closed", + IsDefault = true, + Name = "Done", + TenantId = new Guid("b3466e83-7e11-464c-b93a-daf047838b26") + }); + }); + + modelBuilder.Entity("Marco.Pms.Model.Master.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("char(36)"); + + 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 = new Guid("b3466e83-7e11-464c-b93a-daf047838b26") + }, + new + { + Id = new Guid("5a168569-8ad7-4422-8db6-51ef25caddeb"), + ColorCode = "#85c1e9", + IsDefault = true, + Name = "Help Desk", + TenantId = new Guid("b3466e83-7e11-464c-b93a-daf047838b26") + }); + }); + + modelBuilder.Entity("Marco.Pms.Model.Master.WorkCategoryMaster", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("Description") + .IsRequired() + .HasColumnType("longtext"); + + b.Property("IsSystem") + .HasColumnType("tinyint(1)"); + + b.Property("Name") + .IsRequired() + .HasColumnType("longtext"); + + b.Property("TenantId") + .HasColumnType("char(36)"); + + b.HasKey("Id"); + + b.HasIndex("TenantId"); + + b.ToTable("WorkCategoryMasters"); + + b.HasData( + new + { + Id = new Guid("86bb2cc8-f6b5-4fdd-bbee-c389c713a44b"), + Description = "Created new task in a professional or creative context", + IsSystem = true, + Name = "Fresh Work", + TenantId = new Guid("b3466e83-7e11-464c-b93a-daf047838b26") + }, + new + { + Id = new Guid("9ebfa19c-53b9-481b-b863-c25d2f843201"), + Description = "Revising, modifying, or correcting a task to improve its quality or fix issues", + IsSystem = true, + Name = "Rework", + TenantId = new Guid("b3466e83-7e11-464c-b93a-daf047838b26") + }, + new + { + Id = new Guid("11a79929-1d07-42dc-9e98-82d0d2f4a240"), + Description = "Any defect, deviation, or non-conformance in a task that fails to meet established standards or customer expectations.", + IsSystem = true, + Name = "Quality Issue", + TenantId = new Guid("b3466e83-7e11-464c-b93a-daf047838b26") + }); + }); + + modelBuilder.Entity("Marco.Pms.Model.Master.WorkStatusMaster", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("Description") + .IsRequired() + .HasColumnType("longtext"); + + b.Property("IsSystem") + .HasColumnType("tinyint(1)"); + + b.Property("Name") + .IsRequired() + .HasColumnType("longtext"); + + b.Property("TenantId") + .HasColumnType("char(36)"); + + b.HasKey("Id"); + + b.HasIndex("TenantId"); + + b.ToTable("WorkStatusMasters"); + + b.HasData( + new + { + Id = new Guid("030bb085-e230-4370-aec7-9a74d652864e"), + Description = "Confirm the tasks are actually finished as reported", + IsSystem = true, + Name = "Approve", + TenantId = new Guid("b3466e83-7e11-464c-b93a-daf047838b26") + }, + new + { + Id = new Guid("2a1a5b96-cf93-4111-b4b1-76c19d6333b4"), + Description = "Not all tasks are actually finished as reported", + IsSystem = true, + Name = "Partially Approve", + TenantId = new Guid("b3466e83-7e11-464c-b93a-daf047838b26") + }, + new + { + Id = new Guid("00a062e6-62e6-42c5-b6b1-024328651b72"), + Description = "Tasks are not finished as reported or have any issues in al the tasks", + IsSystem = true, + Name = "NCR", + TenantId = new Guid("b3466e83-7e11-464c-b93a-daf047838b26") + }); + }); + + modelBuilder.Entity("Marco.Pms.Model.Projects.Building", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("Description") + .HasColumnType("longtext"); + + b.Property("Name") + .IsRequired() + .HasColumnType("longtext"); + + b.Property("ProjectId") + .HasColumnType("char(36)"); + + b.Property("TenantId") + .HasColumnType("char(36)"); + + b.HasKey("Id"); + + b.HasIndex("TenantId"); + + b.ToTable("Buildings"); + }); + + modelBuilder.Entity("Marco.Pms.Model.Projects.Floor", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("BuildingId") + .HasColumnType("char(36)"); + + b.Property("FloorName") + .IsRequired() + .HasColumnType("longtext"); + + b.Property("TenantId") + .HasColumnType("char(36)"); + + 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("char(36)"); + + 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("char(36)"); + + b.Property("ShortName") + .HasColumnType("longtext"); + + b.Property("StartDate") + .HasColumnType("datetime(6)"); + + b.Property("TenantId") + .HasColumnType("char(36)"); + + b.HasKey("Id"); + + b.HasIndex("ProjectStatusId"); + + b.HasIndex("TenantId"); + + b.ToTable("Projects"); + + b.HasData( + new + { + 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 = 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") + }); + }); + + modelBuilder.Entity("Marco.Pms.Model.Projects.ProjectAllocation", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("AllocationDate") + .HasColumnType("datetime(6)"); + + b.Property("EmployeeId") + .HasColumnType("char(36)"); + + b.Property("IsActive") + .HasColumnType("tinyint(1)"); + + b.Property("JobRoleId") + .HasColumnType("char(36)"); + + b.Property("ProjectId") + .HasColumnType("char(36)"); + + b.Property("ReAllocationDate") + .HasColumnType("datetime(6)"); + + b.Property("TenantId") + .HasColumnType("char(36)"); + + 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("char(36)"); + + b.Property("AreaName") + .IsRequired() + .HasColumnType("longtext"); + + b.Property("FloorId") + .HasColumnType("char(36)"); + + b.Property("TenantId") + .HasColumnType("char(36)"); + + 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("char(36)"); + + b.Property("ActivityId") + .HasColumnType("char(36)"); + + b.Property("CompletedWork") + .HasColumnType("double"); + + b.Property("Description") + .HasColumnType("longtext"); + + b.Property("ParentTaskId") + .HasColumnType("char(36)"); + + b.Property("PlannedWork") + .HasColumnType("double"); + + b.Property("TaskDate") + .HasColumnType("datetime(6)"); + + b.Property("TenantId") + .HasColumnType("char(36)"); + + b.Property("WorkAreaId") + .HasColumnType("char(36)"); + + b.Property("WorkCategoryId") + .HasColumnType("char(36)"); + + b.HasKey("Id"); + + b.HasIndex("ActivityId"); + + b.HasIndex("TenantId"); + + b.HasIndex("WorkAreaId"); + + b.HasIndex("WorkCategoryId"); + + b.ToTable("WorkItems"); + }); + + modelBuilder.Entity("Marco.Pms.Model.Roles.ApplicationRole", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("Description") + .HasColumnType("longtext"); + + b.Property("IsSystem") + .HasColumnType("tinyint(1)"); + + b.Property("Role") + .HasColumnType("longtext"); + + b.Property("TenantId") + .HasColumnType("char(36)"); + + b.HasKey("Id"); + + b.HasIndex("TenantId"); + + b.ToTable("ApplicationRoles"); + }); + + modelBuilder.Entity("Marco.Pms.Model.Roles.JobRole", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("Description") + .HasColumnType("longtext"); + + b.Property("Name") + .HasColumnType("longtext"); + + b.Property("TenantId") + .HasColumnType("char(36)"); + + b.HasKey("Id"); + + b.HasIndex("TenantId"); + + b.ToTable("JobRoles"); + }); + + modelBuilder.Entity("Marco.Pms.Model.Utilities.Inquiries", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("About") + .HasColumnType("longtext"); + + b.Property("ContactNumber") + .HasColumnType("longtext"); + + b.Property("ContactPerson") + .HasColumnType("longtext"); + + b.Property("Email") + .HasColumnType("longtext"); + + b.Property("IndustryId") + .HasColumnType("char(36)"); + + 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("char(36)"); + + b.HasDiscriminator().HasValue("ApplicationUser"); + }); + + modelBuilder.Entity("Marco.Pms.Model.Activities.TaskAllocation", b => + { + b.HasOne("Marco.Pms.Model.Employees.Employee", "ApprovedBy") + .WithMany() + .HasForeignKey("ApprovedById"); + + b.HasOne("Marco.Pms.Model.Employees.Employee", "Employee") + .WithMany() + .HasForeignKey("AssignedBy") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Marco.Pms.Model.Employees.Employee", "ReportedBy") + .WithMany() + .HasForeignKey("ReportedById"); + + 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.Master.WorkStatusMaster", "WorkStatus") + .WithMany() + .HasForeignKey("WorkStatusId"); + + b.Navigation("ApprovedBy"); + + b.Navigation("Employee"); + + b.Navigation("ReportedBy"); + + b.Navigation("Tenant"); + + b.Navigation("WorkItem"); + + b.Navigation("WorkStatus"); + }); + + 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.MPINDetails", b => + { + b.HasOne("Marco.Pms.Model.Entitlements.Tenant", "Tenant") + .WithMany() + .HasForeignKey("TenantId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Tenant"); + }); + + modelBuilder.Entity("Marco.Pms.Model.Authentication.OTPDetails", b => + { + b.HasOne("Marco.Pms.Model.Entitlements.Tenant", "Tenant") + .WithMany() + .HasForeignKey("TenantId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Tenant"); + }); + + 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.Directory.Bucket", b => + { + b.HasOne("Marco.Pms.Model.Employees.Employee", "CreatedBy") + .WithMany() + .HasForeignKey("CreatedByID") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Marco.Pms.Model.Entitlements.Tenant", "Tenant") + .WithMany() + .HasForeignKey("TenantId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("CreatedBy"); + + b.Navigation("Tenant"); + }); + + modelBuilder.Entity("Marco.Pms.Model.Directory.Contact", b => + { + b.HasOne("Marco.Pms.Model.Directory.ContactCategoryMaster", "ContactCategory") + .WithMany() + .HasForeignKey("ContactCategoryId"); + + b.HasOne("Marco.Pms.Model.Employees.Employee", "CreatedBy") + .WithMany() + .HasForeignKey("CreatedById") + .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", "UpdatedBy") + .WithMany() + .HasForeignKey("UpdatedById"); + + b.Navigation("ContactCategory"); + + b.Navigation("CreatedBy"); + + b.Navigation("Tenant"); + + b.Navigation("UpdatedBy"); + }); + + modelBuilder.Entity("Marco.Pms.Model.Directory.ContactBucketMapping", b => + { + b.HasOne("Marco.Pms.Model.Directory.Bucket", "Bucket") + .WithMany() + .HasForeignKey("BucketId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Marco.Pms.Model.Directory.Contact", "Contact") + .WithMany() + .HasForeignKey("ContactId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Bucket"); + + b.Navigation("Contact"); + }); + + modelBuilder.Entity("Marco.Pms.Model.Directory.ContactCategoryMaster", b => + { + b.HasOne("Marco.Pms.Model.Entitlements.Tenant", "Tenant") + .WithMany() + .HasForeignKey("TenantId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Tenant"); + }); + + modelBuilder.Entity("Marco.Pms.Model.Directory.ContactEmail", b => + { + b.HasOne("Marco.Pms.Model.Directory.Contact", "Contact") + .WithMany() + .HasForeignKey("ContactId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Contact"); + }); + + modelBuilder.Entity("Marco.Pms.Model.Directory.ContactNote", b => + { + b.HasOne("Marco.Pms.Model.Directory.Contact", "Contact") + .WithMany() + .HasForeignKey("ContactId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Marco.Pms.Model.Employees.Employee", "Createdby") + .WithMany() + .HasForeignKey("CreatedById") + .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", "UpdatedBy") + .WithMany() + .HasForeignKey("UpdatedById"); + + b.Navigation("Contact"); + + b.Navigation("Createdby"); + + b.Navigation("Tenant"); + + b.Navigation("UpdatedBy"); + }); + + modelBuilder.Entity("Marco.Pms.Model.Directory.ContactPhone", b => + { + b.HasOne("Marco.Pms.Model.Directory.Contact", "Contact") + .WithMany() + .HasForeignKey("ContactId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Contact"); + }); + + modelBuilder.Entity("Marco.Pms.Model.Directory.ContactProjectMapping", b => + { + b.HasOne("Marco.Pms.Model.Directory.Contact", "Contact") + .WithMany() + .HasForeignKey("ContactId") + .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("Contact"); + + b.Navigation("Project"); + + b.Navigation("Tenant"); + }); + + modelBuilder.Entity("Marco.Pms.Model.Directory.ContactTagMapping", b => + { + b.HasOne("Marco.Pms.Model.Directory.Contact", "Contact") + .WithMany() + .HasForeignKey("ContactId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Marco.Pms.Model.Directory.ContactTagMaster", "ContactTag") + .WithMany() + .HasForeignKey("ContactTagId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Contact"); + + b.Navigation("ContactTag"); + }); + + modelBuilder.Entity("Marco.Pms.Model.Directory.ContactTagMaster", b => + { + b.HasOne("Marco.Pms.Model.Entitlements.Tenant", "Tenant") + .WithMany() + .HasForeignKey("TenantId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Tenant"); + }); + + modelBuilder.Entity("Marco.Pms.Model.Directory.DirectoryUpdateLog", b => + { + b.HasOne("Marco.Pms.Model.Employees.Employee", "Employee") + .WithMany() + .HasForeignKey("UpdatedById") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Employee"); + }); + + modelBuilder.Entity("Marco.Pms.Model.Directory.EmployeeBucketMapping", b => + { + b.HasOne("Marco.Pms.Model.Directory.Bucket", "Bucket") + .WithMany() + .HasForeignKey("BucketId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Marco.Pms.Model.Employees.Employee", "Employee") + .WithMany() + .HasForeignKey("EmployeeId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Bucket"); + + b.Navigation("Employee"); + }); + + modelBuilder.Entity("Marco.Pms.Model.DocumentManager.Document", b => + { + b.HasOne("Marco.Pms.Model.Entitlements.Tenant", "Tenant") + .WithMany() + .HasForeignKey("TenantId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Marco.Pms.Model.Employees.Employee", "UploadedBy") + .WithMany() + .HasForeignKey("UploadedById"); + + b.Navigation("Tenant"); + + b.Navigation("UploadedBy"); + }); + + modelBuilder.Entity("Marco.Pms.Model.Employees.Employee", b => + { + b.HasOne("Marco.Pms.Model.Entitlements.ApplicationUser", "ApplicationUser") + .WithMany() + .HasForeignKey("ApplicationUserId"); + + b.HasOne("Marco.Pms.Model.Roles.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.EmployeeRoleMapping", b => + { + b.HasOne("Marco.Pms.Model.Employees.Employee", "Employee") + .WithMany() + .HasForeignKey("EmployeeId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Marco.Pms.Model.Roles.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.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.FeaturePermission", b => + { + b.HasOne("Marco.Pms.Model.Master.Feature", "Feature") + .WithMany("FeaturePermissions") + .HasForeignKey("FeatureId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Feature"); + }); + + modelBuilder.Entity("Marco.Pms.Model.Entitlements.RolePermissionMappings", b => + { + b.HasOne("Marco.Pms.Model.Roles.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.Tenant", b => + { + b.HasOne("Marco.Pms.Model.Master.Industry", "Industry") + .WithMany() + .HasForeignKey("IndustryId"); + + b.Navigation("Industry"); + }); + + modelBuilder.Entity("Marco.Pms.Model.Expenses.BillAttachments", b => + { + b.HasOne("Marco.Pms.Model.DocumentManager.Document", "Document") + .WithMany() + .HasForeignKey("DocumentId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Marco.Pms.Model.Expenses.Expenses", "Expenses") + .WithMany() + .HasForeignKey("ExpensesId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Marco.Pms.Model.Entitlements.Tenant", "Tenant") + .WithMany() + .HasForeignKey("TenantId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Document"); + + b.Navigation("Expenses"); + + b.Navigation("Tenant"); + }); + + modelBuilder.Entity("Marco.Pms.Model.Expenses.Expenses", b => + { + b.HasOne("Marco.Pms.Model.Master.ExpensesTypeMaster", "ExpensesType") + .WithMany() + .HasForeignKey("ExpensesTypeId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Marco.Pms.Model.Employees.Employee", "PaidBy") + .WithMany() + .HasForeignKey("PaidById") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Marco.Pms.Model.Master.PaymentModeMatser", "PaymentMode") + .WithMany() + .HasForeignKey("PaymentModeId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Marco.Pms.Model.Projects.Project", "Project") + .WithMany() + .HasForeignKey("ProjectId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Marco.Pms.Model.Master.ExpensesStatusMaster", "Status") + .WithMany() + .HasForeignKey("StatusId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Marco.Pms.Model.Entitlements.Tenant", "Tenant") + .WithMany() + .HasForeignKey("TenantId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("ExpensesType"); + + b.Navigation("PaidBy"); + + b.Navigation("PaymentMode"); + + b.Navigation("Project"); + + b.Navigation("Status"); + + b.Navigation("Tenant"); + }); + + modelBuilder.Entity("Marco.Pms.Model.Expenses.ExpensesReimburse", b => + { + b.HasOne("Marco.Pms.Model.Employees.Employee", "ReimburseBy") + .WithMany() + .HasForeignKey("ReimburseById") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Marco.Pms.Model.Entitlements.Tenant", "Tenant") + .WithMany() + .HasForeignKey("TenantId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("ReimburseBy"); + + b.Navigation("Tenant"); + }); + + modelBuilder.Entity("Marco.Pms.Model.Expenses.ExpensesReimburseMapping", b => + { + b.HasOne("Marco.Pms.Model.Expenses.Expenses", "Expenses") + .WithMany() + .HasForeignKey("ExpensesId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Marco.Pms.Model.Expenses.ExpensesReimburse", "ExpensesReimburse") + .WithMany() + .HasForeignKey("ExpensesReimburseId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Expenses"); + + b.Navigation("ExpensesReimburse"); + }); + + modelBuilder.Entity("Marco.Pms.Model.Expenses.StatusMapping", b => + { + b.HasOne("Marco.Pms.Model.Master.ExpensesStatusMaster", "Status") + .WithMany() + .HasForeignKey("ExpeStatusIdnsesId"); + + b.HasOne("Marco.Pms.Model.Master.ExpensesStatusMaster", "NextStatus") + .WithMany() + .HasForeignKey("NextStatusId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Marco.Pms.Model.Entitlements.Tenant", "Tenant") + .WithMany() + .HasForeignKey("TenantId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("NextStatus"); + + b.Navigation("Status"); + + b.Navigation("Tenant"); + }); + + modelBuilder.Entity("Marco.Pms.Model.Expenses.StatusPermissionMapping", b => + { + b.HasOne("Marco.Pms.Model.Entitlements.FeaturePermission", "Permission") + .WithMany() + .HasForeignKey("PermissionId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Marco.Pms.Model.Master.ExpensesStatusMaster", "Status") + .WithMany() + .HasForeignKey("StatusId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Permission"); + + b.Navigation("Status"); + }); + + 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.Master.TicketPriorityMaster", "Priority") + .WithMany() + .HasForeignKey("PriorityId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Marco.Pms.Model.Master.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.Master.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.Mail.MailDetails", b => + { + b.HasOne("Marco.Pms.Model.Mail.MailingList", "MailBody") + .WithMany() + .HasForeignKey("MailListId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("MailBody"); + }); + + modelBuilder.Entity("Marco.Pms.Model.Master.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.Master.ExpensesStatusMaster", b => + { + b.HasOne("Marco.Pms.Model.Entitlements.Tenant", "Tenant") + .WithMany() + .HasForeignKey("TenantId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Tenant"); + }); + + modelBuilder.Entity("Marco.Pms.Model.Master.ExpensesTypeMaster", b => + { + b.HasOne("Marco.Pms.Model.Entitlements.Tenant", "Tenant") + .WithMany() + .HasForeignKey("TenantId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Tenant"); + }); + + modelBuilder.Entity("Marco.Pms.Model.Master.Feature", b => + { + b.HasOne("Marco.Pms.Model.Master.Module", "Module") + .WithMany() + .HasForeignKey("ModuleId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Module"); + }); + + modelBuilder.Entity("Marco.Pms.Model.Master.PaymentModeMatser", b => + { + b.HasOne("Marco.Pms.Model.Entitlements.Tenant", "Tenant") + .WithMany() + .HasForeignKey("TenantId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Tenant"); + }); + + modelBuilder.Entity("Marco.Pms.Model.Master.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.Master.WorkCategoryMaster", b => + { + b.HasOne("Marco.Pms.Model.Entitlements.Tenant", "Tenant") + .WithMany() + .HasForeignKey("TenantId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Tenant"); + }); + + modelBuilder.Entity("Marco.Pms.Model.Master.WorkStatusMaster", 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.Master.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.Master.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.HasOne("Marco.Pms.Model.Master.WorkCategoryMaster", "WorkCategoryMaster") + .WithMany() + .HasForeignKey("WorkCategoryId"); + + b.Navigation("ActivityMaster"); + + b.Navigation("Tenant"); + + b.Navigation("WorkArea"); + + b.Navigation("WorkCategoryMaster"); + }); + + modelBuilder.Entity("Marco.Pms.Model.Roles.ApplicationRole", b => + { + b.HasOne("Marco.Pms.Model.Entitlements.Tenant", null) + .WithMany() + .HasForeignKey("TenantId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Marco.Pms.Model.Roles.JobRole", b => + { + b.HasOne("Marco.Pms.Model.Entitlements.Tenant", "Tenant") + .WithMany() + .HasForeignKey("TenantId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + 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.Forum.TicketComment", b => + { + b.Navigation("Attachments"); + }); + + modelBuilder.Entity("Marco.Pms.Model.Master.Feature", b => + { + b.Navigation("FeaturePermissions"); + }); +#pragma warning restore 612, 618 + } + } +} diff --git a/Marco.Pms.DataAccess/Migrations/20250719074035_Expenses_tables_Added.cs b/Marco.Pms.DataAccess/Migrations/20250719074035_Expenses_tables_Added.cs new file mode 100644 index 0000000..d53b349 --- /dev/null +++ b/Marco.Pms.DataAccess/Migrations/20250719074035_Expenses_tables_Added.cs @@ -0,0 +1,556 @@ +using System; +using Microsoft.EntityFrameworkCore.Migrations; + +#nullable disable + +#pragma warning disable CA1814 // Prefer jagged arrays over multidimensional + +namespace Marco.Pms.DataAccess.Migrations +{ + /// + public partial class Expenses_tables_Added : Migration + { + /// + protected override void Up(MigrationBuilder migrationBuilder) + { + migrationBuilder.CreateTable( + name: "ExpensesReimburse", + columns: table => new + { + Id = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), + ReimburseTransactionId = table.Column(type: "longtext", nullable: false) + .Annotation("MySql:CharSet", "utf8mb4"), + ReimburseDate = table.Column(type: "datetime(6)", nullable: false), + ReimburseById = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), + ReimburseNote = table.Column(type: "longtext", nullable: false) + .Annotation("MySql:CharSet", "utf8mb4"), + TenantId = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci") + }, + constraints: table => + { + table.PrimaryKey("PK_ExpensesReimburse", x => x.Id); + table.ForeignKey( + name: "FK_ExpensesReimburse_Employees_ReimburseById", + column: x => x.ReimburseById, + principalTable: "Employees", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + table.ForeignKey( + name: "FK_ExpensesReimburse_Tenants_TenantId", + column: x => x.TenantId, + principalTable: "Tenants", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + }) + .Annotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.CreateTable( + name: "ExpensesStatusMaster", + 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: false) + .Annotation("MySql:CharSet", "utf8mb4"), + IsSystem = table.Column(type: "tinyint(1)", nullable: false), + 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_ExpensesStatusMaster", x => x.Id); + table.ForeignKey( + name: "FK_ExpensesStatusMaster_Tenants_TenantId", + column: x => x.TenantId, + principalTable: "Tenants", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + }) + .Annotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.CreateTable( + name: "ExpensesTypeMaster", + 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"), + NoOfPersonsRequired = table.Column(type: "tinyint(1)", nullable: false), + Description = table.Column(type: "longtext", nullable: false) + .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_ExpensesTypeMaster", x => x.Id); + table.ForeignKey( + name: "FK_ExpensesTypeMaster_Tenants_TenantId", + column: x => x.TenantId, + principalTable: "Tenants", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + }) + .Annotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.CreateTable( + name: "PaymentModeMatser", + 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: false) + .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_PaymentModeMatser", x => x.Id); + table.ForeignKey( + name: "FK_PaymentModeMatser_Tenants_TenantId", + column: x => x.TenantId, + principalTable: "Tenants", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + }) + .Annotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.CreateTable( + name: "StatusMapping", + columns: table => new + { + Id = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), + StatusId = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), + ExpeStatusIdnsesId = table.Column(type: "char(36)", nullable: true, collation: "ascii_general_ci"), + NextStatusId = 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_StatusMapping", x => x.Id); + table.ForeignKey( + name: "FK_StatusMapping_ExpensesStatusMaster_ExpeStatusIdnsesId", + column: x => x.ExpeStatusIdnsesId, + principalTable: "ExpensesStatusMaster", + principalColumn: "Id"); + table.ForeignKey( + name: "FK_StatusMapping_ExpensesStatusMaster_NextStatusId", + column: x => x.NextStatusId, + principalTable: "ExpensesStatusMaster", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + table.ForeignKey( + name: "FK_StatusMapping_Tenants_TenantId", + column: x => x.TenantId, + principalTable: "Tenants", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + }) + .Annotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.CreateTable( + name: "StatusPermissionMapping", + columns: table => new + { + Id = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), + StatusId = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), + PermissionId = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci") + }, + constraints: table => + { + table.PrimaryKey("PK_StatusPermissionMapping", x => x.Id); + table.ForeignKey( + name: "FK_StatusPermissionMapping_ExpensesStatusMaster_StatusId", + column: x => x.StatusId, + principalTable: "ExpensesStatusMaster", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + table.ForeignKey( + name: "FK_StatusPermissionMapping_FeaturePermissions_PermissionId", + column: x => x.PermissionId, + principalTable: "FeaturePermissions", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + }) + .Annotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.CreateTable( + name: "Expenses", + columns: table => new + { + Id = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), + ProjectId = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), + ExpensesTypeId = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), + PaymentModeId = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), + PaidById = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), + TransactionDate = table.Column(type: "datetime(6)", nullable: false), + TransactionId = table.Column(type: "longtext", nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + Description = table.Column(type: "longtext", nullable: false) + .Annotation("MySql:CharSet", "utf8mb4"), + Location = table.Column(type: "longtext", nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + GSTNumber = table.Column(type: "longtext", nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + SupplerName = table.Column(type: "longtext", nullable: false) + .Annotation("MySql:CharSet", "utf8mb4"), + Amount = table.Column(type: "double", nullable: false), + NoOfPersons = table.Column(type: "int", nullable: true), + StatusId = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), + PreApproved = table.Column(type: "tinyint(1)", nullable: false), + 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_Expenses", x => x.Id); + table.ForeignKey( + name: "FK_Expenses_Employees_PaidById", + column: x => x.PaidById, + principalTable: "Employees", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + table.ForeignKey( + name: "FK_Expenses_ExpensesStatusMaster_StatusId", + column: x => x.StatusId, + principalTable: "ExpensesStatusMaster", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + table.ForeignKey( + name: "FK_Expenses_ExpensesTypeMaster_ExpensesTypeId", + column: x => x.ExpensesTypeId, + principalTable: "ExpensesTypeMaster", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + table.ForeignKey( + name: "FK_Expenses_PaymentModeMatser_PaymentModeId", + column: x => x.PaymentModeId, + principalTable: "PaymentModeMatser", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + table.ForeignKey( + name: "FK_Expenses_Projects_ProjectId", + column: x => x.ProjectId, + principalTable: "Projects", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + table.ForeignKey( + name: "FK_Expenses_Tenants_TenantId", + column: x => x.TenantId, + principalTable: "Tenants", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + }) + .Annotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.CreateTable( + name: "BillAttachments", + columns: table => new + { + Id = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), + ExpensesId = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), + DocumentId = 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_BillAttachments", x => x.Id); + table.ForeignKey( + name: "FK_BillAttachments_Documents_DocumentId", + column: x => x.DocumentId, + principalTable: "Documents", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + table.ForeignKey( + name: "FK_BillAttachments_Expenses_ExpensesId", + column: x => x.ExpensesId, + principalTable: "Expenses", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + table.ForeignKey( + name: "FK_BillAttachments_Tenants_TenantId", + column: x => x.TenantId, + principalTable: "Tenants", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + }) + .Annotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.CreateTable( + name: "ExpensesReimburseMapping", + columns: table => new + { + Id = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), + ExpensesId = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), + ExpensesReimburseId = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci") + }, + constraints: table => + { + table.PrimaryKey("PK_ExpensesReimburseMapping", x => x.Id); + table.ForeignKey( + name: "FK_ExpensesReimburseMapping_ExpensesReimburse_ExpensesReimburse~", + column: x => x.ExpensesReimburseId, + principalTable: "ExpensesReimburse", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + table.ForeignKey( + name: "FK_ExpensesReimburseMapping_Expenses_ExpensesId", + column: x => x.ExpensesId, + principalTable: "Expenses", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + }) + .Annotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.InsertData( + table: "ExpensesStatusMaster", + columns: new[] { "Id", "Description", "IsActive", "IsSystem", "Name", "TenantId" }, + values: new object[,] + { + { new Guid("297e0d8f-f668-41b5-bfea-e03b354251c8"), "Expense has been created but not yet submitted.", true, true, "Draft", new Guid("b3466e83-7e11-464c-b93a-daf047838b26") }, + { new Guid("4068007f-c92f-4f37-a907-bc15fe57d4d8"), "Review is completed, waiting for action of approver.", true, true, "Approval Pending", new Guid("b3466e83-7e11-464c-b93a-daf047838b26") }, + { new Guid("61578360-3a49-4c34-8604-7b35a3787b95"), "Expense has been settled.", true, true, "Processed", new Guid("b3466e83-7e11-464c-b93a-daf047838b26") }, + { new Guid("6537018f-f4e9-4cb3-a210-6c3b2da999d7"), "Reviewer is currently reviewing the expense.", true, true, "Review Pending", new Guid("b3466e83-7e11-464c-b93a-daf047838b26") }, + { new Guid("d1ee5eec-24b6-4364-8673-a8f859c60729"), "Expense was declined, often with a reason(either review rejected or approval rejected.", true, true, "Rejected", new Guid("b3466e83-7e11-464c-b93a-daf047838b26") }, + { new Guid("f18c5cfd-7815-4341-8da2-2c2d65778e27"), "Approved expense is awaiting final payment.", true, true, "Process Pending", new Guid("b3466e83-7e11-464c-b93a-daf047838b26") } + }); + + migrationBuilder.InsertData( + table: "ExpensesTypeMaster", + columns: new[] { "Id", "Description", "IsActive", "Name", "NoOfPersonsRequired", "TenantId" }, + values: new object[,] + { + { new Guid("1e2d697a-76b4-4be8-bc66-87144561a1a0"), "Scheduled payments for external services or goods.", true, "Vendor/Supplier Payments", false, new Guid("b3466e83-7e11-464c-b93a-daf047838b26") }, + { new Guid("2de53163-0dbd-404b-8e60-1b02e6b4886a"), "Vehicle fuel, logistics services and delivery of goods or personnel.", true, "Transport", false, new Guid("b3466e83-7e11-464c-b93a-daf047838b26") }, + { new Guid("4842fa61-64eb-4241-aebd-8282065af9f9"), "Government fees, insurance, inspections and safety-related expenditures.", true, "Compliance & Safety", false, new Guid("b3466e83-7e11-464c-b93a-daf047838b26") }, + { new Guid("52484820-1b54-4865-8f0f-baa2b1d339b9"), "Site setup costs including equipment deployment and temporary infrastructure.", true, "Mobilization", false, new Guid("b3466e83-7e11-464c-b93a-daf047838b26") }, + { new Guid("5e0c6227-d49d-41ff-9f1f-781f0aee2469"), "Materials, equipment and supplies purchased for site operations.", true, "Procurement", false, new Guid("b3466e83-7e11-464c-b93a-daf047838b26") }, + { new Guid("77013784-9324-4d8b-bd36-d6f928e68942"), "Machinery servicing, electricity, water, and temporary office needs.", true, "Maintenance & Utilities", false, new Guid("b3466e83-7e11-464c-b93a-daf047838b26") }, + { new Guid("dd120bc4-ab0a-45ba-8450-5cd45ff221ca"), "Delivery of personnel.", true, "Travelling", true, new Guid("b3466e83-7e11-464c-b93a-daf047838b26") }, + { new Guid("fc59eb90-98ea-481c-b421-54bfa9e42d8f"), " Worker amenities like snacks, meals, safety gear, accommodation, medical support etc.", true, "Employee Welfare", true, new Guid("b3466e83-7e11-464c-b93a-daf047838b26") } + }); + + migrationBuilder.InsertData( + table: "Features", + columns: new[] { "Id", "Description", "IsActive", "ModuleId", "Name" }, + values: new object[] { new Guid("a4e25142-449b-4334-a6e5-22f70e4732d7"), "Expense Management is the systematic process of tracking, controlling, and reporting business-related expenditures.", true, new Guid("bf59fd88-b57a-4d67-bf01-3780f385896b"), "Expense Management" }); + + migrationBuilder.InsertData( + table: "PaymentModeMatser", + columns: new[] { "Id", "Description", "IsActive", "Name", "TenantId" }, + values: new object[,] + { + { new Guid("24e6b0df-7929-47d2-88a3-4cf14c1f28f9"), "Physical currency; still used for small or informal transactions.", true, "Cash", new Guid("b3466e83-7e11-464c-b93a-daf047838b26") }, + { new Guid("2e919e94-694c-41d9-9489-0a2b4208a027"), "Real-time bank-to-bank transfer using mobile apps; widely used for peer-to-peer and merchant payments.", true, "UPI", new Guid("b3466e83-7e11-464c-b93a-daf047838b26") }, + { new Guid("48d9b462-5d87-4dec-8dec-2bc943943172"), "Paper-based payment order; less common now due to processing delays and fraud risks.", true, "Cheque", new Guid("b3466e83-7e11-464c-b93a-daf047838b26") }, + { new Guid("ed667353-8eea-4fd1-8750-719405932480"), "Online banking portals used to transfer funds directly between accounts", true, "NetBanking", new Guid("b3466e83-7e11-464c-b93a-daf047838b26") } + }); + + migrationBuilder.InsertData( + table: "FeaturePermissions", + columns: new[] { "Id", "Description", "FeatureId", "IsEnabled", "Name" }, + values: new object[,] + { + { new Guid("01e06444-9ca7-4df4-b900-8c3fa051b92f"), "Allows a user to view all expense records across the organization or project, regardless of who submitted or paid them", new Guid("a4e25142-449b-4334-a6e5-22f70e4732d7"), true, "View All" }, + { new Guid("0f57885d-bcb2-4711-ac95-d841ace6d5a7"), "Allows a user to create and submit new expense records, including attaching relevant documents like receipts or invoices.", new Guid("a4e25142-449b-4334-a6e5-22f70e4732d7"), true, "Upload" }, + { new Guid("1f4bda08-1873-449a-bb66-3e8222bd871b"), "Allows a user to examine submitted expenses for accuracy, completeness, and policy compliance before they are approved or rejected.", new Guid("a4e25142-449b-4334-a6e5-22f70e4732d7"), true, "Review" }, + { new Guid("385be49f-8fde-440e-bdbc-3dffeb8dd116"), "Allows a user to view only the expense records that they have personally submitted", new Guid("a4e25142-449b-4334-a6e5-22f70e4732d7"), true, "View Self" }, + { new Guid("bdee29a2-b73b-402d-8dd1-c4b1f81ccbc3"), "Allows a user to configure and control system settings, such as managing expense types, payment modes, permissions, and overall workflow rules.", new Guid("a4e25142-449b-4334-a6e5-22f70e4732d7"), true, "Manage" }, + { new Guid("ea5a1529-4ee8-4828-80ea-0e23c9d4dd11"), "Allows a user to handle post-approval actions such as recording payments, updating financial records, or marking expenses as reimbursed or settled.", new Guid("a4e25142-449b-4334-a6e5-22f70e4732d7"), true, "Process" }, + { new Guid("eaafdd76-8aac-45f9-a530-315589c6deca"), "Allows a user to authorize or reject submitted expenses, making them officially accepted or declined within the system.", new Guid("a4e25142-449b-4334-a6e5-22f70e4732d7"), true, "Approve" } + }); + + migrationBuilder.InsertData( + table: "StatusMapping", + columns: new[] { "Id", "ExpeStatusIdnsesId", "NextStatusId", "StatusId", "TenantId" }, + values: new object[,] + { + { new Guid("1fca1700-1266-477d-bba4-9ac3753aa33c"), null, new Guid("f18c5cfd-7815-4341-8da2-2c2d65778e27"), new Guid("4068007f-c92f-4f37-a907-bc15fe57d4d8"), new Guid("b3466e83-7e11-464c-b93a-daf047838b26") }, + { new Guid("36c00548-241c-43ec-bc95-cacebedb925c"), null, new Guid("d1ee5eec-24b6-4364-8673-a8f859c60729"), new Guid("4068007f-c92f-4f37-a907-bc15fe57d4d8"), new Guid("b3466e83-7e11-464c-b93a-daf047838b26") }, + { new Guid("5cf7f1df-9d1f-4289-add0-1775ad614f25"), null, new Guid("f18c5cfd-7815-4341-8da2-2c2d65778e27"), new Guid("f18c5cfd-7815-4341-8da2-2c2d65778e27"), new Guid("b3466e83-7e11-464c-b93a-daf047838b26") }, + { new Guid("af1e4492-98ee-4451-8ab7-fd8323f29c32"), null, new Guid("6537018f-f4e9-4cb3-a210-6c3b2da999d7"), new Guid("297e0d8f-f668-41b5-bfea-e03b354251c8"), new Guid("b3466e83-7e11-464c-b93a-daf047838b26") }, + { new Guid("ef1fcfbc-60e0-4f17-9308-c583a05d48fd"), null, new Guid("4068007f-c92f-4f37-a907-bc15fe57d4d8"), new Guid("6537018f-f4e9-4cb3-a210-6c3b2da999d7"), new Guid("b3466e83-7e11-464c-b93a-daf047838b26") }, + { new Guid("fddaaf20-4ccc-4f4e-a724-dd310272b356"), null, new Guid("d1ee5eec-24b6-4364-8673-a8f859c60729"), new Guid("6537018f-f4e9-4cb3-a210-6c3b2da999d7"), new Guid("b3466e83-7e11-464c-b93a-daf047838b26") } + }); + + migrationBuilder.CreateIndex( + name: "IX_BillAttachments_DocumentId", + table: "BillAttachments", + column: "DocumentId"); + + migrationBuilder.CreateIndex( + name: "IX_BillAttachments_ExpensesId", + table: "BillAttachments", + column: "ExpensesId"); + + migrationBuilder.CreateIndex( + name: "IX_BillAttachments_TenantId", + table: "BillAttachments", + column: "TenantId"); + + migrationBuilder.CreateIndex( + name: "IX_Expenses_ExpensesTypeId", + table: "Expenses", + column: "ExpensesTypeId"); + + migrationBuilder.CreateIndex( + name: "IX_Expenses_PaidById", + table: "Expenses", + column: "PaidById"); + + migrationBuilder.CreateIndex( + name: "IX_Expenses_PaymentModeId", + table: "Expenses", + column: "PaymentModeId"); + + migrationBuilder.CreateIndex( + name: "IX_Expenses_ProjectId", + table: "Expenses", + column: "ProjectId"); + + migrationBuilder.CreateIndex( + name: "IX_Expenses_StatusId", + table: "Expenses", + column: "StatusId"); + + migrationBuilder.CreateIndex( + name: "IX_Expenses_TenantId", + table: "Expenses", + column: "TenantId"); + + migrationBuilder.CreateIndex( + name: "IX_ExpensesReimburse_ReimburseById", + table: "ExpensesReimburse", + column: "ReimburseById"); + + migrationBuilder.CreateIndex( + name: "IX_ExpensesReimburse_TenantId", + table: "ExpensesReimburse", + column: "TenantId"); + + migrationBuilder.CreateIndex( + name: "IX_ExpensesReimburseMapping_ExpensesId", + table: "ExpensesReimburseMapping", + column: "ExpensesId"); + + migrationBuilder.CreateIndex( + name: "IX_ExpensesReimburseMapping_ExpensesReimburseId", + table: "ExpensesReimburseMapping", + column: "ExpensesReimburseId"); + + migrationBuilder.CreateIndex( + name: "IX_ExpensesStatusMaster_TenantId", + table: "ExpensesStatusMaster", + column: "TenantId"); + + migrationBuilder.CreateIndex( + name: "IX_ExpensesTypeMaster_TenantId", + table: "ExpensesTypeMaster", + column: "TenantId"); + + migrationBuilder.CreateIndex( + name: "IX_PaymentModeMatser_TenantId", + table: "PaymentModeMatser", + column: "TenantId"); + + migrationBuilder.CreateIndex( + name: "IX_StatusMapping_ExpeStatusIdnsesId", + table: "StatusMapping", + column: "ExpeStatusIdnsesId"); + + migrationBuilder.CreateIndex( + name: "IX_StatusMapping_NextStatusId", + table: "StatusMapping", + column: "NextStatusId"); + + migrationBuilder.CreateIndex( + name: "IX_StatusMapping_TenantId", + table: "StatusMapping", + column: "TenantId"); + + migrationBuilder.CreateIndex( + name: "IX_StatusPermissionMapping_PermissionId", + table: "StatusPermissionMapping", + column: "PermissionId"); + + migrationBuilder.CreateIndex( + name: "IX_StatusPermissionMapping_StatusId", + table: "StatusPermissionMapping", + column: "StatusId"); + } + + /// + protected override void Down(MigrationBuilder migrationBuilder) + { + migrationBuilder.DropTable( + name: "BillAttachments"); + + migrationBuilder.DropTable( + name: "ExpensesReimburseMapping"); + + migrationBuilder.DropTable( + name: "StatusMapping"); + + migrationBuilder.DropTable( + name: "StatusPermissionMapping"); + + migrationBuilder.DropTable( + name: "ExpensesReimburse"); + + migrationBuilder.DropTable( + name: "Expenses"); + + migrationBuilder.DropTable( + name: "ExpensesStatusMaster"); + + migrationBuilder.DropTable( + name: "ExpensesTypeMaster"); + + migrationBuilder.DropTable( + name: "PaymentModeMatser"); + + migrationBuilder.DeleteData( + table: "FeaturePermissions", + keyColumn: "Id", + keyValue: new Guid("01e06444-9ca7-4df4-b900-8c3fa051b92f")); + + migrationBuilder.DeleteData( + table: "FeaturePermissions", + keyColumn: "Id", + keyValue: new Guid("0f57885d-bcb2-4711-ac95-d841ace6d5a7")); + + migrationBuilder.DeleteData( + table: "FeaturePermissions", + keyColumn: "Id", + keyValue: new Guid("1f4bda08-1873-449a-bb66-3e8222bd871b")); + + migrationBuilder.DeleteData( + table: "FeaturePermissions", + keyColumn: "Id", + keyValue: new Guid("385be49f-8fde-440e-bdbc-3dffeb8dd116")); + + migrationBuilder.DeleteData( + table: "FeaturePermissions", + keyColumn: "Id", + keyValue: new Guid("bdee29a2-b73b-402d-8dd1-c4b1f81ccbc3")); + + migrationBuilder.DeleteData( + table: "FeaturePermissions", + keyColumn: "Id", + keyValue: new Guid("ea5a1529-4ee8-4828-80ea-0e23c9d4dd11")); + + migrationBuilder.DeleteData( + table: "FeaturePermissions", + keyColumn: "Id", + keyValue: new Guid("eaafdd76-8aac-45f9-a530-315589c6deca")); + + migrationBuilder.DeleteData( + table: "Features", + keyColumn: "Id", + keyValue: new Guid("a4e25142-449b-4334-a6e5-22f70e4732d7")); + } + } +} diff --git a/Marco.Pms.DataAccess/Migrations/ApplicationDbContextModelSnapshot.cs b/Marco.Pms.DataAccess/Migrations/ApplicationDbContextModelSnapshot.cs index 258f8bd..766e2dd 100644 --- a/Marco.Pms.DataAccess/Migrations/ApplicationDbContextModelSnapshot.cs +++ b/Marco.Pms.DataAccess/Migrations/ApplicationDbContextModelSnapshot.cs @@ -1133,6 +1133,62 @@ namespace Marco.Pms.DataAccess.Migrations FeatureId = new Guid("39e66f81-efc6-446c-95bd-46bff6cfb606"), IsEnabled = true, Name = "Directory User" + }, + new + { + Id = new Guid("385be49f-8fde-440e-bdbc-3dffeb8dd116"), + Description = "Allows a user to view only the expense records that they have personally submitted", + FeatureId = new Guid("a4e25142-449b-4334-a6e5-22f70e4732d7"), + IsEnabled = true, + Name = "View Self" + }, + new + { + Id = new Guid("01e06444-9ca7-4df4-b900-8c3fa051b92f"), + Description = "Allows a user to view all expense records across the organization or project, regardless of who submitted or paid them", + FeatureId = new Guid("a4e25142-449b-4334-a6e5-22f70e4732d7"), + IsEnabled = true, + Name = "View All" + }, + new + { + Id = new Guid("0f57885d-bcb2-4711-ac95-d841ace6d5a7"), + Description = "Allows a user to create and submit new expense records, including attaching relevant documents like receipts or invoices.", + FeatureId = new Guid("a4e25142-449b-4334-a6e5-22f70e4732d7"), + IsEnabled = true, + Name = "Upload" + }, + new + { + Id = new Guid("1f4bda08-1873-449a-bb66-3e8222bd871b"), + Description = "Allows a user to examine submitted expenses for accuracy, completeness, and policy compliance before they are approved or rejected.", + FeatureId = new Guid("a4e25142-449b-4334-a6e5-22f70e4732d7"), + IsEnabled = true, + Name = "Review" + }, + new + { + Id = new Guid("eaafdd76-8aac-45f9-a530-315589c6deca"), + Description = "Allows a user to authorize or reject submitted expenses, making them officially accepted or declined within the system.", + FeatureId = new Guid("a4e25142-449b-4334-a6e5-22f70e4732d7"), + IsEnabled = true, + Name = "Approve" + }, + new + { + Id = new Guid("ea5a1529-4ee8-4828-80ea-0e23c9d4dd11"), + Description = "Allows a user to handle post-approval actions such as recording payments, updating financial records, or marking expenses as reimbursed or settled.", + FeatureId = new Guid("a4e25142-449b-4334-a6e5-22f70e4732d7"), + IsEnabled = true, + Name = "Process" + }, + new + { + Id = new Guid("bdee29a2-b73b-402d-8dd1-c4b1f81ccbc3"), + Description = "Allows a user to configure and control system settings, such as managing expense types, payment modes, permissions, and overall workflow rules.", + FeatureId = new Guid("a4e25142-449b-4334-a6e5-22f70e4732d7"), + IsEnabled = true, + Name = "Manage" }); }); @@ -1206,6 +1262,252 @@ namespace Marco.Pms.DataAccess.Migrations }); }); + modelBuilder.Entity("Marco.Pms.Model.Expenses.BillAttachments", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("DocumentId") + .HasColumnType("char(36)"); + + b.Property("ExpensesId") + .HasColumnType("char(36)"); + + b.Property("TenantId") + .HasColumnType("char(36)"); + + b.HasKey("Id"); + + b.HasIndex("DocumentId"); + + b.HasIndex("ExpensesId"); + + b.HasIndex("TenantId"); + + b.ToTable("BillAttachments"); + }); + + modelBuilder.Entity("Marco.Pms.Model.Expenses.Expenses", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("Amount") + .HasColumnType("double"); + + b.Property("Description") + .IsRequired() + .HasColumnType("longtext"); + + b.Property("ExpensesTypeId") + .HasColumnType("char(36)"); + + b.Property("GSTNumber") + .HasColumnType("longtext"); + + b.Property("IsActive") + .HasColumnType("tinyint(1)"); + + b.Property("Location") + .HasColumnType("longtext"); + + b.Property("NoOfPersons") + .HasColumnType("int"); + + b.Property("PaidById") + .HasColumnType("char(36)"); + + b.Property("PaymentModeId") + .HasColumnType("char(36)"); + + b.Property("PreApproved") + .HasColumnType("tinyint(1)"); + + b.Property("ProjectId") + .HasColumnType("char(36)"); + + b.Property("StatusId") + .HasColumnType("char(36)"); + + b.Property("SupplerName") + .IsRequired() + .HasColumnType("longtext"); + + b.Property("TenantId") + .HasColumnType("char(36)"); + + b.Property("TransactionDate") + .HasColumnType("datetime(6)"); + + b.Property("TransactionId") + .HasColumnType("longtext"); + + b.HasKey("Id"); + + b.HasIndex("ExpensesTypeId"); + + b.HasIndex("PaidById"); + + b.HasIndex("PaymentModeId"); + + b.HasIndex("ProjectId"); + + b.HasIndex("StatusId"); + + b.HasIndex("TenantId"); + + b.ToTable("Expenses"); + }); + + modelBuilder.Entity("Marco.Pms.Model.Expenses.ExpensesReimburse", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("ReimburseById") + .HasColumnType("char(36)"); + + b.Property("ReimburseDate") + .HasColumnType("datetime(6)"); + + b.Property("ReimburseNote") + .IsRequired() + .HasColumnType("longtext"); + + b.Property("ReimburseTransactionId") + .IsRequired() + .HasColumnType("longtext"); + + b.Property("TenantId") + .HasColumnType("char(36)"); + + b.HasKey("Id"); + + b.HasIndex("ReimburseById"); + + b.HasIndex("TenantId"); + + b.ToTable("ExpensesReimburse"); + }); + + modelBuilder.Entity("Marco.Pms.Model.Expenses.ExpensesReimburseMapping", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("ExpensesId") + .HasColumnType("char(36)"); + + b.Property("ExpensesReimburseId") + .HasColumnType("char(36)"); + + b.HasKey("Id"); + + b.HasIndex("ExpensesId"); + + b.HasIndex("ExpensesReimburseId"); + + b.ToTable("ExpensesReimburseMapping"); + }); + + modelBuilder.Entity("Marco.Pms.Model.Expenses.StatusMapping", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("ExpeStatusIdnsesId") + .HasColumnType("char(36)"); + + b.Property("NextStatusId") + .HasColumnType("char(36)"); + + b.Property("StatusId") + .HasColumnType("char(36)"); + + b.Property("TenantId") + .HasColumnType("char(36)"); + + b.HasKey("Id"); + + b.HasIndex("ExpeStatusIdnsesId"); + + b.HasIndex("NextStatusId"); + + b.HasIndex("TenantId"); + + b.ToTable("StatusMapping"); + + b.HasData( + new + { + Id = new Guid("5cf7f1df-9d1f-4289-add0-1775ad614f25"), + NextStatusId = new Guid("f18c5cfd-7815-4341-8da2-2c2d65778e27"), + StatusId = new Guid("f18c5cfd-7815-4341-8da2-2c2d65778e27"), + TenantId = new Guid("b3466e83-7e11-464c-b93a-daf047838b26") + }, + new + { + Id = new Guid("36c00548-241c-43ec-bc95-cacebedb925c"), + NextStatusId = new Guid("d1ee5eec-24b6-4364-8673-a8f859c60729"), + StatusId = new Guid("4068007f-c92f-4f37-a907-bc15fe57d4d8"), + TenantId = new Guid("b3466e83-7e11-464c-b93a-daf047838b26") + }, + new + { + Id = new Guid("1fca1700-1266-477d-bba4-9ac3753aa33c"), + NextStatusId = new Guid("f18c5cfd-7815-4341-8da2-2c2d65778e27"), + StatusId = new Guid("4068007f-c92f-4f37-a907-bc15fe57d4d8"), + TenantId = new Guid("b3466e83-7e11-464c-b93a-daf047838b26") + }, + new + { + Id = new Guid("fddaaf20-4ccc-4f4e-a724-dd310272b356"), + NextStatusId = new Guid("d1ee5eec-24b6-4364-8673-a8f859c60729"), + StatusId = new Guid("6537018f-f4e9-4cb3-a210-6c3b2da999d7"), + TenantId = new Guid("b3466e83-7e11-464c-b93a-daf047838b26") + }, + new + { + Id = new Guid("ef1fcfbc-60e0-4f17-9308-c583a05d48fd"), + NextStatusId = new Guid("4068007f-c92f-4f37-a907-bc15fe57d4d8"), + StatusId = new Guid("6537018f-f4e9-4cb3-a210-6c3b2da999d7"), + TenantId = new Guid("b3466e83-7e11-464c-b93a-daf047838b26") + }, + new + { + Id = new Guid("af1e4492-98ee-4451-8ab7-fd8323f29c32"), + NextStatusId = new Guid("6537018f-f4e9-4cb3-a210-6c3b2da999d7"), + StatusId = new Guid("297e0d8f-f668-41b5-bfea-e03b354251c8"), + TenantId = new Guid("b3466e83-7e11-464c-b93a-daf047838b26") + }); + }); + + modelBuilder.Entity("Marco.Pms.Model.Expenses.StatusPermissionMapping", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("PermissionId") + .HasColumnType("char(36)"); + + b.Property("StatusId") + .HasColumnType("char(36)"); + + b.HasKey("Id"); + + b.HasIndex("PermissionId"); + + b.HasIndex("StatusId"); + + b.ToTable("StatusPermissionMapping"); + }); + modelBuilder.Entity("Marco.Pms.Model.Forum.TicketAttachment", b => { b.Property("Id") @@ -1496,6 +1798,196 @@ namespace Marco.Pms.DataAccess.Migrations b.ToTable("ActivityMasters"); }); + modelBuilder.Entity("Marco.Pms.Model.Master.ExpensesStatusMaster", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("Description") + .IsRequired() + .HasColumnType("longtext"); + + b.Property("IsActive") + .HasColumnType("tinyint(1)"); + + b.Property("IsSystem") + .HasColumnType("tinyint(1)"); + + b.Property("Name") + .IsRequired() + .HasColumnType("longtext"); + + b.Property("TenantId") + .HasColumnType("char(36)"); + + b.HasKey("Id"); + + b.HasIndex("TenantId"); + + b.ToTable("ExpensesStatusMaster"); + + b.HasData( + new + { + Id = new Guid("297e0d8f-f668-41b5-bfea-e03b354251c8"), + Description = "Expense has been created but not yet submitted.", + IsActive = true, + IsSystem = true, + Name = "Draft", + TenantId = new Guid("b3466e83-7e11-464c-b93a-daf047838b26") + }, + new + { + Id = new Guid("6537018f-f4e9-4cb3-a210-6c3b2da999d7"), + Description = "Reviewer is currently reviewing the expense.", + IsActive = true, + IsSystem = true, + Name = "Review Pending", + TenantId = new Guid("b3466e83-7e11-464c-b93a-daf047838b26") + }, + new + { + Id = new Guid("4068007f-c92f-4f37-a907-bc15fe57d4d8"), + Description = "Review is completed, waiting for action of approver.", + IsActive = true, + IsSystem = true, + Name = "Approval Pending", + TenantId = new Guid("b3466e83-7e11-464c-b93a-daf047838b26") + }, + new + { + Id = new Guid("d1ee5eec-24b6-4364-8673-a8f859c60729"), + Description = "Expense was declined, often with a reason(either review rejected or approval rejected.", + IsActive = true, + IsSystem = true, + Name = "Rejected", + TenantId = new Guid("b3466e83-7e11-464c-b93a-daf047838b26") + }, + new + { + Id = new Guid("f18c5cfd-7815-4341-8da2-2c2d65778e27"), + Description = "Approved expense is awaiting final payment.", + IsActive = true, + IsSystem = true, + Name = "Process Pending", + TenantId = new Guid("b3466e83-7e11-464c-b93a-daf047838b26") + }, + new + { + Id = new Guid("61578360-3a49-4c34-8604-7b35a3787b95"), + Description = "Expense has been settled.", + IsActive = true, + IsSystem = true, + Name = "Processed", + TenantId = new Guid("b3466e83-7e11-464c-b93a-daf047838b26") + }); + }); + + modelBuilder.Entity("Marco.Pms.Model.Master.ExpensesTypeMaster", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("Description") + .IsRequired() + .HasColumnType("longtext"); + + b.Property("IsActive") + .HasColumnType("tinyint(1)"); + + b.Property("Name") + .IsRequired() + .HasColumnType("longtext"); + + b.Property("NoOfPersonsRequired") + .HasColumnType("tinyint(1)"); + + b.Property("TenantId") + .HasColumnType("char(36)"); + + b.HasKey("Id"); + + b.HasIndex("TenantId"); + + b.ToTable("ExpensesTypeMaster"); + + b.HasData( + new + { + Id = new Guid("5e0c6227-d49d-41ff-9f1f-781f0aee2469"), + Description = "Materials, equipment and supplies purchased for site operations.", + IsActive = true, + Name = "Procurement", + NoOfPersonsRequired = false, + TenantId = new Guid("b3466e83-7e11-464c-b93a-daf047838b26") + }, + new + { + Id = new Guid("2de53163-0dbd-404b-8e60-1b02e6b4886a"), + Description = "Vehicle fuel, logistics services and delivery of goods or personnel.", + IsActive = true, + Name = "Transport", + NoOfPersonsRequired = false, + TenantId = new Guid("b3466e83-7e11-464c-b93a-daf047838b26") + }, + new + { + Id = new Guid("dd120bc4-ab0a-45ba-8450-5cd45ff221ca"), + Description = "Delivery of personnel.", + IsActive = true, + Name = "Travelling", + NoOfPersonsRequired = true, + TenantId = new Guid("b3466e83-7e11-464c-b93a-daf047838b26") + }, + new + { + Id = new Guid("52484820-1b54-4865-8f0f-baa2b1d339b9"), + Description = "Site setup costs including equipment deployment and temporary infrastructure.", + IsActive = true, + Name = "Mobilization", + NoOfPersonsRequired = false, + TenantId = new Guid("b3466e83-7e11-464c-b93a-daf047838b26") + }, + new + { + Id = new Guid("fc59eb90-98ea-481c-b421-54bfa9e42d8f"), + Description = " Worker amenities like snacks, meals, safety gear, accommodation, medical support etc.", + IsActive = true, + Name = "Employee Welfare", + NoOfPersonsRequired = true, + TenantId = new Guid("b3466e83-7e11-464c-b93a-daf047838b26") + }, + new + { + Id = new Guid("77013784-9324-4d8b-bd36-d6f928e68942"), + Description = "Machinery servicing, electricity, water, and temporary office needs.", + IsActive = true, + Name = "Maintenance & Utilities", + NoOfPersonsRequired = false, + TenantId = new Guid("b3466e83-7e11-464c-b93a-daf047838b26") + }, + new + { + Id = new Guid("1e2d697a-76b4-4be8-bc66-87144561a1a0"), + Description = "Scheduled payments for external services or goods.", + IsActive = true, + Name = "Vendor/Supplier Payments", + NoOfPersonsRequired = false, + TenantId = new Guid("b3466e83-7e11-464c-b93a-daf047838b26") + }, + new + { + Id = new Guid("4842fa61-64eb-4241-aebd-8282065af9f9"), + Description = "Government fees, insurance, inspections and safety-related expenditures.", + IsActive = true, + Name = "Compliance & Safety", + NoOfPersonsRequired = false, + TenantId = new Guid("b3466e83-7e11-464c-b93a-daf047838b26") + }); + }); + modelBuilder.Entity("Marco.Pms.Model.Master.Feature", b => { b.Property("Id") @@ -1530,6 +2022,14 @@ namespace Marco.Pms.DataAccess.Migrations Name = "Project Management" }, new + { + Id = new Guid("a4e25142-449b-4334-a6e5-22f70e4732d7"), + Description = "Expense Management is the systematic process of tracking, controlling, and reporting business-related expenditures.", + IsActive = true, + ModuleId = new Guid("bf59fd88-b57a-4d67-bf01-3780f385896b"), + Name = "Expense Management" + }, + new { Id = new Guid("9d4b5489-2079-40b9-bd77-6e1bf90bc19f"), Description = "Manage Tasks", @@ -1677,6 +2177,67 @@ namespace Marco.Pms.DataAccess.Migrations }); }); + modelBuilder.Entity("Marco.Pms.Model.Master.PaymentModeMatser", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("Description") + .IsRequired() + .HasColumnType("longtext"); + + b.Property("IsActive") + .HasColumnType("tinyint(1)"); + + b.Property("Name") + .IsRequired() + .HasColumnType("longtext"); + + b.Property("TenantId") + .HasColumnType("char(36)"); + + b.HasKey("Id"); + + b.HasIndex("TenantId"); + + b.ToTable("PaymentModeMatser"); + + b.HasData( + new + { + Id = new Guid("24e6b0df-7929-47d2-88a3-4cf14c1f28f9"), + Description = "Physical currency; still used for small or informal transactions.", + IsActive = true, + Name = "Cash", + TenantId = new Guid("b3466e83-7e11-464c-b93a-daf047838b26") + }, + new + { + Id = new Guid("48d9b462-5d87-4dec-8dec-2bc943943172"), + Description = "Paper-based payment order; less common now due to processing delays and fraud risks.", + IsActive = true, + Name = "Cheque", + TenantId = new Guid("b3466e83-7e11-464c-b93a-daf047838b26") + }, + new + { + Id = new Guid("ed667353-8eea-4fd1-8750-719405932480"), + Description = "Online banking portals used to transfer funds directly between accounts", + IsActive = true, + Name = "NetBanking", + TenantId = new Guid("b3466e83-7e11-464c-b93a-daf047838b26") + }, + new + { + Id = new Guid("2e919e94-694c-41d9-9489-0a2b4208a027"), + Description = "Real-time bank-to-bank transfer using mobile apps; widely used for peer-to-peer and merchant payments.", + IsActive = true, + Name = "UPI", + TenantId = new Guid("b3466e83-7e11-464c-b93a-daf047838b26") + }); + }); + modelBuilder.Entity("Marco.Pms.Model.Master.StatusMaster", b => { b.Property("Id") @@ -3061,6 +3622,166 @@ namespace Marco.Pms.DataAccess.Migrations b.Navigation("Industry"); }); + modelBuilder.Entity("Marco.Pms.Model.Expenses.BillAttachments", b => + { + b.HasOne("Marco.Pms.Model.DocumentManager.Document", "Document") + .WithMany() + .HasForeignKey("DocumentId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Marco.Pms.Model.Expenses.Expenses", "Expenses") + .WithMany() + .HasForeignKey("ExpensesId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Marco.Pms.Model.Entitlements.Tenant", "Tenant") + .WithMany() + .HasForeignKey("TenantId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Document"); + + b.Navigation("Expenses"); + + b.Navigation("Tenant"); + }); + + modelBuilder.Entity("Marco.Pms.Model.Expenses.Expenses", b => + { + b.HasOne("Marco.Pms.Model.Master.ExpensesTypeMaster", "ExpensesType") + .WithMany() + .HasForeignKey("ExpensesTypeId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Marco.Pms.Model.Employees.Employee", "PaidBy") + .WithMany() + .HasForeignKey("PaidById") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Marco.Pms.Model.Master.PaymentModeMatser", "PaymentMode") + .WithMany() + .HasForeignKey("PaymentModeId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Marco.Pms.Model.Projects.Project", "Project") + .WithMany() + .HasForeignKey("ProjectId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Marco.Pms.Model.Master.ExpensesStatusMaster", "Status") + .WithMany() + .HasForeignKey("StatusId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Marco.Pms.Model.Entitlements.Tenant", "Tenant") + .WithMany() + .HasForeignKey("TenantId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("ExpensesType"); + + b.Navigation("PaidBy"); + + b.Navigation("PaymentMode"); + + b.Navigation("Project"); + + b.Navigation("Status"); + + b.Navigation("Tenant"); + }); + + modelBuilder.Entity("Marco.Pms.Model.Expenses.ExpensesReimburse", b => + { + b.HasOne("Marco.Pms.Model.Employees.Employee", "ReimburseBy") + .WithMany() + .HasForeignKey("ReimburseById") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Marco.Pms.Model.Entitlements.Tenant", "Tenant") + .WithMany() + .HasForeignKey("TenantId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("ReimburseBy"); + + b.Navigation("Tenant"); + }); + + modelBuilder.Entity("Marco.Pms.Model.Expenses.ExpensesReimburseMapping", b => + { + b.HasOne("Marco.Pms.Model.Expenses.Expenses", "Expenses") + .WithMany() + .HasForeignKey("ExpensesId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Marco.Pms.Model.Expenses.ExpensesReimburse", "ExpensesReimburse") + .WithMany() + .HasForeignKey("ExpensesReimburseId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Expenses"); + + b.Navigation("ExpensesReimburse"); + }); + + modelBuilder.Entity("Marco.Pms.Model.Expenses.StatusMapping", b => + { + b.HasOne("Marco.Pms.Model.Master.ExpensesStatusMaster", "Status") + .WithMany() + .HasForeignKey("ExpeStatusIdnsesId"); + + b.HasOne("Marco.Pms.Model.Master.ExpensesStatusMaster", "NextStatus") + .WithMany() + .HasForeignKey("NextStatusId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Marco.Pms.Model.Entitlements.Tenant", "Tenant") + .WithMany() + .HasForeignKey("TenantId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("NextStatus"); + + b.Navigation("Status"); + + b.Navigation("Tenant"); + }); + + modelBuilder.Entity("Marco.Pms.Model.Expenses.StatusPermissionMapping", b => + { + b.HasOne("Marco.Pms.Model.Entitlements.FeaturePermission", "Permission") + .WithMany() + .HasForeignKey("PermissionId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Marco.Pms.Model.Master.ExpensesStatusMaster", "Status") + .WithMany() + .HasForeignKey("StatusId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Permission"); + + b.Navigation("Status"); + }); + modelBuilder.Entity("Marco.Pms.Model.Forum.TicketAttachment", b => { b.HasOne("Marco.Pms.Model.Forum.TicketComment", "TicketComment") @@ -3165,6 +3886,28 @@ namespace Marco.Pms.DataAccess.Migrations b.Navigation("Tenant"); }); + modelBuilder.Entity("Marco.Pms.Model.Master.ExpensesStatusMaster", b => + { + b.HasOne("Marco.Pms.Model.Entitlements.Tenant", "Tenant") + .WithMany() + .HasForeignKey("TenantId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Tenant"); + }); + + modelBuilder.Entity("Marco.Pms.Model.Master.ExpensesTypeMaster", b => + { + b.HasOne("Marco.Pms.Model.Entitlements.Tenant", "Tenant") + .WithMany() + .HasForeignKey("TenantId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Tenant"); + }); + modelBuilder.Entity("Marco.Pms.Model.Master.Feature", b => { b.HasOne("Marco.Pms.Model.Master.Module", "Module") @@ -3176,6 +3919,17 @@ namespace Marco.Pms.DataAccess.Migrations b.Navigation("Module"); }); + modelBuilder.Entity("Marco.Pms.Model.Master.PaymentModeMatser", b => + { + b.HasOne("Marco.Pms.Model.Entitlements.Tenant", "Tenant") + .WithMany() + .HasForeignKey("TenantId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Tenant"); + }); + modelBuilder.Entity("Marco.Pms.Model.Master.StatusMaster", b => { b.HasOne("Marco.Pms.Model.Entitlements.Tenant", "Tenant") diff --git a/Marco.Pms.Model/Dtos/Expenses/CreateExpensesDto.cs b/Marco.Pms.Model/Dtos/Expenses/CreateExpensesDto.cs new file mode 100644 index 0000000..d1d8ec4 --- /dev/null +++ b/Marco.Pms.Model/Dtos/Expenses/CreateExpensesDto.cs @@ -0,0 +1,22 @@ +using Marco.Pms.Model.Utilities; + +namespace Marco.Pms.Model.Dtos.Expenses +{ + public class CreateExpensesDto + { + public required Guid ProjectId { get; set; } + public Guid ExpensesTypeId { get; set; } + public Guid PaymentModeId { get; set; } + public DateTime TransactionDate { get; set; } = DateTime.Now; + public string? TransactionId { get; set; } + public required string Description { get; set; } + public string? Location { get; set; } + public string? GSTNumber { get; set; } + public required string SupplerName { get; set; } + public required double Amount { get; set; } + public int? NoOfPersons { get; set; } = 0; + public required Guid StatusId { get; set; } + public bool PreApproved { get; set; } = false; + public required List BillAttachments { get; set; } + } +} diff --git a/Marco.Pms.Model/Dtos/Master/ExpensesTypeMasterDto.cs b/Marco.Pms.Model/Dtos/Master/ExpensesTypeMasterDto.cs new file mode 100644 index 0000000..d8f204a --- /dev/null +++ b/Marco.Pms.Model/Dtos/Master/ExpensesTypeMasterDto.cs @@ -0,0 +1,10 @@ +namespace Marco.Pms.Model.Dtos.Master +{ + public class ExpensesTypeMasterDto + { + public Guid? Id { get; set; } + public required string Name { get; set; } + public required bool NoOfPersonsRequired { get; set; } + public string? Description { get; set; } + } +} diff --git a/Marco.Pms.Model/Entitlements/PermissionsMaster.cs b/Marco.Pms.Model/Entitlements/PermissionsMaster.cs index d0bef58..07ac1b5 100644 --- a/Marco.Pms.Model/Entitlements/PermissionsMaster.cs +++ b/Marco.Pms.Model/Entitlements/PermissionsMaster.cs @@ -23,6 +23,13 @@ public static readonly Guid SelfAttendance = Guid.Parse("ccb0589f-712b-43de-92ed-5b6088e7dc4e"); public static readonly Guid ViewMasters = Guid.Parse("5ffbafe0-7ab0-48b1-bb50-c1bf76b65f9d"); public static readonly Guid ManageMasters = Guid.Parse("588a8824-f924-4955-82d8-fc51956cf323"); + public static readonly Guid ExpenseViewSelf = Guid.Parse("385be49f-8fde-440e-bdbc-3dffeb8dd116"); + public static readonly Guid ExpenseViewAll = Guid.Parse("01e06444-9ca7-4df4-b900-8c3fa051b92f"); + public static readonly Guid ExpenseUpload = Guid.Parse("0f57885d-bcb2-4711-ac95-d841ace6d5a7"); + public static readonly Guid ExpenseReview = Guid.Parse("1f4bda08-1873-449a-bb66-3e8222bd871b"); + public static readonly Guid ExpenseApprove = Guid.Parse("eaafdd76-8aac-45f9-a530-315589c6deca"); + public static readonly Guid ExpenseProcess = Guid.Parse("ea5a1529-4ee8-4828-80ea-0e23c9d4dd11"); + public static readonly Guid ExpenseManage = Guid.Parse("bdee29a2-b73b-402d-8dd1-c4b1f81ccbc3"); } } diff --git a/Marco.Pms.Model/Expenses/BillAttachments.cs b/Marco.Pms.Model/Expenses/BillAttachments.cs new file mode 100644 index 0000000..5d62b09 --- /dev/null +++ b/Marco.Pms.Model/Expenses/BillAttachments.cs @@ -0,0 +1,22 @@ +using Marco.Pms.Model.DocumentManager; +using Marco.Pms.Model.Utilities; +using Microsoft.AspNetCore.Mvc.ModelBinding.Validation; +using System.ComponentModel.DataAnnotations.Schema; + +namespace Marco.Pms.Model.Expenses +{ + public class BillAttachments : TenantRelation + { + public Guid Id { get; set; } + public Guid ExpensesId { get; set; } + + [ValidateNever] + [ForeignKey("ExpensesId")] + public Expenses? Expenses { get; set; } + public Guid DocumentId { get; set; } + + [ValidateNever] + [ForeignKey("DocumentId")] + public Document? Document { get; set; } + } +} diff --git a/Marco.Pms.Model/Expenses/Expenses.cs b/Marco.Pms.Model/Expenses/Expenses.cs new file mode 100644 index 0000000..19e8333 --- /dev/null +++ b/Marco.Pms.Model/Expenses/Expenses.cs @@ -0,0 +1,49 @@ +using Marco.Pms.Model.Employees; +using Marco.Pms.Model.Master; +using Marco.Pms.Model.Projects; +using Marco.Pms.Model.Utilities; +using Microsoft.AspNetCore.Mvc.ModelBinding.Validation; +using System.ComponentModel.DataAnnotations.Schema; + +namespace Marco.Pms.Model.Expenses +{ + public class Expenses : TenantRelation + { + public Guid Id { get; set; } + public Guid ProjectId { get; set; } + + [ValidateNever] + [ForeignKey("ProjectId")] + public Project? Project { get; set; } + public Guid ExpensesTypeId { get; set; } + + [ValidateNever] + [ForeignKey("ExpensesTypeId")] + public ExpensesTypeMaster? ExpensesType { get; set; } + public Guid PaymentModeId { get; set; } + + [ValidateNever] + [ForeignKey("PaymentModeId")] + public PaymentModeMatser? PaymentMode { get; set; } + public Guid PaidById { get; set; } + + [ValidateNever] + [ForeignKey("PaidById")] + public Employee? PaidBy { get; set; } + public DateTime TransactionDate { get; set; } + public string? TransactionId { get; set; } + public string Description { get; set; } = string.Empty; + public string? Location { get; set; } + public string? GSTNumber { get; set; } + public string SupplerName { get; set; } = string.Empty; + public double Amount { get; set; } + public int? NoOfPersons { get; set; } + public Guid StatusId { get; set; } + + [ValidateNever] + [ForeignKey("StatusId")] + public ExpensesStatusMaster? Status { get; set; } + public bool PreApproved { get; set; } = false; + public bool IsActive { get; set; } = true; + } +} diff --git a/Marco.Pms.Model/Expenses/ExpensesReimburse.cs b/Marco.Pms.Model/Expenses/ExpensesReimburse.cs new file mode 100644 index 0000000..401ecda --- /dev/null +++ b/Marco.Pms.Model/Expenses/ExpensesReimburse.cs @@ -0,0 +1,20 @@ +using Marco.Pms.Model.Employees; +using Marco.Pms.Model.Utilities; +using Microsoft.AspNetCore.Mvc.ModelBinding.Validation; +using System.ComponentModel.DataAnnotations.Schema; + +namespace Marco.Pms.Model.Expenses +{ + public class ExpensesReimburse : TenantRelation + { + public Guid Id { get; set; } + public string ReimburseTransactionId { get; set; } = string.Empty; + public DateTime ReimburseDate { get; set; } + public Guid ReimburseById { get; set; } + + [ValidateNever] + [ForeignKey("ReimburseById")] + public Employee? ReimburseBy { get; set; } + public string ReimburseNote { get; set; } = string.Empty; + } +} diff --git a/Marco.Pms.Model/Expenses/ExpensesReimburseMapping.cs b/Marco.Pms.Model/Expenses/ExpensesReimburseMapping.cs new file mode 100644 index 0000000..c1c2be6 --- /dev/null +++ b/Marco.Pms.Model/Expenses/ExpensesReimburseMapping.cs @@ -0,0 +1,20 @@ +using Microsoft.AspNetCore.Mvc.ModelBinding.Validation; +using System.ComponentModel.DataAnnotations.Schema; + +namespace Marco.Pms.Model.Expenses +{ + public class ExpensesReimburseMapping + { + public Guid Id { get; set; } + public Guid ExpensesId { get; set; } + + [ValidateNever] + [ForeignKey("ExpensesId")] + public Expenses? Expenses { get; set; } + public Guid ExpensesReimburseId { get; set; } + + [ValidateNever] + [ForeignKey("ExpensesReimburseId")] + public ExpensesReimburse? ExpensesReimburse { get; set; } + } +} diff --git a/Marco.Pms.Model/Expenses/StatusMapping.cs b/Marco.Pms.Model/Expenses/StatusMapping.cs new file mode 100644 index 0000000..cc683a4 --- /dev/null +++ b/Marco.Pms.Model/Expenses/StatusMapping.cs @@ -0,0 +1,22 @@ +using Marco.Pms.Model.Master; +using Marco.Pms.Model.Utilities; +using Microsoft.AspNetCore.Mvc.ModelBinding.Validation; +using System.ComponentModel.DataAnnotations.Schema; + +namespace Marco.Pms.Model.Expenses +{ + public class StatusMapping : TenantRelation + { + public Guid Id { get; set; } + public Guid StatusId { get; set; } + + [ValidateNever] + [ForeignKey("ExpeStatusIdnsesId")] + public ExpensesStatusMaster? Status { get; set; } + public Guid NextStatusId { get; set; } + + [ValidateNever] + [ForeignKey("NextStatusId")] + public ExpensesStatusMaster? NextStatus { get; set; } + } +} diff --git a/Marco.Pms.Model/Expenses/StatusPermissionMapping.cs b/Marco.Pms.Model/Expenses/StatusPermissionMapping.cs new file mode 100644 index 0000000..2fe9334 --- /dev/null +++ b/Marco.Pms.Model/Expenses/StatusPermissionMapping.cs @@ -0,0 +1,22 @@ +using Marco.Pms.Model.Entitlements; +using Marco.Pms.Model.Master; +using Microsoft.AspNetCore.Mvc.ModelBinding.Validation; +using System.ComponentModel.DataAnnotations.Schema; + +namespace Marco.Pms.Model.Expenses +{ + public class StatusPermissionMapping + { + public Guid Id { get; set; } + public Guid StatusId { get; set; } + + [ValidateNever] + [ForeignKey("StatusId")] + public ExpensesStatusMaster? Status { get; set; } + public Guid PermissionId { get; set; } + + [ValidateNever] + [ForeignKey("PermissionId")] + public FeaturePermission? Permission { get; set; } + } +} diff --git a/Marco.Pms.Model/Master/ExpensesStatusMaster.cs b/Marco.Pms.Model/Master/ExpensesStatusMaster.cs new file mode 100644 index 0000000..dc2556a --- /dev/null +++ b/Marco.Pms.Model/Master/ExpensesStatusMaster.cs @@ -0,0 +1,13 @@ +using Marco.Pms.Model.Utilities; + +namespace Marco.Pms.Model.Master +{ + public class ExpensesStatusMaster : TenantRelation + { + public Guid Id { get; set; } + public string Name { get; set; } = string.Empty; + public string Description { get; set; } = string.Empty; + public bool IsSystem { get; set; } = false; + public bool IsActive { get; set; } = true; + } +} diff --git a/Marco.Pms.Model/Master/ExpensesTypeMaster.cs b/Marco.Pms.Model/Master/ExpensesTypeMaster.cs new file mode 100644 index 0000000..7e7d682 --- /dev/null +++ b/Marco.Pms.Model/Master/ExpensesTypeMaster.cs @@ -0,0 +1,13 @@ +using Marco.Pms.Model.Utilities; + +namespace Marco.Pms.Model.Master +{ + public class ExpensesTypeMaster : TenantRelation + { + public Guid Id { get; set; } + public string Name { get; set; } = string.Empty; + public bool NoOfPersonsRequired { get; set; } + public string Description { get; set; } = string.Empty; + public bool IsActive { get; set; } = true; + } +} diff --git a/Marco.Pms.Model/Master/PaymentModeMatser.cs b/Marco.Pms.Model/Master/PaymentModeMatser.cs new file mode 100644 index 0000000..e947c55 --- /dev/null +++ b/Marco.Pms.Model/Master/PaymentModeMatser.cs @@ -0,0 +1,12 @@ +using Marco.Pms.Model.Utilities; + +namespace Marco.Pms.Model.Master +{ + public class PaymentModeMatser : TenantRelation + { + public Guid Id { get; set; } + public string Name { get; set; } = string.Empty; + public string Description { get; set; } = string.Empty; + public bool IsActive { get; set; } = true; + } +}