Coverage for modules\customs\migrations\0001_initial.py: 100%
8 statements
« prev ^ index » next coverage.py v7.16.0, created at 2026-09-06 16:58 +0800
« prev ^ index » next coverage.py v7.16.0, created at 2026-09-06 16:58 +0800
1# Generated by Django 5.1.15 on 2026-09-05 13:30
3import django.db.models.deletion
4import uuid
5from decimal import Decimal
6from django.db import migrations, models
9class Migration(migrations.Migration):
11 initial = True
13 dependencies = [
14 ]
16 operations = [
17 migrations.CreateModel(
18 name='BrokerLicense',
19 fields=[
20 ('id', models.UUIDField(default=uuid.uuid4, editable=False, primary_key=True, serialize=False)),
21 ('created_at', models.DateTimeField(auto_now_add=True, db_index=True)),
22 ('updated_at', models.DateTimeField(auto_now=True)),
23 ('tenant_id', models.UUIDField(db_index=True, help_text='Organization / Tenant ID')),
24 ('broker_name', models.CharField(max_length=128)),
25 ('license_number', models.CharField(max_length=64, unique=True)),
26 ('issuing_authority', models.CharField(max_length=128)),
27 ('license_type', models.CharField(blank=True, max_length=64, null=True)),
28 ('issue_date', models.DateField()),
29 ('expiry_date', models.DateField()),
30 ('is_active', models.BooleanField(default=True)),
31 ('notes', models.TextField(blank=True, null=True)),
32 ],
33 options={
34 'ordering': ['expiry_date'],
35 },
36 ),
37 migrations.CreateModel(
38 name='CustomsEntry',
39 fields=[
40 ('id', models.UUIDField(default=uuid.uuid4, editable=False, primary_key=True, serialize=False)),
41 ('created_at', models.DateTimeField(auto_now_add=True, db_index=True)),
42 ('updated_at', models.DateTimeField(auto_now=True)),
43 ('tenant_id', models.UUIDField(db_index=True, help_text='Organization / Tenant ID')),
44 ('entry_number', models.CharField(db_index=True, max_length=64, unique=True)),
45 ('entry_type', models.CharField(choices=[('IMPORT', 'Import Declaration'), ('EXPORT', 'Export Declaration'), ('TRANSIT', 'Transit Declaration'), ('TEMPORARY', 'Temporary Admission')], max_length=16)),
46 ('status', models.CharField(choices=[('DRAFT', 'Draft'), ('SUBMITTED', 'Submitted'), ('UNDER_REVIEW', 'Under Review'), ('APPROVED', 'Approved'), ('REJECTED', 'Rejected'), ('CLEARED', 'Cleared')], default='DRAFT', max_length=16)),
47 ('client_name', models.CharField(max_length=255)),
48 ('client_reference', models.CharField(blank=True, max_length=128, null=True)),
49 ('bl_number', models.CharField(blank=True, max_length=64, null=True)),
50 ('container_number', models.CharField(blank=True, max_length=32, null=True)),
51 ('vessel_name', models.CharField(blank=True, max_length=128, null=True)),
52 ('voyage_number', models.CharField(blank=True, max_length=64, null=True)),
53 ('port_of_loading', models.CharField(blank=True, max_length=128, null=True)),
54 ('port_of_discharge', models.CharField(blank=True, max_length=128, null=True)),
55 ('eta', models.DateField(blank=True, null=True)),
56 ('goods_description', models.TextField(blank=True, null=True)),
57 ('hs_code', models.CharField(blank=True, max_length=16, null=True)),
58 ('number_of_packages', models.IntegerField(default=0)),
59 ('gross_weight_kg', models.DecimalField(decimal_places=2, default=Decimal('0.00'), max_digits=12)),
60 ('fob_value', models.DecimalField(decimal_places=2, default=Decimal('0.00'), max_digits=14)),
61 ('freight_cost', models.DecimalField(decimal_places=2, default=Decimal('0.00'), max_digits=14)),
62 ('insurance_cost', models.DecimalField(decimal_places=2, default=Decimal('0.00'), max_digits=14)),
63 ('cif_value', models.DecimalField(decimal_places=2, default=Decimal('0.00'), max_digits=14)),
64 ('duty_amount', models.DecimalField(decimal_places=2, default=Decimal('0.00'), max_digits=14)),
65 ('vat_amount', models.DecimalField(decimal_places=2, default=Decimal('0.00'), max_digits=14)),
66 ('entry_date', models.DateField(blank=True, null=True)),
67 ('clearance_date', models.DateField(blank=True, null=True)),
68 ('due_date', models.DateField(blank=True, null=True)),
69 ('assigned_broker', models.CharField(blank=True, max_length=128, null=True)),
70 ('notes', models.TextField(blank=True, null=True)),
71 ],
72 options={
73 'verbose_name_plural': 'Customs Entries',
74 'ordering': ['-created_at'],
75 },
76 ),
77 migrations.CreateModel(
78 name='DutyRate',
79 fields=[
80 ('id', models.UUIDField(default=uuid.uuid4, editable=False, primary_key=True, serialize=False)),
81 ('created_at', models.DateTimeField(auto_now_add=True, db_index=True)),
82 ('updated_at', models.DateTimeField(auto_now=True)),
83 ('tenant_id', models.UUIDField(db_index=True, help_text='Organization / Tenant ID')),
84 ('hs_code', models.CharField(db_index=True, max_length=16, unique=True)),
85 ('description', models.TextField(blank=True, null=True)),
86 ('duty_rate_percent', models.DecimalField(decimal_places=2, default=Decimal('0.00'), max_digits=5)),
87 ('vat_rate_percent', models.DecimalField(decimal_places=2, default=Decimal('0.00'), max_digits=5)),
88 ('additional_duty_percent', models.DecimalField(decimal_places=2, default=Decimal('0.00'), max_digits=5)),
89 ('country_of_origin', models.CharField(blank=True, max_length=64, null=True)),
90 ('effective_from', models.DateField(blank=True, null=True)),
91 ('effective_to', models.DateField(blank=True, null=True)),
92 ('is_active', models.BooleanField(default=True)),
93 ],
94 options={
95 'ordering': ['hs_code'],
96 },
97 ),
98 migrations.CreateModel(
99 name='ComplianceDocument',
100 fields=[
101 ('id', models.UUIDField(default=uuid.uuid4, editable=False, primary_key=True, serialize=False)),
102 ('created_at', models.DateTimeField(auto_now_add=True, db_index=True)),
103 ('updated_at', models.DateTimeField(auto_now=True)),
104 ('tenant_id', models.UUIDField(db_index=True, help_text='Organization / Tenant ID')),
105 ('document_type', models.CharField(choices=[('CERTIFICATE', 'Certificate of Origin'), ('INVOICE', 'Commercial Invoice'), ('PACKING_LIST', 'Packing List'), ('BILL_OF_LADING', 'Bill of Lading'), ('DANGEROUS_GOODS', 'Dangerous Goods Declaration'), ('PHYTOSANITARY', 'Phytosanitary Certificate'), ('FUMIGATION', 'Fumigation Certificate'), ('OTHER', 'Other')], max_length=24)),
106 ('document_number', models.CharField(blank=True, max_length=64, null=True)),
107 ('issue_date', models.DateField(blank=True, null=True)),
108 ('expiry_date', models.DateField(blank=True, null=True)),
109 ('file_url', models.URLField(blank=True, null=True)),
110 ('notes', models.TextField(blank=True, null=True)),
111 ('entry', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='documents', to='customs.customsentry')),
112 ],
113 options={
114 'ordering': ['-created_at'],
115 },
116 ),
117 ]