Activity_Hierarchy #94

Open
ashutosh.nehete wants to merge 15 commits from Activity_Hierarchy into main
15 changed files with 8615 additions and 6 deletions
Showing only changes of commit f3cf2092a9 - Show all commits

View File

@ -32,6 +32,8 @@ namespace Marco.Pms.DataAccess.Data
public DbSet<RefreshToken> RefreshTokens { get; set; } public DbSet<RefreshToken> RefreshTokens { get; set; }
public DbSet<Tenant> Tenants { get; set; } public DbSet<Tenant> Tenants { get; set; }
public DbSet<ApplicationUser> ApplicationUsers { get; set; } public DbSet<ApplicationUser> ApplicationUsers { get; set; }
public DbSet<ServicesMaster> ServicesMasters { get; set; }
public DbSet<ActivityGroupMaster> ActivityGroupMasters { get; set; }
public DbSet<ActivityMaster> ActivityMasters { get; set; } public DbSet<ActivityMaster> ActivityMasters { get; set; }
public DbSet<Project> Projects { get; set; } public DbSet<Project> Projects { get; set; }
public DbSet<ProjectAllocation> ProjectAllocations { get; set; } public DbSet<ProjectAllocation> ProjectAllocations { get; set; }
@ -461,7 +463,265 @@ namespace Marco.Pms.DataAccess.Data
TenantId = Guid.Parse("b3466e83-7e11-464c-b93a-daf047838b26") TenantId = Guid.Parse("b3466e83-7e11-464c-b93a-daf047838b26")
} }
); );
modelBuilder.Entity<ServicesMaster>().HasData(
new ServicesMaster
{
Id = new Guid("0aa3e986-d6a4-49b4-818b-564d2d7799a2"),
Name = "Civil",
Description = "Construction Civil service involves planning, designing, and overseeing infrastructure and building projects",
IsSystem = true,
TenantId = Guid.Parse("b3466e83-7e11-464c-b93a-daf047838b26")
},
new ServicesMaster
{
Id = new Guid("fa208600-b761-480d-95ad-98cad2e61c9b"),
Name = "Plumbing",
Description = "Plumbing service involves installing, maintaining, and repairing systems for water supply, drainage, and sewage in residential, commercial, and industrial buildings",
IsSystem = true,
TenantId = Guid.Parse("b3466e83-7e11-464c-b93a-daf047838b26")
},
new ServicesMaster
{
Id = new Guid("e3c1d91d-7e86-4257-9c2d-04a4352d8283"),
Name = "Electric",
Description = "Electric service involves the installation, maintenance, and repair of electrical systems, including wiring, lighting, and power distribution in buildings and infrastructure",
IsSystem = true,
TenantId = Guid.Parse("b3466e83-7e11-464c-b93a-daf047838b26")
},
new ServicesMaster
{
Id = new Guid("da465f54-0f58-48c8-ab1d-8e31d59b3607"),
Name = "Fire fighting",
Description = "Fire fighting service involves installing and maintaining systems like sprinklers, hydrants, and alarms to detect, control, and extinguish fires in buildings and facilities.",
IsSystem = true,
TenantId = Guid.Parse("b3466e83-7e11-464c-b93a-daf047838b26")
},
new ServicesMaster
{
Id = new Guid("df3805d6-8d02-45cb-9c53-5c42b527ebb6"),
Name = "HVAC",
Description = "HVAC (Heating, Ventilation, and Air Conditioning) service involves the installation, maintenance, and repair of systems that control indoor climate, air quality, and thermal comfort in buildings.",
IsSystem = true,
TenantId = Guid.Parse("b3466e83-7e11-464c-b93a-daf047838b26")
},
new ServicesMaster
{
Id = new Guid("8d196e15-4099-4c9a-9a84-86650d79d4b4"),
Name = "Interior infrastructure",
Description = "Interior infrastructure (Interior Infra) service involves the construction and installation of essential internal structural elements like partitions, ceilings, flooring, and utility layouts to prepare spaces for interior design and functional use.",
IsSystem = true,
TenantId = Guid.Parse("b3466e83-7e11-464c-b93a-daf047838b26")
}
);
modelBuilder.Entity<ActivityGroupMaster>().HasData(
new ActivityGroupMaster
{
Id = new Guid("6f048b41-f909-41dd-af5f-02369ca80639"),
ServiceId = Guid.Parse("0aa3e986-d6a4-49b4-818b-564d2d7799a2"),
Name = "Site Preparation",
Description = "Site Preparation involves clearing, leveling, and preparing the land for construction by removing obstacles, performing excavation, and conducting soil tests.",
IsSystem = true,
TenantId = Guid.Parse("b3466e83-7e11-464c-b93a-daf047838b26")
},
new ActivityGroupMaster
{
Id = new Guid("1d29b7d1-ffdc-486d-ac7b-ee2661ae9979"),
ServiceId = Guid.Parse("0aa3e986-d6a4-49b4-818b-564d2d7799a2"),
Name = "Foundation Work",
Description = "Foundation Work involves excavating, reinforcing, and casting the base structure that supports the entire building load, including footings and plinth beams.",
IsSystem = true,
TenantId = Guid.Parse("b3466e83-7e11-464c-b93a-daf047838b26")
},
new ActivityGroupMaster
{
Id = new Guid("3a712ddb-8927-4d58-8b24-83290e6ba8d1"),
ServiceId = Guid.Parse("0aa3e986-d6a4-49b4-818b-564d2d7799a2"),
Name = "Sub-Structure Work",
Description = "Sub-Structure Work involves constructing the portion of the building below ground level, including plinth beams, basement walls, and backfilling, to support the superstructure.",
IsSystem = true,
TenantId = Guid.Parse("b3466e83-7e11-464c-b93a-daf047838b26")
},
new ActivityGroupMaster
{
Id = new Guid("47fa23fb-0e1c-459e-9cc9-9136c61effbd"),
ServiceId = Guid.Parse("0aa3e986-d6a4-49b4-818b-564d2d7799a2"),
Name = "Super-Structure Work",
Description = "Super-Structure Work involves constructing the part of the building above ground level, including columns, beams, slabs, and walls, forming the main structural framework.",
IsSystem = true,
TenantId = Guid.Parse("b3466e83-7e11-464c-b93a-daf047838b26")
},
new ActivityGroupMaster
{
Id = new Guid("7613959e-5718-4e46-926b-efa45722c844"),
ServiceId = Guid.Parse("fa208600-b761-480d-95ad-98cad2e61c9b"),
Name = "Water Supply System",
Description = "Water Supply System involves installing pipelines, pumps, tanks, and fittings to ensure the reliable distribution of clean water throughout a building or facility.",
IsSystem = true,
TenantId = Guid.Parse("b3466e83-7e11-464c-b93a-daf047838b26")
},
new ActivityGroupMaster
{
Id = new Guid("ba4ada9c-ed35-4d5e-bc9f-216f32612c85"),
ServiceId = Guid.Parse("fa208600-b761-480d-95ad-98cad2e61c9b"),
Name = "Drainage & Wastewater System",
Description = "Drainage & Wastewater System involves installing pipes, traps, and chambers to safely collect and dispose of wastewater and sewage from a building to the municipal or septic system.",
IsSystem = true,
TenantId = Guid.Parse("b3466e83-7e11-464c-b93a-daf047838b26")
},
new ActivityGroupMaster
{
Id = new Guid("44326c01-f69e-430c-a403-d5bf3dcc35d5"),
ServiceId = Guid.Parse("fa208600-b761-480d-95ad-98cad2e61c9b"),
Name = "Rainwater Harvesting",
Description = "Rainwater Harvesting involves collecting, channeling, and storing rainwater from rooftops or surfaces for reuse or groundwater recharge.",
IsSystem = true,
TenantId = Guid.Parse("b3466e83-7e11-464c-b93a-daf047838b26")
},
new ActivityGroupMaster
{
Id = new Guid("3ef85f9f-e23e-4e6f-9cb7-40ec70a184dd"),
ServiceId = Guid.Parse("e3c1d91d-7e86-4257-9c2d-04a4352d8283"),
Name = "Conduiting & Cabling",
Description = "Conduiting & Cabling involves laying electrical conduits and pulling cables to safely route and protect electrical wiring throughout a building.",
IsSystem = true,
TenantId = Guid.Parse("b3466e83-7e11-464c-b93a-daf047838b26")
},
new ActivityGroupMaster
{
Id = new Guid("a71182a5-0579-4624-b252-4cae2ea11948"),
ServiceId = Guid.Parse("e3c1d91d-7e86-4257-9c2d-04a4352d8283"),
Name = "Wiring Installation",
Description = "Wiring Installation involves connecting electrical wires from distribution boards to switches, sockets, and fixtures to provide power and lighting within a building.",
IsSystem = true,
TenantId = Guid.Parse("b3466e83-7e11-464c-b93a-daf047838b26")
},
new ActivityGroupMaster
{
Id = new Guid("b5e2291f-3569-45e5-9c30-ef33ad0abbf1"),
ServiceId = Guid.Parse("e3c1d91d-7e86-4257-9c2d-04a4352d8283"),
Name = "Lighting System",
Description = "Lighting System involves installing and connecting various lighting fixtures, controls, and fittings to ensure proper illumination for indoor and outdoor areas.",
IsSystem = true,
TenantId = Guid.Parse("b3466e83-7e11-464c-b93a-daf047838b26")
},
new ActivityGroupMaster
{
Id = new Guid("56584b0f-b2a5-4a5e-afea-590516473bcd"),
ServiceId = Guid.Parse("da465f54-0f58-48c8-ab1d-8e31d59b3607"),
Name = "Sprinkler System",
Description = "Sprinkler System involves installing a network of pipes and sprinkler heads designed to automatically discharge water to suppress or extinguish fires.",
IsSystem = true,
TenantId = Guid.Parse("b3466e83-7e11-464c-b93a-daf047838b26")
},
new ActivityGroupMaster
{
Id = new Guid("78a12040-4ab6-493a-b199-ee636f45f77f"),
ServiceId = Guid.Parse("da465f54-0f58-48c8-ab1d-8e31d59b3607"),
Name = "Fire Hydrant System",
Description = "Fire Hydrant System involves installing external and internal hydrants, piping, and valves to provide high-pressure water access for manual firefighting during emergencies.",
IsSystem = true,
TenantId = Guid.Parse("b3466e83-7e11-464c-b93a-daf047838b26")
},
new ActivityGroupMaster
{
Id = new Guid("fbb04bec-53a7-4f86-8536-34c4b5c691a2"),
ServiceId = Guid.Parse("da465f54-0f58-48c8-ab1d-8e31d59b3607"),
Name = "Liaisoning",
Description = "Liaisoning Fire Fighting involves coordinating with fire authorities to obtain necessary approvals and no-objection certificates (NOCs) for fire safety systems, ensuring compliance with local fire safety regulations.",
IsSystem = true,
TenantId = Guid.Parse("b3466e83-7e11-464c-b93a-daf047838b26")
},
new ActivityGroupMaster
{
Id = new Guid("6eedb9f1-22e9-4d93-b770-593125085465"),
ServiceId = Guid.Parse("da465f54-0f58-48c8-ab1d-8e31d59b3607"),
Name = "Public Address (PA) System",
Description = "Public Address (PA) System involves installing speakers, microphones, amplifiers, and control units to broadcast announcements, alerts, and emergency messages throughout a building or facility.",
IsSystem = true,
TenantId = Guid.Parse("b3466e83-7e11-464c-b93a-daf047838b26")
},
new ActivityGroupMaster
{
Id = new Guid("97c6f9f5-cd4d-4830-ba14-a81f6ee0d1e2"),
ServiceId = Guid.Parse("da465f54-0f58-48c8-ab1d-8e31d59b3607"),
Name = "Detection and Alarm System",
Description = "Detection and Alarm System involves installing smoke detectors, heat sensors, and fire alarm panels to automatically detect fire or smoke and alert occupants through audible and visual alarms.",
IsSystem = true,
TenantId = Guid.Parse("b3466e83-7e11-464c-b93a-daf047838b26")
},
new ActivityGroupMaster
{
Id = new Guid("cdea8e5f-8b78-4f7e-ab65-bd6b38d81af2"),
ServiceId = Guid.Parse("df3805d6-8d02-45cb-9c53-5c42b527ebb6"),
Name = "HVAC System Design & Planning",
Description = "HVAC System Design & Planning involves calculating heating and cooling loads, selecting appropriate equipment, and designing duct and piping layouts to ensure efficient climate control and air quality.",
IsSystem = true,
TenantId = Guid.Parse("b3466e83-7e11-464c-b93a-daf047838b26")
},
new ActivityGroupMaster
{
Id = new Guid("1805e22d-4220-45cc-8f39-35194c2499a5"),
ServiceId = Guid.Parse("df3805d6-8d02-45cb-9c53-5c42b527ebb6"),
Name = "Ducting Work",
Description = "Ducting Work involves fabricating, installing, and insulating ducts to distribute conditioned air throughout the building as part of the HVAC system.",
IsSystem = true,
TenantId = Guid.Parse("b3466e83-7e11-464c-b93a-daf047838b26")
},
new ActivityGroupMaster
{
Id = new Guid("69819ea6-5550-4325-9097-c52d95db0822"),
ServiceId = Guid.Parse("df3805d6-8d02-45cb-9c53-5c42b527ebb6"),
Name = "Equipment Installation",
Description = "Equipment Installation involves setting up HVAC units such as AHUs, FCUs, chillers, and compressors to enable heating, cooling, and ventilation operations in the building.",
IsSystem = true,
TenantId = Guid.Parse("b3466e83-7e11-464c-b93a-daf047838b26")
},
new ActivityGroupMaster
{
Id = new Guid("fe613446-c399-4a5c-8205-fd3652231f57"),
ServiceId = Guid.Parse("df3805d6-8d02-45cb-9c53-5c42b527ebb6"),
Name = "Ventilation System",
Description = "Ventilation System involves installing exhausts, fresh air units, and ductwork to ensure proper air circulation, removal of stale air, and maintenance of indoor air quality.",
IsSystem = true,
TenantId = Guid.Parse("b3466e83-7e11-464c-b93a-daf047838b26")
},
new ActivityGroupMaster
{
Id = new Guid("0398ba10-f814-404a-a7a2-3bac0f61a9a5"),
ServiceId = Guid.Parse("8d196e15-4099-4c9a-9a84-86650d79d4b4"),
Name = "Partition Work",
Description = "Partition Work involves constructing internal dividing walls using materials like gypsum, glass, or wood to create separate rooms or functional spaces within a building.",
IsSystem = true,
TenantId = Guid.Parse("b3466e83-7e11-464c-b93a-daf047838b26")
},
new ActivityGroupMaster
{
Id = new Guid("9efaa80a-f115-4e78-866a-5e192faa1024"),
ServiceId = Guid.Parse("8d196e15-4099-4c9a-9a84-86650d79d4b4"),
Name = "False Ceiling Work",
Description = "False Ceiling Work involves installing suspended ceilings made of materials like gypsum, metal, or POP to conceal services, improve aesthetics, and enhance acoustic and thermal performance.",
IsSystem = true,
TenantId = Guid.Parse("b3466e83-7e11-464c-b93a-daf047838b26")
},
new ActivityGroupMaster
{
Id = new Guid("c0a9e90c-4c74-417d-b36e-6e63eca16463"),
ServiceId = Guid.Parse("8d196e15-4099-4c9a-9a84-86650d79d4b4"),
Name = "Door & Window Installation",
Description = "Door & Window Installation involves fitting and fixing doors and windows made of wood, aluminum, uPVC, or glass to provide access, ventilation, and natural light within the building.",
IsSystem = true,
TenantId = Guid.Parse("b3466e83-7e11-464c-b93a-daf047838b26")
},
new ActivityGroupMaster
{
Id = new Guid("a27d502b-20ea-4926-b294-3db7110f94e5"),
ServiceId = Guid.Parse("8d196e15-4099-4c9a-9a84-86650d79d4b4"),
Name = "Data & Communication Cabling",
Description = "Data & Communication Cabling involves laying structured cables for internet, telephone, and networking systems to ensure reliable communication and connectivity throughout the building.",
IsSystem = true,
TenantId = Guid.Parse("b3466e83-7e11-464c-b93a-daf047838b26")
}
);
} }
private static void ManageApplicationStructure(ModelBuilder modelBuilder) private static void ManageApplicationStructure(ModelBuilder modelBuilder)

View File

@ -0,0 +1,209 @@
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_Service_And_ActivityGroup_Master_Table : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
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");
migrationBuilder.AddColumn<Guid>(
name: "ActitvityGroupId",
table: "ActivityMasters",
type: "char(36)",
nullable: true,
collation: "ascii_general_ci");
migrationBuilder.AddColumn<Guid>(
name: "ServiceId",
table: "ActivityMasters",
type: "char(36)",
nullable: true,
collation: "ascii_general_ci");
migrationBuilder.CreateTable(
name: "ActivityGroupMasters",
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"),
ServiceId = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
IsSystem = table.Column<bool>(type: "tinyint(1)", nullable: false),
IsActive = 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_ActivityGroupMasters", x => x.Id);
table.ForeignKey(
name: "FK_ActivityGroupMasters_Tenants_TenantId",
column: x => x.TenantId,
principalTable: "Tenants",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
})
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.CreateTable(
name: "ServicesMasters",
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),
IsActive = 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_ServicesMasters", x => x.Id);
table.ForeignKey(
name: "FK_ServicesMasters_Tenants_TenantId",
column: x => x.TenantId,
principalTable: "Tenants",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
})
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.InsertData(
table: "ActivityGroupMasters",
columns: new[] { "Id", "Description", "IsActive", "IsSystem", "Name", "ServiceId", "TenantId" },
values: new object[,]
{
{ new Guid("0398ba10-f814-404a-a7a2-3bac0f61a9a5"), "Partition Work involves constructing internal dividing walls using materials like gypsum, glass, or wood to create separate rooms or functional spaces within a building.", true, true, "Partition Work", new Guid("8d196e15-4099-4c9a-9a84-86650d79d4b4"), new Guid("b3466e83-7e11-464c-b93a-daf047838b26") },
{ new Guid("1805e22d-4220-45cc-8f39-35194c2499a5"), "Ducting Work involves fabricating, installing, and insulating ducts to distribute conditioned air throughout the building as part of the HVAC system.", true, true, "Ducting Work", new Guid("df3805d6-8d02-45cb-9c53-5c42b527ebb6"), new Guid("b3466e83-7e11-464c-b93a-daf047838b26") },
{ new Guid("1d29b7d1-ffdc-486d-ac7b-ee2661ae9979"), "Foundation Work involves excavating, reinforcing, and casting the base structure that supports the entire building load, including footings and plinth beams.", true, true, "Foundation Work", new Guid("0aa3e986-d6a4-49b4-818b-564d2d7799a2"), new Guid("b3466e83-7e11-464c-b93a-daf047838b26") },
{ new Guid("3a712ddb-8927-4d58-8b24-83290e6ba8d1"), "Sub-Structure Work involves constructing the portion of the building below ground level, including plinth beams, basement walls, and backfilling, to support the superstructure.", true, true, "Sub-Structure Work", new Guid("0aa3e986-d6a4-49b4-818b-564d2d7799a2"), new Guid("b3466e83-7e11-464c-b93a-daf047838b26") },
{ new Guid("3ef85f9f-e23e-4e6f-9cb7-40ec70a184dd"), "Conduiting & Cabling involves laying electrical conduits and pulling cables to safely route and protect electrical wiring throughout a building.", true, true, "Conduiting & Cabling", new Guid("e3c1d91d-7e86-4257-9c2d-04a4352d8283"), new Guid("b3466e83-7e11-464c-b93a-daf047838b26") },
{ new Guid("44326c01-f69e-430c-a403-d5bf3dcc35d5"), "Rainwater Harvesting involves collecting, channeling, and storing rainwater from rooftops or surfaces for reuse or groundwater recharge.", true, true, "Rainwater Harvesting", new Guid("fa208600-b761-480d-95ad-98cad2e61c9b"), new Guid("b3466e83-7e11-464c-b93a-daf047838b26") },
{ new Guid("47fa23fb-0e1c-459e-9cc9-9136c61effbd"), "Super-Structure Work involves constructing the part of the building above ground level, including columns, beams, slabs, and walls, forming the main structural framework.", true, true, "Super-Structure Work", new Guid("0aa3e986-d6a4-49b4-818b-564d2d7799a2"), new Guid("b3466e83-7e11-464c-b93a-daf047838b26") },
{ new Guid("56584b0f-b2a5-4a5e-afea-590516473bcd"), "Sprinkler System involves installing a network of pipes and sprinkler heads designed to automatically discharge water to suppress or extinguish fires.", true, true, "Sprinkler System", new Guid("da465f54-0f58-48c8-ab1d-8e31d59b3607"), new Guid("b3466e83-7e11-464c-b93a-daf047838b26") },
{ new Guid("69819ea6-5550-4325-9097-c52d95db0822"), "Equipment Installation involves setting up HVAC units such as AHUs, FCUs, chillers, and compressors to enable heating, cooling, and ventilation operations in the building.", true, true, "Equipment Installation", new Guid("df3805d6-8d02-45cb-9c53-5c42b527ebb6"), new Guid("b3466e83-7e11-464c-b93a-daf047838b26") },
{ new Guid("6eedb9f1-22e9-4d93-b770-593125085465"), "Public Address (PA) System involves installing speakers, microphones, amplifiers, and control units to broadcast announcements, alerts, and emergency messages throughout a building or facility.", true, true, "Public Address (PA) System", new Guid("da465f54-0f58-48c8-ab1d-8e31d59b3607"), new Guid("b3466e83-7e11-464c-b93a-daf047838b26") },
{ new Guid("6f048b41-f909-41dd-af5f-02369ca80639"), "Site Preparation involves clearing, leveling, and preparing the land for construction by removing obstacles, performing excavation, and conducting soil tests.", true, true, "Site Preparation", new Guid("0aa3e986-d6a4-49b4-818b-564d2d7799a2"), new Guid("b3466e83-7e11-464c-b93a-daf047838b26") },
{ new Guid("7613959e-5718-4e46-926b-efa45722c844"), "Water Supply System involves installing pipelines, pumps, tanks, and fittings to ensure the reliable distribution of clean water throughout a building or facility.", true, true, "Water Supply System", new Guid("fa208600-b761-480d-95ad-98cad2e61c9b"), new Guid("b3466e83-7e11-464c-b93a-daf047838b26") },
{ new Guid("78a12040-4ab6-493a-b199-ee636f45f77f"), "Fire Hydrant System involves installing external and internal hydrants, piping, and valves to provide high-pressure water access for manual firefighting during emergencies.", true, true, "Fire Hydrant System", new Guid("da465f54-0f58-48c8-ab1d-8e31d59b3607"), new Guid("b3466e83-7e11-464c-b93a-daf047838b26") },
{ new Guid("97c6f9f5-cd4d-4830-ba14-a81f6ee0d1e2"), "Detection and Alarm System involves installing smoke detectors, heat sensors, and fire alarm panels to automatically detect fire or smoke and alert occupants through audible and visual alarms.", true, true, "Detection and Alarm System", new Guid("da465f54-0f58-48c8-ab1d-8e31d59b3607"), new Guid("b3466e83-7e11-464c-b93a-daf047838b26") },
{ new Guid("9efaa80a-f115-4e78-866a-5e192faa1024"), "False Ceiling Work involves installing suspended ceilings made of materials like gypsum, metal, or POP to conceal services, improve aesthetics, and enhance acoustic and thermal performance.", true, true, "False Ceiling Work", new Guid("8d196e15-4099-4c9a-9a84-86650d79d4b4"), new Guid("b3466e83-7e11-464c-b93a-daf047838b26") },
{ new Guid("a27d502b-20ea-4926-b294-3db7110f94e5"), "Data & Communication Cabling involves laying structured cables for internet, telephone, and networking systems to ensure reliable communication and connectivity throughout the building.", true, true, "Data & Communication Cabling", new Guid("8d196e15-4099-4c9a-9a84-86650d79d4b4"), new Guid("b3466e83-7e11-464c-b93a-daf047838b26") },
{ new Guid("a71182a5-0579-4624-b252-4cae2ea11948"), "Wiring Installation involves connecting electrical wires from distribution boards to switches, sockets, and fixtures to provide power and lighting within a building.", true, true, "Wiring Installation", new Guid("e3c1d91d-7e86-4257-9c2d-04a4352d8283"), new Guid("b3466e83-7e11-464c-b93a-daf047838b26") },
{ new Guid("b5e2291f-3569-45e5-9c30-ef33ad0abbf1"), "Lighting System involves installing and connecting various lighting fixtures, controls, and fittings to ensure proper illumination for indoor and outdoor areas.", true, true, "Lighting System", new Guid("e3c1d91d-7e86-4257-9c2d-04a4352d8283"), new Guid("b3466e83-7e11-464c-b93a-daf047838b26") },
{ new Guid("ba4ada9c-ed35-4d5e-bc9f-216f32612c85"), "Drainage & Wastewater System involves installing pipes, traps, and chambers to safely collect and dispose of wastewater and sewage from a building to the municipal or septic system.", true, true, "Drainage & Wastewater System", new Guid("fa208600-b761-480d-95ad-98cad2e61c9b"), new Guid("b3466e83-7e11-464c-b93a-daf047838b26") },
{ new Guid("c0a9e90c-4c74-417d-b36e-6e63eca16463"), "Door & Window Installation involves fitting and fixing doors and windows made of wood, aluminum, uPVC, or glass to provide access, ventilation, and natural light within the building.", true, true, "Door & Window Installation", new Guid("8d196e15-4099-4c9a-9a84-86650d79d4b4"), new Guid("b3466e83-7e11-464c-b93a-daf047838b26") },
{ new Guid("cdea8e5f-8b78-4f7e-ab65-bd6b38d81af2"), "HVAC System Design & Planning involves calculating heating and cooling loads, selecting appropriate equipment, and designing duct and piping layouts to ensure efficient climate control and air quality.", true, true, "HVAC System Design & Planning", new Guid("df3805d6-8d02-45cb-9c53-5c42b527ebb6"), new Guid("b3466e83-7e11-464c-b93a-daf047838b26") },
{ new Guid("fbb04bec-53a7-4f86-8536-34c4b5c691a2"), "Liaisoning Fire Fighting involves coordinating with fire authorities to obtain necessary approvals and no-objection certificates (NOCs) for fire safety systems, ensuring compliance with local fire safety regulations.", true, true, "Liaisoning", new Guid("da465f54-0f58-48c8-ab1d-8e31d59b3607"), new Guid("b3466e83-7e11-464c-b93a-daf047838b26") },
{ new Guid("fe613446-c399-4a5c-8205-fd3652231f57"), "Ventilation System involves installing exhausts, fresh air units, and ductwork to ensure proper air circulation, removal of stale air, and maintenance of indoor air quality.", true, true, "Ventilation System", new Guid("df3805d6-8d02-45cb-9c53-5c42b527ebb6"), new Guid("b3466e83-7e11-464c-b93a-daf047838b26") }
});
migrationBuilder.InsertData(
table: "ServicesMasters",
columns: new[] { "Id", "Description", "IsActive", "IsSystem", "Name", "TenantId" },
values: new object[,]
{
{ new Guid("0aa3e986-d6a4-49b4-818b-564d2d7799a2"), "Construction Civil service involves planning, designing, and overseeing infrastructure and building projects", true, true, "Civil", new Guid("b3466e83-7e11-464c-b93a-daf047838b26") },
{ new Guid("8d196e15-4099-4c9a-9a84-86650d79d4b4"), "Interior infrastructure (Interior Infra) service involves the construction and installation of essential internal structural elements like partitions, ceilings, flooring, and utility layouts to prepare spaces for interior design and functional use.", true, true, "Interior infrastructure", new Guid("b3466e83-7e11-464c-b93a-daf047838b26") },
{ new Guid("da465f54-0f58-48c8-ab1d-8e31d59b3607"), "Fire fighting service involves installing and maintaining systems like sprinklers, hydrants, and alarms to detect, control, and extinguish fires in buildings and facilities.", true, true, "Fire fighting", new Guid("b3466e83-7e11-464c-b93a-daf047838b26") },
{ new Guid("df3805d6-8d02-45cb-9c53-5c42b527ebb6"), "HVAC (Heating, Ventilation, and Air Conditioning) service involves the installation, maintenance, and repair of systems that control indoor climate, air quality, and thermal comfort in buildings.", true, true, "HVAC", new Guid("b3466e83-7e11-464c-b93a-daf047838b26") },
{ new Guid("e3c1d91d-7e86-4257-9c2d-04a4352d8283"), "Electric service involves the installation, maintenance, and repair of electrical systems, including wiring, lighting, and power distribution in buildings and infrastructure", true, true, "Electric", new Guid("b3466e83-7e11-464c-b93a-daf047838b26") },
{ new Guid("fa208600-b761-480d-95ad-98cad2e61c9b"), "Plumbing service involves installing, maintaining, and repairing systems for water supply, drainage, and sewage in residential, commercial, and industrial buildings", true, true, "Plumbing", new Guid("b3466e83-7e11-464c-b93a-daf047838b26") }
});
migrationBuilder.CreateIndex(
name: "IX_ActivityGroupMasters_TenantId",
table: "ActivityGroupMasters",
column: "TenantId");
migrationBuilder.CreateIndex(
name: "IX_ServicesMasters_TenantId",
table: "ServicesMasters",
column: "TenantId");
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
name: "ActivityGroupMasters");
migrationBuilder.DropTable(
name: "ServicesMasters");
migrationBuilder.DropColumn(
name: "ActitvityGroupId",
table: "ActivityMasters");
migrationBuilder.DropColumn(
name: "ServiceId",
table: "ActivityMasters");
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");
}
}
}

View File

@ -0,0 +1,79 @@
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace Marco.Pms.DataAccess.Migrations
{
/// <inheritdoc />
public partial class Added_Forgien_Keys_In_Activity_And_ActivityGroup_Master_Table : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.CreateIndex(
name: "IX_ActivityMasters_ActitvityGroupId",
table: "ActivityMasters",
column: "ActitvityGroupId");
migrationBuilder.CreateIndex(
name: "IX_ActivityMasters_ServiceId",
table: "ActivityMasters",
column: "ServiceId");
migrationBuilder.CreateIndex(
name: "IX_ActivityGroupMasters_ServiceId",
table: "ActivityGroupMasters",
column: "ServiceId");
migrationBuilder.AddForeignKey(
name: "FK_ActivityGroupMasters_ServicesMasters_ServiceId",
table: "ActivityGroupMasters",
column: "ServiceId",
principalTable: "ServicesMasters",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
migrationBuilder.AddForeignKey(
name: "FK_ActivityMasters_ActivityGroupMasters_ActitvityGroupId",
table: "ActivityMasters",
column: "ActitvityGroupId",
principalTable: "ActivityGroupMasters",
principalColumn: "Id");
migrationBuilder.AddForeignKey(
name: "FK_ActivityMasters_ServicesMasters_ServiceId",
table: "ActivityMasters",
column: "ServiceId",
principalTable: "ServicesMasters",
principalColumn: "Id");
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropForeignKey(
name: "FK_ActivityGroupMasters_ServicesMasters_ServiceId",
table: "ActivityGroupMasters");
migrationBuilder.DropForeignKey(
name: "FK_ActivityMasters_ActivityGroupMasters_ActitvityGroupId",
table: "ActivityMasters");
migrationBuilder.DropForeignKey(
name: "FK_ActivityMasters_ServicesMasters_ServiceId",
table: "ActivityMasters");
migrationBuilder.DropIndex(
name: "IX_ActivityMasters_ActitvityGroupId",
table: "ActivityMasters");
migrationBuilder.DropIndex(
name: "IX_ActivityMasters_ServiceId",
table: "ActivityMasters");
migrationBuilder.DropIndex(
name: "IX_ActivityGroupMasters_ServiceId",
table: "ActivityGroupMasters");
}
}
}

View File

@ -1442,26 +1442,305 @@ namespace Marco.Pms.DataAccess.Migrations
b.ToTable("MailingList"); b.ToTable("MailingList");
}); });
modelBuilder.Entity("Marco.Pms.Model.Master.ActivityGroupMaster", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("char(36)");
b.Property<string>("Description")
.IsRequired()
.HasColumnType("longtext");
b.Property<bool>("IsActive")
.HasColumnType("tinyint(1)");
b.Property<bool>("IsSystem")
.HasColumnType("tinyint(1)");
b.Property<string>("Name")
.IsRequired()
.HasColumnType("longtext");
b.Property<Guid>("ServiceId")
.HasColumnType("char(36)");
b.Property<Guid>("TenantId")
.HasColumnType("char(36)");
b.HasKey("Id");
b.HasIndex("ServiceId");
b.HasIndex("TenantId");
b.ToTable("ActivityGroupMasters");
b.HasData(
new
{
Id = new Guid("6f048b41-f909-41dd-af5f-02369ca80639"),
Description = "Site Preparation involves clearing, leveling, and preparing the land for construction by removing obstacles, performing excavation, and conducting soil tests.",
IsActive = true,
IsSystem = true,
Name = "Site Preparation",
ServiceId = new Guid("0aa3e986-d6a4-49b4-818b-564d2d7799a2"),
TenantId = new Guid("b3466e83-7e11-464c-b93a-daf047838b26")
},
new
{
Id = new Guid("1d29b7d1-ffdc-486d-ac7b-ee2661ae9979"),
Description = "Foundation Work involves excavating, reinforcing, and casting the base structure that supports the entire building load, including footings and plinth beams.",
IsActive = true,
IsSystem = true,
Name = "Foundation Work",
ServiceId = new Guid("0aa3e986-d6a4-49b4-818b-564d2d7799a2"),
TenantId = new Guid("b3466e83-7e11-464c-b93a-daf047838b26")
},
new
{
Id = new Guid("3a712ddb-8927-4d58-8b24-83290e6ba8d1"),
Description = "Sub-Structure Work involves constructing the portion of the building below ground level, including plinth beams, basement walls, and backfilling, to support the superstructure.",
IsActive = true,
IsSystem = true,
Name = "Sub-Structure Work",
ServiceId = new Guid("0aa3e986-d6a4-49b4-818b-564d2d7799a2"),
TenantId = new Guid("b3466e83-7e11-464c-b93a-daf047838b26")
},
new
{
Id = new Guid("47fa23fb-0e1c-459e-9cc9-9136c61effbd"),
Description = "Super-Structure Work involves constructing the part of the building above ground level, including columns, beams, slabs, and walls, forming the main structural framework.",
IsActive = true,
IsSystem = true,
Name = "Super-Structure Work",
ServiceId = new Guid("0aa3e986-d6a4-49b4-818b-564d2d7799a2"),
TenantId = new Guid("b3466e83-7e11-464c-b93a-daf047838b26")
},
new
{
Id = new Guid("7613959e-5718-4e46-926b-efa45722c844"),
Description = "Water Supply System involves installing pipelines, pumps, tanks, and fittings to ensure the reliable distribution of clean water throughout a building or facility.",
IsActive = true,
IsSystem = true,
Name = "Water Supply System",
ServiceId = new Guid("fa208600-b761-480d-95ad-98cad2e61c9b"),
TenantId = new Guid("b3466e83-7e11-464c-b93a-daf047838b26")
},
new
{
Id = new Guid("ba4ada9c-ed35-4d5e-bc9f-216f32612c85"),
Description = "Drainage & Wastewater System involves installing pipes, traps, and chambers to safely collect and dispose of wastewater and sewage from a building to the municipal or septic system.",
IsActive = true,
IsSystem = true,
Name = "Drainage & Wastewater System",
ServiceId = new Guid("fa208600-b761-480d-95ad-98cad2e61c9b"),
TenantId = new Guid("b3466e83-7e11-464c-b93a-daf047838b26")
},
new
{
Id = new Guid("44326c01-f69e-430c-a403-d5bf3dcc35d5"),
Description = "Rainwater Harvesting involves collecting, channeling, and storing rainwater from rooftops or surfaces for reuse or groundwater recharge.",
IsActive = true,
IsSystem = true,
Name = "Rainwater Harvesting",
ServiceId = new Guid("fa208600-b761-480d-95ad-98cad2e61c9b"),
TenantId = new Guid("b3466e83-7e11-464c-b93a-daf047838b26")
},
new
{
Id = new Guid("3ef85f9f-e23e-4e6f-9cb7-40ec70a184dd"),
Description = "Conduiting & Cabling involves laying electrical conduits and pulling cables to safely route and protect electrical wiring throughout a building.",
IsActive = true,
IsSystem = true,
Name = "Conduiting & Cabling",
ServiceId = new Guid("e3c1d91d-7e86-4257-9c2d-04a4352d8283"),
TenantId = new Guid("b3466e83-7e11-464c-b93a-daf047838b26")
},
new
{
Id = new Guid("a71182a5-0579-4624-b252-4cae2ea11948"),
Description = "Wiring Installation involves connecting electrical wires from distribution boards to switches, sockets, and fixtures to provide power and lighting within a building.",
IsActive = true,
IsSystem = true,
Name = "Wiring Installation",
ServiceId = new Guid("e3c1d91d-7e86-4257-9c2d-04a4352d8283"),
TenantId = new Guid("b3466e83-7e11-464c-b93a-daf047838b26")
},
new
{
Id = new Guid("b5e2291f-3569-45e5-9c30-ef33ad0abbf1"),
Description = "Lighting System involves installing and connecting various lighting fixtures, controls, and fittings to ensure proper illumination for indoor and outdoor areas.",
IsActive = true,
IsSystem = true,
Name = "Lighting System",
ServiceId = new Guid("e3c1d91d-7e86-4257-9c2d-04a4352d8283"),
TenantId = new Guid("b3466e83-7e11-464c-b93a-daf047838b26")
},
new
{
Id = new Guid("56584b0f-b2a5-4a5e-afea-590516473bcd"),
Description = "Sprinkler System involves installing a network of pipes and sprinkler heads designed to automatically discharge water to suppress or extinguish fires.",
IsActive = true,
IsSystem = true,
Name = "Sprinkler System",
ServiceId = new Guid("da465f54-0f58-48c8-ab1d-8e31d59b3607"),
TenantId = new Guid("b3466e83-7e11-464c-b93a-daf047838b26")
},
new
{
Id = new Guid("78a12040-4ab6-493a-b199-ee636f45f77f"),
Description = "Fire Hydrant System involves installing external and internal hydrants, piping, and valves to provide high-pressure water access for manual firefighting during emergencies.",
IsActive = true,
IsSystem = true,
Name = "Fire Hydrant System",
ServiceId = new Guid("da465f54-0f58-48c8-ab1d-8e31d59b3607"),
TenantId = new Guid("b3466e83-7e11-464c-b93a-daf047838b26")
},
new
{
Id = new Guid("fbb04bec-53a7-4f86-8536-34c4b5c691a2"),
Description = "Liaisoning Fire Fighting involves coordinating with fire authorities to obtain necessary approvals and no-objection certificates (NOCs) for fire safety systems, ensuring compliance with local fire safety regulations.",
IsActive = true,
IsSystem = true,
Name = "Liaisoning",
ServiceId = new Guid("da465f54-0f58-48c8-ab1d-8e31d59b3607"),
TenantId = new Guid("b3466e83-7e11-464c-b93a-daf047838b26")
},
new
{
Id = new Guid("6eedb9f1-22e9-4d93-b770-593125085465"),
Description = "Public Address (PA) System involves installing speakers, microphones, amplifiers, and control units to broadcast announcements, alerts, and emergency messages throughout a building or facility.",
IsActive = true,
IsSystem = true,
Name = "Public Address (PA) System",
ServiceId = new Guid("da465f54-0f58-48c8-ab1d-8e31d59b3607"),
TenantId = new Guid("b3466e83-7e11-464c-b93a-daf047838b26")
},
new
{
Id = new Guid("97c6f9f5-cd4d-4830-ba14-a81f6ee0d1e2"),
Description = "Detection and Alarm System involves installing smoke detectors, heat sensors, and fire alarm panels to automatically detect fire or smoke and alert occupants through audible and visual alarms.",
IsActive = true,
IsSystem = true,
Name = "Detection and Alarm System",
ServiceId = new Guid("da465f54-0f58-48c8-ab1d-8e31d59b3607"),
TenantId = new Guid("b3466e83-7e11-464c-b93a-daf047838b26")
},
new
{
Id = new Guid("cdea8e5f-8b78-4f7e-ab65-bd6b38d81af2"),
Description = "HVAC System Design & Planning involves calculating heating and cooling loads, selecting appropriate equipment, and designing duct and piping layouts to ensure efficient climate control and air quality.",
IsActive = true,
IsSystem = true,
Name = "HVAC System Design & Planning",
ServiceId = new Guid("df3805d6-8d02-45cb-9c53-5c42b527ebb6"),
TenantId = new Guid("b3466e83-7e11-464c-b93a-daf047838b26")
},
new
{
Id = new Guid("1805e22d-4220-45cc-8f39-35194c2499a5"),
Description = "Ducting Work involves fabricating, installing, and insulating ducts to distribute conditioned air throughout the building as part of the HVAC system.",
IsActive = true,
IsSystem = true,
Name = "Ducting Work",
ServiceId = new Guid("df3805d6-8d02-45cb-9c53-5c42b527ebb6"),
TenantId = new Guid("b3466e83-7e11-464c-b93a-daf047838b26")
},
new
{
Id = new Guid("69819ea6-5550-4325-9097-c52d95db0822"),
Description = "Equipment Installation involves setting up HVAC units such as AHUs, FCUs, chillers, and compressors to enable heating, cooling, and ventilation operations in the building.",
IsActive = true,
IsSystem = true,
Name = "Equipment Installation",
ServiceId = new Guid("df3805d6-8d02-45cb-9c53-5c42b527ebb6"),
TenantId = new Guid("b3466e83-7e11-464c-b93a-daf047838b26")
},
new
{
Id = new Guid("fe613446-c399-4a5c-8205-fd3652231f57"),
Description = "Ventilation System involves installing exhausts, fresh air units, and ductwork to ensure proper air circulation, removal of stale air, and maintenance of indoor air quality.",
IsActive = true,
IsSystem = true,
Name = "Ventilation System",
ServiceId = new Guid("df3805d6-8d02-45cb-9c53-5c42b527ebb6"),
TenantId = new Guid("b3466e83-7e11-464c-b93a-daf047838b26")
},
new
{
Id = new Guid("0398ba10-f814-404a-a7a2-3bac0f61a9a5"),
Description = "Partition Work involves constructing internal dividing walls using materials like gypsum, glass, or wood to create separate rooms or functional spaces within a building.",
IsActive = true,
IsSystem = true,
Name = "Partition Work",
ServiceId = new Guid("8d196e15-4099-4c9a-9a84-86650d79d4b4"),
TenantId = new Guid("b3466e83-7e11-464c-b93a-daf047838b26")
},
new
{
Id = new Guid("9efaa80a-f115-4e78-866a-5e192faa1024"),
Description = "False Ceiling Work involves installing suspended ceilings made of materials like gypsum, metal, or POP to conceal services, improve aesthetics, and enhance acoustic and thermal performance.",
IsActive = true,
IsSystem = true,
Name = "False Ceiling Work",
ServiceId = new Guid("8d196e15-4099-4c9a-9a84-86650d79d4b4"),
TenantId = new Guid("b3466e83-7e11-464c-b93a-daf047838b26")
},
new
{
Id = new Guid("c0a9e90c-4c74-417d-b36e-6e63eca16463"),
Description = "Door & Window Installation involves fitting and fixing doors and windows made of wood, aluminum, uPVC, or glass to provide access, ventilation, and natural light within the building.",
IsActive = true,
IsSystem = true,
Name = "Door & Window Installation",
ServiceId = new Guid("8d196e15-4099-4c9a-9a84-86650d79d4b4"),
TenantId = new Guid("b3466e83-7e11-464c-b93a-daf047838b26")
},
new
{
Id = new Guid("a27d502b-20ea-4926-b294-3db7110f94e5"),
Description = "Data & Communication Cabling involves laying structured cables for internet, telephone, and networking systems to ensure reliable communication and connectivity throughout the building.",
IsActive = true,
IsSystem = true,
Name = "Data & Communication Cabling",
ServiceId = new Guid("8d196e15-4099-4c9a-9a84-86650d79d4b4"),
TenantId = new Guid("b3466e83-7e11-464c-b93a-daf047838b26")
});
});
modelBuilder.Entity("Marco.Pms.Model.Master.ActivityMaster", b => modelBuilder.Entity("Marco.Pms.Model.Master.ActivityMaster", b =>
{ {
b.Property<Guid>("Id") b.Property<Guid>("Id")
.ValueGeneratedOnAdd() .ValueGeneratedOnAdd()
.HasColumnType("char(36)"); .HasColumnType("char(36)");
b.Property<Guid?>("ActitvityGroupId")
.HasColumnType("char(36)");
b.Property<string>("ActivityName") b.Property<string>("ActivityName")
.IsRequired()
.HasColumnType("longtext"); .HasColumnType("longtext");
b.Property<bool>("IsActive") b.Property<bool>("IsActive")
.HasColumnType("tinyint(1)"); .HasColumnType("tinyint(1)");
b.Property<Guid?>("ServiceId")
.HasColumnType("char(36)");
b.Property<Guid>("TenantId") b.Property<Guid>("TenantId")
.HasColumnType("char(36)"); .HasColumnType("char(36)");
b.Property<string>("UnitOfMeasurement") b.Property<string>("UnitOfMeasurement")
.IsRequired()
.HasColumnType("longtext"); .HasColumnType("longtext");
b.HasKey("Id"); b.HasKey("Id");
b.HasIndex("ActitvityGroupId");
b.HasIndex("ServiceId");
b.HasIndex("TenantId"); b.HasIndex("TenantId");
b.ToTable("ActivityMasters"); b.ToTable("ActivityMasters");
@ -1656,6 +1935,92 @@ namespace Marco.Pms.DataAccess.Migrations
}); });
}); });
modelBuilder.Entity("Marco.Pms.Model.Master.ServicesMaster", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("char(36)");
b.Property<string>("Description")
.IsRequired()
.HasColumnType("longtext");
b.Property<bool>("IsActive")
.HasColumnType("tinyint(1)");
b.Property<bool>("IsSystem")
.HasColumnType("tinyint(1)");
b.Property<string>("Name")
.IsRequired()
.HasColumnType("longtext");
b.Property<Guid>("TenantId")
.HasColumnType("char(36)");
b.HasKey("Id");
b.HasIndex("TenantId");
b.ToTable("ServicesMasters");
b.HasData(
new
{
Id = new Guid("0aa3e986-d6a4-49b4-818b-564d2d7799a2"),
Description = "Construction Civil service involves planning, designing, and overseeing infrastructure and building projects",
IsActive = true,
IsSystem = true,
Name = "Civil",
TenantId = new Guid("b3466e83-7e11-464c-b93a-daf047838b26")
},
new
{
Id = new Guid("fa208600-b761-480d-95ad-98cad2e61c9b"),
Description = "Plumbing service involves installing, maintaining, and repairing systems for water supply, drainage, and sewage in residential, commercial, and industrial buildings",
IsActive = true,
IsSystem = true,
Name = "Plumbing",
TenantId = new Guid("b3466e83-7e11-464c-b93a-daf047838b26")
},
new
{
Id = new Guid("e3c1d91d-7e86-4257-9c2d-04a4352d8283"),
Description = "Electric service involves the installation, maintenance, and repair of electrical systems, including wiring, lighting, and power distribution in buildings and infrastructure",
IsActive = true,
IsSystem = true,
Name = "Electric",
TenantId = new Guid("b3466e83-7e11-464c-b93a-daf047838b26")
},
new
{
Id = new Guid("da465f54-0f58-48c8-ab1d-8e31d59b3607"),
Description = "Fire fighting service involves installing and maintaining systems like sprinklers, hydrants, and alarms to detect, control, and extinguish fires in buildings and facilities.",
IsActive = true,
IsSystem = true,
Name = "Fire fighting",
TenantId = new Guid("b3466e83-7e11-464c-b93a-daf047838b26")
},
new
{
Id = new Guid("df3805d6-8d02-45cb-9c53-5c42b527ebb6"),
Description = "HVAC (Heating, Ventilation, and Air Conditioning) service involves the installation, maintenance, and repair of systems that control indoor climate, air quality, and thermal comfort in buildings.",
IsActive = true,
IsSystem = true,
Name = "HVAC",
TenantId = new Guid("b3466e83-7e11-464c-b93a-daf047838b26")
},
new
{
Id = new Guid("8d196e15-4099-4c9a-9a84-86650d79d4b4"),
Description = "Interior infrastructure (Interior Infra) service involves the construction and installation of essential internal structural elements like partitions, ceilings, flooring, and utility layouts to prepare spaces for interior design and functional use.",
IsActive = true,
IsSystem = true,
Name = "Interior infrastructure",
TenantId = new Guid("b3466e83-7e11-464c-b93a-daf047838b26")
});
});
modelBuilder.Entity("Marco.Pms.Model.Master.StatusMaster", b => modelBuilder.Entity("Marco.Pms.Model.Master.StatusMaster", b =>
{ {
b.Property<Guid>("Id") b.Property<Guid>("Id")
@ -3115,14 +3480,45 @@ namespace Marco.Pms.DataAccess.Migrations
b.Navigation("MailBody"); b.Navigation("MailBody");
}); });
modelBuilder.Entity("Marco.Pms.Model.Master.ActivityMaster", b => modelBuilder.Entity("Marco.Pms.Model.Master.ActivityGroupMaster", b =>
{ {
b.HasOne("Marco.Pms.Model.Master.ServicesMaster", "ServicesMaster")
.WithMany()
.HasForeignKey("ServiceId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("Marco.Pms.Model.Entitlements.Tenant", "Tenant") b.HasOne("Marco.Pms.Model.Entitlements.Tenant", "Tenant")
.WithMany() .WithMany()
.HasForeignKey("TenantId") .HasForeignKey("TenantId")
.OnDelete(DeleteBehavior.Cascade) .OnDelete(DeleteBehavior.Cascade)
.IsRequired(); .IsRequired();
b.Navigation("ServicesMaster");
b.Navigation("Tenant");
});
modelBuilder.Entity("Marco.Pms.Model.Master.ActivityMaster", b =>
{
b.HasOne("Marco.Pms.Model.Master.ActivityGroupMaster", "ActivityGroupMaster")
.WithMany()
.HasForeignKey("ActitvityGroupId");
b.HasOne("Marco.Pms.Model.Master.ServicesMaster", "ServicesMaster")
.WithMany()
.HasForeignKey("ServiceId");
b.HasOne("Marco.Pms.Model.Entitlements.Tenant", "Tenant")
.WithMany()
.HasForeignKey("TenantId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("ActivityGroupMaster");
b.Navigation("ServicesMaster");
b.Navigation("Tenant"); b.Navigation("Tenant");
}); });
@ -3137,6 +3533,17 @@ namespace Marco.Pms.DataAccess.Migrations
b.Navigation("Module"); b.Navigation("Module");
}); });
modelBuilder.Entity("Marco.Pms.Model.Master.ServicesMaster", b =>
{
b.HasOne("Marco.Pms.Model.Entitlements.Tenant", "Tenant")
.WithMany()
.HasForeignKey("TenantId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("Tenant");
});
modelBuilder.Entity("Marco.Pms.Model.Master.StatusMaster", b => modelBuilder.Entity("Marco.Pms.Model.Master.StatusMaster", b =>
{ {
b.HasOne("Marco.Pms.Model.Entitlements.Tenant", "Tenant") b.HasOne("Marco.Pms.Model.Entitlements.Tenant", "Tenant")

View File

@ -2,6 +2,8 @@
{ {
public class CreateActivityMasterDto public class CreateActivityMasterDto
{ {
public Guid ActitvityGroupId { get; set; }
public Guid ServiceId { get; set; }
public string? ActivityName { get; set; } public string? ActivityName { get; set; }
public string? UnitOfMeasurement { get; set; } public string? UnitOfMeasurement { get; set; }
public List<CreateCheckListDto>? CheckList { get; set; } public List<CreateCheckListDto>? CheckList { get; set; }

View File

@ -0,0 +1,10 @@
namespace Marco.Pms.Model.Dtos.Master
{
public class ActivityGroupDto
{
public Guid? Id { get; set; }
public string? Name { get; set; }
public string? Description { get; set; }
public Guid ServiceId { get; set; }
}
}

View File

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

View File

@ -0,0 +1,20 @@
using System.ComponentModel.DataAnnotations.Schema;
using Marco.Pms.Model.Utilities;
using Microsoft.AspNetCore.Mvc.ModelBinding.Validation;
namespace Marco.Pms.Model.Master
{
public class ActivityGroupMaster : TenantRelation
{
public Guid Id { get; set; }
public string Name { get; set; } = string.Empty;
public string Description { get; set; } = string.Empty;
public Guid ServiceId { get; set; }
[ValidateNever]
[ForeignKey("ServiceId")]
public ServicesMaster? ServicesMaster { get; set; }
public bool IsSystem { get; set; } = false;
public bool IsActive { get; set; } = true;
}
}

View File

@ -1,14 +1,24 @@
using Marco.Pms.Model.Utilities; using System.ComponentModel.DataAnnotations.Schema;
using Marco.Pms.Model.Utilities;
using Microsoft.AspNetCore.Mvc.ModelBinding.Validation;
namespace Marco.Pms.Model.Master namespace Marco.Pms.Model.Master
{ {
public class ActivityMaster : TenantRelation public class ActivityMaster : TenantRelation
{ {
public Guid Id { get; set; } public Guid Id { get; set; }
public string? ActivityName { get; set; } public Guid? ActitvityGroupId { get; set; }
public string? UnitOfMeasurement { get; set; } [ValidateNever]
[ForeignKey("ActitvityGroupId")]
public ActivityGroupMaster? ActivityGroupMaster { get; set; }
public Guid? ServiceId { get; set; }
[ValidateNever]
[ForeignKey("ServiceId")]
public ServicesMaster? ServicesMaster { get; set; }
public string ActivityName { get; set; } = string.Empty;
public string UnitOfMeasurement { get; set; } = string.Empty;
public bool IsActive { get; set; } = true; public bool IsActive { get; set; } = true;
} }
} }

View File

@ -0,0 +1,13 @@
using Marco.Pms.Model.Utilities;
namespace Marco.Pms.Model.Master
{
public class ServicesMaster : TenantRelation
{
public Guid Id { get; set; }
public string Name { get; set; } = string.Empty;
public string Description { get; set; } = string.Empty;
public bool IsSystem { get; set; } = false;
public bool IsActive { get; set; } = true;
}
}

View File

@ -4,8 +4,12 @@
{ {
public Guid Id { get; set; } public Guid Id { get; set; }
public string? ActivityName { get; set; } public string? ActivityName { get; set; }
public string? UnitOfMeasurement { get; set; } public string? UnitOfMeasurement { get; set; }
public Guid? ActitvityGroupId { get; set; }
public string? ActivityGroupName { get; set; }
public Guid? ServiceId { get; set; }
public string? ServicesName { get; set; }
public bool IsActive { get; set; }
public List<CheckListVM>? CheckLists { get; set; } public List<CheckListVM>? CheckLists { get; set; }
} }
} }

View File

@ -0,0 +1,13 @@
namespace Marco.Pms.Model.ViewModels.Master
{
public class ActivityGroupMasterVM
{
public Guid Id { get; set; }
public string? Name { get; set; }
public string? Description { get; set; }
public Guid ServiceId { get; set; }
public string? ServicesName { get; set; }
public bool IsSystem { get; set; }
public bool IsActive { get; set; }
}
}

View File

@ -0,0 +1,11 @@
namespace Marco.Pms.Model.ViewModels.Master
{
public class ServiceMasterVM
{
public Guid Id { get; set; }
public string? Name { get; set; }
public string? Description { get; set; }
public bool IsSystem { get; set; }
public bool IsActive { get; set; }
}
}