Create new DDD aggregates in SmartLab domain services using existing Clean Architecture patterns. Use when adding a new aggregate root and related domain behavior; default to event sourcing (domain events + IEventStoreRepository) unless the user explicitly requests a non-event-sourced aggregate.
Create aggregates by matching the target service's existing style instead of introducing a new one.
Inspect a representative aggregate in the target service before writing code.
AggregateRoot/AggregateRoot<TId> with When(object @event).Enqueue(@event), then Apply(@event).DomainEvent<TId>Create(...)IEventStoreRepository<TAggregate, TId>.When(object @event) replay.I{AggregatePlural}Repository.Follow this unless the user explicitly requests otherwise.
New or Create) to raise creation event.Apply(...) methods and When(object @event) switch.Version in non-creation Apply(...) methods where existing service does so.doses: event files next to aggregate file.speedy-glove-manager: DomainEvents/ subfolder.DateTimeOffset.UtcNow in event factory unless target service uses another established pattern.IEventStoreRepository<NewAggregate, TId> in InfrastructureServiceCollectionExtension.IEventStoreRepository<NewAggregate, TId>.For concrete event-sourced checklist and snippet shape, read references/event-sourced.md.
Use only when user explicitly asks for non-event-sourced aggregate.
For concrete non-event-sourced checklist, read references/non-event-sourced.md.
this. qualification, explicit types where required, and established namespace/folder layout.