Skip to content

Architecture: CRM — Telephony #699

Description

@curtisdelicata

Implementation epic

Deliver the Telephony capability in the CRM application repository as an independently owned, testable module. The domain specification remains authoritative for business behavior; API, Filament 5, and Livewire 4 are one-to-one presentation packages and must not move business rules into presentation code.

Source specifications

Specification details

Domain

CRM: Telephony

Canonical independent module specification

Domain module: crm-telephony
Application: CRM
Capability group: Communications and contact-center modules
Source scope: CRM.md
Architecture: MODULES.md · TESTING.md · API.md · FILAMENT.md · LIVEWIRE.md

1. Purpose

The Telephony module owns Numbers, caller ID, IVR, queues, business hours, skills, recording, voicemail, transfers, dispositions, click-to-call, call logging, and provider adapters. It is the authoritative boundary for this capability and must remain independently installable, testable, versioned, enabled, and reusable across compatible Liberu applications.

2. Full feature scope

  • Numbers: implement the complete lifecycle, validation, permissions, failure handling, audit evidence, and operator/user feedback required by this capability.
  • Caller ID: implement the complete lifecycle, validation, permissions, failure handling, audit evidence, and operator/user feedback required by this capability.
  • IVR: implement the complete lifecycle, validation, permissions, failure handling, audit evidence, and operator/user feedback required by this capability.
  • Queues: implement the complete lifecycle, validation, permissions, failure handling, audit evidence, and operator/user feedback required by this capability.
  • Business hours: implement the complete lifecycle, validation, permissions, failure handling, audit evidence, and operator/user feedback required by this capability.
  • Skills: implement the complete lifecycle, validation, permissions, failure handling, audit evidence, and operator/user feedback required by this capability.
  • Recording: implement the complete lifecycle, validation, permissions, failure handling, audit evidence, and operator/user feedback required by this capability.
  • Voicemail: implement the complete lifecycle, validation, permissions, failure handling, audit evidence, and operator/user feedback required by this capability.
  • Transfers: implement the complete lifecycle, validation, permissions, failure handling, audit evidence, and operator/user feedback required by this capability.
  • Dispositions: implement the complete lifecycle, validation, permissions, failure handling, audit evidence, and operator/user feedback required by this capability.
  • Click-to-call: implement the complete lifecycle, validation, permissions, failure handling, audit evidence, and operator/user feedback required by this capability.
  • Call logging: implement the complete lifecycle, validation, permissions, failure handling, audit evidence, and operator/user feedback required by this capability.
  • Provider adapters: implement the complete lifecycle, validation, permissions, failure handling, audit evidence, and operator/user feedback required by this capability.

3. Ownership and boundaries

  • Own the capability's domain rules, policies, actions, queries, events, persistence, migrations, configuration, audit semantics, and failure recovery.
  • Expose stable contracts, immutable DTOs/read models, commands, queries, and past-tense domain events where other modules have a legitimate integration need.
  • Consume identity, organizations/teams, authorization, settings, files, notifications, queues, localization, currency, and observability from the shared foundation rather than duplicating them.
  • Never depend on an application's App\ classes, another module's private tables/models, a provider SDK in provider-neutral code, or an optional presentation framework.
  • Keep Filament, Livewire, and HTTP API logic in matching one-to-one presentation packages when those surfaces are required.

4. Implementation strategy

Domain model

API contract

CRM: Telephony API

Canonical one-to-one API module specification

API package: module-crm-telephony-api
Matching domain module: crm-telephony
Application: CRM
Source feature: Telephony
Architecture: API.md · MODULES.md · TESTING.md

1. Purpose and ownership

This optional API presentation package exposes approved HTTP operations for the Telephony domain module. It presents exactly one independent module, delegates all authoritative behavior to that module's public actions/queries/policies, and contains no other module's API logic.

The domain capability includes:

  • Numbers
  • caller ID
  • IVR
  • queues
  • business hours
  • skills
  • recording
  • voicemail
  • transfers
  • dispositions
  • click-to-call
  • call logging
  • provider adapters

Filament surface

CRM: Telephony Filament

Canonical one-to-one Filament 5 implementation

Filament package: module-crm-telephony-filament
Matching domain module: crm-telephony
Application: CRM
Source feature: Telephony
Architecture: FILAMENT.md · MODULES.md · TESTING.md

1. Purpose and ownership

This optional Filament 5 presentation package presents exactly one independent domain module. It contributes reusable resources, pages, widgets, schemas, tables, infolists, and actions to application-owned panels while delegating authorization, validation, tenancy, persistence, and business rules to the crm-telephony public boundary. It must not contain another module's UI or depend on application App\ classes.

2. Module-specific surfaces

  • Numbers: resource/table/form/action or page behavior for this module's authorized workflow.
  • Caller ID: resource/table/form/action or page behavior for this module's authorized workflow.
  • IVR: resource/table/form/action or page behavior for this module's authorized workflow.
  • Queues: resource/table/form/action or page behavior for this module's authorized workflow.
  • Business hours: resource/table/form/action or page behavior for this module's authorized workflow.
  • Skills: resource/table/form/action or page behavior for this module's authorized workflow.
  • Recording: resource/table/form/action or page behavior for this module's authorized workflow.
  • Voicemail: resource/table/form/action or page behavior for this module's authorized workflow.
  • Transfers: resource/table/form/action or page behavior for this module's authorized workflow.
  • Dispositions: resource/table/form/action or page behavior for this module's authorized workflow.
  • Click-to-call: resource/table/form/action or page behavior for this module's authorized workflow.
  • Call logging: resource/table/form/action or page behavior for this module's authorized workflow.
  • Provider adapters: resource/table/form/action or page behavior for this module's authorized workflow.

Livewire surface

CRM: Telephony Livewire

Canonical one-to-one Livewire 4 implementation

Livewire package: module-crm-telephony-livewire
Matching domain module: crm-telephony
Application: CRM
Source feature: Telephony
Architecture: LIVEWIRE.md · MODULES.md · TESTING.md

1. Purpose and ownership

This optional Livewire 4 presentation package provides interactive server-driven components for exactly one independent domain module. Components coordinate public queries/actions and presentation state; they do not own persistence, authorization decisions, tenancy, business rules, or theme identity. The package has no dependency on application App\ classes or another module's internals.

2. Module-specific interactions

  • Numbers: interactive component state, validation feedback, loading, and failure recovery for this domain capability.
  • Caller ID: interactive component state, validation feedback, loading, and failure recovery for this domain capability.
  • IVR: interactive component state, validation feedback, loading, and failure recovery for this domain capability.
  • Queues: interactive component state, validation feedback, loading, and failure recovery for this domain capability.
  • Business hours: interactive component state, validation feedback, loading, and failure recovery for this domain capability.
  • Skills: interactive component state, validation feedback, loading, and failure recovery for this domain capability.
  • Recording: interactive component state, validation feedback, loading, and failure recovery for this domain capability.
  • Voicemail: interactive component state, validation feedback, loading, and failure recovery for this domain capability.
  • Transfers: interactive component state, validation feedback, loading, and failure recovery for this domain capability.
  • Dispositions: interactive component state, validation feedback, loading, and failure recovery for this domain capability.
  • Click-to-call: interactive component state, validation feedback, loading, and failure recovery for this domain capability.
  • Call logging: interactive component state, validation feedback, loading, and failure recovery for this domain capability.
  • Provider adapters: interactive component state, validation feedback, loading, and failure recovery for this domain capability.

Acceptance criteria

  • Domain ownership, boundaries, data lifecycle, permissions, tenancy, events, failure recovery, telemetry, and migrations match the domain specification.
  • API routes/operations/events, versioning, authentication, authorization scopes, validation, idempotency, errors, pagination, rate limits, and observability match the API specification.
  • Filament package identity, panel/resource/page/widget inventory, authorization, tenancy, navigation, theme integration, accessibility, and cache/discovery behavior match the Filament specification.
  • Livewire package identity, aliases, component inventory, state/actions/events, loading/failure states, authorization, tenancy, accessibility, and lifecycle behavior match the Livewire specification.
  • Unit, feature, contract, architecture, security, compatibility, migration/upgrade, and presentation tests cover allowed, denied, invalid, duplicate, concurrent, wrong-tenant, partial-failure, and recovery paths as applicable.
  • README, changelog, runbook, API/presentation documentation, release notes, and adoption/upgrade guidance are complete.

Explicit exclusions

Do not implement unrelated independent modules, application App namespace coupling inside reusable packages, private cross-module table/model access, provider SDK leakage into provider-neutral code, or business authorization solely in UI/API presentation layers.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions