[CLAUDE] App+Api+FE+Scripts: Edit detail row inline + deps audit helper
All checks were successful
Deploy SOLUTION_ERP / build-deploy (push) Successful in 2m45s
All checks were successful
Deploy SOLUTION_ERP / build-deploy (push) Successful in 2m45s
## Edit detail row inline (BE)
7 typed UpdateXxxDetailCommand handler trong ContractDetailsFeatures.cs
— pattern lặp giống Add commands, EnsureContractType guard + log
ChangelogAction.Update với summary "Sửa <hạng mục/SP/CV/...>".
7 PUT endpoints trong ContractsController:
- PUT /contracts/{id}/details/{thau-phu|giao-khoan|nha-cung-cap|dich-vu|
mua-ban|nguyen-tac-ncc|nguyen-tac-dv}/{detailId}
## Edit detail row inline (FE)
ContractDetailsTab.tsx refactor:
- DeleteBtn → ActionBtns (Pencil + Trash) với onEdit + onDelete callbacks
- 7 XxxTable signatures + onEdit prop + pass row data via callback
- New EditRowDialog component:
* useEffect populate form từ row data khi target thay đổi
* Reuse FIELDS_BY_TYPE config + buildPayload (compute thanhTien)
* Date field convert ISO → yyyy-MM-dd cho input[type=date]
* PUT /contracts/{id}/details/{slug}/{detailId}
- Parent state editTarget — open dialog, close khi save thành công
Mirror fe-admin (file copy).
## Deps audit helper script
scripts/deps-audit.ps1 — chạy thủ công hoặc CI integration:
- dotnet list package --vulnerable --include-transitive (BE)
- npm audit --audit-level=moderate (fe-admin + fe-user)
- Color-coded output (green/red), summary cuối
- -FailOnHigh switch để CI gate
Skill ref .claude/skills/dependency-audit-erp/SKILL.md (đã có) cho
pin constraints + workflow fix.
## Build
- BE: dotnet build pass (0 error)
- fe-user: tsc + vite pass (11.52s)
- fe-admin: tsc + vite pass (577ms)
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
@ -164,6 +164,55 @@ public class ContractsController(IMediator mediator) : ControllerBase
|
||||
return NoContent();
|
||||
}
|
||||
|
||||
[HttpPut("{id:guid}/details/thau-phu/{detailId:guid}")]
|
||||
public async Task<IActionResult> UpdateThauPhuDetail(Guid id, Guid detailId, [FromBody] ThauPhuDetailDto body, CancellationToken ct)
|
||||
{
|
||||
await mediator.Send(new UpdateThauPhuDetailCommand(id, detailId, body), ct);
|
||||
return NoContent();
|
||||
}
|
||||
|
||||
[HttpPut("{id:guid}/details/giao-khoan/{detailId:guid}")]
|
||||
public async Task<IActionResult> UpdateGiaoKhoanDetail(Guid id, Guid detailId, [FromBody] GiaoKhoanDetailDto body, CancellationToken ct)
|
||||
{
|
||||
await mediator.Send(new UpdateGiaoKhoanDetailCommand(id, detailId, body), ct);
|
||||
return NoContent();
|
||||
}
|
||||
|
||||
[HttpPut("{id:guid}/details/nha-cung-cap/{detailId:guid}")]
|
||||
public async Task<IActionResult> UpdateNhaCungCapDetail(Guid id, Guid detailId, [FromBody] NhaCungCapDetailDto body, CancellationToken ct)
|
||||
{
|
||||
await mediator.Send(new UpdateNhaCungCapDetailCommand(id, detailId, body), ct);
|
||||
return NoContent();
|
||||
}
|
||||
|
||||
[HttpPut("{id:guid}/details/dich-vu/{detailId:guid}")]
|
||||
public async Task<IActionResult> UpdateDichVuDetail(Guid id, Guid detailId, [FromBody] DichVuDetailDto body, CancellationToken ct)
|
||||
{
|
||||
await mediator.Send(new UpdateDichVuDetailCommand(id, detailId, body), ct);
|
||||
return NoContent();
|
||||
}
|
||||
|
||||
[HttpPut("{id:guid}/details/mua-ban/{detailId:guid}")]
|
||||
public async Task<IActionResult> UpdateMuaBanDetail(Guid id, Guid detailId, [FromBody] MuaBanDetailDto body, CancellationToken ct)
|
||||
{
|
||||
await mediator.Send(new UpdateMuaBanDetailCommand(id, detailId, body), ct);
|
||||
return NoContent();
|
||||
}
|
||||
|
||||
[HttpPut("{id:guid}/details/nguyen-tac-ncc/{detailId:guid}")]
|
||||
public async Task<IActionResult> UpdateNguyenTacNccDetail(Guid id, Guid detailId, [FromBody] NguyenTacNccDetailDto body, CancellationToken ct)
|
||||
{
|
||||
await mediator.Send(new UpdateNguyenTacNccDetailCommand(id, detailId, body), ct);
|
||||
return NoContent();
|
||||
}
|
||||
|
||||
[HttpPut("{id:guid}/details/nguyen-tac-dv/{detailId:guid}")]
|
||||
public async Task<IActionResult> UpdateNguyenTacDvDetail(Guid id, Guid detailId, [FromBody] NguyenTacDvDetailDto body, CancellationToken ct)
|
||||
{
|
||||
await mediator.Send(new UpdateNguyenTacDvDetailCommand(id, detailId, body), ct);
|
||||
return NoContent();
|
||||
}
|
||||
|
||||
// ========== Changelogs (read-only) ==========
|
||||
|
||||
[HttpGet("{id:guid}/changelogs")]
|
||||
|
||||
Reference in New Issue
Block a user