add party model

This commit is contained in:
behruz-dev
2025-08-21 10:17:59 +05:00
parent 15ef725e91
commit 7e2e62d48c
6 changed files with 104 additions and 2 deletions

View File

@@ -0,0 +1,57 @@
# Generated by Django 5.2.4 on 2025-08-21 10:14
import django.db.models.deletion
import uuid
from django.conf import settings
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('counterparty', '0001_initial'),
('orders', '0008_remove_offer_name_offer_counterparty'),
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
]
operations = [
migrations.AddField(
model_name='order',
name='counterparty',
field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='order', to='counterparty.counterparty'),
),
migrations.AddField(
model_name='order',
name='currency',
field=models.CharField(blank=True, choices=[('uzs', 'uzs'), ('usd', 'usd')], default='uzs', max_length=3, null=True),
),
migrations.AddField(
model_name='order',
name='total_price',
field=models.PositiveBigIntegerField(blank=True, default=0, null=True),
),
migrations.AddField(
model_name='order',
name='unit_amount',
field=models.PositiveBigIntegerField(blank=True, default=0, null=True),
),
migrations.CreateModel(
name='Party',
fields=[
('id', models.UUIDField(default=uuid.uuid4, editable=False, primary_key=True, serialize=False, unique=True)),
('created_at', models.DateTimeField(auto_now_add=True)),
('updated_at', models.DateTimeField(auto_now=True)),
('delivery_date', models.DateField()),
('payment_date', models.DateField()),
('comment', models.TextField(blank=True, null=True)),
('audit', models.CharField(blank=True, choices=[('CHECKED', 'tekshirildi'), ('PROCESS', 'jarayonda')], max_length=20, null=True)),
('audit_comment', models.TextField(blank=True, null=True)),
('mediator', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='parties', to=settings.AUTH_USER_MODEL)),
('orders', models.ManyToManyField(blank=True, null=True, related_name='parties', to='orders.order')),
],
options={
'verbose_name': 'Partiya',
'verbose_name_plural': 'Partiyalar',
},
),
]