@@ -2442,7 +2442,7 @@
|
|||||||
_eq: X-Hasura-User-Id
|
_eq: X-Hasura-User-Id
|
||||||
columns:
|
columns:
|
||||||
- address
|
- address
|
||||||
- buisness_name
|
- business_name
|
||||||
- date_accepted
|
- date_accepted
|
||||||
- eulaid
|
- eulaid
|
||||||
- first_name
|
- first_name
|
||||||
@@ -2454,7 +2454,7 @@
|
|||||||
permission:
|
permission:
|
||||||
columns:
|
columns:
|
||||||
- address
|
- address
|
||||||
- buisness_name
|
- business_name
|
||||||
- first_name
|
- first_name
|
||||||
- last_name
|
- last_name
|
||||||
- phone_number
|
- phone_number
|
||||||
@@ -4164,11 +4164,16 @@
|
|||||||
- name: job_status_transition
|
- name: job_status_transition
|
||||||
definition:
|
definition:
|
||||||
enable_manual: true
|
enable_manual: true
|
||||||
|
insert:
|
||||||
|
columns: '*'
|
||||||
|
update:
|
||||||
|
columns:
|
||||||
|
- status
|
||||||
retry_conf:
|
retry_conf:
|
||||||
interval_sec: 10
|
interval_sec: 10
|
||||||
num_retries: 0
|
num_retries: 0
|
||||||
timeout_sec: 60
|
timeout_sec: 60
|
||||||
webhook_from_env: HASURA_API_URL
|
webhook: https://worktest.home.irony.online
|
||||||
headers:
|
headers:
|
||||||
- name: event-secret
|
- name: event-secret
|
||||||
value_from_env: EVENT_SECRET
|
value_from_env: EVENT_SECRET
|
||||||
|
|||||||
@@ -20,13 +20,19 @@ async function StatusTransition(req, res) {
|
|||||||
res.status(401).send("Unauthorized");
|
res.status(401).send("Unauthorized");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
res.sendStatus(200);
|
|
||||||
return;
|
// return res.sendStatus(200);
|
||||||
|
|
||||||
const {
|
const {
|
||||||
id: jobid,
|
id: jobid,
|
||||||
status: value,
|
status: value,
|
||||||
shopid: bodyshopid,
|
shopid: bodyshopid,
|
||||||
} = req.body.event.data.new;
|
} = req.body.event.data.new;
|
||||||
|
|
||||||
|
// Create record OPEN on new item, enter state
|
||||||
|
// If change to SCHEDULE, update the last record and create a new record (update status and end time on old record, create a new record saying we came from previous status going to previous status
|
||||||
|
// (Timeline)
|
||||||
|
// Final status is exported, there is no end date as there is no further transition (has no end date)
|
||||||
try {
|
try {
|
||||||
const { update_transitions } = await client.request(
|
const { update_transitions } = await client.request(
|
||||||
queries.UPDATE_OLD_TRANSITION,
|
queries.UPDATE_OLD_TRANSITION,
|
||||||
|
|||||||
Reference in New Issue
Block a user