{"table_name":"lsm_clients","full_table_name":"wp_lsm_clients","description":"Stores lsm clients data created by this plugin.","detection_method":"static","confidence":"medium","create_sql":"CREATE TABLE IF NOT EXISTS `wp_lsm_clients` ( id bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, user_id bigint(20) UNSIGNED DEFAULT NULL, first_name varchar(100) NOT NULL, last_name varchar(100) NOT NULL, email varchar(100) NOT NULL, phone varchar(20) DEFAULT NULL, address text DEFAULT NULL, notes text DEFAULT NULL, status varchar(20) DEFAULT 'active', created_at datetime DEFAULT CURRENT_TIMESTAMP, updated_at datetime DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, PRIMARY KEY (id), KEY user_id (user_id), UNIQUE KEY email (email) ) $charset_collate;\"; // Cases Table $tables[] = \"CREATE TABLE IF NOT EXISTS `wp_lsm_cases` ( id bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, client_id bigint(20) UNSIGNED NOT NULL, case_number varchar(50) NOT NULL, title varchar(255) NOT NULL, description text DEFAULT NULL, priority varchar(20) DEFAULT 'medium', court_info text DEFAULT NULL, hearing_dates text DEFAULT NULL, financial_value decimal(15,2) DEFAULT 0.00, status varchar(20) DEFAULT 'open', assigned_lawyer_id bigint(20) UNSIGNED DEFAULT NULL, created_at datetime DEFAULT CURRENT_TIMESTAMP, updated_at datetime DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, PRIMARY KEY (id), KEY client_id (client_id), KEY assigned_lawyer_id (assigned_lawyer_id), UNIQUE KEY case_number (case_number) ) $charset_collate;\"; // Services Table $tables[] = \"CREATE TABLE IF NOT EXISTS `wp_lsm_services` ( id bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, name varchar(255) NOT NULL, description text DEFAULT NULL, base_price decimal(15,2) DEFAULT 0.00, duration int(11) DEFAULT 60, status varchar(20) DEFAULT 'active', created_at datetime DEFAULT CURRENT_TIMESTAMP, PRIMARY KEY (id) ) $charset_collate;\"; // Appointments Table $tables[] = \"CREATE TABLE IF NOT EXISTS `wp_lsm_appointments` ( id bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, client_id bigint(20) UNSIGNED NOT NULL, service_id bigint(20) UNSIGNED DEFAULT NULL, case_id bigint(20) UNSIGNED DEFAULT NULL, lawyer_id bigint(20) UNSIGNED NOT NULL, appointment_date datetime NOT NULL, duration int(11) NOT NULL, location_type varchar(20) DEFAULT 'in-person', location_details text DEFAULT NULL, notes text DEFAULT NULL, status varchar(20) DEFAULT 'scheduled', created_at datetime DEFAULT CURRENT_TIMESTAMP, updated_at datetime DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, PRIMARY KEY (id), KEY client_id (client_id), KEY lawyer_id (lawyer_id), KEY appointment_date (appointment_date) ) $charset_collate;\"; // Invoices Table $tables[] = \"CREATE TABLE IF NOT EXISTS `wp_lsm_invoices` ( id bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, client_id bigint(20) UNSIGNED NOT NULL, case_id bigint(20) UNSIGNED DEFAULT NULL, invoice_number varchar(50) NOT NULL, amount decimal(15,2) NOT NULL, tax decimal(15,2) DEFAULT 0.00, total decimal(15,2) NOT NULL, status varchar(20) DEFAULT 'unpaid', due_date date DEFAULT NULL, payment_method varchar(50) DEFAULT NULL, transaction_id varchar(100) DEFAULT NULL, created_at datetime DEFAULT CURRENT_TIMESTAMP, updated_at datetime DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, PRIMARY KEY (id), KEY client_id (client_id), UNIQUE KEY invoice_number (invoice_number) ) $charset_collate;\"; // Documents Table $tables[] = \"CREATE TABLE IF NOT EXISTS `wp_lsm_documents` ( id bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, client_id bigint(20) UNSIGNED DEFAULT NULL, case_id bigint(20) UNSIGNED DEFAULT NULL, title varchar(255) NOT NULL, file_path text NOT NULL, file_type varchar(50) DEFAULT NULL, template_id bigint(20) UNSIGNED DEFAULT NULL, created_at datetime DEFAULT CURRENT_TIMESTAMP, PRIMARY KEY (id), KEY client_id (client_id), KEY case_id (case_id) ) $charset_collate;\"; // Notifications Table $tables[] = \"CREATE TABLE IF NOT EXISTS `wp_lsm_notifications` ( id bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, user_id bigint(20) UNSIGNED NOT NULL, message text NOT NULL, type varchar(50) DEFAULT 'info', is_read tinyint(1) DEFAULT 0, created_at datetime DEFAULT CURRENT_TIMESTAMP, PRIMARY KEY (id), KEY user_id (user_id), KEY is_read (is_read) ) $charset_collate;\"; // Activity Logs Table $tables[] = \"CREATE TABLE IF NOT EXISTS `wp_lsm_activity_logs` ( id bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, user_id bigint(20) UNSIGNED DEFAULT NULL, action varchar(255) NOT NULL, object_type varchar(50) DEFAULT NULL, object_id bigint(20) UNSIGNED DEFAULT NULL, ip_address varchar(45) DEFAULT NULL, user_agent text DEFAULT NULL, created_at datetime DEFAULT CURRENT_TIMESTAMP, PRIMARY KEY (id), KEY user_id (user_id) ) $charset_collate;\"; // Sessions Table $tables[] = \"CREATE TABLE IF NOT EXISTS `wp_lsm_sessions` ( id bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, user_id bigint(20) UNSIGNED NOT NULL, session_token varchar(255) NOT NULL, ip_address varchar(45) DEFAULT NULL, last_activity datetime DEFAULT CURRENT_TIMESTAMP, expires_at datetime NOT NULL, PRIMARY KEY (id), UNIQUE KEY session_token (session_token), KEY user_id (user_id) ) $charset_collate;\"; foreach ($tables as $sql) { dbDelta($sql);","columns":[{"name":"id","type":"bigint(20) UNSIGNED","nullable":false,"primary_key":true},{"name":"user_id","type":"bigint(20) UNSIGNED","nullable":true,"primary_key":false},{"name":"first_name","type":"varchar(100)","nullable":false,"primary_key":false},{"name":"last_name","type":"varchar(100)","nullable":false,"primary_key":false},{"name":"email","type":"varchar(100)","nullable":false,"primary_key":false},{"name":"phone","type":"varchar(20)","nullable":true,"primary_key":false},{"name":"address","type":"text","nullable":true,"primary_key":false},{"name":"notes","type":"text","nullable":true,"primary_key":false},{"name":"status","type":"varchar(20)","nullable":true,"primary_key":false},{"name":"created_at","type":"datetime","nullable":true,"primary_key":false},{"name":"updated_at","type":"datetime","nullable":true,"primary_key":false},{"name":"client_id","type":"bigint(20) UNSIGNED","nullable":false,"primary_key":false},{"name":"case_number","type":"varchar(50)","nullable":false,"primary_key":false},{"name":"title","type":"varchar(255)","nullable":false,"primary_key":false},{"name":"description","type":"text","nullable":true,"primary_key":false},{"name":"priority","type":"varchar(20)","nullable":true,"primary_key":false},{"name":"court_info","type":"text","nullable":true,"primary_key":false},{"name":"hearing_dates","type":"text","nullable":true,"primary_key":false},{"name":"financial_value","type":"decimal(15,2)","nullable":true,"primary_key":false},{"name":"status","type":"varchar(20)","nullable":true,"primary_key":false},{"name":"assigned_lawyer_id","type":"bigint(20) UNSIGNED","nullable":true,"primary_key":false},{"name":"created_at","type":"datetime","nullable":true,"primary_key":false},{"name":"updated_at","type":"datetime","nullable":true,"primary_key":false},{"name":"name","type":"varchar(255)","nullable":false,"primary_key":false},{"name":"description","type":"text","nullable":true,"primary_key":false},{"name":"base_price","type":"decimal(15,2)","nullable":true,"primary_key":false},{"name":"duration","type":"int(11)","nullable":true,"primary_key":false},{"name":"status","type":"varchar(20)","nullable":true,"primary_key":false},{"name":"created_at","type":"datetime","nullable":true,"primary_key":false},{"name":"client_id","type":"bigint(20) UNSIGNED","nullable":false,"primary_key":false},{"name":"service_id","type":"bigint(20) UNSIGNED","nullable":true,"primary_key":false},{"name":"case_id","type":"bigint(20) UNSIGNED","nullable":true,"primary_key":false},{"name":"lawyer_id","type":"bigint(20) UNSIGNED","nullable":false,"primary_key":false},{"name":"appointment_date","type":"datetime","nullable":false,"primary_key":false},{"name":"duration","type":"int(11)","nullable":false,"primary_key":false},{"name":"location_type","type":"varchar(20)","nullable":true,"primary_key":false},{"name":"location_details","type":"text","nullable":true,"primary_key":false},{"name":"notes","type":"text","nullable":true,"primary_key":false},{"name":"status","type":"varchar(20)","nullable":true,"primary_key":false},{"name":"created_at","type":"datetime","nullable":true,"primary_key":false},{"name":"updated_at","type":"datetime","nullable":true,"primary_key":false},{"name":"client_id","type":"bigint(20) UNSIGNED","nullable":false,"primary_key":false},{"name":"case_id","type":"bigint(20) UNSIGNED","nullable":true,"primary_key":false},{"name":"invoice_number","type":"varchar(50)","nullable":false,"primary_key":false},{"name":"amount","type":"decimal(15,2)","nullable":false,"primary_key":false},{"name":"tax","type":"decimal(15,2)","nullable":true,"primary_key":false},{"name":"total","type":"decimal(15,2)","nullable":false,"primary_key":false},{"name":"status","type":"varchar(20)","nullable":true,"primary_key":false},{"name":"due_date","type":"date","nullable":true,"primary_key":false},{"name":"payment_method","type":"varchar(50)","nullable":true,"primary_key":false},{"name":"transaction_id","type":"varchar(100)","nullable":true,"primary_key":false},{"name":"created_at","type":"datetime","nullable":true,"primary_key":false},{"name":"updated_at","type":"datetime","nullable":true,"primary_key":false},{"name":"client_id","type":"bigint(20) UNSIGNED","nullable":true,"primary_key":false},{"name":"case_id","type":"bigint(20) UNSIGNED","nullable":true,"primary_key":false},{"name":"title","type":"varchar(255)","nullable":false,"primary_key":false},{"name":"file_path","type":"text","nullable":false,"primary_key":false},{"name":"file_type","type":"varchar(50)","nullable":true,"primary_key":false},{"name":"template_id","type":"bigint(20) UNSIGNED","nullable":true,"primary_key":false},{"name":"created_at","type":"datetime","nullable":true,"primary_key":false},{"name":"user_id","type":"bigint(20) UNSIGNED","nullable":false,"primary_key":false},{"name":"message","type":"text","nullable":false,"primary_key":false},{"name":"type","type":"varchar(50)","nullable":true,"primary_key":false},{"name":"is_read","type":"tinyint(1)","nullable":true,"primary_key":false},{"name":"created_at","type":"datetime","nullable":true,"primary_key":false},{"name":"user_id","type":"bigint(20) UNSIGNED","nullable":true,"primary_key":false},{"name":"action","type":"varchar(255)","nullable":false,"primary_key":false},{"name":"object_type","type":"varchar(50)","nullable":true,"primary_key":false},{"name":"object_id","type":"bigint(20) UNSIGNED","nullable":true,"primary_key":false},{"name":"ip_address","type":"varchar(45)","nullable":true,"primary_key":false},{"name":"user_agent","type":"text","nullable":true,"primary_key":false},{"name":"created_at","type":"datetime","nullable":true,"primary_key":false},{"name":"user_id","type":"bigint(20) UNSIGNED","nullable":false,"primary_key":false},{"name":"session_token","type":"varchar(255)","nullable":false,"primary_key":false},{"name":"ip_address","type":"varchar(45)","nullable":true,"primary_key":false},{"name":"last_activity","type":"datetime","nullable":true,"primary_key":false},{"name":"expires_at","type":"datetime","nullable":false,"primary_key":false}],"plugin":{"slug":"legal-services-management","name":"Legal Services Management","active_installs":0,"version":"2.0.0","wp_org_url":"https://wordpress.org/plugins/legal-services-management/"}}