diff --git a/source/packages/com_mokosuiteresto/admin/access.xml b/source/packages/com_mokosuiteresto/admin/access.xml new file mode 100644 index 0000000..be342e7 --- /dev/null +++ b/source/packages/com_mokosuiteresto/admin/access.xml @@ -0,0 +1,11 @@ + + +
+ + + + + + +
+
diff --git a/source/packages/com_mokosuiteresto/admin/config.xml b/source/packages/com_mokosuiteresto/admin/config.xml new file mode 100644 index 0000000..9690c21 --- /dev/null +++ b/source/packages/com_mokosuiteresto/admin/config.xml @@ -0,0 +1,6 @@ + + +
+ +
+
diff --git a/source/packages/com_mokosuiteresto/admin/services/provider.php b/source/packages/com_mokosuiteresto/admin/services/provider.php new file mode 100644 index 0000000..a7e02a6 --- /dev/null +++ b/source/packages/com_mokosuiteresto/admin/services/provider.php @@ -0,0 +1,30 @@ +set( + ComponentInterface::class, + function (Container $container) { + $component = new MVCComponent($container->get(ComponentDispatcherFactoryInterface::class)); + $component->setMVCFactory($container->get(MVCFactoryInterface::class)); + return $component; + } + ); + } +}; diff --git a/source/packages/com_mokosuiteresto/admin/src/Controller/DisplayController.php b/source/packages/com_mokosuiteresto/admin/src/Controller/DisplayController.php new file mode 100644 index 0000000..c6c8e56 --- /dev/null +++ b/source/packages/com_mokosuiteresto/admin/src/Controller/DisplayController.php @@ -0,0 +1,16 @@ + +
+
+

Dashboard

+

Manage dashboard here.

+
+
diff --git a/source/packages/com_mokosuiteresto/mokosuiteresto.xml b/source/packages/com_mokosuiteresto/mokosuiteresto.xml new file mode 100644 index 0000000..338251f --- /dev/null +++ b/source/packages/com_mokosuiteresto/mokosuiteresto.xml @@ -0,0 +1,33 @@ + + + com_mokosuiteresto + 0.0.0 + 2026-06 + Moko Consulting + hello@mokoconsulting.tech + https://mokoconsulting.tech + (C) 2026 Moko Consulting + GPL-3.0-or-later + Layer 2 — Restaurant management, menus, tables, reservations, orders, and inventory + MokoConsulting\Component\MokoSuiteResto + + + services + src + tmpl + language + access.xml + config.xml + + MokoSuiteResto + + Dashboard + Menus + Menu Items + Tables + Reservations + Orders + Inventory + + + diff --git a/source/packages/plg_system_mokosuiteresto/language/en-GB/plg_system_mokosuiteresto.ini b/source/packages/plg_system_mokosuiteresto/language/en-GB/plg_system_mokosuiteresto.ini new file mode 100644 index 0000000..9b6f896 --- /dev/null +++ b/source/packages/plg_system_mokosuiteresto/language/en-GB/plg_system_mokosuiteresto.ini @@ -0,0 +1,3 @@ +PLG_SYSTEM_MOKOSUITERESTO="Resto" +PLG_SYSTEM_MOKOSUITERESTO_DESCRIPTION="MokoSuiteResto system plugin" +PLG_SYSTEM_MOKOSUITERESTO_ENABLED="Enable MokoSuiteResto" diff --git a/source/packages/plg_system_mokosuiteresto/language/en-GB/plg_system_mokosuiteresto.sys.ini b/source/packages/plg_system_mokosuiteresto/language/en-GB/plg_system_mokosuiteresto.sys.ini new file mode 100644 index 0000000..9b6f896 --- /dev/null +++ b/source/packages/plg_system_mokosuiteresto/language/en-GB/plg_system_mokosuiteresto.sys.ini @@ -0,0 +1,3 @@ +PLG_SYSTEM_MOKOSUITERESTO="Resto" +PLG_SYSTEM_MOKOSUITERESTO_DESCRIPTION="MokoSuiteResto system plugin" +PLG_SYSTEM_MOKOSUITERESTO_ENABLED="Enable MokoSuiteResto" diff --git a/source/packages/plg_system_mokosuiteresto/mokosuiteresto.xml b/source/packages/plg_system_mokosuiteresto/mokosuiteresto.xml new file mode 100644 index 0000000..6eea160 --- /dev/null +++ b/source/packages/plg_system_mokosuiteresto/mokosuiteresto.xml @@ -0,0 +1,43 @@ + + + plg_system_mokosuiteresto + 0.0.0 + 2026-06 + Moko Consulting + hello@mokoconsulting.tech + https://mokoconsulting.tech + (C) 2026 Moko Consulting + GPL-3.0-or-later + MokoSuiteResto system plugin -- schema owner and bootstrap + MokoConsulting\Plugin\System\MokoSuiteResto + + src + services + sql + language + + + + sql/install.mysql.sql + + + + + sql/uninstall.mysql.sql + + + + en-GB/plg_system_mokosuiteresto.ini + en-GB/plg_system_mokosuiteresto.sys.ini + + + +
+ + + + +
+
+
+
diff --git a/source/packages/plg_system_mokosuiteresto/services/provider.php b/source/packages/plg_system_mokosuiteresto/services/provider.php new file mode 100644 index 0000000..aa39d21 --- /dev/null +++ b/source/packages/plg_system_mokosuiteresto/services/provider.php @@ -0,0 +1,31 @@ +set( + PluginInterface::class, + function (Container $container) { + $dispatcher = $container->get(DispatcherInterface::class); + $plugin = new Resto($dispatcher, (array) PluginHelper::getPlugin('system', 'mokosuiteresto')); + $plugin->setApplication(Factory::getApplication()); + return $plugin; + } + ); + } +}; diff --git a/source/packages/plg_system_mokosuiteresto/sql/install.mysql.sql b/source/packages/plg_system_mokosuiteresto/sql/install.mysql.sql new file mode 100644 index 0000000..573ce66 --- /dev/null +++ b/source/packages/plg_system_mokosuiteresto/sql/install.mysql.sql @@ -0,0 +1,154 @@ +-- MokoSuiteResto Schema +-- Copyright (C) 2026 Moko Consulting +-- SPDX-License-Identifier: GPL-3.0-or-later + +CREATE TABLE IF NOT EXISTS `#__mokosuiteresto_menus` ( + `id` INT UNSIGNED NOT NULL AUTO_INCREMENT, + `title` VARCHAR(255) NOT NULL, + `description` TEXT NULL, + `menu_type` ENUM('food','drink','dessert','special') NOT NULL DEFAULT 'food', + `active` TINYINT(1) NOT NULL DEFAULT 1, + `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_active` (`active`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; + +CREATE TABLE IF NOT EXISTS `#__mokosuiteresto_menu_items` ( + `id` INT UNSIGNED NOT NULL AUTO_INCREMENT, + `menu_id` INT UNSIGNED NOT NULL, + `title` VARCHAR(255) NOT NULL, + `description` TEXT NULL, + `price` DECIMAL(10,2) NOT NULL DEFAULT 0.00, + `category` VARCHAR(100) NULL, + `allergens` JSON NULL, + `calories` INT UNSIGNED NULL, + `image` VARCHAR(500) NULL, + `available` TINYINT(1) NOT NULL DEFAULT 1, + `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_menu` (`menu_id`), + KEY `idx_available` (`available`), + CONSTRAINT `fk_menuitem_menu` FOREIGN KEY (`menu_id`) REFERENCES `#__mokosuiteresto_menus`(`id`) ON DELETE CASCADE +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; + +CREATE TABLE IF NOT EXISTS `#__mokosuiteresto_modifiers` ( + `id` INT UNSIGNED NOT NULL AUTO_INCREMENT, + `menu_item_id` INT UNSIGNED NOT NULL, + `title` VARCHAR(255) NOT NULL, + `price_adjustment` DECIMAL(10,2) NOT NULL DEFAULT 0.00, + `modifier_type` ENUM('add','remove','substitute') NOT NULL DEFAULT 'add', + `ordering` INT NOT NULL DEFAULT 0, + PRIMARY KEY (`id`), + KEY `idx_menu_item` (`menu_item_id`), + CONSTRAINT `fk_modifier_item` FOREIGN KEY (`menu_item_id`) REFERENCES `#__mokosuiteresto_menu_items`(`id`) ON DELETE CASCADE +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; + +CREATE TABLE IF NOT EXISTS `#__mokosuiteresto_tables` ( + `id` INT UNSIGNED NOT NULL AUTO_INCREMENT, + `table_number` VARCHAR(20) NOT NULL, + `section` VARCHAR(100) NULL, + `capacity` INT UNSIGNED NOT NULL DEFAULT 4, + `status` ENUM('available','occupied','reserved','maintenance') NOT NULL DEFAULT 'available', + `pos_x` INT NULL, + `pos_y` INT NULL, + `created` DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP, + PRIMARY KEY (`id`), + UNIQUE KEY `idx_table_number` (`table_number`), + KEY `idx_status` (`status`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; + +CREATE TABLE IF NOT EXISTS `#__mokosuiteresto_reservations` ( + `id` INT UNSIGNED NOT NULL AUTO_INCREMENT, + `contact_id` INT UNSIGNED NULL COMMENT 'FK to CRM contacts', + `table_id` INT UNSIGNED NULL, + `guest_name` VARCHAR(255) NOT NULL, + `guest_phone` VARCHAR(50) NULL, + `guest_email` VARCHAR(255) NULL, + `party_size` INT UNSIGNED NOT NULL DEFAULT 2, + `reservation_date` DATE NOT NULL, + `reservation_time` TIME NOT NULL, + `duration_minutes` INT UNSIGNED NOT NULL DEFAULT 90, + `status` ENUM('pending','confirmed','seated','completed','cancelled','no_show') NOT NULL DEFAULT 'pending', + `notes` TEXT NULL, + `created` DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP, + `modified` DATETIME NULL ON UPDATE CURRENT_TIMESTAMP, + PRIMARY KEY (`id`), + KEY `idx_date` (`reservation_date`), + KEY `idx_status` (`status`), + KEY `idx_contact` (`contact_id`), + KEY `idx_table` (`table_id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; + +CREATE TABLE IF NOT EXISTS `#__mokosuiteresto_orders` ( + `id` INT UNSIGNED NOT NULL AUTO_INCREMENT, + `table_id` INT UNSIGNED NULL, + `reservation_id` INT UNSIGNED NULL, + `contact_id` INT UNSIGNED NULL COMMENT 'FK to CRM contacts', + `order_number` VARCHAR(50) NOT NULL, + `order_type` ENUM('dine_in','takeout','delivery') NOT NULL DEFAULT 'dine_in', + `status` ENUM('open','preparing','ready','served','closed','cancelled') NOT NULL DEFAULT 'open', + `subtotal` DECIMAL(10,2) NOT NULL DEFAULT 0.00, + `tax` DECIMAL(10,2) NOT NULL DEFAULT 0.00, + `tip` DECIMAL(10,2) NOT NULL DEFAULT 0.00, + `total` DECIMAL(10,2) NOT NULL DEFAULT 0.00, + `payment_method` VARCHAR(50) NULL, + `payment_status` ENUM('unpaid','partial','paid','refunded') NOT NULL DEFAULT 'unpaid', + `server_user_id` INT UNSIGNED NULL, + `notes` TEXT NULL, + `created` DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP, + `modified` DATETIME NULL ON UPDATE CURRENT_TIMESTAMP, + PRIMARY KEY (`id`), + UNIQUE KEY `idx_order_number` (`order_number`), + KEY `idx_table` (`table_id`), + KEY `idx_status` (`status`), + KEY `idx_created` (`created`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; + +CREATE TABLE IF NOT EXISTS `#__mokosuiteresto_order_items` ( + `id` INT UNSIGNED NOT NULL AUTO_INCREMENT, + `order_id` INT UNSIGNED NOT NULL, + `menu_item_id` INT UNSIGNED NOT NULL, + `quantity` INT UNSIGNED NOT NULL DEFAULT 1, + `unit_price` DECIMAL(10,2) NOT NULL, + `modifiers` JSON NULL, + `notes` TEXT NULL, + `status` ENUM('pending','preparing','ready','served','cancelled') NOT NULL DEFAULT 'pending', + `created` DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP, + PRIMARY KEY (`id`), + KEY `idx_order` (`order_id`), + CONSTRAINT `fk_orderitem_order` FOREIGN KEY (`order_id`) REFERENCES `#__mokosuiteresto_orders`(`id`) ON DELETE CASCADE +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; + +CREATE TABLE IF NOT EXISTS `#__mokosuiteresto_inventory` ( + `id` INT UNSIGNED NOT NULL AUTO_INCREMENT, + `item_name` VARCHAR(255) NOT NULL, + `category` VARCHAR(100) NULL, + `unit` VARCHAR(50) NOT NULL DEFAULT 'each', + `quantity_on_hand` DECIMAL(10,2) NOT NULL DEFAULT 0.00, + `reorder_level` DECIMAL(10,2) NULL, + `cost_per_unit` DECIMAL(10,2) NULL, + `supplier` VARCHAR(255) NULL, + `last_restocked` DATETIME NULL, + `created` DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP, + `modified` DATETIME NULL ON UPDATE CURRENT_TIMESTAMP, + PRIMARY KEY (`id`), + KEY `idx_category` (`category`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; + +CREATE TABLE IF NOT EXISTS `#__mokosuiteresto_inventory_transactions` ( + `id` INT UNSIGNED NOT NULL AUTO_INCREMENT, + `inventory_id` INT UNSIGNED NOT NULL, + `transaction_type` ENUM('restock','usage','waste','adjustment') NOT NULL, + `quantity` DECIMAL(10,2) NOT NULL, + `notes` TEXT NULL, + `user_id` INT UNSIGNED NULL, + `created` DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP, + PRIMARY KEY (`id`), + KEY `idx_inventory` (`inventory_id`), + KEY `idx_type` (`transaction_type`), + CONSTRAINT `fk_invtx_inventory` FOREIGN KEY (`inventory_id`) REFERENCES `#__mokosuiteresto_inventory`(`id`) ON DELETE CASCADE +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; diff --git a/source/packages/plg_system_mokosuiteresto/sql/uninstall.mysql.sql b/source/packages/plg_system_mokosuiteresto/sql/uninstall.mysql.sql new file mode 100644 index 0000000..5e657d0 --- /dev/null +++ b/source/packages/plg_system_mokosuiteresto/sql/uninstall.mysql.sql @@ -0,0 +1,9 @@ +DROP TABLE IF EXISTS `#__mokosuiteresto_inventory_transactions`; +DROP TABLE IF EXISTS `#__mokosuiteresto_inventory`; +DROP TABLE IF EXISTS `#__mokosuiteresto_order_items`; +DROP TABLE IF EXISTS `#__mokosuiteresto_orders`; +DROP TABLE IF EXISTS `#__mokosuiteresto_reservations`; +DROP TABLE IF EXISTS `#__mokosuiteresto_tables`; +DROP TABLE IF EXISTS `#__mokosuiteresto_modifiers`; +DROP TABLE IF EXISTS `#__mokosuiteresto_menu_items`; +DROP TABLE IF EXISTS `#__mokosuiteresto_menus`; diff --git a/source/packages/plg_system_mokosuiteresto/src/Extension/Resto.php b/source/packages/plg_system_mokosuiteresto/src/Extension/Resto.php new file mode 100644 index 0000000..91b777a --- /dev/null +++ b/source/packages/plg_system_mokosuiteresto/src/Extension/Resto.php @@ -0,0 +1,20 @@ +