75 lines
4.0 KiB
Python
75 lines
4.0 KiB
Python
# Generated by Django 5.2.7 on 2026-04-03 11:41
|
|
|
|
import django.db.models.deletion
|
|
from django.db import migrations, models
|
|
|
|
|
|
class Migration(migrations.Migration):
|
|
|
|
initial = True
|
|
|
|
dependencies = [
|
|
]
|
|
|
|
operations = [
|
|
migrations.CreateModel(
|
|
name='SalesWorkspace',
|
|
fields=[
|
|
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
|
|
('customer_name', models.CharField(max_length=160)),
|
|
('project_name', models.CharField(blank=True, max_length=160)),
|
|
('project_number', models.CharField(blank=True, max_length=60)),
|
|
('zipcode', models.CharField(blank=True, max_length=20)),
|
|
('address', models.CharField(blank=True, max_length=255)),
|
|
('city', models.CharField(blank=True, max_length=120)),
|
|
('contact_name', models.CharField(blank=True, max_length=160)),
|
|
('contact_email', models.EmailField(blank=True, max_length=254)),
|
|
('contact_phone', models.CharField(blank=True, max_length=40)),
|
|
('opportunity_title', models.CharField(max_length=180)),
|
|
('stage', models.CharField(choices=[('new', 'New lead'), ('qualified', 'Qualified'), ('proposal', 'Proposal / Quote'), ('negotiation', 'Negotiation'), ('won', 'Won'), ('lost', 'Lost')], default='new', max_length=20)),
|
|
('estimated_value', models.DecimalField(decimal_places=2, default=0, max_digits=12)),
|
|
('layout_template', models.CharField(choices=[('customer360', 'Customer 360'), ('quotation_focus', 'Quotation focus'), ('planning', 'Planning board')], default='customer360', max_length=24)),
|
|
('summary', models.TextField(blank=True)),
|
|
('next_step', models.CharField(blank=True, max_length=180)),
|
|
('next_meeting_at', models.DateTimeField(blank=True, null=True)),
|
|
('created_at', models.DateTimeField(auto_now_add=True)),
|
|
('updated_at', models.DateTimeField(auto_now=True)),
|
|
],
|
|
options={
|
|
'ordering': ['-updated_at', '-created_at'],
|
|
},
|
|
),
|
|
migrations.CreateModel(
|
|
name='QuoteLine',
|
|
fields=[
|
|
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
|
|
('product_name', models.CharField(max_length=140)),
|
|
('description', models.CharField(blank=True, max_length=255)),
|
|
('quantity', models.PositiveIntegerField(default=1)),
|
|
('unit_price', models.DecimalField(decimal_places=2, max_digits=10)),
|
|
('created_at', models.DateTimeField(auto_now_add=True)),
|
|
('workspace', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='quote_lines', to='core.salesworkspace')),
|
|
],
|
|
options={
|
|
'ordering': ['created_at', 'id'],
|
|
},
|
|
),
|
|
migrations.CreateModel(
|
|
name='ActivityItem',
|
|
fields=[
|
|
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
|
|
('title', models.CharField(max_length=180)),
|
|
('activity_type', models.CharField(choices=[('call', 'Call'), ('meeting', 'Meeting'), ('email', 'Email'), ('task', 'Task')], max_length=20)),
|
|
('due_at', models.DateTimeField()),
|
|
('owner', models.CharField(blank=True, max_length=120)),
|
|
('notes', models.TextField(blank=True)),
|
|
('is_done', models.BooleanField(default=False)),
|
|
('created_at', models.DateTimeField(auto_now_add=True)),
|
|
('workspace', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='activities', to='core.salesworkspace')),
|
|
],
|
|
options={
|
|
'ordering': ['due_at', 'id'],
|
|
},
|
|
),
|
|
]
|