feature/IO-3060-Realtime-Notifications-Progress Update

This commit is contained in:
Dave Richer
2025-01-10 09:33:47 -08:00
parent e2e5f3f885
commit 3bc6504ae6
8 changed files with 53 additions and 3 deletions

View File

@@ -4776,7 +4776,6 @@
- job_id
- meta
- read
- scenario
- ui_translation_meta
- ui_translation_string
- updated_at
@@ -4794,7 +4793,6 @@
- job_id
- meta
- read
- scenario
- ui_translation_meta
- ui_translation_string
- updated_at
@@ -4820,7 +4818,6 @@
- job_id
- meta
- read
- scenario
- ui_translation_meta
- ui_translation_string
- updated_at
@@ -6200,6 +6197,28 @@
_eq: X-Hasura-User-Id
- active:
_eq: true
event_triggers:
- name: notifications_time_tickets
definition:
enable_manual: false
insert:
columns: '*'
update:
columns: '*'
retry_conf:
interval_sec: 10
num_retries: 0
timeout_sec: 60
webhook_from_env: HASURA_API_URL
headers:
- name: event-secret
value_from_env: EVENT_SECRET
request_transform:
method: POST
query_params: {}
template_engine: Kriti
url: '{{$base_url}}/events/handleTimeTicketsChange'
version: 2
- table:
name: transitions
schema: public

View File

@@ -0,0 +1,3 @@
comment on column "public"."notifications"."scenario" is E'Real Time Notifications System';
alter table "public"."notifications" alter column "scenario" drop not null;
alter table "public"."notifications" add column "scenario" text;

View File

@@ -0,0 +1 @@
alter table "public"."notifications" drop column "scenario" cascade;

View File

@@ -0,0 +1,5 @@
const handlePartsDispatchChange = (req, res) => {
return res.status(200).json({ message: "Parts Dispatch change handled." });
};
module.exports = handlePartsDispatchChange;

View File

@@ -0,0 +1,5 @@
const handlePartsOrderChange = (req, res) => {
return res.status(200).json({ message: "Parts Order change handled." });
};
module.exports = handlePartsOrderChange;

View File

@@ -0,0 +1,5 @@
const handleTasksChange = (req, res) => {
return res.status(200).json({ message: "Tasks change handled." });
};
module.exports = handleTasksChange;

View File

@@ -0,0 +1,5 @@
const handleTimeTicketsChange = (req, res) => {
return res.status(200).json({ message: "Time Tickets change handled." });
};
module.exports = handleTimeTicketsChange;

View File

@@ -4,6 +4,9 @@ const { subscribe, unsubscribe, sendNotification } = require("../firebase/fireba
const eventAuthorizationMiddleware = require("../middleware/eventAuthorizationMIddleware");
const handleJobChange = require("../notifications/eventHandlers/handeJobChange");
const handleBillChange = require("../notifications/eventHandlers/handleBillChange");
const handlePartsOrderChange = require("../notifications/eventHandlers/handlePartsOrderChange");
const handlePartsDispatchChange = require("../notifications/eventHandlers/handlePartsDispatchChange");
const handleTasksChange = require("../notifications/eventHandlers/handleTasksChange");
const router = express.Router();
@@ -15,5 +18,9 @@ router.post("/sendtestnotification", validateFirebaseIdTokenMiddleware, sendNoti
// Hasura Entry points for creating notifications
router.post("/events/handleJobChange", eventAuthorizationMiddleware, handleJobChange);
router.post("/events/handleBillChange", eventAuthorizationMiddleware, handleBillChange);
router.post("/events/handlePartsOrderChange", eventAuthorizationMiddleware, handlePartsOrderChange);
router.post("/events/handlePartsDispatchChange", eventAuthorizationMiddleware, handlePartsDispatchChange);
router.post("/events/handleTasksChange", eventAuthorizationMiddleware, handleTasksChange);
router.post("/events/handleTimeTicketsChange", eventAuthorizationMiddleware, handleTasksChange);
module.exports = router;