Added payment list to jobs BOD-146

This commit is contained in:
Patrick Fic
2020-06-16 10:51:54 -07:00
parent ef81991046
commit 951fce539b
42 changed files with 1403 additions and 212 deletions

View File

@@ -0,0 +1,5 @@
- args:
cascade: false
read_only: false
sql: ALTER TABLE "public"."payments" DROP COLUMN "payer";
type: run_sql

View File

@@ -0,0 +1,5 @@
- args:
cascade: false
read_only: false
sql: ALTER TABLE "public"."payments" ADD COLUMN "payer" text NULL;
type: run_sql

View File

@@ -0,0 +1,36 @@
- args:
role: user
table:
name: payments
schema: public
type: drop_insert_permission
- args:
permission:
check:
job:
bodyshop:
associations:
_and:
- user:
authid:
_eq: X-Hasura-User-Id
- active:
_eq: true
columns:
- id
- created_at
- updated_at
- jobid
- amount
- transactionid
- memo
- stripeid
localPresets:
- key: ""
value: ""
set: {}
role: user
table:
name: payments
schema: public
type: create_insert_permission

View File

@@ -0,0 +1,37 @@
- args:
role: user
table:
name: payments
schema: public
type: drop_insert_permission
- args:
permission:
check:
job:
bodyshop:
associations:
_and:
- user:
authid:
_eq: X-Hasura-User-Id
- active:
_eq: true
columns:
- amount
- created_at
- id
- jobid
- memo
- payer
- stripeid
- transactionid
- updated_at
localPresets:
- key: ""
value: ""
set: {}
role: user
table:
name: payments
schema: public
type: create_insert_permission

View File

@@ -0,0 +1,34 @@
- args:
role: user
table:
name: payments
schema: public
type: drop_select_permission
- args:
permission:
allow_aggregations: false
columns:
- amount
- memo
- stripeid
- transactionid
- created_at
- updated_at
- id
- jobid
computed_fields: []
filter:
job:
bodyshop:
associations:
_and:
- user:
authid:
_eq: X-Hasura-User-Id
- active:
_eq: true
role: user
table:
name: payments
schema: public
type: create_select_permission

View File

@@ -0,0 +1,35 @@
- args:
role: user
table:
name: payments
schema: public
type: drop_select_permission
- args:
permission:
allow_aggregations: false
columns:
- amount
- created_at
- id
- jobid
- memo
- payer
- stripeid
- transactionid
- updated_at
computed_fields: []
filter:
job:
bodyshop:
associations:
_and:
- user:
authid:
_eq: X-Hasura-User-Id
- active:
_eq: true
role: user
table:
name: payments
schema: public
type: create_select_permission

View File

@@ -0,0 +1,36 @@
- args:
role: user
table:
name: payments
schema: public
type: drop_update_permission
- args:
permission:
columns:
- amount
- memo
- stripeid
- transactionid
- 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: payments
schema: public
type: create_update_permission

View File

@@ -0,0 +1,37 @@
- args:
role: user
table:
name: payments
schema: public
type: drop_update_permission
- args:
permission:
columns:
- amount
- created_at
- id
- jobid
- memo
- payer
- stripeid
- transactionid
- updated_at
filter:
job:
bodyshop:
associations:
_and:
- user:
authid:
_eq: X-Hasura-User-Id
- active:
_eq: true
localPresets:
- key: ""
value: ""
set: {}
role: user
table:
name: payments
schema: public
type: create_update_permission

View File

@@ -0,0 +1 @@
[]

View File

@@ -0,0 +1,5 @@
- args:
cascade: true
read_only: false
sql: CREATE INDEX idx_payments_payer ON payments USING GIN (payer gin_trgm_ops);
type: run_sql

View File

@@ -0,0 +1 @@
[]

View File

@@ -0,0 +1,12 @@
- args:
cascade: true
read_only: false
sql: "CREATE OR REPLACE FUNCTION public.search_payments(search text)\n RETURNS
SETOF payments\n LANGUAGE plpgsql\n STABLE\nAS $function$\n\nBEGIN\n if search
= '' then\n return query select * from payments ;\n else \n return query
SELECT\n *\nFROM\n payments\nWHERE\n search <% (payer) ;\n end if;\n\n\tEND\n$function$;"
type: run_sql
- args:
name: search_payments
schema: public
type: track_function

View File

@@ -0,0 +1,35 @@
- args:
role: user
table:
name: payments
schema: public
type: drop_select_permission
- args:
permission:
allow_aggregations: false
columns:
- amount
- created_at
- id
- jobid
- memo
- payer
- stripeid
- transactionid
- updated_at
computed_fields: []
filter:
job:
bodyshop:
associations:
_and:
- user:
authid:
_eq: X-Hasura-User-Id
- active:
_eq: true
role: user
table:
name: payments
schema: public
type: create_select_permission

View File

@@ -0,0 +1,35 @@
- args:
role: user
table:
name: payments
schema: public
type: drop_select_permission
- args:
permission:
allow_aggregations: true
columns:
- amount
- created_at
- id
- jobid
- memo
- payer
- stripeid
- transactionid
- updated_at
computed_fields: []
filter:
job:
bodyshop:
associations:
_and:
- user:
authid:
_eq: X-Hasura-User-Id
- active:
_eq: true
role: user
table:
name: payments
schema: public
type: create_select_permission

View File

@@ -0,0 +1 @@
[]

View File

@@ -0,0 +1,7 @@
- args:
cascade: true
read_only: false
sql: |-
CREATE INDEX idx_payments_memo ON payments USING GIN (memo gin_trgm_ops);
CREATE INDEX idx_payments_txnid ON payments USING GIN (transactionid gin_trgm_ops);
type: run_sql

View File

@@ -0,0 +1 @@
[]

View File

@@ -0,0 +1,9 @@
- args:
cascade: true
read_only: false
sql: "CREATE OR REPLACE FUNCTION public.search_payments(search text)\n RETURNS
SETOF payments\n LANGUAGE plpgsql\n STABLE\nAS $function$\n\nBEGIN\n if search
= '' then\n return query select * from payments ;\n else \n return query
SELECT\n *\nFROM\n payments\nWHERE\n search <% (payer) OR\n search <% (transactionid)
OR\n search <% (memo);\n end if;\n\n\tEND\n$function$;"
type: run_sql

View File

@@ -0,0 +1,5 @@
- args:
cascade: false
read_only: false
sql: ALTER TABLE "public"."payments" DROP COLUMN "exportedat";
type: run_sql

View File

@@ -0,0 +1,5 @@
- args:
cascade: false
read_only: false
sql: ALTER TABLE "public"."payments" ADD COLUMN "exportedat" timestamptz NULL;
type: run_sql

View File

@@ -0,0 +1,37 @@
- args:
role: user
table:
name: payments
schema: public
type: drop_insert_permission
- args:
permission:
check:
job:
bodyshop:
associations:
_and:
- user:
authid:
_eq: X-Hasura-User-Id
- active:
_eq: true
columns:
- amount
- created_at
- id
- jobid
- memo
- payer
- stripeid
- transactionid
- updated_at
localPresets:
- key: ""
value: ""
set: {}
role: user
table:
name: payments
schema: public
type: create_insert_permission

View File

@@ -0,0 +1,38 @@
- args:
role: user
table:
name: payments
schema: public
type: drop_insert_permission
- args:
permission:
check:
job:
bodyshop:
associations:
_and:
- user:
authid:
_eq: X-Hasura-User-Id
- active:
_eq: true
columns:
- amount
- created_at
- exportedat
- id
- jobid
- memo
- payer
- stripeid
- transactionid
- updated_at
localPresets:
- key: ""
value: ""
set: {}
role: user
table:
name: payments
schema: public
type: create_insert_permission

View File

@@ -0,0 +1,35 @@
- args:
role: user
table:
name: payments
schema: public
type: drop_select_permission
- args:
permission:
allow_aggregations: true
columns:
- amount
- created_at
- id
- jobid
- memo
- payer
- stripeid
- transactionid
- updated_at
computed_fields: []
filter:
job:
bodyshop:
associations:
_and:
- user:
authid:
_eq: X-Hasura-User-Id
- active:
_eq: true
role: user
table:
name: payments
schema: public
type: create_select_permission

View File

@@ -0,0 +1,36 @@
- args:
role: user
table:
name: payments
schema: public
type: drop_select_permission
- args:
permission:
allow_aggregations: true
columns:
- amount
- created_at
- exportedat
- id
- jobid
- memo
- payer
- stripeid
- transactionid
- updated_at
computed_fields: []
filter:
job:
bodyshop:
associations:
_and:
- user:
authid:
_eq: X-Hasura-User-Id
- active:
_eq: true
role: user
table:
name: payments
schema: public
type: create_select_permission

View File

@@ -0,0 +1,37 @@
- args:
role: user
table:
name: payments
schema: public
type: drop_update_permission
- args:
permission:
columns:
- amount
- created_at
- id
- jobid
- memo
- payer
- stripeid
- transactionid
- updated_at
filter:
job:
bodyshop:
associations:
_and:
- user:
authid:
_eq: X-Hasura-User-Id
- active:
_eq: true
localPresets:
- key: ""
value: ""
set: {}
role: user
table:
name: payments
schema: public
type: create_update_permission

View File

@@ -0,0 +1,38 @@
- args:
role: user
table:
name: payments
schema: public
type: drop_update_permission
- args:
permission:
columns:
- amount
- created_at
- exportedat
- id
- jobid
- memo
- payer
- stripeid
- transactionid
- updated_at
filter:
job:
bodyshop:
associations:
_and:
- user:
authid:
_eq: X-Hasura-User-Id
- active:
_eq: true
localPresets:
- key: ""
value: ""
set: {}
role: user
table:
name: payments
schema: public
type: create_update_permission

View File

@@ -3214,26 +3214,30 @@ tables:
- active:
_eq: true
columns:
- id
- created_at
- updated_at
- jobid
- amount
- transactionid
- created_at
- exportedat
- id
- jobid
- memo
- payer
- stripeid
- transactionid
- updated_at
select_permissions:
- role: user
permission:
columns:
- amount
- memo
- stripeid
- transactionid
- created_at
- updated_at
- exportedat
- id
- jobid
- memo
- payer
- stripeid
- transactionid
- updated_at
filter:
job:
bodyshop:
@@ -3244,18 +3248,21 @@ tables:
_eq: X-Hasura-User-Id
- active:
_eq: true
allow_aggregations: true
update_permissions:
- role: user
permission:
columns:
- amount
- memo
- stripeid
- transactionid
- created_at
- updated_at
- exportedat
- id
- jobid
- memo
- payer
- stripeid
- transactionid
- updated_at
filter:
job:
bodyshop:
@@ -3870,3 +3877,6 @@ functions:
- function:
schema: public
name: search_owner
- function:
schema: public
name: search_payments