[CLAUDE] PurchaseEvaluation: +mục E "Link hồ sơ" (hyperlink NAS) + rename "Dự trù PRO"->"Ngân sách PRO"
All checks were successful
Deploy SOLUTION_ERP / build-deploy (push) Successful in 4m25s

Anh Kiệt (FDC UAT): (1) thêm mục "e. Link hồ sơ" dưới mục "d. Bản so sánh" — 1 ô dán
hyperlink tới thư mục hồ sơ trên NAS công ty, hiện dạng <a> bấm-mở (target _blank rel
noopener noreferrer), null-safe; (2) đổi nhãn "Dự trù PRO"->"Ngân sách PRO" (cả badge
+ row label; GIỮ "Ghi chú từ PRO" + field-code/biến).
- BE: PurchaseEvaluation +HoSoLink string? (Mig AddHoSoLinkToPurchaseEvaluation —
  nvarchar(1000) nullable, no new table, Down reversible) + Create/Update command
  (+trailing optional =null -> backward-compat, 0 call-site break) + Detail DTO + projection.
  Build slnx PASS.
- FE x2 app SHA256 mirror (PeDetailTabs + PeWorkspaceCreateView): mục E input/hyperlink +
  rename. types +hoSoLink.
Workflow fan-out (BE song song FE -> review); FE+reviewer return-rỗng -> em main recover
disk + build-verify x3 + self-gate (bắt badge sót rename).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
pqhuy1987
2026-06-16 11:13:39 +07:00
parent 318860a38e
commit 5a0aaa4e83
13 changed files with 6458 additions and 10 deletions

View File

@ -206,6 +206,8 @@ public record PurchaseEvaluationDetailBundleDto(
string TenGoiThau,
string? DiaDiem,
string? MoTa,
// [HoSoLink] hyperlink thư mục hồ sơ NAS — FE render hyperlink bấm-mở.
string? HoSoLink,
Guid ProjectId,
string ProjectName,
// [Mig 49 S57bis] Hạng mục công việc — loose-Guid resolve giống ProjectName.

View File

@ -25,7 +25,8 @@ public record CreatePurchaseEvaluationCommand(
string? PaymentTerms,
decimal? BudgetPeriodAmount, // [S61 Mig 50] "Ngân sách - kỳ này" — drafter nhập, optional lúc tạo (guard lúc submit)
Guid? ApprovalWorkflowId = null, // [Mig 23] User chọn quy trình duyệt V2 lúc tạo
Guid? WorkItemId = null) : IRequest<Guid>; // [Mig 49 S57bis] Hạng mục công việc — flow create PHẢI chọn (validator NotEmpty)
Guid? WorkItemId = null, // [Mig 49 S57bis] Hạng mục công việc — flow create PHẢI chọn (validator NotEmpty)
string? HoSoLink = null) : IRequest<Guid>; // [HoSoLink] hyperlink thư mục hồ sơ NAS — optional, max 1000
public class CreatePurchaseEvaluationCommandValidator : AbstractValidator<CreatePurchaseEvaluationCommand>
{
@ -42,6 +43,8 @@ public class CreatePurchaseEvaluationCommandValidator : AbstractValidator<Create
.WithMessage("Phải chọn hạng mục công việc.");
RuleFor(x => x.DiaDiem).MaximumLength(500);
RuleFor(x => x.MoTa).MaximumLength(2000);
// [HoSoLink] MaxLength MATCH EF config HasMaxLength(1000) (S35 lesson).
RuleFor(x => x.HoSoLink).MaximumLength(1000);
// [S61] >0 khi có nhập — KHÔNG bắt buộc lúc tạo, submit guard mới chặn.
RuleFor(x => x.BudgetPeriodAmount).GreaterThan(0)
.When(x => x.BudgetPeriodAmount.HasValue)
@ -134,6 +137,7 @@ public class CreatePurchaseEvaluationCommandHandler(
DepartmentId = request.DepartmentId,
DiaDiem = request.DiaDiem,
MoTa = request.MoTa,
HoSoLink = request.HoSoLink, // [HoSoLink] hyperlink thư mục hồ sơ NAS
DrafterUserId = currentUser.UserId,
WorkflowDefinitionId = activeWfId,
ApprovalWorkflowId = request.ApprovalWorkflowId, // Mig 23 — schema mới V2
@ -208,7 +212,8 @@ public record UpdatePurchaseEvaluationDraftCommand(
decimal? BudgetPeriodAmount = null, // [S61] null-safe: null = GIỮ giá trị cũ (chống null-hóa bug-class S42)
decimal? ExpectedRemainingAmount = null, // [S61] null-safe: null = GIỮ giá trị cũ
Guid? ApprovalWorkflowId = null, // [Mig 23] cho User đổi quy trình khi sửa Nháp
Guid? WorkItemId = null) : IRequest; // [Mig 49 S57bis] cho User đổi hạng mục công việc khi sửa Nháp/Trả lại
Guid? WorkItemId = null, // [Mig 49 S57bis] cho User đổi hạng mục công việc khi sửa Nháp/Trả lại
string? HoSoLink = null) : IRequest; // [HoSoLink] hyperlink thư mục hồ sơ NAS — absolute-set như MoTa/DiaDiem (null = clear link)
public class UpdatePurchaseEvaluationDraftCommandValidator : AbstractValidator<UpdatePurchaseEvaluationDraftCommand>
{
@ -217,6 +222,8 @@ public class UpdatePurchaseEvaluationDraftCommandValidator : AbstractValidator<U
RuleFor(x => x.TenGoiThau).NotEmpty().MaximumLength(500);
RuleFor(x => x.DiaDiem).MaximumLength(500);
RuleFor(x => x.MoTa).MaximumLength(2000);
// [HoSoLink] MaxLength MATCH EF config HasMaxLength(1000) (S35 lesson).
RuleFor(x => x.HoSoLink).MaximumLength(1000);
RuleFor(x => x.BudgetPeriodAmount).GreaterThan(0)
.When(x => x.BudgetPeriodAmount.HasValue)
.WithMessage("Ngân sách kỳ này phải lớn hơn 0.");
@ -264,6 +271,7 @@ public class UpdatePurchaseEvaluationDraftCommandHandler(
entity.TenGoiThau = request.TenGoiThau;
entity.DiaDiem = request.DiaDiem;
entity.MoTa = request.MoTa;
entity.HoSoLink = request.HoSoLink; // [HoSoLink] absolute-set như MoTa/DiaDiem (Section 1 text field, null = clear)
entity.PaymentTerms = request.PaymentTerms;
entity.ApprovalWorkflowId = request.ApprovalWorkflowId; // Mig 23 — User đổi quy trình
// [S61] null-safe 2 field ngân sách mới (mirror WorkItemId bên dưới):
@ -1028,6 +1036,7 @@ public class GetPurchaseEvaluationQueryHandler(
return new PurchaseEvaluationDetailBundleDto(
e.Id, e.MaPhieu, e.Type, e.Phase, e.TenGoiThau, e.DiaDiem, e.MoTa,
e.HoSoLink, // [HoSoLink] hyperlink thư mục hồ sơ NAS
e.ProjectId, project?.Name ?? "",
e.WorkItemId, workItem?.Name, workItem?.Code,
e.DepartmentId, department?.Name,

View File

@ -18,6 +18,7 @@ public class PurchaseEvaluation : AuditableEntity
public Guid? DrafterUserId { get; set; } // QS/NV.PB soạn
public string? DiaDiem { get; set; } // Lô K, KCN Lộc An...
public string? MoTa { get; set; }
public string? HoSoLink { get; set; } // [HoSoLink] 1 hyperlink tới thư mục hồ sơ trên NAS công ty (anh Kiệt) — paste link thư mục, FE render hyperlink bấm-mở. Nullable, max 1000. KHÔNG entity con / bảng mới.
public Guid? WorkflowDefinitionId { get; set; } // [LEGACY Mig 21] Pinned at create — config y như HĐ
public Guid? ApprovalWorkflowId { get; set; } // [Mig 23 Session 17] Pin schema mới ApprovalWorkflowsV2

View File

@ -18,6 +18,8 @@ public class PurchaseEvaluationConfiguration : IEntityTypeConfiguration<Purchase
b.Property(x => x.TenGoiThau).HasMaxLength(500).IsRequired();
b.Property(x => x.DiaDiem).HasMaxLength(500);
b.Property(x => x.MoTa).HasMaxLength(2000);
// [HoSoLink] hyperlink thư mục hồ sơ NAS — nvarchar(1000) nullable, KHÔNG index.
b.Property(x => x.HoSoLink).HasMaxLength(1000);
b.Property(x => x.PaymentTerms).HasColumnType("nvarchar(max)");
// [S61 Mig 50] 2 cột ngân sách mới thay BudgetManual* — precision giữ (18,2).
b.Property(x => x.BudgetPeriodAmount).HasPrecision(18, 2);

View File

@ -0,0 +1,29 @@
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace SolutionErp.Infrastructure.Persistence.Migrations
{
/// <inheritdoc />
public partial class AddHoSoLinkToPurchaseEvaluation : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AddColumn<string>(
name: "HoSoLink",
table: "PurchaseEvaluations",
type: "nvarchar(1000)",
maxLength: 1000,
nullable: true);
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropColumn(
name: "HoSoLink",
table: "PurchaseEvaluations");
}
}
}

View File

@ -4617,6 +4617,10 @@ namespace SolutionErp.Infrastructure.Persistence.Migrations
.HasPrecision(18, 2)
.HasColumnType("decimal(18,2)");
b.Property<string>("HoSoLink")
.HasMaxLength(1000)
.HasColumnType("nvarchar(1000)");
b.Property<bool>("IsDeleted")
.HasColumnType("bit");