You omitted what might be the most important of your classes :
Stock
. In my opinion, it should be managing itself as much as it possibly can. For example, to display an invoice a Stock object only needs to know how many of itself is in the order. An invoice should be just a collection of stock items with a quantity of each. Inventory is almost identical to an order because it has a collection of stock items along with a quantity of each. That's how I would think about these things.
I am not sure a
std::map
is the right container for this. I guess as long as you have keys that are unique enough it can work for you. I am a fan of type definitions and in the C++ world the
using
statement can accomplish the same thing. In your program you use this data type a lot :
std::map<Stock,double>
so I would define a type for it like this :
using mapStock = std::map<Stock, double>;
I'm not sure a double is the right value to associate a key with. It seems like an integer would be more appropriate to hold a quantity. I guess it depends on the increments the products are sold in. If they can be fractional amounts then a double is the right type.
By the way, if you want a more specific answer then you need to ask a more specific question.