fix(universign): add missing api_url parameter to document service
This commit is contained in:
parent
24d7a49a73
commit
d6ed8792cc
2 changed files with 17 additions and 15 deletions
|
|
@ -1531,6 +1531,7 @@ async def telecharger_documents_manquants(
|
||||||
logger.info(f"📥 {len(transactions)} document(s) à télécharger")
|
logger.info(f"📥 {len(transactions)} document(s) à télécharger")
|
||||||
|
|
||||||
document_service = UniversignDocumentService(
|
document_service = UniversignDocumentService(
|
||||||
|
api_url=settings.universign_api_url,
|
||||||
api_key=settings.universign_api_key, timeout=60
|
api_key=settings.universign_api_key, timeout=60
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
@ -1596,6 +1597,7 @@ async def nettoyer_anciens_documents(
|
||||||
"""
|
"""
|
||||||
try:
|
try:
|
||||||
document_service = UniversignDocumentService(
|
document_service = UniversignDocumentService(
|
||||||
|
api_url=settings.universign_api_url,
|
||||||
api_key=settings.universign_api_key
|
api_key=settings.universign_api_key
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -322,7 +322,6 @@ class UniversignSyncService:
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
logger.error(f"Erreur création signer {email}: {e}")
|
logger.error(f"Erreur création signer {email}: {e}")
|
||||||
|
|
||||||
|
|
||||||
async def sync_transaction(
|
async def sync_transaction(
|
||||||
self,
|
self,
|
||||||
session,
|
session,
|
||||||
|
|
@ -395,7 +394,9 @@ class UniversignSyncService:
|
||||||
except ValueError:
|
except ValueError:
|
||||||
logger.warning(f"⚠️ Statut Universign inconnu: {universign_status_raw}")
|
logger.warning(f"⚠️ Statut Universign inconnu: {universign_status_raw}")
|
||||||
if new_local_status == "SIGNE":
|
if new_local_status == "SIGNE":
|
||||||
transaction.universign_status = UniversignTransactionStatus.COMPLETED
|
transaction.universign_status = (
|
||||||
|
UniversignTransactionStatus.COMPLETED
|
||||||
|
)
|
||||||
elif new_local_status == "REFUSE":
|
elif new_local_status == "REFUSE":
|
||||||
transaction.universign_status = UniversignTransactionStatus.REFUSED
|
transaction.universign_status = UniversignTransactionStatus.REFUSED
|
||||||
elif new_local_status == "EXPIRE":
|
elif new_local_status == "EXPIRE":
|
||||||
|
|
@ -445,9 +446,7 @@ class UniversignSyncService:
|
||||||
download_success,
|
download_success,
|
||||||
download_error,
|
download_error,
|
||||||
) = await self.document_service.download_and_store_signed_document(
|
) = await self.document_service.download_and_store_signed_document(
|
||||||
session=session,
|
session=session, transaction=transaction, force=False
|
||||||
transaction=transaction,
|
|
||||||
force=False
|
|
||||||
)
|
)
|
||||||
|
|
||||||
if download_success:
|
if download_success:
|
||||||
|
|
@ -457,8 +456,7 @@ class UniversignSyncService:
|
||||||
|
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
logger.error(
|
logger.error(
|
||||||
f"❌ Erreur téléchargement document: {e}",
|
f"❌ Erreur téléchargement document: {e}", exc_info=True
|
||||||
exc_info=True
|
|
||||||
)
|
)
|
||||||
# === FIN SECTION CORRIGÉE ===
|
# === FIN SECTION CORRIGÉE ===
|
||||||
|
|
||||||
|
|
@ -496,7 +494,9 @@ class UniversignSyncService:
|
||||||
# Exécuter les actions post-changement
|
# Exécuter les actions post-changement
|
||||||
if status_changed:
|
if status_changed:
|
||||||
logger.info(f"🎬 Exécution actions pour statut: {new_local_status}")
|
logger.info(f"🎬 Exécution actions pour statut: {new_local_status}")
|
||||||
await self._execute_status_actions(session, transaction, new_local_status)
|
await self._execute_status_actions(
|
||||||
|
session, transaction, new_local_status
|
||||||
|
)
|
||||||
|
|
||||||
logger.info(
|
logger.info(
|
||||||
f"✅ Sync terminée: {transaction.transaction_id} | "
|
f"✅ Sync terminée: {transaction.transaction_id} | "
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue