Commit inicial: Sales Bot - Sistema de Automatización de Ventas

- Stack completo con Mattermost, NocoDB y Sales Bot
- Procesamiento OCR de tickets con Tesseract
- Sistema de comisiones por tubos de tinte
- Comandos slash /metas y /ranking
- Documentación completa del proyecto

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
2026-01-18 02:41:53 +00:00
commit 5d9cbd4812
21 changed files with 4625 additions and 0 deletions

81
mattermost/README.md Normal file
View File

@@ -0,0 +1,81 @@
# Mattermost - Plataforma de Mensajería
Stack de Mattermost Team Edition para comunicación del equipo de ventas.
## Componentes
- **Mattermost Server** - Servidor de mensajería
- **PostgreSQL** - Base de datos
## Puertos
| Servicio | Puerto |
|----------|--------|
| Mattermost | 8065 |
| PostgreSQL | 5432 (interno) |
## Despliegue
```bash
docker compose up -d
```
## Configuración
El stack está configurado con:
- Usuario: `consultoria-as`
- Zona horaria: América/México_City
- Modo: Team Edition (gratuito)
## Webhooks Configurados
### Webhook Saliente (Outgoing)
Envía mensajes del canal de ventas al Sales Bot:
- URL destino: `http://192.168.10.204:5000/webhook/mattermost`
- Token de verificación configurado en `.env`
### Comandos Slash
| Comando | URL | Descripción |
|---------|-----|-------------|
| /metas | http://192.168.10.204:5000/comando/metas | Muestra metas del vendedor |
| /ranking | http://192.168.10.204:5000/comando/ranking | Ranking de vendedores |
## Volúmenes
```yaml
volumes:
- mattermost_data:/mattermost/data
- mattermost_logs:/mattermost/logs
- mattermost_config:/mattermost/config
- postgres_data:/var/lib/postgresql/data
```
## Acceso
- **URL:** http://192.168.10.204:8065
- **Team:** sales
## Integración con Sales Bot
1. El vendedor envía un mensaje con foto del ticket
2. Mattermost envía webhook al Sales Bot
3. Sales Bot procesa y responde en el mismo canal
4. Sales Bot agrega reacción al mensaje original
## Mantenimiento
### Ver logs
```bash
docker compose logs -f mattermost
```
### Reiniciar servicios
```bash
docker compose restart
```
### Backup de datos
```bash
docker compose exec postgres pg_dump -U consultoria-as mattermost > backup.sql
```

53
mattermost/compose.yaml Normal file
View File

@@ -0,0 +1,53 @@
version: "3.8"
services:
postgres:
image: postgres:15-alpine
container_name: mattermost-db
restart: unless-stopped
environment:
POSTGRES_USER: consultoria-as
POSTGRES_PASSWORD: Aasi940812
POSTGRES_DB: mattermost
volumes:
- postgres_data:/var/lib/postgresql/data
networks:
- mattermost-network
mattermost:
image: mattermost/mattermost-team-edition:latest
container_name: mattermost
restart: unless-stopped
depends_on:
- postgres
environment:
TZ: America/Mexico_City
MM_SQLSETTINGS_DRIVERNAME: postgres
MM_SQLSETTINGS_DATASOURCE: postgres://consultoria-as:Aasi940812@postgres:5432/mattermost?sslmode=disable&connect_timeout=10
MM_BLEVESETTINGS_INDEXDIR: /mattermost/bleve-indexes
MM_SERVICESETTINGS_SITEURL: http://192.168.10.204:8065
MM_SERVICESETTINGS_ALLOWEDUNTRUSTEDINTERNALCONNECTIONS: "192.168.10.0/24 172.16.0.0/12"
volumes:
- mattermost_config:/mattermost/config
- mattermost_data:/mattermost/data
- mattermost_logs:/mattermost/logs
- mattermost_plugins:/mattermost/plugins
- mattermost_client_plugins:/mattermost/client/plugins
- mattermost_bleve:/mattermost/bleve-indexes
ports:
- "8065:8065"
networks:
- mattermost-network
volumes:
postgres_data:
mattermost_config:
mattermost_data:
mattermost_logs:
mattermost_plugins:
mattermost_client_plugins:
mattermost_bleve:
networks:
mattermost-network:
driver: bridge