Skip to content

Service Configuration Management

The Catalog module exposes service configuration management under /api/catalog/services.

Route Surface

  • GET /api/catalog/services
  • POST /api/catalog/services
  • DELETE /api/catalog/services/:configId
  • PUT /api/catalog/services/:configId
  • DELETE returns { "message": "Service configuration deleted successfully" } when the configuration exists and is removed.

Validation Rules

  • POST uses createServiceConfigurationSchema, so service, iconCode, price, and isEnabled are all required at the HTTP boundary.
  • PUT uses updateServiceConfigurationSchema, so iconCode, price, and isEnabled are optional for partial updates.
  • PUT and DELETE require a configId route param validated as a UUID v7.
  • service is constrained by the shared enum and currently accepts only AI_AGENTS.
  • iconCode must be one of the published catalog icon values: bag, home, gift, sparkles, dining, car, users, heart, truck, tools, school, code, calendar, flight, camera, music, phone, globe, shield, key, star, flash, present, target, idea, clipboard, or washer.
  • POST is create-only. If a configuration for the same service already exists, the command returns a structured conflict error.
  • PUT is update-only. It targets an existing configuration record by configId, so the service value remains immutable after creation.
  • DELETE is delete-only. If the target configId does not exist, the command returns the same structured not-found error as PUT.

Structured Error Contract

The Catalog command layer returns structured application errors for invalid create/update/delete state transitions instead of silently upserting or ignoring missing records.

CodeHTTPMeaning
CATALOG.SERVICE_CONFIGURATION_ALREADY_EXISTS409POST tried to create a configuration for a service that already has one.
CATALOG.SERVICE_CONFIGURATION_NOT_FOUND404PUT or DELETE targeted a configId that does not map to a persisted configuration.

This keeps the Catalog module aligned with the shared Result<T> + AppError pattern used in the rest of the API.

Panel (Ajustes)

El panel administra estas configuraciones en Ajustes → Servicios (section=services): lista, filtros, creación y edición con react-hook-form, y cliente HTTP validado con los mismos esquemas Zod del paquete @repo/schemas/catalog. La UI respeta una configuración por valor de ServiceType: el alta solo permite elegir tipos aún libres y deshabilita “Crear” cuando el enum está saturado; en edición el tipo no es editable. Detalle de producto (inglés): Settings — Catalog services.