Add Django backend, 1C integration, deploy config and API docs
Backend (Django 4.2 + DRF): - accounts: phone OTP login, JWT, profile, addresses - catalog: categories, products, images, filters, search, hits/new/related - orders: creation with Idempotency-Key, stock reservation, status history, cancel - loyalty: bonus accounts, promo codes, gift certificates - payments: payment records and YooKassa webhook handling - content: static pages, banners, site settings - integration: 1C exchange (catalog sync, order push via outbox, statuses, bonuses) - common: error envelope, pagination, request-id, integration auth, admin dashboard Infrastructure: Dockerfile, docker-compose (Postgres, Redis, Celery worker/beat, Nginx), requirements split by environment, OpenAPI contracts for site and 1C, architecture doc. Tests: 22 pytest cases covering catalog, orders, idempotency, OTP, integration.
This commit is contained in:
1 parent
5f8d37357d
commit
756f40353b
130 files changed
+10066
No files matched your search
@@ -0,0 +1,84 @@
|
||||
# Generated by Django 4.2.16 on 2026-11-06 13:38
|
||||
|
||||
from decimal import Decimal
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
initial = True
|
||||
|
||||
dependencies = [
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.CreateModel(
|
||||
name='Banner',
|
||||
fields=[
|
||||
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
|
||||
('created_at', models.DateTimeField(auto_now_add=True, db_index=True)),
|
||||
('updated_at', models.DateTimeField(auto_now=True)),
|
||||
('title', models.CharField(max_length=255, verbose_name='название')),
|
||||
('image_url', models.URLField(max_length=1000, verbose_name='изображение')),
|
||||
('link_url', models.URLField(blank=True, max_length=1000, verbose_name='ссылка')),
|
||||
('position', models.CharField(choices=[('home_top', 'Главная — верх'), ('home_middle', 'Главная — середина'), ('category', 'Категория')], default='home_top', max_length=20, verbose_name='позиция')),
|
||||
('is_active', models.BooleanField(default=True, verbose_name='активен')),
|
||||
('sort_order', models.IntegerField(default=0, verbose_name='порядок')),
|
||||
('starts_at', models.DateTimeField(blank=True, null=True, verbose_name='начало показа')),
|
||||
('ends_at', models.DateTimeField(blank=True, null=True, verbose_name='конец показа')),
|
||||
],
|
||||
options={
|
||||
'verbose_name': 'баннер',
|
||||
'verbose_name_plural': 'баннеры',
|
||||
'db_table': 'content_banner',
|
||||
'ordering': ['sort_order', '-created_at'],
|
||||
},
|
||||
),
|
||||
migrations.CreateModel(
|
||||
name='SiteSettings',
|
||||
fields=[
|
||||
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
|
||||
('site_name', models.CharField(default='HOMM', max_length=255, verbose_name='название сайта')),
|
||||
('phone', models.CharField(blank=True, max_length=32, verbose_name='телефон')),
|
||||
('email', models.EmailField(blank=True, max_length=254, verbose_name='email')),
|
||||
('address', models.CharField(blank=True, max_length=500, verbose_name='адрес')),
|
||||
('working_hours', models.CharField(blank=True, max_length=255, verbose_name='часы работы')),
|
||||
('telegram_url', models.URLField(blank=True, verbose_name='Telegram')),
|
||||
('vk_url', models.URLField(blank=True, verbose_name='ВКонтакте')),
|
||||
('whatsapp_url', models.URLField(blank=True, verbose_name='WhatsApp')),
|
||||
('free_delivery_threshold', models.DecimalField(decimal_places=2, default=Decimal('0'), max_digits=12, verbose_name='бесплатная доставка от')),
|
||||
('default_delivery_cost', models.DecimalField(decimal_places=2, default=Decimal('0'), max_digits=12, verbose_name='стоимость доставки')),
|
||||
('bonus_accrual_percent', models.DecimalField(decimal_places=2, default=Decimal('0'), max_digits=5, verbose_name='процент начисления бонусов')),
|
||||
('bonus_max_payment_percent', models.DecimalField(decimal_places=2, default=Decimal('0'), max_digits=5, verbose_name='максимум оплаты бонусами, %')),
|
||||
('bonus_ttl_days', models.PositiveIntegerField(default=365, verbose_name='срок жизни бонусов, дней')),
|
||||
('privacy_policy_url', models.URLField(blank=True, verbose_name='политика конфиденциальности')),
|
||||
('offer_url', models.URLField(blank=True, verbose_name='публичная оферта')),
|
||||
('updated_at', models.DateTimeField(auto_now=True)),
|
||||
],
|
||||
options={
|
||||
'verbose_name': 'настройки сайта',
|
||||
'verbose_name_plural': 'настройки сайта',
|
||||
'db_table': 'content_site_settings',
|
||||
},
|
||||
),
|
||||
migrations.CreateModel(
|
||||
name='StaticPage',
|
||||
fields=[
|
||||
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
|
||||
('created_at', models.DateTimeField(auto_now_add=True, db_index=True)),
|
||||
('updated_at', models.DateTimeField(auto_now=True)),
|
||||
('slug', models.SlugField(max_length=255, unique=True, verbose_name='адрес')),
|
||||
('title', models.CharField(max_length=255, verbose_name='заголовок')),
|
||||
('content', models.TextField(blank=True, verbose_name='содержимое')),
|
||||
('seo_title', models.CharField(blank=True, max_length=255, verbose_name='SEO title')),
|
||||
('seo_description', models.CharField(blank=True, max_length=500, verbose_name='SEO description')),
|
||||
('is_published', models.BooleanField(default=True, verbose_name='опубликована')),
|
||||
],
|
||||
options={
|
||||
'verbose_name': 'статическая страница',
|
||||
'verbose_name_plural': 'статические страницы',
|
||||
'db_table': 'content_static_page',
|
||||
'ordering': ['title'],
|
||||
},
|
||||
),
|
||||
]
|
||||
Reference in new issue
Block a user