Support selecting update procedure for catalog updates

Added CatalogUpdateProcedure enum to domain. CatalogWriteDto now includes UpdateProcedure property in both application and BlazorWasm layers. Catalogs.razor form allows users to choose between PRTBMY_CATALOG_UPDATE and PRTBMY_CATALOG_SAVE when editing. Repository, service, and handler layers updated to pass and use the selected procedure. Default remains Update. Updated comments and TODOs for clarity and future refactoring.
This commit is contained in:
OlgunR
2026-01-19 11:10:19 +01:00
parent 45e5327148
commit 4fbcd0dc11
9 changed files with 43 additions and 46 deletions

View File

@@ -1,6 +1,7 @@
using AutoMapper;
using DbFirst.Domain.Entities;
using DbFirst.Domain.Repositories;
using DbFirst.Domain;
using MediatR;
namespace DbFirst.Application.Catalogs.Commands;
@@ -32,7 +33,8 @@ public class UpdateCatalogHandler : IRequestHandler<UpdateCatalogCommand, Catalo
entity.ChangedWho = "system";
entity.ChangedWhen = DateTime.UtcNow;
var updated = await _repository.UpdateAsync(request.Id, entity, cancellationToken);
var procedure = request.Dto.UpdateProcedure;
var updated = await _repository.UpdateAsync(request.Id, entity, procedure, cancellationToken);
return updated == null ? null : _mapper.Map<CatalogReadDto>(updated);
}
}