Customer entity
Customers are stored in theCliente model with the following fields:
Unique customer code identifier (primary key)
Full name or business name of the customer
Phone number for customer contact (max 15 characters)
Email address for customer communications (max 200 characters)
Physical address or delivery location (max 300 characters)
Customer status flag (true = active, false = inactive). Defaults to true
Timestamp when the customer record was created. Automatically set to current date/time
Database schema
Indexes
The customers table includes the following indexes for optimized query performance:IDX_clientes_nombre- Index on customer name for fast name-based searchesIDX_clientes_estado- Index on status for filtering active/inactive customersIDX_clientes_email- Index on email for quick email lookups
Relationships
Customers have a one-to-many relationship with sales transactions:- Ventas (Sales): A customer can have multiple sales orders. The relationship is established through the
codclienforeign key in theventastable.
User workflows
Adding a new customer
Enter customer code
Provide a unique customer identifier in the
Codclien field. This code will be used to reference the customer throughout the system.Fill in required information
Enter the customer’s full name or business name in the
Nombre field. This is a required field.Add contact details
Optionally provide phone number, email address, and physical address for customer communications and delivery purposes.
Managing customer status
TheEstado field controls whether a customer is active in the system:
- Active customers (
Estado = true) can be selected for new sales transactions - Inactive customers (
Estado = false) are hidden from active customer lists but their historical data remains accessible
Viewing customer sales history
Each customer record maintains a collection of all associated sales transactions through theVenta navigation property. This allows you to:
- Track total purchases per customer
- Monitor payment history and outstanding balances
- Analyze customer buying patterns
- Identify high-value customers
Searching for customers
The database indexes enable efficient searching by:- Customer name: Quickly find customers by partial or full name matches
- Email address: Look up customers using their email
- Status: Filter to show only active or inactive customers
Best practices
Customer code conventions
Customer code conventions
Establish a consistent naming convention for customer codes, such as:
- Sequential numbers:
CUST001,CUST002 - Initials + number:
JD001for John Doe - Business identifier:
ABC-CORPfor ABC Corporation
Data quality
Data quality
- Verify email addresses are properly formatted before saving
- Keep phone numbers in a consistent format
- Update customer information when notified of changes
- Use complete addresses including city and postal code for accurate delivery
Customer maintenance
Customer maintenance
- Regularly review inactive customers to identify re-engagement opportunities
- Merge duplicate customer records to maintain data integrity
- Archive old customer data according to your data retention policies