diff --git a/source/packages/plg_system_mokosuiteauto/language/en-GB/plg_system_mokosuiteauto.ini b/source/packages/plg_system_mokosuiteauto/language/en-GB/plg_system_mokosuiteauto.ini new file mode 100644 index 0000000..1452959 --- /dev/null +++ b/source/packages/plg_system_mokosuiteauto/language/en-GB/plg_system_mokosuiteauto.ini @@ -0,0 +1,2 @@ +PLG_SYSTEM_MOKOSUITEAUTO="System - MokoSuite Auto" +PLG_SYSTEM_MOKOSUITEAUTO_DESC="Auto dealership management — VIN inventory, deals, F&I, trade-ins, test drives, financing, service department." diff --git a/source/packages/plg_system_mokosuiteauto/language/en-GB/plg_system_mokosuiteauto.sys.ini b/source/packages/plg_system_mokosuiteauto/language/en-GB/plg_system_mokosuiteauto.sys.ini new file mode 100644 index 0000000..1452959 --- /dev/null +++ b/source/packages/plg_system_mokosuiteauto/language/en-GB/plg_system_mokosuiteauto.sys.ini @@ -0,0 +1,2 @@ +PLG_SYSTEM_MOKOSUITEAUTO="System - MokoSuite Auto" +PLG_SYSTEM_MOKOSUITEAUTO_DESC="Auto dealership management — VIN inventory, deals, F&I, trade-ins, test drives, financing, service department." diff --git a/source/packages/plg_system_mokosuiteauto/mokosuiteauto.xml b/source/packages/plg_system_mokosuiteauto/mokosuiteauto.xml new file mode 100644 index 0000000..5a34724 --- /dev/null +++ b/source/packages/plg_system_mokosuiteauto/mokosuiteauto.xml @@ -0,0 +1,45 @@ + + + System - MokoSuite Auto + mokosuiteauto + Moko Consulting + 2026-06-22 + Copyright (C) 2026 Moko Consulting. All rights reserved. + GPL-3.0-or-later + hello@mokoconsulting.tech + https://mokoconsulting.tech + 01.00.00 + 8.3 + PLG_SYSTEM_MOKOSUITEAUTO_DESC + Moko\Plugin\System\MokoSuiteAuto + + src + services + language + sql + + + en-GB/plg_system_mokosuiteauto.ini + en-GB/plg_system_mokosuiteauto.sys.ini + + sql/install.mysql.sql + sql/uninstall.mysql.sql + + +
+ + + + + +
+
+ + +
+
+ +
+
+
+
diff --git a/source/packages/plg_system_mokosuiteauto/services/provider.php b/source/packages/plg_system_mokosuiteauto/services/provider.php new file mode 100644 index 0000000..0e1a208 --- /dev/null +++ b/source/packages/plg_system_mokosuiteauto/services/provider.php @@ -0,0 +1,27 @@ +set( + PluginInterface::class, + function (Container $container) { + $dispatcher = $container->get(DispatcherInterface::class); + $plugin = new Auto($dispatcher, (array) PluginHelper::getPlugin('system', 'mokosuiteauto')); + $plugin->setApplication(Factory::getApplication()); + return $plugin; + } + ); + } +}; diff --git a/source/packages/plg_system_mokosuiteauto/sql/install.mysql.sql b/source/packages/plg_system_mokosuiteauto/sql/install.mysql.sql new file mode 100644 index 0000000..d959ce2 --- /dev/null +++ b/source/packages/plg_system_mokosuiteauto/sql/install.mysql.sql @@ -0,0 +1,152 @@ +-- +-- MokoSuite Auto Tables +-- + +CREATE TABLE IF NOT EXISTS `#__mokosuiteauto_vehicles` ( + `id` INT UNSIGNED NOT NULL AUTO_INCREMENT, + `vin` CHAR(17) NOT NULL, + `stock_number` VARCHAR(20) NOT NULL DEFAULT '', + `year` SMALLINT UNSIGNED NOT NULL, + `make` VARCHAR(100) NOT NULL, + `model` VARCHAR(100) NOT NULL, + `trim_level` VARCHAR(100) NOT NULL DEFAULT '', + `body_style` VARCHAR(50) NOT NULL DEFAULT '', + `exterior_color` VARCHAR(50) NOT NULL DEFAULT '', + `interior_color` VARCHAR(50) NOT NULL DEFAULT '', + `engine` VARCHAR(100) NOT NULL DEFAULT '', + `transmission` ENUM('automatic','manual','cvt') NOT NULL DEFAULT 'automatic', + `drivetrain` ENUM('fwd','rwd','awd','4wd') NOT NULL DEFAULT 'fwd', + `mileage` INT UNSIGNED NOT NULL DEFAULT 0, + `condition_type` ENUM('new','used','certified') NOT NULL DEFAULT 'used', + `status` ENUM('in_transit','on_lot','sold','wholesale','trade_pending') NOT NULL DEFAULT 'on_lot', + `invoice_price` DECIMAL(12,2) NOT NULL DEFAULT 0.00, + `list_price` DECIMAL(12,2) NOT NULL DEFAULT 0.00, + `internet_price` DECIMAL(12,2) DEFAULT NULL, + `reconditioning_cost` DECIMAL(10,2) NOT NULL DEFAULT 0.00, + `lot_date` DATE DEFAULT NULL, + `sold_date` DATE DEFAULT NULL, + `notes` TEXT, + `created` DATETIME NOT NULL, + `modified` DATETIME DEFAULT NULL, + `created_by` INT NOT NULL DEFAULT 0, + PRIMARY KEY (`id`), + UNIQUE KEY `idx_vin` (`vin`), + KEY `idx_stock` (`stock_number`), + KEY `idx_status` (`status`), + KEY `idx_condition` (`condition_type`), + KEY `idx_make_model` (`make`, `model`), + KEY `idx_lot_date` (`lot_date`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; + +CREATE TABLE IF NOT EXISTS `#__mokosuiteauto_deals` ( + `id` INT UNSIGNED NOT NULL AUTO_INCREMENT, + `vehicle_id` INT UNSIGNED NOT NULL, + `buyer_contact_id` INT NOT NULL, + `salesperson_id` INT DEFAULT NULL, + `fi_manager_id` INT DEFAULT NULL, + `sale_price` DECIMAL(12,2) NOT NULL, + `trade_allowance` DECIMAL(12,2) NOT NULL DEFAULT 0.00, + `trade_payoff` DECIMAL(12,2) NOT NULL DEFAULT 0.00, + `down_payment` DECIMAL(12,2) NOT NULL DEFAULT 0.00, + `financed_amount` DECIMAL(12,2) NOT NULL DEFAULT 0.00, + `apr` DECIMAL(5,2) DEFAULT NULL, + `term_months` INT UNSIGNED DEFAULT NULL, + `monthly_payment` DECIMAL(10,2) DEFAULT NULL, + `front_gross` DECIMAL(12,2) NOT NULL DEFAULT 0.00, + `back_gross` DECIMAL(12,2) NOT NULL DEFAULT 0.00, + `total_gross` DECIMAL(12,2) NOT NULL DEFAULT 0.00, + `status` ENUM('prospect','negotiating','pending_finance','approved','delivered','unwound') NOT NULL DEFAULT 'prospect', + `deal_number` VARCHAR(20) NOT NULL DEFAULT '', + `created` DATETIME NOT NULL, + `modified` DATETIME DEFAULT NULL, + `delivered_at` DATETIME DEFAULT NULL, + `created_by` INT NOT NULL DEFAULT 0, + PRIMARY KEY (`id`), + KEY `idx_vehicle` (`vehicle_id`), + KEY `idx_buyer` (`buyer_contact_id`), + KEY `idx_salesperson` (`salesperson_id`), + KEY `idx_status` (`status`), + KEY `idx_deal_number` (`deal_number`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; + +CREATE TABLE IF NOT EXISTS `#__mokosuiteauto_fi_products` ( + `id` INT UNSIGNED NOT NULL AUTO_INCREMENT, + `deal_id` INT UNSIGNED NOT NULL, + `product_name` VARCHAR(255) NOT NULL, + `cost` DECIMAL(10,2) NOT NULL DEFAULT 0.00, + `price` DECIMAL(10,2) NOT NULL DEFAULT 0.00, + `profit` DECIMAL(10,2) NOT NULL DEFAULT 0.00, + `term_months` INT UNSIGNED DEFAULT NULL, + `created` DATETIME NOT NULL, + PRIMARY KEY (`id`), + KEY `idx_deal` (`deal_id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; + +CREATE TABLE IF NOT EXISTS `#__mokosuiteauto_tradeins` ( + `id` INT UNSIGNED NOT NULL AUTO_INCREMENT, + `deal_id` INT UNSIGNED DEFAULT NULL, + `vin` CHAR(17) NOT NULL DEFAULT '', + `year` SMALLINT UNSIGNED DEFAULT NULL, + `make` VARCHAR(100) NOT NULL DEFAULT '', + `model` VARCHAR(100) NOT NULL DEFAULT '', + `mileage` INT UNSIGNED NOT NULL DEFAULT 0, + `condition_grade` ENUM('excellent','good','fair','poor') NOT NULL DEFAULT 'good', + `appraisal_value` DECIMAL(12,2) NOT NULL DEFAULT 0.00, + `payoff_amount` DECIMAL(12,2) NOT NULL DEFAULT 0.00, + `equity` DECIMAL(12,2) NOT NULL DEFAULT 0.00, + `status` ENUM('pending_review','approved','applied','rejected') NOT NULL DEFAULT 'pending_review', + `owner_contact_id` INT DEFAULT NULL, + `appraised_by` INT DEFAULT NULL, + `notes` TEXT, + `created` DATETIME NOT NULL, + PRIMARY KEY (`id`), + KEY `idx_deal` (`deal_id`), + KEY `idx_vin` (`vin`), + KEY `idx_status` (`status`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; + +CREATE TABLE IF NOT EXISTS `#__mokosuiteauto_test_drives` ( + `id` INT UNSIGNED NOT NULL AUTO_INCREMENT, + `vehicle_id` INT UNSIGNED NOT NULL, + `contact_id` INT NOT NULL, + `salesperson_id` INT DEFAULT NULL, + `scheduled_at` DATETIME NOT NULL, + `started_at` DATETIME DEFAULT NULL, + `ended_at` DATETIME DEFAULT NULL, + `mileage_out` INT UNSIGNED DEFAULT NULL, + `mileage_in` INT UNSIGNED DEFAULT NULL, + `status` ENUM('scheduled','in_progress','completed','cancelled','no_show') NOT NULL DEFAULT 'scheduled', + `notes` TEXT, + `created` DATETIME NOT NULL, + PRIMARY KEY (`id`), + KEY `idx_vehicle` (`vehicle_id`), + KEY `idx_contact` (`contact_id`), + KEY `idx_date` (`scheduled_at`), + KEY `idx_status` (`status`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; + +CREATE TABLE IF NOT EXISTS `#__mokosuiteauto_service_orders` ( + `id` INT UNSIGNED NOT NULL AUTO_INCREMENT, + `ro_number` VARCHAR(20) NOT NULL DEFAULT '', + `vin` CHAR(17) NOT NULL DEFAULT '', + `contact_id` INT DEFAULT NULL, + `advisor_id` INT DEFAULT NULL, + `technician_id` INT DEFAULT NULL, + `type` ENUM('repair','maintenance','warranty','recall','inspection') NOT NULL DEFAULT 'repair', + `concern` TEXT, + `diagnosis` TEXT, + `resolution` TEXT, + `parts_total` DECIMAL(10,2) NOT NULL DEFAULT 0.00, + `labor_total` DECIMAL(10,2) NOT NULL DEFAULT 0.00, + `total` DECIMAL(10,2) NOT NULL DEFAULT 0.00, + `status` ENUM('open','in_progress','waiting_parts','completed','invoiced') NOT NULL DEFAULT 'open', + `opened_at` DATETIME NOT NULL, + `completed_at` DATETIME DEFAULT NULL, + `created` DATETIME NOT NULL, + `created_by` INT NOT NULL DEFAULT 0, + PRIMARY KEY (`id`), + KEY `idx_ro` (`ro_number`), + KEY `idx_vin` (`vin`), + KEY `idx_contact` (`contact_id`), + KEY `idx_status` (`status`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; diff --git a/source/packages/plg_system_mokosuiteauto/sql/uninstall.mysql.sql b/source/packages/plg_system_mokosuiteauto/sql/uninstall.mysql.sql new file mode 100644 index 0000000..60b7a9d --- /dev/null +++ b/source/packages/plg_system_mokosuiteauto/sql/uninstall.mysql.sql @@ -0,0 +1,10 @@ +-- +-- MokoSuite Auto — Uninstall +-- + +DROP TABLE IF EXISTS `#__mokosuiteauto_service_orders`; +DROP TABLE IF EXISTS `#__mokosuiteauto_test_drives`; +DROP TABLE IF EXISTS `#__mokosuiteauto_tradeins`; +DROP TABLE IF EXISTS `#__mokosuiteauto_fi_products`; +DROP TABLE IF EXISTS `#__mokosuiteauto_deals`; +DROP TABLE IF EXISTS `#__mokosuiteauto_vehicles`; diff --git a/source/packages/plg_system_mokosuiteauto/src/Extension/Auto.php b/source/packages/plg_system_mokosuiteauto/src/Extension/Auto.php new file mode 100644 index 0000000..fea2ba7 --- /dev/null +++ b/source/packages/plg_system_mokosuiteauto/src/Extension/Auto.php @@ -0,0 +1,18 @@ +