diff --git a/client/src/components/white-board-card/white-board-card.component.jsx b/client/src/components/white-board-card/white-board-card.component.jsx
index fbbcfa358..e5367c085 100644
--- a/client/src/components/white-board-card/white-board-card.component.jsx
+++ b/client/src/components/white-board-card/white-board-card.component.jsx
@@ -31,32 +31,33 @@ export default function WhiteBoardCard({ metadata }) {
const menu = (
);
+
return (
@@ -72,17 +73,16 @@ export default function WhiteBoardCard({ metadata }) {
bodyStyle={{ padding: 10 }}
actions={[
-
+
,
-
,
+
,
-
+
- ]}
- >
+ ]}>
-
+
@@ -104,11 +104,11 @@ export default function WhiteBoardCard({ metadata }) {
{t("general.labels.in")}:
- {metadata.actual_in}
+ {metadata.actual_in}
{t("general.labels.out")}:
- {metadata.scheduled_completion}
+ {metadata.scheduled_completion}
diff --git a/client/src/components/white-board-card/white-board-card.menu.component.jsx b/client/src/components/white-board-card/white-board-card.menu.component.jsx
deleted file mode 100644
index e69de29bb..000000000
diff --git a/client/src/graphql/apollo-error-handling.js b/client/src/graphql/apollo-error-handling.js
index 4e82df059..37c987c81 100644
--- a/client/src/graphql/apollo-error-handling.js
+++ b/client/src/graphql/apollo-error-handling.js
@@ -5,6 +5,10 @@ import { auth } from "../firebase/firebase.utils";
const errorLink = onError(
({ graphQLErrors, networkError, operation, forward }) => {
let access_token = window.localStorage.getItem("token");
+ console.log("graphQLErrors", graphQLErrors);
+ console.log("networkError", networkError);
+ console.log("operation", operation);
+ console.log("forward", forward);
if (graphQLErrors) {
// User access token has expired
if (graphQLErrors[0].message.includes("JWTExpired")) {
diff --git a/hasura/migrations/1578415206280_create_table_public_vendors/down.yaml b/hasura/migrations/1578415206280_create_table_public_vendors/down.yaml
new file mode 100644
index 000000000..063f625bc
--- /dev/null
+++ b/hasura/migrations/1578415206280_create_table_public_vendors/down.yaml
@@ -0,0 +1,3 @@
+- args:
+ sql: DROP TABLE "public"."vendors"
+ type: run_sql
diff --git a/hasura/migrations/1578415206280_create_table_public_vendors/up.yaml b/hasura/migrations/1578415206280_create_table_public_vendors/up.yaml
new file mode 100644
index 000000000..facdabbbb
--- /dev/null
+++ b/hasura/migrations/1578415206280_create_table_public_vendors/up.yaml
@@ -0,0 +1,23 @@
+- args:
+ sql: CREATE EXTENSION IF NOT EXISTS pgcrypto;
+ type: run_sql
+- args:
+ sql: "CREATE TABLE \"public\".\"vendors\"(\"id\" uuid NOT NULL DEFAULT gen_random_uuid(),
+ \"created_at\" timestamptz NOT NULL DEFAULT now(), \"updated_at\" timestamptz
+ NOT NULL DEFAULT now(), \"bodyshopid\" uuid NOT NULL, \"name\" text NOT NULL,
+ \"street1\" text, \"street2\" text, \"city\" text, \"state\" text, \"zip\" text,
+ \"country\" text, \"email\" text, \"taxid\" text, \"discount\" numeric NOT NULL
+ DEFAULT 0, \"prompt_discount\" numeric NOT NULL DEFAULT 0, \"due_date\" integer,
+ \"terms\" text, \"display_name\" text, PRIMARY KEY (\"id\") , FOREIGN KEY (\"bodyshopid\")
+ REFERENCES \"public\".\"bodyshops\"(\"id\") ON UPDATE cascade ON DELETE cascade);\nCREATE
+ OR REPLACE FUNCTION \"public\".\"set_current_timestamp_updated_at\"()\nRETURNS
+ TRIGGER AS $$\nDECLARE\n _new record;\nBEGIN\n _new := NEW;\n _new.\"updated_at\"
+ = NOW();\n RETURN _new;\nEND;\n$$ LANGUAGE plpgsql;\nCREATE TRIGGER \"set_public_vendors_updated_at\"\nBEFORE
+ UPDATE ON \"public\".\"vendors\"\nFOR EACH ROW\nEXECUTE PROCEDURE \"public\".\"set_current_timestamp_updated_at\"();\nCOMMENT
+ ON TRIGGER \"set_public_vendors_updated_at\" ON \"public\".\"vendors\" \nIS
+ 'trigger to set value of column \"updated_at\" to current timestamp on row update';\n"
+ type: run_sql
+- args:
+ name: vendors
+ schema: public
+ type: add_existing_table_or_view
diff --git a/hasura/migrations/1578415220953_track_all_relationships/down.yaml b/hasura/migrations/1578415220953_track_all_relationships/down.yaml
new file mode 100644
index 000000000..5ddf931d2
--- /dev/null
+++ b/hasura/migrations/1578415220953_track_all_relationships/down.yaml
@@ -0,0 +1,12 @@
+- args:
+ relationship: vendors
+ table:
+ name: bodyshops
+ schema: public
+ type: drop_relationship
+- args:
+ relationship: bodyshop
+ table:
+ name: vendors
+ schema: public
+ type: drop_relationship
diff --git a/hasura/migrations/1578415220953_track_all_relationships/up.yaml b/hasura/migrations/1578415220953_track_all_relationships/up.yaml
new file mode 100644
index 000000000..da19a71f3
--- /dev/null
+++ b/hasura/migrations/1578415220953_track_all_relationships/up.yaml
@@ -0,0 +1,20 @@
+- args:
+ name: vendors
+ table:
+ name: bodyshops
+ schema: public
+ using:
+ foreign_key_constraint_on:
+ column: bodyshopid
+ table:
+ name: vendors
+ schema: public
+ type: create_array_relationship
+- args:
+ name: bodyshop
+ table:
+ name: vendors
+ schema: public
+ using:
+ foreign_key_constraint_on: bodyshopid
+ type: create_object_relationship
diff --git a/hasura/migrations/1578415310253_update_permission_user_public_table_vendors/down.yaml b/hasura/migrations/1578415310253_update_permission_user_public_table_vendors/down.yaml
new file mode 100644
index 000000000..341c33e8b
--- /dev/null
+++ b/hasura/migrations/1578415310253_update_permission_user_public_table_vendors/down.yaml
@@ -0,0 +1,6 @@
+- args:
+ role: user
+ table:
+ name: vendors
+ schema: public
+ type: drop_insert_permission
diff --git a/hasura/migrations/1578415310253_update_permission_user_public_table_vendors/up.yaml b/hasura/migrations/1578415310253_update_permission_user_public_table_vendors/up.yaml
new file mode 100644
index 000000000..826d51398
--- /dev/null
+++ b/hasura/migrations/1578415310253_update_permission_user_public_table_vendors/up.yaml
@@ -0,0 +1,40 @@
+- args:
+ permission:
+ allow_upsert: true
+ check:
+ bodyshop:
+ associations:
+ _and:
+ - user:
+ authid:
+ _eq: X-Hasura-User-Id
+ - active:
+ _eq: true
+ columns:
+ - due_date
+ - discount
+ - prompt_discount
+ - city
+ - country
+ - display_name
+ - email
+ - name
+ - state
+ - street1
+ - street2
+ - taxid
+ - terms
+ - zip
+ - created_at
+ - updated_at
+ - bodyshopid
+ - id
+ localPresets:
+ - key: ""
+ value: ""
+ set: {}
+ role: user
+ table:
+ name: vendors
+ schema: public
+ type: create_insert_permission
diff --git a/hasura/migrations/1578415315745_update_permission_user_public_table_vendors/down.yaml b/hasura/migrations/1578415315745_update_permission_user_public_table_vendors/down.yaml
new file mode 100644
index 000000000..c49f12455
--- /dev/null
+++ b/hasura/migrations/1578415315745_update_permission_user_public_table_vendors/down.yaml
@@ -0,0 +1,6 @@
+- args:
+ role: user
+ table:
+ name: vendors
+ schema: public
+ type: drop_select_permission
diff --git a/hasura/migrations/1578415315745_update_permission_user_public_table_vendors/up.yaml b/hasura/migrations/1578415315745_update_permission_user_public_table_vendors/up.yaml
new file mode 100644
index 000000000..1b4248be1
--- /dev/null
+++ b/hasura/migrations/1578415315745_update_permission_user_public_table_vendors/up.yaml
@@ -0,0 +1,37 @@
+- args:
+ permission:
+ allow_aggregations: false
+ columns:
+ - due_date
+ - discount
+ - prompt_discount
+ - city
+ - country
+ - display_name
+ - email
+ - name
+ - state
+ - street1
+ - street2
+ - taxid
+ - terms
+ - zip
+ - created_at
+ - updated_at
+ - bodyshopid
+ - id
+ filter:
+ bodyshop:
+ associations:
+ _and:
+ - user:
+ authid:
+ _eq: X-Hasura-User-Id
+ - active:
+ _eq: true
+ limit: null
+ role: user
+ table:
+ name: vendors
+ schema: public
+ type: create_select_permission
diff --git a/hasura/migrations/1578415321110_update_permission_user_public_table_vendors/down.yaml b/hasura/migrations/1578415321110_update_permission_user_public_table_vendors/down.yaml
new file mode 100644
index 000000000..2e7f9528d
--- /dev/null
+++ b/hasura/migrations/1578415321110_update_permission_user_public_table_vendors/down.yaml
@@ -0,0 +1,6 @@
+- args:
+ role: user
+ table:
+ name: vendors
+ schema: public
+ type: drop_update_permission
diff --git a/hasura/migrations/1578415321110_update_permission_user_public_table_vendors/up.yaml b/hasura/migrations/1578415321110_update_permission_user_public_table_vendors/up.yaml
new file mode 100644
index 000000000..4c70a3b50
--- /dev/null
+++ b/hasura/migrations/1578415321110_update_permission_user_public_table_vendors/up.yaml
@@ -0,0 +1,39 @@
+- args:
+ permission:
+ columns:
+ - due_date
+ - discount
+ - prompt_discount
+ - city
+ - country
+ - display_name
+ - email
+ - name
+ - state
+ - street1
+ - street2
+ - taxid
+ - terms
+ - zip
+ - created_at
+ - updated_at
+ - bodyshopid
+ - id
+ filter:
+ bodyshop:
+ associations:
+ _and:
+ - user:
+ authid:
+ _eq: X-Hasura-User-Id
+ - active:
+ _eq: true
+ localPresets:
+ - key: ""
+ value: ""
+ set: {}
+ role: user
+ table:
+ name: vendors
+ schema: public
+ type: create_update_permission
diff --git a/hasura/migrations/1578415327701_update_permission_user_public_table_vendors/down.yaml b/hasura/migrations/1578415327701_update_permission_user_public_table_vendors/down.yaml
new file mode 100644
index 000000000..289d7e000
--- /dev/null
+++ b/hasura/migrations/1578415327701_update_permission_user_public_table_vendors/down.yaml
@@ -0,0 +1,6 @@
+- args:
+ role: user
+ table:
+ name: vendors
+ schema: public
+ type: drop_delete_permission
diff --git a/hasura/migrations/1578415327701_update_permission_user_public_table_vendors/up.yaml b/hasura/migrations/1578415327701_update_permission_user_public_table_vendors/up.yaml
new file mode 100644
index 000000000..0e9e9463c
--- /dev/null
+++ b/hasura/migrations/1578415327701_update_permission_user_public_table_vendors/up.yaml
@@ -0,0 +1,16 @@
+- args:
+ permission:
+ filter:
+ bodyshop:
+ associations:
+ _and:
+ - user:
+ authid:
+ _eq: X-Hasura-User-Id
+ - active:
+ _eq: true
+ role: user
+ table:
+ name: vendors
+ schema: public
+ type: create_delete_permission
diff --git a/hasura/migrations/1578416086468_create_table_public_parts_order/down.yaml b/hasura/migrations/1578416086468_create_table_public_parts_order/down.yaml
new file mode 100644
index 000000000..bdf939ee1
--- /dev/null
+++ b/hasura/migrations/1578416086468_create_table_public_parts_order/down.yaml
@@ -0,0 +1,3 @@
+- args:
+ sql: DROP TABLE "public"."parts_order"
+ type: run_sql
diff --git a/hasura/migrations/1578416086468_create_table_public_parts_order/up.yaml b/hasura/migrations/1578416086468_create_table_public_parts_order/up.yaml
new file mode 100644
index 000000000..f76e22cef
--- /dev/null
+++ b/hasura/migrations/1578416086468_create_table_public_parts_order/up.yaml
@@ -0,0 +1,25 @@
+- args:
+ sql: CREATE EXTENSION IF NOT EXISTS pgcrypto;
+ type: run_sql
+- args:
+ sql: "CREATE TABLE \"public\".\"parts_order\"(\"id\" uuid NOT NULL DEFAULT gen_random_uuid(),
+ \"created_at\" timestamptz NOT NULL DEFAULT now(), \"updated_at\" timestamptz
+ NOT NULL DEFAULT now(), \"jobid\" uuid NOT NULL, \"vendorid\" uuid NOT NULL,
+ \"order_number\" text NOT NULL, \"order_date\" date NOT NULL DEFAULT now(),
+ \"ordered_by_user_id\" text NOT NULL, \"status\" text NOT NULL, \"deliver_by\"
+ date, PRIMARY KEY (\"id\") , FOREIGN KEY (\"jobid\") REFERENCES \"public\".\"jobs\"(\"id\")
+ ON UPDATE cascade ON DELETE cascade, FOREIGN KEY (\"vendorid\") REFERENCES \"public\".\"vendors\"(\"id\")
+ ON UPDATE restrict ON DELETE restrict, FOREIGN KEY (\"ordered_by_user_id\")
+ REFERENCES \"public\".\"users\"(\"email\") ON UPDATE restrict ON DELETE restrict);\nCREATE
+ OR REPLACE FUNCTION \"public\".\"set_current_timestamp_updated_at\"()\nRETURNS
+ TRIGGER AS $$\nDECLARE\n _new record;\nBEGIN\n _new := NEW;\n _new.\"updated_at\"
+ = NOW();\n RETURN _new;\nEND;\n$$ LANGUAGE plpgsql;\nCREATE TRIGGER \"set_public_parts_order_updated_at\"\nBEFORE
+ UPDATE ON \"public\".\"parts_order\"\nFOR EACH ROW\nEXECUTE PROCEDURE \"public\".\"set_current_timestamp_updated_at\"();\nCOMMENT
+ ON TRIGGER \"set_public_parts_order_updated_at\" ON \"public\".\"parts_order\"
+ \nIS 'trigger to set value of column \"updated_at\" to current timestamp on
+ row update';\n"
+ type: run_sql
+- args:
+ name: parts_order
+ schema: public
+ type: add_existing_table_or_view
diff --git a/hasura/migrations/1578416103317_track_all_relationships/down.yaml b/hasura/migrations/1578416103317_track_all_relationships/down.yaml
new file mode 100644
index 000000000..93ad953a5
--- /dev/null
+++ b/hasura/migrations/1578416103317_track_all_relationships/down.yaml
@@ -0,0 +1,36 @@
+- args:
+ relationship: parts_orders
+ table:
+ name: jobs
+ schema: public
+ type: drop_relationship
+- args:
+ relationship: user
+ table:
+ name: parts_order
+ schema: public
+ type: drop_relationship
+- args:
+ relationship: job
+ table:
+ name: parts_order
+ schema: public
+ type: drop_relationship
+- args:
+ relationship: vendor
+ table:
+ name: parts_order
+ schema: public
+ type: drop_relationship
+- args:
+ relationship: parts_orders
+ table:
+ name: users
+ schema: public
+ type: drop_relationship
+- args:
+ relationship: parts_orders
+ table:
+ name: vendors
+ schema: public
+ type: drop_relationship
diff --git a/hasura/migrations/1578416103317_track_all_relationships/up.yaml b/hasura/migrations/1578416103317_track_all_relationships/up.yaml
new file mode 100644
index 000000000..cce26c1e3
--- /dev/null
+++ b/hasura/migrations/1578416103317_track_all_relationships/up.yaml
@@ -0,0 +1,60 @@
+- args:
+ name: parts_orders
+ table:
+ name: jobs
+ schema: public
+ using:
+ foreign_key_constraint_on:
+ column: jobid
+ table:
+ name: parts_order
+ schema: public
+ type: create_array_relationship
+- args:
+ name: user
+ table:
+ name: parts_order
+ schema: public
+ using:
+ foreign_key_constraint_on: ordered_by_user_id
+ type: create_object_relationship
+- args:
+ name: job
+ table:
+ name: parts_order
+ schema: public
+ using:
+ foreign_key_constraint_on: jobid
+ type: create_object_relationship
+- args:
+ name: vendor
+ table:
+ name: parts_order
+ schema: public
+ using:
+ foreign_key_constraint_on: vendorid
+ type: create_object_relationship
+- args:
+ name: parts_orders
+ table:
+ name: users
+ schema: public
+ using:
+ foreign_key_constraint_on:
+ column: ordered_by_user_id
+ table:
+ name: parts_order
+ schema: public
+ type: create_array_relationship
+- args:
+ name: parts_orders
+ table:
+ name: vendors
+ schema: public
+ using:
+ foreign_key_constraint_on:
+ column: vendorid
+ table:
+ name: parts_order
+ schema: public
+ type: create_array_relationship
diff --git a/hasura/migrations/1578416157323_update_permission_user_public_table_parts_order/down.yaml b/hasura/migrations/1578416157323_update_permission_user_public_table_parts_order/down.yaml
new file mode 100644
index 000000000..97ed8317f
--- /dev/null
+++ b/hasura/migrations/1578416157323_update_permission_user_public_table_parts_order/down.yaml
@@ -0,0 +1,6 @@
+- args:
+ role: user
+ table:
+ name: parts_order
+ schema: public
+ type: drop_insert_permission
diff --git a/hasura/migrations/1578416157323_update_permission_user_public_table_parts_order/up.yaml b/hasura/migrations/1578416157323_update_permission_user_public_table_parts_order/up.yaml
new file mode 100644
index 000000000..b3734b79e
--- /dev/null
+++ b/hasura/migrations/1578416157323_update_permission_user_public_table_parts_order/up.yaml
@@ -0,0 +1,33 @@
+- args:
+ permission:
+ allow_upsert: true
+ check:
+ job:
+ bodyshop:
+ associations:
+ _and:
+ - user:
+ authid:
+ _eq: X-Hasura-User-Id
+ - active:
+ _eq: true
+ columns:
+ - deliver_by
+ - order_date
+ - ordered_by_user_id
+ - order_number
+ - status
+ - created_at
+ - updated_at
+ - id
+ - jobid
+ - vendorid
+ localPresets:
+ - key: ""
+ value: ""
+ set: {}
+ role: user
+ table:
+ name: parts_order
+ schema: public
+ type: create_insert_permission
diff --git a/hasura/migrations/1578416163694_update_permission_user_public_table_parts_order/down.yaml b/hasura/migrations/1578416163694_update_permission_user_public_table_parts_order/down.yaml
new file mode 100644
index 000000000..935d34ae9
--- /dev/null
+++ b/hasura/migrations/1578416163694_update_permission_user_public_table_parts_order/down.yaml
@@ -0,0 +1,6 @@
+- args:
+ role: user
+ table:
+ name: parts_order
+ schema: public
+ type: drop_select_permission
diff --git a/hasura/migrations/1578416163694_update_permission_user_public_table_parts_order/up.yaml b/hasura/migrations/1578416163694_update_permission_user_public_table_parts_order/up.yaml
new file mode 100644
index 000000000..0d029d635
--- /dev/null
+++ b/hasura/migrations/1578416163694_update_permission_user_public_table_parts_order/up.yaml
@@ -0,0 +1,30 @@
+- args:
+ permission:
+ allow_aggregations: false
+ columns:
+ - deliver_by
+ - order_date
+ - ordered_by_user_id
+ - order_number
+ - status
+ - created_at
+ - updated_at
+ - id
+ - jobid
+ - vendorid
+ filter:
+ job:
+ bodyshop:
+ associations:
+ _and:
+ - user:
+ authid:
+ _eq: X-Hasura-User-Id
+ - active:
+ _eq: true
+ limit: null
+ role: user
+ table:
+ name: parts_order
+ schema: public
+ type: create_select_permission
diff --git a/hasura/migrations/1578416169493_update_permission_user_public_table_parts_order/down.yaml b/hasura/migrations/1578416169493_update_permission_user_public_table_parts_order/down.yaml
new file mode 100644
index 000000000..13e5e444b
--- /dev/null
+++ b/hasura/migrations/1578416169493_update_permission_user_public_table_parts_order/down.yaml
@@ -0,0 +1,6 @@
+- args:
+ role: user
+ table:
+ name: parts_order
+ schema: public
+ type: drop_update_permission
diff --git a/hasura/migrations/1578416169493_update_permission_user_public_table_parts_order/up.yaml b/hasura/migrations/1578416169493_update_permission_user_public_table_parts_order/up.yaml
new file mode 100644
index 000000000..434f9eb38
--- /dev/null
+++ b/hasura/migrations/1578416169493_update_permission_user_public_table_parts_order/up.yaml
@@ -0,0 +1,32 @@
+- args:
+ permission:
+ columns:
+ - deliver_by
+ - order_date
+ - ordered_by_user_id
+ - order_number
+ - status
+ - created_at
+ - updated_at
+ - id
+ - jobid
+ - vendorid
+ filter:
+ job:
+ bodyshop:
+ associations:
+ _and:
+ - user:
+ authid:
+ _eq: X-Hasura-User-Id
+ - active:
+ _eq: true
+ localPresets:
+ - key: ""
+ value: ""
+ set: {}
+ role: user
+ table:
+ name: parts_order
+ schema: public
+ type: create_update_permission
diff --git a/hasura/migrations/1578416175507_update_permission_user_public_table_parts_order/down.yaml b/hasura/migrations/1578416175507_update_permission_user_public_table_parts_order/down.yaml
new file mode 100644
index 000000000..ea03cd56b
--- /dev/null
+++ b/hasura/migrations/1578416175507_update_permission_user_public_table_parts_order/down.yaml
@@ -0,0 +1,6 @@
+- args:
+ role: user
+ table:
+ name: parts_order
+ schema: public
+ type: drop_delete_permission
diff --git a/hasura/migrations/1578416175507_update_permission_user_public_table_parts_order/up.yaml b/hasura/migrations/1578416175507_update_permission_user_public_table_parts_order/up.yaml
new file mode 100644
index 000000000..c4181050c
--- /dev/null
+++ b/hasura/migrations/1578416175507_update_permission_user_public_table_parts_order/up.yaml
@@ -0,0 +1,17 @@
+- args:
+ permission:
+ filter:
+ job:
+ bodyshop:
+ associations:
+ _and:
+ - user:
+ authid:
+ _eq: X-Hasura-User-Id
+ - active:
+ _eq: true
+ role: user
+ table:
+ name: parts_order
+ schema: public
+ type: create_delete_permission
diff --git a/hasura/migrations/1578416710710_create_table_public_parts_order_lines/down.yaml b/hasura/migrations/1578416710710_create_table_public_parts_order_lines/down.yaml
new file mode 100644
index 000000000..c5a967f68
--- /dev/null
+++ b/hasura/migrations/1578416710710_create_table_public_parts_order_lines/down.yaml
@@ -0,0 +1,3 @@
+- args:
+ sql: DROP TABLE "public"."parts_order_lines"
+ type: run_sql
diff --git a/hasura/migrations/1578416710710_create_table_public_parts_order_lines/up.yaml b/hasura/migrations/1578416710710_create_table_public_parts_order_lines/up.yaml
new file mode 100644
index 000000000..0b04c75d4
--- /dev/null
+++ b/hasura/migrations/1578416710710_create_table_public_parts_order_lines/up.yaml
@@ -0,0 +1,24 @@
+- args:
+ sql: CREATE EXTENSION IF NOT EXISTS pgcrypto;
+ type: run_sql
+- args:
+ sql: "CREATE TABLE \"public\".\"parts_order_lines\"(\"id\" uuid NOT NULL DEFAULT
+ gen_random_uuid(), \"created_at\" timestamptz NOT NULL DEFAULT now(), \"updated_at\"
+ timestamptz NOT NULL DEFAULT now(), \"orderid\" uuid NOT NULL, \"job_line_id\"
+ uuid, \"line_desc\" text NOT NULL, \"oem_partno\" text, \"db_price\" numeric,
+ \"act_price\" numeric, \"status\" text NOT NULL DEFAULT 'Ordered', \"line_remarks\"
+ text, PRIMARY KEY (\"id\") , FOREIGN KEY (\"orderid\") REFERENCES \"public\".\"parts_order\"(\"id\")
+ ON UPDATE cascade ON DELETE cascade, FOREIGN KEY (\"job_line_id\") REFERENCES
+ \"public\".\"joblines\"(\"id\") ON UPDATE restrict ON DELETE set null);\nCREATE
+ OR REPLACE FUNCTION \"public\".\"set_current_timestamp_updated_at\"()\nRETURNS
+ TRIGGER AS $$\nDECLARE\n _new record;\nBEGIN\n _new := NEW;\n _new.\"updated_at\"
+ = NOW();\n RETURN _new;\nEND;\n$$ LANGUAGE plpgsql;\nCREATE TRIGGER \"set_public_parts_order_lines_updated_at\"\nBEFORE
+ UPDATE ON \"public\".\"parts_order_lines\"\nFOR EACH ROW\nEXECUTE PROCEDURE
+ \"public\".\"set_current_timestamp_updated_at\"();\nCOMMENT ON TRIGGER \"set_public_parts_order_lines_updated_at\"
+ ON \"public\".\"parts_order_lines\" \nIS 'trigger to set value of column \"updated_at\"
+ to current timestamp on row update';\n"
+ type: run_sql
+- args:
+ name: parts_order_lines
+ schema: public
+ type: add_existing_table_or_view
diff --git a/hasura/migrations/1578416775337_track_all_relationships/down.yaml b/hasura/migrations/1578416775337_track_all_relationships/down.yaml
new file mode 100644
index 000000000..9adaa8446
--- /dev/null
+++ b/hasura/migrations/1578416775337_track_all_relationships/down.yaml
@@ -0,0 +1,24 @@
+- args:
+ relationship: parts_order_lines
+ table:
+ name: joblines
+ schema: public
+ type: drop_relationship
+- args:
+ relationship: parts_order_lines
+ table:
+ name: parts_order
+ schema: public
+ type: drop_relationship
+- args:
+ relationship: jobline
+ table:
+ name: parts_order_lines
+ schema: public
+ type: drop_relationship
+- args:
+ relationship: parts_order
+ table:
+ name: parts_order_lines
+ schema: public
+ type: drop_relationship
diff --git a/hasura/migrations/1578416775337_track_all_relationships/up.yaml b/hasura/migrations/1578416775337_track_all_relationships/up.yaml
new file mode 100644
index 000000000..47bf443e8
--- /dev/null
+++ b/hasura/migrations/1578416775337_track_all_relationships/up.yaml
@@ -0,0 +1,40 @@
+- args:
+ name: parts_order_lines
+ table:
+ name: joblines
+ schema: public
+ using:
+ foreign_key_constraint_on:
+ column: job_line_id
+ table:
+ name: parts_order_lines
+ schema: public
+ type: create_array_relationship
+- args:
+ name: parts_order_lines
+ table:
+ name: parts_order
+ schema: public
+ using:
+ foreign_key_constraint_on:
+ column: orderid
+ table:
+ name: parts_order_lines
+ schema: public
+ type: create_array_relationship
+- args:
+ name: jobline
+ table:
+ name: parts_order_lines
+ schema: public
+ using:
+ foreign_key_constraint_on: job_line_id
+ type: create_object_relationship
+- args:
+ name: parts_order
+ table:
+ name: parts_order_lines
+ schema: public
+ using:
+ foreign_key_constraint_on: orderid
+ type: create_object_relationship
diff --git a/hasura/migrations/1578416885067_update_permission_user_public_table_parts_order_lines/down.yaml b/hasura/migrations/1578416885067_update_permission_user_public_table_parts_order_lines/down.yaml
new file mode 100644
index 000000000..3077aa952
--- /dev/null
+++ b/hasura/migrations/1578416885067_update_permission_user_public_table_parts_order_lines/down.yaml
@@ -0,0 +1,6 @@
+- args:
+ role: user
+ table:
+ name: parts_order_lines
+ schema: public
+ type: drop_insert_permission
diff --git a/hasura/migrations/1578416885067_update_permission_user_public_table_parts_order_lines/up.yaml b/hasura/migrations/1578416885067_update_permission_user_public_table_parts_order_lines/up.yaml
new file mode 100644
index 000000000..516e3fc35
--- /dev/null
+++ b/hasura/migrations/1578416885067_update_permission_user_public_table_parts_order_lines/up.yaml
@@ -0,0 +1,35 @@
+- args:
+ permission:
+ allow_upsert: true
+ check:
+ parts_order:
+ job:
+ bodyshop:
+ associations:
+ _and:
+ - user:
+ authid:
+ _eq: X-Hasura-User-Id
+ - active:
+ _eq: true
+ columns:
+ - id
+ - created_at
+ - updated_at
+ - orderid
+ - job_line_id
+ - line_desc
+ - oem_partno
+ - db_price
+ - act_price
+ - status
+ - line_remarks
+ localPresets:
+ - key: ""
+ value: ""
+ set: {}
+ role: user
+ table:
+ name: parts_order_lines
+ schema: public
+ type: create_insert_permission
diff --git a/hasura/migrations/1578416923961_update_permission_user_public_table_parts_order_lines/down.yaml b/hasura/migrations/1578416923961_update_permission_user_public_table_parts_order_lines/down.yaml
new file mode 100644
index 000000000..ff4dc0091
--- /dev/null
+++ b/hasura/migrations/1578416923961_update_permission_user_public_table_parts_order_lines/down.yaml
@@ -0,0 +1,6 @@
+- args:
+ role: user
+ table:
+ name: parts_order_lines
+ schema: public
+ type: drop_select_permission
diff --git a/hasura/migrations/1578416923961_update_permission_user_public_table_parts_order_lines/up.yaml b/hasura/migrations/1578416923961_update_permission_user_public_table_parts_order_lines/up.yaml
new file mode 100644
index 000000000..9b33ac709
--- /dev/null
+++ b/hasura/migrations/1578416923961_update_permission_user_public_table_parts_order_lines/up.yaml
@@ -0,0 +1,32 @@
+- args:
+ permission:
+ allow_aggregations: false
+ columns:
+ - act_price
+ - db_price
+ - line_desc
+ - line_remarks
+ - oem_partno
+ - status
+ - created_at
+ - updated_at
+ - id
+ - job_line_id
+ - orderid
+ filter:
+ parts_order:
+ job:
+ bodyshop:
+ associations:
+ _and:
+ - user:
+ authid:
+ _eq: X-Hasura-User-Id
+ - active:
+ _eq: true
+ limit: null
+ role: user
+ table:
+ name: parts_order_lines
+ schema: public
+ type: create_select_permission
diff --git a/hasura/migrations/1578416929216_update_permission_user_public_table_parts_order_lines/down.yaml b/hasura/migrations/1578416929216_update_permission_user_public_table_parts_order_lines/down.yaml
new file mode 100644
index 000000000..80bc2e713
--- /dev/null
+++ b/hasura/migrations/1578416929216_update_permission_user_public_table_parts_order_lines/down.yaml
@@ -0,0 +1,6 @@
+- args:
+ role: user
+ table:
+ name: parts_order_lines
+ schema: public
+ type: drop_update_permission
diff --git a/hasura/migrations/1578416929216_update_permission_user_public_table_parts_order_lines/up.yaml b/hasura/migrations/1578416929216_update_permission_user_public_table_parts_order_lines/up.yaml
new file mode 100644
index 000000000..03b406e75
--- /dev/null
+++ b/hasura/migrations/1578416929216_update_permission_user_public_table_parts_order_lines/up.yaml
@@ -0,0 +1,34 @@
+- args:
+ permission:
+ columns:
+ - act_price
+ - db_price
+ - line_desc
+ - line_remarks
+ - oem_partno
+ - status
+ - created_at
+ - updated_at
+ - id
+ - job_line_id
+ - orderid
+ filter:
+ parts_order:
+ job:
+ bodyshop:
+ associations:
+ _and:
+ - user:
+ authid:
+ _eq: X-Hasura-User-Id
+ - active:
+ _eq: true
+ localPresets:
+ - key: ""
+ value: ""
+ set: {}
+ role: user
+ table:
+ name: parts_order_lines
+ schema: public
+ type: create_update_permission
diff --git a/hasura/migrations/1578416933624_update_permission_user_public_table_parts_order_lines/down.yaml b/hasura/migrations/1578416933624_update_permission_user_public_table_parts_order_lines/down.yaml
new file mode 100644
index 000000000..d45bd66b3
--- /dev/null
+++ b/hasura/migrations/1578416933624_update_permission_user_public_table_parts_order_lines/down.yaml
@@ -0,0 +1,6 @@
+- args:
+ role: user
+ table:
+ name: parts_order_lines
+ schema: public
+ type: drop_delete_permission
diff --git a/hasura/migrations/1578416933624_update_permission_user_public_table_parts_order_lines/up.yaml b/hasura/migrations/1578416933624_update_permission_user_public_table_parts_order_lines/up.yaml
new file mode 100644
index 000000000..a1cde1393
--- /dev/null
+++ b/hasura/migrations/1578416933624_update_permission_user_public_table_parts_order_lines/up.yaml
@@ -0,0 +1,18 @@
+- args:
+ permission:
+ filter:
+ parts_order:
+ job:
+ bodyshop:
+ associations:
+ _and:
+ - user:
+ authid:
+ _eq: X-Hasura-User-Id
+ - active:
+ _eq: true
+ role: user
+ table:
+ name: parts_order_lines
+ schema: public
+ type: create_delete_permission