input: Write a python function to calculate the total quantity of items purchased by a customer.
  assert total_quantity(Customer("John", [Purchase("apple", "2023-01-01", 5), Purchase("banana", "2023-01-02", 3)])) == 8
  assert total_quantity(Customer("Jane", [Purchase("milk", "2023-01-01", 2), Purchase("bread", "2023-01-02", 1)])) == 3
  assert total_quantity(Customer("Alice", [Purchase("egg", "2023-01-01", 12), Purchase("cheese", "2023-01-02", 5), Purchase("butter", "2023-01-03", 2)])) == 19
output: def total_quantity(customer):
      return sum(purchase.quantity for purchase in customer.purchases)