feat: encapsulate snapshot

This commit is contained in:
2025-08-11 14:04:38 +02:00
parent 91c3755533
commit 6da78b043d
4 changed files with 118 additions and 103 deletions

View File

@@ -153,7 +153,7 @@ export abstract class AggregateRoot<TEventFactory extends EventFactory> {
}
await this.save();
const reducer = this.#store.aggregate.reducer(this.#self);
await this.#store.createSnapshot({
await this.#store.snapshot.create({
name: this.#self.name,
stream,
reducer,