Package su.onno.ui
Class CatalogCommandService
java.lang.Object
su.onno.ui.CatalogCommandService
Write-side commands for catalogs — create, update, delete. Extracted from
GenericCatalogController so the REST API and other callers (e.g. the MCP
server) share one write path, and read-only mode + UiAccessService write
checks are enforced in a single place against the caller's Principal.-
Constructor Summary
ConstructorsConstructorDescriptionCatalogCommandService(MetadataRegistry registry, org.jdbi.v3.core.Jdbi jdbi, UiProperties properties, NumberGenerator numberGenerator, CatalogQueryService query, UiAccessService access, org.springframework.context.ApplicationEventPublisher events, SecretCipher secretCipher) -
Method Summary
Modifier and TypeMethodDescriptionvoiddelete(CatalogDescriptor desc, UUID id, Principal principal) Dry-run the write lifecycle against a form's current values and report every failure without persisting anything — the backend of the form's live (as-you-type) validation.
-
Constructor Details
-
CatalogCommandService
public CatalogCommandService(MetadataRegistry registry, org.jdbi.v3.core.Jdbi jdbi, UiProperties properties, NumberGenerator numberGenerator, CatalogQueryService query, UiAccessService access, org.springframework.context.ApplicationEventPublisher events, SecretCipher secretCipher)
-
-
Method Details
-
create
-
update
-
validate
public Map<String,Object> validate(CatalogDescriptor desc, UUID id, Map<String, Object> requestBody, Principal principal) Dry-run the write lifecycle against a form's current values and report every failure without persisting anything — the backend of the form's live (as-you-type) validation. Runs the same pipeline ascreate(su.onno.metadata.CatalogDescriptor, java.util.Map<java.lang.String, java.lang.Object>, java.security.Principal)/update(su.onno.metadata.CatalogDescriptor, java.util.UUID, java.util.Map<java.lang.String, java.lang.Object>, java.security.Principal): declarative attribute constraints, then the typed entity'sonFilling/beforeWritehooks andValidatedrules, so a conflict check written in Java surfaces while the user is still on the field. No code is consumed from the numbering sequence and no events fire. Always returns 200 — the outcome is the{valid, fieldErrors, formErrors}payload. -
delete
-