Skip to content

help wanted: property-scoped SMS/WhatsApp credentials (multi-property hotel groups) #307

Description

@telivity-otaip

Why hotels care

Independent groups and soft brands run many properties under one HAIP deploy. Front desk SMS, confirmation WhatsApp, and marketing templates must bill / brand / opt-in per hotel — not one global Twilio account shared by every property on the box.

Today Twilio credentials are env-global (docs/channels/whatsapp.md explicitly: "Env-global Twilio credentials (not yet property-scoped)"). That blocks real multi-property ops and is a GDPR / consent risk if property A’s guest gets property B’s sender ID.

Current state (code anchors)

  • apps/api/src/modules/notifications/SmsProvider / WhatsApp provider interfaces
  • docs/channels/whatsapp.md — Twilio Content API path; notes env-global gap
  • Guest marketing gate: gdprConsentMarketing (already property-aware at guest level)
  • Multi-tenancy rule: every property-scoped table/query must filter propertyId

What we need

  1. Per-property messaging credentials store (encrypted at rest — follow migration credential vault patterns if present)
  2. Provider resolution: propertyId → credentials → Twilio SMS / WhatsApp adapter (env-global only as fallback for single-property demos)
  3. Admin/API to set/rotate/test credentials without restarting the API
  4. Audit log on credential create/rotate/delete (never log secrets)
  5. Tests: property A cannot send using property B’s sender; missing creds → clear error, not silent console success in prod

Open questions (operators — please comment)

  • Do you need different WhatsApp Business numbers per property, or one WABA with per-property templates?
  • Should marketing vs transactional senders be separable per property?
  • Who may rotate credentials — admin only, or a new messaging.manage permission?

Out of scope

  • Inventing Meta/WhatsApp Cloud API contracts beyond what docs/channels/whatsapp.md already locks
  • Two-way inbound chatbot product (Phase 2 in that doc)

Acceptance criteria

  • Property-scoped send path for SMS + WhatsApp templates
  • Demo/single-property still works with env vars
  • Cross-property credential use is impossible
  • Rotate/test endpoints + dashboard settings surface (or documented API if UI later)
  • Tests + docs update in docs/channels/whatsapp.md

How to contribute

Great for NestJS + multi-tenant config folks, or hotel IT who already manage per-property Twilio subaccounts.

Comment to claim a slice: (A) schema + encryption, (B) provider resolution, (C) admin API/UI, (D) tests/docs.

Search keywords: Twilio, WhatsApp, multi-property, per-property credentials, SMS, GDPR consent, hotel group PMS

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requesthardeningPost-v1.0 production hardeninghelp wantedExtra attention is needed

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions