How edwin-ngugi/retail_management works
This Django application supports multi-branch retail inventory, purchasing, point-of-sale, approvals, and reporting. The main workflow is a staff or API client submitting inventory or sales data; API views and serializers validate and execute domain operations against the stock models, while analytics services provide reporting. Admin screens support operational management, and approvals can trigger email notifications. The source excerpts are partial, so edges are limited to relationships documented in the index or shown directly; unsampled integrations are not inferred.
Main entry points: models.py Stock and sales records · views.py API operations · tasks.py Approval email tasks · admin.py Django admin
Components 18
Retail operations
- Django admin
stocks/admin.py - Stock and sales records
stocks/models.py - Branch pricing lookup
stocks/views.py - Sale price helper
stocks/static/admin/js/sale_item_pricing.js
API and approvals
- API routes
apis/urls.py - API operations
apis/views.py - Request serializers
apis/serializers.py - Approval email tasks
apis/tasks.py - Approval emails
apis/emails.py
Analytics and realtime
- Analytics endpoints
analytics/views.py - Analytics and calculations
analytics/services.py - Monthly stock snapshots
analytics/tasks.py - Analytics signals
analytics/signals.py - ASGI application
myproject/asgi.py - Analytics WebSocket routes
analytics/routing.py - Analytics WebSocket consumer
analytics/consumers.py
Other components
- Staff user
- API client
Connections 19
- Staff user → Django admin: manages records
stocks/admin.py - Django admin → Stock and sales records: reads and updates
stocks/admin.py - Staff user → Branch pricing lookup: requests pricing
stocks/views.py - Branch pricing lookup → Stock and sales records: queries pricing
stocks/views.py - API client → API routes: sends requests
apis/urls.py - API routes → API operations: routes to
apis/urls.py - API operations → Request serializers: validates data
apis/views.py - API operations → Stock and sales records: executes operations
apis/views.py - Request serializers → Stock and sales records: validates domain data
apis/serializers.py - API operations → Analytics and calculations: requests calculations
apis/views.py - API operations → Approval email tasks: queues notifications
apis/views.py - Approval email tasks → Stock and sales records: loads approval
apis/tasks.py - Approval email tasks → Approval emails: dispatches email
apis/tasks.py - Approval emails → Stock and sales records: resolves branch
apis/emails.py - Analytics endpoints → Stock and sales records: queries records
analytics/views.py - Analytics and calculations → Stock and sales records: aggregates records
analytics/services.py - Monthly stock snapshots → Stock and sales records: updates snapshots
analytics/tasks.py - ASGI application → Analytics WebSocket routes: loads routes
myproject/asgi.py - Analytics WebSocket routes → Analytics WebSocket consumer: dispatches connections
analytics/routing.py