feat: added creation endpoints
This commit is contained in:
@@ -1,7 +1,8 @@
|
||||
# Generated by Django 5.0.3 on 2024-03-24 18:23
|
||||
# Generated by Django 5.0.3 on 2024-03-24 22:50
|
||||
|
||||
import django.db.models.deletion
|
||||
import django.utils.timezone
|
||||
import uuid
|
||||
from decimal import Decimal
|
||||
from django.db import migrations, models
|
||||
|
||||
@@ -50,64 +51,6 @@ class Migration(migrations.Migration):
|
||||
"verbose_name_plural": "Clientes",
|
||||
},
|
||||
),
|
||||
migrations.CreateModel(
|
||||
name="OrderLine",
|
||||
fields=[
|
||||
(
|
||||
"id",
|
||||
models.BigAutoField(
|
||||
auto_created=True,
|
||||
primary_key=True,
|
||||
serialize=False,
|
||||
verbose_name="ID",
|
||||
),
|
||||
),
|
||||
(
|
||||
"quantity",
|
||||
models.DecimalField(
|
||||
decimal_places=4,
|
||||
default=Decimal("1"),
|
||||
max_digits=13,
|
||||
verbose_name="Cantidad",
|
||||
),
|
||||
),
|
||||
(
|
||||
"price",
|
||||
models.DecimalField(
|
||||
decimal_places=4, max_digits=13, verbose_name="Precio"
|
||||
),
|
||||
),
|
||||
(
|
||||
"base_total",
|
||||
models.DecimalField(
|
||||
decimal_places=4,
|
||||
default=Decimal("0"),
|
||||
max_digits=13,
|
||||
verbose_name="Total sin impuestos",
|
||||
),
|
||||
),
|
||||
(
|
||||
"tax_value",
|
||||
models.PositiveIntegerField(verbose_name="Valor de impuestos"),
|
||||
),
|
||||
(
|
||||
"taxes",
|
||||
models.DecimalField(
|
||||
decimal_places=4, max_digits=13, verbose_name="Impuestos"
|
||||
),
|
||||
),
|
||||
(
|
||||
"total",
|
||||
models.DecimalField(
|
||||
decimal_places=4, max_digits=13, verbose_name="Total"
|
||||
),
|
||||
),
|
||||
],
|
||||
options={
|
||||
"verbose_name": "Línea de pedido",
|
||||
"verbose_name_plural": "Líneas de pedido",
|
||||
},
|
||||
),
|
||||
migrations.CreateModel(
|
||||
name="Product",
|
||||
fields=[
|
||||
@@ -196,6 +139,7 @@ class Migration(migrations.Migration):
|
||||
verbose_name="ID",
|
||||
),
|
||||
),
|
||||
("uuid", models.UUIDField(default=uuid.uuid4, verbose_name="UUID")),
|
||||
(
|
||||
"creation_date",
|
||||
models.DateTimeField(
|
||||
@@ -288,24 +232,86 @@ class Migration(migrations.Migration):
|
||||
verbose_name="Cliente",
|
||||
),
|
||||
),
|
||||
(
|
||||
"lines",
|
||||
models.ManyToManyField(to="shop.orderline", verbose_name="Líneas"),
|
||||
),
|
||||
],
|
||||
options={
|
||||
"verbose_name": "Pedido",
|
||||
"verbose_name_plural": "Pedidos",
|
||||
},
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name="orderline",
|
||||
name="product",
|
||||
field=models.ForeignKey(
|
||||
on_delete=django.db.models.deletion.CASCADE,
|
||||
to="shop.product",
|
||||
verbose_name="Producto",
|
||||
),
|
||||
migrations.CreateModel(
|
||||
name="OrderLine",
|
||||
fields=[
|
||||
(
|
||||
"id",
|
||||
models.BigAutoField(
|
||||
auto_created=True,
|
||||
primary_key=True,
|
||||
serialize=False,
|
||||
verbose_name="ID",
|
||||
),
|
||||
),
|
||||
(
|
||||
"quantity",
|
||||
models.DecimalField(
|
||||
decimal_places=4,
|
||||
default=Decimal("1"),
|
||||
max_digits=13,
|
||||
verbose_name="Cantidad",
|
||||
),
|
||||
),
|
||||
(
|
||||
"price",
|
||||
models.DecimalField(
|
||||
decimal_places=4, max_digits=13, verbose_name="Precio"
|
||||
),
|
||||
),
|
||||
(
|
||||
"base_total",
|
||||
models.DecimalField(
|
||||
decimal_places=4,
|
||||
default=Decimal("0"),
|
||||
max_digits=13,
|
||||
verbose_name="Total sin impuestos",
|
||||
),
|
||||
),
|
||||
(
|
||||
"tax_value",
|
||||
models.PositiveIntegerField(verbose_name="Valor de impuestos"),
|
||||
),
|
||||
(
|
||||
"taxes",
|
||||
models.DecimalField(
|
||||
decimal_places=4, max_digits=13, verbose_name="Impuestos"
|
||||
),
|
||||
),
|
||||
(
|
||||
"total",
|
||||
models.DecimalField(
|
||||
decimal_places=4, max_digits=13, verbose_name="Total"
|
||||
),
|
||||
),
|
||||
(
|
||||
"order",
|
||||
models.ForeignKey(
|
||||
on_delete=django.db.models.deletion.CASCADE,
|
||||
related_name="lines",
|
||||
to="shop.order",
|
||||
verbose_name="Pedido",
|
||||
),
|
||||
),
|
||||
(
|
||||
"product",
|
||||
models.ForeignKey(
|
||||
on_delete=django.db.models.deletion.CASCADE,
|
||||
to="shop.product",
|
||||
verbose_name="Producto",
|
||||
),
|
||||
),
|
||||
],
|
||||
options={
|
||||
"verbose_name": "Línea de pedido",
|
||||
"verbose_name_plural": "Líneas de pedido",
|
||||
},
|
||||
),
|
||||
migrations.CreateModel(
|
||||
name="ProductPrice",
|
||||
|
||||
Reference in New Issue
Block a user