-
Dashboard
-
Manage dashboard here.
+
+
+
+
+
Total Orders
+
total_orders; ?>
+
+
+
+
+
+
+
Active Deliveries
+
active_deliveries; ?>
+
+
+
+
+
+
+
Available Drivers
+
available_drivers; ?>
+
+
+
+
+
+
+
Total Drivers
+
total_drivers; ?>
+
+
+
+
+
+
+
Total Warehouses
+
total_warehouses; ?>
+
+
+
+
+
+
+
Today's Revenue
+
today_revenue, 2); ?>
+
+
diff --git a/source/packages/com_mokosuitelogistics/admin/tmpl/orders/default.php b/source/packages/com_mokosuitelogistics/admin/tmpl/orders/default.php
new file mode 100644
index 0000000..a474a20
--- /dev/null
+++ b/source/packages/com_mokosuitelogistics/admin/tmpl/orders/default.php
@@ -0,0 +1,68 @@
+
+ * SPDX-License-Identifier: GPL-3.0-or-later
+ * Authored-by: Moko Consulting
+ */
+
+defined('_JEXEC') or die;
+
+use Joomla\CMS\HTML\HTMLHelper;
+use Joomla\CMS\Router\Route;
+
+$listOrder = $this->escape($this->state->get('list.ordering'));
+$listDirn = $this->escape($this->state->get('list.direction'));
+
+$statusBadges = [
+ 'pending' => 'secondary',
+ 'confirmed' => 'info',
+ 'assigned' => 'warning',
+ 'picked_up' => 'primary',
+ 'in_transit' => 'primary',
+ 'delivered' => 'success',
+ 'failed' => 'danger',
+ 'cancelled' => 'danger',
+ 'returned' => 'dark',
+];
+?>
+
diff --git a/source/packages/com_mokosuitelogistics/admin/tmpl/pricingrules/default.php b/source/packages/com_mokosuitelogistics/admin/tmpl/pricingrules/default.php
new file mode 100644
index 0000000..8a8aac7
--- /dev/null
+++ b/source/packages/com_mokosuitelogistics/admin/tmpl/pricingrules/default.php
@@ -0,0 +1,14 @@
+
+ * SPDX-License-Identifier: GPL-3.0-or-later
+ * Authored-by: Moko Consulting
+ */
+
+defined('_JEXEC') or die;
+?>
+
+
Pricing Rules
+
Coming soon.
+
diff --git a/source/packages/com_mokosuitelogistics/admin/tmpl/proofs/default.php b/source/packages/com_mokosuitelogistics/admin/tmpl/proofs/default.php
new file mode 100644
index 0000000..8d0b1cd
--- /dev/null
+++ b/source/packages/com_mokosuitelogistics/admin/tmpl/proofs/default.php
@@ -0,0 +1,14 @@
+
+ * SPDX-License-Identifier: GPL-3.0-or-later
+ * Authored-by: Moko Consulting
+ */
+
+defined('_JEXEC') or die;
+?>
+
+
Proof of Delivery
+
Coming soon.
+
diff --git a/source/packages/com_mokosuitelogistics/admin/tmpl/routes/default.php b/source/packages/com_mokosuitelogistics/admin/tmpl/routes/default.php
new file mode 100644
index 0000000..93929b7
--- /dev/null
+++ b/source/packages/com_mokosuitelogistics/admin/tmpl/routes/default.php
@@ -0,0 +1,14 @@
+
+ * SPDX-License-Identifier: GPL-3.0-or-later
+ * Authored-by: Moko Consulting
+ */
+
+defined('_JEXEC') or die;
+?>
+
+
Routes
+
Coming soon.
+
diff --git a/source/packages/com_mokosuitelogistics/admin/tmpl/warehouses/default.php b/source/packages/com_mokosuitelogistics/admin/tmpl/warehouses/default.php
new file mode 100644
index 0000000..44c55ed
--- /dev/null
+++ b/source/packages/com_mokosuitelogistics/admin/tmpl/warehouses/default.php
@@ -0,0 +1,14 @@
+
+ * SPDX-License-Identifier: GPL-3.0-or-later
+ * Authored-by: Moko Consulting
+ */
+
+defined('_JEXEC') or die;
+?>
+
+
Warehouses
+
Coming soon.
+
diff --git a/source/packages/com_mokosuitelogistics/mokosuitelogistics.xml b/source/packages/com_mokosuitelogistics/mokosuitelogistics.xml
index 0179e6e..d42a347 100644
--- a/source/packages/com_mokosuitelogistics/mokosuitelogistics.xml
+++ b/source/packages/com_mokosuitelogistics/mokosuitelogistics.xml
@@ -1,32 +1,38 @@
- com_mokosuitelogistics
- 0.0.0
- 2026-06
- Moko Consulting
- hello@mokoconsulting.tech
- https://mokoconsulting.tech
- (C) 2026 Moko Consulting
- GPL-3.0-or-later
- Layer 2 — Fleet logistics, shipment tracking, route planning, warehouse management
- MokoConsulting\Component\MokoSuiteLogistics
-
-
- services
- src
- tmpl
- language
- access.xml
- config.xml
-
-
-
-
-
-
-
-
-
-
-
+ MokoSuite Logistics
+ Moko Consulting
+ hello@mokoconsulting.tech
+ https://mokoconsulting.tech
+ 2026-06-27
+ Copyright (C) 2026 Moko Consulting.
+ GPL-3.0-or-later
+ 06.00.00
+ Delivery management, route optimization, courier dispatch, proof of delivery
+ Moko\Component\MokoSuiteLogistics
+
+
+ access.xml
+ config.xml
+ language
+ services
+ src
+ tmpl
+
+
+ en-GB/com_mokosuitelogistics.ini
+ en-GB/com_mokosuitelogistics.sys.ini
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/source/packages/plg_system_mokosuitelogistics/language/en-GB/plg_system_mokosuitelogistics.ini b/source/packages/plg_system_mokosuitelogistics/language/en-GB/plg_system_mokosuitelogistics.ini
index d8af8a0..1fab730 100644
--- a/source/packages/plg_system_mokosuitelogistics/language/en-GB/plg_system_mokosuitelogistics.ini
+++ b/source/packages/plg_system_mokosuitelogistics/language/en-GB/plg_system_mokosuitelogistics.ini
@@ -1,3 +1,2 @@
-PLG_SYSTEM_MOKOSUITELOGISTICS="Logistics"
-PLG_SYSTEM_MOKOSUITELOGISTICS_DESCRIPTION="MokoSuiteLogistics system plugin"
-PLG_SYSTEM_MOKOSUITELOGISTICS_ENABLED="Enable MokoSuiteLogistics"
+PLG_SYSTEM_MOKOSUITELOGISTICS="System - MokoSuite Logistics"
+PLG_SYSTEM_MOKOSUITELOGISTICS_DESC="Delivery management, route optimization, courier dispatch, proof of delivery"
diff --git a/source/packages/plg_system_mokosuitelogistics/language/en-GB/plg_system_mokosuitelogistics.sys.ini b/source/packages/plg_system_mokosuitelogistics/language/en-GB/plg_system_mokosuitelogistics.sys.ini
index d8af8a0..1fab730 100644
--- a/source/packages/plg_system_mokosuitelogistics/language/en-GB/plg_system_mokosuitelogistics.sys.ini
+++ b/source/packages/plg_system_mokosuitelogistics/language/en-GB/plg_system_mokosuitelogistics.sys.ini
@@ -1,3 +1,2 @@
-PLG_SYSTEM_MOKOSUITELOGISTICS="Logistics"
-PLG_SYSTEM_MOKOSUITELOGISTICS_DESCRIPTION="MokoSuiteLogistics system plugin"
-PLG_SYSTEM_MOKOSUITELOGISTICS_ENABLED="Enable MokoSuiteLogistics"
+PLG_SYSTEM_MOKOSUITELOGISTICS="System - MokoSuite Logistics"
+PLG_SYSTEM_MOKOSUITELOGISTICS_DESC="Delivery management, route optimization, courier dispatch, proof of delivery"
diff --git a/source/packages/plg_system_mokosuitelogistics/mokosuitelogistics.xml b/source/packages/plg_system_mokosuitelogistics/mokosuitelogistics.xml
index 7b93a00..20300c7 100644
--- a/source/packages/plg_system_mokosuitelogistics/mokosuitelogistics.xml
+++ b/source/packages/plg_system_mokosuitelogistics/mokosuitelogistics.xml
@@ -1,43 +1,68 @@
- plg_system_mokosuitelogistics
- 0.0.0
- 2026-06
- Moko Consulting
- hello@mokoconsulting.tech
- https://mokoconsulting.tech
- (C) 2026 Moko Consulting
- GPL-3.0-or-later
- MokoSuiteLogistics system plugin -- schema owner and bootstrap
- MokoConsulting\Plugin\System\MokoSuiteLogistics
-
- src
- services
- sql
- language
-
-
-
- sql/install.mysql.sql
-
-
-
-
- sql/uninstall.mysql.sql
-
-
-
- en-GB/plg_system_mokosuitelogistics.ini
- en-GB/plg_system_mokosuitelogistics.sys.ini
-
-
-
-
-
-
+ System - MokoSuite Logistics
+ mokosuitelogistics
+ Moko Consulting
+ 2026-06-27
+ Copyright (C) 2026 Moko Consulting. All rights reserved.
+ GPL-3.0-or-later
+ hello@mokoconsulting.tech
+ https://mokoconsulting.tech
+ 06.00.00
+ 8.3
+ PLG_SYSTEM_MOKOSUITELOGISTICS_DESC
+ Moko\Plugin\System\MokoSuiteLogistics
+
+ src
+ services
+ language
+ sql
+
+
+ en-GB/plg_system_mokosuitelogistics.ini
+ en-GB/plg_system_mokosuitelogistics.sys.ini
+
+ sql/install.mysql.sql
+ sql/uninstall.mysql.sql
+
+
+
+
+
+
+
+
diff --git a/source/packages/plg_system_mokosuitelogistics/services/provider.php b/source/packages/plg_system_mokosuitelogistics/services/provider.php
index 281d8e8..1fbda3d 100644
--- a/source/packages/plg_system_mokosuitelogistics/services/provider.php
+++ b/source/packages/plg_system_mokosuitelogistics/services/provider.php
@@ -1,7 +1,9 @@
+ * SPDX-License-Identifier: GPL-3.0-or-later
+ * Authored-by: Moko Consulting
*/
defined('_JEXEC') or die;
@@ -12,20 +14,20 @@ use Joomla\CMS\Plugin\PluginHelper;
use Joomla\DI\Container;
use Joomla\DI\ServiceProviderInterface;
use Joomla\Event\DispatcherInterface;
-use MokoConsulting\Plugin\System\MokoSuiteLogistics\Extension\Logistics;
+use Moko\Plugin\System\MokoSuiteLogistics\Extension\Logistics;
return new class implements ServiceProviderInterface
{
- public function register(Container $container): void
- {
- $container->set(
- PluginInterface::class,
- function (Container $container) {
- $dispatcher = $container->get(DispatcherInterface::class);
- $plugin = new Logistics($dispatcher, (array) PluginHelper::getPlugin('system', 'mokosuitelogistics'));
- $plugin->setApplication(Factory::getApplication());
- return $plugin;
- }
- );
- }
+ public function register(Container $container): void
+ {
+ $container->set(
+ PluginInterface::class,
+ function (Container $container) {
+ $dispatcher = $container->get(DispatcherInterface::class);
+ $plugin = new Logistics($dispatcher, (array) PluginHelper::getPlugin('system', 'mokosuitelogistics'));
+ $plugin->setApplication(Factory::getApplication());
+ return $plugin;
+ }
+ );
+ }
};
diff --git a/source/packages/plg_system_mokosuitelogistics/sql/install.mysql.sql b/source/packages/plg_system_mokosuitelogistics/sql/install.mysql.sql
index 7043444..ed34a05 100644
--- a/source/packages/plg_system_mokosuitelogistics/sql/install.mysql.sql
+++ b/source/packages/plg_system_mokosuitelogistics/sql/install.mysql.sql
@@ -1,172 +1,155 @@
--- MokoSuiteLogistics Schema
--- Copyright (C) 2026 Moko Consulting
--- SPDX-License-Identifier: GPL-3.0-or-later
+CREATE TABLE IF NOT EXISTS `#__mokosuitelogistics_orders` (
+ `id` INT UNSIGNED NOT NULL AUTO_INCREMENT,
+ `order_ref` VARCHAR(20) NOT NULL,
+ `customer_contact_id` INT DEFAULT NULL,
+ `customer_name` VARCHAR(255) NOT NULL,
+ `customer_phone` VARCHAR(50) NOT NULL DEFAULT '',
+ `customer_email` VARCHAR(255) NOT NULL DEFAULT '',
+ `status` ENUM('pending','confirmed','assigned','picked_up','in_transit','delivered','failed','cancelled','returned') NOT NULL DEFAULT 'pending',
+ `order_type` ENUM('standard','express','same_day','scheduled','bulk') NOT NULL DEFAULT 'standard',
+ `pickup_address` VARCHAR(500) NOT NULL,
+ `pickup_lat` DECIMAL(10,7) DEFAULT NULL,
+ `pickup_lng` DECIMAL(10,7) DEFAULT NULL,
+ `delivery_address` VARCHAR(500) NOT NULL,
+ `delivery_lat` DECIMAL(10,7) DEFAULT NULL,
+ `delivery_lng` DECIMAL(10,7) DEFAULT NULL,
+ `package_type` ENUM('envelope','small_box','medium_box','large_box','pallet','fragile','perishable','custom') NOT NULL DEFAULT 'small_box',
+ `weight_kg` DECIMAL(8,2) DEFAULT NULL,
+ `estimated_distance_km` DECIMAL(10,2) DEFAULT NULL,
+ `delivery_fee` DECIMAL(10,2) NOT NULL DEFAULT 0.00,
+ `total_charge` DECIMAL(10,2) NOT NULL DEFAULT 0.00,
+ `payment_method` ENUM('cash','card','account','prepaid','cod') NOT NULL DEFAULT 'card',
+ `payment_status` ENUM('pending','paid','refunded','failed') NOT NULL DEFAULT 'pending',
+ `notes` TEXT,
+ `created` DATETIME NOT NULL,
+ `created_by` INT NOT NULL DEFAULT 0,
+ PRIMARY KEY (`id`),
+ UNIQUE KEY `idx_ref` (`order_ref`),
+ KEY `idx_customer` (`customer_contact_id`),
+ KEY `idx_status` (`status`),
+ KEY `idx_type` (`order_type`),
+ KEY `idx_created` (`created`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
-CREATE TABLE IF NOT EXISTS `#__mokosuitelogistics_carriers` (
- `id` INT UNSIGNED NOT NULL AUTO_INCREMENT,
- `contact_id` INT UNSIGNED NULL COMMENT 'FK to CRM contacts',
- `name` VARCHAR(255) NOT NULL,
- `code` VARCHAR(50) NOT NULL,
- `carrier_type` ENUM('ground','air','sea','rail','courier') NOT NULL DEFAULT 'ground',
- `tracking_url_template` VARCHAR(500) NULL,
- `phone` VARCHAR(50) NULL,
- `email` VARCHAR(255) NULL,
- `status` ENUM('active','inactive','suspended') NOT NULL DEFAULT 'active',
- `notes` TEXT NULL,
- `created` DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,
- `modified` DATETIME NULL ON UPDATE CURRENT_TIMESTAMP,
- PRIMARY KEY (`id`),
- UNIQUE KEY `idx_code` (`code`),
- KEY `idx_status` (`status`),
- KEY `idx_contact` (`contact_id`)
-) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
-
-CREATE TABLE IF NOT EXISTS `#__mokosuitelogistics_warehouses` (
- `id` INT UNSIGNED NOT NULL AUTO_INCREMENT,
- `name` VARCHAR(255) NOT NULL,
- `code` VARCHAR(50) NOT NULL,
- `address` TEXT NULL,
- `city` VARCHAR(100) NULL,
- `state` VARCHAR(100) NULL,
- `postal_code` VARCHAR(20) NULL,
- `country` VARCHAR(100) NULL,
- `capacity_sqft` DECIMAL(12,2) NULL,
- `manager_contact_id` INT UNSIGNED NULL COMMENT 'FK to CRM contacts',
- `status` ENUM('active','inactive','maintenance') NOT NULL DEFAULT 'active',
- `created` DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,
- `modified` DATETIME NULL ON UPDATE CURRENT_TIMESTAMP,
- PRIMARY KEY (`id`),
- UNIQUE KEY `idx_code` (`code`),
- KEY `idx_status` (`status`),
- KEY `idx_manager_contact` (`manager_contact_id`)
-) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
-
-CREATE TABLE IF NOT EXISTS `#__mokosuitelogistics_warehouse_zones` (
- `id` INT UNSIGNED NOT NULL AUTO_INCREMENT,
- `warehouse_id` INT UNSIGNED NOT NULL,
- `name` VARCHAR(255) NOT NULL,
- `zone_type` ENUM('receiving','storage','picking','packing','shipping','cold','hazmat') NOT NULL DEFAULT 'storage',
- `capacity` INT UNSIGNED NULL,
- `current_utilization` INT UNSIGNED NOT NULL DEFAULT 0,
- `ordering` INT NOT NULL DEFAULT 0,
- `created` DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,
- `modified` DATETIME NULL ON UPDATE CURRENT_TIMESTAMP,
- PRIMARY KEY (`id`),
- KEY `idx_warehouse` (`warehouse_id`),
- KEY `idx_zone_type` (`zone_type`),
- CONSTRAINT `fk_zone_warehouse` FOREIGN KEY (`warehouse_id`) REFERENCES `#__mokosuitelogistics_warehouses`(`id`) ON DELETE CASCADE
-) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
-
-CREATE TABLE IF NOT EXISTS `#__mokosuitelogistics_shipments` (
- `id` INT UNSIGNED NOT NULL AUTO_INCREMENT,
- `shipment_number` VARCHAR(50) NOT NULL,
- `shipper_contact_id` INT UNSIGNED NULL COMMENT 'FK to CRM contacts',
- `consignee_contact_id` INT UNSIGNED NULL COMMENT 'FK to CRM contacts',
- `carrier_id` INT UNSIGNED NULL,
- `warehouse_id` INT UNSIGNED NULL,
- `origin_address` TEXT NULL,
- `destination_address` TEXT NULL,
- `shipment_type` ENUM('inbound','outbound','transfer','return') NOT NULL DEFAULT 'outbound',
- `status` ENUM('draft','booked','picked_up','in_transit','out_for_delivery','delivered','cancelled','returned') NOT NULL DEFAULT 'draft',
- `priority` ENUM('standard','express','overnight','freight') NOT NULL DEFAULT 'standard',
- `weight_kg` DECIMAL(10,3) NULL,
- `volume_cbm` DECIMAL(10,4) NULL,
- `estimated_pickup` DATETIME NULL,
- `estimated_delivery` DATETIME NULL,
- `actual_pickup` DATETIME NULL,
- `actual_delivery` DATETIME NULL,
- `tracking_number` VARCHAR(255) NULL,
- `shipping_cost` DECIMAL(10,2) NULL,
- `insurance_value` DECIMAL(10,2) NULL,
- `notes` TEXT NULL,
- `created` DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,
- `modified` DATETIME NULL ON UPDATE CURRENT_TIMESTAMP,
- PRIMARY KEY (`id`),
- UNIQUE KEY `idx_shipment_number` (`shipment_number`),
- KEY `idx_status` (`status`),
- KEY `idx_shipper_contact` (`shipper_contact_id`),
- KEY `idx_consignee_contact` (`consignee_contact_id`),
- KEY `idx_carrier` (`carrier_id`),
- KEY `idx_warehouse` (`warehouse_id`),
- KEY `idx_estimated_delivery` (`estimated_delivery`)
-) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
+CREATE TABLE IF NOT EXISTS `#__mokosuitelogistics_deliveries` (
+ `id` INT UNSIGNED NOT NULL AUTO_INCREMENT,
+ `order_id` INT UNSIGNED NOT NULL,
+ `driver_id` INT UNSIGNED DEFAULT NULL,
+ `route_id` INT UNSIGNED DEFAULT NULL,
+ `status` ENUM('assigned','en_route_pickup','picked_up','en_route_delivery','delivered','failed','returned') NOT NULL DEFAULT 'assigned',
+ `assigned_at` DATETIME DEFAULT NULL,
+ `picked_up_at` DATETIME DEFAULT NULL,
+ `delivered_at` DATETIME DEFAULT NULL,
+ `failed_at` DATETIME DEFAULT NULL,
+ `failure_reason` VARCHAR(500) NOT NULL DEFAULT '',
+ `attempt_number` TINYINT UNSIGNED NOT NULL DEFAULT 1,
+ `actual_distance_km` DECIMAL(10,2) DEFAULT NULL,
+ `driver_notes` TEXT,
+ `created` DATETIME NOT NULL,
+ PRIMARY KEY (`id`),
+ KEY `idx_order` (`order_id`),
+ KEY `idx_driver` (`driver_id`),
+ KEY `idx_route` (`route_id`),
+ KEY `idx_status` (`status`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
CREATE TABLE IF NOT EXISTS `#__mokosuitelogistics_routes` (
- `id` INT UNSIGNED NOT NULL AUTO_INCREMENT,
- `name` VARCHAR(255) NOT NULL,
- `carrier_id` INT UNSIGNED NULL,
- `route_type` ENUM('scheduled','on_demand','dedicated') NOT NULL DEFAULT 'scheduled',
- `status` ENUM('active','inactive','planned') NOT NULL DEFAULT 'planned',
- `distance_km` DECIMAL(10,2) NULL,
- `estimated_duration_hours` DECIMAL(6,2) NULL,
- `notes` TEXT NULL,
- `created` DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,
- `modified` DATETIME NULL ON UPDATE CURRENT_TIMESTAMP,
- PRIMARY KEY (`id`),
- KEY `idx_carrier` (`carrier_id`),
- KEY `idx_status` (`status`)
-) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
+ `id` INT UNSIGNED NOT NULL AUTO_INCREMENT,
+ `route_ref` VARCHAR(20) NOT NULL,
+ `driver_id` INT UNSIGNED DEFAULT NULL,
+ `status` ENUM('planned','active','completed','cancelled') NOT NULL DEFAULT 'planned',
+ `planned_date` DATE NOT NULL,
+ `started_at` DATETIME DEFAULT NULL,
+ `completed_at` DATETIME DEFAULT NULL,
+ `total_stops` INT UNSIGNED NOT NULL DEFAULT 0,
+ `total_distance_km` DECIMAL(10,2) NOT NULL DEFAULT 0.00,
+ `notes` TEXT,
+ `created` DATETIME NOT NULL,
+ PRIMARY KEY (`id`),
+ UNIQUE KEY `idx_ref` (`route_ref`),
+ KEY `idx_driver` (`driver_id`),
+ KEY `idx_status` (`status`),
+ KEY `idx_date` (`planned_date`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
CREATE TABLE IF NOT EXISTS `#__mokosuitelogistics_route_stops` (
- `id` INT UNSIGNED NOT NULL AUTO_INCREMENT,
- `route_id` INT UNSIGNED NOT NULL,
- `stop_number` INT UNSIGNED NOT NULL,
- `location_name` VARCHAR(255) NOT NULL,
- `address` TEXT NULL,
- `latitude` DECIMAL(10,7) NULL,
- `longitude` DECIMAL(10,7) NULL,
- `stop_type` ENUM('pickup','dropoff','waypoint','rest') NOT NULL DEFAULT 'dropoff',
- `estimated_arrival` DATETIME NULL,
- `estimated_departure` DATETIME NULL,
- `actual_arrival` DATETIME NULL,
- `actual_departure` DATETIME NULL,
- `notes` TEXT NULL,
- `created` DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,
- PRIMARY KEY (`id`),
- KEY `idx_route` (`route_id`),
- KEY `idx_stop_number` (`route_id`, `stop_number`),
- CONSTRAINT `fk_stop_route` FOREIGN KEY (`route_id`) REFERENCES `#__mokosuitelogistics_routes`(`id`) ON DELETE CASCADE
-) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
+ `id` INT UNSIGNED NOT NULL AUTO_INCREMENT,
+ `route_id` INT UNSIGNED NOT NULL,
+ `order_id` INT UNSIGNED DEFAULT NULL,
+ `stop_type` ENUM('pickup','delivery','warehouse','return') NOT NULL DEFAULT 'delivery',
+ `address` VARCHAR(500) NOT NULL,
+ `lat` DECIMAL(10,7) DEFAULT NULL,
+ `lng` DECIMAL(10,7) DEFAULT NULL,
+ `sequence_order` INT UNSIGNED NOT NULL DEFAULT 0,
+ `estimated_arrival` DATETIME DEFAULT NULL,
+ `actual_arrival` DATETIME DEFAULT NULL,
+ `status` ENUM('pending','arrived','completed','skipped') NOT NULL DEFAULT 'pending',
+ `notes` TEXT,
+ PRIMARY KEY (`id`),
+ KEY `idx_route` (`route_id`),
+ KEY `idx_order` (`order_id`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
-CREATE TABLE IF NOT EXISTS `#__mokosuitelogistics_packages` (
- `id` INT UNSIGNED NOT NULL AUTO_INCREMENT,
- `shipment_id` INT UNSIGNED NOT NULL,
- `package_number` VARCHAR(50) NOT NULL,
- `description` VARCHAR(255) NULL,
- `weight_kg` DECIMAL(10,3) NULL,
- `length_cm` DECIMAL(8,2) NULL,
- `width_cm` DECIMAL(8,2) NULL,
- `height_cm` DECIMAL(8,2) NULL,
- `declared_value` DECIMAL(10,2) NULL,
- `is_fragile` TINYINT(1) NOT NULL DEFAULT 0,
- `is_hazmat` TINYINT(1) NOT NULL DEFAULT 0,
- `barcode` VARCHAR(255) NULL,
- `status` ENUM('created','labeled','in_transit','delivered','damaged','lost') NOT NULL DEFAULT 'created',
- `created` DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,
- `modified` DATETIME NULL ON UPDATE CURRENT_TIMESTAMP,
- PRIMARY KEY (`id`),
- UNIQUE KEY `idx_package_number` (`package_number`),
- KEY `idx_shipment` (`shipment_id`),
- KEY `idx_status` (`status`),
- KEY `idx_barcode` (`barcode`),
- CONSTRAINT `fk_package_shipment` FOREIGN KEY (`shipment_id`) REFERENCES `#__mokosuitelogistics_shipments`(`id`) ON DELETE CASCADE
-) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
+CREATE TABLE IF NOT EXISTS `#__mokosuitelogistics_delivery_proofs` (
+ `id` INT UNSIGNED NOT NULL AUTO_INCREMENT,
+ `delivery_id` INT UNSIGNED NOT NULL,
+ `proof_type` ENUM('signature','photo','both') NOT NULL DEFAULT 'photo',
+ `recipient_name` VARCHAR(255) NOT NULL DEFAULT '',
+ `signature_data` TEXT,
+ `photo_path` VARCHAR(500) NOT NULL DEFAULT '',
+ `geolocation_lat` DECIMAL(10,7) DEFAULT NULL,
+ `geolocation_lng` DECIMAL(10,7) DEFAULT NULL,
+ `notes` TEXT,
+ `created` DATETIME NOT NULL,
+ PRIMARY KEY (`id`),
+ KEY `idx_delivery` (`delivery_id`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
-CREATE TABLE IF NOT EXISTS `#__mokosuitelogistics_tracking_events` (
- `id` INT UNSIGNED NOT NULL AUTO_INCREMENT,
- `shipment_id` INT UNSIGNED NOT NULL,
- `package_id` INT UNSIGNED NULL,
- `event_type` ENUM('created','picked_up','in_transit','at_hub','out_for_delivery','delivered','exception','returned') NOT NULL,
- `location` VARCHAR(255) NULL,
- `latitude` DECIMAL(10,7) NULL,
- `longitude` DECIMAL(10,7) NULL,
- `description` TEXT NULL,
- `event_time` DATETIME NOT NULL,
- `created` DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,
- PRIMARY KEY (`id`),
- KEY `idx_shipment` (`shipment_id`),
- KEY `idx_package` (`package_id`),
- KEY `idx_event_type` (`event_type`),
- KEY `idx_event_time` (`event_time`),
- CONSTRAINT `fk_tracking_shipment` FOREIGN KEY (`shipment_id`) REFERENCES `#__mokosuitelogistics_shipments`(`id`) ON DELETE CASCADE
-) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
+CREATE TABLE IF NOT EXISTS `#__mokosuitelogistics_pricing_rules` (
+ `id` INT UNSIGNED NOT NULL AUTO_INCREMENT,
+ `name` VARCHAR(255) NOT NULL,
+ `order_type` ENUM('standard','express','same_day','scheduled','bulk','all') NOT NULL DEFAULT 'all',
+ `base_fee` DECIMAL(10,2) NOT NULL DEFAULT 5.00,
+ `per_km` DECIMAL(10,2) NOT NULL DEFAULT 1.00,
+ `per_kg` DECIMAL(10,2) NOT NULL DEFAULT 0.50,
+ `minimum_charge` DECIMAL(10,2) NOT NULL DEFAULT 5.00,
+ `express_multiplier` DECIMAL(4,2) NOT NULL DEFAULT 1.50,
+ `published` TINYINT NOT NULL DEFAULT 1,
+ `created` DATETIME NOT NULL,
+ PRIMARY KEY (`id`),
+ KEY `idx_order_type` (`order_type`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
+
+CREATE TABLE IF NOT EXISTS `#__mokosuitelogistics_drivers` (
+ `id` INT UNSIGNED NOT NULL AUTO_INCREMENT,
+ `contact_id` INT DEFAULT NULL,
+ `name` VARCHAR(255) NOT NULL,
+ `phone` VARCHAR(50) NOT NULL DEFAULT '',
+ `email` VARCHAR(255) NOT NULL DEFAULT '',
+ `license_number` VARCHAR(50) NOT NULL DEFAULT '',
+ `vehicle_description` VARCHAR(255) NOT NULL DEFAULT '',
+ `status` ENUM('available','on_delivery','off_duty','inactive') NOT NULL DEFAULT 'available',
+ `current_lat` DECIMAL(10,7) DEFAULT NULL,
+ `current_lng` DECIMAL(10,7) DEFAULT NULL,
+ `rating` DECIMAL(3,2) NOT NULL DEFAULT 5.00,
+ `total_deliveries` INT UNSIGNED NOT NULL DEFAULT 0,
+ `published` TINYINT NOT NULL DEFAULT 1,
+ `created` DATETIME NOT NULL,
+ PRIMARY KEY (`id`),
+ KEY `idx_contact` (`contact_id`),
+ KEY `idx_status` (`status`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
+
+CREATE TABLE IF NOT EXISTS `#__mokosuitelogistics_warehouses` (
+ `id` INT UNSIGNED NOT NULL AUTO_INCREMENT,
+ `name` VARCHAR(255) NOT NULL,
+ `address` VARCHAR(500) NOT NULL,
+ `lat` DECIMAL(10,7) DEFAULT NULL,
+ `lng` DECIMAL(10,7) DEFAULT NULL,
+ `manager_contact_id` INT DEFAULT NULL,
+ `phone` VARCHAR(50) NOT NULL DEFAULT '',
+ `published` TINYINT NOT NULL DEFAULT 1,
+ `created` DATETIME NOT NULL,
+ PRIMARY KEY (`id`),
+ KEY `idx_manager` (`manager_contact_id`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
diff --git a/source/packages/plg_system_mokosuitelogistics/sql/uninstall.mysql.sql b/source/packages/plg_system_mokosuitelogistics/sql/uninstall.mysql.sql
index 0f24cf1..a5258b5 100644
--- a/source/packages/plg_system_mokosuitelogistics/sql/uninstall.mysql.sql
+++ b/source/packages/plg_system_mokosuitelogistics/sql/uninstall.mysql.sql
@@ -1,8 +1,8 @@
-DROP TABLE IF EXISTS `#__mokosuitelogistics_tracking_events`;
-DROP TABLE IF EXISTS `#__mokosuitelogistics_packages`;
+DROP TABLE IF EXISTS `#__mokosuitelogistics_warehouses`;
+DROP TABLE IF EXISTS `#__mokosuitelogistics_drivers`;
+DROP TABLE IF EXISTS `#__mokosuitelogistics_pricing_rules`;
+DROP TABLE IF EXISTS `#__mokosuitelogistics_delivery_proofs`;
DROP TABLE IF EXISTS `#__mokosuitelogistics_route_stops`;
DROP TABLE IF EXISTS `#__mokosuitelogistics_routes`;
-DROP TABLE IF EXISTS `#__mokosuitelogistics_shipments`;
-DROP TABLE IF EXISTS `#__mokosuitelogistics_warehouse_zones`;
-DROP TABLE IF EXISTS `#__mokosuitelogistics_warehouses`;
-DROP TABLE IF EXISTS `#__mokosuitelogistics_carriers`;
+DROP TABLE IF EXISTS `#__mokosuitelogistics_deliveries`;
+DROP TABLE IF EXISTS `#__mokosuitelogistics_orders`;
diff --git a/source/packages/plg_system_mokosuitelogistics/src/Extension/Logistics.php b/source/packages/plg_system_mokosuitelogistics/src/Extension/Logistics.php
index 44b061a..c01f14f 100644
--- a/source/packages/plg_system_mokosuitelogistics/src/Extension/Logistics.php
+++ b/source/packages/plg_system_mokosuitelogistics/src/Extension/Logistics.php
@@ -1,20 +1,24 @@
+ * SPDX-License-Identifier: GPL-3.0-or-later
+ * Authored-by: Moko Consulting
*/
-namespace MokoConsulting\Plugin\System\MokoSuiteLogistics\Extension;
+namespace Moko\Plugin\System\MokoSuiteLogistics\Extension;
defined('_JEXEC') or die;
use Joomla\CMS\Plugin\CMSPlugin;
use Joomla\Event\SubscriberInterface;
-final class Logistics extends CMSPlugin implements SubscriberInterface
+class Logistics extends CMSPlugin implements SubscriberInterface
{
- public static function getSubscribedEvents(): array
- {
- return [];
- }
+ protected $autoloadLanguage = true;
+
+ public static function getSubscribedEvents(): array
+ {
+ return [];
+ }
}
diff --git a/source/packages/plg_system_mokosuitelogistics/src/Helper/LogisticsHelper.php b/source/packages/plg_system_mokosuitelogistics/src/Helper/LogisticsHelper.php
new file mode 100644
index 0000000..79d2ed0
--- /dev/null
+++ b/source/packages/plg_system_mokosuitelogistics/src/Helper/LogisticsHelper.php
@@ -0,0 +1,87 @@
+
+ * SPDX-License-Identifier: GPL-3.0-or-later
+ * Authored-by: Moko Consulting
+ */
+
+declare(strict_types=1);
+
+namespace Moko\Plugin\System\MokoSuiteLogistics\Helper;
+
+defined('_JEXEC') or die;
+
+use Joomla\CMS\Factory;
+use Joomla\Database\DatabaseInterface;
+
+class LogisticsHelper
+{
+ public static function getDashboard(): object
+ {
+ $db = Factory::getContainer()->get(DatabaseInterface::class);
+
+ $db->setQuery($db->getQuery(true)
+ ->select('COUNT(*)')
+ ->from('#__mokosuitelogistics_orders'));
+ $totalOrders = (int) $db->loadResult();
+
+ $db->setQuery($db->getQuery(true)
+ ->select('COUNT(*)')
+ ->from('#__mokosuitelogistics_deliveries')
+ ->where($db->quoteName('status') . ' IN (' . implode(',', array_map([$db, 'quote'], ['assigned', 'en_route_pickup', 'picked_up', 'en_route_delivery'])) . ')'));
+ $activeDeliveries = (int) $db->loadResult();
+
+ $db->setQuery($db->getQuery(true)
+ ->select('COUNT(*)')
+ ->from('#__mokosuitelogistics_drivers')
+ ->where($db->quoteName('status') . ' = ' . $db->quote('available'))
+ ->where($db->quoteName('published') . ' = 1'));
+ $availableDrivers = (int) $db->loadResult();
+
+ $db->setQuery($db->getQuery(true)
+ ->select('COUNT(*)')
+ ->from('#__mokosuitelogistics_drivers')
+ ->where($db->quoteName('published') . ' = 1'));
+ $totalDrivers = (int) $db->loadResult();
+
+ $db->setQuery($db->getQuery(true)
+ ->select('COUNT(*)')
+ ->from('#__mokosuitelogistics_warehouses')
+ ->where($db->quoteName('published') . ' = 1'));
+ $totalWarehouses = (int) $db->loadResult();
+
+ $db->setQuery($db->getQuery(true)
+ ->select('COALESCE(SUM(' . $db->quoteName('total_charge') . '), 0)')
+ ->from('#__mokosuitelogistics_orders')
+ ->where($db->quoteName('status') . ' = ' . $db->quote('delivered'))
+ ->where($db->quoteName('payment_status') . ' = ' . $db->quote('paid'))
+ ->where('DATE(' . $db->quoteName('created') . ') = CURDATE()'));
+ $todayRevenue = (float) $db->loadResult();
+
+ return (object) [
+ 'total_orders' => $totalOrders,
+ 'active_deliveries' => $activeDeliveries,
+ 'available_drivers' => $availableDrivers,
+ 'total_drivers' => $totalDrivers,
+ 'total_warehouses' => $totalWarehouses,
+ 'today_revenue' => $todayRevenue,
+ ];
+ }
+
+ public static function generateOrderRef(): string
+ {
+ $db = Factory::getContainer()->get(DatabaseInterface::class);
+ $prefix = 'LG';
+
+ do {
+ $ref = $prefix . strtoupper(bin2hex(random_bytes(4)));
+ $db->setQuery($db->getQuery(true)
+ ->select('COUNT(*)')
+ ->from('#__mokosuitelogistics_orders')
+ ->where($db->quoteName('order_ref') . ' = ' . $db->quote($ref)));
+ } while ((int) $db->loadResult() > 0);
+
+ return $ref;
+ }
+}
diff --git a/source/packages/plg_webservices_mokosuitelogistics/mokosuitelogistics.xml b/source/packages/plg_webservices_mokosuitelogistics/mokosuitelogistics.xml
index 8b669b7..69d66b8 100644
--- a/source/packages/plg_webservices_mokosuitelogistics/mokosuitelogistics.xml
+++ b/source/packages/plg_webservices_mokosuitelogistics/mokosuitelogistics.xml
@@ -1,17 +1,15 @@
-
+
- plg_webservices_mokosuitelogistics
- 0.0.0
- 2026-06
- Moko Consulting
- hello@mokoconsulting.tech
- https://mokoconsulting.tech
- (C) 2026 Moko Consulting
- GPL-3.0-or-later
- MokoSuiteLogistics webservices plugin
- MokoConsulting\Plugin\WebServices\MokoSuiteLogistics
-
- src
- services
-
+ Web Services - MokoSuite Logistics
+ mokosuitelogistics
+ Moko Consulting
+ hello@mokoconsulting.tech
+ https://mokoconsulting.tech
+ 2026-06-27
+ Copyright (C) 2026 Moko Consulting.
+ 06.00.00
+ GPL-3.0-or-later
+ REST API routes for MokoSuite Logistics delivery operations
+ Moko\Plugin\WebServices\MokoSuiteLogistics
+ srcservices
diff --git a/source/packages/plg_webservices_mokosuitelogistics/services/provider.php b/source/packages/plg_webservices_mokosuitelogistics/services/provider.php
index 751f8c0..26ce564 100644
--- a/source/packages/plg_webservices_mokosuitelogistics/services/provider.php
+++ b/source/packages/plg_webservices_mokosuitelogistics/services/provider.php
@@ -1,31 +1,24 @@
+ * SPDX-License-Identifier: GPL-3.0-or-later
+ * Authored-by: Moko Consulting
*/
defined('_JEXEC') or die;
use Joomla\CMS\Extension\PluginInterface;
-use Joomla\CMS\Factory;
use Joomla\CMS\Plugin\PluginHelper;
use Joomla\DI\Container;
use Joomla\DI\ServiceProviderInterface;
use Joomla\Event\DispatcherInterface;
-use MokoConsulting\Plugin\WebServices\MokoSuiteLogistics\Extension\MokoSuiteLogistics;
+use Moko\Plugin\WebServices\MokoSuiteLogistics\Extension\MokoSuiteLogistics;
-return new class implements ServiceProviderInterface
-{
- public function register(Container $container): void
- {
- $container->set(
- PluginInterface::class,
- function (Container $container) {
- $dispatcher = $container->get(DispatcherInterface::class);
- $plugin = new MokoSuiteLogistics($dispatcher, (array) PluginHelper::getPlugin('webservices', 'mokosuitelogistics'));
- $plugin->setApplication(Factory::getApplication());
- return $plugin;
- }
- );
- }
+return new class implements ServiceProviderInterface {
+ public function register(Container $container): void {
+ $container->set(PluginInterface::class, function (Container $container) {
+ return new MokoSuiteLogistics($container->get(DispatcherInterface::class), (array) PluginHelper::getPlugin('webservices', 'mokosuitelogistics'));
+ });
+ }
};
diff --git a/source/packages/plg_webservices_mokosuitelogistics/src/Extension/MokoSuiteLogistics.php b/source/packages/plg_webservices_mokosuitelogistics/src/Extension/MokoSuiteLogistics.php
index 09726a2..9948350 100644
--- a/source/packages/plg_webservices_mokosuitelogistics/src/Extension/MokoSuiteLogistics.php
+++ b/source/packages/plg_webservices_mokosuitelogistics/src/Extension/MokoSuiteLogistics.php
@@ -1,34 +1,36 @@
+ * SPDX-License-Identifier: GPL-3.0-or-later
+ * Authored-by: Moko Consulting
*/
-namespace MokoConsulting\Plugin\WebServices\MokoSuiteLogistics\Extension;
+namespace Moko\Plugin\WebServices\MokoSuiteLogistics\Extension;
defined('_JEXEC') or die;
use Joomla\CMS\Plugin\CMSPlugin;
-use Joomla\CMS\Router\ApiRouter;
use Joomla\Event\SubscriberInterface;
-use Joomla\Router\Route;
-final class MokoSuiteLogistics extends CMSPlugin implements SubscriberInterface
+class MokoSuiteLogistics extends CMSPlugin implements SubscriberInterface
{
- public static function getSubscribedEvents(): array
- {
- return [
- 'onBeforeApiRoute' => 'onBeforeApiRoute',
- ];
- }
+ public static function getSubscribedEvents(): array
+ {
+ return ['onBeforeApiRoute' => 'onBeforeApiRoute'];
+ }
- public function onBeforeApiRoute(&$router): void
- {
- $router->createCRUDRoutes('v1/mokosuitelogistics/shipments', 'shipments');
- $router->createCRUDRoutes('v1/mokosuitelogistics/routes', 'routes');
- $router->createCRUDRoutes('v1/mokosuitelogistics/carriers', 'carriers');
- $router->createCRUDRoutes('v1/mokosuitelogistics/warehouses', 'warehouses');
- $router->createCRUDRoutes('v1/mokosuitelogistics/packages', 'packages');
- $router->createCRUDRoutes('v1/mokosuitelogistics/tracking', 'tracking');
- }
+ public function onBeforeApiRoute(&$event): void
+ {
+ $router = $event->getArgument('router');
+ $opts = ['component' => 'com_mokosuitelogistics'];
+
+ $router->createCRUDRoutes('v1/mokosuitelogistics/orders', 'orders', $opts);
+ $router->createCRUDRoutes('v1/mokosuitelogistics/deliveries', 'deliveries', $opts);
+ $router->createCRUDRoutes('v1/mokosuitelogistics/routes', 'routes', $opts);
+ $router->createCRUDRoutes('v1/mokosuitelogistics/warehouses', 'warehouses', $opts);
+ $router->createCRUDRoutes('v1/mokosuitelogistics/pricingrules', 'pricingrules', $opts);
+ $router->createCRUDRoutes('v1/mokosuitelogistics/drivers', 'drivers', $opts);
+ $router->createCRUDRoutes('v1/mokosuitelogistics/proofs', 'proofs', $opts);
+ }
}
diff --git a/source/pkg_mokosuitelogistics.xml b/source/pkg_mokosuitelogistics.xml
index 4b9c3a2..61a56e9 100644
--- a/source/pkg_mokosuitelogistics.xml
+++ b/source/pkg_mokosuitelogistics.xml
@@ -1,21 +1,24 @@
- MokoSuiteLogistics
+ Package - MokoSuite Logistics
mokosuitelogistics
- 0.0.0
- 2026-06
+ 06.00.00
+ 2026-06-27
Moko Consulting
hello@mokoconsulting.tech
https://mokoconsulting.tech
- (C) 2026 Moko Consulting
- GPL-3.0-or-later
- Layer 2 — Fleet logistics, shipment tracking, route planning, warehouse management
-
- plg_system_mokosuitelogistics.zip
- com_mokosuitelogistics.zip
- plg_webservices_mokosuitelogistics.zip
+ Copyright (C) 2026 Moko Consulting. All rights reserved.
+ GNU General Public License version 3 or later; see LICENSE
+ Delivery management, route optimization, courier dispatch, proof of delivery
+ 8.3
+
+ true
+
+ plg_system_mokosuitelogistics.zip
+ com_mokosuitelogistics.zip
+ plg_webservices_mokosuitelogistics.zip
- https://git.mokoconsulting.tech/api/packages/MokoConsulting/generic/updates/mokosuitelogistics/updates.xml
+ https://git.mokoconsulting.tech/MokoConsulting/MokoSuiteLogistics/updates.xml