diff --git a/hasura/metadata/tables.yaml b/hasura/metadata/tables.yaml index 1be15efad..6cdb4c008 100644 --- a/hasura/metadata/tables.yaml +++ b/hasura/metadata/tables.yaml @@ -5266,32 +5266,6 @@ - active: _eq: true check: null - event_triggers: - - name: notifications_parts_dispatch - definition: - enable_manual: false - insert: - 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: - body: - action: transform - template: |- - { - "success": true - } - method: POST - query_params: {} - template_engine: Kriti - url: '{{$base_url}}/notifications/events/handlePartsDispatchChange' - version: 2 - table: name: parts_dispatch_lines schema: public diff --git a/server/notifications/eventHandlers.js b/server/notifications/eventHandlers.js index 315cfe705..eeb86981d 100644 --- a/server/notifications/eventHandlers.js +++ b/server/notifications/eventHandlers.js @@ -134,24 +134,6 @@ const handleJobLinesChange = async (req, res) => const handleNotesChange = async (req, res) => processNotificationEvent(req, res, "req.body.event.new.jobid", "Notes Changed Notification Event Handled."); -/** - * Handle parts dispatch change notifications. - * - * @param {Object} req - Express request object. - * @param {Object} res - Express response object. - * @returns {Object} JSON response with a success message. - */ -const handlePartsDispatchChange = (req, res) => res.status(200).json({ message: "Parts Dispatch change handled." }); - -/** - * Handle parts order change notifications. - * - * @param {Object} req - Express request object. - * @param {Object} res - Express response object. - * @returns {Object} JSON response with a success message. - */ -const handlePartsOrderChange = (req, res) => res.status(200).json({ message: "Parts Order change handled." }); - /** * Handle payments change notifications. * @@ -182,6 +164,27 @@ const handleTasksChange = async (req, res) => const handleTimeTicketsChange = async (req, res) => processNotificationEvent(req, res, "req.body.event.new.jobid", "Time Tickets Changed Notification Event Handled."); +/** + * Handle parts dispatch change notifications. + * Note: Placeholder + * + * @param {Object} req - Express request object. + * @param {Object} res - Express response object. + * @returns {Object} JSON response with a success message. + * + */ +const handlePartsDispatchChange = (req, res) => res.status(200).json({ message: "Parts Dispatch change handled." }); + +/** + * Handle parts order change notifications. + * Note: Placeholder + * + * @param {Object} req - Express request object. + * @param {Object} res - Express response object. + * @returns {Object} JSON response with a success message. + */ +const handlePartsOrderChange = (req, res) => res.status(200).json({ message: "Parts Order change handled." }); + module.exports = { handleJobsChange, handleBillsChange,