Django 6 + DRF resource server against the Gooyal accounts OAuth2 service, matching the Winsoo ecosystem's conventions. Covers locations, stores, catalog, cart, checkout/orders (with the multi-store-cart split and the status stepper), reviews, and notifications, plus a demo-data seed command. Payment integration (wallet debits, online gateway, seller payouts) is intentionally left out here — see feature/payment. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
80 lines
4.1 KiB
Python
80 lines
4.1 KiB
Python
# Generated by Django 6.0.2 on 2026-08-09 10:29
|
||
|
||
import django.contrib.gis.db.models.fields
|
||
import django.db.models.deletion
|
||
import uuid
|
||
from django.conf import settings
|
||
from django.db import migrations, models
|
||
|
||
|
||
class Migration(migrations.Migration):
|
||
|
||
initial = True
|
||
|
||
dependencies = [
|
||
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
|
||
]
|
||
|
||
operations = [
|
||
migrations.CreateModel(
|
||
name='City',
|
||
fields=[
|
||
('uuid', models.UUIDField(db_index=True, default=uuid.uuid4, primary_key=True, serialize=False, unique=True)),
|
||
('created_at', models.DateTimeField(auto_now_add=True, db_index=True)),
|
||
('updated_at', models.DateTimeField(auto_now=True, db_index=True)),
|
||
('name', models.CharField(max_length=100, unique=True)),
|
||
('slug', models.SlugField(max_length=100, unique=True)),
|
||
('is_active', models.BooleanField(default=True)),
|
||
],
|
||
options={
|
||
'verbose_name': 'شهر',
|
||
'verbose_name_plural': 'شهرها',
|
||
'ordering': ['name'],
|
||
},
|
||
),
|
||
migrations.CreateModel(
|
||
name='Neighborhood',
|
||
fields=[
|
||
('uuid', models.UUIDField(db_index=True, default=uuid.uuid4, primary_key=True, serialize=False, unique=True)),
|
||
('created_at', models.DateTimeField(auto_now_add=True, db_index=True)),
|
||
('updated_at', models.DateTimeField(auto_now=True, db_index=True)),
|
||
('name', models.CharField(max_length=100)),
|
||
('slug', models.SlugField(max_length=100)),
|
||
('center', django.contrib.gis.db.models.fields.PointField(blank=True, geography=True, null=True, srid=4326)),
|
||
('is_active', models.BooleanField(default=True)),
|
||
('city', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='neighborhoods', to='locations.city')),
|
||
],
|
||
options={
|
||
'verbose_name': 'محله',
|
||
'verbose_name_plural': 'محله\u200cها',
|
||
'ordering': ['name'],
|
||
'unique_together': {('city', 'slug')},
|
||
},
|
||
),
|
||
migrations.CreateModel(
|
||
name='Address',
|
||
fields=[
|
||
('uuid', models.UUIDField(db_index=True, default=uuid.uuid4, primary_key=True, serialize=False, unique=True)),
|
||
('created_at', models.DateTimeField(auto_now_add=True, db_index=True)),
|
||
('updated_at', models.DateTimeField(auto_now=True, db_index=True)),
|
||
('label', models.CharField(choices=[('home', 'خانه'), ('work', 'محل کار'), ('other', 'سایر')], default='home', max_length=10)),
|
||
('title', models.CharField(blank=True, max_length=100)),
|
||
('full_address', models.TextField()),
|
||
('plaque', models.CharField(blank=True, max_length=20)),
|
||
('floor', models.CharField(blank=True, max_length=20)),
|
||
('unit', models.CharField(blank=True, max_length=20)),
|
||
('recipient_name', models.CharField(max_length=150)),
|
||
('recipient_phone', models.CharField(max_length=20)),
|
||
('location', django.contrib.gis.db.models.fields.PointField(blank=True, geography=True, null=True, srid=4326)),
|
||
('is_default', models.BooleanField(default=False)),
|
||
('user', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='addresses', to=settings.AUTH_USER_MODEL)),
|
||
('city', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, related_name='addresses', to='locations.city')),
|
||
('neighborhood', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.PROTECT, related_name='addresses', to='locations.neighborhood')),
|
||
],
|
||
options={
|
||
'verbose_name': 'آدرس',
|
||
'verbose_name_plural': 'آدرس\u200cها',
|
||
'ordering': ['-is_default', '-created_at'],
|
||
},
|
||
),
|
||
]
|