From 77ce2c3043114eae5d1c3f0fc94e3af84912a240 Mon Sep 17 00:00:00 2001 From: olli Date: Sun, 14 Dec 2025 15:13:30 +0100 Subject: [PATCH] refactor: Move billing module assets to vendor package MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit BREAKING CHANGE: All billing-related frontend code moved to billing module Changes: - Remove billing Vue components from core (InvoiceForm, InvoiceManagement, etc.) - Remove billing config from core (billing_module.yaml) - Update router.js to dynamically load billing routes from module - Update Dashboard.vue to dynamically load InvoicesDashboardWidget - Add webpack alias '@billing-module' pointing to vendor/mycrm/billing-module - Billing module is now fully self-contained The billing module now exports: - routes.js: Route definitions for /billing/* paths - components.js: Reusable components (InvoicesDashboardWidget) - index.js: Main module exports Frontend assets are loaded via '@billing-module' alias in webpack. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 --- assets/js/router.js | 14 +- assets/js/views/Dashboard.vue | 24 + assets/js/views/InvoiceForm.vue | 645 -------------------------- assets/js/views/InvoiceManagement.vue | 298 ------------ assets/js/views/PDFUploadForm.vue | 102 ---- assets/js/views/PaymentForm.vue | 121 ----- config/packages/billing_module.yaml | 6 - webpack.config.js | 3 +- 8 files changed, 37 insertions(+), 1176 deletions(-) delete mode 100644 assets/js/views/InvoiceForm.vue delete mode 100644 assets/js/views/InvoiceManagement.vue delete mode 100644 assets/js/views/PDFUploadForm.vue delete mode 100644 assets/js/views/PaymentForm.vue delete mode 100644 config/packages/billing_module.yaml diff --git a/assets/js/router.js b/assets/js/router.js index cdb380b..917c059 100644 --- a/assets/js/router.js +++ b/assets/js/router.js @@ -7,7 +7,15 @@ import ProjectStatusManagement from './views/ProjectStatusManagement.vue'; import UserManagement from './views/UserManagement.vue'; import RoleManagement from './views/RoleManagement.vue'; import SettingsManagement from './views/SettingsManagement.vue'; -import InvoiceManagement from './views/InvoiceManagement.vue'; + +// Import Billing Module Routes +let billingRoutes = []; +try { + const billingModule = require('@billing-module/assets/js/routes.js'); + billingRoutes = billingModule.default || []; +} catch (e) { + console.warn('Billing module not available:', e.message); +} const routes = [ { path: '/', name: 'dashboard', component: Dashboard }, @@ -18,8 +26,8 @@ const routes = [ { path: '/users', name: 'users', component: UserManagement, meta: { requiresAdmin: true } }, { path: '/roles', name: 'roles', component: RoleManagement, meta: { requiresAdmin: true } }, { path: '/settings', name: 'settings', component: SettingsManagement, meta: { requiresAdmin: true } }, - // Billing Module Routes - { path: '/billing/invoices', name: 'invoices', component: InvoiceManagement, meta: { requiresPermission: { module: 'billing', action: 'view' } } }, + // Dynamically loaded module routes + ...billingRoutes, ]; const router = createRouter({ diff --git a/assets/js/views/Dashboard.vue b/assets/js/views/Dashboard.vue index 8c87bbc..a47d9de 100644 --- a/assets/js/views/Dashboard.vue +++ b/assets/js/views/Dashboard.vue @@ -128,6 +128,18 @@
+ + +
+ +
+ DEBUG: User has no billing.view permission. + User permissions: {{ JSON.stringify(authStore.user.modulePermissions) }} +
+
+