# Generated by Django 5.1.6 on 2025-03-18 17:40

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


class Migration(migrations.Migration):
    initial = True

    dependencies = [
        ('socialaccount', '0006_alter_socialaccount_extra_data'),
        migrations.swappable_dependency(settings.AUTH_USER_MODEL),
    ]

    operations = [
        migrations.CreateModel(
            name='IdentityProviderUserLog',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('created_at', models.DateTimeField(auto_now_add=True)),
                ('logs', models.TextField(blank=True, null=True)),
                ('identity_provider', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='saml_logs', to='socialaccount.socialapp')),
                ('user', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='saml_logs', to=settings.AUTH_USER_MODEL)),
            ],
            options={
                'verbose_name': 'Identity Provider User Log',
                'verbose_name_plural': 'Identity Provider User Logs',
                'ordering': ['-created_at'],
            },
        ),
        migrations.CreateModel(
            name='IdentityProviderCategoryMapping',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(help_text='Identity Provider group attribute value', max_length=100, verbose_name='Group Attribute Value')),
                ('map_to', models.CharField(help_text='Category id', max_length=300)),
                ('identity_provider', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='category_mapping', to='socialaccount.socialapp')),
            ],
            options={
                'verbose_name': 'Identity Provider Category Mapping',
                'verbose_name_plural': 'Identity Provider Category Mappings',
                'unique_together': {('identity_provider', 'name')},
            },
        ),
        migrations.CreateModel(
            name='IdentityProviderGlobalRole',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(help_text='Identity Provider role attribute value', max_length=100, verbose_name='Global Role Mapping')),
                (
                    'map_to',
                    models.CharField(
                        choices=[
                            ('user', 'Authenticated User'),
                            ('advancedUser', 'Advanced User'),
                            ('editor', 'MediaCMS Editor'),
                            ('manager', 'MediaCMS Manager'),
                            ('admin', 'MediaCMS Administrator'),
                        ],
                        help_text='MediaCMS Global Role',
                        max_length=20,
                    ),
                ),
                ('identity_provider', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='global_roles', to='socialaccount.socialapp')),
            ],
            options={
                'verbose_name': 'Identity Provider Global Role Mapping',
                'verbose_name_plural': 'Identity Provider Global Role Mappings',
                'unique_together': {('identity_provider', 'name')},
            },
        ),
        migrations.CreateModel(
            name='IdentityProviderGroupRole',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(help_text='Identity Provider role attribute value', max_length=100, verbose_name='Group Role Mapping')),
                ('map_to', models.CharField(choices=[('member', 'Member'), ('contributor', 'Contributor'), ('manager', 'Manager')], help_text='MediaCMS Group Role', max_length=20)),
                ('identity_provider', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='group_roles', to='socialaccount.socialapp')),
            ],
            options={
                'verbose_name': 'Identity Provider Group Role Mapping',
                'verbose_name_plural': 'Identity Provider Group Role Mappings',
                'unique_together': {('identity_provider', 'name')},
            },
        ),
    ]
