Compare commits

..

No commits in common. "d4ba3d5341fd99bcfa54dd868f4321b0197481ec" and "fa5a8c178daaa2a93683fe40d455f66379df6823" have entirely different histories.

185 changed files with 14176 additions and 12427 deletions

View File

@ -1,15 +1,12 @@
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.DocumentManager;
using Marco.Pms.Model.Employees;
using Marco.Pms.Model.Entitlements;
using Marco.Pms.Model.Forum;
using Marco.Pms.Model.Master;
using Marco.Pms.Model.Industries;
using Marco.Pms.Model.Projects;
using Marco.Pms.Model.Roles;
using Marco.Pms.Model.Utilities;
using Marco.Pms.Utility;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Identity;
using Microsoft.AspNetCore.Identity.EntityFrameworkCore;
@ -60,7 +57,7 @@ namespace Marco.Pms.DataAccess.Data
public DbSet<Attendance> Attendes { get; set; }
public DbSet<AttendanceLog> AttendanceLogs { get; set; }
// public DbSet<AttendLog> AttendLogs { get; set; }
// public DbSet<AttendLog> AttendLogs { get; set; }
@ -75,21 +72,10 @@ namespace Marco.Pms.DataAccess.Data
public DbSet<JobRole> JobRoles { get; set; }
public DbSet<RolePermissionMappings> RolePermissionMappings { get; set; }
public DbSet<Industry> Industries { get; set; }
public DbSet<ActivityCheckList> ActivityCheckLists { get; set; }
public DbSet<Industry>Industries { get; set; }
public DbSet<ActivityCheckList>ActivityCheckLists { get; set; }
public DbSet<CheckListMappings> CheckListMappings { get; set; }
public DbSet<Inquiries> Inquiries { get; set; }
public DbSet<TicketForum> Tickets { get; set; }
public DbSet<TicketAttachment> TicketAttachments { get; set; }
public DbSet<TicketComment> TicketComments { get; set; }
public DbSet<TicketStatusMaster> TicketStatusMasters { get; set; }
public DbSet<TicketTypeMaster> TicketTypeMasters { get; set; }
public DbSet<TicketPriorityMaster> TicketPriorityMasters { get; set; }
public DbSet<TicketTagMaster> TicketTagMasters { get; set; }
public DbSet<Document> Documents { get; set; }
public DbSet<TicketTag> TicketTags { get; set; }
public DbSet<WorkCategoryMaster> WorkCategoryMasters { get; set; }
protected override void OnModelCreating(ModelBuilder modelBuilder)
{
@ -97,48 +83,48 @@ namespace Marco.Pms.DataAccess.Data
ManageApplicationStructure(modelBuilder);
//modelBuilder.Entity<ApplicationRole>().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 = "",
modelBuilder.Entity<ApplicationRole>().HasData(
new ApplicationRole
{
Id = new Guid("2c8d0808-c421-11ef-9b93-0242ac110002"),
Role = "Admin",
Description = "",
TenantId = 1
},
new ApplicationRole
{
Id = new Guid("62e0918d-c421-11ef-9b93-0242ac110002"),
Role = "Welder",
Description = "",
// TenantId = Guid.Parse("b3466e83-7e11-464c-b93a-daf047838b26")
// },
// new ApplicationRole
// {
// Id = new Guid("68823f1f-c421-11ef-9b93-0242ac110002"),
// Role = "Helper",
// Description = "",
TenantId = 1
},
new ApplicationRole
{
Id = new Guid("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 = 1
},
new ApplicationRole
{
Id = new Guid("6d3a7c72-c421-11ef-9b93-0242ac110002"),
Role = "Site Engineer",
Description = "",
// TenantId = Guid.Parse("b3466e83-7e11-464c-b93a-daf047838b26")
// }
// ,
// new ApplicationRole
// {
// Id = new Guid("6d3aad72-c421-11ef-9b93-0242ac110002"),
// Role = "Project Manager",
// Description = "",
TenantId = 1
}
,
new ApplicationRole
{
Id = new Guid("6d3aad72-c421-11ef-9b93-0242ac110002"),
Role = "Project Manager",
Description = "",
// TenantId = Guid.Parse("b3466e83-7e11-464c-b93a-daf047838b26")
// }
// );
TenantId = 1
}
);
modelBuilder.Entity<RefreshToken>(entity =>
{
@ -150,287 +136,165 @@ namespace Marco.Pms.DataAccess.Data
});
modelBuilder.Entity<Tenant>().HasData(
new Tenant { Id = Guid.Parse("b3466e83-7e11-464c-b93a-daf047838b26"), OragnizationSize = "100-200", Name = "MarcoBMS", ContactName = "Admin", ContactNumber = "123456789", Description = "", DomainName = "www.marcobms.org", IndustryId = Guid.Parse("15436ee3-a650-469e-bfc2-59993f7514bb"), OnBoardingDate = DateTime.MinValue }
);
new Tenant { Id = 1, Name = "MarcoBMS", ContactName = "Admin", ContactNumber = "123456789", Description = "", DomainName = "www.marcobms.org",IndustryId = 1, OnBoardingDate = DateTime.MinValue }
);
modelBuilder.Entity<StatusMaster>().HasData(
new StatusMaster
{
Id = new Guid("b74da4c2-d07e-46f2-9919-e75e49b12731"),
Id = 1,
Status = "Active",
TenantId = Guid.Parse("b3466e83-7e11-464c-b93a-daf047838b26")
TenantId = 1
},
new StatusMaster
{
Id = new Guid("603e994b-a27f-4e5d-a251-f3d69b0498ba"),
Id = 2,
Status = "In Progress",
TenantId = Guid.Parse("b3466e83-7e11-464c-b93a-daf047838b26")
TenantId = 1
},
new StatusMaster
{
Id = new Guid("ef1c356e-0fe0-42df-a5d3-8daee355492d"),
Id = 3,
Status = "On Hold",
TenantId = Guid.Parse("b3466e83-7e11-464c-b93a-daf047838b26")
TenantId = 1
},
new StatusMaster
{
Id = new Guid("33deaef9-9af1-4f2a-b443-681ea0d04f81"),
Id = 4,
Status = "Completed",
TenantId = Guid.Parse("b3466e83-7e11-464c-b93a-daf047838b26")
TenantId = 1
}
);
modelBuilder.Entity<Project>().HasData(
new Project
{
Id = new Guid("85bf587b-7ca9-4685-b77c-d817f5847e85"),
Id = 1,
Name = "Project 1",
ProjectAddress = "Project 1 Address",
ContactPerson = "Project 1 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("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")
//}
);
ProjectStatusId = 1,
TenantId = 1
}, new Project
{
Id = 2,
Name = "Project 2",
ProjectAddress = "Project 2 Address",
ContactPerson = "Project 2 Contact Person",
ProjectStatusId = 2,
TenantId = 1
}, new Project
{
Id = 3,
Name = "Project 3",
ProjectAddress = "Project 3 Address",
ContactPerson = "Project 3 Contact Person",
ProjectStatusId = 3,
TenantId = 1
});
var tenantId = _httpContextAccessor.HttpContext?.Items["TenantId"]?.ToString();
//modelBuilder.Entity<ActivityMaster>()
// .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<ActivityMaster>()
.HasData(
new ActivityMaster
{
Id = 1,
ActivityName = "Core Cutting",
UnitOfMeasurement = UnitOfMeasurement.Number.ToString(),
TenantId = 1
}, new ActivityMaster
{
Id = 2,
ActivityName = "Fabrication",
UnitOfMeasurement = UnitOfMeasurement.Meter.ToString(),
TenantId = 1
}, new ActivityMaster
{
Id = 3,
ActivityName = "Lifting",
UnitOfMeasurement = UnitOfMeasurement.Meter.ToString(),
TenantId = 1
}, new ActivityMaster
{
Id = 4,
ActivityName = "Hanging",
UnitOfMeasurement = UnitOfMeasurement.Meter.ToString(),
TenantId = 1
}, new ActivityMaster
{
Id = 5,
ActivityName = "Tapping",
UnitOfMeasurement = UnitOfMeasurement.Meter.ToString(),
TenantId = 1
}, new ActivityMaster
{
Id = 6,
ActivityName = "Welding",
UnitOfMeasurement = UnitOfMeasurement.Meter.ToString(),
TenantId = 1
}, new ActivityMaster
{
Id = 7,
ActivityName = "Testing",
UnitOfMeasurement = UnitOfMeasurement.Area.ToString(),
TenantId = 1
}, new ActivityMaster
{
Id = 8,
ActivityName = "Painting",
UnitOfMeasurement = UnitOfMeasurement.Meter.ToString(),
TenantId = 1
}, new ActivityMaster
{
Id = 9,
ActivityName = "Marking Area",
UnitOfMeasurement = UnitOfMeasurement.Meter.ToString(),
TenantId = 1
}, new ActivityMaster
{
Id = 10,
ActivityName = "Drilling",
UnitOfMeasurement = UnitOfMeasurement.Number.ToString(),
TenantId = 1
}, new ActivityMaster
{
Id = 11,
ActivityName = "MS Support Fabrication",
UnitOfMeasurement = UnitOfMeasurement.Number.ToString(),
TenantId = 1
}, new ActivityMaster
{
Id = 12,
ActivityName = "MS Support Hanging",
UnitOfMeasurement = UnitOfMeasurement.Number.ToString(),
TenantId = 1
}, new ActivityMaster
{
Id = 13,
ActivityName = "Hydrant Volve",
UnitOfMeasurement = UnitOfMeasurement.Number.ToString(),
TenantId = 1
}, new ActivityMaster
{
Id = 14,
ActivityName = "Sprinkler Installation",
UnitOfMeasurement = UnitOfMeasurement.Number.ToString(),
TenantId = 1
}
);
modelBuilder.Entity<Industry>().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" },
new Industry { Id = Guid.Parse("bdc61e3b-69ea-4394-bab6-079ec135b5bd"), Name = "Energy & Resources" },
new Industry { Id = Guid.Parse("5ca200ac-00d7-415e-a410-b948e27ac9d2"), Name = "Finance & Professional Services" },
new Industry { Id = Guid.Parse("d5621700-cd87-441f-8cdb-6051ddfc83b4"), Name = "Hospitals and Healthcare Services" },
new Industry { Id = Guid.Parse("23608891-657e-40f0-bbd4-2b0a2ec1a76f"), Name = "Social Services" },
new Industry { Id = Guid.Parse("a493f4e3-16b1-4411-be3c-6bf2987a3168"), Name = "Retail & Consumer Services" },
new Industry { Id = Guid.Parse("e9d8ce92-9371-4ed9-9831-83c07f78edec"), Name = "Transportation & Logistics" },
new Industry { Id = Guid.Parse("8a0d6134-2dbe-4e0a-b250-ff34cb7b9df0"), Name = "Education & Training" }
new Industry {Id = 1,Name = "Information Technology (IT) Services"},
new Industry { Id = 2,Name = "Manufacturing & Production" },
new Industry { Id = 3,Name = "Energy & Resources" },
new Industry { Id = 4,Name = "Finance & Professional Services" },
new Industry { Id = 5, Name = "Hospitals and Healthcare Services" },
new Industry { Id = 6, Name = "Social Services" },
new Industry { Id = 7, Name = "Retail & Consumer Services" },
new Industry { Id = 8, Name = "Transportation & Logistics" },
new Industry { Id = 9, Name = "Education & Training" }
);
modelBuilder.Entity<TicketStatusMaster>().HasData(
new TicketStatusMaster
{
Id = new Guid("6b0c409b-3e80-4165-8b39-f3fcacb4c797"),
Name = "New",
Description = "This is a newly created issue.",
ColorCode = "#FFCC99",
IsDefault = true,
TenantId = Guid.Parse("b3466e83-7e11-464c-b93a-daf047838b26")
},
new TicketStatusMaster
{
Id = new Guid("6c5ac37d-5b7d-40f3-adec-2dabaa5cca86"),
Name = "Assigned",
Description = "Assigned to employee or team of employees",
ColorCode = "#E6FF99",
IsDefault = true,
TenantId = Guid.Parse("b3466e83-7e11-464c-b93a-daf047838b26")
},
new TicketStatusMaster
{
Id = new Guid("7f96bcd5-0c66-411b-8a1d-9d1a4785194e"),
Name = "In Progress",
Description = "These issues are currently in progress",
ColorCode = "#99E6FF",
IsDefault = true,
TenantId = Guid.Parse("b3466e83-7e11-464c-b93a-daf047838b26")
},
new TicketStatusMaster
{
Id = new Guid("5c72b630-6923-4215-bf2c-b1622afd76e7"),
Name = "In Review",
Description = "These issues are currently under review",
ColorCode = "#6c757d",
IsDefault = true,
TenantId = Guid.Parse("b3466e83-7e11-464c-b93a-daf047838b26")
},
new TicketStatusMaster
{
Id = new Guid("8ff85685-a875-4f21-aa95-d99551315fcc"),
Name = "Done",
Description = "The following issues are resolved and closed",
ColorCode = "#B399FF",
IsDefault = true,
TenantId = Guid.Parse("b3466e83-7e11-464c-b93a-daf047838b26")
}
);
modelBuilder.Entity<TicketTypeMaster>().HasData(
new TicketTypeMaster
{
Id = new Guid("c74e5480-2b71-483c-8f4a-1a9c69c32603"),
Name = "Quality Issue",
Description = "An identified problem that affects the performance, reliability, or standards of a product or service",
IsDefault = true,
TenantId = Guid.Parse("b3466e83-7e11-464c-b93a-daf047838b26")
},
new TicketTypeMaster
{
Id = new Guid("d1f55eab-9898-4e46-9f03-b263e33e5d38"),
Name = "Help Desk",
Description = "A support service that assists users with technical issues, requests, or inquiries.",
IsDefault = true,
TenantId = Guid.Parse("b3466e83-7e11-464c-b93a-daf047838b26")
}
);
modelBuilder.Entity<TicketPriorityMaster>().HasData(
new TicketPriorityMaster
{
Id = new Guid("188d29b3-10f3-42d0-9587-1a46ae7a0320"),
Name = "Low",
ColorCode = "008000",
Level = 1,
IsDefault = true,
TenantId = Guid.Parse("b3466e83-7e11-464c-b93a-daf047838b26")
},
new TicketPriorityMaster
{
Id = new Guid("0919bc84-9f82-4ecf-98c7-962755dd9a97"),
Name = "Medium",
ColorCode = "FFFF00",
Level = 2,
IsDefault = true,
TenantId = Guid.Parse("b3466e83-7e11-464c-b93a-daf047838b26")
}, new TicketPriorityMaster
{
Id = new Guid("a13b7e59-16fd-4665-b5cf-a97399e8445a"),
Name = "High",
ColorCode = "#FFA500",
Level = 3,
IsDefault = true,
TenantId = Guid.Parse("b3466e83-7e11-464c-b93a-daf047838b26")
}, new TicketPriorityMaster
{
Id = new Guid("f340fbc3-c9fd-46aa-b063-0093418830e4"),
Name = "Critical",
ColorCode = "#FFA500",
Level = 4,
IsDefault = true,
TenantId = Guid.Parse("b3466e83-7e11-464c-b93a-daf047838b26")
},
new TicketPriorityMaster
{
Id = new Guid("44a7b91d-a0dd-45d1-8616-4d2f71e16401"),
Name = "Urgent",
ColorCode = "#FF0000",
Level = 5,
IsDefault = true,
TenantId = Guid.Parse("b3466e83-7e11-464c-b93a-daf047838b26")
}
);
modelBuilder.Entity<TicketTagMaster>().HasData(
new TicketTagMaster
{
Id = new Guid("ef6c2a65-f61d-4537-9650-a7ab7f8d98db"),
Name = "Quality Issue",
ColorCode = "#e59866",
IsDefault = true,
TenantId = Guid.Parse("b3466e83-7e11-464c-b93a-daf047838b26")
},
new TicketTagMaster
{
Id = new Guid("5a168569-8ad7-4422-8db6-51ef25caddeb"),
Name = "Help Desk",
ColorCode = "#85c1e9",
IsDefault = true,
TenantId = Guid.Parse("b3466e83-7e11-464c-b93a-daf047838b26")
}
);
modelBuilder.Entity<WorkCategoryMaster>().HasData(
new WorkCategoryMaster
{
Id = new Guid("86bb2cc8-f6b5-4fdd-bbee-c389c713a44b"),
Name = "Fresh Work",
Description = "Created new task in a professional or creative context",
IsSystem = true,
TenantId = Guid.Parse("b3466e83-7e11-464c-b93a-daf047838b26")
},
new WorkCategoryMaster
{
Id = new Guid("9ebfa19c-53b9-481b-b863-c25d2f843201"),
Name = "Rework",
Description = "Revising, modifying, or correcting a task to improve its quality or fix issues",
IsSystem = true,
TenantId = Guid.Parse("b3466e83-7e11-464c-b93a-daf047838b26")
},
new WorkCategoryMaster
{
Id = new Guid("11a79929-1d07-42dc-9e98-82d0d2f4a240"),
Name = "Quality Issue",
Description = "Any defect, deviation, or non-conformance in a task that fails to meet established standards or customer expectations.",
IsSystem = true,
TenantId = Guid.Parse("b3466e83-7e11-464c-b93a-daf047838b26")
}
);
}
private static void ManageApplicationStructure(ModelBuilder modelBuilder)
@ -459,19 +323,19 @@ namespace Marco.Pms.DataAccess.Data
modelBuilder.Entity<Module>().HasData(new Module
{
Id = new Guid("bf59fd88-b57a-4d67-bf01-3780f385896b"),
Id = 1,
Name = "Project",
Description = "Project Module",
Key = "b04da7e9-0406-409c-ac7f-b97256e6ea02"
}, new Module
{
Id = new Guid("2a231490-bcb1-4bdd-91f1-f25fb7f25b23"),
Id = 2,
Name = "Employee",
Description = "Employee Module",
Key = "0971c7fb-6ce1-458a-ae3f-8d3205893637"
}, new Module
{
Id = new Guid("c43db8c7-ab73-47f4-9d3b-f83e81357924"),
Id = 3,
Name = "Masters",
Description = "Masters Module",
Key = "504ec132-e6a9-422f-8f85-050602cfce05"
@ -480,23 +344,23 @@ namespace Marco.Pms.DataAccess.Data
modelBuilder.Entity<Feature>().HasData(
new Feature { Id = new Guid("53176ebf-c75d-42e5-839f-4508ffac3def"), Description = "Manage Project", Name = "Manage Project", ModuleId = new Guid("bf59fd88-b57a-4d67-bf01-3780f385896b"), IsActive = true },
new Feature { Id = new Guid("9666de86-d7c7-4d3d-acaa-fcd6d6b81f3c"), Description = "Manage Infra", Name = "Manage Infra", ModuleId = new Guid("bf59fd88-b57a-4d67-bf01-3780f385896b"), IsActive = true },
new Feature { Id = new Guid("53176ebf-c75d-42e5-839f-4508ffac3def"), Description = "Manage Project", Name = "Manage Project", ModuleId = 1, IsActive = true },
new Feature { Id = new Guid("9666de86-d7c7-4d3d-acaa-fcd6d6b81f3c"), Description = "Manage Infra", Name = "Manage Infra", ModuleId = 1, IsActive = true },
new Feature { Id = new Guid("9d4b5489-2079-40b9-bd77-6e1bf90bc19f"), Description = "Manage Tasks", Name = "Manage Tasks", ModuleId = new Guid("bf59fd88-b57a-4d67-bf01-3780f385896b"), IsActive = true },
new Feature { Id = new Guid("9d4b5489-2079-40b9-bd77-6e1bf90bc19f"), Description = "Manage Tasks", Name = "Manage Tasks", ModuleId = 1, IsActive = true },
new Feature { Id = new Guid("39e66f81-efc6-446c-95bd-46bff6cfb606"), Description = "Assign and Update Tasks Progress", Name = "Assign and Update Tasks Progress", ModuleId = new Guid("bf59fd88-b57a-4d67-bf01-3780f385896b"), IsActive = true },
new Feature { Id = new Guid("39e66f81-efc6-446c-95bd-46bff6cfb606"), Description = "Assign and Update Tasks Progress", Name = "Assign and Update Tasks Progress", ModuleId = 1, IsActive = true },
new Feature { Id = new Guid("81ab8a87-8ccd-4015-a917-0627cee6a100"), Description = "Manage Employee", Name = "Manage Employee", ModuleId = new Guid("2a231490-bcb1-4bdd-91f1-f25fb7f25b23"), IsActive = true },
new Feature { Id = new Guid("52c9cf54-1eb2-44d2-81bb-524cf29c0a94"), Description = "Attendance", Name = "Attendance", ModuleId = new Guid("2a231490-bcb1-4bdd-91f1-f25fb7f25b23"), IsActive = true },
new Feature { Id = new Guid("81ab8a87-8ccd-4015-a917-0627cee6a100"), Description = "Manage Employee", Name = "Manage Employee", ModuleId = 2, IsActive = true },
new Feature { Id = new Guid("52c9cf54-1eb2-44d2-81bb-524cf29c0a94"), Description = "Attendance", Name = "Attendance", ModuleId = 2, IsActive = true },
new Feature { Id = new Guid("be3b3afc-6ccf-4566-b9b6-aafcb65546be"), Description = "Global Masters", Name = "Global Masters", ModuleId = new Guid("c43db8c7-ab73-47f4-9d3b-f83e81357924"), IsActive = true },
new Feature { Id = new Guid("660131a4-788c-4739-a082-cbbf7879cbf2"), Description = "Tenant Masters", Name = "Tenant Masters", ModuleId = new Guid("c43db8c7-ab73-47f4-9d3b-f83e81357924"), IsActive = true }
new Feature { Id = new Guid("be3b3afc-6ccf-4566-b9b6-aafcb65546be"), Description = "Global Masters", Name = "Global Masters", ModuleId = 3, IsActive = true },
new Feature { Id = new Guid("660131a4-788c-4739-a082-cbbf7879cbf2"), Description = "Tenant Masters", Name = "Tenant Masters", ModuleId = 3, IsActive = true }
);
modelBuilder.Entity<FeaturePermission>().HasData(
new FeaturePermission { Id = new Guid("6ea44136-987e-44ba-9e5d-1cf8f5837ebc"), FeatureId = new Guid("53176ebf-c75d-42e5-839f-4508ffac3def"), IsEnabled = true, Name = "View Project", Description = "" },
new FeaturePermission { Id = new Guid("6ea44136-987e-44ba-9e5d-1cf8f5837ebc"), FeatureId = new Guid("53176ebf-c75d-42e5-839f-4508ffac3def"), IsEnabled = true, Name = "View Project" , Description=""},
new FeaturePermission { Id = new Guid("172fc9b6-755b-4f62-ab26-55c34a330614"), FeatureId = new Guid("53176ebf-c75d-42e5-839f-4508ffac3def"), IsEnabled = true, Name = "Manage Project", Description = "" },
new FeaturePermission { Id = new Guid("b94802ce-0689-4643-9e1d-11c86950c35b"), FeatureId = new Guid("53176ebf-c75d-42e5-839f-4508ffac3def"), IsEnabled = true, Name = "Manage Team", Description = "" },

View File

@ -1,7 +1,7 @@
using Marco.Pms.DataAccess.Data;
using Marco.Pms.Model.Employees;
using Marco.Pms.Model.Entitlements;
using Marco.Pms.Model.ViewModels.Projects;
using Marco.Pms.Model.ViewModels;
using Marco.Pms.Utility;
using Microsoft.AspNetCore.Identity;
using Microsoft.EntityFrameworkCore;
@ -34,10 +34,7 @@ namespace Marco.Pms.DataAccess.Initializer
_db.Database.Migrate();
}
}
catch (Exception ex)
{
Console.WriteLine(ex.ToString());
}
catch (Exception ex) { }
// Create roes if not created
@ -62,12 +59,12 @@ namespace Marco.Pms.DataAccess.Initializer
// State = "State",
// Postalcode = "1234567890",
// City = "City",
TenantId = Guid.Parse("b3466e83-7e11-464c-b93a-daf047838b26"),
TenantId = 1,
IsRootUser = true,
}, "User@123").GetAwaiter().GetResult();
ApplicationUser user = _db.ApplicationUsers.FirstOrDefault(u => u.Email == "admin@marcobms.com") ?? new ApplicationUser();
ApplicationUser user = _db.ApplicationUsers.FirstOrDefault(u => u.Email == "admin@marcobms.com");
_userManager.AddToRoleAsync(user, APP_ROLES.Admin.ToString()).GetAwaiter().GetResult();
Employee emp = new Employee()

View File

@ -12,6 +12,13 @@
<None Remove="Repository\**" />
</ItemGroup>
<ItemGroup>
<Compile Remove="Migrations\20240926175604_identitySetup.cs" />
<Compile Remove="Migrations\20240926175604_identitySetup.Designer.cs" />
<Compile Remove="Migrations\20240927100058_AddModels.cs" />
<Compile Remove="Migrations\20240927100058_AddModels.Designer.cs" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\Marco.Pms.Model\Marco.Pms.Model.csproj" />
<ProjectReference Include="..\Marco.Pms.Utility\Marco.Pms.Utility.csproj" />
@ -25,4 +32,8 @@
<PackageReference Include="Pomelo.EntityFrameworkCore.MySql" Version="7.0.0" />
</ItemGroup>
<ItemGroup>
<Folder Include="Migrations\" />
</ItemGroup>
</Project>

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,135 @@
using Microsoft.EntityFrameworkCore.Metadata;
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
#pragma warning disable CA1814 // Prefer jagged arrays over multidimensional
namespace Marco.Pms.DataAccess.Migrations
{
/// <inheritdoc />
public partial class Add_Industry_Table : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
//migrationBuilder.DropColumn(
// name: "Role",
// table: "AspNetUsers");
migrationBuilder.AddColumn<int>(
name: "IndustryId",
table: "Tenants",
type: "int",
nullable: true);
migrationBuilder.AddColumn<bool>(
name: "IsActive",
table: "Tenants",
type: "tinyint(1)",
nullable: false,
defaultValue: false);
migrationBuilder.AddColumn<string>(
name: "OragnizationSize",
table: "Tenants",
type: "longtext",
nullable: true)
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.AddColumn<bool>(
name: "IsActive",
table: "AspNetUsers",
type: "tinyint(1)",
nullable: true);
migrationBuilder.CreateTable(
name: "Industries",
columns: table => new
{
Id = table.Column<int>(type: "int", nullable: false)
.Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
Name = table.Column<string>(type: "longtext", nullable: false)
.Annotation("MySql:CharSet", "utf8mb4")
},
constraints: table =>
{
table.PrimaryKey("PK_Industries", x => x.Id);
})
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.InsertData(
table: "Industries",
columns: new[] { "Id", "Name" },
values: new object[,]
{
{ 1, "Information Technology (IT) Services" },
{ 2, "Manufacturing & Production" },
{ 3, "Energy & Resources" },
{ 4, "Finance & Professional Services" },
{ 5, "Hospitals and Healthcare Services" },
{ 6, "Social Services" },
{ 7, "Retail & Consumer Services" },
{ 8, "Transportation & Logistics" },
{ 9, "Education & Training" }
});
migrationBuilder.UpdateData(
table: "Tenants",
keyColumn: "Id",
keyValue: 1,
columns: new[] { "IndustryId", "IsActive", "OragnizationSize" },
values: new object[] { 1, true, null });
migrationBuilder.CreateIndex(
name: "IX_Tenants_IndustryId",
table: "Tenants",
column: "IndustryId");
migrationBuilder.AddForeignKey(
name: "FK_Tenants_Industries_IndustryId",
table: "Tenants",
column: "IndustryId",
principalTable: "Industries",
principalColumn: "Id");
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropForeignKey(
name: "FK_Tenants_Industries_IndustryId",
table: "Tenants");
migrationBuilder.DropTable(
name: "Industries");
migrationBuilder.DropIndex(
name: "IX_Tenants_IndustryId",
table: "Tenants");
migrationBuilder.DropColumn(
name: "IndustryId",
table: "Tenants");
migrationBuilder.DropColumn(
name: "IsActive",
table: "Tenants");
migrationBuilder.DropColumn(
name: "OragnizationSize",
table: "Tenants");
migrationBuilder.DropColumn(
name: "IsActive",
table: "AspNetUsers");
migrationBuilder.AddColumn<string>(
name: "Role",
table: "AspNetUsers",
type: "longtext",
nullable: true)
.Annotation("MySql:CharSet", "utf8mb4");
}
}
}

View File

@ -0,0 +1,543 @@
using System;
using Microsoft.EntityFrameworkCore.Metadata;
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace Marco.Pms.DataAccess.Migrations
{
/// <inheritdoc />
public partial class TaskAllocationModels : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropForeignKey(
name: "FK_ActivityMasters_TaskAllocations_TaskAllocationId",
table: "ActivityMasters");
migrationBuilder.DropForeignKey(
name: "FK_TaskAllocations_Buildings_BuildingId",
table: "TaskAllocations");
migrationBuilder.DropForeignKey(
name: "FK_TaskAllocations_Employees_EmployeeId",
table: "TaskAllocations");
migrationBuilder.DropForeignKey(
name: "FK_TaskAllocations_Projects_ProjectId",
table: "TaskAllocations");
migrationBuilder.DropForeignKey(
name: "FK_TaskAllocations_WorkAreas_WorkAreaId",
table: "TaskAllocations");
migrationBuilder.DropIndex(
name: "IX_TaskAllocations_BuildingId",
table: "TaskAllocations");
migrationBuilder.DropIndex(
name: "IX_TaskAllocations_EmployeeId",
table: "TaskAllocations");
migrationBuilder.DropIndex(
name: "IX_ActivityMasters_TaskAllocationId",
table: "ActivityMasters");
migrationBuilder.DropColumn(
name: "BuildingId",
table: "TaskAllocations");
migrationBuilder.DropColumn(
name: "EmployeeId",
table: "TaskAllocations");
migrationBuilder.DropColumn(
name: "TaskAllocationId",
table: "ActivityMasters");
migrationBuilder.RenameColumn(
name: "WorkAreaId",
table: "TaskAllocations",
newName: "WorkItemMappingId");
migrationBuilder.RenameColumn(
name: "ReAllocationDate",
table: "TaskAllocations",
newName: "ReportedDate");
migrationBuilder.RenameColumn(
name: "ProjectId",
table: "TaskAllocations",
newName: "WorkItemId");
migrationBuilder.RenameColumn(
name: "EmployeeRole",
table: "TaskAllocations",
newName: "AssignedBy");
migrationBuilder.RenameColumn(
name: "AllocationDate",
table: "TaskAllocations",
newName: "AssignmentDate");
migrationBuilder.RenameIndex(
name: "IX_TaskAllocations_WorkAreaId",
table: "TaskAllocations",
newName: "IX_TaskAllocations_WorkItemMappingId");
migrationBuilder.RenameIndex(
name: "IX_TaskAllocations_ProjectId",
table: "TaskAllocations",
newName: "IX_TaskAllocations_WorkItemId");
migrationBuilder.AlterColumn<double>(
name: "PlannedWork",
table: "WorkItems",
type: "double",
nullable: false,
oldClrType: typeof(int),
oldType: "int");
migrationBuilder.AlterColumn<double>(
name: "CompletedWork",
table: "WorkItems",
type: "double",
nullable: false,
oldClrType: typeof(int),
oldType: "int");
migrationBuilder.AlterColumn<long>(
name: "Id",
table: "TaskAllocations",
type: "bigint",
nullable: false,
oldClrType: typeof(int),
oldType: "int")
.Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn)
.OldAnnotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn);
migrationBuilder.AddColumn<double>(
name: "CompletedTask",
table: "TaskAllocations",
type: "double",
nullable: false,
defaultValue: 0.0);
migrationBuilder.AddColumn<string>(
name: "Description",
table: "TaskAllocations",
type: "longtext",
nullable: false)
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.AddColumn<double>(
name: "PlannedTask",
table: "TaskAllocations",
type: "double",
nullable: false,
defaultValue: 0.0);
migrationBuilder.CreateTable(
name: "TaskComments",
columns: table => new
{
Id = table.Column<long>(type: "bigint", nullable: false)
.Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
TaskAllocationId = table.Column<long>(type: "bigint", nullable: false),
CommentDate = table.Column<DateTime>(type: "datetime(6)", nullable: false),
Comment = table.Column<string>(type: "longtext", nullable: false)
.Annotation("MySql:CharSet", "utf8mb4"),
CommentedBy = table.Column<int>(type: "int", nullable: false),
TenantId = table.Column<int>(type: "int", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_TaskComments", x => x.Id);
table.ForeignKey(
name: "FK_TaskComments_Employees_CommentedBy",
column: x => x.CommentedBy,
principalTable: "Employees",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
table.ForeignKey(
name: "FK_TaskComments_TaskAllocations_TaskAllocationId",
column: x => x.TaskAllocationId,
principalTable: "TaskAllocations",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
table.ForeignKey(
name: "FK_TaskComments_Tenants_TenantId",
column: x => x.TenantId,
principalTable: "Tenants",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
})
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.CreateTable(
name: "TaskMembers",
columns: table => new
{
Id = table.Column<long>(type: "bigint", nullable: false)
.Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
TaskAllocationId = table.Column<long>(type: "bigint", nullable: false),
EmployeeId = table.Column<int>(type: "int", nullable: false),
TenantId = table.Column<int>(type: "int", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_TaskMembers", x => x.Id);
table.ForeignKey(
name: "FK_TaskMembers_Employees_EmployeeId",
column: x => x.EmployeeId,
principalTable: "Employees",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
table.ForeignKey(
name: "FK_TaskMembers_TaskAllocations_TaskAllocationId",
column: x => x.TaskAllocationId,
principalTable: "TaskAllocations",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
table.ForeignKey(
name: "FK_TaskMembers_Tenants_TenantId",
column: x => x.TenantId,
principalTable: "Tenants",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
})
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.CreateIndex(
name: "IX_TaskAllocations_AssignedBy",
table: "TaskAllocations",
column: "AssignedBy");
migrationBuilder.CreateIndex(
name: "IX_TaskComments_CommentedBy",
table: "TaskComments",
column: "CommentedBy");
migrationBuilder.CreateIndex(
name: "IX_TaskComments_TaskAllocationId",
table: "TaskComments",
column: "TaskAllocationId");
migrationBuilder.CreateIndex(
name: "IX_TaskComments_TenantId",
table: "TaskComments",
column: "TenantId");
migrationBuilder.CreateIndex(
name: "IX_TaskMembers_EmployeeId",
table: "TaskMembers",
column: "EmployeeId");
migrationBuilder.CreateIndex(
name: "IX_TaskMembers_TaskAllocationId",
table: "TaskMembers",
column: "TaskAllocationId");
migrationBuilder.CreateIndex(
name: "IX_TaskMembers_TenantId",
table: "TaskMembers",
column: "TenantId");
migrationBuilder.AddForeignKey(
name: "FK_TaskAllocations_Employees_AssignedBy",
table: "TaskAllocations",
column: "AssignedBy",
principalTable: "Employees",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
migrationBuilder.AddForeignKey(
name: "FK_TaskAllocations_WorkItemMapping_WorkItemMappingId",
table: "TaskAllocations",
column: "WorkItemMappingId",
principalTable: "WorkItemMapping",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
migrationBuilder.AddForeignKey(
name: "FK_TaskAllocations_WorkItems_WorkItemId",
table: "TaskAllocations",
column: "WorkItemId",
principalTable: "WorkItems",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropForeignKey(
name: "FK_TaskAllocations_Employees_AssignedBy",
table: "TaskAllocations");
migrationBuilder.DropForeignKey(
name: "FK_TaskAllocations_WorkItemMapping_WorkItemMappingId",
table: "TaskAllocations");
migrationBuilder.DropForeignKey(
name: "FK_TaskAllocations_WorkItems_WorkItemId",
table: "TaskAllocations");
migrationBuilder.DropTable(
name: "TaskComments");
migrationBuilder.DropTable(
name: "TaskMembers");
migrationBuilder.DropIndex(
name: "IX_TaskAllocations_AssignedBy",
table: "TaskAllocations");
migrationBuilder.DropColumn(
name: "CompletedTask",
table: "TaskAllocations");
migrationBuilder.DropColumn(
name: "Description",
table: "TaskAllocations");
migrationBuilder.DropColumn(
name: "PlannedTask",
table: "TaskAllocations");
migrationBuilder.RenameColumn(
name: "WorkItemMappingId",
table: "TaskAllocations",
newName: "WorkAreaId");
migrationBuilder.RenameColumn(
name: "WorkItemId",
table: "TaskAllocations",
newName: "ProjectId");
migrationBuilder.RenameColumn(
name: "ReportedDate",
table: "TaskAllocations",
newName: "ReAllocationDate");
migrationBuilder.RenameColumn(
name: "AssignmentDate",
table: "TaskAllocations",
newName: "AllocationDate");
migrationBuilder.RenameColumn(
name: "AssignedBy",
table: "TaskAllocations",
newName: "EmployeeRole");
migrationBuilder.RenameIndex(
name: "IX_TaskAllocations_WorkItemMappingId",
table: "TaskAllocations",
newName: "IX_TaskAllocations_WorkAreaId");
migrationBuilder.RenameIndex(
name: "IX_TaskAllocations_WorkItemId",
table: "TaskAllocations",
newName: "IX_TaskAllocations_ProjectId");
migrationBuilder.AlterColumn<int>(
name: "PlannedWork",
table: "WorkItems",
type: "int",
nullable: false,
oldClrType: typeof(double),
oldType: "double");
migrationBuilder.AlterColumn<int>(
name: "CompletedWork",
table: "WorkItems",
type: "int",
nullable: false,
oldClrType: typeof(double),
oldType: "double");
migrationBuilder.AlterColumn<int>(
name: "Id",
table: "TaskAllocations",
type: "int",
nullable: false,
oldClrType: typeof(long),
oldType: "bigint")
.Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn)
.OldAnnotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn);
migrationBuilder.AddColumn<int>(
name: "BuildingId",
table: "TaskAllocations",
type: "int",
nullable: false,
defaultValue: 0);
migrationBuilder.AddColumn<int>(
name: "EmployeeId",
table: "TaskAllocations",
type: "int",
nullable: false,
defaultValue: 0);
migrationBuilder.AddColumn<int>(
name: "TaskAllocationId",
table: "ActivityMasters",
type: "int",
nullable: true);
migrationBuilder.UpdateData(
table: "ActivityMasters",
keyColumn: "Id",
keyValue: 1,
column: "TaskAllocationId",
value: null);
migrationBuilder.UpdateData(
table: "ActivityMasters",
keyColumn: "Id",
keyValue: 2,
column: "TaskAllocationId",
value: null);
migrationBuilder.UpdateData(
table: "ActivityMasters",
keyColumn: "Id",
keyValue: 3,
column: "TaskAllocationId",
value: null);
migrationBuilder.UpdateData(
table: "ActivityMasters",
keyColumn: "Id",
keyValue: 4,
column: "TaskAllocationId",
value: null);
migrationBuilder.UpdateData(
table: "ActivityMasters",
keyColumn: "Id",
keyValue: 5,
column: "TaskAllocationId",
value: null);
migrationBuilder.UpdateData(
table: "ActivityMasters",
keyColumn: "Id",
keyValue: 6,
column: "TaskAllocationId",
value: null);
migrationBuilder.UpdateData(
table: "ActivityMasters",
keyColumn: "Id",
keyValue: 7,
column: "TaskAllocationId",
value: null);
migrationBuilder.UpdateData(
table: "ActivityMasters",
keyColumn: "Id",
keyValue: 8,
column: "TaskAllocationId",
value: null);
migrationBuilder.UpdateData(
table: "ActivityMasters",
keyColumn: "Id",
keyValue: 9,
column: "TaskAllocationId",
value: null);
migrationBuilder.UpdateData(
table: "ActivityMasters",
keyColumn: "Id",
keyValue: 10,
column: "TaskAllocationId",
value: null);
migrationBuilder.UpdateData(
table: "ActivityMasters",
keyColumn: "Id",
keyValue: 11,
column: "TaskAllocationId",
value: null);
migrationBuilder.UpdateData(
table: "ActivityMasters",
keyColumn: "Id",
keyValue: 12,
column: "TaskAllocationId",
value: null);
migrationBuilder.UpdateData(
table: "ActivityMasters",
keyColumn: "Id",
keyValue: 13,
column: "TaskAllocationId",
value: null);
migrationBuilder.UpdateData(
table: "ActivityMasters",
keyColumn: "Id",
keyValue: 14,
column: "TaskAllocationId",
value: null);
migrationBuilder.CreateIndex(
name: "IX_TaskAllocations_BuildingId",
table: "TaskAllocations",
column: "BuildingId");
migrationBuilder.CreateIndex(
name: "IX_TaskAllocations_EmployeeId",
table: "TaskAllocations",
column: "EmployeeId");
migrationBuilder.CreateIndex(
name: "IX_ActivityMasters_TaskAllocationId",
table: "ActivityMasters",
column: "TaskAllocationId");
migrationBuilder.AddForeignKey(
name: "FK_ActivityMasters_TaskAllocations_TaskAllocationId",
table: "ActivityMasters",
column: "TaskAllocationId",
principalTable: "TaskAllocations",
principalColumn: "Id");
migrationBuilder.AddForeignKey(
name: "FK_TaskAllocations_Buildings_BuildingId",
table: "TaskAllocations",
column: "BuildingId",
principalTable: "Buildings",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
migrationBuilder.AddForeignKey(
name: "FK_TaskAllocations_Employees_EmployeeId",
table: "TaskAllocations",
column: "EmployeeId",
principalTable: "Employees",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
migrationBuilder.AddForeignKey(
name: "FK_TaskAllocations_Projects_ProjectId",
table: "TaskAllocations",
column: "ProjectId",
principalTable: "Projects",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
migrationBuilder.AddForeignKey(
name: "FK_TaskAllocations_WorkAreas_WorkAreaId",
table: "TaskAllocations",
column: "WorkAreaId",
principalTable: "WorkAreas",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
}
}
}

View File

@ -0,0 +1,37 @@
using System;
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace Marco.Pms.DataAccess.Migrations
{
/// <inheritdoc />
public partial class Make_ReportDate_Nullable : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AlterColumn<DateTime>(
name: "ReportedDate",
table: "TaskAllocations",
type: "datetime(6)",
nullable: true,
oldClrType: typeof(DateTime),
oldType: "datetime(6)");
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.AlterColumn<DateTime>(
name: "ReportedDate",
table: "TaskAllocations",
type: "datetime(6)",
nullable: false,
defaultValue: new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified),
oldClrType: typeof(DateTime),
oldType: "datetime(6)",
oldNullable: true);
}
}
}

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,131 @@
using Microsoft.EntityFrameworkCore.Metadata;
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace Marco.Pms.DataAccess.Migrations
{
/// <inheritdoc />
public partial class Removed_WorkItemMapping : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropForeignKey(
name: "FK_TaskAllocations_WorkItemMapping_WorkItemMappingId",
table: "TaskAllocations");
migrationBuilder.DropTable(
name: "WorkItemMapping");
migrationBuilder.DropIndex(
name: "IX_TaskAllocations_WorkItemMappingId",
table: "TaskAllocations");
migrationBuilder.DropColumn(
name: "WorkItemMappingId",
table: "TaskAllocations");
migrationBuilder.AlterColumn<string>(
name: "Description",
table: "TaskAllocations",
type: "longtext",
nullable: true,
oldClrType: typeof(string),
oldType: "longtext")
.Annotation("MySql:CharSet", "utf8mb4")
.OldAnnotation("MySql:CharSet", "utf8mb4");
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.UpdateData(
table: "TaskAllocations",
keyColumn: "Description",
keyValue: null,
column: "Description",
value: "");
migrationBuilder.AlterColumn<string>(
name: "Description",
table: "TaskAllocations",
type: "longtext",
nullable: false,
oldClrType: typeof(string),
oldType: "longtext",
oldNullable: true)
.Annotation("MySql:CharSet", "utf8mb4")
.OldAnnotation("MySql:CharSet", "utf8mb4");
migrationBuilder.AddColumn<int>(
name: "WorkItemMappingId",
table: "TaskAllocations",
type: "int",
nullable: false,
defaultValue: 0);
migrationBuilder.CreateTable(
name: "WorkItemMapping",
columns: table => new
{
Id = table.Column<int>(type: "int", nullable: false)
.Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
TenantId = table.Column<int>(type: "int", nullable: false),
WorkAreaId = table.Column<int>(type: "int", nullable: false),
WorkItemId = table.Column<int>(type: "int", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_WorkItemMapping", x => x.Id);
table.ForeignKey(
name: "FK_WorkItemMapping_Tenants_TenantId",
column: x => x.TenantId,
principalTable: "Tenants",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
table.ForeignKey(
name: "FK_WorkItemMapping_WorkAreas_WorkAreaId",
column: x => x.WorkAreaId,
principalTable: "WorkAreas",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
table.ForeignKey(
name: "FK_WorkItemMapping_WorkItems_WorkItemId",
column: x => x.WorkItemId,
principalTable: "WorkItems",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
})
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.CreateIndex(
name: "IX_TaskAllocations_WorkItemMappingId",
table: "TaskAllocations",
column: "WorkItemMappingId");
migrationBuilder.CreateIndex(
name: "IX_WorkItemMapping_TenantId",
table: "WorkItemMapping",
column: "TenantId");
migrationBuilder.CreateIndex(
name: "IX_WorkItemMapping_WorkAreaId",
table: "WorkItemMapping",
column: "WorkAreaId");
migrationBuilder.CreateIndex(
name: "IX_WorkItemMapping_WorkItemId",
table: "WorkItemMapping",
column: "WorkItemId");
migrationBuilder.AddForeignKey(
name: "FK_TaskAllocations_WorkItemMapping_WorkItemMappingId",
table: "TaskAllocations",
column: "WorkItemMappingId",
principalTable: "WorkItemMapping",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
}
}
}

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,984 @@
using Microsoft.EntityFrameworkCore.Metadata;
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace Marco.Pms.DataAccess.Migrations
{
/// <inheritdoc />
public partial class Added_Check_List_Table : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropColumn(
name: "PeramnentAddress",
table: "Employees");
migrationBuilder.AlterColumn<string>(
name: "Name",
table: "WorkShifts",
type: "longtext",
nullable: true,
oldClrType: typeof(string),
oldType: "longtext")
.Annotation("MySql:CharSet", "utf8mb4")
.OldAnnotation("MySql:CharSet", "utf8mb4");
migrationBuilder.AlterColumn<string>(
name: "Name",
table: "Tenants",
type: "longtext",
nullable: true,
oldClrType: typeof(string),
oldType: "longtext")
.Annotation("MySql:CharSet", "utf8mb4")
.OldAnnotation("MySql:CharSet", "utf8mb4");
migrationBuilder.AlterColumn<string>(
name: "DomainName",
table: "Tenants",
type: "longtext",
nullable: true,
oldClrType: typeof(string),
oldType: "longtext")
.Annotation("MySql:CharSet", "utf8mb4")
.OldAnnotation("MySql:CharSet", "utf8mb4");
migrationBuilder.AlterColumn<string>(
name: "Description",
table: "Tenants",
type: "longtext",
nullable: true,
oldClrType: typeof(string),
oldType: "longtext")
.Annotation("MySql:CharSet", "utf8mb4")
.OldAnnotation("MySql:CharSet", "utf8mb4");
migrationBuilder.AlterColumn<string>(
name: "ContactNumber",
table: "Tenants",
type: "longtext",
nullable: true,
oldClrType: typeof(string),
oldType: "longtext")
.Annotation("MySql:CharSet", "utf8mb4")
.OldAnnotation("MySql:CharSet", "utf8mb4");
migrationBuilder.AlterColumn<string>(
name: "ContactName",
table: "Tenants",
type: "longtext",
nullable: true,
oldClrType: typeof(string),
oldType: "longtext")
.Annotation("MySql:CharSet", "utf8mb4")
.OldAnnotation("MySql:CharSet", "utf8mb4");
migrationBuilder.AlterColumn<string>(
name: "Status",
table: "StatusMasters",
type: "longtext",
nullable: true,
oldClrType: typeof(string),
oldType: "longtext")
.Annotation("MySql:CharSet", "utf8mb4")
.OldAnnotation("MySql:CharSet", "utf8mb4");
migrationBuilder.AlterColumn<string>(
name: "UserId",
table: "RefreshTokens",
type: "varchar(255)",
nullable: true,
oldClrType: typeof(string),
oldType: "varchar(255)")
.Annotation("MySql:CharSet", "utf8mb4")
.OldAnnotation("MySql:CharSet", "utf8mb4");
migrationBuilder.AlterColumn<string>(
name: "Token",
table: "RefreshTokens",
type: "longtext",
nullable: true,
oldClrType: typeof(string),
oldType: "longtext")
.Annotation("MySql:CharSet", "utf8mb4")
.OldAnnotation("MySql:CharSet", "utf8mb4");
migrationBuilder.AlterColumn<string>(
name: "ProjectAddress",
table: "Projects",
type: "longtext",
nullable: true,
oldClrType: typeof(string),
oldType: "longtext")
.Annotation("MySql:CharSet", "utf8mb4")
.OldAnnotation("MySql:CharSet", "utf8mb4");
migrationBuilder.AlterColumn<string>(
name: "ContactPerson",
table: "Projects",
type: "longtext",
nullable: true,
oldClrType: typeof(string),
oldType: "longtext")
.Annotation("MySql:CharSet", "utf8mb4")
.OldAnnotation("MySql:CharSet", "utf8mb4");
migrationBuilder.AlterColumn<string>(
name: "Description",
table: "Modules",
type: "longtext",
nullable: true,
oldClrType: typeof(string),
oldType: "longtext")
.Annotation("MySql:CharSet", "utf8mb4")
.OldAnnotation("MySql:CharSet", "utf8mb4");
migrationBuilder.AlterColumn<string>(
name: "Name",
table: "JobRoles",
type: "longtext",
nullable: true,
oldClrType: typeof(string),
oldType: "longtext")
.Annotation("MySql:CharSet", "utf8mb4")
.OldAnnotation("MySql:CharSet", "utf8mb4");
migrationBuilder.AlterColumn<string>(
name: "Name",
table: "Industries",
type: "longtext",
nullable: true,
oldClrType: typeof(string),
oldType: "longtext")
.Annotation("MySql:CharSet", "utf8mb4")
.OldAnnotation("MySql:CharSet", "utf8mb4");
migrationBuilder.AlterColumn<string>(
name: "Name",
table: "Features",
type: "longtext",
nullable: true,
oldClrType: typeof(string),
oldType: "longtext")
.Annotation("MySql:CharSet", "utf8mb4")
.OldAnnotation("MySql:CharSet", "utf8mb4");
migrationBuilder.AlterColumn<string>(
name: "Description",
table: "Features",
type: "longtext",
nullable: true,
oldClrType: typeof(string),
oldType: "longtext")
.Annotation("MySql:CharSet", "utf8mb4")
.OldAnnotation("MySql:CharSet", "utf8mb4");
migrationBuilder.AlterColumn<string>(
name: "Name",
table: "FeaturePermissions",
type: "longtext",
nullable: true,
oldClrType: typeof(string),
oldType: "longtext")
.Annotation("MySql:CharSet", "utf8mb4")
.OldAnnotation("MySql:CharSet", "utf8mb4");
migrationBuilder.AlterColumn<string>(
name: "Description",
table: "FeaturePermissions",
type: "longtext",
nullable: true,
oldClrType: typeof(string),
oldType: "longtext")
.Annotation("MySql:CharSet", "utf8mb4")
.OldAnnotation("MySql:CharSet", "utf8mb4");
migrationBuilder.AlterColumn<string>(
name: "PhoneNumber",
table: "Employees",
type: "longtext",
nullable: true,
oldClrType: typeof(string),
oldType: "longtext")
.Annotation("MySql:CharSet", "utf8mb4")
.OldAnnotation("MySql:CharSet", "utf8mb4");
migrationBuilder.AlterColumn<string>(
name: "LastName",
table: "Employees",
type: "longtext",
nullable: true,
oldClrType: typeof(string),
oldType: "longtext")
.Annotation("MySql:CharSet", "utf8mb4")
.OldAnnotation("MySql:CharSet", "utf8mb4");
migrationBuilder.AlterColumn<string>(
name: "Gender",
table: "Employees",
type: "longtext",
nullable: true,
oldClrType: typeof(string),
oldType: "longtext")
.Annotation("MySql:CharSet", "utf8mb4")
.OldAnnotation("MySql:CharSet", "utf8mb4");
migrationBuilder.AlterColumn<string>(
name: "FirstName",
table: "Employees",
type: "longtext",
nullable: true,
oldClrType: typeof(string),
oldType: "longtext")
.Annotation("MySql:CharSet", "utf8mb4")
.OldAnnotation("MySql:CharSet", "utf8mb4");
migrationBuilder.AlterColumn<string>(
name: "EmergencyPhoneNumber",
table: "Employees",
type: "longtext",
nullable: true,
oldClrType: typeof(string),
oldType: "longtext")
.Annotation("MySql:CharSet", "utf8mb4")
.OldAnnotation("MySql:CharSet", "utf8mb4");
migrationBuilder.AlterColumn<string>(
name: "EmergencyContactPerson",
table: "Employees",
type: "longtext",
nullable: true,
oldClrType: typeof(string),
oldType: "longtext")
.Annotation("MySql:CharSet", "utf8mb4")
.OldAnnotation("MySql:CharSet", "utf8mb4");
migrationBuilder.AlterColumn<string>(
name: "CurrentAddress",
table: "Employees",
type: "longtext",
nullable: true,
oldClrType: typeof(string),
oldType: "longtext")
.Annotation("MySql:CharSet", "utf8mb4")
.OldAnnotation("MySql:CharSet", "utf8mb4");
migrationBuilder.AddColumn<string>(
name: "PermanentAddress",
table: "Employees",
type: "longtext",
nullable: true)
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.AlterColumn<string>(
name: "Role",
table: "ApplicationRoles",
type: "longtext",
nullable: true,
oldClrType: typeof(string),
oldType: "longtext")
.Annotation("MySql:CharSet", "utf8mb4")
.OldAnnotation("MySql:CharSet", "utf8mb4");
migrationBuilder.AlterColumn<string>(
name: "Description",
table: "ApplicationRoles",
type: "longtext",
nullable: true,
oldClrType: typeof(string),
oldType: "longtext")
.Annotation("MySql:CharSet", "utf8mb4")
.OldAnnotation("MySql:CharSet", "utf8mb4");
migrationBuilder.AlterColumn<string>(
name: "UnitOfMeasurement",
table: "ActivityMasters",
type: "longtext",
nullable: true,
oldClrType: typeof(string),
oldType: "longtext")
.Annotation("MySql:CharSet", "utf8mb4")
.OldAnnotation("MySql:CharSet", "utf8mb4");
migrationBuilder.AlterColumn<string>(
name: "ActivityName",
table: "ActivityMasters",
type: "longtext",
nullable: true,
oldClrType: typeof(string),
oldType: "longtext")
.Annotation("MySql:CharSet", "utf8mb4")
.OldAnnotation("MySql:CharSet", "utf8mb4");
migrationBuilder.AddColumn<bool>(
name: "IsActive",
table: "ActivityMasters",
type: "tinyint(1)",
nullable: false,
defaultValue: false);
migrationBuilder.CreateTable(
name: "ActivityCheckLists",
columns: table => new
{
Id = table.Column<int>(type: "int", nullable: false)
.Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
ActivityId = table.Column<int>(type: "int", nullable: false),
Description = table.Column<string>(type: "longtext", nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
IsChecked = table.Column<bool>(type: "tinyint(1)", nullable: false),
IsMandatory = table.Column<bool>(type: "tinyint(1)", nullable: false),
TenantId = table.Column<int>(type: "int", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_ActivityCheckLists", x => x.Id);
})
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.UpdateData(
table: "ActivityMasters",
keyColumn: "Id",
keyValue: 1,
column: "IsActive",
value: true);
migrationBuilder.UpdateData(
table: "ActivityMasters",
keyColumn: "Id",
keyValue: 2,
column: "IsActive",
value: true);
migrationBuilder.UpdateData(
table: "ActivityMasters",
keyColumn: "Id",
keyValue: 3,
column: "IsActive",
value: true);
migrationBuilder.UpdateData(
table: "ActivityMasters",
keyColumn: "Id",
keyValue: 4,
column: "IsActive",
value: true);
migrationBuilder.UpdateData(
table: "ActivityMasters",
keyColumn: "Id",
keyValue: 5,
column: "IsActive",
value: true);
migrationBuilder.UpdateData(
table: "ActivityMasters",
keyColumn: "Id",
keyValue: 6,
column: "IsActive",
value: true);
migrationBuilder.UpdateData(
table: "ActivityMasters",
keyColumn: "Id",
keyValue: 7,
column: "IsActive",
value: true);
migrationBuilder.UpdateData(
table: "ActivityMasters",
keyColumn: "Id",
keyValue: 8,
column: "IsActive",
value: true);
migrationBuilder.UpdateData(
table: "ActivityMasters",
keyColumn: "Id",
keyValue: 9,
column: "IsActive",
value: true);
migrationBuilder.UpdateData(
table: "ActivityMasters",
keyColumn: "Id",
keyValue: 10,
column: "IsActive",
value: true);
migrationBuilder.UpdateData(
table: "ActivityMasters",
keyColumn: "Id",
keyValue: 11,
column: "IsActive",
value: true);
migrationBuilder.UpdateData(
table: "ActivityMasters",
keyColumn: "Id",
keyValue: 12,
column: "IsActive",
value: true);
migrationBuilder.UpdateData(
table: "ActivityMasters",
keyColumn: "Id",
keyValue: 13,
column: "IsActive",
value: true);
migrationBuilder.UpdateData(
table: "ActivityMasters",
keyColumn: "Id",
keyValue: 14,
column: "IsActive",
value: true);
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
name: "ActivityCheckLists");
migrationBuilder.DropColumn(
name: "PermanentAddress",
table: "Employees");
migrationBuilder.DropColumn(
name: "IsActive",
table: "ActivityMasters");
migrationBuilder.UpdateData(
table: "WorkShifts",
keyColumn: "Name",
keyValue: null,
column: "Name",
value: "");
migrationBuilder.AlterColumn<string>(
name: "Name",
table: "WorkShifts",
type: "longtext",
nullable: false,
oldClrType: typeof(string),
oldType: "longtext",
oldNullable: true)
.Annotation("MySql:CharSet", "utf8mb4")
.OldAnnotation("MySql:CharSet", "utf8mb4");
migrationBuilder.UpdateData(
table: "Tenants",
keyColumn: "Name",
keyValue: null,
column: "Name",
value: "");
migrationBuilder.AlterColumn<string>(
name: "Name",
table: "Tenants",
type: "longtext",
nullable: false,
oldClrType: typeof(string),
oldType: "longtext",
oldNullable: true)
.Annotation("MySql:CharSet", "utf8mb4")
.OldAnnotation("MySql:CharSet", "utf8mb4");
migrationBuilder.UpdateData(
table: "Tenants",
keyColumn: "DomainName",
keyValue: null,
column: "DomainName",
value: "");
migrationBuilder.AlterColumn<string>(
name: "DomainName",
table: "Tenants",
type: "longtext",
nullable: false,
oldClrType: typeof(string),
oldType: "longtext",
oldNullable: true)
.Annotation("MySql:CharSet", "utf8mb4")
.OldAnnotation("MySql:CharSet", "utf8mb4");
migrationBuilder.UpdateData(
table: "Tenants",
keyColumn: "Description",
keyValue: null,
column: "Description",
value: "");
migrationBuilder.AlterColumn<string>(
name: "Description",
table: "Tenants",
type: "longtext",
nullable: false,
oldClrType: typeof(string),
oldType: "longtext",
oldNullable: true)
.Annotation("MySql:CharSet", "utf8mb4")
.OldAnnotation("MySql:CharSet", "utf8mb4");
migrationBuilder.UpdateData(
table: "Tenants",
keyColumn: "ContactNumber",
keyValue: null,
column: "ContactNumber",
value: "");
migrationBuilder.AlterColumn<string>(
name: "ContactNumber",
table: "Tenants",
type: "longtext",
nullable: false,
oldClrType: typeof(string),
oldType: "longtext",
oldNullable: true)
.Annotation("MySql:CharSet", "utf8mb4")
.OldAnnotation("MySql:CharSet", "utf8mb4");
migrationBuilder.UpdateData(
table: "Tenants",
keyColumn: "ContactName",
keyValue: null,
column: "ContactName",
value: "");
migrationBuilder.AlterColumn<string>(
name: "ContactName",
table: "Tenants",
type: "longtext",
nullable: false,
oldClrType: typeof(string),
oldType: "longtext",
oldNullable: true)
.Annotation("MySql:CharSet", "utf8mb4")
.OldAnnotation("MySql:CharSet", "utf8mb4");
migrationBuilder.UpdateData(
table: "StatusMasters",
keyColumn: "Status",
keyValue: null,
column: "Status",
value: "");
migrationBuilder.AlterColumn<string>(
name: "Status",
table: "StatusMasters",
type: "longtext",
nullable: false,
oldClrType: typeof(string),
oldType: "longtext",
oldNullable: true)
.Annotation("MySql:CharSet", "utf8mb4")
.OldAnnotation("MySql:CharSet", "utf8mb4");
migrationBuilder.UpdateData(
table: "RefreshTokens",
keyColumn: "UserId",
keyValue: null,
column: "UserId",
value: "");
migrationBuilder.AlterColumn<string>(
name: "UserId",
table: "RefreshTokens",
type: "varchar(255)",
nullable: false,
oldClrType: typeof(string),
oldType: "varchar(255)",
oldNullable: true)
.Annotation("MySql:CharSet", "utf8mb4")
.OldAnnotation("MySql:CharSet", "utf8mb4");
migrationBuilder.UpdateData(
table: "RefreshTokens",
keyColumn: "Token",
keyValue: null,
column: "Token",
value: "");
migrationBuilder.AlterColumn<string>(
name: "Token",
table: "RefreshTokens",
type: "longtext",
nullable: false,
oldClrType: typeof(string),
oldType: "longtext",
oldNullable: true)
.Annotation("MySql:CharSet", "utf8mb4")
.OldAnnotation("MySql:CharSet", "utf8mb4");
migrationBuilder.UpdateData(
table: "Projects",
keyColumn: "ProjectAddress",
keyValue: null,
column: "ProjectAddress",
value: "");
migrationBuilder.AlterColumn<string>(
name: "ProjectAddress",
table: "Projects",
type: "longtext",
nullable: false,
oldClrType: typeof(string),
oldType: "longtext",
oldNullable: true)
.Annotation("MySql:CharSet", "utf8mb4")
.OldAnnotation("MySql:CharSet", "utf8mb4");
migrationBuilder.UpdateData(
table: "Projects",
keyColumn: "ContactPerson",
keyValue: null,
column: "ContactPerson",
value: "");
migrationBuilder.AlterColumn<string>(
name: "ContactPerson",
table: "Projects",
type: "longtext",
nullable: false,
oldClrType: typeof(string),
oldType: "longtext",
oldNullable: true)
.Annotation("MySql:CharSet", "utf8mb4")
.OldAnnotation("MySql:CharSet", "utf8mb4");
migrationBuilder.UpdateData(
table: "Modules",
keyColumn: "Description",
keyValue: null,
column: "Description",
value: "");
migrationBuilder.AlterColumn<string>(
name: "Description",
table: "Modules",
type: "longtext",
nullable: false,
oldClrType: typeof(string),
oldType: "longtext",
oldNullable: true)
.Annotation("MySql:CharSet", "utf8mb4")
.OldAnnotation("MySql:CharSet", "utf8mb4");
migrationBuilder.UpdateData(
table: "JobRoles",
keyColumn: "Name",
keyValue: null,
column: "Name",
value: "");
migrationBuilder.AlterColumn<string>(
name: "Name",
table: "JobRoles",
type: "longtext",
nullable: false,
oldClrType: typeof(string),
oldType: "longtext",
oldNullable: true)
.Annotation("MySql:CharSet", "utf8mb4")
.OldAnnotation("MySql:CharSet", "utf8mb4");
migrationBuilder.UpdateData(
table: "Industries",
keyColumn: "Name",
keyValue: null,
column: "Name",
value: "");
migrationBuilder.AlterColumn<string>(
name: "Name",
table: "Industries",
type: "longtext",
nullable: false,
oldClrType: typeof(string),
oldType: "longtext",
oldNullable: true)
.Annotation("MySql:CharSet", "utf8mb4")
.OldAnnotation("MySql:CharSet", "utf8mb4");
migrationBuilder.UpdateData(
table: "Features",
keyColumn: "Name",
keyValue: null,
column: "Name",
value: "");
migrationBuilder.AlterColumn<string>(
name: "Name",
table: "Features",
type: "longtext",
nullable: false,
oldClrType: typeof(string),
oldType: "longtext",
oldNullable: true)
.Annotation("MySql:CharSet", "utf8mb4")
.OldAnnotation("MySql:CharSet", "utf8mb4");
migrationBuilder.UpdateData(
table: "Features",
keyColumn: "Description",
keyValue: null,
column: "Description",
value: "");
migrationBuilder.AlterColumn<string>(
name: "Description",
table: "Features",
type: "longtext",
nullable: false,
oldClrType: typeof(string),
oldType: "longtext",
oldNullable: true)
.Annotation("MySql:CharSet", "utf8mb4")
.OldAnnotation("MySql:CharSet", "utf8mb4");
migrationBuilder.UpdateData(
table: "FeaturePermissions",
keyColumn: "Name",
keyValue: null,
column: "Name",
value: "");
migrationBuilder.AlterColumn<string>(
name: "Name",
table: "FeaturePermissions",
type: "longtext",
nullable: false,
oldClrType: typeof(string),
oldType: "longtext",
oldNullable: true)
.Annotation("MySql:CharSet", "utf8mb4")
.OldAnnotation("MySql:CharSet", "utf8mb4");
migrationBuilder.UpdateData(
table: "FeaturePermissions",
keyColumn: "Description",
keyValue: null,
column: "Description",
value: "");
migrationBuilder.AlterColumn<string>(
name: "Description",
table: "FeaturePermissions",
type: "longtext",
nullable: false,
oldClrType: typeof(string),
oldType: "longtext",
oldNullable: true)
.Annotation("MySql:CharSet", "utf8mb4")
.OldAnnotation("MySql:CharSet", "utf8mb4");
migrationBuilder.UpdateData(
table: "Employees",
keyColumn: "PhoneNumber",
keyValue: null,
column: "PhoneNumber",
value: "");
migrationBuilder.AlterColumn<string>(
name: "PhoneNumber",
table: "Employees",
type: "longtext",
nullable: false,
oldClrType: typeof(string),
oldType: "longtext",
oldNullable: true)
.Annotation("MySql:CharSet", "utf8mb4")
.OldAnnotation("MySql:CharSet", "utf8mb4");
migrationBuilder.UpdateData(
table: "Employees",
keyColumn: "LastName",
keyValue: null,
column: "LastName",
value: "");
migrationBuilder.AlterColumn<string>(
name: "LastName",
table: "Employees",
type: "longtext",
nullable: false,
oldClrType: typeof(string),
oldType: "longtext",
oldNullable: true)
.Annotation("MySql:CharSet", "utf8mb4")
.OldAnnotation("MySql:CharSet", "utf8mb4");
migrationBuilder.UpdateData(
table: "Employees",
keyColumn: "Gender",
keyValue: null,
column: "Gender",
value: "");
migrationBuilder.AlterColumn<string>(
name: "Gender",
table: "Employees",
type: "longtext",
nullable: false,
oldClrType: typeof(string),
oldType: "longtext",
oldNullable: true)
.Annotation("MySql:CharSet", "utf8mb4")
.OldAnnotation("MySql:CharSet", "utf8mb4");
migrationBuilder.UpdateData(
table: "Employees",
keyColumn: "FirstName",
keyValue: null,
column: "FirstName",
value: "");
migrationBuilder.AlterColumn<string>(
name: "FirstName",
table: "Employees",
type: "longtext",
nullable: false,
oldClrType: typeof(string),
oldType: "longtext",
oldNullable: true)
.Annotation("MySql:CharSet", "utf8mb4")
.OldAnnotation("MySql:CharSet", "utf8mb4");
migrationBuilder.UpdateData(
table: "Employees",
keyColumn: "EmergencyPhoneNumber",
keyValue: null,
column: "EmergencyPhoneNumber",
value: "");
migrationBuilder.AlterColumn<string>(
name: "EmergencyPhoneNumber",
table: "Employees",
type: "longtext",
nullable: false,
oldClrType: typeof(string),
oldType: "longtext",
oldNullable: true)
.Annotation("MySql:CharSet", "utf8mb4")
.OldAnnotation("MySql:CharSet", "utf8mb4");
migrationBuilder.UpdateData(
table: "Employees",
keyColumn: "EmergencyContactPerson",
keyValue: null,
column: "EmergencyContactPerson",
value: "");
migrationBuilder.AlterColumn<string>(
name: "EmergencyContactPerson",
table: "Employees",
type: "longtext",
nullable: false,
oldClrType: typeof(string),
oldType: "longtext",
oldNullable: true)
.Annotation("MySql:CharSet", "utf8mb4")
.OldAnnotation("MySql:CharSet", "utf8mb4");
migrationBuilder.UpdateData(
table: "Employees",
keyColumn: "CurrentAddress",
keyValue: null,
column: "CurrentAddress",
value: "");
migrationBuilder.AlterColumn<string>(
name: "CurrentAddress",
table: "Employees",
type: "longtext",
nullable: false,
oldClrType: typeof(string),
oldType: "longtext",
oldNullable: true)
.Annotation("MySql:CharSet", "utf8mb4")
.OldAnnotation("MySql:CharSet", "utf8mb4");
migrationBuilder.AddColumn<string>(
name: "PeramnentAddress",
table: "Employees",
type: "longtext",
nullable: false)
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.UpdateData(
table: "ApplicationRoles",
keyColumn: "Role",
keyValue: null,
column: "Role",
value: "");
migrationBuilder.AlterColumn<string>(
name: "Role",
table: "ApplicationRoles",
type: "longtext",
nullable: false,
oldClrType: typeof(string),
oldType: "longtext",
oldNullable: true)
.Annotation("MySql:CharSet", "utf8mb4")
.OldAnnotation("MySql:CharSet", "utf8mb4");
migrationBuilder.UpdateData(
table: "ApplicationRoles",
keyColumn: "Description",
keyValue: null,
column: "Description",
value: "");
migrationBuilder.AlterColumn<string>(
name: "Description",
table: "ApplicationRoles",
type: "longtext",
nullable: false,
oldClrType: typeof(string),
oldType: "longtext",
oldNullable: true)
.Annotation("MySql:CharSet", "utf8mb4")
.OldAnnotation("MySql:CharSet", "utf8mb4");
migrationBuilder.UpdateData(
table: "ActivityMasters",
keyColumn: "UnitOfMeasurement",
keyValue: null,
column: "UnitOfMeasurement",
value: "");
migrationBuilder.AlterColumn<string>(
name: "UnitOfMeasurement",
table: "ActivityMasters",
type: "longtext",
nullable: false,
oldClrType: typeof(string),
oldType: "longtext",
oldNullable: true)
.Annotation("MySql:CharSet", "utf8mb4")
.OldAnnotation("MySql:CharSet", "utf8mb4");
migrationBuilder.UpdateData(
table: "ActivityMasters",
keyColumn: "ActivityName",
keyValue: null,
column: "ActivityName",
value: "");
migrationBuilder.AlterColumn<string>(
name: "ActivityName",
table: "ActivityMasters",
type: "longtext",
nullable: false,
oldClrType: typeof(string),
oldType: "longtext",
oldNullable: true)
.Annotation("MySql:CharSet", "utf8mb4")
.OldAnnotation("MySql:CharSet", "utf8mb4");
}
}
}

View File

@ -0,0 +1,37 @@
using Microsoft.EntityFrameworkCore.Metadata;
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace Marco.Pms.DataAccess.Migrations
{
/// <inheritdoc />
public partial class Added_CheckListMappings_Table : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.CreateTable(
name: "CheckListMappings",
columns: table => new
{
Id = table.Column<int>(type: "int", nullable: false)
.Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
TaskAllocationId = table.Column<long>(type: "bigint", nullable: false),
CheckListId = table.Column<int>(type: "int", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_CheckListMappings", x => x.Id);
})
.Annotation("MySql:CharSet", "utf8mb4");
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
name: "CheckListMappings");
}
}
}

View File

@ -0,0 +1,48 @@
using Microsoft.EntityFrameworkCore.Metadata;
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace Marco.Pms.DataAccess.Migrations
{
/// <inheritdoc />
public partial class Added_Inquiries_table : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.CreateTable(
name: "Inquiries",
columns: table => new
{
Id = table.Column<int>(type: "int", nullable: false)
.Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
OrganizatioinName = table.Column<string>(type: "longtext", nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
Email = table.Column<string>(type: "longtext", nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
About = table.Column<string>(type: "longtext", nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
OragnizationSize = table.Column<string>(type: "longtext", nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
IndustryId = table.Column<int>(type: "int", nullable: false),
ContactPerson = table.Column<string>(type: "longtext", nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
ContactNumber = table.Column<string>(type: "longtext", nullable: true)
.Annotation("MySql:CharSet", "utf8mb4")
},
constraints: table =>
{
table.PrimaryKey("PK_Inquiries", x => x.Id);
})
.Annotation("MySql:CharSet", "utf8mb4");
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
name: "Inquiries");
}
}
}

View File

@ -1,109 +0,0 @@
using System;
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
#pragma warning disable CA1814 // Prefer jagged arrays over multidimensional
namespace Marco.Pms.DataAccess.Migrations
{
/// <inheritdoc />
public partial class Changed_DataType_ApproverdBY : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.DeleteData(
table: "ActivityMasters",
keyColumn: "Id",
keyValue: new Guid("1714f64d-7591-4419-bee5-118d21bb2855"));
migrationBuilder.DeleteData(
table: "ActivityMasters",
keyColumn: "Id",
keyValue: new Guid("4117b7de-ef6c-461f-a2c2-64eaac5f9a11"));
migrationBuilder.DeleteData(
table: "ActivityMasters",
keyColumn: "Id",
keyValue: new Guid("53eedf44-4076-445f-be93-fedef17117e7"));
migrationBuilder.DeleteData(
table: "ActivityMasters",
keyColumn: "Id",
keyValue: new Guid("715b9ddb-d9e2-4afa-8987-d9918905cea4"));
migrationBuilder.DeleteData(
table: "ActivityMasters",
keyColumn: "Id",
keyValue: new Guid("a3d191a7-a5aa-4dd8-a525-12c99263bbd6"));
migrationBuilder.DeleteData(
table: "ActivityMasters",
keyColumn: "Id",
keyValue: new Guid("b3f51a93-dde6-45f9-8b22-f1bf017a640b"));
migrationBuilder.DeleteData(
table: "ActivityMasters",
keyColumn: "Id",
keyValue: new Guid("c138a7de-713a-4bd4-8292-b0b265be77a3"));
migrationBuilder.DeleteData(
table: "Projects",
keyColumn: "Id",
keyValue: new Guid("3ef56a12-f5e5-4193-87d6-9e110ed10b86"));
migrationBuilder.DeleteData(
table: "Projects",
keyColumn: "Id",
keyValue: new Guid("54d013e3-0a2b-48be-85c7-5ef03492a18c"));
migrationBuilder.AlterColumn<Guid>(
name: "ApprovedBy",
table: "Attendes",
type: "char(36)",
nullable: true,
collation: "ascii_general_ci",
oldClrType: typeof(int),
oldType: "int",
oldNullable: true);
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.AlterColumn<int>(
name: "ApprovedBy",
table: "Attendes",
type: "int",
nullable: true,
oldClrType: typeof(Guid),
oldType: "char(36)",
oldNullable: true)
.OldAnnotation("Relational:Collation", "ascii_general_ci");
migrationBuilder.InsertData(
table: "ActivityMasters",
columns: new[] { "Id", "ActivityName", "IsActive", "TenantId", "UnitOfMeasurement" },
values: new object[,]
{
{ new Guid("1714f64d-7591-4419-bee5-118d21bb2855"), "Fabrication", true, new Guid("b3466e83-7e11-464c-b93a-daf047838b26"), "Meter" },
{ new Guid("4117b7de-ef6c-461f-a2c2-64eaac5f9a11"), "Core Cutting", true, new Guid("b3466e83-7e11-464c-b93a-daf047838b26"), "Number" },
{ new Guid("53eedf44-4076-445f-be93-fedef17117e7"), "MS Support Fabrication", true, new Guid("b3466e83-7e11-464c-b93a-daf047838b26"), "Number" },
{ new Guid("715b9ddb-d9e2-4afa-8987-d9918905cea4"), "MS Support Hanging", true, new Guid("b3466e83-7e11-464c-b93a-daf047838b26"), "Number" },
{ new Guid("a3d191a7-a5aa-4dd8-a525-12c99263bbd6"), "Hydrant Volve", true, new Guid("b3466e83-7e11-464c-b93a-daf047838b26"), "Number" },
{ new Guid("b3f51a93-dde6-45f9-8b22-f1bf017a640b"), "Welding", true, new Guid("b3466e83-7e11-464c-b93a-daf047838b26"), "Meter" },
{ new Guid("c138a7de-713a-4bd4-8292-b0b265be77a3"), "Sprinkler Installation", true, new Guid("b3466e83-7e11-464c-b93a-daf047838b26"), "Number" }
});
migrationBuilder.InsertData(
table: "Projects",
columns: new[] { "Id", "ContactPerson", "EndDate", "Name", "ProjectAddress", "ProjectStatusId", "StartDate", "TenantId" },
values: new object[,]
{
{ new Guid("3ef56a12-f5e5-4193-87d6-9e110ed10b86"), "Project 2 Contact Person", new DateTime(2026, 4, 20, 10, 11, 17, 588, DateTimeKind.Unspecified), "Project 2", "Project 2 Address", new Guid("ef1c356e-0fe0-42df-a5d3-8daee355492d"), new DateTime(2025, 4, 20, 10, 11, 17, 588, DateTimeKind.Unspecified), new Guid("b3466e83-7e11-464c-b93a-daf047838b26") },
{ new Guid("54d013e3-0a2b-48be-85c7-5ef03492a18c"), "Project 3 Contact Person", new DateTime(2026, 4, 20, 10, 11, 17, 588, DateTimeKind.Unspecified), "Project 3", "Project 3 Address", new Guid("33deaef9-9af1-4f2a-b443-681ea0d04f81"), new DateTime(2025, 4, 20, 10, 11, 17, 588, DateTimeKind.Unspecified), new Guid("b3466e83-7e11-464c-b93a-daf047838b26") }
});
}
}
}

View File

@ -1,40 +0,0 @@
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace Marco.Pms.DataAccess.Migrations
{
/// <inheritdoc />
public partial class Added_IsSystem_Flag : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AddColumn<bool>(
name: "IsSystem",
table: "Employees",
type: "tinyint(1)",
nullable: false,
defaultValue: false);
migrationBuilder.AddColumn<bool>(
name: "IsSystem",
table: "ApplicationRoles",
type: "tinyint(1)",
nullable: false,
defaultValue: false);
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropColumn(
name: "IsSystem",
table: "Employees");
migrationBuilder.DropColumn(
name: "IsSystem",
table: "ApplicationRoles");
}
}
}

View File

@ -1,63 +0,0 @@
using System;
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
#pragma warning disable CA1814 // Prefer jagged arrays over multidimensional
namespace Marco.Pms.DataAccess.Migrations
{
/// <inheritdoc />
public partial class Added_WorkCategory_Master_Table : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.CreateTable(
name: "WorkCategoryMasters",
columns: table => new
{
Id = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
Name = table.Column<string>(type: "longtext", nullable: false)
.Annotation("MySql:CharSet", "utf8mb4"),
Description = table.Column<string>(type: "longtext", nullable: false)
.Annotation("MySql:CharSet", "utf8mb4"),
IsSystem = table.Column<bool>(type: "tinyint(1)", nullable: false),
TenantId = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci")
},
constraints: table =>
{
table.PrimaryKey("PK_WorkCategoryMasters", x => x.Id);
table.ForeignKey(
name: "FK_WorkCategoryMasters_Tenants_TenantId",
column: x => x.TenantId,
principalTable: "Tenants",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
})
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.InsertData(
table: "WorkCategoryMasters",
columns: new[] { "Id", "Description", "IsSystem", "Name", "TenantId" },
values: new object[,]
{
{ new Guid("11a79929-1d07-42dc-9e98-82d0d2f4a240"), "Any defect, deviation, or non-conformance in a task that fails to meet established standards or customer expectations.", true, "Quality Issue", new Guid("b3466e83-7e11-464c-b93a-daf047838b26") },
{ new Guid("86bb2cc8-f6b5-4fdd-bbee-c389c713a44b"), "Created new task in a professional or creative context", true, "Fresh Work", new Guid("b3466e83-7e11-464c-b93a-daf047838b26") },
{ new Guid("9ebfa19c-53b9-481b-b863-c25d2f843201"), "Revising, modifying, or correcting a task to improve its quality or fix issues", true, "Rework", new Guid("b3466e83-7e11-464c-b93a-daf047838b26") }
});
migrationBuilder.CreateIndex(
name: "IX_WorkCategoryMasters_TenantId",
table: "WorkCategoryMasters",
column: "TenantId");
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
name: "WorkCategoryMasters");
}
}
}

View File

@ -1,50 +0,0 @@
using System;
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace Marco.Pms.DataAccess.Migrations
{
/// <inheritdoc />
public partial class Added_Foreign_key_For_WorkCategery_To_WorkItem : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AddColumn<Guid>(
name: "WorkCategoryId",
table: "WorkItems",
type: "char(36)",
nullable: true,
collation: "ascii_general_ci");
migrationBuilder.CreateIndex(
name: "IX_WorkItems_WorkCategoryId",
table: "WorkItems",
column: "WorkCategoryId");
migrationBuilder.AddForeignKey(
name: "FK_WorkItems_WorkCategoryMasters_WorkCategoryId",
table: "WorkItems",
column: "WorkCategoryId",
principalTable: "WorkCategoryMasters",
principalColumn: "Id");
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropForeignKey(
name: "FK_WorkItems_WorkCategoryMasters_WorkCategoryId",
table: "WorkItems");
migrationBuilder.DropIndex(
name: "IX_WorkItems_WorkCategoryId",
table: "WorkItems");
migrationBuilder.DropColumn(
name: "WorkCategoryId",
table: "WorkItems");
}
}
}

View File

@ -1,15 +1,15 @@
using System.ComponentModel.DataAnnotations.Schema;
using Marco.Pms.Model.Employees;
using Marco.Pms.Model.Entitlements;
using Marco.Pms.Model.Projects;
using Marco.Pms.Model.Utilities;
using Microsoft.AspNetCore.Mvc.ModelBinding.Validation;
namespace Marco.Pms.Model.Activities
{
public class TaskAllocation : TenantRelation
public class TaskAllocation
{
public Guid Id { get; set; }
public long Id { get; set; }
public DateTime AssignmentDate { get; set; }
@ -24,15 +24,20 @@ namespace Marco.Pms.Model.Activities
//[ValidateNever]
//public WorkItemMapping? WorkItemMapping { get; set; }
public Guid AssignedBy { get; set; } //Employee Id
public int AssignedBy { get; set; } //Employee Id
[ForeignKey("AssignedBy")]
[ValidateNever]
public Employee? Employee { get; set; }
public Guid WorkItemId { get; set; }
public int WorkItemId { get; set; }
[ForeignKey("WorkItemId")]
[ValidateNever]
public WorkItem? WorkItem { get; set; }
public int TenantId { get; set; }
[ValidateNever]
[ForeignKey(nameof(TenantId))]
public Tenant? Tenant { get; set; }
}
}

View File

@ -5,22 +5,22 @@ using Microsoft.AspNetCore.Mvc.ModelBinding.Validation;
namespace Marco.Pms.Model.Activities
{
public class TaskComment : TenantRelation
public class TaskComment : TenantTest
{
public Guid Id { get; set; }
public long Id { get; set; }
public Guid TaskAllocationId { get; set; }
public long TaskAllocationId { get; set; }
[ValidateNever]
[ForeignKey(nameof(TaskAllocationId))]
public TaskAllocation? TaskAllocation { get; set; }
public DateTime CommentDate { get; set; }
public string Comment { get; set; } = string.Empty;
public Guid CommentedBy { get; set; }
public int CommentedBy { get; set; }
[ForeignKey("CommentedBy")]
[ValidateNever]
public Employee? Employee { get; set; }
}
}

View File

@ -1,13 +1,13 @@
using System.ComponentModel.DataAnnotations.Schema;
using Microsoft.AspNetCore.Mvc.ModelBinding.Validation;
using Microsoft.AspNetCore.Mvc.ModelBinding.Validation;
using System.ComponentModel.DataAnnotations.Schema;
namespace Marco.Pms.Model.Activities
{
public class TaskImages
{
public Guid Id { get; set; }
public long Id { get; set; }
public Guid TaskAllocationId { get; set; }
public long TaskAllocationId { get; set; }
[ValidateNever]
[ForeignKey(nameof(TaskAllocationId))]
public TaskAllocation? TaskAllocation { get; set; }

View File

@ -1,22 +1,27 @@
using System.ComponentModel.DataAnnotations.Schema;
using Marco.Pms.Model.Employees;
using Marco.Pms.Model.Utilities;
using Marco.Pms.Model.Entitlements;
using Microsoft.AspNetCore.Mvc.ModelBinding.Validation;
namespace Marco.Pms.Model.Activities
{
public class TaskMembers : TenantRelation
public class TaskMembers
{
public Guid Id { get; set; }
public long Id { get; set; }
public Guid TaskAllocationId { get; set; }
public long TaskAllocationId { get; set; }
[ValidateNever]
[ForeignKey(nameof(TaskAllocationId))]
public TaskAllocation? TaskAllocation { get; set; }
public Guid EmployeeId { get; set; }
public int EmployeeId { get; set; }
[ForeignKey("EmployeeId")]
[ValidateNever]
public Employee? Employee { get; set; }
public int TenantId { get; set; }
[ValidateNever]
[ForeignKey(nameof(TenantId))]
public Tenant? Tenant { get; set; }
}
}

View File

@ -1,20 +1,21 @@
using System.ComponentModel.DataAnnotations.Schema;
using System.ComponentModel;
using System.ComponentModel.DataAnnotations.Schema;
using Marco.Pms.Model.Dtos.Attendance;
using Marco.Pms.Model.Employees;
using Marco.Pms.Model.Utilities;
using Marco.Pms.Model.Entitlements;
using Microsoft.AspNetCore.Mvc.ModelBinding.Validation;
namespace Marco.Pms.Model.AttendanceModule
{
public class Attendance : TenantRelation
public class Attendance
{
public Guid Id { get; set; }
public int Id { get; set; }
public string Comment { get; set; } = string.Empty;
public Guid EmployeeID { get; set; }
public int EmployeeID { get; set; }
public DateTime Date { get; set; }
public Guid ProjectID { get; set; }
public int ProjectID { get; set; }
public DateTime AttendanceDate { get; set; }
public DateTime? InTime { get; set; }
@ -22,9 +23,17 @@ namespace Marco.Pms.Model.AttendanceModule
public bool IsApproved { get; set; }
public ATTENDANCE_MARK_TYPE Activity { get; set; }
public Guid? ApprovedBy { get; set; }
public int? ApprovedBy { get; set; }
[ForeignKey("EmployeeID")]
[ValidateNever]
public Employee? Approver { get; set; }
[DisplayName("TenantId")]
public int TenantId { get; set; }
[ValidateNever]
[ForeignKey(nameof(TenantId))]
public Tenant? Tenant { get; set; }
}
}

View File

@ -1,23 +1,23 @@
using System.ComponentModel.DataAnnotations.Schema;
using Marco.Pms.Model.DocumentManager;
using System.ComponentModel;
using System.ComponentModel.DataAnnotations.Schema;
using Marco.Pms.Model.Dtos.Attendance;
using Marco.Pms.Model.Employees;
using Marco.Pms.Model.Utilities;
using Marco.Pms.Model.Entitlements;
using Microsoft.AspNetCore.Mvc.ModelBinding.Validation;
namespace Marco.Pms.Model.AttendanceModule
{
public class AttendanceLog : TenantRelation
public class AttendanceLog
{
public Guid Id { get; set; }
public int Id { get; set; }
public string Comment { get; set; } = string.Empty;
public Guid AttendanceId { get; set; }
public int AttendanceId { get; set; }
[ForeignKey("AttendanceId")]
[ValidateNever]
public Attendance? Attendance { get; set; }
public Guid EmployeeID { get; set; }
public int EmployeeID { get; set; }
[ForeignKey("EmployeeID")]
[ValidateNever]
public Employee? Employee { get; set; }
@ -36,15 +36,16 @@ namespace Marco.Pms.Model.AttendanceModule
public DateTime UpdatedOn { get; set; }
public Guid? UpdatedBy { get; set; }
public int? UpdatedBy { get; set; }
[ForeignKey("UpdatedBy")]
[ValidateNever]
public Employee? UpdatedByEmployee { get; set; }
public Guid? DocumentId { get; set; }
[ForeignKey("DocumentId")]
[ValidateNever]
public Document? Document { get; set; }
[DisplayName("TenantId")]
public int TenantId { get; set; }
[ValidateNever]
[ForeignKey(nameof(TenantId))]
public Tenant? Tenant { get; set; }
}
}

View File

@ -4,7 +4,7 @@ namespace Marco.Pms.Model.Authentication
{
public class RefreshToken
{
public Guid Id { get; set; }
public int Id { get; set; }
public string? Token { get; set; }
public string? UserId { get; set; }
public DateTime ExpiryDate { get; set; }

View File

@ -1,25 +0,0 @@
using Marco.Pms.Model.Utilities;
namespace Marco.Pms.Model.DocumentManager
{
public class Document : TenantRelation
{
public Guid Id { get; set; }
public Guid? BatchId { get; set; }
public string FileName { get; set; } = string.Empty;
/// <summary>
/// Full S3 object key
/// </summary>
public string S3Key { get; set; } = string.Empty;
/// <summary>
/// S3 key for thumbnail image
/// </summary>
public string? ThumbS3Key { get; set; }
public string? Base64Data { get; set; }
public long FileSize { get; set; }
public string ContentType { get; set; } = string.Empty;
public DateTime UploadedAt { get; set; }
}
}

View File

@ -5,8 +5,8 @@
public DateTime AssignmentDate { get; set; }
public double PlannedTask { get; set; }
public string? Description { get; set; }
public List<Guid>? TaskTeam { get; set; } //Employee Ids
public Guid WorkItemId { get; set; }
public List<int>? TaskTeam { get; set; } //Employee Ids
public int WorkItemId { get; set; }
}
}

View File

@ -2,7 +2,7 @@
{
public class CreateCheckListDto
{
public Guid? Id { get; set; }
public int Id { get; set; }
public string? Description { get; set; }
public bool IsMandatory { get; set; }
}

View File

@ -2,7 +2,7 @@
{
public class CreateCommentDto
{
public Guid TaskAllocationId { get; set; }
public long TaskAllocationId { get; set; }
public DateTime CommentDate { get; set; }
public string? Comment { get; set; }

View File

@ -2,8 +2,8 @@
{
public class ReportCheckListDto
{
public Guid Id { get; set; }
public string Description { get; set; } = string.Empty;
public int Id { get; set; }
public string Description { get; set; }= string.Empty;
public bool IsMandatory { get; set; }
public bool IsChecked { get; set; }
}

View File

@ -2,7 +2,7 @@
{
public class ReportTaskDto
{
public Guid Id { get; set; }
public long Id { get; set; }
public double CompletedTask { get; set; }
public DateTime ReportedDate { get; set; }
public string? Comment { get; set; }

View File

@ -4,10 +4,10 @@ namespace Marco.Pms.Model.Dtos.Attendance
{
public class RecordAttendanceDot
{
public Guid? Id { get; set; }
public int? Id { get; set; }
public string? Comment { get; set; }
public Guid EmployeeID { get; set; }
public Guid ProjectID { get; set; }
public int EmployeeID { get; set; }
public int ProjectID { get; set; }
public DateTime Date { get; set; }
@ -18,7 +18,7 @@ namespace Marco.Pms.Model.Dtos.Attendance
public ATTENDANCE_MARK_TYPE Action { get; set; }
public FileUploadModel? Image { get; set; }
public List<FileUploadModel>? Image { get; set; }
}
public enum ATTENDANCE_MARK_TYPE

View File

@ -1,8 +1,9 @@
using Microsoft.AspNetCore.Http;
using Marco.Pms.Model.Employees;
using Microsoft.AspNetCore.Http;
namespace Marco.Pms.Model.Dtos.Employees
{
public class ApplicationUserDto
public class ApplicationUserDto
{
public ApplicationUserDto() { }
public int? Id { get; set; }
@ -31,7 +32,7 @@ namespace Marco.Pms.Model.Dtos.Employees
public Guid RoleId { get; set; }
public Guid TenantId { get; set; }
public int TenantId { get; set; }
}
}

View File

@ -2,7 +2,7 @@
{
public class CreateUserDto
{
public Guid? Id { get; set; }
public int Id { get; set; }
public string? FirstName { get; set; }
public string? LastName { get; set; }
public string? MiddleName { get; set; }
@ -13,7 +13,7 @@
public string? JoiningDate { get; set; }
public string? PermanentAddress { get; set; }
public string? CurrentAddress { get; set; }
public string? CurrentAddress { get; set; }
public string? PhoneNumber { get; set; }
public string? EmergencyPhoneNumber { get; set; }
@ -26,17 +26,17 @@
//public IFormFile? Photo { get; set; } // To store the captured photo
//public List<IFormFile>? Documents { get; set; }
public Guid? JobRoleId { get; set; }
public string? JobRoleId { get; set; }
// public int TenantId { get; set; }
// public int TenantId { get; set; }
}
public class CreateQuickUserDto
{
public Guid Id { get; set; }
public int Id { get; set; }
public string? FirstName { get; set; }
public string? LastName { get; set; }
public string? LastName { get; set; }
public string? Gender { get; set; }
public string? Gender { get; set; }
public string? CurrentAddress { get; set; }
public string? PhoneNumber { get; set; }
@ -44,7 +44,7 @@
public string? EmergencyPhoneNumber { get; set; }
public string? EmergencyContactPerson { get; set; }
public Guid? JobRoleId { get; set; }
public string? JobRoleId { get; set; }
}
}

View File

@ -4,7 +4,7 @@
{
public string Id { get; set; } = string.Empty;
public Guid EmployeeId { get; set; }
public int EmployeeId { get; set; }
public Guid RoleId { get; set; }
public bool IsEnabled { get; set; }
}

View File

@ -1,12 +0,0 @@
namespace Marco.Pms.Model.Dtos.Forum
{
public class AddCommentDto
{
public Guid TicketId { get; set; } = Guid.Empty;
public Guid AuthorId { get; set; }
public string MessageText { get; set; } = string.Empty;
public DateTime SentAt { get; set; }
public Guid? ParentMessageId { get; set; } // For threaded replies
public ICollection<ForumAttachmentDto>? Attachments { get; set; }
}
}

View File

@ -1,17 +0,0 @@
namespace Marco.Pms.Model.Dtos.Forum
{
public class CreateTicketDto
{
public string Subject { get; set; } = string.Empty;
public string Description { get; set; } = string.Empty;
public Guid StatusId { get; set; }
public Guid TypeId { get; set; } // QualityIssue, HelpDesk, Feedback
public Guid CreatedById { get; set; }
public DateTime CreatedAt { get; set; }
public Guid? LinkedProjectId { get; set; }
public Guid? LinkedActivityId { get; set; } // task or project ID
public ICollection<ForumAttachmentDto>? Attachments { get; set; }
public Guid PriorityId { get; set; }
public ICollection<Guid>? TagIds { get; set; }
}
}

View File

@ -1,13 +0,0 @@
namespace Marco.Pms.Model.Dtos.Forum
{
public class ForumAttachmentDto
{
public Guid? TicketId { get; set; }
public Guid? CommentId { get; set; }
public string FileName { get; set; } = string.Empty;
public string? Base64Data { get; set; }
public int FileSize { get; set; }
public string ContentType { get; set; } = string.Empty;
public DateTime SentAt { get; set; }
}
}

View File

@ -1,14 +0,0 @@
namespace Marco.Pms.Model.Dtos.Forum
{
public class UpdateAttachmentDto
{
public Guid Id { get; set; }
public Guid TicketId { get; set; } = Guid.Empty;
public Guid? CommentId { get; set; }
public string FileName { get; set; } = string.Empty;
public string? Base64Data { get; set; }
public int FileSize { get; set; }
public string ContentType { get; set; } = string.Empty;
public DateTime SentAt { get; set; }
}
}

View File

@ -1,13 +0,0 @@
namespace Marco.Pms.Model.Dtos.Forum
{
public class UpdateCommentDto
{
public Guid Id { get; set; }
public Guid TicketId { get; set; }
public Guid AuthorId { get; set; }
public string MessageText { get; set; } = string.Empty;
public DateTime SentAt { get; set; }
public Guid? ParentMessageId { get; set; } // For threaded replies
public ICollection<UpdateAttachmentDto>? Attachments { get; set; }
}
}

View File

@ -1,18 +0,0 @@
namespace Marco.Pms.Model.Dtos.Forum
{
public class UpdateTicketDto
{
public Guid Id { get; set; }
public string Subject { get; set; } = string.Empty;
public string Description { get; set; } = string.Empty;
public Guid StatusId { get; set; }
public Guid TypeId { get; set; } // QualityIssue, HelpDesk, Feedback
public Guid CreatedById { get; set; }
public DateTime CreatedAt { get; set; }
public Guid? LinkedProjectId { get; set; }
public Guid? LinkedActivityId { get; set; } // task or project ID
public ICollection<UpdateAttachmentDto>? Attachments { get; set; }
public Guid PriorityId { get; set; }
public ICollection<Guid>? TagIds { get; set; }
}
}

View File

@ -1,11 +0,0 @@
namespace Marco.Pms.Model.Dtos.Master
{
public class TicketPriorityMasterDto
{
public Guid? Id { get; set; }
public string Name { get; set; } = string.Empty; // e.g., Low, Medium, High, Critical
public int Level { get; set; } // 1 = Low, 2 = Medium...
public string? ColorCode { get; set; }
public bool IsDefault { get; set; }
}
}

View File

@ -1,11 +0,0 @@
namespace Marco.Pms.Model.Dtos.Master
{
public class TicketStatusMasterDto
{
public Guid? Id { get; set; }
public string Name { get; set; } = string.Empty; // e.g., "Open", "In Progress"
public string? Description { get; set; }
public string? ColorCode { get; set; } // e.g., "#FF0000"
public bool IsDefault { get; set; } // true for system defaults
}
}

View File

@ -1,10 +0,0 @@
namespace Marco.Pms.Model.Dtos.Master
{
public class TicketTagMasterDto
{
public Guid? Id { get; set; }
public string Name { get; set; } = string.Empty; // e.g., "Bug", "UI", "Urgent"
public string? ColorCode { get; set; }
public bool IsDefault { get; set; }
}
}

View File

@ -1,10 +0,0 @@
namespace Marco.Pms.Model.Dtos.Master
{
public class TicketTypeMasterDto
{
public Guid? Id { get; set; }
public string Name { get; set; } = string.Empty; // e.g., "Quality Issue"
public string? Description { get; set; }
public bool IsDefault { get; set; } // true for system defaults
}
}

View File

@ -1,9 +0,0 @@
namespace Marco.Pms.Model.Dtos.Master
{
public class WorkCategoryMasterDto
{
public Guid? Id { get; set; }
public string Name { get; set; } = string.Empty;
public string? Description { get; set; }
}
}

View File

@ -6,11 +6,14 @@ namespace Marco.Pms.Model.Dtos.Project
public class BuildingDot
{
[Key]
public Guid? Id { get; set; }
public int Id { get; set; }
[Required]
[DisplayName("Building Name")]
public string? Name { get; set; }
public string? Description { get; set; }
public Guid ProjectId { get; set; }
public int ProjectId { get; set; }
[DisplayName("TenantId")]
public int TenantId { get; set; }
}
}

View File

@ -1,8 +1,10 @@
namespace Marco.Pms.Model.ViewModels.Projects

namespace Marco.Pms.Model.Dtos.Project
{
public class BuildingVM
{
public Guid Id { get; set; }
public int Id { get; set; }
public string? Name { get; set; }
public string? Description { get; set; }

View File

@ -5,6 +5,7 @@ namespace Marco.Pms.Model.Dtos.Project
{
public class CreateProjectDto
{
//public int Id { get; set; }
[Required(ErrorMessage = "Project Name is required!")]
[DisplayName("Project Name")]
public string? Name { get; set; }
@ -23,6 +24,8 @@ namespace Marco.Pms.Model.Dtos.Project
[DisplayName("Project Status")]
[Required(ErrorMessage = "Project Status is required!")]
public Guid ProjectStatusId { get; set; }
public int ProjectStatusId { get; set; }
public int TenantId { get; set; }
}
}

View File

@ -5,14 +5,17 @@ namespace Marco.Pms.Model.Dtos.Project
{
public class FloorDot
{
public Guid? Id { get; set; }
public int Id { get; set; }
[Required]
[DisplayName("Floor Name")]
public string? FloorName { get; set; }
public Guid BuildingId { get; set; }
public int BuildingId { get; set; }
[DisplayName("TenantId")]
public int TenantId { get; set; }
}
}

View File

@ -1,11 +1,11 @@
using System.ComponentModel;
using System.ComponentModel.DataAnnotations;
namespace Marco.Pms.Model.ViewModels.Projects
namespace Marco.Pms.Model.Dtos.Project
{
public class FloorsVM
{
public Guid Id { get; set; }
public int Id { get; set; }
[Required]
[DisplayName("Floor Name")]

View File

@ -2,9 +2,9 @@
{
public class ProjectAllocationDot
{
public Guid EmpID { get; set; }
public Guid JobRoleId { get; set; }
public Guid ProjectId { get; set; }
public int EmpID { get; set; }
public int JobRoleId { get; set; }
public int ProjectId { get; set; }
public bool Status { get; set; }
}

View File

@ -4,8 +4,8 @@ using System.ComponentModel.DataAnnotations;
namespace Marco.Pms.Model.Dtos.Project
{
public class ProjectDto
{
public Guid Id { get; set; }
{
public int Id { get; set; }
[Required(ErrorMessage = "Project Name is required!")]
[DisplayName("Project Name")]
public string? Name { get; set; }
@ -24,7 +24,8 @@ namespace Marco.Pms.Model.Dtos.Project
[DisplayName("Project Status")]
[Required(ErrorMessage = "Project Status is required!")]
public Guid ProjectStatusId { get; set; }
public int ProjectStatusId { get; set; }
public int TenantId { get; set; }
}

View File

@ -1,6 +1,4 @@
using Marco.Pms.Model.Dtos.Project;
namespace Marco.Pms.Model.ViewModels.Projects
namespace Marco.Pms.Model.Dtos.Project
{
public class ProjectVM : ProjectDto
{

View File

@ -5,7 +5,7 @@ namespace Marco.Pms.Model.Dtos.Project
{
public class UpdateProjectDto
{
public Guid Id { get; set; }
public int Id { get; set; }
[Required(ErrorMessage = "Project Name is required!")]
[DisplayName("Project Name")]
public string? Name { get; set; }
@ -24,6 +24,8 @@ namespace Marco.Pms.Model.Dtos.Project
[DisplayName("Project Status")]
[Required(ErrorMessage = "Project Status is required!")]
public Guid ProjectStatusId { get; set; }
public int ProjectStatusId { get; set; }
public int TenantId { get; set; }
}
}

View File

@ -6,13 +6,16 @@ namespace Marco.Pms.Model.Dtos.Project
public class WorkAreaDot
{
[Key]
public Guid? Id { get; set; }
public int Id { get; set; }
[Required]
[DisplayName("Area Name")]
public string? AreaName { get; set; }
public Guid FloorId { get; set; }
public int FloorId { get; set; }
[DisplayName("TenantId")]
public int TenantId { get; set; }
}
}

View File

@ -1,11 +1,11 @@
using System.ComponentModel;
using System.ComponentModel.DataAnnotations;
namespace Marco.Pms.Model.ViewModels.Projects
namespace Marco.Pms.Model.Dtos.Project
{
public class WorkAreaVM
{
public Guid Id { get; set; }
public int Id { get; set; }
[Required]
[DisplayName("Area Name")]

View File

@ -5,11 +5,12 @@ namespace Marco.Pms.Model.Dtos.Project
public class WorkItemDot
{
[Key]
public Guid? Id { get; set; }
public Guid WorkAreaID { get; set; }
public Guid WorkCategoryId { get; set; }
public Guid ActivityID { get; set; }
public int Id { get; set; }
public int WorkAreaID { get; set; }
public int ActivityID { get; set; }
public int PlannedWork { get; set; }
public int CompletedWork { get; set; }
public int TenantId { get; set; }
}
}

View File

@ -1,10 +1,10 @@
using Marco.Pms.Model.Projects;
namespace Marco.Pms.Model.ViewModels.Projects
namespace Marco.Pms.Model.Dtos.Project
{
public class WorkItemVM
{
public Guid WorkItemId { get; set; }
public int WorkItemId { get; set; }
public WorkItem? WorkItem { get; set; }
}
}

View File

@ -2,7 +2,7 @@
{
public class UpdateJobRoleDto
{
public Guid Id { get; set; }
public int Id { get; set; }
public string? Name { get; set; }
public string? Description { get; set; }
}

View File

@ -6,7 +6,7 @@
public string? Email { get; set; }
public string? About { get; set; }
public string? OragnizationSize { get; set; }
public Guid IndustryId { get; set; }
public int IndustryId { get; set; }
public string? ContactPerson { get; set; }
public string? ContactNumber { get; set; }
}

View File

@ -1,14 +1,13 @@
using System.ComponentModel.DataAnnotations.Schema;
using Marco.Pms.Model.Entitlements;
using Marco.Pms.Model.Roles;
using Marco.Pms.Model.Utilities;
using Marco.Pms.Model.Entitlements;
using Microsoft.AspNetCore.Mvc.ModelBinding.Validation;
using System.ComponentModel;
using System.ComponentModel.DataAnnotations.Schema;
namespace Marco.Pms.Model.Employees
{
public class Employee : TenantRelation
public class Employee
{
public Guid Id { get; set; }
public int Id { get; set; }
public string? FirstName { get; set; }
public string? LastName { get; set; }
public string? MiddleName { get; set; }
@ -36,17 +35,19 @@ namespace Marco.Pms.Model.Employees
[ForeignKey("ApplicationUserId")]
[ValidateNever]
public ApplicationUser? ApplicationUser { get; set; }
[DisplayName("TenantId")]
public int TenantId { get; set; }
public bool IsActive { get; set; } = true;
public bool IsSystem { get; set; } = false;
[ValidateNever]
[ForeignKey(nameof(TenantId))]
public Tenant? Tenant { get; set; }
public Guid RoleId { get; set; }
//[ForeignKey(nameof(RoleId))]
//public EmployeeRole EmployeeRole { get; set; }
public Guid? JobRoleId { get; set; }
public int? JobRoleId { get; set; }
[ForeignKey("JobRoleId")]
[ValidateNever]
public JobRole? JobRole { get; set; }

View File

@ -1,16 +1,24 @@
using System.ComponentModel;
using Marco.Pms.Model.Utilities;
using Marco.Pms.Model.Entitlements;
using Microsoft.AspNetCore.Mvc.ModelBinding.Validation;
using System.ComponentModel;
using System.ComponentModel.DataAnnotations.Schema;
namespace Marco.Pms.Model.Employees
{
public class WorkShift : TenantRelation
public class WorkShift
{
public Guid Id { get; set; }
public int Id { get; set; }
[DisplayName("Shift Name")]
public string? Name { get; set; }
public TimeOnly StartTime { get; set; }
public TimeOnly EndTime { get; set; }
[DisplayName("TenantId")]
public int TenantId { get; set; }
[ValidateNever]
[ForeignKey(nameof(TenantId))]
public Tenant? Tenant { get; set; }
}
}

View File

@ -2,11 +2,11 @@
{
public class ActivityCheckList
{
public Guid Id { get; set; }
public Guid ActivityId { get; set; }
public int Id { get; set; }
public int ActivityId { get; set; }
public string? Description { get; set; } = string.Empty;
public bool IsChecked { get; set; } = false;
public bool IsMandatory { get; set; }
public Guid TenantId { get; set; }
public int TenantId { get; set; }
}
}

View File

@ -0,0 +1,22 @@
using System.ComponentModel;
using System.ComponentModel.DataAnnotations.Schema;
using Microsoft.AspNetCore.Mvc.ModelBinding.Validation;
namespace Marco.Pms.Model.Entitlements
{
public class ActivityMaster
{
public int Id { get; set; }
public string? ActivityName { get; set; }
public string? UnitOfMeasurement { get; set; }
[DisplayName("TenantId")]
public int TenantId { get; set; }
[ValidateNever]
[ForeignKey(nameof(TenantId))]
public Tenant? Tenant { get; set; }
public bool IsActive { get; set; } = true;
}
}

View File

@ -1,15 +1,14 @@
namespace Marco.Pms.Model.Roles
namespace Marco.Pms.Model.Entitlements
{
public class ApplicationRole
{
public Guid Id { get; set; }
public string? Role { get; set; }
public string? Description { get; set; }
public bool IsSystem { get; set; } = false;
public Guid TenantId { get; set; }
public int TenantId { get; set; }
}
}

View File

@ -1,5 +1,9 @@
using System.ComponentModel;
using Microsoft.AspNetCore.Identity;
using Microsoft.AspNetCore.Identity;
using Microsoft.AspNetCore.Mvc.ModelBinding.Validation;
using Microsoft.Extensions.Logging;
using System.ComponentModel;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
namespace Marco.Pms.Model.Entitlements
{
@ -10,7 +14,7 @@ namespace Marco.Pms.Model.Entitlements
[DisplayName("TenantId")]
public Guid TenantId { get; set; }
public int TenantId { get; set; }
public bool? IsRootUser { get; set; } = false;

View File

@ -2,8 +2,8 @@
{
public class CheckListMappings
{
public Guid Id { get; set; }
public Guid TaskAllocationId { get; set; }
public Guid CheckListId { get; set; }
public int Id { get; set; }
public long TaskAllocationId { get; set; }
public int CheckListId { get; set; }
}
}

View File

@ -1,12 +1,12 @@
using System.ComponentModel.DataAnnotations.Schema;
using Marco.Pms.Model.Master;
using Marco.Pms.Model.Industries;
using Microsoft.AspNetCore.Mvc.ModelBinding.Validation;
namespace Marco.Pms.Model.Entitlements
{
public class Tenant
{
public Guid Id { get; set; }
public int Id { get; set; }
public string? Name { get; set; }
public string? Description { get; set; }
public string? DomainName { get; set; }
@ -14,11 +14,11 @@ namespace Marco.Pms.Model.Entitlements
public string? ContactNumber { get; set; }
public DateTime OnBoardingDate { get; set; }
public string? OragnizationSize { get; set; }
public Guid? IndustryId { get; set; }
public int? IndustryId { get;set; }
[ForeignKey("IndustryId")]
[ValidateNever]
public Industry? Industry { get; set; }
public Industry? Industry{ get; set; }
public bool IsActive { get; set; } = true;
}

View File

@ -1,14 +1,13 @@
using System.ComponentModel.DataAnnotations.Schema;
using Marco.Pms.Model.Roles;
using Marco.Pms.Model.Utilities;
using Marco.Pms.Model.Employees;
using Microsoft.AspNetCore.Mvc.ModelBinding.Validation;
namespace Marco.Pms.Model.Employees
namespace Marco.Pms.Model.Entitlements
{
public class EmployeeRoleMapping : TenantRelation
public class EmployeeRoleMapping
{
public Guid Id { get; set; }
public Guid EmployeeId { get; set; }
public int EmployeeId { get; set; }
[ValidateNever]
[ForeignKey(nameof(EmployeeId))]
public Employee? Employee { get; set; } // Navigation property to Employee
@ -20,7 +19,12 @@ namespace Marco.Pms.Model.Employees
public bool IsEnabled { get; set; }
}
public int TenantId { get; set; }
[ValidateNever]
[ForeignKey(nameof(TenantId))]
public Tenant? Tenant { get; set; }
}
}

View File

@ -1,13 +1,12 @@
using System.ComponentModel.DataAnnotations.Schema;
using Marco.Pms.Model.Entitlements;
using Microsoft.AspNetCore.Mvc.ModelBinding.Validation;
using Microsoft.AspNetCore.Mvc.ModelBinding.Validation;
using System.ComponentModel.DataAnnotations.Schema;
namespace Marco.Pms.Model.Master
namespace Marco.Pms.Model.Entitlements
{
public class Feature
{
public Guid Id { get; set; } // Unique identifier for the feature
public Guid ModuleId { get; set; }
public int ModuleId { get; set; }
[ValidateNever]
[ForeignKey(nameof(ModuleId))]
public Module? Module { get; set; }

View File

@ -1,5 +1,4 @@
using System.ComponentModel.DataAnnotations.Schema;
using Marco.Pms.Model.Master;
using Microsoft.AspNetCore.Mvc.ModelBinding.Validation;
namespace Marco.Pms.Model.Entitlements

View File

@ -0,0 +1,17 @@
using System.ComponentModel.DataAnnotations.Schema;
using Microsoft.AspNetCore.Mvc.ModelBinding.Validation;
namespace Marco.Pms.Model.Entitlements
{
public class JobRole
{
public int Id { get; set; }
public string? Name { get; set; }
public string? Description { get; set; }
public int TenantId { get; set; }
[ValidateNever]
[ForeignKey(nameof(TenantId))]
public Tenant? Tenant { get; set; }
}
}

View File

@ -1,6 +1,6 @@
using System.ComponentModel.DataAnnotations;
namespace Marco.Pms.Model.Master
namespace Marco.Pms.Model.Entitlements
{
public class Module
{
@ -10,14 +10,14 @@ namespace Marco.Pms.Model.Master
Key = Guid.NewGuid().ToString();
}
[Key]
public Guid Id { get; set; }
public int Id { get; set; }
[Required]
public string? Name { get; set; }
public string? Description { get; set; }
public string Key { get; set; }

View File

@ -0,0 +1,19 @@
using System.ComponentModel;
using System.ComponentModel.DataAnnotations.Schema;
using Microsoft.AspNetCore.Mvc.ModelBinding.Validation;
namespace Marco.Pms.Model.Entitlements
{
public class StatusMaster
{
public int Id { get; set; }
public string? Status { get; set; }
[DisplayName("TenantId")]
public int TenantId { get; set; }
[ValidateNever]
[ForeignKey(nameof(TenantId))]
public Tenant? Tenant { get; set; }
}
}

View File

@ -1,21 +0,0 @@
using System.ComponentModel.DataAnnotations.Schema;
using Microsoft.AspNetCore.Mvc.ModelBinding.Validation;
namespace Marco.Pms.Model.Forum
{
public class TicketAttachment
{
public Guid Id { get; set; }
public Guid TicketId { get; set; }
[ValidateNever]
[ForeignKey(nameof(TicketId))]
public TicketForum? Ticket { get; set; }
public Guid? CommentId { get; set; }
[ValidateNever]
[ForeignKey(nameof(CommentId))]
public TicketComment? TicketComment { get; set; }
public string FileName { get; set; } = string.Empty;
public Guid FileId { get; set; }
}
}

View File

@ -1,17 +0,0 @@
using Marco.Pms.Model.Utilities;
namespace Marco.Pms.Model.Forum
{
public class TicketComment : TenantRelation
{
public Guid Id { get; set; }
public Guid TicketId { get; set; }
public Guid AuthorId { get; set; }
public string MessageText { get; set; } = string.Empty;
public DateTime SentAt { get; set; }
public Guid? ParentMessageId { get; set; } // For threaded replies
public ICollection<TicketAttachment>? Attachments { get; set; }
}
}

View File

@ -1,38 +0,0 @@
using System.ComponentModel.DataAnnotations.Schema;
using Marco.Pms.Model.Master;
using Marco.Pms.Model.Utilities;
using Microsoft.AspNetCore.Mvc.ModelBinding.Validation;
namespace Marco.Pms.Model.Forum
{
public class TicketForum : TenantRelation
{
public Guid Id { get; set; }
public string Subject { get; set; } = string.Empty;
public string Description { get; set; } = string.Empty;
public Guid StatusId { get; set; }
[ValidateNever]
[ForeignKey(nameof(StatusId))]
public TicketStatusMaster? TicketStatusMaster { get; set; }
public Guid TypeId { get; set; } // QualityIssue, HelpDesk, Feedback
[ValidateNever]
[ForeignKey(nameof(TypeId))]
public TicketTypeMaster? TicketTypeMaster { get; set; }
public Guid CreatedById { get; set; }
public DateTime CreatedAt { get; set; }
public Guid? LinkedProjectId { get; set; }
public Guid? LinkedActivityId { get; set; } // task or project ID
//public ICollection<TicketComment>? Comments { get; set; } // view model
//public ICollection<TicketAttachment>? Attachments { get; set; } // view model
public Guid PriorityId { get; set; }
[ValidateNever]
[ForeignKey(nameof(PriorityId))]
public TicketPriorityMaster? Priority { get; set; }
//public ICollection<TicketTag>? Tags { get; set; } // view model
}
}

View File

@ -1,15 +0,0 @@
using Marco.Pms.Model.Master;
namespace Marco.Pms.Model.Forum
{
public class TicketTag
{
public Guid Id { get; set; }
public Guid TicketId { get; set; }
public TicketForum? Ticket { get; set; }
public Guid TagId { get; set; }
public TicketTagMaster? Tag { get; set; }
}
}

View File

@ -1,8 +1,8 @@
namespace Marco.Pms.Model.Master
namespace Marco.Pms.Model.Industries
{
public class Industry
{
public Guid Id { get; set; }
public int Id { get; set; }
public string? Name { get; set; }
}
}

View File

@ -1,14 +1,13 @@
using Marco.Pms.Model.Activities;
using Marco.Pms.Model.Dtos.Activities;
using Marco.Pms.Model.Entitlements;
using Marco.Pms.Model.Master;
using Marco.Pms.Model.ViewModels.Activities;
#nullable disable
namespace Marco.Pms.Model.Mapper
{
public static class ActivitiesMapper
{
public static TaskAllocation ToTaskAllocationFromAssignTaskDto(this AssignTaskDto assignTask, Guid EmployeeId, Guid tenantId)
public static TaskAllocation ToTaskAllocationFromAssignTaskDto(this AssignTaskDto assignTask, int EmployeeId,int tenantId)
{
return new TaskAllocation
{
@ -21,29 +20,27 @@ namespace Marco.Pms.Model.Mapper
TenantId = tenantId
};
}
public static TaskComment ToCommentFromReportTaskDto(this ReportTaskDto reportTask, Guid tenantId, Guid EmployeeId)
public static TaskComment ToCommentFromReportTaskDto(this ReportTaskDto reportTask, int tenantId, int EmployeeId)
{
return new TaskComment
{
TaskAllocationId = reportTask.Id,
CommentDate = reportTask.ReportedDate,
Comment = reportTask.Comment ?? string.Empty,
Comment = reportTask.Comment,
CommentedBy = EmployeeId,
TenantId = tenantId
};
}
public static TaskComment ToCommentFromCommentDto(this CreateCommentDto createComment, Guid tenantId, Guid EmployeeId)
{
return new TaskComment
{
public static TaskComment ToCommentFromCommentDto(this CreateCommentDto createComment, int tenantId, int EmployeeId) {
return new TaskComment {
TaskAllocationId = createComment.TaskAllocationId,
CommentDate = createComment.CommentDate,
Comment = createComment.Comment ?? string.Empty,
Comment = createComment.Comment,
CommentedBy = EmployeeId,
TenantId = tenantId
};
}
public static TaskVM TaskAllocationToTaskVM(this TaskAllocation taskAllocation, string employeeName)
public static TaskVM TaskAllocationToTaskVM(this TaskAllocation taskAllocation,string employeeName,string tenant )
{
return new TaskVM
{
@ -54,6 +51,7 @@ namespace Marco.Pms.Model.Mapper
ReportedDate = taskAllocation.ReportedDate,
Description = taskAllocation.Description,
AssignBy = employeeName,
Tenant = tenant,
WorkItem = taskAllocation.WorkItem
};
}
@ -65,10 +63,11 @@ namespace Marco.Pms.Model.Mapper
AssignmentDate = taskAllocation.AssignmentDate,
PlannedTask = taskAllocation.PlannedTask,
CompletedTask = taskAllocation.CompletedTask,
ReportedDate = taskAllocation.ReportedDate,
ReportedDate= taskAllocation.ReportedDate,
Description = taskAllocation.Description,
AssignedBy = taskAllocation.Employee != null ? taskAllocation.Employee.ToEmployeeVMFromEmployee() : new ViewModels.Employee.EmployeeVM(),
WorkItemId = taskAllocation.WorkItemId
AssignedBy = taskAllocation.Employee.ToEmployeeVMFromEmployee(),
WorkItemId = taskAllocation.WorkItemId,
TenantId = taskAllocation.TenantId
};
}
public static ReportTaskVM ToReportTaskVMFromTaskAllocation(this TaskAllocation taskAllocation)
@ -82,10 +81,11 @@ namespace Marco.Pms.Model.Mapper
ReportedDate = taskAllocation.ReportedDate,
Description = taskAllocation.Description,
AssignedBy = taskAllocation.AssignedBy,
WorkItemId = taskAllocation.WorkItemId
WorkItemId = taskAllocation.WorkItemId,
TenantId = taskAllocation.TenantId
};
}
public static ActivityMaster ToActivityMasterFromCreateActivityMasterDto(this CreateActivityMasterDto createActivity, Guid tenantId)
public static ActivityMaster ToActivityMasterFromCreateActivityMasterDto(this CreateActivityMasterDto createActivity,int tenantId)
{
return new ActivityMaster
{
@ -102,11 +102,12 @@ namespace Marco.Pms.Model.Mapper
Id = taskAllocation.Id,
AssignmentDate = taskAllocation.AssignmentDate,
PlannedTask = taskAllocation.PlannedTask,
ReportedDate = taskAllocation.ReportedDate,
CompletedTask = taskAllocation.CompletedTask,
AssignedBy = taskAllocation.Employee != null ? taskAllocation.Employee.ToBasicEmployeeVMFromEmployee() : new BasicEmployeeVM(),
AssignedBy = taskAllocation.Employee.ToBasicEmployeeVMFromEmployee(),
WorkItemId = taskAllocation.WorkItemId,
WorkItem = taskAllocation.WorkItem
WorkItem = taskAllocation.WorkItem,
TenantId = taskAllocation.TenantId,
//CheckList =
};
}
public static CommentVM ToCommentVMFromTaskComment(this TaskComment comment)
@ -118,11 +119,11 @@ namespace Marco.Pms.Model.Mapper
CommentDate = comment.CommentDate,
Comment = comment.Comment,
CommentedBy = comment.CommentedBy,
Employee = comment.Employee != null ? comment.Employee.ToBasicEmployeeVMFromEmployee() : new BasicEmployeeVM()
Employee = comment.Employee.ToBasicEmployeeVMFromEmployee()
};
}
public static ActivityVM ToActivityVMFromActivityMaster(this ActivityMaster activity, List<CheckListVM> checkList)
public static ActivityVM ToActivityVMFromActivityMaster(this ActivityMaster activity,List<CheckListVM> checkList)
{
return new ActivityVM
{
@ -132,7 +133,7 @@ namespace Marco.Pms.Model.Mapper
CheckLists = checkList,
};
}
public static CheckListVM ToCheckListVMFromActivityCheckList(this ActivityCheckList checkList, Guid activityId, bool IsChecked)
public static CheckListVM ToCheckListVMFromActivityCheckList(this ActivityCheckList checkList,int activityId,bool IsChecked)
{
return new CheckListVM
{
@ -143,18 +144,18 @@ namespace Marco.Pms.Model.Mapper
IsMandatory = checkList.IsMandatory,
};
}
public static ActivityCheckList ToActivityCheckListFromCreateCheckListDto(this CreateCheckListDto checkListDto, Guid tenantId, Guid activityId)
public static ActivityCheckList ToActivityCheckListFromCreateCheckListDto(this CreateCheckListDto checkListDto,int tenantId,int activityId)
{
return new ActivityCheckList
{
Id = checkListDto.Id != null ? checkListDto.Id.Value : Guid.Empty,
Id = checkListDto.Id,
Description = checkListDto.Description,
ActivityId = activityId,
IsMandatory = checkListDto.IsMandatory,
TenantId = tenantId
};
}
public static CheckListVM ToCheckListVMFromReportCheckListDto(this ReportCheckListDto checkListDto, Guid activityId)
public static CheckListVM ToCheckListVMFromReportCheckListDto(this ReportCheckListDto checkListDto, int activityId)
{
return new CheckListVM
{

View File

@ -1,7 +1,6 @@
using Marco.Pms.Model.Dtos.Roles;
using Marco.Pms.Model.Roles;
using Marco.Pms.Model.Entitlements;
using Marco.Pms.Model.ViewModels;
using Marco.Pms.Model.ViewModels.Roles;
#nullable disable
namespace Marco.Pms.Model.Mapper
{
@ -13,12 +12,11 @@ namespace Marco.Pms.Model.Mapper
{
Id = model.Id,
Role = model.Role,
IsSystem = model.IsSystem,
Description = model.Description,
//FeaturePermission = model.FeaturePermissions
};
}
public static ApplicationRole ToApplicationRoleFromCreateDto(this CreateApplicationRoleDto model, Guid TenantId)
public static ApplicationRole ToApplicationRoleFromCreateDto(this CreateApplicationRoleDto model, int TenantId)
{
return new ApplicationRole
{
@ -29,7 +27,7 @@ namespace Marco.Pms.Model.Mapper
};
}
public static ApplicationRole ToApplicationRoleFromUpdateDto(this UpdateApplicationRoleDto model, Guid TenantId)
public static ApplicationRole ToApplicationRoleFromUpdateDto(this UpdateApplicationRoleDto model, int TenantId)
{
return new ApplicationRole
{
@ -41,7 +39,7 @@ namespace Marco.Pms.Model.Mapper
};
}
public static JobRole ToJobRoleFromCreateJobRoleDot(this CreateJobRoleDto model, Guid TenantId)
public static JobRole ToJobRoleFromCreateJobRoleDot(this CreateJobRoleDto model, int TenantId)
{
return new JobRole
{
@ -52,7 +50,7 @@ namespace Marco.Pms.Model.Mapper
};
}
public static JobRole ToJobRoleFromUpdateJobRoleDot(this UpdateJobRoleDto model, Guid TenantId)
public static JobRole ToJobRoleFromUpdateJobRoleDot(this UpdateJobRoleDto model, int TenantId)
{
return new JobRole
{
@ -74,4 +72,4 @@ namespace Marco.Pms.Model.Mapper
}
}
}
}

View File

@ -1,29 +0,0 @@
using Marco.Pms.Model.AttendanceModule;
using Marco.Pms.Model.ViewModels.Activities;
using Marco.Pms.Model.ViewModels.AttendanceVM;
namespace Marco.Pms.Model.Mapper
{
public static class AttendanceMapper
{
public static AttendanceLogVM ToAttendanceLogVMFromAttendanceLog(this AttendanceLog attendanceLog, string preSignedUrl, string thumbPreSignedUrl)
{
return new AttendanceLogVM
{
Id = attendanceLog.Id,
Comment = attendanceLog.Comment,
Employee = attendanceLog.Employee != null ? attendanceLog.Employee.ToBasicEmployeeVMFromEmployee() : new BasicEmployeeVM(),
ActivityTime = attendanceLog.ActivityTime,
Activity = attendanceLog.Activity,
Photo = attendanceLog.Photo,
Latitude = attendanceLog.Latitude,
Longitude = attendanceLog.Longitude,
UpdatedOn = attendanceLog.UpdatedOn,
UpdatedByEmployee = attendanceLog.UpdatedByEmployee != null ? attendanceLog.UpdatedByEmployee.ToBasicEmployeeVMFromEmployee() : new BasicEmployeeVM(),
DocumentId = attendanceLog.Document != null ? attendanceLog.Document.Id : null,
PreSignedUrl = preSignedUrl,
ThumbPreSignedUrl = thumbPreSignedUrl,
};
}
}
}

View File

@ -29,12 +29,23 @@ namespace Marco.Pms.Model.Mapper
PhoneNumber = model.PhoneNumber,
Photo = model.Photo,
IsActive = model.IsActive,
IsSystem = model.IsSystem,
JoiningDate = model.JoiningDate
};
}
public static BasicEmployeeVM ToBasicEmployeeVMFromEmployee(this Employee employee)
{
if (employee.JobRole == null)
{
return new BasicEmployeeVM
{
Id = employee.Id,
FirstName = employee.FirstName,
LastName = employee.LastName,
Photo = employee.Photo,
JobRoleId = employee.JobRoleId,
JobRoleName = ""
};
}
return new BasicEmployeeVM
{
Id = employee.Id,
@ -42,7 +53,7 @@ namespace Marco.Pms.Model.Mapper
LastName = employee.LastName,
Photo = employee.Photo,
JobRoleId = employee.JobRoleId,
JobRoleName = employee.JobRole != null ? employee.JobRole.Name : ""
JobRoleName = employee.JobRole.Name
};
}
}

View File

@ -1,5 +1,5 @@
using Marco.Pms.Model.Dtos.Employees;
using Marco.Pms.Model.Employees;
using Marco.Pms.Model.Entitlements;
namespace Marco.Pms.Model.Mapper
{
@ -15,12 +15,12 @@ namespace Marco.Pms.Model.Mapper
// Features = model.Features
// };
//}
public static EmployeeRoleMapping ToEmployeeRoleMappingFromEmployeeRoleDot(this EmployeeRoleDot model, Guid TenantId)
public static EmployeeRoleMapping ToEmployeeRoleMappingFromEmployeeRoleDot(this EmployeeRoleDot model, int TenantId)
{
Guid id = (string.IsNullOrEmpty(model.Id) ? Guid.NewGuid() : new Guid(model.Id));
Guid id = (string.IsNullOrEmpty(model.Id ) ?Guid.NewGuid() : new Guid(model.Id));
return new EmployeeRoleMapping
{
Id = id,
Id = id,
RoleId = model.RoleId,
EmployeeId = model.EmployeeId,
IsEnabled = model.IsEnabled,
@ -28,7 +28,7 @@ namespace Marco.Pms.Model.Mapper
};
}
//public static EmployeeRole ToEmployeeRoleFromUpdateDto(this UpdateApplicationRoleDto model, int TenantId)
//{
// return new EmployeeRole

View File

@ -1,5 +1,5 @@
using Marco.Pms.Model.Entitlements;
using Marco.Pms.Model.ViewModels.Master;
using Marco.Pms.Model.ViewModels;
namespace Marco.Pms.Model.Mapper
{

View File

@ -1,252 +0,0 @@
using Marco.Pms.Model.DocumentManager;
using Marco.Pms.Model.Dtos.Forum;
using Marco.Pms.Model.Dtos.Master;
using Marco.Pms.Model.Employees;
using Marco.Pms.Model.Forum;
using Marco.Pms.Model.Master;
using Marco.Pms.Model.ViewModels.Forum;
namespace Marco.Pms.Model.Mapper
{
public static class ForumMapper
{
public static TicketForum ToTicketForumFromCreateTicketDto(this CreateTicketDto createTicketDto, Guid tenantId)
{
return new TicketForum
{
Subject = createTicketDto.Subject,
Description = createTicketDto.Description,
StatusId = createTicketDto.StatusId,
TypeId = createTicketDto.TypeId,
CreatedById = createTicketDto.CreatedById,
CreatedAt = createTicketDto.CreatedAt,
LinkedProjectId = createTicketDto.LinkedProjectId,
LinkedActivityId = createTicketDto.LinkedActivityId,
PriorityId = createTicketDto.PriorityId,
TenantId = tenantId,
};
}
public static TicketForum ToTicketForumFromUpdateTicketDto(this UpdateTicketDto updateTicketDto, TicketForum ticket)
{
return new TicketForum
{
Id = updateTicketDto.Id,
Subject = updateTicketDto.Subject,
Description = updateTicketDto.Description,
StatusId = updateTicketDto.StatusId,
TypeId = updateTicketDto.TypeId,
CreatedById = ticket.CreatedById,
CreatedAt = ticket.CreatedAt,
LinkedProjectId = ticket.LinkedProjectId,
LinkedActivityId = ticket.LinkedActivityId,
PriorityId = updateTicketDto.PriorityId,
TenantId = ticket.TenantId
};
}
public static TicketComment ToTicketCommentFromAddCommentDto(this AddCommentDto commentDto, Guid tenantId)
{
return new TicketComment
{
TicketId = commentDto.TicketId,
AuthorId = commentDto.AuthorId,
MessageText = commentDto.MessageText,
SentAt = commentDto.SentAt,
ParentMessageId = commentDto.ParentMessageId,
TenantId = tenantId,
};
}
public static TicketComment ToTicketCommentFromUpdateCommentDto(this UpdateCommentDto updateComment, Guid tenantId, TicketComment comment)
{
return new TicketComment
{
Id = updateComment.Id,
TicketId = updateComment.TicketId,
AuthorId = comment.AuthorId,
MessageText = updateComment.MessageText,
SentAt = comment.SentAt,
ParentMessageId = updateComment.ParentMessageId,
TenantId = tenantId,
};
}
public static TicketAttachment ToTicketAttachmentFromForumAttachmentDto(this ForumAttachmentDto AttachmentDto, Guid ticketId, Guid fileId, Guid? commentId = null)
{
return new TicketAttachment
{
TicketId = ticketId,
CommentId = commentId,
FileName = AttachmentDto.FileName,
FileId = fileId,
};
}
public static TicketAttachment ToTicketAttachmentFromUpdateAttachmentDto(this UpdateAttachmentDto AttachmentDto, Guid ticketId, Guid fileId, Guid? commentId = null)
{
return new TicketAttachment
{
TicketId = ticketId,
CommentId = commentId,
FileName = AttachmentDto.FileName,
FileId = fileId,
};
}
public static Document ToDocumentFromForumAttachmentDto(this ForumAttachmentDto AttachmentDto, string objectKey, string thumbS3Key, DateTime uploadedAt, Guid tenantId)
{
return new Document
{
FileName = AttachmentDto.FileName,
ContentType = AttachmentDto.ContentType,
S3Key = objectKey,
ThumbS3Key = thumbS3Key,
Base64Data = AttachmentDto.Base64Data,
FileSize = AttachmentDto.FileSize,
UploadedAt = uploadedAt,
TenantId = tenantId
};
}
public static Document ToDocumentFromUpdateAttachmentDto(this UpdateAttachmentDto AttachmentDto, string objectKey, string thumbS3Key, DateTime uploadedAt, Guid tenantId)
{
return new Document
{
FileName = AttachmentDto.FileName,
ContentType = AttachmentDto.ContentType,
S3Key = objectKey,
ThumbS3Key = thumbS3Key,
Base64Data = AttachmentDto.Base64Data,
FileSize = AttachmentDto.FileSize,
UploadedAt = uploadedAt,
TenantId = tenantId
};
}
public static ForumTicketVM ToForumTicketVMFromTicketForum(this TicketForum ticket, Employee employee)
{
return new ForumTicketVM
{
Id = ticket.Id,
Subject = ticket.Subject,
Description = ticket.Description,
CreatedAt = ticket.CreatedAt,
LinkedProjectId = ticket.LinkedProjectId,
LinkedActivityId = ticket.LinkedActivityId,
Status = ticket.TicketStatusMaster != null ? ticket.TicketStatusMaster.ToTicketStatusVMFromTicketStatusMaster() : new TicketStatusVM(),
Priority = ticket.Priority != null ? ticket.Priority.ToTicketPriorityVMFromTicketPriorityMaster() : new TicketPriorityVM(),
Type = ticket.TicketTypeMaster != null ? ticket.TicketTypeMaster.ToTicketTypeVMFromTicketTypeMaster() : new TicketTypeVM(),
CreatedBy = employee.ToBasicEmployeeVMFromEmployee(),
};
}
public static TicketAttachmentVM ToTicketAttachmentVMFromTicketAttachment(this TicketAttachment attachment, string preSignedUrl, string thumbPreSignedUrl)
{
return new TicketAttachmentVM
{
Id = attachment.Id,
TicketId = attachment.TicketId,
CommentId = attachment.CommentId,
FileName = attachment.FileName,
PreSignedUrl = preSignedUrl,
ThumbPreSignedUrl = thumbPreSignedUrl
};
}
public static TicketCommentVM ToTicketCommentVMFromTicketComment(this TicketComment comment, Employee employee)
{
return new TicketCommentVM
{
Id = comment.Id,
TicketId = comment.TicketId,
Author = employee.ToBasicEmployeeVMFromEmployee(),
MessageText = comment.MessageText,
SentAt = comment.SentAt,
ParentMessageId = comment.ParentMessageId,
Attachments = new List<TicketAttachmentVM>()
};
}
public static TicketStatusVM ToTicketStatusVMFromTicketStatusMaster(this TicketStatusMaster statusMaster)
{
return new TicketStatusVM
{
Id = statusMaster.Id,
Name = statusMaster.Name,
Description = statusMaster.Description,
ColorCode = statusMaster.ColorCode,
IsDefault = statusMaster.IsDefault
};
}
public static TicketStatusMaster ToTicketStatusMasterFromTicketStatusMasterDto(this TicketStatusMasterDto statusMasterDto, Guid tenantId)
{
return new TicketStatusMaster
{
Id = statusMasterDto.Id != null ? statusMasterDto.Id.Value : Guid.Empty,
Name = statusMasterDto.Name,
Description = statusMasterDto.Description,
ColorCode = statusMasterDto.ColorCode,
IsDefault = statusMasterDto.IsDefault,
TenantId = tenantId
};
}
public static TicketPriorityVM ToTicketPriorityVMFromTicketPriorityMaster(this TicketPriorityMaster priorityMaster)
{
return new TicketPriorityVM
{
Id = priorityMaster.Id,
Name = priorityMaster.Name,
Level = priorityMaster.Level,
ColorCode = priorityMaster.ColorCode,
IsDefault = priorityMaster.IsDefault
};
}
public static TicketPriorityMaster ToTicketPriorityMasterFromTicketPriorityMasterDto(this TicketPriorityMasterDto priorityMasterDto, Guid tenantId)
{
return new TicketPriorityMaster
{
Id = priorityMasterDto.Id != null ? priorityMasterDto.Id.Value : Guid.Empty,
Name = priorityMasterDto.Name,
Level = priorityMasterDto.Level,
ColorCode = priorityMasterDto.ColorCode,
IsDefault = priorityMasterDto.IsDefault,
TenantId = tenantId
};
}
public static TicketTypeVM ToTicketTypeVMFromTicketTypeMaster(this TicketTypeMaster typeMaster)
{
return new TicketTypeVM
{
Id = typeMaster.Id,
Name = typeMaster.Name,
Description = typeMaster.Description,
IsDefault = typeMaster.IsDefault
};
}
public static TicketTypeMaster ToTicketTypeMasterFromTicketTypeMasterDto(this TicketTypeMasterDto typeMasterDto, Guid tenantId)
{
return new TicketTypeMaster
{
Id = typeMasterDto.Id != null ? typeMasterDto.Id.Value : Guid.Empty,
Name = typeMasterDto.Name,
Description = typeMasterDto.Description,
IsDefault = typeMasterDto.IsDefault,
TenantId = tenantId
};
}
public static TicketTagVM ToTicketTagVMFromTicketTagMaster(this TicketTagMaster tagMaster)
{
return new TicketTagVM
{
Id = tagMaster.Id,
Name = tagMaster.Name,
ColorCode = tagMaster.ColorCode,
IsDefault = tagMaster.IsDefault
};
}
public static TicketTagMaster ToTicketTagMasterFromTicketTagMasterDto(this TicketTagMasterDto tagMasterDto, Guid tenantId)
{
return new TicketTagMaster
{
Id = tagMasterDto.Id != null ? tagMasterDto.Id.Value : Guid.Empty,
Name = tagMasterDto.Name,
ColorCode = tagMasterDto.ColorCode,
IsDefault = tagMasterDto.IsDefault,
TenantId = tenantId
};
}
}
}

View File

@ -5,61 +5,60 @@ namespace Marco.Pms.Model.Mapper
{
public static class BuildingMapper
{
public static Building ToBuildingFromBuildingDto(this BuildingDot model, Guid tenantId)
public static Building ToBuildingFromBuildingDto(this BuildingDot model)
{
return new Building
{
Id = model.Id != null ? model.Id.Value : Guid.Empty,
Id = model.Id,
Description = model.Description,
Name = model.Name,
ProjectId = model.ProjectId,
TenantId = tenantId,
TenantId = model.TenantId,
};
}
}
public static class FloorMapper
{
public static Floor ToFloorFromFloorDto(this FloorDot model, Guid tenantId)
public static Floor ToFloorFromFloorDto(this FloorDot model)
{
return new Floor
{
Id = model.Id != null ? model.Id.Value : Guid.Empty,
Id = model.Id,
FloorName = model.FloorName,
BuildingId = model.BuildingId,
TenantId = tenantId
TenantId = model.TenantId
};
}
}
public static class WorAreaMapper
{
public static WorkArea ToWorkAreaFromWorkAreaDto(this WorkAreaDot model, Guid tenantId)
public static WorkArea ToWorkAreaFromWorkAreaDto(this WorkAreaDot model)
{
return new WorkArea
{
Id = model.Id != null ? model.Id.Value : Guid.Empty,
Id = model.Id,
AreaName = model.AreaName,
FloorId = model.FloorId,
TenantId = tenantId
TenantId = model.TenantId
};
}
}
public static class WorkItemMapper
{
public static WorkItem ToWorkItemFromWorkItemDto(this WorkItemDot model, Guid tenantId)
public static WorkItem ToWorkItemFromWorkItemDto(this WorkItemDot model)
{
return new WorkItem
{
Id = model.Id != null ? model.Id.Value : Guid.Empty,
Id = model.Id,
ActivityId = model.ActivityID,
CompletedWork = model.CompletedWork,
PlannedWork = model.PlannedWork,
WorkCategoryId = model.WorkCategoryId,
TaskDate = DateTime.Now,
TenantId = tenantId,
WorkAreaId = model.WorkAreaID
TenantId = model.TenantId,
WorkAreaId = model.WorkAreaID
};
}

View File

@ -5,11 +5,10 @@ namespace Marco.Pms.Model.Mapper
{
public static class InquiryMapper
{
public static Inquiries ToInquiriesFromInquiriesDto(this InquiryDto inquiryDto)
{
public static Inquiries ToInquiriesFromInquiriesDto(this InquiryDto inquiryDto) {
return new Inquiries
{
Id = Guid.Empty,
Id = 0,
OrganizatioinName = inquiryDto.OrganizatioinName,
OragnizationSize = inquiryDto.OragnizationSize,
IndustryId = inquiryDto.IndustryId,
@ -20,7 +19,7 @@ namespace Marco.Pms.Model.Mapper
};
}
public static InquiryEmailObject ToInquiryEmailObjectFromInquiriesDto(this InquiryDto inquiryDto, string industryName)
public static InquiryEmailObject ToInquiryEmailObjectFromInquiriesDto(this InquiryDto inquiryDto,string industryName)
{
return new InquiryEmailObject
{

View File

@ -1,31 +0,0 @@
using Marco.Pms.Model.Dtos.Master;
using Marco.Pms.Model.Master;
using Marco.Pms.Model.ViewModels.Master;
namespace Marco.Pms.Model.Mapper
{
public static class MasterMapper
{
// -------------------------------- Work Category --------------------------------
public static WorkCategoryMaster ToWorkCategoryMasterFromWorkCategoryMasterDto(this WorkCategoryMasterDto categoryMasterDto, Guid tenantId)
{
return new WorkCategoryMaster
{
Id = categoryMasterDto.Id ?? Guid.Empty,
Name = categoryMasterDto.Name,
Description = categoryMasterDto.Description ?? "",
TenantId = tenantId
};
}
public static WorkCategoryMasterVM ToWorkCategoryMasterVMFromWorkCategoryMaster(this WorkCategoryMaster categoryMaster)
{
return new WorkCategoryMasterVM
{
Id = categoryMaster.Id,
Name = categoryMaster.Name,
Description = categoryMaster.Description ?? "",
IsSystem = categoryMaster.IsSystem
};
}
}
}

View File

@ -1,6 +1,6 @@
using Marco.Pms.Model.Dtos.Project;
using Marco.Pms.Model.Projects;
using Marco.Pms.Model.ViewModels.Projects;
using Marco.Pms.Model.ViewModels;
namespace Marco.Pms.Model.Mapper
{
@ -16,11 +16,12 @@ namespace Marco.Pms.Model.Mapper
Name = projectModel.Name,
EndDate = projectModel.EndDate,
StartDate = projectModel.StartDate,
TenantId = projectModel.TenantId,
ProjectStatusId = projectModel.ProjectStatusId
};
}
public static Project ToProjectFromCreateProjectDto(this CreateProjectDto projectModel, Guid TenantId)
public static Project ToProjectFromCreateProjectDto(this CreateProjectDto projectModel, int TenantId)
{
return new Project
{
@ -34,7 +35,7 @@ namespace Marco.Pms.Model.Mapper
};
}
public static Project ToProjectFromUpdateProjectDto(this UpdateProjectDto projectModel, Guid TenantId, Guid id)
public static Project ToProjectFromUpdateProjectDto(this UpdateProjectDto projectModel, int TenantId,int id)
{
return new Project
{
@ -49,7 +50,7 @@ namespace Marco.Pms.Model.Mapper
};
}
public static ProjectAllocation ToProjectAllocationFromProjectAllocationDto(this ProjectAllocationDot model, Guid TenantId)
public static ProjectAllocation ToProjectAllocationFromProjectAllocationDto(this ProjectAllocationDot model, int TenantId)
{
return new ProjectAllocation
{
@ -72,6 +73,7 @@ namespace Marco.Pms.Model.Mapper
ContactPerson = project.ContactPerson,
StartDate = project.StartDate,
EndDate = project.EndDate,
TenantId = project.TenantId
};
}
}

View File

@ -1,14 +0,0 @@
using Marco.Pms.Model.Utilities;
namespace Marco.Pms.Model.Master
{
public class ActivityMaster : TenantRelation
{
public Guid Id { get; set; }
public string? ActivityName { get; set; }
public string? UnitOfMeasurement { get; set; }
public bool IsActive { get; set; } = true;
}
}

Some files were not shown because too many files have changed in this diff Show More