from django.db import models
from django.contrib.auth import get_user_model
from dbsynce.models import Orders, Resource, Provider, Service, Client

from webservice_running.docs.database.local import Local as HelpTextsLocal
from webservice_running.docs.verbose_names.local import Local as VerboseNameLocal

from dbsynce.docs.database.template import Template as HelpTexts
from dbsynce.docs.verbose_names.template import Template as VerboseName

class ResourceLocal(models.Model):
    """
    Таблица с дополнительной информацией о ресурсе
    """
    
    resource = models.ForeignKey(
        Resource,
        on_delete=models.DO_NOTHING,
        blank=True,
        null=True,
        verbose_name = VerboseName.resource,
        help_text=HelpTexts.resource,
    )

    local_data = models.CharField(
        null=True,
        verbose_name = VerboseNameLocal.local_data,
        help_text=HelpTextsLocal.local_data,
        max_length=100
        )

class OrdersLocal(models.Model):
    """
    Таблица с дополнительной информацией о ресурсе
    """

    order = models.ForeignKey(
        Orders,
        on_delete=models.DO_NOTHING,
        blank=True,
        null=True,
        verbose_name = VerboseName.order,
        help_text=HelpTexts.order,
    )

    local_data = models.CharField(
        null=True,
        verbose_name = VerboseNameLocal.local_data,
        help_text=HelpTextsLocal.local_data,
        max_length=100
        )

class ProviderLocal(models.Model):
    """
    Таблица с дополнительной информацией о ресурсе
    """

    provider = models.ForeignKey(
        Provider,
        on_delete=models.DO_NOTHING,
        blank=True,
        null=True,
        verbose_name = VerboseName.provider,
        help_text=HelpTexts.provider,
    )   
    
    local_data = models.CharField(
        null=True,
        verbose_name = VerboseNameLocal.local_data,
        help_text=HelpTextsLocal.local_data,
        max_length=100
        )

class SerivceLocal(models.Model):
    """
    Таблица с дополнительной информацией о ресурсе
    """

    service = models.ForeignKey(
        Service,
        on_delete=models.DO_NOTHING,
        blank=True,
        null=True,
        verbose_name = VerboseName.service,
        help_text=HelpTexts.service,
    )

    local_data = models.CharField(
        null=True,
        verbose_name = VerboseNameLocal.local_data,
        help_text=HelpTextsLocal.local_data,
        max_length=100
        )

class ClientLocal(models.Model):
    """
    Таблица с дополнительной информацией о ресурсе
    """

    client = models.ForeignKey(
        Client,
        on_delete=models.DO_NOTHING,
        blank=True,
        null=True,
        verbose_name = VerboseName.client,
        help_text=HelpTexts.client,
    )

    local_data = models.CharField(
        null=True,
        verbose_name = VerboseNameLocal.local_data,
        help_text=HelpTextsLocal.local_data,
        max_length=100
        )


