# Generated by Django 4.2.28 on 2026-02-24 12:22

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


class Migration(migrations.Migration):

    dependencies = [
        ('auth', '0012_alter_user_first_name_max_length'),
        ('accounts', '0002_alter_user_role'),
    ]

    operations = [
        migrations.AddField(
            model_name='user',
            name='failed_login_attempts',
            field=models.PositiveSmallIntegerField(default=0),
        ),
        migrations.AddField(
            model_name='user',
            name='locked_until',
            field=models.DateTimeField(blank=True, null=True),
        ),
        migrations.AddField(
            model_name='user',
            name='must_change_password',
            field=models.BooleanField(default=False),
        ),
        migrations.CreateModel(
            name='GroupCapability',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('capability', models.CharField(choices=[('*', 'All Capabilities'), ('approve', 'Approve'), ('asset.manage', 'Asset Manage'), ('asset.read', 'Asset Read'), ('audit.view', 'Audit View'), ('create', 'Create'), ('delete', 'Delete'), ('export', 'Export'), ('finance.create', 'Finance Create'), ('finance.delete', 'Finance Delete'), ('finance.export', 'Finance Export'), ('finance.read', 'Finance Read'), ('finance.update', 'Finance Update'), ('inventory.export', 'Inventory Export'), ('inventory.item.create', 'Inventory Item Create'), ('inventory.item.update', 'Inventory Item Update'), ('inventory.price.update', 'Inventory Price Update'), ('inventory.purchase.manage', 'Inventory Purchase Manage'), ('inventory.purchase.receive', 'Inventory Purchase Receive'), ('inventory.read', 'Inventory Read'), ('inventory.stock.adjust', 'Inventory Stock Adjust'), ('inventory.stock.approve', 'Inventory Stock Approve'), ('inventory.supplier.manage', 'Inventory Supplier Manage'), ('inventory.transfer.approve', 'Inventory Transfer Approve'), ('inventory.transfer.request', 'Inventory Transfer Request'), ('invoice.create', 'Invoice Create'), ('invoice.delete', 'Invoice Delete'), ('invoice.payment.manage', 'Invoice Payment Manage'), ('invoice.print', 'Invoice Print'), ('invoice.read.all', 'Invoice Read All'), ('invoice.read.own', 'Invoice Read Own'), ('invoice.void', 'Invoice Void'), ('print', 'Print'), ('read', 'Read'), ('reports.export', 'Reports Export'), ('reports.view', 'Reports View'), ('reverse', 'Reverse'), ('sales.create', 'Sales Create'), ('sales.delete', 'Sales Delete'), ('sales.print', 'Sales Print'), ('sales.read.all', 'Sales Read All'), ('sales.read.own', 'Sales Read Own'), ('sales.void', 'Sales Void'), ('settings.manage', 'Settings Manage'), ('update', 'Update'), ('users.manage', 'Users Manage'), ('void', 'Void')], max_length=80)),
                ('created_at', models.DateTimeField(auto_now_add=True)),
                ('group', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='capability_bindings', to='auth.group')),
            ],
            options={
                'ordering': ('group__name', 'capability'),
                'unique_together': {('group', 'capability')},
            },
        ),
    ]
