Closed bikerp closed 5 years ago
In short, yes, two aggregates with the same name on different contexts are completely separated, therefore they can ( and probably should ) use the same ID.
As of what is the purpose of context, I suggest you dive into DDD principles to find out.
Thank you for your answer. I know the DDD and I just wanted to be sure if the context in cqrs-domain means the same.
I have defined aggreate user
in file aggregate.js
module.exports = require('cqrs-domain').defineAggregate({
name: 'user',
defaultCommandPayload: 'payload',
defaultEventPayload: 'payload',
});
I have noticed that aggregate name is not mentioned in event store records. Is it itentional?
It definitely is on the aggregate
property.
You are right. I forgot to put aggregate: 'aggregate.name',
into defineEvent
Thanks
Hi, what is the exact purpose of the context? Fo example can I have two aggregates with the same name (e.g. user) but in different contexts (hr and sales). Can these aggregates use the same aggregateId for the same person e.g. email address?