Skip to content

Commit

Permalink
feature: adding queues to content
Browse files Browse the repository at this point in the history
  • Loading branch information
AlanJaeger committed Aug 20, 2024
1 parent 4a6769a commit ae4f474
Showing 1 changed file with 12 additions and 9 deletions.
21 changes: 12 additions & 9 deletions chats/apps/projects/usecases/sector_creation.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,12 +60,22 @@ def create(self, body, sector_dtos):
SectorAuthorization.objects.create(
role=1, permission=manager_permission, sector=created_sector
)

content = {
"project_uuid": str(created_sector.project.uuid),
"name": created_sector.name,
"project_auth": str(created_sector.external_token.pk),
"user_email": str(body["user_email"]),
"uuid": str(created_sector.uuid),
"queues": [],
}
for queue in sector.queues:
created_queue = Queue.objects.create(
sector=created_sector,
name=queue.name,
)
content["queues"].append(
{"uuid": str(created_queue.uuid), "name": created_queue.name}
)

for agent in queue.agents:
agent_permission = ProjectPermission.objects.get(
Expand All @@ -76,14 +86,7 @@ def create(self, body, sector_dtos):
permission=agent_permission,
queue=created_queue,
)
content = {
"project_uuid": str(created_sector.project.uuid),
"name": created_sector.name,
"project_auth": str(created_sector.external_token.pk),
"user_email": str(body["user_email"]),
"uuid": str(created_sector.uuid),
"queues": [],
}

self._flows_client.request_ticketer(content=content)

def create_feature_version(self, body, sector_dtos):
Expand Down

0 comments on commit ae4f474

Please sign in to comment.