Object Versioning

0
Hello,  I currently process orders and I have prices associated to the location in relation to a part. Right now, when I edit an object for a locations price, it will automatically update all the objects that were used for orders, however I want these already created objects to stay the same, and only future orders to carry the updated price or details.  What is the best way to achieve this, beyond implementing an effective date system.    Thank you. 
asked
1 answers
0

From what I’m understanding, the following is a simplified representation of your domain model: https://ibb.co/nfG2QwX (Apologies if I misunderstood your description)

 

To achieve what you’re looking for you’re going to have to introduce some form of status or way to filter effectively on the Price object. This can be done by your proposition of an Effective Date Date Time boolean but that doesn’t account for the the End of that’s Price’s Effictive Date. 

 

In this case, I would add Active and InActive DateTime fields that effectively act as booleans (Empty = False vs Not Empty =True) but also gives you timestamp insight as to when a Price was both activated and inactivated. Assuming you can only have one Active Price for a Part at a specific location.

When you change the Price of a Part at a specific location, you will need to create a new Price object (with the information copied over) and deactivate the old one by populating the Inactive datetime with the CurrentDateTime token. This is to ensure you have only one active price for that part at the specific location.

Although more development, this accommodates the initial pulling of price by location and making sure you get the right price, allows you to associate that correct price to the part & order, allows the changing of the a Part’s active price without losing history for the Order, and adds visibility into the Price’s time when it was active with the Active=Beginning and Inactive=End

 

answered