[CLAUDE] Infra: Mig 27 — Chunk A MenuItem +IsVisible +DisplayLabel
Some checks failed
Deploy SOLUTION_ERP / build-deploy (push) Has been cancelled
Some checks failed
Deploy SOLUTION_ERP / build-deploy (push) Has been cancelled
Session 20 turn 7: admin có thể Ẩn/Hiện + Đổi tên hiển thị menu cho fe-user (eOffice). Admin sidebar luôn giữ Label gốc (user Q2=b "chỉ của eOffice thôi"). Domain MenuItem: +IsVisible bool=true +DisplayLabel string?(200) EF Configuration: HasDefaultValue(true) + HasMaxLength(200) Migration 27 AddVisibilityAndDisplayLabelToMenuItems — 3-file rule: + AddColumn IsVisible bit NOT NULL DEFAULT 1 + AddColumn DisplayLabel nvarchar(200) NULL Verify: - dotnet build SolutionErp.slnx — 0 warn / 0 err - dotnet ef database update --connection SolutionErp_Dev — applied OK - dotnet ef database update SolutionErp_Design — applied OK Pending: B (BE API) → C (FE admin page) → D (FE user render) → E (Docs) Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
@ -15,6 +15,8 @@ public class MenuItemConfiguration : IEntityTypeConfiguration<MenuItem>
|
||||
b.Property(x => x.Label).HasMaxLength(200).IsRequired();
|
||||
b.Property(x => x.ParentKey).HasMaxLength(50);
|
||||
b.Property(x => x.Icon).HasMaxLength(50);
|
||||
b.Property(x => x.IsVisible).HasDefaultValue(true);
|
||||
b.Property(x => x.DisplayLabel).HasMaxLength(200);
|
||||
|
||||
b.HasOne(x => x.Parent)
|
||||
.WithMany(x => x.Children)
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,40 @@
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace SolutionErp.Infrastructure.Persistence.Migrations
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public partial class AddVisibilityAndDisplayLabelToMenuItems : Migration
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.AddColumn<string>(
|
||||
name: "DisplayLabel",
|
||||
table: "MenuItems",
|
||||
type: "nvarchar(200)",
|
||||
maxLength: 200,
|
||||
nullable: true);
|
||||
|
||||
migrationBuilder.AddColumn<bool>(
|
||||
name: "IsVisible",
|
||||
table: "MenuItems",
|
||||
type: "bit",
|
||||
nullable: false,
|
||||
defaultValue: true);
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropColumn(
|
||||
name: "DisplayLabel",
|
||||
table: "MenuItems");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "IsVisible",
|
||||
table: "MenuItems");
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -1799,10 +1799,19 @@ namespace SolutionErp.Infrastructure.Persistence.Migrations
|
||||
.HasMaxLength(50)
|
||||
.HasColumnType("nvarchar(50)");
|
||||
|
||||
b.Property<string>("DisplayLabel")
|
||||
.HasMaxLength(200)
|
||||
.HasColumnType("nvarchar(200)");
|
||||
|
||||
b.Property<string>("Icon")
|
||||
.HasMaxLength(50)
|
||||
.HasColumnType("nvarchar(50)");
|
||||
|
||||
b.Property<bool>("IsVisible")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("bit")
|
||||
.HasDefaultValue(true);
|
||||
|
||||
b.Property<string>("Label")
|
||||
.IsRequired()
|
||||
.HasMaxLength(200)
|
||||
|
||||
Reference in New Issue
Block a user