facade pattern @staticmethod def fetch_receipts(invoice_id)return receipt(invoicepayment_type@staticmethod def fetch_loyalty_account(customer_id)return loyaltyaccount(customer@staticmethod def add_item(invoiceitem_barcodeamount_purchased)item item fetch(item_barcodeitem amount_in_stock amount_purchased item save(invoice_line invoiceline make(iteminvoice add_line(invoice_line@staticmethod def finalize(invoice)invoice calculate(invoice save(loyalt_account loyaltyaccount fetch(invoice customerloyalty_account calculate(invoiceloyalty_account save(@staticmethod def generate_receipt(invoicepayment_type)receipt receipt(invoicepayment_typereceipt save(using this new sales classwhich serves as facade for the rest of the systemthe ideal function we looked at earlier now looks like thisdef nice_sales_processor(customer_iditem_dict_listpayment_type)invoice sale make_invoice(customer_idfor item_dict in item_dict_listsale add_item(invoiceitem_dict["barcode"]item_dict_list["amount_ purchased"]