### 23APR26

Based on what's been built and what remains:

Immediate (blocking)

Run migrations — all 5 new migration files haven't been run yet: integration tables + allow_vilogi_webhook column on service_providers
Run feature tests — tests/Feature/IntegrationReadingTest.php was written but never executed; confirms the integration API works end-to-end
Security
3. Encrypt Vilogi API key at rest — vilogi_configs.api_key is stored plaintext. Add 'api_key' => 'encrypted' to VilogiConfig::$casts (Laravel handles the rest automatically)

Minor gaps
4. PDF orphan on queue-level failure — SyncToVilogiJob::failed() only logs; if Laravel's queue exhausts attempts before the job's own retry logic does, the PDF is never deleted. Add cleanupPdfFile() there too
5. Retry backoff off-by-one — in handleException(), markAsFailed() increments retry_count before $this->backoff[$journalEntry->retry_count - 1] is read, so the index may be one ahead of intended. Worth verifying against markAsFailed()'s implementation

If not done yet
6. Superadmin UI wiring — the token management endpoints (GET/POST/DELETE /api/v1/superadmin/integration-tokens) need to be connected to the frontend
7. Queue worker setup — php artisan queue:work --queue=vilogi needs to be running in production for SyncToVilogiJob to process

The superadmin UI will need endpoints to manage vilogi_contreparties and to set vilogi_identifiant_copropriete on sites.

Want me to start on any of these?

### To fetch Identifiant coproprietaire use:
curl -X GET "https://copro.vilogi.com/rest/coproLot?token=dnT05OPoV_ApEB97KaPdiZfofqcMrIQI&copro=69509" -H  "accept: application/json"

