# Generated by Django 5.2.19 on 2026-11-28 16:08

import django.db.models.deletion
import uuid
from decimal import Decimal
from django.db import migrations, models


class Migration(migrations.Migration):

    initial = True

    dependencies = [
        ('tenancy', '0001_initial'),
    ]

    operations = [
        migrations.CreateModel(
            name='Project',
            fields=[
                ('id', models.UUIDField(default=uuid.uuid4, editable=False, primary_key=True, serialize=False)),
                ('code', models.CharField(max_length=32)),
                ('name', models.CharField(max_length=200)),
                ('client_name', models.CharField(blank=True, max_length=200)),
                ('location', models.CharField(blank=True, max_length=200)),
                ('contract_amount', models.DecimalField(decimal_places=2, default=Decimal('0.00'), max_digits=18)),
                ('budget_amount', models.DecimalField(decimal_places=2, default=Decimal('0.00'), max_digits=18)),
                ('start_date', models.DateField(blank=True, null=True)),
                ('expected_end_date', models.DateField(blank=True, null=True)),
                ('status', models.CharField(choices=[('PLANNED', 'Planned'), ('ACTIVE', 'Active'), ('ON_HOLD', 'On Hold'), ('COMPLETED', 'Completed')], default='ACTIVE', max_length=16)),
                ('company', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='projects', to='tenancy.company')),
            ],
            options={
                'ordering': ['code'],
                'unique_together': {('company', 'code')},
            },
        ),
        migrations.CreateModel(
            name='CostCode',
            fields=[
                ('id', models.UUIDField(default=uuid.uuid4, editable=False, primary_key=True, serialize=False)),
                ('code', models.CharField(max_length=32)),
                ('name', models.CharField(max_length=150)),
                ('category', models.CharField(choices=[('MATERIAL', 'Materials'), ('LABOR', 'Labor'), ('EQUIPMENT', 'Equipment'), ('SUBCONTRACT', 'Subcontract'), ('TRANSPORT', 'Transport'), ('OVERHEAD', 'Overheads')], max_length=16)),
                ('is_active', models.BooleanField(default=True)),
                ('company', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='cost_codes', to='tenancy.company')),
            ],
            options={
                'ordering': ['code'],
                'unique_together': {('company', 'code')},
            },
        ),
        migrations.CreateModel(
            name='Site',
            fields=[
                ('id', models.UUIDField(default=uuid.uuid4, editable=False, primary_key=True, serialize=False)),
                ('code', models.CharField(max_length=32)),
                ('name', models.CharField(max_length=150)),
                ('location', models.CharField(blank=True, max_length=200)),
                ('is_active', models.BooleanField(default=True)),
                ('project', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='sites', to='projects.project')),
            ],
            options={
                'ordering': ['code'],
                'unique_together': {('project', 'code')},
            },
        ),
    ]
