feat: Add Advoware History and Watcher services for document synchronization
- Implement AdvowareHistoryService for fetching and creating history entries. - Implement AdvowareWatcherService for file operations including listing, downloading, and uploading with Blake3 hash verification. - Introduce Blake3 utility functions for hash computation and verification. - Create document sync cron step to poll Redis for pending Aktennummern and emit sync events. - Develop document sync event handler to manage 3-way merge synchronization for Akten, including metadata updates and error handling.
This commit is contained in:
@@ -127,3 +127,35 @@ class AdvowareService:
|
||||
# Expected: 403 Forbidden
|
||||
self._log(f"[ADVO] DELETE not allowed (expected): {e}", level='warning')
|
||||
return False
|
||||
|
||||
# ========== AKTEN ==========
|
||||
|
||||
async def get_akte(self, akte_id: int) -> Optional[Dict[str, Any]]:
|
||||
"""
|
||||
Get Akte details including ablage status.
|
||||
|
||||
Args:
|
||||
akte_id: Advoware Akte ID
|
||||
|
||||
Returns:
|
||||
Akte details with fields:
|
||||
- ablage: int (0 or 1, archive status)
|
||||
- az: str (Aktenzeichen)
|
||||
- rubrum: str
|
||||
- referat: str
|
||||
- wegen: str
|
||||
|
||||
Returns None if Akte not found
|
||||
"""
|
||||
try:
|
||||
endpoint = f"api/v1/advonet/Akten/{akte_id}"
|
||||
result = await self.api.api_call(endpoint, method='GET')
|
||||
|
||||
if result:
|
||||
self._log(f"[ADVO] ✅ Fetched Akte {akte_id}: {result.get('az', 'N/A')}")
|
||||
|
||||
return result
|
||||
|
||||
except Exception as e:
|
||||
self._log(f"[ADVO] Error loading Akte {akte_id}: {e}", level='error')
|
||||
return None
|
||||
|
||||
Reference in New Issue
Block a user