#!/usr/bin/env python

from structures import *

if __name__ == '__main__':

    database = Database()

    customer = Customer()
    customer.setName("Michael Keller")
    customer.setAccountBalance(Amount(29, 99))
    customer.setId(20022)
    customer.setFiducialNum(4)
    customer.addAllergy("Peanuts")
    database.addCustomer(customer)
    
    customer = Customer()
    customer.addAllergy("Milk")
    customer.addAllergy("Soy")
    customer.setName("Winfried Schuffert")
    customer.setAccountBalance(Amount(99, 99))
    customer.setId(11)
    customer.setFiducialNum(11)
    database.addCustomer(customer)
    
    customer = Customer()
    customer.addAllergy("Peanuts")
    customer.addAllergy("Gluten")
    customer.setName("Seth Vanderwilt")
    customer.setAccountBalance(Amount(6, 0))
    customer.setId(23984)
    customer.setFiducialNum(5)
    database.addCustomer(customer)

    
    item = Item()
    item.setName("Oreos")
    item.setAmount(Amount(2, 99))
    item.setFiducialNum(7)
    item.setWeight(Weight(15.5))
    item.setDescription("Black and white cookies!")
    item.setImagePath("../img/oreos.jpg")
    item.addContains("milk")
    item.addContains("gluten")
    item.setLocation((1.125, 1.675))
    database.addItem(item)
    
    item = Item()
    item.setName("Trader Joe's Organic Peppermints")
    item.setAmount(Amount(1, 99))
    item.setFiducialNum(8)
    item.setWeight(Weight(1.41))
    item.setDescription("USDA organic")
    item.setImagePath("../img/peppermints.jpg")
    item.setLocation((1.761, 0.031))
    database.addItem(item)
    
    item = Item()
    item.setName("Peanuts (Salted)")
    item.setAmount(Amount(2, 79))
    item.setFiducialNum(9)
    item.setWeight(Weight(3.2))
    item.setDescription("7 vitamins and minerals")
    item.setImagePath("../img/peanuts.jpg")
    item.addContains("peanuts")
    item.setLocation((1.163, 0.0))
    database.addItem(item)
        
    item = Item()
    item.setName("Toblerone")
    item.setAmount(Amount(2, 49))
    item.setFiducialNum(6)
    item.setWeight(Weight(12.00))
    item.setDescription("Swiss Milk Chocolate with Honey and Almonds")
    item.setImagePath("../img/toblerone.jpg")
    item.addContains("milk")
    item.addContains("soy")
    item.addContains("peanuts")
    item.setLocation((1.163, 0.0))
    database.addItem(item)
    
    item = Item()
    item.setName("Kettle Popcorn")
    item.setAmount(Amount(2, 49))
    item.setFiducialNum(2)
    item.setWeight(Weight(3.2))
    item.setDescription("Lightly Salted.")
    item.setImagePath("../img/popcorn.jpg")
    item.setLocation((1.761, 0.031))
    database.addItem(item)
    
    item = Item()
    item.setName("Skittles")
    item.setAmount(Amount(1, 89))
    item.setFiducialNum(3)
    item.setWeight(Weight(2.5))
    item.setDescription("The Original.")
    item.setImagePath("../img/skittles.jpg")
    item.setLocation((2.656, 0.822))
    database.addItem(item)
    
    item = Item()
    item.setName("Arrowhead 100% Mountain Spring Water")
    item.setAmount(Amount(1, 89))
    item.setFiducialNum(2394948)
    item.setWeight(Weight(2.5))
    item.setDescription("Pure Quality.")
    item.setImagePath("../img/skittles.jpg")
    database.addItem(item)
    
    
    item = Item()
    item.setName("Kellogg's Apple Jacks")
    item.setAmount(Amount(1, 89))
    item.setFiducialNum(1)
    item.setWeight(Weight(2.5))
    item.setDescription("Made with Whole Grain")
    item.setImagePath("../img/kelloggs.jpg")
    item.addContains("peanuts")
    item.setLocation((1.842, 1.676))
    database.addItem(item)
    
    item = Item()
    item.setName("Lindt Milk Chocolate")
    item.setAmount(Amount(3, 99))
    item.setFiducialNum(15)
    item.setWeight(Weight(4.4))
    item.setDescription("Creamy, Smooth Milk Chocolate")
    item.setImagePath("../img/lindt.jpg")
    item.addContains("peanuts")
    item.addContains("milk")
    item.setLocation((0.364, 0.802))
    database.addItem(item)
    
    
    database.toFile("database.xml")
