Untitled

mail@pastecode.io avatar
unknown
plain_text
a year ago
1.6 kB
1
Indexable
class Customer:
    def __init__(self, name, address):
        self.name = name
        self.address = address

    def get_customer_info(self):
        return f"Name: {self.name}, Address: {self.address}"


class ApparelItem:
    def __init__(self, item_name, item_type, size, color, price):
        self.item_name = item_name
        self.item_type = item_type
        self.size = size
        self.color = color
        self.price = price

    def get_item_info(self):
        return f"Item Name: {self.item_name}, Item Type: {self.item_type}, Size: {self.size}, Color: {self.color}, Price: ${self.price}"


class BusinessApp:
    def __init__(self):
        self.inventory = []
        self.customers = []

    def add_item(self, item_name, item_type, size, color, price):
        new_item = ApparelItem(item_name, item_type, size, color, price)
        self.inventory.append(new_item)

    def add_customer(self, name, address):
        new_customer = Customer(name, address)
        self.customers.append(new_customer)

    def search_item(self, item_name):
        for item in self.inventory:
            if item.item_name == item_name:
                return item.get_item_info()
        return "Item not found."

    def get_customer_info(self, customer_name):
        for customer in self.customers:
            if customer.name == customer_name:
                return customer.get_customer_info()
        return "Customer not found."


# Creating the business app instance
business_app = BusinessApp()

# Adding apparel items
business_app.add_item("T-Shirt", "Shirt", "Large", "Blue", 15)
business_app.add_item("Pants", "Pants", "