Added the Compeny type master and data
This commit is contained in:
parent
25896d3093
commit
a05f1ba5c3
@ -1099,6 +1099,24 @@ namespace Marco.Pms.DataAccess.Data
|
||||
}
|
||||
);
|
||||
|
||||
modelBuilder.Entity<ProductCategoryMaster>().HasData(
|
||||
new ProductCategoryMaster { Id = Guid.Parse("2e097d8b-63a2-4b96-8c55-61c2826f1001"), Name = "Civil/Structural", ShortName = "CIV", Description = "Materials, components, and systems used in civil and structural engineering, including concrete, steel, reinforcement, and construction accessories.", IsActive = true },
|
||||
new ProductCategoryMaster { Id = Guid.Parse("b5c4f7b3-bf24-4f19-9b5c-2deb12131002"), Name = "Electrical", ShortName = "ELE", Description = "Cables, lighting, wiring devices, control panels, transformers, and electrical distribution systems for building and industrial use.", IsActive = true },
|
||||
new ProductCategoryMaster { Id = Guid.Parse("e0e7d2cf-0438-4acd-aa1e-09304d5b1003"), Name = "Electronics/ICT", ShortName = "ICT", Description = "Electronic and communication products including data cabling, networking equipment, surveillance systems, and audio-visual devices.", IsActive = true },
|
||||
new ProductCategoryMaster { Id = Guid.Parse("6089cc9c-70dd-4d3a-8b68-0c7c79371004"), Name = "Mechanical & Power Transmission", ShortName = "MEC", Description = "Mechanical components and systems such as pumps, motors, gearboxes, bearings, compressors, and power transmission equipment.", IsActive = true },
|
||||
new ProductCategoryMaster { Id = Guid.Parse("a4ad945b-9213-4f4f-b823-b8c277871005"), Name = "Plumbing & Sanitary", ShortName = "PLU", Description = "Pipes, fittings, valves, sanitary fixtures, and drainage systems used for water supply and waste management.", IsActive = true },
|
||||
new ProductCategoryMaster { Id = Guid.Parse("d77d7b2c-83a3-44e9-8dea-62ee85bb1006"), Name = "HVAC", ShortName = "HVA", Description = "Heating, ventilation, and air conditioning equipment including chillers, ducts, diffusers, and air handling units.", IsActive = true },
|
||||
new ProductCategoryMaster { Id = Guid.Parse("adbd1c50-e845-4b52-9406-2f1e1c881007"), Name = "Fire & Safety", ShortName = "FIR", Description = "Firefighting systems, alarms, extinguishers, safety gear, and related safety infrastructure.", IsActive = true },
|
||||
new ProductCategoryMaster { Id = Guid.Parse("ac930654-b973-4d5c-b13b-06e6815c1008"), Name = "Plant, Machinery & Material Handling", ShortName = "PLA", Description = "Industrial machinery, plant equipment, forklifts, cranes, and material handling systems.", IsActive = true },
|
||||
new ProductCategoryMaster { Id = Guid.Parse("57b4ccf4-9e34-422d-b2c9-0a16d9c91009"), Name = "Tools & Equipment", ShortName = "TOO", Description = "Hand tools, power tools, measuring instruments, and workshop equipment for industrial and maintenance use.", IsActive = true },
|
||||
new ProductCategoryMaster { Id = Guid.Parse("db8c7b16-b6c4-463e-9a59-6558a837100a"), Name = "Office Supplies & Stationery", ShortName = "OFF", Description = "General office supplies including stationery, furniture, printers, and consumables for daily operations.", IsActive = true },
|
||||
new ProductCategoryMaster { Id = Guid.Parse("fb081cf7-fef2-4d91-a052-4922d20d100b"), Name = "IT, Computing & Networking", ShortName = "ITC", Description = "Computers, servers, storage devices, network accessories, and related IT infrastructure.", IsActive = true },
|
||||
new ProductCategoryMaster { Id = Guid.Parse("bbdc04bb-d930-428c-aabc-72e198ea100c"), Name = "Packaging, Consumables, Chemicals & Lubricants", ShortName = "PAC", Description = "Industrial packaging materials, adhesive tapes, cleaning agents, lubricants, and operational consumables.", IsActive = true },
|
||||
new ProductCategoryMaster { Id = Guid.Parse("d9677af1-6f91-44da-b12e-0f7ab00c100d"), Name = "Building Materials & Finishes", ShortName = "BLD", Description = "Cement, tiles, paints, glass, flooring, and other architectural finishing materials.", IsActive = true },
|
||||
new ProductCategoryMaster { Id = Guid.Parse("cd59914f-4e6b-47eb-8d2a-eecb85bc100e"), Name = "Automotive & Fleet", ShortName = "AUT", Description = "Vehicles, fleet equipment, spare parts, lubricants, and accessories for automotive applications.", IsActive = true }
|
||||
|
||||
);
|
||||
|
||||
modelBuilder.Entity<UnitType>().HasData(
|
||||
new UnitType
|
||||
{
|
||||
|
||||
@ -4,6 +4,7 @@
|
||||
<TargetFramework>net7.0</TargetFramework>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<Nullable>enable</Nullable>
|
||||
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
|
||||
10638
Marco.Pms.DataAccess/Migrations/20251031043704_Made_Status_Mapping_Nullable.Designer.cs
generated
Normal file
10638
Marco.Pms.DataAccess/Migrations/20251031043704_Made_Status_Mapping_Nullable.Designer.cs
generated
Normal file
File diff suppressed because one or more lines are too long
@ -0,0 +1,280 @@
|
||||
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 Made_Status_Mapping_Nullable : Migration
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropForeignKey(
|
||||
name: "FK_PurchaseStatusMappings_PurchaseOrderStatus_NextPurchaseStatu~",
|
||||
table: "PurchaseStatusMappings");
|
||||
|
||||
migrationBuilder.DropForeignKey(
|
||||
name: "FK_PurchaseStatusMappings_PurchaseOrderStatus_PreviousPurchaseS~",
|
||||
table: "PurchaseStatusMappings");
|
||||
|
||||
migrationBuilder.DropForeignKey(
|
||||
name: "FK_RequisitionStatusMappings_RequisitionStatus_PreviousRequisit~",
|
||||
table: "RequisitionStatusMappings");
|
||||
|
||||
migrationBuilder.AddColumn<Guid>(
|
||||
name: "CompanyTypeId",
|
||||
table: "Suppliers",
|
||||
type: "char(36)",
|
||||
nullable: false,
|
||||
defaultValue: new Guid("00000000-0000-0000-0000-000000000000"),
|
||||
collation: "ascii_general_ci");
|
||||
|
||||
migrationBuilder.AlterColumn<Guid>(
|
||||
name: "PreviousRequisitionStatusId",
|
||||
table: "RequisitionStatusMappings",
|
||||
type: "char(36)",
|
||||
nullable: true,
|
||||
collation: "ascii_general_ci",
|
||||
oldClrType: typeof(Guid),
|
||||
oldType: "char(36)")
|
||||
.OldAnnotation("Relational:Collation", "ascii_general_ci");
|
||||
|
||||
migrationBuilder.AlterColumn<Guid>(
|
||||
name: "PreviousPurchaseStatusId",
|
||||
table: "PurchaseStatusMappings",
|
||||
type: "char(36)",
|
||||
nullable: true,
|
||||
collation: "ascii_general_ci",
|
||||
oldClrType: typeof(Guid),
|
||||
oldType: "char(36)")
|
||||
.OldAnnotation("Relational:Collation", "ascii_general_ci");
|
||||
|
||||
migrationBuilder.AlterColumn<Guid>(
|
||||
name: "NextPurchaseStatusId",
|
||||
table: "PurchaseStatusMappings",
|
||||
type: "char(36)",
|
||||
nullable: true,
|
||||
collation: "ascii_general_ci",
|
||||
oldClrType: typeof(Guid),
|
||||
oldType: "char(36)")
|
||||
.OldAnnotation("Relational:Collation", "ascii_general_ci");
|
||||
|
||||
migrationBuilder.InsertData(
|
||||
table: "ProductCategoryMasters",
|
||||
columns: new[] { "Id", "Description", "IsActive", "Name", "ShortName" },
|
||||
values: new object[,]
|
||||
{
|
||||
{ new Guid("2e097d8b-63a2-4b96-8c55-61c2826f1001"), "Materials, components, and systems used in civil and structural engineering, including concrete, steel, reinforcement, and construction accessories.", true, "Civil/Structural", "CIV" },
|
||||
{ new Guid("57b4ccf4-9e34-422d-b2c9-0a16d9c91009"), "Hand tools, power tools, measuring instruments, and workshop equipment for industrial and maintenance use.", true, "Tools & Equipment", "TOO" },
|
||||
{ new Guid("6089cc9c-70dd-4d3a-8b68-0c7c79371004"), "Mechanical components and systems such as pumps, motors, gearboxes, bearings, compressors, and power transmission equipment.", true, "Mechanical & Power Transmission", "MEC" },
|
||||
{ new Guid("a4ad945b-9213-4f4f-b823-b8c277871005"), "Pipes, fittings, valves, sanitary fixtures, and drainage systems used for water supply and waste management.", true, "Plumbing & Sanitary", "PLU" },
|
||||
{ new Guid("ac930654-b973-4d5c-b13b-06e6815c1008"), "Industrial machinery, plant equipment, forklifts, cranes, and material handling systems.", true, "Plant, Machinery & Material Handling", "PLA" },
|
||||
{ new Guid("adbd1c50-e845-4b52-9406-2f1e1c881007"), "Firefighting systems, alarms, extinguishers, safety gear, and related safety infrastructure.", true, "Fire & Safety", "FIR" },
|
||||
{ new Guid("b5c4f7b3-bf24-4f19-9b5c-2deb12131002"), "Cables, lighting, wiring devices, control panels, transformers, and electrical distribution systems for building and industrial use.", true, "Electrical", "ELE" },
|
||||
{ new Guid("bbdc04bb-d930-428c-aabc-72e198ea100c"), "Industrial packaging materials, adhesive tapes, cleaning agents, lubricants, and operational consumables.", true, "Packaging, Consumables, Chemicals & Lubricants", "PAC" },
|
||||
{ new Guid("cd59914f-4e6b-47eb-8d2a-eecb85bc100e"), "Vehicles, fleet equipment, spare parts, lubricants, and accessories for automotive applications.", true, "Automotive & Fleet", "AUT" },
|
||||
{ new Guid("d77d7b2c-83a3-44e9-8dea-62ee85bb1006"), "Heating, ventilation, and air conditioning equipment including chillers, ducts, diffusers, and air handling units.", true, "HVAC", "HVA" },
|
||||
{ new Guid("d9677af1-6f91-44da-b12e-0f7ab00c100d"), "Cement, tiles, paints, glass, flooring, and other architectural finishing materials.", true, "Building Materials & Finishes", "BLD" },
|
||||
{ new Guid("db8c7b16-b6c4-463e-9a59-6558a837100a"), "General office supplies including stationery, furniture, printers, and consumables for daily operations.", true, "Office Supplies & Stationery", "OFF" },
|
||||
{ new Guid("e0e7d2cf-0438-4acd-aa1e-09304d5b1003"), "Electronic and communication products including data cabling, networking equipment, surveillance systems, and audio-visual devices.", true, "Electronics/ICT", "ICT" },
|
||||
{ new Guid("fb081cf7-fef2-4d91-a052-4922d20d100b"), "Computers, servers, storage devices, network accessories, and related IT infrastructure.", true, "IT, Computing & Networking", "ITC" }
|
||||
});
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_Suppliers_CompanyTypeId",
|
||||
table: "Suppliers",
|
||||
column: "CompanyTypeId");
|
||||
|
||||
migrationBuilder.AddForeignKey(
|
||||
name: "FK_PurchaseStatusMappings_PurchaseOrderStatus_NextPurchaseStatu~",
|
||||
table: "PurchaseStatusMappings",
|
||||
column: "NextPurchaseStatusId",
|
||||
principalTable: "PurchaseOrderStatus",
|
||||
principalColumn: "Id");
|
||||
|
||||
migrationBuilder.AddForeignKey(
|
||||
name: "FK_PurchaseStatusMappings_PurchaseOrderStatus_PreviousPurchaseS~",
|
||||
table: "PurchaseStatusMappings",
|
||||
column: "PreviousPurchaseStatusId",
|
||||
principalTable: "PurchaseOrderStatus",
|
||||
principalColumn: "Id");
|
||||
|
||||
migrationBuilder.AddForeignKey(
|
||||
name: "FK_RequisitionStatusMappings_RequisitionStatus_PreviousRequisit~",
|
||||
table: "RequisitionStatusMappings",
|
||||
column: "PreviousRequisitionStatusId",
|
||||
principalTable: "RequisitionStatus",
|
||||
principalColumn: "Id");
|
||||
|
||||
migrationBuilder.AddForeignKey(
|
||||
name: "FK_Suppliers_CompanyTypeMasters_CompanyTypeId",
|
||||
table: "Suppliers",
|
||||
column: "CompanyTypeId",
|
||||
principalTable: "CompanyTypeMasters",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropForeignKey(
|
||||
name: "FK_PurchaseStatusMappings_PurchaseOrderStatus_NextPurchaseStatu~",
|
||||
table: "PurchaseStatusMappings");
|
||||
|
||||
migrationBuilder.DropForeignKey(
|
||||
name: "FK_PurchaseStatusMappings_PurchaseOrderStatus_PreviousPurchaseS~",
|
||||
table: "PurchaseStatusMappings");
|
||||
|
||||
migrationBuilder.DropForeignKey(
|
||||
name: "FK_RequisitionStatusMappings_RequisitionStatus_PreviousRequisit~",
|
||||
table: "RequisitionStatusMappings");
|
||||
|
||||
migrationBuilder.DropForeignKey(
|
||||
name: "FK_Suppliers_CompanyTypeMasters_CompanyTypeId",
|
||||
table: "Suppliers");
|
||||
|
||||
migrationBuilder.DropIndex(
|
||||
name: "IX_Suppliers_CompanyTypeId",
|
||||
table: "Suppliers");
|
||||
|
||||
migrationBuilder.DeleteData(
|
||||
table: "ProductCategoryMasters",
|
||||
keyColumn: "Id",
|
||||
keyValue: new Guid("2e097d8b-63a2-4b96-8c55-61c2826f1001"));
|
||||
|
||||
migrationBuilder.DeleteData(
|
||||
table: "ProductCategoryMasters",
|
||||
keyColumn: "Id",
|
||||
keyValue: new Guid("57b4ccf4-9e34-422d-b2c9-0a16d9c91009"));
|
||||
|
||||
migrationBuilder.DeleteData(
|
||||
table: "ProductCategoryMasters",
|
||||
keyColumn: "Id",
|
||||
keyValue: new Guid("6089cc9c-70dd-4d3a-8b68-0c7c79371004"));
|
||||
|
||||
migrationBuilder.DeleteData(
|
||||
table: "ProductCategoryMasters",
|
||||
keyColumn: "Id",
|
||||
keyValue: new Guid("a4ad945b-9213-4f4f-b823-b8c277871005"));
|
||||
|
||||
migrationBuilder.DeleteData(
|
||||
table: "ProductCategoryMasters",
|
||||
keyColumn: "Id",
|
||||
keyValue: new Guid("ac930654-b973-4d5c-b13b-06e6815c1008"));
|
||||
|
||||
migrationBuilder.DeleteData(
|
||||
table: "ProductCategoryMasters",
|
||||
keyColumn: "Id",
|
||||
keyValue: new Guid("adbd1c50-e845-4b52-9406-2f1e1c881007"));
|
||||
|
||||
migrationBuilder.DeleteData(
|
||||
table: "ProductCategoryMasters",
|
||||
keyColumn: "Id",
|
||||
keyValue: new Guid("b5c4f7b3-bf24-4f19-9b5c-2deb12131002"));
|
||||
|
||||
migrationBuilder.DeleteData(
|
||||
table: "ProductCategoryMasters",
|
||||
keyColumn: "Id",
|
||||
keyValue: new Guid("bbdc04bb-d930-428c-aabc-72e198ea100c"));
|
||||
|
||||
migrationBuilder.DeleteData(
|
||||
table: "ProductCategoryMasters",
|
||||
keyColumn: "Id",
|
||||
keyValue: new Guid("cd59914f-4e6b-47eb-8d2a-eecb85bc100e"));
|
||||
|
||||
migrationBuilder.DeleteData(
|
||||
table: "ProductCategoryMasters",
|
||||
keyColumn: "Id",
|
||||
keyValue: new Guid("d77d7b2c-83a3-44e9-8dea-62ee85bb1006"));
|
||||
|
||||
migrationBuilder.DeleteData(
|
||||
table: "ProductCategoryMasters",
|
||||
keyColumn: "Id",
|
||||
keyValue: new Guid("d9677af1-6f91-44da-b12e-0f7ab00c100d"));
|
||||
|
||||
migrationBuilder.DeleteData(
|
||||
table: "ProductCategoryMasters",
|
||||
keyColumn: "Id",
|
||||
keyValue: new Guid("db8c7b16-b6c4-463e-9a59-6558a837100a"));
|
||||
|
||||
migrationBuilder.DeleteData(
|
||||
table: "ProductCategoryMasters",
|
||||
keyColumn: "Id",
|
||||
keyValue: new Guid("e0e7d2cf-0438-4acd-aa1e-09304d5b1003"));
|
||||
|
||||
migrationBuilder.DeleteData(
|
||||
table: "ProductCategoryMasters",
|
||||
keyColumn: "Id",
|
||||
keyValue: new Guid("fb081cf7-fef2-4d91-a052-4922d20d100b"));
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "CompanyTypeId",
|
||||
table: "Suppliers");
|
||||
|
||||
migrationBuilder.AlterColumn<Guid>(
|
||||
name: "PreviousRequisitionStatusId",
|
||||
table: "RequisitionStatusMappings",
|
||||
type: "char(36)",
|
||||
nullable: false,
|
||||
defaultValue: new Guid("00000000-0000-0000-0000-000000000000"),
|
||||
collation: "ascii_general_ci",
|
||||
oldClrType: typeof(Guid),
|
||||
oldType: "char(36)",
|
||||
oldNullable: true)
|
||||
.OldAnnotation("Relational:Collation", "ascii_general_ci");
|
||||
|
||||
migrationBuilder.AlterColumn<Guid>(
|
||||
name: "PreviousPurchaseStatusId",
|
||||
table: "PurchaseStatusMappings",
|
||||
type: "char(36)",
|
||||
nullable: false,
|
||||
defaultValue: new Guid("00000000-0000-0000-0000-000000000000"),
|
||||
collation: "ascii_general_ci",
|
||||
oldClrType: typeof(Guid),
|
||||
oldType: "char(36)",
|
||||
oldNullable: true)
|
||||
.OldAnnotation("Relational:Collation", "ascii_general_ci");
|
||||
|
||||
migrationBuilder.AlterColumn<Guid>(
|
||||
name: "NextPurchaseStatusId",
|
||||
table: "PurchaseStatusMappings",
|
||||
type: "char(36)",
|
||||
nullable: false,
|
||||
defaultValue: new Guid("00000000-0000-0000-0000-000000000000"),
|
||||
collation: "ascii_general_ci",
|
||||
oldClrType: typeof(Guid),
|
||||
oldType: "char(36)",
|
||||
oldNullable: true)
|
||||
.OldAnnotation("Relational:Collation", "ascii_general_ci");
|
||||
|
||||
migrationBuilder.AddForeignKey(
|
||||
name: "FK_PurchaseStatusMappings_PurchaseOrderStatus_NextPurchaseStatu~",
|
||||
table: "PurchaseStatusMappings",
|
||||
column: "NextPurchaseStatusId",
|
||||
principalTable: "PurchaseOrderStatus",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
|
||||
migrationBuilder.AddForeignKey(
|
||||
name: "FK_PurchaseStatusMappings_PurchaseOrderStatus_PreviousPurchaseS~",
|
||||
table: "PurchaseStatusMappings",
|
||||
column: "PreviousPurchaseStatusId",
|
||||
principalTable: "PurchaseOrderStatus",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
|
||||
migrationBuilder.AddForeignKey(
|
||||
name: "FK_RequisitionStatusMappings_RequisitionStatus_PreviousRequisit~",
|
||||
table: "RequisitionStatusMappings",
|
||||
column: "PreviousRequisitionStatusId",
|
||||
principalTable: "RequisitionStatus",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -2672,6 +2672,120 @@ namespace Marco.Pms.DataAccess.Migrations
|
||||
b.HasKey("Id");
|
||||
|
||||
b.ToTable("ProductCategoryMasters");
|
||||
|
||||
b.HasData(
|
||||
new
|
||||
{
|
||||
Id = new Guid("2e097d8b-63a2-4b96-8c55-61c2826f1001"),
|
||||
Description = "Materials, components, and systems used in civil and structural engineering, including concrete, steel, reinforcement, and construction accessories.",
|
||||
IsActive = true,
|
||||
Name = "Civil/Structural",
|
||||
ShortName = "CIV"
|
||||
},
|
||||
new
|
||||
{
|
||||
Id = new Guid("b5c4f7b3-bf24-4f19-9b5c-2deb12131002"),
|
||||
Description = "Cables, lighting, wiring devices, control panels, transformers, and electrical distribution systems for building and industrial use.",
|
||||
IsActive = true,
|
||||
Name = "Electrical",
|
||||
ShortName = "ELE"
|
||||
},
|
||||
new
|
||||
{
|
||||
Id = new Guid("e0e7d2cf-0438-4acd-aa1e-09304d5b1003"),
|
||||
Description = "Electronic and communication products including data cabling, networking equipment, surveillance systems, and audio-visual devices.",
|
||||
IsActive = true,
|
||||
Name = "Electronics/ICT",
|
||||
ShortName = "ICT"
|
||||
},
|
||||
new
|
||||
{
|
||||
Id = new Guid("6089cc9c-70dd-4d3a-8b68-0c7c79371004"),
|
||||
Description = "Mechanical components and systems such as pumps, motors, gearboxes, bearings, compressors, and power transmission equipment.",
|
||||
IsActive = true,
|
||||
Name = "Mechanical & Power Transmission",
|
||||
ShortName = "MEC"
|
||||
},
|
||||
new
|
||||
{
|
||||
Id = new Guid("a4ad945b-9213-4f4f-b823-b8c277871005"),
|
||||
Description = "Pipes, fittings, valves, sanitary fixtures, and drainage systems used for water supply and waste management.",
|
||||
IsActive = true,
|
||||
Name = "Plumbing & Sanitary",
|
||||
ShortName = "PLU"
|
||||
},
|
||||
new
|
||||
{
|
||||
Id = new Guid("d77d7b2c-83a3-44e9-8dea-62ee85bb1006"),
|
||||
Description = "Heating, ventilation, and air conditioning equipment including chillers, ducts, diffusers, and air handling units.",
|
||||
IsActive = true,
|
||||
Name = "HVAC",
|
||||
ShortName = "HVA"
|
||||
},
|
||||
new
|
||||
{
|
||||
Id = new Guid("adbd1c50-e845-4b52-9406-2f1e1c881007"),
|
||||
Description = "Firefighting systems, alarms, extinguishers, safety gear, and related safety infrastructure.",
|
||||
IsActive = true,
|
||||
Name = "Fire & Safety",
|
||||
ShortName = "FIR"
|
||||
},
|
||||
new
|
||||
{
|
||||
Id = new Guid("ac930654-b973-4d5c-b13b-06e6815c1008"),
|
||||
Description = "Industrial machinery, plant equipment, forklifts, cranes, and material handling systems.",
|
||||
IsActive = true,
|
||||
Name = "Plant, Machinery & Material Handling",
|
||||
ShortName = "PLA"
|
||||
},
|
||||
new
|
||||
{
|
||||
Id = new Guid("57b4ccf4-9e34-422d-b2c9-0a16d9c91009"),
|
||||
Description = "Hand tools, power tools, measuring instruments, and workshop equipment for industrial and maintenance use.",
|
||||
IsActive = true,
|
||||
Name = "Tools & Equipment",
|
||||
ShortName = "TOO"
|
||||
},
|
||||
new
|
||||
{
|
||||
Id = new Guid("db8c7b16-b6c4-463e-9a59-6558a837100a"),
|
||||
Description = "General office supplies including stationery, furniture, printers, and consumables for daily operations.",
|
||||
IsActive = true,
|
||||
Name = "Office Supplies & Stationery",
|
||||
ShortName = "OFF"
|
||||
},
|
||||
new
|
||||
{
|
||||
Id = new Guid("fb081cf7-fef2-4d91-a052-4922d20d100b"),
|
||||
Description = "Computers, servers, storage devices, network accessories, and related IT infrastructure.",
|
||||
IsActive = true,
|
||||
Name = "IT, Computing & Networking",
|
||||
ShortName = "ITC"
|
||||
},
|
||||
new
|
||||
{
|
||||
Id = new Guid("bbdc04bb-d930-428c-aabc-72e198ea100c"),
|
||||
Description = "Industrial packaging materials, adhesive tapes, cleaning agents, lubricants, and operational consumables.",
|
||||
IsActive = true,
|
||||
Name = "Packaging, Consumables, Chemicals & Lubricants",
|
||||
ShortName = "PAC"
|
||||
},
|
||||
new
|
||||
{
|
||||
Id = new Guid("d9677af1-6f91-44da-b12e-0f7ab00c100d"),
|
||||
Description = "Cement, tiles, paints, glass, flooring, and other architectural finishing materials.",
|
||||
IsActive = true,
|
||||
Name = "Building Materials & Finishes",
|
||||
ShortName = "BLD"
|
||||
},
|
||||
new
|
||||
{
|
||||
Id = new Guid("cd59914f-4e6b-47eb-8d2a-eecb85bc100e"),
|
||||
Description = "Vehicles, fleet equipment, spare parts, lubricants, and accessories for automotive applications.",
|
||||
IsActive = true,
|
||||
Name = "Automotive & Fleet",
|
||||
ShortName = "AUT"
|
||||
});
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Marco.Pms.Model.Inventory.ProductDetail", b =>
|
||||
@ -3007,10 +3121,10 @@ namespace Marco.Pms.DataAccess.Migrations
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("char(36)");
|
||||
|
||||
b.Property<Guid>("NextPurchaseStatusId")
|
||||
b.Property<Guid?>("NextPurchaseStatusId")
|
||||
.HasColumnType("char(36)");
|
||||
|
||||
b.Property<Guid>("PreviousPurchaseStatusId")
|
||||
b.Property<Guid?>("PreviousPurchaseStatusId")
|
||||
.HasColumnType("char(36)");
|
||||
|
||||
b.Property<Guid>("PurchaseStatusId")
|
||||
@ -3191,7 +3305,7 @@ namespace Marco.Pms.DataAccess.Migrations
|
||||
b.Property<Guid>("NextRequisitionStatusId")
|
||||
.HasColumnType("char(36)");
|
||||
|
||||
b.Property<Guid>("PreviousRequisitionStatusId")
|
||||
b.Property<Guid?>("PreviousRequisitionStatusId")
|
||||
.HasColumnType("char(36)");
|
||||
|
||||
b.Property<Guid>("RequisitionStatusId")
|
||||
@ -3227,6 +3341,9 @@ namespace Marco.Pms.DataAccess.Migrations
|
||||
.IsRequired()
|
||||
.HasColumnType("longtext");
|
||||
|
||||
b.Property<Guid>("CompanyTypeId")
|
||||
.HasColumnType("char(36)");
|
||||
|
||||
b.Property<DateTime>("CreatedAt")
|
||||
.HasColumnType("datetime(6)");
|
||||
|
||||
@ -3263,6 +3380,8 @@ namespace Marco.Pms.DataAccess.Migrations
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("CompanyTypeId");
|
||||
|
||||
b.HasIndex("CreatedById");
|
||||
|
||||
b.HasIndex("UpdatedById");
|
||||
@ -9639,15 +9758,11 @@ namespace Marco.Pms.DataAccess.Migrations
|
||||
{
|
||||
b.HasOne("Marco.Pms.Model.Inventory.PurchaseOrderStatus", "NextPurchaseStatus")
|
||||
.WithMany()
|
||||
.HasForeignKey("NextPurchaseStatusId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
.HasForeignKey("NextPurchaseStatusId");
|
||||
|
||||
b.HasOne("Marco.Pms.Model.Inventory.PurchaseOrderStatus", "PreviousPurchaseStatus")
|
||||
.WithMany()
|
||||
.HasForeignKey("PreviousPurchaseStatusId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
.HasForeignKey("PreviousPurchaseStatusId");
|
||||
|
||||
b.HasOne("Marco.Pms.Model.Inventory.PurchaseOrderStatus", "PurchaseStatus")
|
||||
.WithMany()
|
||||
@ -9802,9 +9917,7 @@ namespace Marco.Pms.DataAccess.Migrations
|
||||
|
||||
b.HasOne("Marco.Pms.Model.Inventory.RequisitionStatus", "PreviousRequisitionStatus")
|
||||
.WithMany()
|
||||
.HasForeignKey("PreviousRequisitionStatusId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
.HasForeignKey("PreviousRequisitionStatusId");
|
||||
|
||||
b.HasOne("Marco.Pms.Model.Inventory.RequisitionStatus", "RequisitionStatus")
|
||||
.WithMany()
|
||||
@ -9829,6 +9942,12 @@ namespace Marco.Pms.DataAccess.Migrations
|
||||
|
||||
modelBuilder.Entity("Marco.Pms.Model.Inventory.Supplier", b =>
|
||||
{
|
||||
b.HasOne("Marco.Pms.Model.Master.CompanyTypeMaster", "CompanyType")
|
||||
.WithMany()
|
||||
.HasForeignKey("CompanyTypeId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.HasOne("Marco.Pms.Model.Employees.Employee", "CreatedBy")
|
||||
.WithMany()
|
||||
.HasForeignKey("CreatedById")
|
||||
@ -9839,6 +9958,8 @@ namespace Marco.Pms.DataAccess.Migrations
|
||||
.WithMany()
|
||||
.HasForeignKey("UpdatedById");
|
||||
|
||||
b.Navigation("CompanyType");
|
||||
|
||||
b.Navigation("CreatedBy");
|
||||
|
||||
b.Navigation("UpdatedBy");
|
||||
|
||||
@ -4,6 +4,7 @@
|
||||
<TargetFramework>net8.0</TargetFramework>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<Nullable>enable</Nullable>
|
||||
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
|
||||
@ -7,7 +7,7 @@ namespace Marco.Pms.Model.Inventory
|
||||
public class PurchaseStatusMapping : TenantRelation
|
||||
{
|
||||
public Guid Id { get; set; }
|
||||
public Guid PreviousPurchaseStatusId { get; set; }
|
||||
public Guid? PreviousPurchaseStatusId { get; set; }
|
||||
|
||||
[ValidateNever]
|
||||
[ForeignKey("PreviousPurchaseStatusId")]
|
||||
@ -17,7 +17,7 @@ namespace Marco.Pms.Model.Inventory
|
||||
[ValidateNever]
|
||||
[ForeignKey("PurchaseStatusId")]
|
||||
public PurchaseOrderStatus? PurchaseStatus { get; set; }
|
||||
public Guid NextPurchaseStatusId { get; set; }
|
||||
public Guid? NextPurchaseStatusId { get; set; }
|
||||
|
||||
[ValidateNever]
|
||||
[ForeignKey("NextPurchaseStatusId")]
|
||||
|
||||
@ -7,7 +7,7 @@ namespace Marco.Pms.Model.Inventory
|
||||
public class RequisitionStatusMapping : TenantRelation
|
||||
{
|
||||
public Guid Id { get; set; }
|
||||
public Guid PreviousRequisitionStatusId { get; set; }
|
||||
public Guid? PreviousRequisitionStatusId { get; set; }
|
||||
|
||||
[ValidateNever]
|
||||
[ForeignKey("PreviousRequisitionStatusId")]
|
||||
|
||||
@ -1,4 +1,5 @@
|
||||
using Marco.Pms.Model.Employees;
|
||||
using Marco.Pms.Model.Master;
|
||||
using Microsoft.AspNetCore.Mvc.ModelBinding.Validation;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
|
||||
@ -15,6 +16,11 @@ namespace Marco.Pms.Model.Inventory
|
||||
public string IFSC { get; set; } = default!;
|
||||
public string SupplierUId { get; set; } = "Supplier-00001";
|
||||
public bool IsActive { get; set; } = true;
|
||||
public Guid CompanyTypeId { get; set; }
|
||||
|
||||
[ValidateNever]
|
||||
[ForeignKey("CompanyTypeId")]
|
||||
public CompanyTypeMaster? CompanyType { get; set; }
|
||||
public DateTime CreatedAt { get; set; }
|
||||
public Guid CreatedById { get; set; }
|
||||
|
||||
|
||||
@ -4,6 +4,7 @@
|
||||
<TargetFramework>net7.0</TargetFramework>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<Nullable>enable</Nullable>
|
||||
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
|
||||
@ -8,6 +8,7 @@
|
||||
<GenerateDocumentationFile>False</GenerateDocumentationFile>
|
||||
<UserSecretsId>55935cea-fc40-40f8-be42-da094f06b11f</UserSecretsId>
|
||||
<DockerDefaultTargetOS>Linux</DockerDefaultTargetOS>
|
||||
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
|
||||
@ -1,19 +1,28 @@
|
||||
using Marco.Pms.Model.Dtos.Inventory;
|
||||
using Marco.Pms.DataAccess.Data;
|
||||
using Marco.Pms.Model.Dtos.Inventory;
|
||||
using Marco.Pms.Model.Employees;
|
||||
using Marco.Pms.Model.Utilities;
|
||||
using Marco.Pms.Services.Service.ServiceInterfaces;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
|
||||
namespace Marco.Pms.Services.Service
|
||||
{
|
||||
public class InventoryService : IInventoryService
|
||||
{
|
||||
private readonly ApplicationDbContext _context;
|
||||
public InventoryService(ApplicationDbContext context)
|
||||
{
|
||||
_context = context;
|
||||
}
|
||||
#region =================================================================== Items APIs ===================================================================
|
||||
public async Task<ApiResponse<object>> CreateItemAsync(ItemDto model, Employee loggedInEmployee, Guid tenantId)
|
||||
{
|
||||
var item = await _context.ProductDetails.FirstOrDefaultAsync();
|
||||
return ApiResponse<object>.SuccessResponse(new { }, "", 200);
|
||||
}
|
||||
public async Task<ApiResponse<object>> SuspendItemAsync(Guid id, bool isActive, Employee loggedInEmployee, Guid tenantId)
|
||||
{
|
||||
var item = await _context.ProductDetails.FirstOrDefaultAsync();
|
||||
return ApiResponse<object>.SuccessResponse(new { }, "", 200);
|
||||
}
|
||||
#endregion
|
||||
|
||||
@ -4,6 +4,7 @@
|
||||
<TargetFramework>net7.0</TargetFramework>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<Nullable>enable</Nullable>
|
||||
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user