GivenInitializationCommand

data class GivenInitializationCommand(val aggregateId: AggregateId, val id: String = generateGlobalId(), val ownerId: String = OwnerId.DEFAULT_OWNER_ID, val requestId: String = generateGlobalId(), val isCreate: Boolean = true, val allowCreate: Boolean = false, val isVoid: Boolean = false, val header: Header = DefaultHeader.empty()) : CommandMessage<GivenInitialization> , NamedAggregate

A command message used for initializing aggregates with given events during testing.

This command is used internally by the testing framework to set up aggregate state by replaying domain events. It implements the CommandMessage interface and provides default values suitable for testing scenarios.

Constructors

Link copied to clipboard
constructor(aggregateId: AggregateId, id: String = generateGlobalId(), ownerId: String = OwnerId.DEFAULT_OWNER_ID, requestId: String = generateGlobalId(), isCreate: Boolean = true, allowCreate: Boolean = false, isVoid: Boolean = false, header: Header = DefaultHeader.empty())

Properties

Link copied to clipboard
open override val aggregateId: AggregateId

the identifier of the aggregate to initialize

Link copied to clipboard
open override val aggregateName: String
Link copied to clipboard
open override val aggregateVersion: Int? = null

The aggregate version (null for initialization commands).

Link copied to clipboard
open override val allowCreate: Boolean

allows aggregate creation if it doesn't exist

Link copied to clipboard
open override val body: GivenInitialization

The command body, which is the GivenInitialization marker object.

Link copied to clipboard
open override val commandId: String
Link copied to clipboard
open override val contextName: String
Link copied to clipboard
open override val createTime: Long

The timestamp when this command was created.

Link copied to clipboard
open override val header: Header

command header with default empty header

Link copied to clipboard
open override val id: String

unique identifier for this command (auto-generated)

Link copied to clipboard
open override val isCreate: Boolean

indicates this is a creation command

Link copied to clipboard
Link copied to clipboard
open override val isVoid: Boolean

indicates if this command produces no events

Link copied to clipboard
open override val name: String

The name of this command class.

Link copied to clipboard
open override val ownerId: String

the owner of the aggregate (defaults to system owner)

Link copied to clipboard
open override val requestId: String

unique identifier for the request (auto-generated)

Functions

Link copied to clipboard

Creates a copy of this command with a new header.

Link copied to clipboard
open override fun isSameAggregateName(other: NamedAggregate): Boolean
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard