Files
exchange/suppliers/models.py
Ruslan Bakiev 198e5567e0
All checks were successful
Build Docker Image / build (push) Successful in 3m12s
Add kyc_profile_uuid to SupplierProfile and getSupplierProfileByTeam query
2026-01-21 09:19:29 +07:00

43 lines
1.7 KiB
Python
Raw Permalink 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
import uuid
class SupplierProfile(models.Model):
"""Профиль поставщика на бирже - витринные данные для marketplace.
Первоисточник данных о поставщике - Team (team_type=SELLER).
Этот профиль содержит только витринную информацию для отображения на бирже.
"""
uuid = models.CharField(max_length=100, unique=True, default=uuid.uuid4)
team_uuid = models.CharField(max_length=100, unique=True) # Связь с Team
kyc_profile_uuid = models.CharField(max_length=100, blank=True, default='') # Связь с KYCProfile
name = models.CharField(max_length=255)
description = models.TextField(blank=True, default='')
country = models.CharField(max_length=100, blank=True, default='')
country_code = models.CharField(max_length=3, blank=True, default='')
logo_url = models.URLField(blank=True, default='')
# Координаты для карты
latitude = models.FloatField(null=True, blank=True)
longitude = models.FloatField(null=True, blank=True)
is_verified = models.BooleanField(default=False)
is_active = models.BooleanField(default=True)
created_at = models.DateTimeField(auto_now_add=True)
updated_at = models.DateTimeField(auto_now=True)
class Meta:
db_table = 'suppliers' # Сохраняем имя таблицы для совместимости
ordering = ['name']
verbose_name = 'Supplier Profile'
verbose_name_plural = 'Supplier Profiles'
def __str__(self):
return f"{self.name} ({self.country})"
# Alias for backwards compatibility
Supplier = SupplierProfile