mirror of
https://github.com/FranP-code/inbox-negotiator.git
synced 2025-10-13 00:42:26 +00:00
Enables users to approve and send negotiation emails directly via Postmark after configuring a server token in settings. Introduces new debt statuses ("approved", "sent"), UI for token management, and approval/rejection flows. Refactors notifications to use a modern toast library, adjusts dashboard status filters, and updates DB schema for new flows.
Empowers compliant, user-controlled negotiation and automated email delivery.
19 lines
736 B
SQL
19 lines
736 B
SQL
-- Add postmark_server_token to user_profiles table
|
|
ALTER TABLE user_profiles
|
|
ADD COLUMN IF NOT EXISTS postmark_server_token TEXT;
|
|
|
|
-- Update debts table status constraint to include 'sent'
|
|
ALTER TABLE debts
|
|
DROP CONSTRAINT IF EXISTS debts_status_check;
|
|
|
|
ALTER TABLE debts
|
|
ADD CONSTRAINT debts_status_check
|
|
CHECK (status IN ('received', 'negotiating', 'sent', 'settled', 'failed', 'opted_out'));
|
|
|
|
-- Create index on postmark_server_token for faster lookups
|
|
CREATE INDEX IF NOT EXISTS idx_user_profiles_postmark_token
|
|
ON user_profiles(user_id) WHERE postmark_server_token IS NOT NULL;
|
|
|
|
-- Add comment for documentation
|
|
COMMENT ON COLUMN user_profiles.postmark_server_token IS 'Postmark server token for sending negotiation emails';
|