Good day, Please help me solve the dilemma. I am trying to write an e-commerce engine relying on DDD.
Problems associated with two aggregates, ProductType, and Product. Product is a classic product like in any other system with the exception that it can have a different set of additional properties. Features and composition of properties determined by ProductType which in turn refers Product i.e. Product have an id of ProductType. The Product can have ProductType or not it means that it can have additional properties or not like size, width, height. Properties may be bool or just string or list of options and they can all be required or not. All this knowledge about the composition of the properties and their validation contains ProductType, Product contains only concrete values for this properties. ProductType is created on a separate page and stored in a separate transaction and also could be assigned to multiple products in the product edit page. The Product may exist separately from ProductType and ProductType, in turn, may exist separately from Product. I.E. behave like two independent aggregates.
and now the question
When I save the Product with assigned ProductType and values according to ProductType properties I need to validate all of these values according to the rules in ProductType. How to ensure transactional consistency (in terms of DDD) saving Product knowing that ProductType could be changed by separate users in separate transactions ?