ФУНКЦИИ - МЕЖПРОЕКТНАЯ КОММУНИКАЦИЯ: суточные квоты Voice Tasker по workspace и контурам

This commit is contained in:
DCCONSTRUCTIONS
2026-04-28 14:39:39 +03:00
parent a0c0db27f3
commit a0213db2fc
7 changed files with 309 additions and 64 deletions
@@ -52,6 +52,9 @@ class WorkspaceAISettings(BaseModel):
max_audio_duration_seconds = models.PositiveIntegerField(default=120)
per_user_hourly_limit = models.PositiveIntegerField(default=30)
workspace_hourly_limit = models.PositiveIntegerField(default=300)
per_user_daily_limit = models.PositiveIntegerField(default=100)
workspace_daily_limit = models.PositiveIntegerField(default=1000)
project_daily_limit = models.PositiveIntegerField(default=300)
class Meta:
verbose_name = "Workspace AI Settings"
@@ -106,6 +109,13 @@ class VoiceTaskSession(BaseModel):
on_delete=models.CASCADE,
related_name="voice_task_sessions",
)
project = models.ForeignKey(
"db.Project",
on_delete=models.SET_NULL,
null=True,
blank=True,
related_name="voice_task_sessions",
)
status = models.CharField(max_length=32, choices=Status.choices, default=Status.UPLOADED)
audio_duration_seconds = models.FloatField(null=True, blank=True)
audio_content_type = models.CharField(max_length=100, blank=True)
@@ -138,6 +148,7 @@ class VoiceTaskSession(BaseModel):
ordering = ("-created_at",)
indexes = [
models.Index(fields=["workspace", "user", "-created_at"], name="voice_task_session_user_idx"),
models.Index(fields=["workspace", "project", "-created_at"], name="voice_task_session_project_idx"),
models.Index(fields=["workspace", "status", "-created_at"], name="voice_task_session_status_idx"),
]