RecoverAggregate

Marker interface for commands that recover a previously deleted aggregate.

Commands implementing this interface signal that a soft-deleted aggregate should be restored to active status. The recovery process typically involves:

  • Unmarking the aggregate as deleted

  • Publishing recovery events for downstream processing

  • Restoring related resources and references

  • Ensuring the operation is idempotent for already recovered aggregates

See also

AggregateRecovered

event published when recovery completes

for the deletion operation

AggregateDeleted

for the deletion event

Example usage:

// Custom recover command with additional data
data class RecoverUserCommand(
val reason: String,
val recoveredBy: String
) : RecoverAggregate

// Or use the default implementation
val recoverCommand = DefaultRecoverAggregate

Inheritors