diff --git a/.gitignore b/.gitignore index cb890ec..9d9fe2e 100644 --- a/.gitignore +++ b/.gitignore @@ -1,9 +1,8 @@ +*.min.css +*.min.js +node_modules/ .claude/ .mcp.json TODO.md -*.min.css -*.min.js -vendor/ -node_modules/ -.DS_Store -Thumbs.db +*.zip +*.tar.gz diff --git a/CHANGELOG.md b/CHANGELOG.md index 4f64690..de338a6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,8 @@ + @@ -11,9 +13,9 @@ ### Added - **Repository** -- initial repo creation with scaffolding -- **System Plugin** -- Extension class, service provider, SQL schema -- **SQL Schema** -- 10 tables: menus, menu_items, modifiers, tables, reservations, orders, order_items, inventory, inventory_transactions, staff_shifts -- **Admin Component** -- 8 views: dashboard, menus, items, tables, reservations, orders, inventory, shifts -- **Webservices Plugin** -- 6 API routes: menus, items, tables, reservations, orders, inventory -- **Configuration** -- settings for restaurant basics, orders, reservations, display -- **Access Control** -- granular permissions for menu, reservation, order, inventory, shift management +- **System Plugin** -- Extension class, service provider +- **SQL Schema** -- 8 tables: menus, menu_items, tables, reservations, orders, order_items, inventory, inventory_transactions +- **Admin Component** -- 7 views: dashboard, menus, menu items, tables, reservations, orders, inventory +- **Webservices Plugin** -- 7 API routes: menus, menuitems, tables, reservations, orders, inventory, inventory-transactions +- **Configuration** -- settings across basic, ordering, reservations, kitchen +- **Access Control** -- permissions for granular role-based access diff --git a/CLAUDE.md b/CLAUDE.md index 4c6effa..834dba0 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -1,6 +1,6 @@ # MokoSuiteResto -Restaurant operations: menu, reservations, and order management for Joomla 6. +Menu management, table reservations, online ordering, kitchen display, and inventory for Joomla 6. ## Quick Reference @@ -14,7 +14,7 @@ Restaurant operations: menu, reservations, and order management for Joomla 6. ## Architecture -Joomla **package** -- Layer 2 add-on. CRM contacts as customers, menu management with modifiers, table reservations, order tracking. +Joomla **package** -- Layer 2 add-on. CRM contacts as customers, menu management with categories, table reservations, online ordering with kitchen display, and inventory tracking. ## Rules diff --git a/README.md b/README.md index 765b7c2..14c30e0 100644 --- a/README.md +++ b/README.md @@ -1,15 +1,43 @@ -# MokoSuiteResto +# MokoSuite Resto -Restaurant operations: menu, reservations, and order management. +Menu management, table reservations, online ordering, kitchen display, and inventory module for MokoSuite on Joomla 6. -Part of the [MokoSuite](https://mokoconsulting.tech) platform — Layer 2 vertical. +## Overview + +MokoSuiteResto is a Layer 2 module in the MokoSuite platform, building on MokoSuiteClient (Layer 0) and MokoSuiteCRM (Layer 1) to provide complete restaurant operations management. + +## Features + +- **Menu Management** -- menus with categories, items, pricing, allergens, dietary tags +- **Table Management** -- sections, capacity tracking, real-time status +- **Reservations** -- party size, time slots, auto-confirm, special requests +- **Online Ordering** -- dine-in, takeout, delivery, and catering order types +- **Kitchen Display** -- order status tracking from pending to served +- **Inventory** -- stock tracking with minimum levels, supplier info, expiry dates +- **Inventory Transactions** -- received, used, wasted, adjusted, returned tracking + +## Requirements + +- Joomla 6.x +- PHP 8.3+ +- MokoSuiteClient (Layer 0) +- MokoSuiteCRM (Layer 1) + +## Installation + +Install via Joomla Extension Manager using the package file `pkg_mokosuiteresto.zip`. ## License -GNU General Public License v3.0 or later. See [LICENSE](LICENSE). +GNU General Public License v3.0 or later -- see [LICENSE](LICENSE). + +## Links + +- [Documentation](https://git.mokoconsulting.tech/MokoConsulting/MokoSuiteResto/wiki) +- [Issues](https://git.mokoconsulting.tech/MokoConsulting/MokoSuiteResto/issues) +- [MokoSuite Platform](https://mokoconsulting.tech) diff --git a/source/packages/com_mokosuiteresto/admin/access.xml b/source/packages/com_mokosuiteresto/admin/access.xml index be342e7..68a6cc3 100644 --- a/source/packages/com_mokosuiteresto/admin/access.xml +++ b/source/packages/com_mokosuiteresto/admin/access.xml @@ -1,11 +1,22 @@ -
- - - - - - -
+
+ + + + + + + + + + + + + + + + + +
diff --git a/source/packages/com_mokosuiteresto/admin/config.xml b/source/packages/com_mokosuiteresto/admin/config.xml index 9690c21..2e41d7c 100644 --- a/source/packages/com_mokosuiteresto/admin/config.xml +++ b/source/packages/com_mokosuiteresto/admin/config.xml @@ -1,6 +1,28 @@ -
- -
+
+ + + + +
+
+ + + + + + +
+
+ + + + + + +
+
+ +
diff --git a/source/packages/com_mokosuiteresto/admin/services/provider.php b/source/packages/com_mokosuiteresto/admin/services/provider.php index a7e02a6..6c33848 100644 --- a/source/packages/com_mokosuiteresto/admin/services/provider.php +++ b/source/packages/com_mokosuiteresto/admin/services/provider.php @@ -1,30 +1,26 @@ + * SPDX-License-Identifier: GPL-3.0-or-later + * Authored-by: Moko Consulting */ defined('_JEXEC') or die; -use Joomla\CMS\Dispatcher\ComponentDispatcherFactoryInterface; use Joomla\CMS\Extension\ComponentInterface; use Joomla\CMS\Extension\MVCComponent; +use Joomla\CMS\Dispatcher\ComponentDispatcherFactoryInterface; use Joomla\CMS\MVC\Factory\MVCFactoryInterface; -use Joomla\CMS\Router\ApiRouter; use Joomla\DI\Container; use Joomla\DI\ServiceProviderInterface; -return new class implements ServiceProviderInterface -{ - public function register(Container $container): void - { - $container->set( - ComponentInterface::class, - function (Container $container) { - $component = new MVCComponent($container->get(ComponentDispatcherFactoryInterface::class)); - $component->setMVCFactory($container->get(MVCFactoryInterface::class)); - return $component; - } - ); - } +return new class implements ServiceProviderInterface { + public function register(Container $container): void { + $container->set(ComponentInterface::class, function (Container $container) { + $c = new MVCComponent($container->get(ComponentDispatcherFactoryInterface::class)); + $c->setMVCFactory($container->get(MVCFactoryInterface::class)); + return $c; + }); + } }; diff --git a/source/packages/com_mokosuiteresto/admin/src/Controller/DisplayController.php b/source/packages/com_mokosuiteresto/admin/src/Controller/DisplayController.php index c6c8e56..58bb4d9 100644 --- a/source/packages/com_mokosuiteresto/admin/src/Controller/DisplayController.php +++ b/source/packages/com_mokosuiteresto/admin/src/Controller/DisplayController.php @@ -1,10 +1,12 @@ + * SPDX-License-Identifier: GPL-3.0-or-later + * Authored-by: Moko Consulting */ -namespace MokoConsulting\Component\MokoSuiteResto\Administrator\Controller; +namespace Moko\Component\MokoSuiteResto\Administrator\Controller; defined('_JEXEC') or die; @@ -12,5 +14,5 @@ use Joomla\CMS\MVC\Controller\BaseController; class DisplayController extends BaseController { - protected $default_view = 'restodashboard'; + protected $default_view = 'restodashboard'; } diff --git a/source/packages/com_mokosuiteresto/admin/src/Model/RestoDashboardModel.php b/source/packages/com_mokosuiteresto/admin/src/Model/RestoDashboardModel.php index c12d9e1..2bfce68 100644 --- a/source/packages/com_mokosuiteresto/admin/src/Model/RestoDashboardModel.php +++ b/source/packages/com_mokosuiteresto/admin/src/Model/RestoDashboardModel.php @@ -1,10 +1,12 @@ + * SPDX-License-Identifier: GPL-3.0-or-later + * Authored-by: Moko Consulting */ -namespace MokoConsulting\Component\MokoSuiteResto\Administrator\Model; +namespace Moko\Component\MokoSuiteResto\Administrator\Model; defined('_JEXEC') or die; diff --git a/source/packages/com_mokosuiteresto/admin/src/View/Inventory/HtmlView.php b/source/packages/com_mokosuiteresto/admin/src/View/Inventory/HtmlView.php new file mode 100644 index 0000000..ab71e18 --- /dev/null +++ b/source/packages/com_mokosuiteresto/admin/src/View/Inventory/HtmlView.php @@ -0,0 +1,23 @@ + + * SPDX-License-Identifier: GPL-3.0-or-later + * Authored-by: Moko Consulting + */ + +namespace Moko\Component\MokoSuiteResto\Administrator\View\Inventory; + +defined('_JEXEC') or die; + +use Joomla\CMS\MVC\View\HtmlView as BaseHtmlView; +use Joomla\CMS\Toolbar\ToolbarHelper; + +class HtmlView extends BaseHtmlView +{ + public function display($tpl = null): void + { + ToolbarHelper::title('MokoSuite Resto - Inventory'); + parent::display($tpl); + } +} diff --git a/source/packages/com_mokosuiteresto/admin/src/View/MenuItems/HtmlView.php b/source/packages/com_mokosuiteresto/admin/src/View/MenuItems/HtmlView.php new file mode 100644 index 0000000..aa0d4a4 --- /dev/null +++ b/source/packages/com_mokosuiteresto/admin/src/View/MenuItems/HtmlView.php @@ -0,0 +1,23 @@ + + * SPDX-License-Identifier: GPL-3.0-or-later + * Authored-by: Moko Consulting + */ + +namespace Moko\Component\MokoSuiteResto\Administrator\View\MenuItems; + +defined('_JEXEC') or die; + +use Joomla\CMS\MVC\View\HtmlView as BaseHtmlView; +use Joomla\CMS\Toolbar\ToolbarHelper; + +class HtmlView extends BaseHtmlView +{ + public function display($tpl = null): void + { + ToolbarHelper::title('MokoSuite Resto - Menu Items'); + parent::display($tpl); + } +} diff --git a/source/packages/com_mokosuiteresto/admin/src/View/Menus/HtmlView.php b/source/packages/com_mokosuiteresto/admin/src/View/Menus/HtmlView.php new file mode 100644 index 0000000..a5e1bab --- /dev/null +++ b/source/packages/com_mokosuiteresto/admin/src/View/Menus/HtmlView.php @@ -0,0 +1,23 @@ + + * SPDX-License-Identifier: GPL-3.0-or-later + * Authored-by: Moko Consulting + */ + +namespace Moko\Component\MokoSuiteResto\Administrator\View\Menus; + +defined('_JEXEC') or die; + +use Joomla\CMS\MVC\View\HtmlView as BaseHtmlView; +use Joomla\CMS\Toolbar\ToolbarHelper; + +class HtmlView extends BaseHtmlView +{ + public function display($tpl = null): void + { + ToolbarHelper::title('MokoSuite Resto - Menus'); + parent::display($tpl); + } +} diff --git a/source/packages/com_mokosuiteresto/admin/src/View/Orders/HtmlView.php b/source/packages/com_mokosuiteresto/admin/src/View/Orders/HtmlView.php new file mode 100644 index 0000000..713a9a2 --- /dev/null +++ b/source/packages/com_mokosuiteresto/admin/src/View/Orders/HtmlView.php @@ -0,0 +1,23 @@ + + * SPDX-License-Identifier: GPL-3.0-or-later + * Authored-by: Moko Consulting + */ + +namespace Moko\Component\MokoSuiteResto\Administrator\View\Orders; + +defined('_JEXEC') or die; + +use Joomla\CMS\MVC\View\HtmlView as BaseHtmlView; +use Joomla\CMS\Toolbar\ToolbarHelper; + +class HtmlView extends BaseHtmlView +{ + public function display($tpl = null): void + { + ToolbarHelper::title('MokoSuite Resto - Orders'); + parent::display($tpl); + } +} diff --git a/source/packages/com_mokosuiteresto/admin/src/View/Reservations/HtmlView.php b/source/packages/com_mokosuiteresto/admin/src/View/Reservations/HtmlView.php new file mode 100644 index 0000000..8dc3e62 --- /dev/null +++ b/source/packages/com_mokosuiteresto/admin/src/View/Reservations/HtmlView.php @@ -0,0 +1,23 @@ + + * SPDX-License-Identifier: GPL-3.0-or-later + * Authored-by: Moko Consulting + */ + +namespace Moko\Component\MokoSuiteResto\Administrator\View\Reservations; + +defined('_JEXEC') or die; + +use Joomla\CMS\MVC\View\HtmlView as BaseHtmlView; +use Joomla\CMS\Toolbar\ToolbarHelper; + +class HtmlView extends BaseHtmlView +{ + public function display($tpl = null): void + { + ToolbarHelper::title('MokoSuite Resto - Reservations'); + parent::display($tpl); + } +} diff --git a/source/packages/com_mokosuiteresto/admin/src/View/RestoDashboard/HtmlView.php b/source/packages/com_mokosuiteresto/admin/src/View/RestoDashboard/HtmlView.php index b47748b..94172eb 100644 --- a/source/packages/com_mokosuiteresto/admin/src/View/RestoDashboard/HtmlView.php +++ b/source/packages/com_mokosuiteresto/admin/src/View/RestoDashboard/HtmlView.php @@ -1,10 +1,12 @@ + * SPDX-License-Identifier: GPL-3.0-or-later + * Authored-by: Moko Consulting */ -namespace MokoConsulting\Component\MokoSuiteResto\Administrator\View\RestoDashboard; +namespace Moko\Component\MokoSuiteResto\Administrator\View\RestoDashboard; defined('_JEXEC') or die; @@ -13,9 +15,9 @@ use Joomla\CMS\Toolbar\ToolbarHelper; class HtmlView extends BaseHtmlView { - public function display($tpl = null): void - { - ToolbarHelper::title('Dashboard', 'generic'); - parent::display($tpl); - } + public function display($tpl = null): void + { + ToolbarHelper::title('MokoSuite Resto - Dashboard'); + parent::display($tpl); + } } diff --git a/source/packages/com_mokosuiteresto/admin/src/View/Tables/HtmlView.php b/source/packages/com_mokosuiteresto/admin/src/View/Tables/HtmlView.php new file mode 100644 index 0000000..dae0b9b --- /dev/null +++ b/source/packages/com_mokosuiteresto/admin/src/View/Tables/HtmlView.php @@ -0,0 +1,23 @@ + + * SPDX-License-Identifier: GPL-3.0-or-later + * Authored-by: Moko Consulting + */ + +namespace Moko\Component\MokoSuiteResto\Administrator\View\Tables; + +defined('_JEXEC') or die; + +use Joomla\CMS\MVC\View\HtmlView as BaseHtmlView; +use Joomla\CMS\Toolbar\ToolbarHelper; + +class HtmlView extends BaseHtmlView +{ + public function display($tpl = null): void + { + ToolbarHelper::title('MokoSuite Resto - Tables'); + parent::display($tpl); + } +} diff --git a/source/packages/com_mokosuiteresto/admin/tmpl/inventory/default.php b/source/packages/com_mokosuiteresto/admin/tmpl/inventory/default.php new file mode 100644 index 0000000..53bb549 --- /dev/null +++ b/source/packages/com_mokosuiteresto/admin/tmpl/inventory/default.php @@ -0,0 +1 @@ +

Inventory

Coming soon.

diff --git a/source/packages/com_mokosuiteresto/admin/tmpl/menuitems/default.php b/source/packages/com_mokosuiteresto/admin/tmpl/menuitems/default.php new file mode 100644 index 0000000..35ac32c --- /dev/null +++ b/source/packages/com_mokosuiteresto/admin/tmpl/menuitems/default.php @@ -0,0 +1 @@ +

Menu Items

Coming soon.

diff --git a/source/packages/com_mokosuiteresto/admin/tmpl/menus/default.php b/source/packages/com_mokosuiteresto/admin/tmpl/menus/default.php new file mode 100644 index 0000000..514320d --- /dev/null +++ b/source/packages/com_mokosuiteresto/admin/tmpl/menus/default.php @@ -0,0 +1 @@ +

Menus

Coming soon.

diff --git a/source/packages/com_mokosuiteresto/admin/tmpl/orders/default.php b/source/packages/com_mokosuiteresto/admin/tmpl/orders/default.php new file mode 100644 index 0000000..7aa45f7 --- /dev/null +++ b/source/packages/com_mokosuiteresto/admin/tmpl/orders/default.php @@ -0,0 +1 @@ +

Orders

Coming soon.

diff --git a/source/packages/com_mokosuiteresto/admin/tmpl/reservations/default.php b/source/packages/com_mokosuiteresto/admin/tmpl/reservations/default.php new file mode 100644 index 0000000..118fbac --- /dev/null +++ b/source/packages/com_mokosuiteresto/admin/tmpl/reservations/default.php @@ -0,0 +1 @@ +

Reservations

Coming soon.

diff --git a/source/packages/com_mokosuiteresto/admin/tmpl/restodashboard/default.php b/source/packages/com_mokosuiteresto/admin/tmpl/restodashboard/default.php index 589a88f..e80e602 100644 --- a/source/packages/com_mokosuiteresto/admin/tmpl/restodashboard/default.php +++ b/source/packages/com_mokosuiteresto/admin/tmpl/restodashboard/default.php @@ -1,15 +1 @@ - -
-
-

Dashboard

-

Manage dashboard here.

-
-
+

Dashboard

Coming soon.

diff --git a/source/packages/com_mokosuiteresto/admin/tmpl/tables/default.php b/source/packages/com_mokosuiteresto/admin/tmpl/tables/default.php new file mode 100644 index 0000000..36eaa2e --- /dev/null +++ b/source/packages/com_mokosuiteresto/admin/tmpl/tables/default.php @@ -0,0 +1 @@ +

Tables

Coming soon.

diff --git a/source/packages/com_mokosuiteresto/mokosuiteresto.xml b/source/packages/com_mokosuiteresto/mokosuiteresto.xml index 338251f..0fd7d01 100644 --- a/source/packages/com_mokosuiteresto/mokosuiteresto.xml +++ b/source/packages/com_mokosuiteresto/mokosuiteresto.xml @@ -1,33 +1,14 @@ - 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 - - + MokoSuite Resto + Moko Consulting + 2026-06-27 + Copyright (C) 2026 Moko Consulting. + GPL-3.0-or-later + 06.00.00 + Moko\Component\MokoSuiteResto + + servicessrctmpl + COM_MOKOSUITERESTO + 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 index 46e56c9..b6a5753 100644 --- 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 @@ -1,2 +1,2 @@ PLG_SYSTEM_MOKOSUITERESTO="System - MokoSuite Resto" -PLG_SYSTEM_MOKOSUITERESTO_DESC="Restaurant operations: menu, reservations, and order management" +PLG_SYSTEM_MOKOSUITERESTO_DESC="Menu management, table reservations, online ordering, kitchen display, and inventory" 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 index 46e56c9..b6a5753 100644 --- 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 @@ -1,2 +1,2 @@ PLG_SYSTEM_MOKOSUITERESTO="System - MokoSuite Resto" -PLG_SYSTEM_MOKOSUITERESTO_DESC="Restaurant operations: menu, reservations, and order management" +PLG_SYSTEM_MOKOSUITERESTO_DESC="Menu management, table reservations, online ordering, kitchen display, and inventory" diff --git a/source/packages/plg_system_mokosuiteresto/mokosuiteresto.xml b/source/packages/plg_system_mokosuiteresto/mokosuiteresto.xml index 7738e4e..c654799 100644 --- a/source/packages/plg_system_mokosuiteresto/mokosuiteresto.xml +++ b/source/packages/plg_system_mokosuiteresto/mokosuiteresto.xml @@ -26,32 +26,30 @@ sql/uninstall.mysql.sql -
+
+ - +
-
- +
+ - + +
- - + + + + +
-
- - - - - - - - +
+
diff --git a/source/packages/plg_system_mokosuiteresto/sql/install.mysql.sql b/source/packages/plg_system_mokosuiteresto/sql/install.mysql.sql index cf9e2e9..2a4c02e 100644 --- a/source/packages/plg_system_mokosuiteresto/sql/install.mysql.sql +++ b/source/packages/plg_system_mokosuiteresto/sql/install.mysql.sql @@ -1,23 +1,149 @@ --- Copyright (C) 2026 Moko Consulting --- SPDX-License-Identifier: GPL-3.0-or-later --- Authored-by: Moko Consulting +CREATE TABLE IF NOT EXISTS `#__mokosuiteresto_menus` ( + `id` INT UNSIGNED NOT NULL AUTO_INCREMENT, + `name` VARCHAR(255) NOT NULL, + `description` TEXT, + `menu_type` ENUM('breakfast','lunch','dinner','brunch','drinks','dessert','kids','catering','special') NOT NULL DEFAULT 'dinner', + `available_start` TIME DEFAULT NULL, + `available_end` TIME DEFAULT NULL, + `photo` VARCHAR(500) NOT NULL DEFAULT '', + `published` TINYINT NOT NULL DEFAULT 1, + `ordering` INT NOT NULL DEFAULT 0, + `created` DATETIME NOT NULL, + PRIMARY KEY (`id`), + KEY `idx_type` (`menu_type`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; -CREATE TABLE IF NOT EXISTS `#__mokosuiteresto_menus` (`id` INT UNSIGNED NOT NULL AUTO_INCREMENT, `name` VARCHAR(255) NOT NULL, `description` TEXT, `menu_type` ENUM('breakfast','lunch','dinner','brunch','drinks','desserts','specials','kids') NOT NULL DEFAULT 'dinner', `available_from` TIME DEFAULT NULL, `available_to` TIME DEFAULT NULL, `published` TINYINT NOT NULL DEFAULT 1, `ordering` INT NOT NULL DEFAULT 0, `created` DATETIME NOT NULL, PRIMARY KEY (`id`)) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; +CREATE TABLE IF NOT EXISTS `#__mokosuiteresto_menu_items` ( + `id` INT UNSIGNED NOT NULL AUTO_INCREMENT, + `menu_id` INT UNSIGNED NOT NULL, + `name` VARCHAR(255) NOT NULL, + `description` TEXT, + `category` VARCHAR(100) NOT NULL DEFAULT '', + `price` DECIMAL(10,2) NOT NULL, + `calories` SMALLINT UNSIGNED DEFAULT NULL, + `allergens` JSON DEFAULT NULL, + `dietary_tags` JSON DEFAULT NULL, + `available` TINYINT NOT NULL DEFAULT 1, + `featured` TINYINT NOT NULL DEFAULT 0, + `photo` VARCHAR(500) NOT NULL DEFAULT '', + `published` TINYINT NOT NULL DEFAULT 1, + `ordering` INT NOT NULL DEFAULT 0, + `created` DATETIME NOT NULL, + PRIMARY KEY (`id`), + KEY `idx_menu` (`menu_id`), + KEY `idx_category` (`category`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; -CREATE TABLE IF NOT EXISTS `#__mokosuiteresto_menu_items` (`id` INT UNSIGNED NOT NULL AUTO_INCREMENT, `menu_id` INT UNSIGNED NOT NULL, `name` VARCHAR(255) NOT NULL, `description` TEXT, `category` VARCHAR(100) NOT NULL DEFAULT '', `price` DECIMAL(10,2) NOT NULL, `calories` SMALLINT UNSIGNED DEFAULT NULL, `allergens` VARCHAR(500) NOT NULL DEFAULT '', `dietary_tags` VARCHAR(255) NOT NULL DEFAULT '', `prep_time_minutes` SMALLINT UNSIGNED NOT NULL DEFAULT 15, `photo` VARCHAR(500) NOT NULL DEFAULT '', `available` TINYINT NOT NULL DEFAULT 1, `published` TINYINT NOT NULL DEFAULT 1, `ordering` INT NOT NULL DEFAULT 0, `created` DATETIME NOT NULL, PRIMARY KEY (`id`), KEY `idx_menu` (`menu_id`)) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; +CREATE TABLE IF NOT EXISTS `#__mokosuiteresto_tables` ( + `id` INT UNSIGNED NOT NULL AUTO_INCREMENT, + `table_number` VARCHAR(20) NOT NULL, + `section` VARCHAR(50) NOT NULL DEFAULT '', + `capacity` TINYINT UNSIGNED NOT NULL DEFAULT 4, + `table_type` ENUM('indoor','outdoor','patio','bar','private','booth') NOT NULL DEFAULT 'indoor', + `status` ENUM('available','occupied','reserved','cleaning','closed') NOT NULL DEFAULT 'available', + `published` TINYINT NOT NULL DEFAULT 1, + `ordering` INT NOT NULL DEFAULT 0, + `created` DATETIME NOT NULL, + PRIMARY KEY (`id`), + UNIQUE KEY `idx_number` (`table_number`), + KEY `idx_status` (`status`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; -CREATE TABLE IF NOT EXISTS `#__mokosuiteresto_modifiers` (`id` INT UNSIGNED NOT NULL AUTO_INCREMENT, `menu_item_id` INT UNSIGNED NOT NULL, `name` VARCHAR(255) NOT NULL, `modifier_type` ENUM('add_on','size','preparation','sauce','side','substitution') NOT NULL DEFAULT 'add_on', `price_adjustment` DECIMAL(10,2) NOT NULL DEFAULT 0.00, `ordering` INT NOT NULL DEFAULT 0, PRIMARY KEY (`id`), KEY `idx_item` (`menu_item_id`)) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; +CREATE TABLE IF NOT EXISTS `#__mokosuiteresto_reservations` ( + `id` INT UNSIGNED NOT NULL AUTO_INCREMENT, + `reservation_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 '', + `table_id` INT UNSIGNED DEFAULT NULL, + `party_size` TINYINT UNSIGNED NOT NULL DEFAULT 2, + `reservation_date` DATE NOT NULL, + `reservation_time` TIME NOT NULL, + `duration_minutes` SMALLINT UNSIGNED NOT NULL DEFAULT 90, + `status` ENUM('pending','confirmed','seated','completed','cancelled','no_show') NOT NULL DEFAULT 'pending', + `special_requests` TEXT, + `created` DATETIME NOT NULL, + `created_by` INT NOT NULL DEFAULT 0, + PRIMARY KEY (`id`), + UNIQUE KEY `idx_ref` (`reservation_ref`), + KEY `idx_customer` (`customer_contact_id`), + KEY `idx_table` (`table_id`), + KEY `idx_date` (`reservation_date`), + KEY `idx_status` (`status`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; -CREATE TABLE IF NOT EXISTS `#__mokosuiteresto_tables` (`id` INT UNSIGNED NOT NULL AUTO_INCREMENT, `table_number` VARCHAR(20) NOT NULL, `section` VARCHAR(100) NOT NULL DEFAULT '', `capacity` TINYINT UNSIGNED NOT NULL DEFAULT 4, `table_type` ENUM('indoor','outdoor','patio','bar','private','booth') NOT NULL DEFAULT 'indoor', `status` ENUM('available','occupied','reserved','cleaning','closed') NOT NULL DEFAULT 'available', `published` TINYINT NOT NULL DEFAULT 1, `ordering` INT NOT NULL DEFAULT 0, PRIMARY KEY (`id`), KEY `idx_status` (`status`)) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; +CREATE TABLE IF NOT EXISTS `#__mokosuiteresto_orders` ( + `id` INT UNSIGNED NOT NULL AUTO_INCREMENT, + `order_ref` VARCHAR(20) NOT NULL, + `table_id` INT UNSIGNED DEFAULT NULL, + `customer_contact_id` INT DEFAULT NULL, + `customer_name` VARCHAR(255) NOT NULL DEFAULT '', + `order_type` ENUM('dine_in','takeout','delivery','catering') NOT NULL DEFAULT 'dine_in', + `status` ENUM('pending','confirmed','preparing','ready','served','completed','cancelled') NOT NULL DEFAULT 'pending', + `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, + `discount` DECIMAL(10,2) NOT NULL DEFAULT 0.00, + `total` DECIMAL(10,2) NOT NULL DEFAULT 0.00, + `payment_method` ENUM('cash','card','online','gift_card','split') NOT NULL DEFAULT 'card', + `payment_status` ENUM('pending','paid','refunded','voided') NOT NULL DEFAULT 'pending', + `notes` TEXT, + `ordered_at` DATETIME NOT NULL, + `completed_at` DATETIME DEFAULT NULL, + `created` DATETIME NOT NULL, + `created_by` INT NOT NULL DEFAULT 0, + PRIMARY KEY (`id`), + UNIQUE KEY `idx_ref` (`order_ref`), + KEY `idx_table` (`table_id`), + KEY `idx_status` (`status`), + KEY `idx_type` (`order_type`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; -CREATE TABLE IF NOT EXISTS `#__mokosuiteresto_reservations` (`id` INT UNSIGNED NOT NULL AUTO_INCREMENT, `reservation_ref` VARCHAR(20) NOT NULL, `customer_contact_id` INT DEFAULT NULL, `customer_name` VARCHAR(255) NOT NULL, `customer_phone` VARCHAR(50) NOT NULL DEFAULT '', `table_id` INT UNSIGNED DEFAULT NULL, `party_size` TINYINT UNSIGNED NOT NULL DEFAULT 2, `reservation_date` DATE NOT NULL, `reservation_time` TIME NOT NULL, `duration_minutes` SMALLINT UNSIGNED NOT NULL DEFAULT 90, `status` ENUM('pending','confirmed','seated','completed','cancelled','no_show') NOT NULL DEFAULT 'pending', `special_requests` TEXT, `created` DATETIME NOT NULL, PRIMARY KEY (`id`), UNIQUE KEY `idx_ref` (`reservation_ref`), KEY `idx_customer` (`customer_contact_id`), KEY `idx_date` (`reservation_date`), KEY `idx_status` (`status`)) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; +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` TINYINT UNSIGNED NOT NULL DEFAULT 1, + `unit_price` DECIMAL(10,2) NOT NULL, + `modifiers_json` JSON DEFAULT NULL, + `modifiers_price` DECIMAL(10,2) NOT NULL DEFAULT 0.00, + `line_total` DECIMAL(10,2) NOT NULL, + `status` ENUM('pending','preparing','ready','served','cancelled') NOT NULL DEFAULT 'pending', + `special_instructions` TEXT, + PRIMARY KEY (`id`), + KEY `idx_order` (`order_id`), + KEY `idx_item` (`menu_item_id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; -CREATE TABLE IF NOT EXISTS `#__mokosuiteresto_orders` (`id` INT UNSIGNED NOT NULL AUTO_INCREMENT, `order_ref` VARCHAR(20) NOT NULL, `order_type` ENUM('dine_in','takeout','delivery','catering') NOT NULL DEFAULT 'dine_in', `table_id` INT UNSIGNED DEFAULT NULL, `customer_name` VARCHAR(255) NOT NULL DEFAULT '', `status` ENUM('pending','preparing','ready','served','completed','cancelled') NOT NULL DEFAULT 'pending', `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` ENUM('cash','card','tab','comp') NOT NULL DEFAULT 'card', `payment_status` ENUM('pending','paid','refunded') NOT NULL DEFAULT 'pending', `server_name` VARCHAR(255) NOT NULL DEFAULT '', `notes` TEXT, `created` DATETIME NOT NULL, `created_by` INT NOT NULL DEFAULT 0, PRIMARY KEY (`id`), UNIQUE KEY `idx_ref` (`order_ref`), KEY `idx_table` (`table_id`), KEY `idx_status` (`status`), KEY `idx_created` (`created`)) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; +CREATE TABLE IF NOT EXISTS `#__mokosuiteresto_inventory` ( + `id` INT UNSIGNED NOT NULL AUTO_INCREMENT, + `name` VARCHAR(255) NOT NULL, + `category` VARCHAR(100) NOT NULL DEFAULT '', + `unit` ENUM('ea','oz','lb','kg','gal','ltr','case','box','bag','other') NOT NULL DEFAULT 'ea', + `current_stock` DECIMAL(10,2) NOT NULL DEFAULT 0.00, + `minimum_stock` DECIMAL(10,2) NOT NULL DEFAULT 0.00, + `cost_per_unit` DECIMAL(10,4) NOT NULL DEFAULT 0.0000, + `supplier` VARCHAR(255) NOT NULL DEFAULT '', + `expiry_date` DATE DEFAULT NULL, + `notes` TEXT, + `published` TINYINT NOT NULL DEFAULT 1, + `created` DATETIME NOT NULL, + PRIMARY KEY (`id`), + KEY `idx_category` (`category`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; -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` SMALLINT UNSIGNED NOT NULL DEFAULT 1, `unit_price` DECIMAL(10,2) NOT NULL, `modifiers` JSON DEFAULT NULL, `modifiers_price` DECIMAL(10,2) NOT NULL DEFAULT 0.00, `special_instructions` VARCHAR(500) NOT NULL DEFAULT '', `status` ENUM('pending','preparing','ready','served','cancelled') NOT NULL DEFAULT 'pending', PRIMARY KEY (`id`), KEY `idx_order` (`order_id`)) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; - -CREATE TABLE IF NOT EXISTS `#__mokosuiteresto_inventory` (`id` INT UNSIGNED NOT NULL AUTO_INCREMENT, `name` VARCHAR(255) NOT NULL, `category` ENUM('produce','meat','seafood','dairy','dry_goods','beverages','supplies','other') NOT NULL DEFAULT 'other', `unit` VARCHAR(50) NOT NULL DEFAULT 'each', `current_qty` DECIMAL(10,2) NOT NULL DEFAULT 0.00, `reorder_level` DECIMAL(10,2) NOT NULL DEFAULT 0.00, `unit_cost` DECIMAL(10,2) NOT NULL DEFAULT 0.00, `supplier` VARCHAR(255) NOT NULL DEFAULT '', `created` DATETIME NOT NULL, PRIMARY KEY (`id`), KEY `idx_category` (`category`)) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; - -CREATE TABLE IF NOT EXISTS `#__mokosuiteresto_inventory_transactions` (`id` INT UNSIGNED NOT NULL AUTO_INCREMENT, `inventory_id` INT UNSIGNED NOT NULL, `transaction_type` ENUM('received','used','waste','adjustment','transfer') NOT NULL DEFAULT 'received', `quantity` DECIMAL(10,2) NOT NULL, `unit_cost` DECIMAL(10,2) NOT NULL DEFAULT 0.00, `reference` VARCHAR(255) NOT NULL DEFAULT '', `created` DATETIME NOT NULL, `created_by` INT NOT NULL DEFAULT 0, PRIMARY KEY (`id`), KEY `idx_inventory` (`inventory_id`)) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; - -CREATE TABLE IF NOT EXISTS `#__mokosuiteresto_staff_shifts` (`id` INT UNSIGNED NOT NULL AUTO_INCREMENT, `staff_name` VARCHAR(255) NOT NULL, `contact_id` INT DEFAULT NULL, `role` ENUM('server','bartender','host','cook','chef','dishwasher','manager','busser') NOT NULL DEFAULT 'server', `shift_date` DATE NOT NULL, `start_time` TIME NOT NULL, `end_time` TIME NOT NULL, `status` ENUM('scheduled','active','completed','no_show','cancelled') NOT NULL DEFAULT 'scheduled', `tips_earned` DECIMAL(10,2) NOT NULL DEFAULT 0.00, `created` DATETIME NOT NULL, PRIMARY KEY (`id`), KEY `idx_date` (`shift_date`), KEY `idx_role` (`role`)) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; +CREATE TABLE IF NOT EXISTS `#__mokosuiteresto_inventory_transactions` ( + `id` INT UNSIGNED NOT NULL AUTO_INCREMENT, + `inventory_id` INT UNSIGNED NOT NULL, + `transaction_type` ENUM('received','used','wasted','adjusted','returned') NOT NULL, + `quantity` DECIMAL(10,2) NOT NULL, + `cost` DECIMAL(10,2) DEFAULT NULL, + `reference` VARCHAR(255) NOT NULL DEFAULT '', + `notes` TEXT, + `created` DATETIME NOT NULL, + `created_by` INT NOT NULL DEFAULT 0, + PRIMARY KEY (`id`), + KEY `idx_inventory` (`inventory_id`), + KEY `idx_type` (`transaction_type`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; diff --git a/source/packages/plg_system_mokosuiteresto/sql/uninstall.mysql.sql b/source/packages/plg_system_mokosuiteresto/sql/uninstall.mysql.sql index 1f67bf9..3bb07c7 100644 --- a/source/packages/plg_system_mokosuiteresto/sql/uninstall.mysql.sql +++ b/source/packages/plg_system_mokosuiteresto/sql/uninstall.mysql.sql @@ -1,14 +1,8 @@ --- Copyright (C) 2026 Moko Consulting --- SPDX-License-Identifier: GPL-3.0-or-later --- Authored-by: Moko Consulting - -DROP TABLE IF EXISTS `#__mokosuiteresto_staff_shifts`; 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_webservices_mokosuiteresto/mokosuiteresto.xml b/source/packages/plg_webservices_mokosuiteresto/mokosuiteresto.xml index c44b42c..b6de54b 100644 --- a/source/packages/plg_webservices_mokosuiteresto/mokosuiteresto.xml +++ b/source/packages/plg_webservices_mokosuiteresto/mokosuiteresto.xml @@ -1,17 +1,10 @@ - + - plg_webservices_mokosuiteresto - 0.0.0 - 2026-06 - Moko Consulting - hello@mokoconsulting.tech - https://mokoconsulting.tech - (C) 2026 Moko Consulting - GPL-3.0-or-later - MokoSuiteResto webservices plugin - MokoConsulting\Plugin\WebServices\MokoSuiteResto - - src - services - + Web Services - MokoSuite Resto + mokosuiteresto + Moko Consulting + 06.00.00 + GPL-3.0-or-later + Moko\Plugin\WebServices\MokoSuiteResto + srcservices diff --git a/source/packages/plg_webservices_mokosuiteresto/services/provider.php b/source/packages/plg_webservices_mokosuiteresto/services/provider.php index 4a1da52..42f24e8 100644 --- a/source/packages/plg_webservices_mokosuiteresto/services/provider.php +++ b/source/packages/plg_webservices_mokosuiteresto/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\MokoSuiteResto\Extension\MokoSuiteResto; +use Moko\Plugin\WebServices\MokoSuiteResto\Extension\MokoSuiteResto; -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 MokoSuiteResto($dispatcher, (array) PluginHelper::getPlugin('webservices', 'mokosuiteresto')); - $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 MokoSuiteResto($container->get(DispatcherInterface::class), (array) PluginHelper::getPlugin('webservices', 'mokosuiteresto')); + }); + } }; diff --git a/source/packages/plg_webservices_mokosuiteresto/src/Extension/MokoSuiteResto.php b/source/packages/plg_webservices_mokosuiteresto/src/Extension/MokoSuiteResto.php index 0fb0c2e..f573ffa 100644 --- a/source/packages/plg_webservices_mokosuiteresto/src/Extension/MokoSuiteResto.php +++ b/source/packages/plg_webservices_mokosuiteresto/src/Extension/MokoSuiteResto.php @@ -1,34 +1,36 @@ + * SPDX-License-Identifier: GPL-3.0-or-later + * Authored-by: Moko Consulting */ -namespace MokoConsulting\Plugin\WebServices\MokoSuiteResto\Extension; +namespace Moko\Plugin\WebServices\MokoSuiteResto\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 MokoSuiteResto extends CMSPlugin implements SubscriberInterface +class MokoSuiteResto 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/mokosuiteresto/menus', 'menus'); - $router->createCRUDRoutes('v1/mokosuiteresto/menu-items', 'menuitems'); - $router->createCRUDRoutes('v1/mokosuiteresto/tables', 'tables'); - $router->createCRUDRoutes('v1/mokosuiteresto/reservations', 'reservations'); - $router->createCRUDRoutes('v1/mokosuiteresto/orders', 'orders'); - $router->createCRUDRoutes('v1/mokosuiteresto/inventory', 'inventory'); - } + public function onBeforeApiRoute(&$event): void + { + $router = $event->getArgument('router'); + $opts = ['component' => 'com_mokosuiteresto']; + + $router->createCRUDRoutes('v1/mokosuiteresto/menus', 'menus', $opts); + $router->createCRUDRoutes('v1/mokosuiteresto/menuitems', 'menuitems', $opts); + $router->createCRUDRoutes('v1/mokosuiteresto/tables', 'tables', $opts); + $router->createCRUDRoutes('v1/mokosuiteresto/reservations', 'reservations', $opts); + $router->createCRUDRoutes('v1/mokosuiteresto/orders', 'orders', $opts); + $router->createCRUDRoutes('v1/mokosuiteresto/inventory', 'inventory', $opts); + $router->createCRUDRoutes('v1/mokosuiteresto/inventory-transactions', 'inventorytransactions', $opts); + } } diff --git a/source/pkg_mokosuiteresto.xml b/source/pkg_mokosuiteresto.xml index cd180ca..f2a4d40 100644 --- a/source/pkg_mokosuiteresto.xml +++ b/source/pkg_mokosuiteresto.xml @@ -9,14 +9,12 @@ https://mokoconsulting.tech Copyright (C) 2026 Moko Consulting. All rights reserved. GNU General Public License version 3 or later; see LICENSE - Restaurant operations: menu, reservations, and order management + Menu management, table reservations, online ordering, kitchen display, and inventory 8.3 true plg_system_mokosuiteresto.zip - com_mokosuiteresto.zip - plg_webservices_mokosuiteresto.zip https://git.mokoconsulting.tech/MokoConsulting/MokoSuiteResto/updates.xml