# Generated by Django 5.1.12 on 2025-09-24 07:14

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


class Migration(migrations.Migration):

    initial = True

    dependencies = [
        ("authentik_core", "0050_user_last_updated_and_more"),
        ("authentik_flows", "0028_flowtoken_revoke_on_execution"),
    ]

    operations = [
        migrations.CreateModel(
            name="GroupTelegramSourceConnection",
            fields=[
                (
                    "groupsourceconnection_ptr",
                    models.OneToOneField(
                        auto_created=True,
                        on_delete=django.db.models.deletion.CASCADE,
                        parent_link=True,
                        primary_key=True,
                        serialize=False,
                        to="authentik_core.groupsourceconnection",
                    ),
                ),
            ],
            options={
                "verbose_name": "Group Telegram Source Connection",
                "verbose_name_plural": "Group Telegram Source Connections",
            },
            bases=("authentik_core.groupsourceconnection",),
        ),
        migrations.CreateModel(
            name="TelegramSourcePropertyMapping",
            fields=[
                (
                    "propertymapping_ptr",
                    models.OneToOneField(
                        auto_created=True,
                        on_delete=django.db.models.deletion.CASCADE,
                        parent_link=True,
                        primary_key=True,
                        serialize=False,
                        to="authentik_core.propertymapping",
                    ),
                ),
            ],
            options={
                "verbose_name": "Telegram Source Property Mapping",
                "verbose_name_plural": "Telegram Source Property Mappings",
            },
            bases=("authentik_core.propertymapping",),
        ),
        migrations.CreateModel(
            name="UserTelegramSourceConnection",
            fields=[
                (
                    "usersourceconnection_ptr",
                    models.OneToOneField(
                        auto_created=True,
                        on_delete=django.db.models.deletion.CASCADE,
                        parent_link=True,
                        primary_key=True,
                        serialize=False,
                        to="authentik_core.usersourceconnection",
                    ),
                ),
            ],
            options={
                "verbose_name": "User Telegram Source Connection",
                "verbose_name_plural": "User Telegram Source Connections",
            },
            bases=("authentik_core.usersourceconnection",),
        ),
        migrations.CreateModel(
            name="TelegramSource",
            fields=[
                (
                    "source_ptr",
                    models.OneToOneField(
                        auto_created=True,
                        on_delete=django.db.models.deletion.CASCADE,
                        parent_link=True,
                        primary_key=True,
                        serialize=False,
                        to="authentik_core.source",
                    ),
                ),
                ("bot_username", models.TextField(help_text="Telegram bot username")),
                ("bot_token", models.TextField(help_text="Telegram bot token")),
                (
                    "request_message_access",
                    models.BooleanField(
                        default=False, help_text="Request access to send messages from your bot."
                    ),
                ),
                (
                    "pre_authentication_flow",
                    models.ForeignKey(
                        help_text="Flow used before authentication.",
                        on_delete=django.db.models.deletion.CASCADE,
                        related_name="telegram_source_pre_authentication",
                        to="authentik_flows.flow",
                    ),
                ),
            ],
            options={
                "verbose_name": "Telegram Source",
                "verbose_name_plural": "Telegram Sources",
            },
            bases=("authentik_core.source",),
        ),
    ]
