order so now in the main file instead of passing these three values directly as arguments to the addline item method we create a line item and then add that instead the third code smell also has to do with the order class you see that even though we changed these three lists to now have a single list of line items order still has lots and lots of instance variables and when a class contains too many of these instance variables this is often a sign that it has simply too many responsibilities in this case there are actually too many responsibilities because not only is the order responsible for keeping track of the items that are in it and the status of the order but also for all of the details about the customer so it has a customer id name address postal code city and email and that doesn't make a lot of sense order should be a bit more focused on only the stuff that's related to the order and the problem is once you start expanding the system and making it more complex perhaps you want to do other things with customers as well and now this is not possible because it's all directly part of the order class so that all points to us having to separate order stuff from customer stuff so in order to do this let's just create a separate customer class so i'm going to add another file here called customer let's also use a data class to represent the customer so i'm going to automatically import that and create a customer class and this is going to have a couple of fields that's going to be an id yeah that was an integer i was not entirely sure if we used an integer or string then we have a name which is a string we have an address we have a postal code so you see tab NUMBER_TOKEN is actually quite helpful here and filling in the details for me so we have city and we have an email address so that's the customer class and then let's first change the order to actually use the customer class instead of all these separate fields here so i'm going to have a customer and that's going to be of type customer so let's delete all these lines here and now order is much shorter it has a customer it maintains items it has a status and it has an id which is really much better in the main file i was going to need to update a couple of things because now i'm passing all this detailed information about the customer directly to the order initializer so instead of this we're going to need to create a separate customer and then attach it to the order so let's remove this like so and then i'm going to create a customer here
NO_SEGMENT_TOKEN