# Generated by Django 5.2.7 on 2026-01-23 09:01

import django.db.models.deletion
from django.conf import settings
from django.db import migrations, models


class Migration(migrations.Migration):

    dependencies = [
        ('core', '0001_initial'),
        migrations.swappable_dependency(settings.AUTH_USER_MODEL),
    ]

    operations = [
        migrations.CreateModel(
            name='Shipment',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('description', models.TextField(verbose_name='Goods Description')),
                ('weight', models.CharField(max_length=100, verbose_name='Weight/Volume')),
                ('origin', models.CharField(max_length=255, verbose_name='Origin')),
                ('destination', models.CharField(max_length=255, verbose_name='Destination')),
                ('delivery_date', models.DateField(verbose_name='Requested Delivery Date')),
                ('status', models.CharField(choices=[('OPEN', 'Open for Bids'), ('IN_PROGRESS', 'In Progress'), ('COMPLETED', 'Completed'), ('CANCELLED', 'Cancelled')], default='OPEN', max_length=20)),
                ('created_at', models.DateTimeField(auto_now_add=True)),
                ('shipper', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='shipments', to=settings.AUTH_USER_MODEL)),
            ],
        ),
        migrations.CreateModel(
            name='Message',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('content', models.TextField()),
                ('timestamp', models.DateTimeField(auto_now_add=True)),
                ('sender', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='sent_messages', to=settings.AUTH_USER_MODEL)),
                ('shipment', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='messages', to='core.shipment')),
            ],
        ),
        migrations.CreateModel(
            name='Truck',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('truck_type', models.CharField(max_length=100, verbose_name='Truck Type')),
                ('model', models.CharField(max_length=100, verbose_name='Model')),
                ('year', models.PositiveIntegerField(verbose_name='Year')),
                ('plate_no', models.CharField(max_length=50, verbose_name='Plate No')),
                ('load_capacity', models.CharField(max_length=100, verbose_name='Load Capacity')),
                ('color', models.CharField(max_length=50, verbose_name='Color')),
                ('truck_picture', models.ImageField(blank=True, null=True, upload_to='trucks/', verbose_name='Truck Picture')),
                ('registration_front', models.ImageField(blank=True, null=True, upload_to='docs/', verbose_name='Registration Front')),
                ('registration_back', models.ImageField(blank=True, null=True, upload_to='docs/', verbose_name='Registration Back')),
                ('driver_license', models.ImageField(blank=True, null=True, upload_to='docs/', verbose_name='Driver License')),
                ('created_at', models.DateTimeField(auto_now_add=True)),
                ('owner', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='trucks', to=settings.AUTH_USER_MODEL)),
            ],
        ),
        migrations.AddField(
            model_name='shipment',
            name='assigned_truck',
            field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='assigned_shipments', to='core.truck'),
        ),
        migrations.CreateModel(
            name='Bid',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('amount', models.DecimalField(decimal_places=2, max_digits=10, verbose_name='Offer Amount')),
                ('comments', models.TextField(blank=True, verbose_name='Comments')),
                ('status', models.CharField(choices=[('PENDING', 'Pending'), ('ACCEPTED', 'Accepted'), ('REJECTED', 'Rejected')], default='PENDING', max_length=20)),
                ('created_at', models.DateTimeField(auto_now_add=True)),
                ('truck_owner', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='bids', to=settings.AUTH_USER_MODEL)),
                ('shipment', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='bids', to='core.shipment')),
                ('truck', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='core.truck')),
            ],
        ),
    ]
