Files
octopus/myproject/integrations/models/marketplaces/base.py
Andrey Smakotin 4629369823 feat(integrations): добавлена заготовка интеграции Recommerce
- Создана структура marketplaces/ для маркетплейсов
- Модели: MarketplaceIntegration, WooCommerceIntegration, RecommerceIntegration
- Сервисы: MarketplaceService, WooCommerceService, RecommerceService
- RecommerceService содержит методы для работы с API:
  - test_connection(), sync(), fetch_products()
  - push_product(), update_stock(), update_price()
- IntegrationConfig обновлён с новой интеграцией

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-11 23:19:42 +03:00

43 lines
1.5 KiB
Python
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
from django.db import models
from ..base import BaseIntegration, IntegrationType
class MarketplaceIntegration(BaseIntegration):
"""
Базовая модель для интеграций с маркетплейсами.
Наследует BaseIntegration и добавляет специфичные поля.
"""
integration_type = models.CharField(
max_length=20,
choices=IntegrationType.choices,
default=IntegrationType.MARKETPLACE,
editable=False
)
# URL магазина
store_url = models.URLField(
blank=True,
verbose_name="URL магазина",
help_text="Адрес магазина (например, https://shop.example.com)"
)
# Автоматическая синхронизация товаров
auto_sync_products = models.BooleanField(
default=False,
verbose_name="Авто-синхронизация товаров",
help_text="Автоматически обновлять товары на маркетплейсе"
)
# Импорт заказов
import_orders = models.BooleanField(
default=False,
verbose_name="Импорт заказов",
help_text="Импортировать заказы с маркетплейса"
)
class Meta:
abstract = True
verbose_name = "Интеграция с маркетплейсом"
verbose_name_plural = "Интеграции с маркетплейсами"