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:
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user