Need sanity check..

Need sanity check..

Old forum URL: forums.lhotka.net/forums/t/1048.aspx


ajj3085 posted on Monday, August 28, 2006

Hi all,

Just want to see if I'm off base with a portion of my design.

I have many products and many price lists.  Users can create a new price list from scratch; they assign a name and save it, and then go and set prices for the products in that list.  Pretty straight foreward.

More commonly the user will select an existing price list.  The exact requirements are this:  user selects existing price list, the user inputs a price multiplier (eg, 1.15 will raise prices by 15%), then the user selects which products should NOT have a price increase in the new price list (that is, the price will be copied as is into the new price list). 

When the user saves this price list, it's expected that the old price list is retired (set inactive) and the new list is generated based off of the prices in the old list and using the price modifier for any product which is not excluded.  Excluded products have their old prices carried forward into the new list.

To this end, I simply have a NewPriceList static method which gathers the expected information and keep its 'hidden.'  The idea is that additional processing will occur on save that will inactive the old list, copy existing prices, and then modify prices for products which should be affected... so this logic would be in DataPortal_Insert.

The public API for the PriceList object isn't changed at all; you still have the same properties exposed as if you created a blank PriceList.  Its only on the one static factory method that these details come into play.

Anyone see anything wrong with this design?

Thanks
Andy

Copyright (c) Marimer LLC