Jobslines schema. Added phone number formatting.

This commit is contained in:
Patrick Fic
2019-12-16 17:41:07 -08:00
parent 337048f0e9
commit 03d99a27c3
42 changed files with 1076 additions and 72 deletions

View File

@@ -0,0 +1,3 @@
- args:
sql: ALTER TABLE "public"."jobs" DROP COLUMN "claim_total";
type: run_sql

View File

@@ -0,0 +1,3 @@
- args:
sql: ALTER TABLE "public"."jobs" ADD COLUMN "claim_total" numeric NULL;
type: run_sql

View File

@@ -0,0 +1,3 @@
- args:
sql: ALTER TABLE "public"."jobs" DROP COLUMN "deducitble";
type: run_sql

View File

@@ -0,0 +1,3 @@
- args:
sql: ALTER TABLE "public"."jobs" ADD COLUMN "deducitble" numeric NULL;
type: run_sql

View File

@@ -0,0 +1,6 @@
- args:
sql: ALTER TABLE ONLY "public"."jobs" ALTER COLUMN "deducitble" SET DEFAULT 0;
type: run_sql
- args:
sql: COMMENT ON COLUMN "public"."jobs"."deducitble" IS E'null'
type: run_sql

View File

@@ -0,0 +1,6 @@
- args:
sql: ALTER TABLE ONLY "public"."jobs" ALTER COLUMN "deducitble" SET DEFAULT 0;
type: run_sql
- args:
sql: COMMENT ON COLUMN "public"."jobs"."deducitble" IS E''
type: run_sql

View File

@@ -0,0 +1,6 @@
- args:
sql: ALTER TABLE ONLY "public"."jobs" ALTER COLUMN "claim_total" SET DEFAULT 0;
type: run_sql
- args:
sql: COMMENT ON COLUMN "public"."jobs"."claim_total" IS E'null'
type: run_sql

View File

@@ -0,0 +1,6 @@
- args:
sql: ALTER TABLE ONLY "public"."jobs" ALTER COLUMN "claim_total" SET DEFAULT 0;
type: run_sql
- args:
sql: COMMENT ON COLUMN "public"."jobs"."claim_total" IS E''
type: run_sql

View File

@@ -0,0 +1,82 @@
- args:
role: user
table:
name: jobs
schema: public
type: drop_insert_permission
- args:
permission:
check:
bodyshop:
associations:
_and:
- user:
authid:
_eq: X-Hasura-User-Id
- active:
_eq: true
columns:
- actual_completion
- actual_delivery
- actual_in
- created_at
- est_addr1
- est_addr2
- est_city
- est_co_nm
- est_ct_fn
- est_ct_ln
- est_ctry
- est_ea
- est_number
- est_ph1
- est_st
- est_zip
- federal_tax_rate
- invoice_date
- labor_rate_desc
- labor_rate_id
- local_tax_rate
- ownerid
- rate_atp
- rate_la1
- rate_la2
- rate_la3
- rate_la4
- rate_lab
- rate_lad
- rate_lae
- rate_laf
- rate_lag
- rate_lam
- rate_lar
- rate_las
- rate_lau
- rate_ma2s
- rate_ma2t
- rate_ma3s
- rate_mabl
- rate_macs
- rate_mahw
- rate_mapa
- rate_mash
- rate_matd
- regie_number
- ro_number
- scheduled_completion
- scheduled_delivery
- scheduled_in
- shopid
- state_tax_rate
- status
- updated_at
- vehicleid
localPresets:
- key: ""
value: ""
set: {}
role: user
table:
name: jobs
schema: public
type: create_insert_permission

View File

@@ -0,0 +1,84 @@
- args:
role: user
table:
name: jobs
schema: public
type: drop_insert_permission
- args:
permission:
check:
bodyshop:
associations:
_and:
- user:
authid:
_eq: X-Hasura-User-Id
- active:
_eq: true
columns:
- actual_completion
- actual_delivery
- actual_in
- claim_total
- created_at
- deducitble
- est_addr1
- est_addr2
- est_city
- est_co_nm
- est_ct_fn
- est_ct_ln
- est_ctry
- est_ea
- est_number
- est_ph1
- est_st
- est_zip
- federal_tax_rate
- invoice_date
- labor_rate_desc
- labor_rate_id
- local_tax_rate
- ownerid
- rate_atp
- rate_la1
- rate_la2
- rate_la3
- rate_la4
- rate_lab
- rate_lad
- rate_lae
- rate_laf
- rate_lag
- rate_lam
- rate_lar
- rate_las
- rate_lau
- rate_ma2s
- rate_ma2t
- rate_ma3s
- rate_mabl
- rate_macs
- rate_mahw
- rate_mapa
- rate_mash
- rate_matd
- regie_number
- ro_number
- scheduled_completion
- scheduled_delivery
- scheduled_in
- shopid
- state_tax_rate
- status
- updated_at
- vehicleid
localPresets:
- key: ""
value: ""
set: {}
role: user
table:
name: jobs
schema: public
type: create_insert_permission

View File

@@ -0,0 +1,81 @@
- args:
role: user
table:
name: jobs
schema: public
type: drop_select_permission
- args:
permission:
allow_aggregations: false
columns:
- invoice_date
- federal_tax_rate
- local_tax_rate
- rate_atp
- rate_la1
- rate_la2
- rate_la3
- rate_la4
- rate_lab
- rate_lad
- rate_lae
- rate_laf
- rate_lag
- rate_lam
- rate_lar
- rate_las
- rate_lau
- rate_ma2s
- rate_ma2t
- rate_ma3s
- rate_mabl
- rate_macs
- rate_mahw
- rate_mapa
- rate_mash
- rate_matd
- state_tax_rate
- est_addr1
- est_addr2
- est_city
- est_co_nm
- est_ct_fn
- est_ct_ln
- est_ctry
- est_ea
- est_number
- est_ph1
- est_st
- est_zip
- labor_rate_desc
- labor_rate_id
- regie_number
- ro_number
- status
- actual_completion
- actual_delivery
- actual_in
- scheduled_completion
- scheduled_delivery
- scheduled_in
- created_at
- updated_at
- id
- ownerid
- shopid
- vehicleid
computed_fields: []
filter:
bodyshop:
associations:
_and:
- user:
authid:
_eq: X-Hasura-User-Id
- active:
_eq: true
role: user
table:
name: jobs
schema: public
type: create_select_permission

View File

@@ -0,0 +1,83 @@
- args:
role: user
table:
name: jobs
schema: public
type: drop_select_permission
- args:
permission:
allow_aggregations: false
columns:
- actual_completion
- actual_delivery
- actual_in
- claim_total
- created_at
- deducitble
- est_addr1
- est_addr2
- est_city
- est_co_nm
- est_ct_fn
- est_ct_ln
- est_ctry
- est_ea
- est_number
- est_ph1
- est_st
- est_zip
- federal_tax_rate
- id
- invoice_date
- labor_rate_desc
- labor_rate_id
- local_tax_rate
- ownerid
- rate_atp
- rate_la1
- rate_la2
- rate_la3
- rate_la4
- rate_lab
- rate_lad
- rate_lae
- rate_laf
- rate_lag
- rate_lam
- rate_lar
- rate_las
- rate_lau
- rate_ma2s
- rate_ma2t
- rate_ma3s
- rate_mabl
- rate_macs
- rate_mahw
- rate_mapa
- rate_mash
- rate_matd
- regie_number
- ro_number
- scheduled_completion
- scheduled_delivery
- scheduled_in
- shopid
- state_tax_rate
- status
- updated_at
- vehicleid
computed_fields: []
filter:
bodyshop:
associations:
_and:
- user:
authid:
_eq: X-Hasura-User-Id
- active:
_eq: true
role: user
table:
name: jobs
schema: public
type: create_select_permission

View File

@@ -0,0 +1,82 @@
- args:
role: user
table:
name: jobs
schema: public
type: drop_update_permission
- args:
permission:
columns:
- actual_completion
- actual_delivery
- actual_in
- created_at
- est_addr1
- est_addr2
- est_city
- est_co_nm
- est_ct_fn
- est_ct_ln
- est_ctry
- est_ea
- est_number
- est_ph1
- est_st
- est_zip
- federal_tax_rate
- invoice_date
- labor_rate_desc
- labor_rate_id
- local_tax_rate
- ownerid
- rate_atp
- rate_la1
- rate_la2
- rate_la3
- rate_la4
- rate_lab
- rate_lad
- rate_lae
- rate_laf
- rate_lag
- rate_lam
- rate_lar
- rate_las
- rate_lau
- rate_ma2s
- rate_ma2t
- rate_ma3s
- rate_mabl
- rate_macs
- rate_mahw
- rate_mapa
- rate_mash
- rate_matd
- regie_number
- ro_number
- scheduled_completion
- scheduled_delivery
- scheduled_in
- shopid
- state_tax_rate
- status
- updated_at
- vehicleid
filter:
bodyshop:
associations:
_and:
- user:
authid:
_eq: X-Hasura-User-Id
- active:
_eq: true
localPresets:
- key: ""
value: ""
set: {}
role: user
table:
name: jobs
schema: public
type: create_update_permission

View File

@@ -0,0 +1,84 @@
- args:
role: user
table:
name: jobs
schema: public
type: drop_update_permission
- args:
permission:
columns:
- actual_completion
- actual_delivery
- actual_in
- claim_total
- created_at
- deducitble
- est_addr1
- est_addr2
- est_city
- est_co_nm
- est_ct_fn
- est_ct_ln
- est_ctry
- est_ea
- est_number
- est_ph1
- est_st
- est_zip
- federal_tax_rate
- invoice_date
- labor_rate_desc
- labor_rate_id
- local_tax_rate
- ownerid
- rate_atp
- rate_la1
- rate_la2
- rate_la3
- rate_la4
- rate_lab
- rate_lad
- rate_lae
- rate_laf
- rate_lag
- rate_lam
- rate_lar
- rate_las
- rate_lau
- rate_ma2s
- rate_ma2t
- rate_ma3s
- rate_mabl
- rate_macs
- rate_mahw
- rate_mapa
- rate_mash
- rate_matd
- regie_number
- ro_number
- scheduled_completion
- scheduled_delivery
- scheduled_in
- shopid
- state_tax_rate
- status
- updated_at
- vehicleid
filter:
bodyshop:
associations:
_and:
- user:
authid:
_eq: X-Hasura-User-Id
- active:
_eq: true
localPresets:
- key: ""
value: ""
set: {}
role: user
table:
name: jobs
schema: public
type: create_update_permission

View File

@@ -0,0 +1,6 @@
- args:
sql: COMMENT ON COLUMN "public"."jobs"."deducitble" IS E'null'
type: run_sql
- args:
sql: alter table "public"."jobs" rename column "deductible" to "deducitble";
type: run_sql

View File

@@ -0,0 +1,6 @@
- args:
sql: COMMENT ON COLUMN "public"."jobs"."deducitble" IS E''
type: run_sql
- args:
sql: alter table "public"."jobs" rename column "deducitble" to "deductible";
type: run_sql

View File

@@ -0,0 +1,3 @@
- args:
sql: DROP TABLE "public"."joblines"
type: run_sql

View File

@@ -0,0 +1,24 @@
- args:
sql: CREATE EXTENSION IF NOT EXISTS pgcrypto;
type: run_sql
- args:
sql: "CREATE TABLE \"public\".\"joblines\"(\"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, \"unq_seq\" integer, \"line_ind\"
text, \"line_desc\" text, \"part_type\" text, \"oem_partno\" text, \"est_seq\"
integer, \"db_ref\" text, \"line_ref\" text, \"tax_part\" boolean NOT NULL DEFAULT
true, \"db_price\" numeric, \"act_price\" numeric, \"part_qty\" integer, \"alt_partno\"
text, \"mod_lbr_ty\" text, \"db_hrs\" numeric, \"mod_lb_hrs\" numeric, \"lbr_op\"
text, \"lbr_amt\" numeric, PRIMARY KEY (\"id\") , FOREIGN KEY (\"jobid\") REFERENCES
\"public\".\"jobs\"(\"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_joblines_updated_at\"\nBEFORE
UPDATE ON \"public\".\"joblines\"\nFOR EACH ROW\nEXECUTE PROCEDURE \"public\".\"set_current_timestamp_updated_at\"();\nCOMMENT
ON TRIGGER \"set_public_joblines_updated_at\" ON \"public\".\"joblines\" \nIS
'trigger to set value of column \"updated_at\" to current timestamp on row update';\n"
type: run_sql
- args:
name: joblines
schema: public
type: add_existing_table_or_view

View File

@@ -0,0 +1,12 @@
- args:
relationship: job
table:
name: joblines
schema: public
type: drop_relationship
- args:
relationship: joblines
table:
name: jobs
schema: public
type: drop_relationship

View File

@@ -0,0 +1,20 @@
- args:
name: job
table:
name: joblines
schema: public
using:
foreign_key_constraint_on: jobid
type: create_object_relationship
- args:
name: joblines
table:
name: jobs
schema: public
using:
foreign_key_constraint_on:
column: jobid
table:
name: joblines
schema: public
type: create_array_relationship

View File

@@ -0,0 +1,6 @@
- args:
role: user
table:
name: joblines
schema: public
type: drop_insert_permission

View File

@@ -0,0 +1,45 @@
- args:
permission:
allow_upsert: true
check:
job:
bodyshop:
associations:
_and:
- user:
authid:
_eq: X-Hasura-User-Id
- active:
_eq: true
columns:
- id
- created_at
- updated_at
- jobid
- unq_seq
- line_ind
- line_desc
- part_type
- oem_partno
- est_seq
- db_ref
- line_ref
- tax_part
- db_price
- act_price
- part_qty
- alt_partno
- mod_lbr_ty
- db_hrs
- mod_lb_hrs
- lbr_op
- lbr_amt
localPresets:
- key: ""
value: ""
set: {}
role: user
table:
name: joblines
schema: public
type: create_insert_permission

View File

@@ -0,0 +1,6 @@
- args:
role: user
table:
name: joblines
schema: public
type: drop_select_permission

View File

@@ -0,0 +1,42 @@
- args:
permission:
allow_aggregations: false
columns:
- tax_part
- est_seq
- part_qty
- unq_seq
- act_price
- db_hrs
- db_price
- lbr_amt
- mod_lb_hrs
- alt_partno
- db_ref
- lbr_op
- line_desc
- line_ind
- line_ref
- mod_lbr_ty
- oem_partno
- part_type
- created_at
- updated_at
- id
- jobid
filter:
job:
bodyshop:
associations:
_and:
- user:
authid:
_eq: X-Hasura-User-Id
- active:
_eq: true
limit: null
role: user
table:
name: joblines
schema: public
type: create_select_permission

View File

@@ -0,0 +1,6 @@
- args:
role: user
table:
name: joblines
schema: public
type: drop_update_permission

View File

@@ -0,0 +1,44 @@
- args:
permission:
columns:
- tax_part
- est_seq
- part_qty
- unq_seq
- act_price
- db_hrs
- db_price
- lbr_amt
- mod_lb_hrs
- alt_partno
- db_ref
- lbr_op
- line_desc
- line_ind
- line_ref
- mod_lbr_ty
- oem_partno
- part_type
- created_at
- updated_at
- id
- jobid
filter:
job:
bodyshop:
associations:
_and:
- user:
authid:
_eq: X-Hasura-User-Id
- active:
_eq: true
localPresets:
- key: ""
value: ""
set: {}
role: user
table:
name: joblines
schema: public
type: create_update_permission

View File

@@ -0,0 +1,6 @@
- args:
role: user
table:
name: joblines
schema: public
type: drop_delete_permission

View File

@@ -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: joblines
schema: public
type: create_delete_permission