So I am about to create a new connection between Store
and Products
.
The 'connection' is many to many.
Now, this connection also contains other info such as startDate
and endDate
.
My connection is whether it's better to just create a relationship or if I need to create a middle node.
For example
Version 1
(store)-[:PROMOTES {startDate:...., endDate:...})->(product)
Version 2
(store)-[:PROMOTES)->(promotion:Promotion {startDate:...., endDate:...})<-[:PROMOTED]-(product)
Some info:
- This promotion info will never be fetched 'alone'. You always need store and product too.
- Admin will very often edit it (or ask to edit it) and is an admin of either the product or store i.e. a connection will be checked there. Delete the promotion altogether or edit the dates (which must be validated that there are no conflicts with other promotional dates).
- When fetching a
promotion
via theproduct
, thedates
will be used to fetch otherpromotions
of thatstore
during thedates
found - Active
promotions
i.e. promotions where startDate<today()<endDate will be often fetched
Hope I make sense.
Thanks