[CLAUDE] PurchaseEvaluation: Mig 56 ngan sach MA TRAN 3 cot (Du an|PRO|CCM) + badge quyen NS theo role
All checks were successful
Deploy SOLUTION_ERP / build-deploy (push) Successful in 4m57s

S76 (anh Kiet FDC + chi Tra Sol) — form ngan sach + hien thi quyen nhap NS trong flow:
- Part 1: form ngan sach -> MA TRAN 3 cot, moi phong nhap+dieu chinh cot minh
  (PRO canEditPro / CCM canEditCcm / Du an FE hien-thi-only). Mig 56
  +ProInitialAmount/ProAdjustmentAmount (additive-nullable + data-migrate
  ProEstimate->ProInitial). full moi cot = ban hanh + hieu chinh.
- Part 2: Workflow Designer (fe-admin) +badge "NS PRO/CCM" canh approver
  (suy tu role Admin|Procurement / Admin|CostControl, hien-thi-only no-authz).
- Part 3: flow quy trinh fe-user/fe-admin (Duyet NCC) +badge tuong tu.
- Fix race mat-du-lieu Part 1 (useIsFetching khoa Luu khi refetch — dong
  cua-so stale-echo, reviewer Part2/3 bat).
- Test 339->344 (+5). 2 workflow review (Part 1 PASS + Part 2/3 PASS).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
pqhuy1987
2026-06-19 11:02:47 +07:00
parent 70c13d4ac8
commit e33481efb6
19 changed files with 6974 additions and 325 deletions

View File

@ -17,6 +17,8 @@ public class PeWorkItemBudgetConfiguration : IEntityTypeConfiguration<PeWorkItem
// Precision match BudgetManualAmount cũ (18,2).
b.Property(x => x.ProEstimateAmount).HasPrecision(18, 2);
b.Property(x => x.ProInitialAmount).HasPrecision(18, 2);
b.Property(x => x.ProAdjustmentAmount).HasPrecision(18, 2);
b.Property(x => x.InitialAmount).HasPrecision(18, 2);
b.Property(x => x.AdjustmentAmount).HasPrecision(18, 2);
b.Property(x => x.ProNote).HasMaxLength(1000);

View File

@ -0,0 +1,51 @@
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace SolutionErp.Infrastructure.Persistence.Migrations
{
/// <inheritdoc />
public partial class AddProBudgetSplitToPeWorkItemBudget : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AddColumn<decimal>(
name: "ProAdjustmentAmount",
table: "PeWorkItemBudgets",
type: "decimal(18,2)",
precision: 18,
scale: 2,
nullable: true);
migrationBuilder.AddColumn<decimal>(
name: "ProInitialAmount",
table: "PeWorkItemBudgets",
type: "decimal(18,2)",
precision: 18,
scale: 2,
nullable: true);
// [S76] Giu so PRO cu: so du tru 1-cot (ProEstimateAmount, <=S75) coi nhu
// "ban hanh lan dau" cot PRO -> migrate sang ProInitialAmount. Chay SAU
// AddColumn (cot phai ton tai truoc). Idempotent: chi set khi ProInitial trong.
// Design-DB 0 rows; chay THAT lan dau tren prod co data (gotcha #64).
migrationBuilder.Sql(@"
UPDATE PeWorkItemBudgets
SET ProInitialAmount = ProEstimateAmount
WHERE ProEstimateAmount IS NOT NULL AND ProInitialAmount IS NULL;");
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropColumn(
name: "ProAdjustmentAmount",
table: "PeWorkItemBudgets");
migrationBuilder.DropColumn(
name: "ProInitialAmount",
table: "PeWorkItemBudgets");
}
}
}

View File

@ -4546,10 +4546,18 @@ namespace SolutionErp.Infrastructure.Persistence.Migrations
b.Property<bool>("IsDeleted")
.HasColumnType("bit");
b.Property<decimal?>("ProAdjustmentAmount")
.HasPrecision(18, 2)
.HasColumnType("decimal(18,2)");
b.Property<decimal?>("ProEstimateAmount")
.HasPrecision(18, 2)
.HasColumnType("decimal(18,2)");
b.Property<decimal?>("ProInitialAmount")
.HasPrecision(18, 2)
.HasColumnType("decimal(18,2)");
b.Property<string>("ProNote")
.HasMaxLength(1000)
.HasColumnType("nvarchar(1000)");