I want to create a marketplace. There are Products and Sellers. I want the product to be edited only by the creator. Should I add the validation to the Product entity (and how) if the Seller is in a different aggregate?
I want to create a marketplace. There are Products and Sellers. I want the product to be edited only by the creator. Should I add the validation to the Product entity (and how) if the Seller is in a different aggregate?
If it's part of the domain rules for a product that only edits from the creator are valid, the most straightforward way to do that is to store the ID of the creator (presumably a seller?) as part of the product. The seller on whose behalf an edit is being performed is then a parameter to the request (i.e. command; this is independent of how particularly you're encoding the request (e.g. as a message, as a method, ...)).