feat: reset migrations and created customer address model

This commit is contained in:
2024-12-07 10:10:14 +01:00
parent 1ffa5b117f
commit 48d39f55ba
18 changed files with 863 additions and 908 deletions
+5 -2
View File
@@ -1,6 +1,9 @@
from decimal import Decimal
from shop.models import Customer, Order, OrderLine, Product, ProductBatch
from django.contrib.auth import get_user_model
User = get_user_model()
def create_order_line_for_product(product: Product, quantity: Decimal, order: Order):
@@ -22,7 +25,7 @@ def create_order_line_for_product(product: Product, quantity: Decimal, order: Or
def create_order(
customer: Customer,
customer: User,
billing_address: str,
billing_city: str,
billing_state: str,
@@ -47,7 +50,7 @@ def create_order(
shipping_zip = shipping_zip if shipping_zip else billing_zip
order = Order.objects.create(
customer=customer,
user=customer,
billing_address=billing_address,
billing_city=billing_city,
billing_state=billing_state,