Skip to content

Commit

Permalink
Merge pull request #892 from weni-ai/feature/show-chat-help-ecommerce
Browse files Browse the repository at this point in the history
Feature: Adding E-Commerce rule to show help bot chat
  • Loading branch information
ericosta-dev authored Aug 30, 2024
2 parents b8d3732 + aafb2c8 commit 09b1b53
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion connect/api/v1/organization/serializers.py
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,8 @@ def get_authorization(self, obj):
def get_show_chat_help(self, obj):
if obj.config.get("show_chat_help"):
return True
return obj.authorizations.order_by("created_at").first().user.number_people == 4
user = obj.authorizations.order_by("created_at").first().user
return user.number_people == 4 or user.company_segment in ['E-commerce', 'Comercio electrónico']


class OrganizationAuthorizationSerializer(serializers.ModelSerializer):
Expand Down
3 changes: 2 additions & 1 deletion connect/api/v2/organizations/serializers.py
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,8 @@ def publish_create_org_message(self, instance: Organization, user: User):
def get_show_chat_help(self, obj):
if obj.config.get("show_chat_help"):
return True
return obj.authorizations.order_by("created_at").first().user.number_people == 4
user = obj.authorizations.order_by("created_at").first().user
return user.number_people == 4 or user.company_segment in ['E-commerce', 'Comercio electrónico']


class PendingAuthorizationOrganizationSerializer(serializers.ModelSerializer):
Expand Down

0 comments on commit 09b1b53

Please sign in to comment.