Overview
The Catalog Service (jea-catalogo) provides comprehensive inventory and product catalog management for Sistema de Ventas. It maintains real-time stock levels, product information, categories, and pricing across the entire system.
Key Features
Product Management
Full CRUD operations with unique product codes and names for catalog management
Category Organization
Hierarchical category management for logical product classification
Inventory Tracking
Real-time stock quantity management with automatic updates
Image Support
Product image storage and retrieval for enhanced product presentation
Pricing Management
Separate tracking for sale price and purchase cost
Automatic Timestamps
Creation and update timestamps for comprehensive audit trails
Product Entity Structure
The product entity captures all essential information for inventory management:Inventory Management
Real-Time Stock Updates
The Catalog Service maintains accurate inventory levels through automatic integration with sales and purchase services:- Sales - Automatically decrease stock when sales are completed
- Purchases - Automatically increase stock when purchase orders are received
- Manual Adjustments - Direct quantity updates for inventory corrections
Stock Quantity Updates
Update inventory levels programmatically:Category Management
Organize products into logical categories for better navigation and reporting:Category Features
- Create hierarchical product classifications
- Filter products by category
- Generate category-based reports
- Organize catalog for customer browsing
Available Endpoints
The Catalog Service provides comprehensive product and category management:| Method | Endpoint | Description |
|---|---|---|
| GET | /producto | List all products |
| GET | /producto/{id} | Get product by ID |
| POST | /producto | Create new product |
| PUT | /producto/{id} | Update product |
| DELETE | /producto/{id} | Delete product |
| PUT | /producto/{id}/cantidad | Update stock quantity |
| GET | /categoria | List all categories |
| POST | /categoria | Create new category |
| GET | /imagenes/{filename} | Get product image (public) |
The
/imagenes/** endpoint is publicly accessible without authentication to allow product image display on public-facing pages and catalogs.Product Images
Support for product images enhances the shopping experience:Image Storage
- Images are stored in the file system
- File paths are stored in the product entity
- Images are accessible via public endpoint
Image Retrieval
Pricing Management
Dual Pricing System
The system maintains separate prices for different purposes:- Sale Price (precioVenta) - Customer-facing retail price
- Purchase Cost (costoCompra) - Internal cost for profit margin calculation
- Profit margin analysis
- Pricing strategy evaluation
- Cost tracking for financial reporting
Automatic Timestamps
Track product lifecycle with automatic timestamp management:Product Status Management
Control product visibility and availability:- Active Products - Available for sale and purchase
- Inactive Products - Hidden from catalogs but retained in system for historical data
estado field allows soft deletion, preserving product information for past transactions while removing products from active catalogs.
Integration with Other Services
The Catalog Service is the central hub for product information:Sales Service Integration
- Validates product availability
- Updates stock quantities after sales
- Provides product pricing information
Purchase Service Integration
- Updates stock quantities on purchase receipt
- Validates product codes
- Updates purchase costs
Order Service Integration
- Checks product availability for orders
- Reserves stock for pending orders
- Provides product details for order line items
Best Practices
Unique Product Codes
Unique Product Codes
Always assign unique product codes that are meaningful for your business. These codes are used throughout the system for product identification and should follow a consistent naming convention.
Category Structure
Category Structure
Plan your category structure before adding products. A well-organized category hierarchy improves navigation and reporting capabilities.
Stock Monitoring
Stock Monitoring
Regularly monitor stock levels to prevent stockouts. Set up alerts for low inventory levels to ensure timely reordering.
Image Optimization
Image Optimization
Optimize product images for web delivery to ensure fast loading times. Use consistent image dimensions across all products.
Pricing Updates
Pricing Updates
When updating prices, consider the impact on pending orders and quotes. Plan price changes carefully to avoid customer confusion.
Low Stock Alerts
Monitor inventory levels to prevent stockouts:- Track products with low stock quantities
- Set minimum stock thresholds per product
- Generate reorder recommendations
- Integrate with purchase order system
Next Steps
API Reference
Detailed catalog API documentation
Purchase Orders
Manage product procurement
Sales Management
Process sales transactions
Analytics & Reporting
Inventory analytics and reports