# Generated by Django 5.2.7 on 2025-11-11 12:02

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


class Migration(migrations.Migration):

    dependencies = [
        ('notcloudapp', '0002_transferorder_fileselection'),
        migrations.swappable_dependency(settings.AUTH_USER_MODEL),
    ]

    operations = [
        migrations.AlterModelOptions(
            name='fileselection',
            options={'ordering': ['-selected_at'], 'verbose_name': 'File Selection', 'verbose_name_plural': 'File Selections'},
        ),
        migrations.AlterModelOptions(
            name='transferorder',
            options={'ordering': ['-created_at'], 'verbose_name': 'Transfer Order', 'verbose_name_plural': 'Transfer Orders'},
        ),
        migrations.AddField(
            model_name='fileselection',
            name='download_error',
            field=models.TextField(blank=True, help_text='Error message if download failed', null=True),
        ),
        migrations.AddField(
            model_name='fileselection',
            name='download_status',
            field=models.CharField(choices=[('pending', 'Pending'), ('downloading', 'Downloading'), ('downloaded', 'Downloaded'), ('failed', 'Failed'), ('skipped', 'Skipped')], default='pending', max_length=20),
        ),
        migrations.AddField(
            model_name='fileselection',
            name='downloaded_at',
            field=models.DateTimeField(blank=True, help_text='When the file was successfully downloaded', null=True),
        ),
        migrations.AddField(
            model_name='fileselection',
            name='file_size_gb',
            field=models.DecimalField(decimal_places=6, default=0.0, help_text='Size in GB (calculated field)', max_digits=10),
        ),
        migrations.AddField(
            model_name='transferorder',
            name='access_token',
            field=models.TextField(blank=True, help_text='OAuth access token for cloud provider', null=True),
        ),
        migrations.AddField(
            model_name='transferorder',
            name='download_log',
            field=models.JSONField(blank=True, help_text='Detailed download log with file statuses', null=True),
        ),
        migrations.AddField(
            model_name='transferorder',
            name='download_status',
            field=models.CharField(blank=True, help_text='Current download status message', max_length=255, null=True),
        ),
        migrations.AddField(
            model_name='transferorder',
            name='estimated_completion',
            field=models.DateTimeField(blank=True, help_text='Estimated completion time for the order', null=True),
        ),
        migrations.AddField(
            model_name='transferorder',
            name='order_number',
            field=models.CharField(blank=True, editable=False, help_text='Public order number for customer reference', max_length=20, unique=True),
        ),
        migrations.AddField(
            model_name='transferorder',
            name='payment_amount',
            field=models.DecimalField(decimal_places=2, default=0.0, help_text='Amount paid for the order', max_digits=10),
        ),
        migrations.AddField(
            model_name='transferorder',
            name='payment_currency',
            field=models.CharField(default='KES', help_text='Currency code (KES, USD, etc.)', max_length=3),
        ),
        migrations.AddField(
            model_name='transferorder',
            name='selected_files',
            field=models.JSONField(default=list, help_text='List of selected files with metadata'),
        ),
        migrations.AlterField(
            model_name='fileselection',
            name='file_id',
            field=models.CharField(help_text="Cloud provider's file ID", max_length=255),
        ),
        migrations.AlterField(
            model_name='fileselection',
            name='file_path',
            field=models.TextField(blank=True, help_text='Full path of the file in cloud storage', null=True),
        ),
        migrations.AlterField(
            model_name='fileselection',
            name='file_size',
            field=models.BigIntegerField(default=0, help_text='Size in bytes'),
        ),
        migrations.AlterField(
            model_name='fileselection',
            name='id',
            field=models.UUIDField(default=uuid.uuid4, editable=False, primary_key=True, serialize=False, unique=True),
        ),
        migrations.AlterField(
            model_name='fileselection',
            name='order',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='file_selections', to='notcloudapp.transferorder'),
        ),
        migrations.AlterField(
            model_name='profile',
            name='id',
            field=models.UUIDField(default=uuid.uuid4, editable=False, primary_key=True, serialize=False, unique=True),
        ),
        migrations.AlterField(
            model_name='transferorder',
            name='id',
            field=models.UUIDField(default=uuid.uuid4, editable=False, primary_key=True, serialize=False, unique=True),
        ),
        migrations.AlterField(
            model_name='transferorder',
            name='status',
            field=models.CharField(choices=[('cloud_connected', 'Cloud Connected'), ('files_selected', 'Files Selected'), ('storage_selected', 'Storage Selected'), ('payment_completed', 'Payment Completed'), ('payment_pending', 'Payment Pending'), ('download_in_progress', 'Download In Progress'), ('download_completed', 'Download Completed'), ('download_failed', 'Download Failed'), ('download_partial', 'Download Partial'), ('processing', 'Processing Files'), ('shipped', 'Shipped'), ('delivered', 'Delivered'), ('completed', 'Completed'), ('cancelled', 'Cancelled')], default='cloud_connected', max_length=50),
        ),
        migrations.AlterField(
            model_name='transferorder',
            name='total_size',
            field=models.DecimalField(decimal_places=2, default=0.0, help_text='Total size of selected files in GB', max_digits=10),
        ),
        migrations.AlterField(
            model_name='transferorder',
            name='user',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='transfer_orders', to=settings.AUTH_USER_MODEL),
        ),
        migrations.AddIndex(
            model_name='fileselection',
            index=models.Index(fields=['order', 'download_status'], name='notcloudapp_order_i_78e9e3_idx'),
        ),
        migrations.AddIndex(
            model_name='fileselection',
            index=models.Index(fields=['cloud_source', 'selected_at'], name='notcloudapp_cloud_s_945bca_idx'),
        ),
        migrations.AddIndex(
            model_name='fileselection',
            index=models.Index(fields=['download_status'], name='notcloudapp_downloa_32a17b_idx'),
        ),
        migrations.AddIndex(
            model_name='profile',
            index=models.Index(fields=['email'], name='notcloudapp_email_657295_idx'),
        ),
        migrations.AddIndex(
            model_name='profile',
            index=models.Index(fields=['created_at'], name='notcloudapp_created_595660_idx'),
        ),
        migrations.AddIndex(
            model_name='profile',
            index=models.Index(fields=['user', 'created_at'], name='notcloudapp_user_id_3a336d_idx'),
        ),
        migrations.AddIndex(
            model_name='transferorder',
            index=models.Index(fields=['user', 'status'], name='notcloudapp_user_id_0c899f_idx'),
        ),
        migrations.AddIndex(
            model_name='transferorder',
            index=models.Index(fields=['status', 'created_at'], name='notcloudapp_status_20a1bf_idx'),
        ),
        migrations.AddIndex(
            model_name='transferorder',
            index=models.Index(fields=['order_number'], name='notcloudapp_order_n_0f3f3c_idx'),
        ),
        migrations.AddIndex(
            model_name='transferorder',
            index=models.Index(fields=['created_at'], name='notcloudapp_created_818254_idx'),
        ),
        migrations.AddIndex(
            model_name='transferorder',
            index=models.Index(fields=['user', 'created_at'], name='notcloudapp_user_id_897bb7_idx'),
        ),
    ]
