CREATE TABLE users (
    id INT AUTO_INCREMENT PRIMARY KEY,
    full_name VARCHAR(255) NOT NULL,
    email VARCHAR(255) UNIQUE NOT NULL,
    password VARCHAR(255) NOT NULL,
    phone_number VARCHAR(20)
);

CREATE TABLE packages (
    id INT AUTO_INCREMENT PRIMARY KEY,
    tracking_number VARCHAR(50) UNIQUE NOT NULL,
    receiver_name VARCHAR(255) NOT NULL,
    receiver_address VARCHAR(255) NOT NULL,
    receiver_email VARCHAR(255),
    receiver_phone VARCHAR(20),
    sender_name VARCHAR(255) NOT NULL,
    sender_address VARCHAR(255),
    sender_phone VARCHAR(20),
    package_weight DECIMAL(10, 2),
    status VARCHAR(50),
    service_type VARCHAR(50),
    delivery_mode VARCHAR(50),
    delivery_completion INT,
    origin VARCHAR(255),
    destination VARCHAR(255),
    pickup_date DATETIME,
    departure_date DATETIME,
    expected_delivery_date DATETIME,
    current_location VARCHAR(255),
    location_latitude DECIMAL(10, 6),
    location_longitude DECIMAL(10, 6),
    arrival_country VARCHAR(255),
    arrival_date DATETIME,
    comments TEXT
);

CREATE TABLE admin (
    id INT AUTO_INCREMENT PRIMARY KEY,
    username VARCHAR(255) UNIQUE NOT NULL,
    password VARCHAR(255) NOT NULL,
    email VARCHAR(255) NOT NULL
);