Commit Graph

58 Commits

Author SHA1 Message Date
bsiggel
b0fceef4e2 fix: Update sync mode logging to clarify Blake3 hash verification status 2026-03-12 23:09:21 +00:00
bsiggel
e727582584 fix: Update JunctionData URL construction to use API Gateway instead of direct EspoCRM endpoint 2026-03-12 23:07:33 +00:00
bsiggel
2292fd4762 feat: Enhance document synchronization logic to continue syncing after collection activation 2026-03-12 23:06:40 +00:00
bsiggel
9ada48d8c8 fix: Update collection ID retrieval logic and simplify error logging in AI Knowledge sync event handler 2026-03-12 23:04:01 +00:00
bsiggel
9a3e01d447 fix: Correct logging method from warning to warn for lock acquisition in AI Knowledge sync handler 2026-03-12 23:00:08 +00:00
bsiggel
e945333c1a feat: Update activation status references to 'aktivierungsstatus' for consistency across AI Knowledge sync utilities 2026-03-12 22:53:47 +00:00
bsiggel
6f7f847939 feat: Enhance AI Knowledge Update webhook handler to validate payload structure and handle empty lists 2026-03-12 22:51:44 +00:00
bsiggel
46c0bbf381 feat: Refactor AI Knowledge sync processes to remove full sync parameter and ensure Blake3 verification is always performed 2026-03-12 22:41:19 +00:00
bsiggel
8f1533337c feat: Enhance AI Knowledge sync process with full sync mode and attachment handling 2026-03-12 22:35:48 +00:00
bsiggel
6bf2343a12 feat: Enhance document synchronization by integrating CAIKnowledge handling and improving error logging 2026-03-12 22:30:11 +00:00
bsiggel
8ed7cca432 feat: Add logging utility for calendar sync operations and enhance error handling 2026-03-12 19:26:04 +00:00
bsiggel
9bbfa61b3b feat: Implement AI Knowledge Sync Utilities and Event Handlers
- Added AIKnowledgeActivationStatus and AIKnowledgeSyncStatus enums to models.py for managing activation and sync states.
- Introduced AIKnowledgeSync class in aiknowledge_sync_utils.py for synchronizing CAIKnowledge entities with XAI Collections, including collection lifecycle management, document synchronization, and metadata updates.
- Created a daily cron job (aiknowledge_full_sync_cron_step.py) to perform a full sync of CAIKnowledge entities.
- Developed an event handler (aiknowledge_sync_event_step.py) to synchronize CAIKnowledge entities with XAI Collections triggered by webhooks and cron jobs.
- Implemented a webhook handler (aiknowledge_update_api_step.py) to receive updates from EspoCRM for CAIKnowledge entities and enqueue sync events.
- Enhanced xai_service.py with methods for collection management, document listing, and metadata updates.
2026-03-11 21:14:52 +00:00
bsiggel
a5a122b688 refactor(logging): enhance error handling and resource management in rate limiting and sync operations 2026-03-08 22:47:05 +00:00
bsiggel
6c3cf3ca91 refactor(logging): remove unused logger instances and enhance error logging in webhook steps 2026-03-08 22:21:08 +00:00
bsiggel
1c765d1eec refactor(logging): standardize status code handling and enhance logging in webhook and cron handlers 2026-03-08 22:09:22 +00:00
bsiggel
a0cf845877 Refactor and enhance logging in webhook handlers and Redis client
- Translated comments and docstrings from German to English for better clarity.
- Improved logging consistency across various webhook handlers for create, delete, and update operations.
- Centralized logging functionality by utilizing a dedicated logger utility.
- Added new enums for file and XAI sync statuses in models.
- Updated Redis client factory to use a centralized logger and improved error handling.
- Enhanced API responses to include more descriptive messages and status codes.
2026-03-08 21:50:34 +00:00
bsiggel
f392ec0f06 refactor(typing): update handler signatures to use Dict and Any for improved type hinting 2026-03-08 21:24:12 +00:00
bsiggel
2532bd89ee refactor(logging): standardize logging approach across services and steps 2026-03-08 21:20:49 +00:00
bsiggel
2e449d2928 docs: enhance error handling and locking strategies in document synchronization 2026-03-08 20:58:58 +00:00
bsiggel
fd0196ec31 docs: add guidelines for Steps vs. Utils architecture and decision matrix 2026-03-08 20:30:33 +00:00
bsiggel
d71b5665b6 docs: update Design Principles section with enhanced lock strategy and event handling guidelines 2026-03-08 20:28:57 +00:00
bsiggel
d69801ed97 docs: expand Design Principles section with detailed guidelines and examples for event handling and locking strategies 2026-03-08 20:18:18 +00:00
bsiggel
6e2303c5eb feat(docs): add Design Principles section with Event Storm and Bidirectional Reference patterns 2026-03-08 20:09:32 +00:00
bsiggel
93d4d89531 feat(document-sync): update xaiSyncStatus handling and logging for document synchronization 2026-03-08 19:21:17 +00:00
bsiggel
4ed752b19e feat(document-sync): enhance metadata update to reset file status after preview generation 2026-03-08 18:59:56 +00:00
bsiggel
ba657ecd3b docs: update troubleshooting section with service restart instructions and log checking commands 2026-03-08 18:49:45 +00:00
bsiggel
9e7e163933 docs: add production and manual start instructions for system services 2026-03-08 18:49:08 +00:00
bsiggel
82b48eee8e fix(api-steps): update response status field in document create, delete, and update handlers 2026-03-08 18:48:56 +00:00
bsiggel
7fd6eed86d feat(sync-utils): add logging delegation method to BaseSyncUtils 2026-03-08 18:38:48 +00:00
bsiggel
91ae2947e5 feat(xai-service): implement xAI Files & Collections service for document synchronization 2026-03-08 18:31:29 +00:00
bsiggel
6f7d62293e feat(espocrm): add logging method to EspoCRMAPI for improved message handling
fix(calendar_sync): correct cron expression for calendar sync job
2026-03-08 17:58:10 +00:00
bsiggel
d7b2b5543f feat(espocrm): add caching for entity definitions and implement related entity listing 2026-03-08 17:51:36 +00:00
bsiggel
a53051ea8e feat(api-client): implement session management for AdvowareAPI and EspoCRMAPI 2026-03-03 17:24:35 +00:00
bsiggel
69a48f5f9a Implement central configuration, custom exceptions, logging utilities, Pydantic models, and Redis client for BitByLaw integration
- Added `config.py` for centralized configuration management including Sync, API, Advoware, EspoCRM, Redis, Logging, Calendar Sync, and Feature Flags.
- Created `exceptions.py` with a hierarchy of custom exceptions for integration errors, API errors, sync errors, and Redis errors.
- Developed `logging_utils.py` for a unified logging wrapper supporting structured logging and performance tracking.
- Defined Pydantic models in `models.py` for data validation of Advoware and EspoCRM entities, including sync operation models.
- Introduced `redis_client.py` for a centralized Redis client factory with connection pooling, automatic reconnection, and health checks.
2026-03-03 17:18:49 +00:00
bsiggel
bcb6454b2a Add comprehensive test scripts for thumbnail generation and xAI collections API
- Implemented `test_thumbnail_generation.py` to validate the complete flow of document thumbnail generation in EspoCRM, including document creation, file upload, webhook triggering, and preview verification.
- Created `test_xai_collections_api.py` to test critical operations of the xAI Collections API, covering file uploads, collection CRUD operations, document management, and response validation.
- Both scripts include detailed logging for success and error states, ensuring robust testing and easier debugging.
2026-03-03 17:03:08 +00:00
bsiggel
c45bfb7233 Enhance EspoCRM API and Webhook Handling
- Improved logging for file uploads in EspoCRMAPI to include upload parameters and error details.
- Updated cron job configurations for calendar sync and participant sync to trigger every 15 minutes on the first minute of the hour.
- Enhanced document create, delete, and update webhook handlers to determine and log the entity type.
- Refactored document sync event handler to include entity type in sync operations and logging.
- Added a new test script for uploading preview images to EspoCRM and verifying the upload process.
- Created a test script for document thumbnail generation, including document creation, file upload, webhook triggering, and preview verification.
2026-03-03 16:53:55 +00:00
bsiggel
0e521f22f8 feat(preview-generation): implement thumbnail generation for documents; add preview upload to EspoCRM 2026-03-03 09:28:49 +00:00
bsiggel
70265c9adf feat(document-sync): enhance DocumentSync with file status checks and hash-based change detection; add thumbnail generation and metadata update methods 2026-03-03 09:15:02 +00:00
bsiggel
ee9aab049f feat(document-sync): add Document Sync Utilities and VMH Document Sync Handler for xAI integration 2026-03-03 06:55:54 +00:00
bsiggel
cb0e170ee9 feat(webhooks): update EspoCRM webhook configurations to use VMH naming and endpoints 2026-03-02 17:34:17 +00:00
bsiggel
bc917bd885 feat(webhooks): add EspoCRM Document Delete and Update webhook handlers with detailed logging
- Implemented document delete webhook handler to process delete notifications from EspoCRM.
- Added detailed logging for incoming payloads, including headers and entity information.
- Extracted and emitted document IDs for further processing.
- Implemented document update webhook handler to handle update notifications from EspoCRM.
- Enhanced logging for update payloads, including changed fields and metadata.
- Both handlers emit events for queue processing to facilitate further actions.

test: add comprehensive xAI Collections API test suite

- Created a test suite for xAI Collections API covering critical operations.
- Included tests for file uploads, CRUD operations on collections and documents, and response structures.
- Verified shared file behavior across multiple collections.
- Implemented cleanup procedures to remove test resources after execution.
2026-03-02 17:16:07 +00:00
bsiggel
0282149613 Fix cron expression in Calendar Sync Cron Job to trigger at second 0 and update entity retrieval methods in Beteiligte Sync steps for consistency 2026-03-02 09:36:09 +00:00
bsiggel
0740952063 Fix cron expression in Calendar Sync Cron Job to trigger every 15 minutes 2026-03-01 23:47:36 +00:00
bsiggel
f1ac5ffc7e Update cron description in Calendar Sync Cron Job for clarity 2026-03-01 23:46:51 +00:00
bsiggel
5c204ba16c Add api_call method to AdvowareService for delegating API calls 2026-03-01 23:40:50 +00:00
bsiggel
721339ca9b Update flow names for Advoware and VMH steps to improve clarity and organization 2026-03-01 23:28:29 +00:00
bsiggel
dc586385df Refactor logging in log_operation to support context-based logging and fallback to standard logger 2026-03-01 23:15:14 +00:00
bsiggel
0b8da01b71 Update README and add detailed documentation for Advoware integration and calendar sync 2026-03-01 23:03:01 +00:00
bsiggel
52356e634e Add calendar sync utilities and Beteiligte sync cron job
- Implemented calendar_sync_utils.py for shared utility functions
  including DB connection, Google Calendar service initialization,
  Redis client setup, and employee sync operations.

- Created beteiligte_sync_cron_step.py to handle periodic sync
  of Beteiligte entities, checking for new, modified, failed,
  and stale records, and emitting sync events accordingly.
2026-03-01 22:55:17 +00:00
bsiggel
17f908d036 Add requests dependency to project
- Included 'requests' in the dependencies list of uv.lock.
- Specified minimum version of 'requests' as 2.32.0 in requires-dist.
2026-03-01 22:39:33 +00:00