Skip to main content

Command & Query Catalog

Complete reference of all MediatR commands and queries in the Alert.CA.Frontend.Application project. Commands modify state; queries read state. All are dispatched by controllers via the Mediator property inherited from ApiControllerBase.

For an overview of the CQRS pattern and the services these commands coordinate with, see Application Services.


Camera Commands

CommandHandler Action
PanTiltCameraCommandCalls CameraControlService.PanTiltZoomCamera(), then LeaseCameraAfterMove() on callback
MoveCameraHomeCommandCalls CameraControlService.MoveCameraHome()
FocusCameraCommandCalls CameraControlService.SetCameraFocus()
BrightnessCommandCalls CameraControlService.SetCameraBrightness()
TogglePatrolModeCommandCalls CameraControlService.GuardTourToggle()
ActivateTurboModeCommandSends turbo mode request to Image Acquisition API
CloseLeaseCommandCalls CameraControlService.CloseLease()
LeaseCameraAfterMoveCommandCalls CameraControlService.LeaseCameraAfterMove() (internal callback)
ExtendMovementExpirationCommandUpdates movement expiration date in Cosmos DB
EndMovementExpirationCommandClears movement expiration for a camera

Camera Queries

QueryReturns
GetStaticMetadataByCameraIdsQueryStatic camera metadata (combines Cosmos, SQL, and Acquisition device data)
GetAllStaticCameraMetadataQueryAll static camera metadata, optionally filtered by user access
GetOperationalCameraMetadataQueryOperational metadata with optional time filter, images, and patrol mode
GetCamerasByEntraUserIdQueryCamera names the user has access to
GetCameraStateQueryCurrent device state from Cosmos DB
GetLatestCameraMovementWithUserQueryLatest movement record with user information
GetLatestLeaseAndMoveByCameraQueryActive lease and movement reason, if exists

Image Queries

QueryReturns
GetImageMetadataForCamerasQueryLatest image metadata for multiple cameras
GetLatestImageByCameraIdQueryLatest single image for one camera
GetTimelapseForCameraQueryImage metadata within a time range (max 6 hours)
GetPanoramaImagesForCameraQueryPanorama images within a time range
GetLatestPanoramaMetadataForCameraQueryLatest panorama for one camera

Alert & Notification Commands

CommandDescription
CreateAlertMessageCommandCreates an alert with optional map image (PNG)
CreateSubscriptionCommandCreates a new notification subscription
UpdateSubscriptionCommandUpdates an existing subscription
PauseSubscriptionCommandPauses a subscription
DeleteSubscriptionCommandSoft-deletes a subscription

Notification Queries

QueryReturns
GetSubscriptionByEntraUserIdQueryUser's subscriptions
GetLocationsQueryAvailable subscription locations

User Commands & Queries

Command / QueryDescription
UISettingsQueryGets UI settings from Cosmos DB for the user
UpdateActivityLogReadDateCommandUpdates the user's last activity log read date
UpdateCameraPinHideCommandUpdates pinned and hidden camera lists
UpdateLayerVisibilityCommandUpdates map layer visibility preferences
UpdateCameraOptionsCommandUpdates camera display options

Activity Log

Command / QueryDescription
AddMessageCommandInserts an activity log record into SQL Server
GetLatestMessagesByCameraQueryRetrieves latest messages for a camera (with optional count limit)

Shared Views & Feature Flags

Command / QueryDescription
CreateSharedViewCommandCreates a shared view, returns the generated ID
GetSharedViewByIdQueryRetrieves a shared view by ID
GetAllFeatureFlagsQueryRetrieves all feature flags from App Configuration