Skip to content

IAV-1243/feat(integrations): Add expiresAt for WhatsApp/Instagram and validate existing platform IDs across IAVIA channels

salaheddine zidani a demandé de fusionner feature/IAV-1243 vers develop

Summary

Improves the createIntegration method with token expiration tracking for WhatsApp and Instagram channels, and adds a pre-creation check for duplicate platform IDs across all IAVIA channel integrations.


Changes

createIntegration — token expiration support

  • Added expiresAt field handling for WhatsApp and Instagram integrations
  • Token expiry is now stored and can be used to trigger refresh flows or surface warnings before credentials become invalid

IAVIA channels — duplicate platform ID check

  • Added a guard that verifies whether a platform ID already exists before attempting to create a new integration across all IAVIA channel types
  • Returns a clear error (or early exit) when a duplicate is detected, preventing silent overwrites or duplicate records

Testing

  • createIntegration stores expiresAt correctly for WhatsApp
  • createIntegration stores expiresAt correctly for Instagram
  • Attempting to create a duplicate platform ID on any IAVIA channel returns the expected error
  • Existing integrations are not affected by the new validation

Rapports de requête de fusion