Overview
This guide explains how to add new products, locations (sucursales), and quality standards to Quality Hub GINEZ. All product configuration is managed inlib/production-constants.ts.
File Location
All product constants are defined in:Adding New Locations (Sucursales)
1. Add to SUCURSALES Array
Locate theSUCURSALES constant and add your new location:
2. Add Acronym to SUCURSAL_ACRONYMS
Add a unique acronym for batch code generation:Acronyms are used in batch codes (format:
YYYYMMDD-SUC-PROD-###). Keep them short (2-4 characters) and unique.Adding New Product Categories
1. Add to PRODUCT_CATEGORIES
Add your new category with an ID, name, and image:2. Add to CATEGORY_PRODUCTS
Map product codes to your new category:Adding New Products
Complete Product Addition Example
Let’s add a new product called “LIMFRESA” (Strawberry Cleaner):Step 1: Add to Category Products
Step 2: Add Solids Standards
Define the % Solids quality standards:These values represent:
- Red lines (specification limits): min and max values
- Yellow lines (tolerance): ±5% of red lines
- Classification:
- Between red lines → CONFORME
- Between red and yellow lines → SEMI-CONFORME
- Outside yellow lines → NO CONFORME
Step 3: Add pH Standards (if applicable)
Step 4: Add Appearance Standard
Standard appearance values:
- CRISTALINO: Clear/transparent
- OPACO: Opaque
- APERLADO: Pearly/pearlescent
Step 5: Configure Parameter Applicability
This determines which quality parameters are measured for each product:
solidos: true- % Solids measurement is requiredph: true- pH measurement is required- Set to
falseif parameter doesn’t apply to the product
Real-World Examples
Example 1: Adding a Detergent Product
Example 2: Adding an Air Freshener
Example 3: Adding a Cream Product
Adding Product Groups
Product groups organize categories in the UI. EditPRODUCT_GROUPS:
Validation and Testing
After adding products, test the following:1. Bitácora Registration
- Navigate to
/bitacora - Select your new product
- Verify correct fields appear based on
PARAMETER_APPLICABILITY - Enter quality measurements
- Verify conformity classification works correctly
2. Quality Control Charts
- Go to
/calidad - Find records for your new product
- Verify control chart lines (red/yellow) display correctly
- Check conformity status indicators
3. Reports
- Navigate to
/reportes - Verify product appears in analytics
- Check that it’s grouped correctly in commercial reports
Common Patterns by Product Family
Cleaners (Limpiadores)
Detergents (Detergentes)
Fabric Softeners (Suavizantes)
Personal Care (Cuidado Personal)
Troubleshooting
Product Not Appearing in Bitácora
- Check
CATEGORY_PRODUCTSmapping - Verify category name matches exactly
- Clear browser cache and restart dev server
Conformity Status Not Showing
- Verify
PRODUCT_STANDARDShas correct min/max values - Check that values are numbers, not strings
- Ensure
PARAMETER_APPLICABILITYis set correctly
Control Charts Not Displaying
- Confirm product has standards in
PRODUCT_STANDARDS - Check that
solidos: trueinPARAMETER_APPLICABILITY - Verify there are actual measurements in the database
Best Practices
Use Consistent Naming
Use Consistent Naming
- Use UPPERCASE for product codes
- Keep codes short (5-8 characters)
- Use descriptive acronyms
- Example:
LIMFRESA(LIM = Limpiador, FRESA = Strawberry)
Set Realistic Standards
Set Realistic Standards
- Base standards on actual production data
- Min/max should be achievable 95% of the time
- ±5% tolerance is automatically calculated
- Review and adjust standards periodically
Document Changes
Document Changes
- Add comments in code explaining new products
- Keep a changelog of standards updates
- Document why specific ranges were chosen
Test Thoroughly
Test Thoroughly
- Test in development environment first
- Create test batches with edge cases
- Verify reports and analytics work correctly
- Check on mobile devices too
Next Steps
Customization
Learn how to customize the application
Database Migrations
Manage database schema changes
