feat: Replace warehouse product groups with hierarchical categories and update related UI and API.

This commit is contained in:
2025-12-12 13:34:52 +01:00
parent 54cf1ff276
commit 08256f0019
18 changed files with 10153 additions and 2 deletions

View File

@@ -0,0 +1,76 @@
using System;
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace Zentral.Infrastructure.Migrations
{
/// <inheritdoc />
public partial class RemoveWarehouseProductGroups : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropForeignKey(
name: "FK_WarehouseArticles_WarehouseProductGroups_ProductGroupId",
table: "WarehouseArticles");
migrationBuilder.DropTable(
name: "WarehouseProductGroups");
migrationBuilder.DropIndex(
name: "IX_WarehouseArticles_ProductGroupId",
table: "WarehouseArticles");
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.CreateTable(
name: "WarehouseProductGroups",
columns: table => new
{
Id = table.Column<int>(type: "INTEGER", nullable: false)
.Annotation("Sqlite:Autoincrement", true),
Code = table.Column<string>(type: "TEXT", nullable: false),
CreatedAt = table.Column<DateTime>(type: "TEXT", nullable: true),
CreatedBy = table.Column<string>(type: "TEXT", nullable: true),
CustomFieldsJson = table.Column<string>(type: "TEXT", nullable: true),
Description = table.Column<string>(type: "TEXT", nullable: true),
IsActive = table.Column<bool>(type: "INTEGER", nullable: false),
Name = table.Column<string>(type: "TEXT", nullable: false),
Notes = table.Column<string>(type: "TEXT", nullable: true),
UpdatedAt = table.Column<DateTime>(type: "TEXT", nullable: true),
UpdatedBy = table.Column<string>(type: "TEXT", nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_WarehouseProductGroups", x => x.Id);
});
migrationBuilder.CreateIndex(
name: "IX_WarehouseArticles_ProductGroupId",
table: "WarehouseArticles",
column: "ProductGroupId");
migrationBuilder.CreateIndex(
name: "IX_WarehouseProductGroups_Code",
table: "WarehouseProductGroups",
column: "Code",
unique: true);
migrationBuilder.CreateIndex(
name: "IX_WarehouseProductGroups_IsActive",
table: "WarehouseProductGroups",
column: "IsActive");
migrationBuilder.AddForeignKey(
name: "FK_WarehouseArticles_WarehouseProductGroups_ProductGroupId",
table: "WarehouseArticles",
column: "ProductGroupId",
principalTable: "WarehouseProductGroups",
principalColumn: "Id",
onDelete: ReferentialAction.SetNull);
}
}
}