Merge remote-tracking branch 'origin/feature/notification' into self-order+notification

# Conflicts:
#	go.mod
#	go.sum
#	internal/app/app.go
#	internal/router/router.go
This commit is contained in:
2026-05-10 12:23:16 +07:00
37 changed files with 3064 additions and 65 deletions
@@ -0,0 +1 @@
DROP TABLE IF EXISTS user_devices;
@@ -0,0 +1,22 @@
-- User devices table
CREATE TABLE user_devices (
id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
user_id UUID NOT NULL REFERENCES users(id) ON DELETE CASCADE,
device_id VARCHAR(255) NOT NULL,
device_name VARCHAR(255),
device_type VARCHAR(50) CHECK (device_type IN ('mobile', 'tablet', 'desktop')),
platform VARCHAR(50) CHECK (platform IN ('android', 'ios', 'web')),
fcm_token VARCHAR(512),
app_version VARCHAR(50),
os_version VARCHAR(50),
ip_address VARCHAR(45),
last_active_at TIMESTAMP WITH TIME ZONE,
created_at TIMESTAMP WITH TIME ZONE DEFAULT NOW(),
updated_at TIMESTAMP WITH TIME ZONE DEFAULT NOW()
);
-- Indexes
CREATE INDEX idx_user_devices_user_id ON user_devices(user_id);
CREATE INDEX idx_user_devices_device_id ON user_devices(device_id);
CREATE INDEX idx_user_devices_fcm_token ON user_devices(fcm_token);
CREATE UNIQUE INDEX idx_user_devices_user_device ON user_devices(user_id, device_id);