dimanche 1 mars 2015

How to handle inmutable data on Databases


I'm working on a quotation software. It basically creates quotations for customers based on certains ProductModel that contains n Plan that contains n PriceRange


Normally, a Quotation would have n ProductModel, so that each Plan that groups PriceRanges can be access. The problem is once a Quotation is made, it is immutable, which means, if a PriceRange property changes, it must not change for already made quotations.


So far we implemented a different table QuotationDataParam that would practically copy every attribute on ProductModel,Plan,PriceRange. But this didn't help cause it cannot be browsed as a tree.


The only other option I see right now is to create a copy table (ProductModelImmutable,PlanImmutable,PriceRangeImmutable) and link the quotation to ProductModelImmutable so that ProductModel can be altered for future quotations.


I hope I did explain what issue I am having, if it isn't clear let me know so I can provide more or explain better.





Aucun commentaire:

Enregistrer un commentaire