How kevinclk/sis_adv_mark works
Purpose and entry points
A Laravel operational-management system for multi-branch inventory, warehouse distribution, souvenir requests, fixed assets, organization data, and reporting. HTTP entry points are routes/web.php and routes/api.php; Laravel bootstraps through public/index.php and bootstrap/app.php. The Vue/Inertia client starts at resources/js/app.js.
Application boundary and access model
Laravel controllers serve role-specific workflows for administrators, branch administrators, warehouse staff, managers, and sellers. Authentication is handled by app/Http/Controllers/Auth/AuthenticatedSessionController.php; authorization crosses middleware and policies in app/Http/Middleware/CheckRole.php and app/Policies/UserPolicy.php. Organization entities bind users to branches, areas, and warehouses through app/Domain/Organizacion/Models/User.php, app/Domain/Organizacion/Models/Sucursal.php, and app/Domain/Inventario/Models/Almacen.php.
Inventory and warehouse ledger
The inventory core models products, categories, per-location stock, and stock history: app/Domain/Inventario/Models/Producto.php, app/Domain/Inventario/Models/Inventario.php, and app/Domain/Inventario/Models/StockHistorico.php. Warehouse intake, requests, transfers, disposals, and movements are separate transactional concepts in app/Domain/Distribucion/Models/IngresoAlmacen.php, app/Domain/Distribucion/Models/Movimiento.php, and app/Domain/Distribucion/Models/TransferenciaSucursal.php. This establishes a flow from received stock through movement records to inventory/history updates.
Distribution and confirmation workflows
Admin distribution supports direct and batch-oriented delivery flows via app/Http/Controllers/Admin/DistribucionDirectaController.php and app/Http/Controllers/Admin/DistribucionLoteController.php. Distribution records can require recipient confirmation, represented by app/Domain/Distribucion/Models/DistribucionConfirmacion.php and coordinated by app/Services/DistribucionConfirmacionService.php. A public confirmation boundary exists at app/Http/Controllers/ConfirmacionPublicaController.php, separating recipient actions from authenticated administration.
Souvenirs and seller fulfillment
Souvenir operations combine versioned packs, product requests, and request history: app/Domain/Souvenirs/Models/PackSouvenir.php, app/Domain/Souvenirs/Models/PackSouvenirVersion.php, and app/Domain/Souvenirs/Models/SolicitudSouvenir.php. Administrative preparation and approval flow through app/Http/Controllers/Admin/PreparacionSouvenirsController.php; seller-facing catalogue, requests, and receipt actions reside under app/Http/Controllers/Vendedor/. Request state changes emit app/Events/SolicitudSouvenirUpdated.php.
Fixed assets and reporting
Assets are modeled independently from consumable stock, including assignment, movements, maintenance, and disposal in app/Domain/Activos/Models/Activo.php, app/Domain/Activos/Models/AsignacionActivo.php, and app/Domain/Activos/Models/MantenimientoActivo.php. Reporting derives operational views and exports from ledger data, with core assembly in app/Domain/Reportes/Services/KardexProductoDataBuilder.php, spreadsheet exports in app/Exports/KardexProductoExport.php, and PDF generation queued through app/Jobs/GeneratePdfReportJob.php.
Frontend, events, and runtime infrastructure
The frontend is a Vue application using Inertia request adaptation via app/Http/Middleware/HandleInertiaRequests.php; role-oriented screens live in resources/js/Pages/Admin/, resources/js/Pages/Vendedor/, and resources/js/Pages/Gerencia/. Events cover low-stock alerts and generated reports (app/Events/LowStockAlert.php, app/Events/ReportGenerated.php) with notification logic in app/Services/LowStockNotifier.php. Runtime configuration includes database, queues, mail, broadcasting, and Reverb (config/database.php, config/queue.php, config/reverb.php); production packaging uses Docker and Nginx (Dockerfile.prod, docker/nginx.conf, docker/entrypoint.sh).
Components 20
Laravel Runtime
- Laravel Bootstrap
- Web & API Routes
- Production Container
Access & Delivery
- Vue/Inertia Client
- Inertia Adapter
- Session Authentication
- Roles & Policies · Role middleware and user policy protect role-specific workflows.
- Public Recipient Confirmation · Unauthenticated recipient confirmation boundary.
- Seller Screens · Seller catalogue, request, and receipt workflows.
Operational Domains
- Organization & Locations · Users are associated with branches, areas, and warehouses.
- Inventory Ledger · Products, location stock, and stock history form the stock ledger.
- Warehouse Transactions · Intake, movements, transfers, and disposals change operational stock.
- Admin Distribution · Direct and batch delivery workflows.
- Distribution Confirmation · Coordinates recipient confirmation for distributions.
- Souvenir Requests · Versioned packs and seller product requests.
- Souvenir Preparation · Administrative request preparation and approval.
- Fixed Assets · Independent asset assignments, maintenance, movements, and disposal.
Reporting & Events
- Kardex Data Builder · Assembles operational ledger data for reports.
- Report Export & PDF Job · Spreadsheet export and queued PDF generation.
- Operational Events · Low-stock, report-generated, and souvenir-update events drive notifications.
Connections 20
- Laravel Bootstrap → Web & API Routes: boots HTTP routes
- Web & API Routes → Session Authentication: session endpoints
- Web & API Routes → Roles & Policies: protects workflows
- Web & API Routes → Inertia Adapter: web responses
- Inertia Adapter → Vue/Inertia Client: Inertia pages
- Roles & Policies → Organization & Locations: resolves user scope
- Organization & Locations → Inventory Ledger: scopes locations
- Warehouse Transactions → Inventory Ledger: updates stock and history
- Admin Distribution → Warehouse Transactions: creates delivery movements
- Admin Distribution → Distribution Confirmation: requests confirmation
- Public Recipient Confirmation → Distribution Confirmation: recipient action
- Seller Screens → Souvenir Requests: catalogue and requests
- Souvenir Preparation → Souvenir Requests: prepares and approves
- Souvenir Requests → Operational Events: request state update
- Inventory Ledger → Operational Events: low-stock alerts
- Inventory Ledger → Kardex Data Builder: ledger data
- Warehouse Transactions → Kardex Data Builder: movement data
- Kardex Data Builder → Report Export & PDF Job: report dataset
- Report Export & PDF Job → Operational Events: report generated
- Production Container → Laravel Bootstrap: serves application