diff --git a/pos/blueprints/config_bp.py b/pos/blueprints/config_bp.py index 72f28ff..32d5109 100644 --- a/pos/blueprints/config_bp.py +++ b/pos/blueprints/config_bp.py @@ -200,7 +200,7 @@ def create_employee(): nxt_name = PLANS[nxt]['name'] if nxt else 'Enterprise' return jsonify({'error': f'Plan limit reached ({limit} employees). Upgrade to {nxt_name}.'}), 403 - valid_roles = ['admin', 'cashier', 'warehouse', 'accountant', 'workshop'] + valid_roles = ['admin', 'cashier', 'warehouse', 'accountant', 'workshop', 'mechanic'] if data['role'] not in valid_roles: return jsonify({'error': f'role must be one of: {", ".join(valid_roles)}'}), 400 @@ -239,6 +239,8 @@ def create_employee(): 'fleet.view'], 'workshop': ['workshop.view', 'workshop.edit', 'workshop.add_items', 'customers.view', 'fleet.view'], + 'mechanic': ['workshop.view', 'workshop.edit', 'workshop.add_items', 'customers.view', + 'fleet.view'], } for perm in role_permissions.get(data['role'], []): diff --git a/pos/static/css/config.css b/pos/static/css/config.css index 60227f3..ba2244d 100644 --- a/pos/static/css/config.css +++ b/pos/static/css/config.css @@ -1186,6 +1186,8 @@ .badge--green { background: rgba(34,197,94,0.15); color: var(--color-success); } .badge--yellow { background: rgba(234,179,8,0.15); color: #eab308; } .badge--purple { background: rgba(168,85,247,0.15); color: #a855f7; } + .badge--orange { background: rgba(249,115,22,0.15); color: #f97316; } + .badge--teal { background: rgba(20,184,166,0.15); color: #14b8a6; } /* Toast notification */ .cfg-toast { diff --git a/pos/static/js/config.js b/pos/static/js/config.js index 86a82ab..92d0070 100644 --- a/pos/static/js/config.js +++ b/pos/static/js/config.js @@ -106,7 +106,9 @@ const Config = (() => { admin: 'Admin', cashier: 'Cajero', warehouse: 'Almacenista', - accountant: 'Contador' + accountant: 'Contador', + workshop: 'Taller', + mechanic: 'Mecanico' }; var ROLE_BADGE = { @@ -114,7 +116,9 @@ const Config = (() => { admin: 'badge--blue', cashier: 'badge--green', warehouse: 'badge--yellow', - accountant: 'badge--purple' + accountant: 'badge--purple', + workshop: 'badge--orange', + mechanic: 'badge--teal' }; function roleBadge(role) { diff --git a/pos/templates/config.html b/pos/templates/config.html index 9b63066..40404e8 100644 --- a/pos/templates/config.html +++ b/pos/templates/config.html @@ -896,6 +896,8 @@ + +