-- Add username, password, and last_login columns to the receivers table for login functionality.

ALTER TABLE `receivers`
ADD COLUMN `username` VARCHAR(50) NOT NULL UNIQUE AFTER `hotel_id`,
ADD COLUMN `password` VARCHAR(255) NOT NULL AFTER `username`,
ADD COLUMN `last_login` DATETIME NULL DEFAULT NULL AFTER `last_seen`;

-- Example: Add a new receiver with a hashed password (password is 'password123')
-- You must run this or a similar query to add a user that can log in.
-- INSERT INTO receivers (hotel_id, username, password, peer_id) VALUES (1, 'receiver1', '$2y$10$examplehash...', 'some-peer-id');
