- Implement SmsService class for sending SMS via CPSMS API. - Add SMS sending functionality in the frontend with validation and user feedback. - Create database migrations for SMS message storage and telephony features. - Introduce telephony settings and user-specific configurations for click-to-call functionality. - Enhance user experience with toast notifications for incoming calls and actions.
17 lines
683 B
SQL
17 lines
683 B
SQL
-- Store SMS events linked to contacts for unified contact communication history
|
|
|
|
CREATE TABLE IF NOT EXISTS sms_messages (
|
|
id SERIAL PRIMARY KEY,
|
|
kontakt_id INTEGER NOT NULL REFERENCES contacts(id) ON DELETE CASCADE,
|
|
bruger_id INTEGER REFERENCES users(user_id) ON DELETE SET NULL,
|
|
recipient VARCHAR(64) NOT NULL,
|
|
sender VARCHAR(64),
|
|
message TEXT NOT NULL,
|
|
status VARCHAR(16) NOT NULL DEFAULT 'sent',
|
|
provider_response JSONB,
|
|
created_at TIMESTAMP NOT NULL DEFAULT NOW()
|
|
);
|
|
|
|
CREATE INDEX IF NOT EXISTS idx_sms_messages_kontakt_id ON sms_messages(kontakt_id);
|
|
CREATE INDEX IF NOT EXISTS idx_sms_messages_created_at ON sms_messages(created_at DESC);
|