libretificacaotjcore 0.1.3__py3-none-any.whl → 0.1.5__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of libretificacaotjcore might be problematic. Click here for more details.

@@ -48,3 +48,10 @@ class ArquivoRepository:
48
48
  except Exception as e:
49
49
  print(f"❌ Erro ao remover o arquivo: {e}")
50
50
  return False
51
+
52
+ async def buscar_por_solicitacao_id(self, solicitacaoId: int) -> list[dict]:
53
+ try:
54
+ return await self.__db.arquivos.find({"SolicitacaoId": solicitacaoId}).to_list(length=None)
55
+ except Exception as e:
56
+ print(f"❌ Erro ao buscar por solicitacaoId: {e}")
57
+ return []
@@ -13,21 +13,22 @@ class ConfigDb:
13
13
  self.client = motor.motor_asyncio.AsyncIOMotorClient(
14
14
  f"mongodb://{self.host}:{self.port}"
15
15
  )
16
- self.db = self.client[self.db_name]
16
+ self.__db = self.client[self.db_name]
17
17
  self.db_initialized = False
18
18
 
19
19
 
20
20
  async def criar_schema(self):
21
21
  global _db_initialized
22
22
  if not self.db_initialized:
23
- if "arquivos" not in (await self.db.list_collection_names()):
24
- await self.db.create_collection("arquivos")
23
+ if "arquivos" not in (await self.__db.list_collection_names()):
24
+ await self.__db.create_collection("arquivos")
25
25
 
26
- await self.db.arquivos.create_index([("cnpj", 1)])
27
- await self.db.arquivos.create_index([("SolicitacaoId", 1)])
28
- await self.db.arquivos.create_index([("id", 1)], unique=True)
26
+ await self.__db.arquivos.create_index([("cnpj", 1)])
27
+ await self.__db.arquivos.create_index([("SolicitacaoId", 1)])
28
+ await self.__db.arquivos.create_index([("id", 1)], unique=True)
29
+ await self.__db.arquivos.create_index([("SolicitacaoId", 1), ("cpf", 1)], unique=True)
29
30
  self.db_initialized = True
30
31
 
31
32
  async def get_db(self):
32
33
  await self.criar_schema()
33
- return self.db
34
+ return self.__db
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: libretificacaotjcore
3
- Version: 0.1.3
3
+ Version: 0.1.5
4
4
  Summary: Biblioteca para centralizar conexao com filas no rabbit e banco de dados no mongodb para os servicos de retificacao da TJ
5
5
  Author-email: Jhonatan Azevedo <dev.azevedo@outlook.com>
6
6
  Project-URL: Homepage, https://github.com/seu-usuario/libretificacaotjcore
@@ -1,12 +1,12 @@
1
1
  libretificacaotjcore/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
2
2
  libretificacaotjcore/database/__init__.py,sha256=frcCV1k9oG9oKj3dpUqdJg1PxRT2RSN_XKdLCPjaYaY,2
3
- libretificacaotjcore/database/arquivo_repository.py,sha256=ks1dbRmrDiFfqxpVXodYZVeHg00_90oRVoBJ9BNsXv4,1833
4
- libretificacaotjcore/database/config_db.py,sha256=bixGQjK-QHk8KAqSadHMHZe1mU57FbVXI0rdW0PvNSs,1178
3
+ libretificacaotjcore/database/arquivo_repository.py,sha256=uCrdib3Ub-4_45T5PBz9GqgsuVC-uEdKqUOVODv0FSY,2154
4
+ libretificacaotjcore/database/config_db.py,sha256=ydY83Xn16DcAO-apH1nIJ1hKL_38hEHeUKg5R8v8ZJI,1292
5
5
  libretificacaotjcore/dtos/solicitacao_dto.py,sha256=A0QU6MwuyK6Z2vYy4FknSAOfebpY4txB-YmgpFhAVCY,2460
6
6
  libretificacaotjcore/services/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
7
7
  libretificacaotjcore/services/rabbitmq_consumer.py,sha256=a25mRHjbkgO3lkdCJ5NpJfWAGHhVkQDCRDR2t8hMNAI,1710
8
8
  libretificacaotjcore/services/s3_service.py,sha256=HKR_jt2H3XdV1PCzo5R5bnhmoQ3I46Yn5IqAvVPhsjs,2946
9
- libretificacaotjcore-0.1.3.dist-info/METADATA,sha256=1EIFOVn8Te90dCp5Hip1dD_LHUnR-XzwkSr1BTRx0g0,1368
10
- libretificacaotjcore-0.1.3.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
11
- libretificacaotjcore-0.1.3.dist-info/top_level.txt,sha256=J9vnz_X9OUnxC-eXHiAzlc9xIrWBwZ5bgnIDQIIFY4c,21
12
- libretificacaotjcore-0.1.3.dist-info/RECORD,,
9
+ libretificacaotjcore-0.1.5.dist-info/METADATA,sha256=_HDPRde4-ftE9gLAw8lWwwu5Dp2DDt3dWmLUClbpzKc,1368
10
+ libretificacaotjcore-0.1.5.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
11
+ libretificacaotjcore-0.1.5.dist-info/top_level.txt,sha256=J9vnz_X9OUnxC-eXHiAzlc9xIrWBwZ5bgnIDQIIFY4c,21
12
+ libretificacaotjcore-0.1.5.dist-info/RECORD,,