# Generated by Django 5.2.12 on 2026-04-01 21:43

import django.db.models.deletion
from django.db import migrations, models


class Migration(migrations.Migration):

    initial = True

    dependencies = [
    ]

    operations = [
        migrations.CreateModel(
            name='Company',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=200)),
                ('slug', models.SlugField(help_text='URL identifier e.g. acme-pos', max_length=100, unique=True)),
                ('email', models.EmailField(blank=True, max_length=254)),
                ('phone', models.CharField(blank=True, max_length=20)),
                ('address', models.TextField(blank=True)),
                ('logo', models.ImageField(blank=True, null=True, upload_to='company_logos/')),
                ('is_active', models.BooleanField(default=True, help_text='Inactive = suspended access')),
                ('activation_code', models.CharField(blank=True, max_length=100)),
                ('expiry_date', models.DateField(blank=True, help_text='Subscription expiry. Null = never expires.', null=True)),
                ('created_at', models.DateTimeField(auto_now_add=True)),
                ('updated_at', models.DateTimeField(auto_now=True)),
            ],
            options={
                'verbose_name': 'Company',
                'verbose_name_plural': 'Companies',
                'ordering': ['name'],
            },
        ),
        migrations.CreateModel(
            name='Plan',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=100, unique=True)),
                ('price_monthly', models.DecimalField(decimal_places=2, default=0, max_digits=10)),
                ('max_orders_per_day', models.PositiveIntegerField(default=0, help_text='0 = unlimited')),
                ('max_products', models.PositiveIntegerField(default=0, help_text='0 = unlimited')),
                ('max_customers', models.PositiveIntegerField(default=0, help_text='0 = unlimited')),
                ('max_categories', models.PositiveIntegerField(default=0, help_text='0 = unlimited')),
                ('max_staff', models.PositiveIntegerField(default=0, help_text='0 = unlimited')),
                ('max_branches', models.PositiveIntegerField(default=1, help_text='Max branches allowed')),
                ('feature_pos_terminal_v1', models.BooleanField(default=True)),
                ('feature_pos_terminal_v2_grid', models.BooleanField(default=False)),
                ('feature_barcode_pos', models.BooleanField(default=False)),
                ('feature_bulk_import', models.BooleanField(default=False)),
                ('feature_export', models.BooleanField(default=True)),
                ('feature_profit_loss', models.BooleanField(default=False)),
                ('feature_audit_logs', models.BooleanField(default=False)),
                ('feature_suspicious_activity', models.BooleanField(default=False)),
                ('feature_multi_branch', models.BooleanField(default=False)),
                ('feature_wholesale_price', models.BooleanField(default=False)),
                ('feature_discount', models.BooleanField(default=True)),
                ('feature_promo', models.BooleanField(default=False)),
                ('feature_android_app', models.BooleanField(default=False)),
                ('feature_credit_sales', models.BooleanField(default=True)),
                ('feature_advanced_reports', models.BooleanField(default=False)),
                ('is_active', models.BooleanField(default=True)),
                ('created_at', models.DateTimeField(auto_now_add=True)),
                ('updated_at', models.DateTimeField(auto_now=True)),
            ],
            options={
                'verbose_name': 'Plan',
                'verbose_name_plural': 'Plans',
                'ordering': ['price_monthly'],
            },
        ),
        migrations.CreateModel(
            name='CompanySettings',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('business_name', models.CharField(default='My Business', max_length=200)),
                ('business_address', models.TextField(blank=True)),
                ('business_phone', models.CharField(blank=True, max_length=20)),
                ('business_email', models.EmailField(blank=True, max_length=254)),
                ('logo', models.ImageField(blank=True, null=True, upload_to='company_logos/')),
                ('currency', models.CharField(choices=[('NGN', 'Naira (₦)'), ('USD', 'Dollar ($)'), ('EUR', 'Euro (€)'), ('GBP', 'Pound (£)')], default='NGN', max_length=3)),
                ('currency_symbol', models.CharField(default='₦', max_length=5)),
                ('decimal_places', models.PositiveSmallIntegerField(default=2)),
                ('use_comma_separator', models.BooleanField(default=True)),
                ('vat_rate', models.DecimalField(decimal_places=2, default=0.0, max_digits=5)),
                ('pos_interface_mode', models.CharField(choices=[('classic', 'Classic POS (V1)'), ('grid', 'Smart Grid POS (V2)')], default='classic', max_length=10)),
                ('enable_camera_scanner', models.BooleanField(default=False)),
                ('receipt_header', models.TextField(blank=True)),
                ('receipt_footer', models.TextField(blank=True)),
                ('show_receipt_logo', models.BooleanField(default=True)),
                ('primary_color', models.CharField(default='#667eea', max_length=7)),
                ('secondary_color', models.CharField(default='#764ba2', max_length=7)),
                ('accent_color', models.CharField(default='#f093fb', max_length=7)),
                ('show_inventory', models.BooleanField(default=True)),
                ('show_receipts', models.BooleanField(default=True)),
                ('show_analytics', models.BooleanField(default=True)),
                ('show_reports', models.BooleanField(default=True)),
                ('enable_sms', models.BooleanField(default=False)),
                ('enable_email', models.BooleanField(default=False)),
                ('created_at', models.DateTimeField(auto_now_add=True)),
                ('updated_at', models.DateTimeField(auto_now=True)),
                ('company', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, related_name='settings', to='companies.company')),
            ],
            options={
                'verbose_name': 'Company Settings',
                'verbose_name_plural': 'Company Settings',
            },
        ),
        migrations.AddField(
            model_name='company',
            name='plan',
            field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.PROTECT, related_name='companies', to='companies.plan'),
        ),
    ]
