{
    "models": [
        {
            "classname": "Customer",
            "code": "class Customer(Base):\n    \"\"\"description: Represents customers in the system.\"\"\"\n    __tablename__ = 'customer'\n\n    id = Column(Integer, primary_key=True, autoincrement=True)\n    name = Column(String)\n    email = Column(String)",
            "sqlite_create": "CREATE TABLE customer (\n    id INTEGER PRIMARY KEY AUTOINCREMENT,\n    name TEXT,\n    email TEXT\n);",
            "description": "Table for storing information about customers.",
            "name": "Customer"
        },
        {
            "classname": "Order",
            "code": "class Order(Base):\n    \"\"\"description: Represents orders placed by customers.\"\"\"\n    __tablename__ = 'order'\n\n    id = Column(Integer, primary_key=True, autoincrement=True)\n    customer_id = Column(Integer, ForeignKey('customer.id'))\n    order_date = Column(DateTime)\n    notes = Column(String)",
            "sqlite_create": "CREATE TABLE order (\n    id INTEGER PRIMARY KEY AUTOINCREMENT,\n    customer_id INTEGER,\n    order_date DATETIME,\n    notes TEXT,\n    FOREIGN KEY(customer_id) REFERENCES customer(id)\n);",
            "description": "Table for storing orders made by customers, includes a notes field.",
            "name": "Order"
        },
        {
            "classname": "Product",
            "code": "class Product(Base):\n    \"\"\"description: Represents products available in the system.\"\"\"\n    __tablename__ = 'product'\n\n    id = Column(Integer, primary_key=True, autoincrement=True)\n    name = Column(String)\n    price = Column(Integer)",
            "sqlite_create": "CREATE TABLE product (\n    id INTEGER PRIMARY KEY AUTOINCREMENT,\n    name TEXT,\n    price INTEGER\n);",
            "description": "Table for storing products available for purchase.",
            "name": "Product"
        },
        {
            "classname": "OrderItem",
            "code": "class OrderItem(Base):\n    \"\"\"description: Represents items in an order.\"\"\"\n    __tablename__ = 'order_item'\n\n    id = Column(Integer, primary_key=True, autoincrement=True)\n    order_id = Column(Integer, ForeignKey('order.id'))\n    product_id = Column(Integer, ForeignKey('product.id'))\n    quantity = Column(Integer)",
            "sqlite_create": "CREATE TABLE order_item (\n    id INTEGER PRIMARY KEY AUTOINCREMENT,\n    order_id INTEGER,\n    product_id INTEGER,\n    quantity INTEGER,\n    FOREIGN KEY(order_id) REFERENCES order(id),\n    FOREIGN KEY(product_id) REFERENCES product(id)\n);",
            "description": "Table representing items belonging to an order. It links orders to products.",
            "name": "OrderItem"
        }
    ],
    "rules": [],
    "test_data": "import datetime\n\nfrom models import Customer, Order, Product, OrderItem\n\n# Customers\ncustomer1 = Customer(name='John Doe', email='johndoe@example.com')\ncustomer2 = Customer(name='Jane Smith', email='janesmith@example.com')\ncustomer3 = Customer(name='Michael Brown', email='michaelbrown@example.com')\ncustomer4 = Customer(name='Emily Davis', email='emilydavis@example.com')\n\n# Products\nproduct1 = Product(name='Widget', price=20)\nproduct2 = Product(name='Gadget', price=40)\nproduct3 = Product(name='Doohickey', price=10)\nproduct4 = Product(name='Thingamajig', price=25)\n\n# Orders\norder1 = Order(customer_id=1, order_date=datetime.date(2023, 1, 15), notes='Delivered to reception')\norder2 = Order(customer_id=2, order_date=datetime.date(2023, 2, 20), notes='Urgent delivery')\norder3 = Order(customer_id=3, order_date=datetime.date(2023, 3, 10), notes='New address')\norder4 = Order(customer_id=4, order_date=datetime.date(2023, 4, 5), notes='Include gift wrapping')\n\n# OrderItems\norder_item1 = OrderItem(order_id=1, product_id=1, quantity=2)\norder_item2 = OrderItem(order_id=1, product_id=2, quantity=1)\norder_item3 = OrderItem(order_id=2, product_id=3, quantity=5)\norder_item4 = OrderItem(order_id=2, product_id=1, quantity=1)\n",
    "test_data_rows": [
        {
            "test_data_row_variable": "customer1",
            "code": "customer1 = Customer(name='John Doe', email='johndoe@example.com')"
        },
        {
            "test_data_row_variable": "customer2",
            "code": "customer2 = Customer(name='Jane Smith', email='janesmith@example.com')"
        },
        {
            "test_data_row_variable": "customer3",
            "code": "customer3 = Customer(name='Michael Brown', email='michaelbrown@example.com')"
        },
        {
            "test_data_row_variable": "customer4",
            "code": "customer4 = Customer(name='Emily Davis', email='emilydavis@example.com')"
        },
        {
            "test_data_row_variable": "product1",
            "code": "product1 = Product(name='Widget', price=20)"
        },
        {
            "test_data_row_variable": "product2",
            "code": "product2 = Product(name='Gadget', price=40)"
        },
        {
            "test_data_row_variable": "product3",
            "code": "product3 = Product(name='Doohickey', price=10)"
        },
        {
            "test_data_row_variable": "product4",
            "code": "product4 = Product(name='Thingamajig', price=25)"
        },
        {
            "test_data_row_variable": "order1",
            "code": "order1 = Order(customer_id=1, order_date=datetime.date(2023, 1, 15), notes='Delivered to reception')"
        },
        {
            "test_data_row_variable": "order2",
            "code": "order2 = Order(customer_id=2, order_date=datetime.date(2023, 2, 20), notes='Urgent delivery')"
        },
        {
            "test_data_row_variable": "order3",
            "code": "order3 = Order(customer_id=3, order_date=datetime.date(2023, 3, 10), notes='New address')"
        },
        {
            "test_data_row_variable": "order4",
            "code": "order4 = Order(customer_id=4, order_date=datetime.date(2023, 4, 5), notes='Include gift wrapping')"
        },
        {
            "test_data_row_variable": "order_item1",
            "code": "order_item1 = OrderItem(order_id=1, product_id=1, quantity=2)"
        },
        {
            "test_data_row_variable": "order_item2",
            "code": "order_item2 = OrderItem(order_id=1, product_id=2, quantity=1)"
        },
        {
            "test_data_row_variable": "order_item3",
            "code": "order_item3 = OrderItem(order_id=2, product_id=3, quantity=5)"
        },
        {
            "test_data_row_variable": "order_item4",
            "code": "order_item4 = OrderItem(order_id=2, product_id=1, quantity=1)"
        }
    ],
    "test_data_sqlite": "INSERT INTO customer (id, name, email) VALUES (1, 'John Doe', 'johndoe@example.com');\nINSERT INTO customer (id, name, email) VALUES (2, 'Jane Smith', 'janesmith@example.com');\nINSERT INTO customer (id, name, email) VALUES (3, 'Michael Brown', 'michaelbrown@example.com');\nINSERT INTO customer (id, name, email) VALUES (4, 'Emily Davis', 'emilydavis@example.com');\n\nINSERT INTO product (id, name, price) VALUES (1, 'Widget', 20);\nINSERT INTO product (id, name, price) VALUES (2, 'Gadget', 40);\nINSERT INTO product (id, name, price) VALUES (3, 'Doohickey', 10);\nINSERT INTO product (id, name, price) VALUES (4, 'Thingamajig', 25);\n\nINSERT INTO order (id, customer_id, order_date, notes) VALUES (1, 1, '2023-01-15', 'Delivered to reception');\nINSERT INTO order (id, customer_id, order_date, notes) VALUES (2, 2, '2023-02-20', 'Urgent delivery');\nINSERT INTO order (id, customer_id, order_date, notes) VALUES (3, 3, '2023-03-10', 'New address');\nINSERT INTO order (id, customer_id, order_date, notes) VALUES (4, 4, '2023-04-05', 'Include gift wrapping');\n\nINSERT INTO order_item (id, order_id, product_id, quantity) VALUES (1, 1, 1, 2);\nINSERT INTO order_item (id, order_id, product_id, quantity) VALUES (2, 1, 2, 1);\nINSERT INTO order_item (id, order_id, product_id, quantity) VALUES (3, 2, 3, 5);\nINSERT INTO order_item (id, order_id, product_id, quantity) VALUES (4, 2, 1, 1);",
    "name": "OrderManagementSystem"
}