account, schduels, timezone profile and many imporant updates

This commit is contained in:
IGNY8 VPS (Salman)
2026-01-19 15:37:03 +00:00
parent 618ed8b8c6
commit e7219a2390
28 changed files with 919 additions and 358 deletions

View File

@@ -106,6 +106,16 @@ class Account(SoftDeletableModel):
billing_postal_code = models.CharField(max_length=20, blank=True)
billing_country = models.CharField(max_length=2, blank=True, help_text="ISO 2-letter country code")
tax_id = models.CharField(max_length=100, blank=True, help_text="VAT/Tax ID number")
# Account timezone (single source of truth for all users/sites)
account_timezone = models.CharField(max_length=64, default='UTC', help_text="IANA timezone name")
timezone_mode = models.CharField(
max_length=20,
choices=[('country', 'Country'), ('manual', 'Manual')],
default='country',
help_text="Timezone selection mode"
)
timezone_offset = models.CharField(max_length=10, blank=True, default='', help_text="Optional UTC offset label")
# Monthly usage tracking (reset on billing cycle)
usage_ahrefs_queries = models.IntegerField(default=0, validators=[MinValueValidator(0)], help_text="Ahrefs queries used this month")
@@ -922,6 +932,7 @@ class User(AbstractUser):
account = models.ForeignKey('igny8_core_auth.Account', on_delete=models.CASCADE, related_name='users', null=True, blank=True, db_column='tenant_id')
role = models.CharField(max_length=20, choices=ROLE_CHOICES, default='viewer')
email = models.EmailField(_('email address'), unique=True)
phone = models.CharField(max_length=30, blank=True, default='')
created_at = models.DateTimeField(auto_now_add=True)
updated_at = models.DateTimeField(auto_now=True)