# Generated by Django 5.2.8 on 2025-11-25 02:24

import django.db.models.deletion
from django.db import migrations, models


class Migration(migrations.Migration):

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

    operations = [
        migrations.CreateModel(
            name='FieldCategory',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=100, unique=True)),
                ('description', models.TextField(blank=True)),
                ('icon', models.CharField(blank=True, help_text='Font Awesome icon class', max_length=50)),
                ('created_at', models.DateTimeField(auto_now_add=True)),
                ('updated_at', models.DateTimeField(auto_now=True)),
            ],
            options={
                'verbose_name': 'Field Category',
                'verbose_name_plural': 'Field Categories',
                'ordering': ['name'],
            },
        ),
        migrations.CreateModel(
            name='CustomField',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=100)),
                ('field_type', models.CharField(choices=[('text', 'Text'), ('number', 'Number'), ('email', 'Email'), ('phone', 'Phone'), ('date', 'Date'), ('datetime', 'Date & Time'), ('boolean', 'Yes/No'), ('dropdown', 'Dropdown'), ('textarea', 'Text Area'), ('image', 'Image Upload'), ('file', 'File Upload'), ('currency', 'Currency'), ('percentage', 'Percentage')], max_length=20)),
                ('label', models.CharField(help_text='Display label for the field', max_length=200)),
                ('placeholder', models.CharField(blank=True, help_text='Placeholder text', max_length=200)),
                ('help_text', models.TextField(blank=True, help_text='Help text to display')),
                ('required', models.BooleanField(default=False)),
                ('show_on_receipt', models.BooleanField(default=False)),
                ('show_on_reports', models.BooleanField(default=False)),
                ('show_on_pos', models.BooleanField(default=True)),
                ('default_value', models.TextField(blank=True, help_text='Default value for the field')),
                ('validation_rules', models.JSONField(blank=True, default=dict, help_text='Validation rules as JSON')),
                ('order', models.PositiveIntegerField(default=0, help_text='Order in which field appears')),
                ('dropdown_options', models.JSONField(blank=True, default=list, help_text='Dropdown options as JSON array')),
                ('created_at', models.DateTimeField(auto_now_add=True)),
                ('updated_at', models.DateTimeField(auto_now=True)),
                ('category', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='fields', to='core.fieldcategory')),
            ],
            options={
                'verbose_name': 'Custom Field',
                'verbose_name_plural': 'Custom Fields',
                'ordering': ['category', 'order', 'name'],
            },
        ),
        migrations.CreateModel(
            name='FieldValue',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('content_type', models.CharField(help_text="Model name (e.g., 'Product', 'Customer')", max_length=50)),
                ('object_id', models.PositiveIntegerField(help_text='ID of the related object')),
                ('value', models.TextField(help_text='The actual value stored')),
                ('created_at', models.DateTimeField(auto_now_add=True)),
                ('updated_at', models.DateTimeField(auto_now=True)),
                ('field', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='core.customfield')),
            ],
            options={
                'verbose_name': 'Field Value',
                'verbose_name_plural': 'Field Values',
                'unique_together': {('field', 'content_type', 'object_id')},
            },
        ),
    ]
