From 198e5567e00edae17f8eeb770c74755cf8a625e7 Mon Sep 17 00:00:00 2001 From: Ruslan Bakiev <572431+veikab@users.noreply.github.com> Date: Wed, 21 Jan 2026 09:19:29 +0700 Subject: [PATCH] Add kyc_profile_uuid to SupplierProfile and getSupplierProfileByTeam query --- exchange/schemas/public_schema.py | 11 +++++++++++ suppliers/models.py | 1 + 2 files changed, 12 insertions(+) diff --git a/exchange/schemas/public_schema.py b/exchange/schemas/public_schema.py index f6a83a9..2cc87bb 100644 --- a/exchange/schemas/public_schema.py +++ b/exchange/schemas/public_schema.py @@ -54,6 +54,11 @@ class PublicQuery(graphene.ObjectType): is_verified=graphene.Boolean(), ) get_supplier_profile = graphene.Field(SupplierProfileType, uuid=graphene.String(required=True)) + get_supplier_profile_by_team = graphene.Field( + SupplierProfileType, + team_uuid=graphene.String(required=True), + description="Get supplier profile by team UUID" + ) get_offers = graphene.List( OfferType, status=graphene.String(), @@ -125,6 +130,12 @@ class PublicQuery(graphene.ObjectType): except SupplierProfile.DoesNotExist: return None + def resolve_get_supplier_profile_by_team(self, info, team_uuid): + try: + return SupplierProfile.objects.get(team_uuid=team_uuid) + except SupplierProfile.DoesNotExist: + return None + @staticmethod def _get_offers_queryset(status=None, product_uuid=None, location_uuid=None, category_name=None, team_uuid=None): queryset = Offer.objects.all() diff --git a/suppliers/models.py b/suppliers/models.py index 4b36cbb..a0bf6c6 100644 --- a/suppliers/models.py +++ b/suppliers/models.py @@ -10,6 +10,7 @@ class SupplierProfile(models.Model): """ 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='')