Hi all.
I'm working on the order-processing section of an e-commerce system and have come accross a small issue in the data-structure and I am hoping someone here can help.
When someone adds items to their basket, a SalesOrder is created, which contains a collection of SalesOrderItems, which hold a reference to their respective Product. This is all fine and well, but what happens once the order is completed and a few months later, the referenced Product(s) are deleted from the system? When the customer or admin go back to look at the order, it won't show properly.
Now, I know what options I have for getting around this; that's not the issue. But, as this (Order Processing) is a common feature of soooo much software, I would like to know what the usual (tried-and-tested, if you will) approach to storing orders is. Do I create an Invoice Class, or do I replicate the important Product data (name, code, price, options, etc) within the Order-Classes?
Any help is greatly appreciated.
Regards.
Stephen.
I'm working on the order-processing section of an e-commerce system and have come accross a small issue in the data-structure and I am hoping someone here can help.
When someone adds items to their basket, a SalesOrder is created, which contains a collection of SalesOrderItems, which hold a reference to their respective Product. This is all fine and well, but what happens once the order is completed and a few months later, the referenced Product(s) are deleted from the system? When the customer or admin go back to look at the order, it won't show properly.
Now, I know what options I have for getting around this; that's not the issue. But, as this (Order Processing) is a common feature of soooo much software, I would like to know what the usual (tried-and-tested, if you will) approach to storing orders is. Do I create an Invoice Class, or do I replicate the important Product data (name, code, price, options, etc) within the Order-Classes?
Any help is greatly appreciated.
Regards.
Stephen.