update
This commit is contained in:
183
backEnd/support/migrations/0001_initial.py
Normal file
183
backEnd/support/migrations/0001_initial.py
Normal file
@@ -0,0 +1,183 @@
|
||||
# Generated by Django 4.2.7 on 2025-10-07 15:42
|
||||
|
||||
from django.conf import settings
|
||||
from django.db import migrations, models
|
||||
import django.db.models.deletion
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
initial = True
|
||||
|
||||
dependencies = [
|
||||
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.CreateModel(
|
||||
name='SupportSettings',
|
||||
fields=[
|
||||
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
|
||||
('setting_name', models.CharField(max_length=100, unique=True)),
|
||||
('setting_value', models.TextField()),
|
||||
('description', models.TextField(blank=True)),
|
||||
('is_active', models.BooleanField(default=True)),
|
||||
('created_at', models.DateTimeField(auto_now_add=True)),
|
||||
('updated_at', models.DateTimeField(auto_now=True)),
|
||||
],
|
||||
options={
|
||||
'verbose_name_plural': 'Support Settings',
|
||||
},
|
||||
),
|
||||
migrations.CreateModel(
|
||||
name='TicketCategory',
|
||||
fields=[
|
||||
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
|
||||
('name', models.CharField(max_length=100, unique=True)),
|
||||
('description', models.TextField(blank=True)),
|
||||
('color', models.CharField(default='#667eea', help_text='Hex color code', max_length=7)),
|
||||
('icon', models.CharField(default='fa-question-circle', help_text='FontAwesome icon class', max_length=50)),
|
||||
('is_active', models.BooleanField(default=True)),
|
||||
('display_order', models.PositiveIntegerField(default=0)),
|
||||
('created_at', models.DateTimeField(auto_now_add=True)),
|
||||
('updated_at', models.DateTimeField(auto_now=True)),
|
||||
],
|
||||
options={
|
||||
'verbose_name_plural': 'Ticket Categories',
|
||||
'ordering': ['display_order', 'name'],
|
||||
},
|
||||
),
|
||||
migrations.CreateModel(
|
||||
name='TicketPriority',
|
||||
fields=[
|
||||
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
|
||||
('name', models.CharField(max_length=50, unique=True)),
|
||||
('level', models.PositiveIntegerField(help_text='Lower number = higher priority', unique=True)),
|
||||
('color', models.CharField(default='#667eea', help_text='Hex color code', max_length=7)),
|
||||
('description', models.TextField(blank=True)),
|
||||
('sla_hours', models.PositiveIntegerField(default=24, help_text='SLA response time in hours')),
|
||||
('is_active', models.BooleanField(default=True)),
|
||||
('created_at', models.DateTimeField(auto_now_add=True)),
|
||||
],
|
||||
options={
|
||||
'verbose_name_plural': 'Ticket Priorities',
|
||||
'ordering': ['level'],
|
||||
},
|
||||
),
|
||||
migrations.CreateModel(
|
||||
name='TicketStatus',
|
||||
fields=[
|
||||
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
|
||||
('name', models.CharField(max_length=50, unique=True)),
|
||||
('color', models.CharField(default='#667eea', help_text='Hex color code', max_length=7)),
|
||||
('description', models.TextField(blank=True)),
|
||||
('is_closed', models.BooleanField(default=False, help_text='Whether this status represents a closed ticket')),
|
||||
('is_active', models.BooleanField(default=True)),
|
||||
('display_order', models.PositiveIntegerField(default=0)),
|
||||
('created_at', models.DateTimeField(auto_now_add=True)),
|
||||
],
|
||||
options={
|
||||
'verbose_name_plural': 'Ticket Statuses',
|
||||
'ordering': ['display_order', 'name'],
|
||||
},
|
||||
),
|
||||
migrations.CreateModel(
|
||||
name='SupportTicket',
|
||||
fields=[
|
||||
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
|
||||
('ticket_number', models.CharField(editable=False, max_length=20, unique=True)),
|
||||
('title', models.CharField(max_length=200)),
|
||||
('description', models.TextField()),
|
||||
('ticket_type', models.CharField(choices=[('technical', 'Technical Issue'), ('billing', 'Billing Question'), ('feature_request', 'Feature Request'), ('bug_report', 'Bug Report'), ('general', 'General Inquiry'), ('account', 'Account Issue')], default='general', max_length=20)),
|
||||
('user_name', models.CharField(max_length=100)),
|
||||
('user_email', models.EmailField(max_length=254)),
|
||||
('user_phone', models.CharField(blank=True, max_length=20)),
|
||||
('company', models.CharField(blank=True, max_length=100)),
|
||||
('assigned_at', models.DateTimeField(blank=True, null=True)),
|
||||
('created_at', models.DateTimeField(auto_now_add=True)),
|
||||
('updated_at', models.DateTimeField(auto_now=True)),
|
||||
('closed_at', models.DateTimeField(blank=True, null=True)),
|
||||
('last_activity', models.DateTimeField(auto_now=True)),
|
||||
('first_response_at', models.DateTimeField(blank=True, null=True)),
|
||||
('sla_deadline', models.DateTimeField(blank=True, null=True)),
|
||||
('tags', models.CharField(blank=True, help_text='Comma-separated tags', max_length=500)),
|
||||
('internal_notes', models.TextField(blank=True, help_text='Internal notes visible only to staff')),
|
||||
('is_escalated', models.BooleanField(default=False)),
|
||||
('escalation_reason', models.TextField(blank=True)),
|
||||
('attachments', models.JSONField(blank=True, default=list, help_text='List of file paths')),
|
||||
('assigned_to', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='assigned_tickets', to=settings.AUTH_USER_MODEL)),
|
||||
('category', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, to='support.ticketcategory')),
|
||||
('priority', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, to='support.ticketpriority')),
|
||||
('status', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, to='support.ticketstatus')),
|
||||
('user', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='support_tickets', to=settings.AUTH_USER_MODEL)),
|
||||
],
|
||||
options={
|
||||
'ordering': ['-created_at'],
|
||||
},
|
||||
),
|
||||
migrations.CreateModel(
|
||||
name='TicketMessage',
|
||||
fields=[
|
||||
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
|
||||
('message_type', models.CharField(choices=[('user_message', 'User Message'), ('agent_response', 'Agent Response'), ('system_note', 'System Note'), ('status_change', 'Status Change'), ('assignment_change', 'Assignment Change'), ('escalation', 'Escalation')], default='user_message', max_length=20)),
|
||||
('content', models.TextField()),
|
||||
('author_name', models.CharField(blank=True, max_length=100)),
|
||||
('author_email', models.EmailField(blank=True, max_length=254)),
|
||||
('is_internal', models.BooleanField(default=False, help_text='Internal message not visible to user')),
|
||||
('created_at', models.DateTimeField(auto_now_add=True)),
|
||||
('updated_at', models.DateTimeField(auto_now=True)),
|
||||
('attachments', models.JSONField(blank=True, default=list, help_text='List of file paths')),
|
||||
('is_read', models.BooleanField(default=False)),
|
||||
('read_at', models.DateTimeField(blank=True, null=True)),
|
||||
('author', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='ticket_messages', to=settings.AUTH_USER_MODEL)),
|
||||
('read_by', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='read_messages', to=settings.AUTH_USER_MODEL)),
|
||||
('ticket', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='messages', to='support.supportticket')),
|
||||
],
|
||||
options={
|
||||
'ordering': ['created_at'],
|
||||
'indexes': [models.Index(fields=['ticket', 'created_at'], name='support_tic_ticket__0cd9bd_idx'), models.Index(fields=['author'], name='support_tic_author__503d4b_idx'), models.Index(fields=['message_type'], name='support_tic_message_6220bd_idx')],
|
||||
},
|
||||
),
|
||||
migrations.CreateModel(
|
||||
name='TicketActivity',
|
||||
fields=[
|
||||
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
|
||||
('activity_type', models.CharField(choices=[('created', 'Ticket Created'), ('updated', 'Ticket Updated'), ('status_changed', 'Status Changed'), ('assigned', 'Ticket Assigned'), ('message_added', 'Message Added'), ('escalated', 'Ticket Escalated'), ('closed', 'Ticket Closed'), ('reopened', 'Ticket Reopened')], max_length=20)),
|
||||
('description', models.TextField()),
|
||||
('user_name', models.CharField(blank=True, max_length=100)),
|
||||
('old_value', models.TextField(blank=True)),
|
||||
('new_value', models.TextField(blank=True)),
|
||||
('created_at', models.DateTimeField(auto_now_add=True)),
|
||||
('ticket', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='activities', to='support.supportticket')),
|
||||
('user', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='ticket_activities', to=settings.AUTH_USER_MODEL)),
|
||||
],
|
||||
options={
|
||||
'ordering': ['-created_at'],
|
||||
'indexes': [models.Index(fields=['ticket', 'created_at'], name='support_tic_ticket__4097ca_idx'), models.Index(fields=['activity_type'], name='support_tic_activit_9c98a0_idx')],
|
||||
},
|
||||
),
|
||||
migrations.AddIndex(
|
||||
model_name='supportticket',
|
||||
index=models.Index(fields=['ticket_number'], name='support_sup_ticket__4a7d4b_idx'),
|
||||
),
|
||||
migrations.AddIndex(
|
||||
model_name='supportticket',
|
||||
index=models.Index(fields=['user_email'], name='support_sup_user_em_c518a8_idx'),
|
||||
),
|
||||
migrations.AddIndex(
|
||||
model_name='supportticket',
|
||||
index=models.Index(fields=['status'], name='support_sup_status__7b4480_idx'),
|
||||
),
|
||||
migrations.AddIndex(
|
||||
model_name='supportticket',
|
||||
index=models.Index(fields=['priority'], name='support_sup_priorit_5d48ff_idx'),
|
||||
),
|
||||
migrations.AddIndex(
|
||||
model_name='supportticket',
|
||||
index=models.Index(fields=['assigned_to'], name='support_sup_assigne_53b075_idx'),
|
||||
),
|
||||
migrations.AddIndex(
|
||||
model_name='supportticket',
|
||||
index=models.Index(fields=['created_at'], name='support_sup_created_83a137_idx'),
|
||||
),
|
||||
]
|
||||
@@ -0,0 +1,61 @@
|
||||
# Generated by Django 4.2.7 on 2025-10-07 18:06
|
||||
|
||||
from django.conf import settings
|
||||
from django.db import migrations, models
|
||||
import django.db.models.deletion
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
|
||||
('support', '0001_initial'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.CreateModel(
|
||||
name='KnowledgeBaseCategory',
|
||||
fields=[
|
||||
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
|
||||
('name', models.CharField(max_length=100, unique=True)),
|
||||
('slug', models.SlugField(max_length=120, unique=True)),
|
||||
('description', models.TextField(blank=True)),
|
||||
('icon', models.CharField(default='fa-book', help_text='FontAwesome icon class', max_length=50)),
|
||||
('color', models.CharField(default='#667eea', help_text='Hex color code', max_length=7)),
|
||||
('is_active', models.BooleanField(default=True)),
|
||||
('display_order', models.PositiveIntegerField(default=0)),
|
||||
('created_at', models.DateTimeField(auto_now_add=True)),
|
||||
('updated_at', models.DateTimeField(auto_now=True)),
|
||||
],
|
||||
options={
|
||||
'verbose_name_plural': 'Knowledge Base Categories',
|
||||
'ordering': ['display_order', 'name'],
|
||||
},
|
||||
),
|
||||
migrations.CreateModel(
|
||||
name='KnowledgeBaseArticle',
|
||||
fields=[
|
||||
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
|
||||
('title', models.CharField(max_length=200)),
|
||||
('slug', models.SlugField(max_length=220, unique=True)),
|
||||
('content', models.TextField()),
|
||||
('summary', models.TextField(blank=True, help_text='Short summary of the article')),
|
||||
('meta_description', models.CharField(blank=True, max_length=160)),
|
||||
('keywords', models.CharField(blank=True, help_text='Comma-separated keywords', max_length=500)),
|
||||
('is_published', models.BooleanField(default=False)),
|
||||
('is_featured', models.BooleanField(default=False)),
|
||||
('view_count', models.PositiveIntegerField(default=0)),
|
||||
('helpful_count', models.PositiveIntegerField(default=0)),
|
||||
('not_helpful_count', models.PositiveIntegerField(default=0)),
|
||||
('created_at', models.DateTimeField(auto_now_add=True)),
|
||||
('updated_at', models.DateTimeField(auto_now=True)),
|
||||
('published_at', models.DateTimeField(blank=True, null=True)),
|
||||
('author', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='kb_articles', to=settings.AUTH_USER_MODEL)),
|
||||
('category', models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='articles', to='support.knowledgebasecategory')),
|
||||
],
|
||||
options={
|
||||
'ordering': ['-created_at'],
|
||||
'indexes': [models.Index(fields=['slug'], name='support_kno_slug_0c7b3a_idx'), models.Index(fields=['category'], name='support_kno_categor_733ba1_idx'), models.Index(fields=['is_published'], name='support_kno_is_publ_402a55_idx'), models.Index(fields=['created_at'], name='support_kno_created_ef91a5_idx')],
|
||||
},
|
||||
),
|
||||
]
|
||||
39
backEnd/support/migrations/0003_registeredemail.py
Normal file
39
backEnd/support/migrations/0003_registeredemail.py
Normal file
@@ -0,0 +1,39 @@
|
||||
# Generated by Django 4.2.7 on 2025-10-07 18:58
|
||||
|
||||
from django.conf import settings
|
||||
import django.core.validators
|
||||
from django.db import migrations, models
|
||||
import django.db.models.deletion
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
|
||||
('support', '0002_knowledgebasecategory_knowledgebasearticle'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.CreateModel(
|
||||
name='RegisteredEmail',
|
||||
fields=[
|
||||
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
|
||||
('email', models.EmailField(max_length=254, unique=True, validators=[django.core.validators.EmailValidator()])),
|
||||
('company_name', models.CharField(blank=True, help_text='Company or organization name', max_length=200)),
|
||||
('contact_name', models.CharField(blank=True, help_text='Primary contact name', max_length=200)),
|
||||
('notes', models.TextField(blank=True, help_text='Internal notes about this registration')),
|
||||
('is_active', models.BooleanField(default=True, help_text='Whether this email can submit tickets')),
|
||||
('created_at', models.DateTimeField(auto_now_add=True)),
|
||||
('updated_at', models.DateTimeField(auto_now=True)),
|
||||
('last_ticket_date', models.DateTimeField(blank=True, help_text='Last time this email submitted a ticket', null=True)),
|
||||
('ticket_count', models.PositiveIntegerField(default=0, help_text='Total number of tickets submitted')),
|
||||
('added_by', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='registered_emails', to=settings.AUTH_USER_MODEL)),
|
||||
],
|
||||
options={
|
||||
'verbose_name': 'Registered Email',
|
||||
'verbose_name_plural': 'Registered Emails',
|
||||
'ordering': ['-created_at'],
|
||||
'indexes': [models.Index(fields=['email'], name='support_reg_email_ee78ad_idx'), models.Index(fields=['is_active'], name='support_reg_is_acti_fadc86_idx')],
|
||||
},
|
||||
),
|
||||
]
|
||||
0
backEnd/support/migrations/__init__.py
Normal file
0
backEnd/support/migrations/__init__.py
Normal file
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
backEnd/support/migrations/__pycache__/__init__.cpython-312.pyc
Normal file
BIN
backEnd/support/migrations/__pycache__/__init__.cpython-312.pyc
Normal file
Binary file not shown.
Reference in New Issue
Block a user