LAgencia-prospects-softseguros 0.1.11__tar.gz → 0.1.12__tar.gz

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.
Files changed (39) hide show
  1. {lagencia_prospects_softseguros-0.1.11 → lagencia_prospects_softseguros-0.1.12}/PKG-INFO +1 -1
  2. {lagencia_prospects_softseguros-0.1.11 → lagencia_prospects_softseguros-0.1.12}/pyproject.toml +1 -1
  3. {lagencia_prospects_softseguros-0.1.11 → lagencia_prospects_softseguros-0.1.12}/src/LAgencia_prospects_softseguros.egg-info/PKG-INFO +1 -1
  4. {lagencia_prospects_softseguros-0.1.11 → lagencia_prospects_softseguros-0.1.12}/src/LAgencia_prospects_softseguros.egg-info/SOURCES.txt +1 -0
  5. {lagencia_prospects_softseguros-0.1.11 → lagencia_prospects_softseguros-0.1.12}/src/LAgencia_prospects_softseguros.egg-info/top_level.txt +1 -0
  6. {lagencia_prospects_softseguros-0.1.11 → lagencia_prospects_softseguros-0.1.12}/src/main.py +12 -6
  7. lagencia_prospects_softseguros-0.1.12/src/main2.py +74 -0
  8. {lagencia_prospects_softseguros-0.1.11 → lagencia_prospects_softseguros-0.1.12}/src/softseguros/api_libertador/api.py +0 -1
  9. {lagencia_prospects_softseguros-0.1.11 → lagencia_prospects_softseguros-0.1.12}/src/softseguros/api_libertador/models_response.py +2 -2
  10. {lagencia_prospects_softseguros-0.1.11 → lagencia_prospects_softseguros-0.1.12}/src/softseguros/api_softseguros/create_customers_libertador.py +1 -0
  11. {lagencia_prospects_softseguros-0.1.11 → lagencia_prospects_softseguros-0.1.12}/src/softseguros/notifier/notificaciones.py +6 -3
  12. {lagencia_prospects_softseguros-0.1.11 → lagencia_prospects_softseguros-0.1.12}/README.md +0 -0
  13. {lagencia_prospects_softseguros-0.1.11 → lagencia_prospects_softseguros-0.1.12}/setup.cfg +0 -0
  14. {lagencia_prospects_softseguros-0.1.11 → lagencia_prospects_softseguros-0.1.12}/src/LAgencia_prospects_softseguros.egg-info/dependency_links.txt +0 -0
  15. {lagencia_prospects_softseguros-0.1.11 → lagencia_prospects_softseguros-0.1.12}/src/LAgencia_prospects_softseguros.egg-info/requires.txt +0 -0
  16. {lagencia_prospects_softseguros-0.1.11 → lagencia_prospects_softseguros-0.1.12}/src/execute_synchronization.py +0 -0
  17. {lagencia_prospects_softseguros-0.1.11 → lagencia_prospects_softseguros-0.1.12}/src/softseguros/__init__.py +0 -0
  18. {lagencia_prospects_softseguros-0.1.11 → lagencia_prospects_softseguros-0.1.12}/src/softseguros/api_libertador/__init__.py +0 -0
  19. {lagencia_prospects_softseguros-0.1.11 → lagencia_prospects_softseguros-0.1.12}/src/softseguros/api_libertador/codes_status_api.py +0 -0
  20. {lagencia_prospects_softseguros-0.1.11 → lagencia_prospects_softseguros-0.1.12}/src/softseguros/api_libertador/custom_execptions_api.py +0 -0
  21. {lagencia_prospects_softseguros-0.1.11 → lagencia_prospects_softseguros-0.1.12}/src/softseguros/api_libertador/execute_load_to_db.py +0 -0
  22. {lagencia_prospects_softseguros-0.1.11 → lagencia_prospects_softseguros-0.1.12}/src/softseguros/api_libertador/models_request.py +0 -0
  23. {lagencia_prospects_softseguros-0.1.11 → lagencia_prospects_softseguros-0.1.12}/src/softseguros/api_softin/fetch_softin.py +0 -0
  24. {lagencia_prospects_softseguros-0.1.11 → lagencia_prospects_softseguros-0.1.12}/src/softseguros/api_softseguros/api_softseguros.py +0 -0
  25. {lagencia_prospects_softseguros-0.1.11 → lagencia_prospects_softseguros-0.1.12}/src/softseguros/api_softseguros/create_customers_softin.py +0 -0
  26. {lagencia_prospects_softseguros-0.1.11 → lagencia_prospects_softseguros-0.1.12}/src/softseguros/api_softseguros/create_prospectsfrom_in_crm_softseguros.py +0 -0
  27. {lagencia_prospects_softseguros-0.1.11 → lagencia_prospects_softseguros-0.1.12}/src/softseguros/api_softseguros/models_requests.py +0 -0
  28. {lagencia_prospects_softseguros-0.1.11 → lagencia_prospects_softseguros-0.1.12}/src/softseguros/api_softseguros/models_response.py +0 -0
  29. {lagencia_prospects_softseguros-0.1.11 → lagencia_prospects_softseguros-0.1.12}/src/softseguros/config/logging_config.py +0 -0
  30. {lagencia_prospects_softseguros-0.1.11 → lagencia_prospects_softseguros-0.1.12}/src/softseguros/config/settings.py +0 -0
  31. {lagencia_prospects_softseguros-0.1.11 → lagencia_prospects_softseguros-0.1.12}/src/softseguros/database/__init__.py +0 -0
  32. {lagencia_prospects_softseguros-0.1.11 → lagencia_prospects_softseguros-0.1.12}/src/softseguros/database/config_db.py +0 -0
  33. {lagencia_prospects_softseguros-0.1.11 → lagencia_prospects_softseguros-0.1.12}/src/softseguros/database/models/__init__.py +0 -0
  34. {lagencia_prospects_softseguros-0.1.11 → lagencia_prospects_softseguros-0.1.12}/src/softseguros/database/models/models.py +0 -0
  35. {lagencia_prospects_softseguros-0.1.11 → lagencia_prospects_softseguros-0.1.12}/src/softseguros/database/repositories/__init__.py +0 -0
  36. {lagencia_prospects_softseguros-0.1.11 → lagencia_prospects_softseguros-0.1.12}/src/softseguros/database/repositories/libertadors.py +0 -0
  37. {lagencia_prospects_softseguros-0.1.11 → lagencia_prospects_softseguros-0.1.12}/src/softseguros/database/repositories/softin.py +0 -0
  38. {lagencia_prospects_softseguros-0.1.11 → lagencia_prospects_softseguros-0.1.12}/src/softseguros/database/repositories/softseguros.py +0 -0
  39. {lagencia_prospects_softseguros-0.1.11 → lagencia_prospects_softseguros-0.1.12}/src/softseguros/database/repository.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: LAgencia-prospects-softseguros
3
- Version: 0.1.11
3
+ Version: 0.1.12
4
4
  Summary: Add your description here
5
5
  Requires-Python: >=3.11
6
6
  Description-Content-Type: text/markdown
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "LAgencia-prospects-softseguros"
3
- version = "0.1.11"
3
+ version = "0.1.12"
4
4
  description = "Add your description here"
5
5
  readme = "README.md"
6
6
  requires-python = ">=3.11"
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: LAgencia-prospects-softseguros
3
- Version: 0.1.11
3
+ Version: 0.1.12
4
4
  Summary: Add your description here
5
5
  Requires-Python: >=3.11
6
6
  Description-Content-Type: text/markdown
@@ -2,6 +2,7 @@ README.md
2
2
  pyproject.toml
3
3
  src/execute_synchronization.py
4
4
  src/main.py
5
+ src/main2.py
5
6
  src/LAgencia_prospects_softseguros.egg-info/PKG-INFO
6
7
  src/LAgencia_prospects_softseguros.egg-info/SOURCES.txt
7
8
  src/LAgencia_prospects_softseguros.egg-info/dependency_links.txt
@@ -80,16 +80,22 @@ def main():
80
80
  client_id = os.getenv("CLIENT_ID_ESTRELLA")
81
81
  client_secret = os.getenv("CLIENT_SECRET_ESTRELLA")
82
82
 
83
- service_libertador = ServiceAPILibertador(client_id=client_id, client_secret=client_secret)
83
+ # client_id = os.getenv("CLIENT_ID_CASTILLO")
84
+ # client_secret = os.getenv("CLIENT_SECRET_CASTILLO")
84
85
 
85
- data = RequestDataUnique(solicitud="11725333")
86
- result = service_libertador.data_unique(data=data)
87
- print(result)
86
+ # client_id = os.getenv("CLIENT_ID_VILLACRUZ")
87
+ # client_secret = os.getenv("CLIENT_SECRET_VILLACRUZ")
88
+
89
+ service_libertador = ServiceAPILibertador(client_id=client_id, client_secret=client_secret)
88
90
 
89
- # data = RequestDataFull(estado=State.APROBADA, fechaInicio=datetime(2025, 11, 20), fechaFin=datetime(2025, 11, 24))
90
- # result = service_libertador.data_full(data=data)
91
+ # data = RequestDataUnique(solicitud="11725333")
92
+ # result = service_libertador.data_unique(data=data)
91
93
  # print(result)
92
94
 
95
+ data = RequestDataFull(estado=State.APROBADA, fechaInicio=datetime(2025, 12, 2), fechaFin=datetime(2025, 12, 4))
96
+ result = service_libertador.data_full(data=data)
97
+ print(result)
98
+
93
99
  # result = service_libertador.request_a_one_day_range()
94
100
  # print(result)
95
101
  ...
@@ -0,0 +1,74 @@
1
+ from dotenv import load_dotenv
2
+
3
+ from softseguros.api_libertador.execute_load_to_db import synchronize_prospects_libertador_table_for_castillo, synchronize_prospects_libertador_table_for_estrella, synchronize_prospects_libertador_table_for_villacruz
4
+ from softseguros.api_softin.fetch_softin import synchronize_prospects_softin_table_for_castillo, synchronize_prospects_softin_table_for_estrella, synchronize_prospects_softin_table_for_villacruz
5
+ from softseguros.api_softseguros.create_customers_libertador import synchronize_the_softseguros_table_with_libertador_prospects
6
+ from softseguros.api_softseguros.create_customers_softin import synchronize_the_softseguros_table_with_softin_prospects_for_landlord
7
+ from softseguros.api_softseguros.create_prospectsfrom_in_crm_softseguros import create_prospectsfrom_libertador_in_crm_softseguros
8
+ from softseguros.config.logging_config import configure_logger
9
+ from softseguros.notifier.notificaciones import notify_prospect_from_libertador, notify_prospect_from_softin
10
+
11
+
12
+ load_dotenv()
13
+ logger = configure_logger()
14
+
15
+
16
+ # def pr_api_softseguros_extrella():
17
+ # username = os.getenv("USERNAME_SOFTSEGUROS")
18
+ # password = os.getenv("USERNAME_PASSWORD_SOFTSEGUROS")
19
+ # api_softseguros = ServiceAPISoftSeguros(username=username, password=password)
20
+
21
+ # # 3610548
22
+ # category_estrella = {"id": 47205, "nombre": "La Estrella", "color": "#28a187", "tipo": "cliente"}
23
+ # customer = {"canon": 1800000, "identificacionInquilino": "10072325401", "nombreInquilino": "Juan Villa", "direccionInmueble": "Direcciion prueba", "telefonoInquilino": "573103555748", "correoInquilino": "juan@gmail.com"}
24
+ # observations = Observations(canon=customer.get("canon"))
25
+ # new_customer_softseguros = RequestsCreateCustomerSoftseguros(
26
+ # numero_documento=customer.get("identificacionInquilino"),
27
+ # nombres=customer.get("nombreInquilino"),
28
+ # direccion=customer.get("direccionInmueble"),
29
+ # telefono=customer.get("telefonoInquilino"),
30
+ # celular=customer.get("telefonoInquilino"),
31
+ # email=customer.get("correoInquilino"),
32
+ # observations=observations,
33
+ # ids_categorias=str(category_estrella.get("id")),
34
+ # )
35
+
36
+ # resp_create_customer = api_softseguros.create_customer(new_customer_softseguros)
37
+ # print()
38
+ # print(f"{customer=}\n")
39
+ # print(f"{new_customer_softseguros=}\n")
40
+ # print(f"{resp_create_customer=}\n")
41
+ # print("*" * 50)
42
+
43
+ # result_fetch_customer = api_softseguros.fetch_customer(numero_documento=customer.get("identificacionInquilino"))
44
+ # print(f"{result_fetch_customer=}")
45
+
46
+
47
+ def main():
48
+ logger.info("Hello from api-libertador!")
49
+ # + sincronizacion por libertador
50
+ synchronize_prospects_libertador_table_for_estrella()
51
+ synchronize_prospects_libertador_table_for_castillo()
52
+ synchronize_prospects_libertador_table_for_villacruz()
53
+
54
+ # # # + sincronizacion por softin
55
+ synchronize_prospects_softin_table_for_estrella()
56
+ synchronize_prospects_softin_table_for_castillo()
57
+ synchronize_prospects_softin_table_for_villacruz()
58
+
59
+ # # # + sincronizacion tabla softseguros
60
+ synchronize_the_softseguros_table_with_libertador_prospects()
61
+ synchronize_the_softseguros_table_with_softin_prospects_for_landlord()
62
+
63
+ # # + crear cleintes softseguros
64
+ create_prospectsfrom_libertador_in_crm_softseguros()
65
+
66
+ # # + notificar asesores
67
+ notify_prospect_from_libertador()
68
+ notify_prospect_from_softin()
69
+
70
+
71
+ if __name__ == "__main__":
72
+ main()
73
+
74
+ ...
@@ -100,7 +100,6 @@ class OAuth2BearerAuth(httpx.Auth):
100
100
  def auth_flow(self, request: httpx.Request) -> Generator[httpx.Request, None, None]:
101
101
  """Se ejecuta antes de cada request httpx para añadir el token."""
102
102
  self._ensure_valid_token()
103
- print(f"{self.token}")
104
103
  request.headers["Authorization"] = f"Bearer {self.token}"
105
104
  yield request
106
105
 
@@ -43,7 +43,7 @@ class DetailByDataUnique(BaseModel):
43
43
 
44
44
  """
45
45
 
46
- model_config = ConfigDict(title="Detalle de Solicitud Individual", frozen=True)
46
+ model_config = ConfigDict(title="Detalle de Solicitud Individual", frozen=False)
47
47
 
48
48
  solicitud: str = Field(..., description="Número único de solicitud")
49
49
  descripcionResultado: str = Field(..., description="Descripción del estado o resultado")
@@ -129,7 +129,7 @@ class DetailByDataFull(BaseModel):
129
129
 
130
130
  """
131
131
 
132
- model_config = ConfigDict(title="Detalle Completo de Solicitud", frozen=True)
132
+ model_config = ConfigDict(title="Detalle Completo de Solicitud", frozen=False)
133
133
 
134
134
  poliza: str = Field(..., description="Número de póliza")
135
135
  solicitud: str = Field(..., description="Número de solicitud")
@@ -71,6 +71,7 @@ def synchronize_the_softseguros_table_with_libertador_prospects():
71
71
  # Si el canon > 2M, el valor comercial es canon * 166.67, sino es canon * 200
72
72
  market_value = with_point(canon * 100 / 0.6 if canon > 2_000_000 else canon * 100 / 0.5)
73
73
  logger.debug(f"Valor comercial calculado: {market_value} para canon {canon}")
74
+ market_value= "No aplica"
74
75
 
75
76
  if record.fechaExpedicion != "No Registra":
76
77
  fecha_formatted = normalizar_fecha(record.fechaExpedicion)
@@ -9,7 +9,7 @@ import httpx
9
9
  from loguru import logger
10
10
  from pydantic import BaseModel
11
11
 
12
- from softseguros.database.repositories.softseguros import select_not_notified, update_notified
12
+ from softseguros.database.repositories.softseguros import select_not_notified, update_notified # noqa: F401
13
13
 
14
14
  phones = os.getenv("PHONES")
15
15
  PHONES = ast.literal_eval(phones)
@@ -134,8 +134,8 @@ def shipment_message_prospect_from_softin(phones: List[str], data: DataNotificat
134
134
  "number": phone,
135
135
  }
136
136
  response = client.post(url, headers=headers, json=payload)
137
- logger.info(response.text)
138
- result.append(response.status_code)
137
+ print(f"Codigo de respuesta del envio: {response.status_code}")
138
+ print(f"Resultado del envio: {response.text}")
139
139
  time.sleep(5)
140
140
  return result
141
141
 
@@ -182,6 +182,7 @@ def notify_prospect_from_softin():
182
182
  print("mensaje enviado, actualizando estado de prospects_to_secure {}")
183
183
  update_notified(contrato_solicitud=str(inquilino.contrato_solicitud) + "i", status=True)
184
184
  update_notified(contrato_solicitud=str(propietario.contrato_solicitud) + "p", status=True)
185
+ print(result)
185
186
 
186
187
 
187
188
  class DataNotificationpLibertador(BaseModel):
@@ -223,6 +224,8 @@ def shipment_new_prospect_from_libertador(phones: List[str], data: DataNotificat
223
224
  logger.info(response.text)
224
225
  result.append(response.status_code)
225
226
  time.sleep(5)
227
+ print(f"Codigo de respuesta del envio: {response.status_code}")
228
+ print(f"Resultado del envio: {response.text}")
226
229
 
227
230
  return result
228
231