feat: add multi-dashboard routing support for n8n
All checks were successful
Build and Deploy / build-and-push (push) Successful in 2m36s

- Refactor `sendToN8n` service to accept dynamic webhook URLs.
- Update `order-status` controller to fan-out payload to both STATUS and GRAPHS webhooks.
- Add new endpoints and controllers for stock and graphs updates (`/stock-update`, `/graphs-update`).
- Maintain backward compatibility with existing `N8N_WEBHOOK_URL` environment variable.
This commit is contained in:
Cauê Faleiros
2026-05-05 11:26:56 -03:00
parent 325099ec94
commit ff2f5aca29
3 changed files with 82 additions and 5 deletions

View File

@@ -1,8 +1,10 @@
import { Router } from 'express';
import { handleTinyOrderUpdate } from '../controllers/webhook.controller';
import { handleTinyOrderUpdate, handleTinyStockUpdate, handleTinyGraphsUpdate } from '../controllers/webhook.controller';
const router = Router();
router.post('/tiny/order-status', handleTinyOrderUpdate);
router.post('/tiny/stock-update', handleTinyStockUpdate);
router.post('/tiny/graphs-update', handleTinyGraphsUpdate);
export default router;
export default router;