Overview
The Customer Management module provides a centralized directory for managing all your clients, including both companies (RUC) and individuals (DNI). The system tracks customer relationships with vehicles and provides integrated API validation through SUNAT/RENIEC.Key Features
- RUC/DNI validation via Decolecta API
- Vehicle relationship tracking
- Advanced search and filtering
- Customer profile management
- Document type support (RUC, DNI)
Customer Data Model
Each customer record contains the following information:Example Customer Records
Customer Directory Workflow
Search for Customers
Use the search bar to filter customers by document number, name, or email. The search is case-insensitive and searches across all text fields.
View Customer Details
Click the eye icon to view the complete customer profile, including:
- Contact information
- Owned vehicles
- Vehicles where they are the habitual driver
- Service history
RUC/DNI Validation with Decolecta API
MotorDesk integrates with the Decolecta API to automatically validate and populate customer information from SUNAT (RUC) and RENIEC (DNI) databases.The API validation feature automatically fills in the business name and address fields when you enter a valid RUC or DNI number.
Validation Implementation
Vehicle Relationship Tracking
The customer management system automatically tracks vehicle relationships:Vehicle Ownership
Vehicle Ownership
Customers can own multiple vehicles as proprietors (
propietarioId). The system displays the total count of owned vehicles in the customer directory.Driver Relationships
Driver Relationships
Customers can also be registered as habitual drivers (
conductorHabitualId) for vehicles they don’t own, useful for fleet management.Relationship Calculation
The system calculates total related vehicles using the following logic:Search and Pagination
The customer directory includes powerful search and pagination features:Search Implementation
Pagination Options
Configurable Page Sizes
Users can display 5, 10, 20, or 50 records per page, with automatic page recalculation when filters change.
Customer Actions
The following actions are available for each customer:| Action | Icon | Description |
|---|---|---|
| View | Eye | Opens customer details modal with full profile and vehicle relationships |
| Edit | Edit2 | Opens form to modify customer information |
| Delete | Trash2 | Soft delete customer (with confirmation) |
| Vehicle Count | Truck | Shows total related vehicles and opens detail view |
UI Components
The customer management interface is built with the following components:Modal System
The customer module uses three specialized modals:CustomerDetailsModal
Displays comprehensive customer information including vehicle relationships and service history.
CustomerFormModal
Handles both adding new customers and editing existing ones, with integrated API validation.
Best Practices
Customer Data Management
- Always validate RUC/DNI before saving
- Verify vehicle relationships before deletion
- Keep contact information up to date
- Use the search function to avoid duplicate entries
Deleting a customer with active vehicle relationships may affect your fleet management. Always review vehicle associations before deletion.
