[CLAUDE] PurchaseEvaluation: Mig 55 ô "Ghi chú từ CCM" ngân sách gói thầu — CCM nhập số + ghi lý do giống PRO
All checks were successful
Deploy SOLUTION_ERP / build-deploy (push) Successful in 4m54s
All checks were successful
Deploy SOLUTION_ERP / build-deploy (push) Successful in 4m54s
- Entity PeWorkItemBudget +CcmNote (mirror ProNote, nvarchar 1000) + Mig 55 additive-nullable - UpdatePeBudgetCcmCommand +CcmNote absolute-set, role-gate CostControl/Admin fail-closed - DTO PeBudgetSummaryDto +CcmNote + controller BudgetCcmBody + GET mapping - FE 2 app SHA-mirror: dòng "Ghi chú từ CCM" gate canEditCcm (sau V0/hiệu chỉnh), absolute-set đủ 3 field - Test +5 (set CCM/Admin, null-clear, non-priv Forbidden, all-3-persist) -> 339 pass Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
@ -297,6 +297,7 @@ public record PeBudgetSummaryDto(
|
||||
string? ProNote,
|
||||
decimal? InitialAmount,
|
||||
decimal? AdjustmentAmount,
|
||||
string? CcmNote,
|
||||
decimal FullAmount,
|
||||
bool FullIsEstimate,
|
||||
bool CanEditPro,
|
||||
|
||||
@ -12,7 +12,7 @@ namespace SolutionErp.Application.PurchaseEvaluations;
|
||||
// [S61 Mig 50] 2 handler nhập ngân sách gói thầu theo ROLE (anh Kiệt chốt):
|
||||
// - PRO (Procurement | Admin): ProEstimateAmount (dự trù lần đầu) + ProNote.
|
||||
// - CCM (CostControl | Admin): InitialAmount ("Ban hành lần đầu") +
|
||||
// AdjustmentAmount ("V0/hiệu chỉnh tăng giảm" — cho phép ÂM).
|
||||
// AdjustmentAmount ("V0/hiệu chỉnh tăng giảm" — cho phép ÂM) + CcmNote (Mig 55).
|
||||
// Authz pattern AssignItTicketHandler S54: controller [Authorize] any-auth,
|
||||
// handler fine-grained ForbiddenException fail-closed (Forbidden TRƯỚC mọi
|
||||
// side-effect — S56 #5). KHÔNG ràng Phase (CCM "nhập trong khi duyệt" theo lời
|
||||
@ -126,7 +126,8 @@ public class UpdatePeBudgetProCommandHandler(
|
||||
public record UpdatePeBudgetCcmCommand(
|
||||
Guid PeId,
|
||||
decimal? InitialAmount,
|
||||
decimal? AdjustmentAmount) : IRequest;
|
||||
decimal? AdjustmentAmount,
|
||||
string? CcmNote) : IRequest;
|
||||
|
||||
public class UpdatePeBudgetCcmCommandValidator : AbstractValidator<UpdatePeBudgetCcmCommand>
|
||||
{
|
||||
@ -135,6 +136,7 @@ public class UpdatePeBudgetCcmCommandValidator : AbstractValidator<UpdatePeBudge
|
||||
RuleFor(x => x.InitialAmount).GreaterThanOrEqualTo(0)
|
||||
.When(x => x.InitialAmount.HasValue);
|
||||
// AdjustmentAmount KHÔNG ràng dấu — "hiệu chỉnh tăng giảm" cho phép ÂM.
|
||||
RuleFor(x => x.CcmNote).MaximumLength(1000);
|
||||
}
|
||||
}
|
||||
|
||||
@ -161,14 +163,18 @@ public class UpdatePeBudgetCcmCommandHandler(
|
||||
|
||||
var oldInitial = rec.InitialAmount;
|
||||
var oldAdjustment = rec.AdjustmentAmount;
|
||||
var oldCcmNote = rec.CcmNote;
|
||||
rec.InitialAmount = request.InitialAmount; // absolute-set (null = clear)
|
||||
rec.AdjustmentAmount = request.AdjustmentAmount;
|
||||
rec.CcmNote = request.CcmNote;
|
||||
|
||||
var parts = new List<string>();
|
||||
if (oldInitial != request.InitialAmount)
|
||||
parts.Add($"ban hành lần đầu {oldInitial?.ToString("N0") ?? "(trống)"}đ → {request.InitialAmount?.ToString("N0") ?? "(trống)"}đ");
|
||||
if (oldAdjustment != request.AdjustmentAmount)
|
||||
parts.Add($"V0/hiệu chỉnh {oldAdjustment?.ToString("N0") ?? "(trống)"}đ → {request.AdjustmentAmount?.ToString("N0") ?? "(trống)"}đ");
|
||||
if (oldCcmNote != request.CcmNote)
|
||||
parts.Add("ghi chú CCM cập nhật");
|
||||
|
||||
db.PurchaseEvaluationChangelogs.Add(new PurchaseEvaluationChangelog
|
||||
{
|
||||
|
||||
@ -851,7 +851,7 @@ public class GetPurchaseEvaluationQueryHandler(
|
||||
|
||||
peBudgetSummary = new PeBudgetSummaryDto(
|
||||
pairRec?.Id, pairRec?.ProEstimateAmount, pairRec?.ProNote,
|
||||
pairRec?.InitialAmount, pairRec?.AdjustmentAmount,
|
||||
pairRec?.InitialAmount, pairRec?.AdjustmentAmount, pairRec?.CcmNote,
|
||||
fullAmount, !hasCcm,
|
||||
canEditPro, canEditCcm,
|
||||
prevSubmittedTotal, prevSubmittedCount,
|
||||
|
||||
Reference in New Issue
Block a user