ixg_platform/apps/batches/migrations/0001_initial.py

38 lines
1.9 KiB
Python

# Generated by Django 5.2.12 on 2026-07-29 12:02
import django.db.models.deletion
import uuid
from django.conf import settings
from django.db import migrations, models
class Migration(migrations.Migration):
initial = True
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
]
operations = [
migrations.CreateModel(
name='ProcessingBatch',
fields=[
('id', models.UUIDField(default=uuid.uuid4, editable=False, primary_key=True, serialize=False)),
('batch_reference', models.CharField(max_length=50, unique=True)),
('harvest_date', models.DateField(blank=True, null=True)),
('weight_kg', models.DecimalField(blank=True, decimal_places=2, max_digits=10, null=True)),
('grade', models.CharField(blank=True, choices=[('A', 'Grade A'), ('B', 'Grade B'), ('C', 'Grade C')], max_length=5, null=True)),
('status', models.CharField(choices=[('harvested', 'Harvested'), ('processing', 'Processing'), ('qc_pass', 'QC Pass'), ('qc_fail', 'QC Fail'), ('ready_to_ship', 'Ready to Ship'), ('in_transit', 'In Transit'), ('at_uk_port', 'At UK Port'), ('customs', 'Customs'), ('delivered', 'Delivered')], default='harvested', max_length=20)),
('origin_facility', models.CharField(default='ASI - Katsina State, Nigeria', max_length=255)),
('notes', models.TextField(blank=True)),
('created_at', models.DateTimeField(auto_now_add=True)),
('updated_at', models.DateTimeField(auto_now=True)),
('created_by', models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='batches_created', to=settings.AUTH_USER_MODEL)),
],
options={
'db_table': 'processing_batches',
'ordering': ['-created_at'],
},
),
]