+
{
+ return (
+
+
+ {
+ search.search = value;
+ history.push({ search: queryString.stringify(search) });
+ }}
+ enterButton
+ />
+
+ );
+ }}
+ />
+
+ );
+}
diff --git a/client/src/components/schedule-event/schedule-event.component.jsx b/client/src/components/schedule-event/schedule-event.component.jsx
index 19a537b6c..e1c024a8d 100644
--- a/client/src/components/schedule-event/schedule-event.component.jsx
+++ b/client/src/components/schedule-event/schedule-event.component.jsx
@@ -1,9 +1,9 @@
+import { Button, Popover } from "antd";
import React from "react";
-import { Popover, Button, Progress } from "antd";
+import { useTranslation } from "react-i18next";
+import { Link } from "react-router-dom";
import CurrencyFormatter from "../../utils/CurrencyFormatter";
import PhoneFormatter from "../../utils/PhoneFormatter";
-import { Link } from "react-router-dom";
-import { useTranslation } from "react-i18next";
import DataLabel from "../data-label/data-label.component";
export default function ScheduleEventComponent({ event, handleCancel }) {
diff --git a/client/src/graphql/jobs.queries.js b/client/src/graphql/jobs.queries.js
index 778beb580..05073307b 100644
--- a/client/src/graphql/jobs.queries.js
+++ b/client/src/graphql/jobs.queries.js
@@ -269,6 +269,15 @@ export const GET_JOB_BY_PK = gql`
lbr_amt
op_code_desc
}
+ payments {
+ id
+ amount
+ payer
+ created_at
+ stripeid
+ transactionid
+ memo
+ }
cccontracts {
id
status
diff --git a/client/src/graphql/payments.queries.js b/client/src/graphql/payments.queries.js
index 0a4a83dd2..d7b94263d 100644
--- a/client/src/graphql/payments.queries.js
+++ b/client/src/graphql/payments.queries.js
@@ -9,3 +9,42 @@ export const INSERT_NEW_PAYMENT = gql`
}
}
`;
+
+export const QUERY_ALL_PAYMENTS_PAGINATED = gql`
+ query QUERY_ALL_PAYMENTS_PAGINATED(
+ $search: String
+ $offset: Int
+ $limit: Int
+ $order: [payments_order_by!]!
+ ) {
+ search_payments(
+ args: { search: $search }
+ offset: $offset
+ limit: $limit
+ order_by: $order
+ ) {
+ id
+ created_at
+ jobid
+ job {
+ id
+ ro_number
+ est_number
+ ownr_fn
+ ownr_ln
+ ownr_co_nm
+ }
+ transactionid
+ memo
+ amount
+ stripeid
+ exportedat
+ stripeid
+ }
+ search_payments_aggregate(args: { search: $search }) {
+ aggregate {
+ count(distinct: true)
+ }
+ }
+ }
+`;
diff --git a/client/src/pages/manage/manage.page.component.jsx b/client/src/pages/manage/manage.page.component.jsx
index e380ec04d..540cc5110 100644
--- a/client/src/pages/manage/manage.page.component.jsx
+++ b/client/src/pages/manage/manage.page.component.jsx
@@ -109,6 +109,9 @@ const JobsClose = lazy(() => import("../jobs-close/jobs-close.container"));
const ShopCsiPageContainer = lazy(() =>
import("../shop-csi/shop-csi.container.page")
);
+const PaymentsAll = lazy(() =>
+ import("../payments-all/payments-all.container.page")
+);
const { Content } = Layout;
@@ -134,11 +137,11 @@ export function Manage({ match, conflict }) {
}, [t]);
return (
-
+
-
+
{conflict ? (
@@ -147,7 +150,8 @@ export function Manage({ match, conflict }) {
- }>
+ }
+ >
@@ -296,6 +300,11 @@ export function Manage({ match, conflict }) {
path={`${match.path}/accounting/payables`}
component={AccountingPayables}
/>
+
)}
diff --git a/client/src/pages/payments-all/payments-all.container.page.jsx b/client/src/pages/payments-all/payments-all.container.page.jsx
new file mode 100644
index 000000000..4caba08df
--- /dev/null
+++ b/client/src/pages/payments-all/payments-all.container.page.jsx
@@ -0,0 +1,68 @@
+import { useQuery } from "@apollo/react-hooks";
+import queryString from "query-string";
+import React, { useEffect } from "react";
+import { useTranslation } from "react-i18next";
+import { connect } from "react-redux";
+import { useLocation } from "react-router-dom";
+import { createStructuredSelector } from "reselect";
+import AlertComponent from "../../components/alert/alert.component";
+import PaymentsListPaginated from "../../components/payments-list-paginated/payment-list-paginated.component";
+import { QUERY_ALL_PAYMENTS_PAGINATED } from "../../graphql/payments.queries";
+import { setBreadcrumbs } from "../../redux/application/application.actions";
+import { selectBodyshop } from "../../redux/user/user.selectors";
+
+const mapStateToProps = createStructuredSelector({
+ bodyshop: selectBodyshop,
+});
+
+const mapDispatchToProps = (dispatch) => ({
+ setBreadcrumbs: (breadcrumbs) => dispatch(setBreadcrumbs(breadcrumbs)),
+});
+
+export function AllJobs({ bodyshop, setBreadcrumbs }) {
+ const searchParams = queryString.parse(useLocation().search);
+ const { page, sortcolumn, sortorder, search } = searchParams;
+
+ const { loading, error, data, refetch } = useQuery(
+ QUERY_ALL_PAYMENTS_PAGINATED,
+ {
+ variables: {
+ search: search || "",
+ offset: page ? (page - 1) * 25 : 0,
+ limit: 25,
+ order: [
+ {
+ [sortcolumn || "created_at"]: sortorder
+ ? sortorder === "descend"
+ ? "desc"
+ : "asc"
+ : "desc",
+ },
+ ],
+ },
+ }
+ );
+ const { t } = useTranslation();
+
+ useEffect(() => {
+ document.title = t("titles.payments-all");
+ setBreadcrumbs([
+ { link: "/manage/payments", label: t("titles.bc.payments-all") },
+ ]);
+ }, [t, setBreadcrumbs]);
+
+ if (error) return ;
+ return (
+
+ );
+}
+
+export default connect(mapStateToProps, mapDispatchToProps)(AllJobs);
diff --git a/client/src/translations/en_us/common.json b/client/src/translations/en_us/common.json
index 7515edbeb..92c6b5948 100644
--- a/client/src/translations/en_us/common.json
+++ b/client/src/translations/en_us/common.json
@@ -779,6 +779,7 @@
"invoices": "Invoices",
"jobs": "Jobs",
"owners": "Owners",
+ "payments": "All Payments",
"productionlist": "Production - List",
"schedule": "Schedule",
"shop": "My Shop",
@@ -915,13 +916,22 @@
"payments": {
"fields": {
"amount": "Amount",
+ "created_at": "Created At",
+ "exportedat": "Exported At",
"memo": "Memo",
- "transactionid": "Transaction Reference"
+ "payer": "Payer",
+ "stripeid": "Stripe ID",
+ "transactionid": "Transaction ID"
},
"labels": {
"electronicpayment": "Use Electronic Payment Processing?",
"new": "New Payment",
- "signup": "Please contact support to sign up for electronic payments."
+ "signup": "Please contact support to sign up for electronic payments.",
+ "title": "Payments"
+ },
+ "successes": {
+ "payment": "Payment created successfully. ",
+ "stripe": "Credit card transaction charged successfully."
}
},
"printcenter": {
@@ -1027,6 +1037,7 @@
"jobs-new": "Create a New Job",
"owner-detail": "{{name}}",
"owners": "Owners",
+ "payments-all": "All Payments",
"productionboard": "Production Board",
"productionlist": "Production - List",
"schedule": "Schedule",
@@ -1054,6 +1065,7 @@
"manageroot": "Home | $t(titles.app)",
"owners": "All Owners | $t(titles.app)",
"owners-detail": "{{name}} | $t(titles.app)",
+ "payments-all": "Payments | $t(titles.app)",
"productionboard": "Production - Board",
"productionlist": "Production - List View | $t(titles.app)",
"profile": "My Profile | $t(titles.app)",
diff --git a/client/src/translations/es/common.json b/client/src/translations/es/common.json
index 87da31b34..9a49572c2 100644
--- a/client/src/translations/es/common.json
+++ b/client/src/translations/es/common.json
@@ -779,6 +779,7 @@
"invoices": "",
"jobs": "Trabajos",
"owners": "propietarios",
+ "payments": "",
"productionlist": "",
"schedule": "Programar",
"shop": "Mi tienda",
@@ -915,13 +916,22 @@
"payments": {
"fields": {
"amount": "",
+ "created_at": "",
+ "exportedat": "",
"memo": "",
+ "payer": "",
+ "stripeid": "",
"transactionid": ""
},
"labels": {
"electronicpayment": "",
"new": "",
- "signup": ""
+ "signup": "",
+ "title": ""
+ },
+ "successes": {
+ "payment": "",
+ "stripe": ""
}
},
"printcenter": {
@@ -1027,6 +1037,7 @@
"jobs-new": "",
"owner-detail": "",
"owners": "",
+ "payments-all": "",
"productionboard": "",
"productionlist": "",
"schedule": "",
@@ -1054,6 +1065,7 @@
"manageroot": "Casa | $t(titles.app)",
"owners": "Todos los propietarios | $t(titles.app)",
"owners-detail": "",
+ "payments-all": "",
"productionboard": "",
"productionlist": "",
"profile": "Mi perfil | $t(titles.app)",
diff --git a/client/src/translations/fr/common.json b/client/src/translations/fr/common.json
index e5220c596..c98a1917d 100644
--- a/client/src/translations/fr/common.json
+++ b/client/src/translations/fr/common.json
@@ -779,6 +779,7 @@
"invoices": "",
"jobs": "Emplois",
"owners": "Propriétaires",
+ "payments": "",
"productionlist": "",
"schedule": "Programme",
"shop": "Mon magasin",
@@ -915,13 +916,22 @@
"payments": {
"fields": {
"amount": "",
+ "created_at": "",
+ "exportedat": "",
"memo": "",
+ "payer": "",
+ "stripeid": "",
"transactionid": ""
},
"labels": {
"electronicpayment": "",
"new": "",
- "signup": ""
+ "signup": "",
+ "title": ""
+ },
+ "successes": {
+ "payment": "",
+ "stripe": ""
}
},
"printcenter": {
@@ -1027,6 +1037,7 @@
"jobs-new": "",
"owner-detail": "",
"owners": "",
+ "payments-all": "",
"productionboard": "",
"productionlist": "",
"schedule": "",
@@ -1054,6 +1065,7 @@
"manageroot": "Accueil | $t(titles.app)",
"owners": "Tous les propriétaires | $t(titles.app)",
"owners-detail": "",
+ "payments-all": "",
"productionboard": "",
"productionlist": "",
"profile": "Mon profil | $t(titles.app)",
diff --git a/client/src/utils/DateFormatter.jsx b/client/src/utils/DateFormatter.jsx
index 07a41d7b4..1989c53ea 100644
--- a/client/src/utils/DateFormatter.jsx
+++ b/client/src/utils/DateFormatter.jsx
@@ -2,9 +2,13 @@ import React from "react";
import Moment from "react-moment";
export function DateFormatter(props) {
- return {props.children || null};
+ return props.children ? (
+ {props.children}
+ ) : null;
}
export function DateTimeFormatter(props) {
- return {props.children || ""};
+ return props.children ? (
+ {props.children}
+ ) : null;
}
diff --git a/hasura/migrations/1592324594982_alter_table_public_payments_add_column_payer/down.yaml b/hasura/migrations/1592324594982_alter_table_public_payments_add_column_payer/down.yaml
new file mode 100644
index 000000000..8ead0dc0d
--- /dev/null
+++ b/hasura/migrations/1592324594982_alter_table_public_payments_add_column_payer/down.yaml
@@ -0,0 +1,5 @@
+- args:
+ cascade: false
+ read_only: false
+ sql: ALTER TABLE "public"."payments" DROP COLUMN "payer";
+ type: run_sql
diff --git a/hasura/migrations/1592324594982_alter_table_public_payments_add_column_payer/up.yaml b/hasura/migrations/1592324594982_alter_table_public_payments_add_column_payer/up.yaml
new file mode 100644
index 000000000..968dd3294
--- /dev/null
+++ b/hasura/migrations/1592324594982_alter_table_public_payments_add_column_payer/up.yaml
@@ -0,0 +1,5 @@
+- args:
+ cascade: false
+ read_only: false
+ sql: ALTER TABLE "public"."payments" ADD COLUMN "payer" text NULL;
+ type: run_sql
diff --git a/hasura/migrations/1592324603137_update_permission_user_public_table_payments/down.yaml b/hasura/migrations/1592324603137_update_permission_user_public_table_payments/down.yaml
new file mode 100644
index 000000000..5d9f8f5a0
--- /dev/null
+++ b/hasura/migrations/1592324603137_update_permission_user_public_table_payments/down.yaml
@@ -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
diff --git a/hasura/migrations/1592324603137_update_permission_user_public_table_payments/up.yaml b/hasura/migrations/1592324603137_update_permission_user_public_table_payments/up.yaml
new file mode 100644
index 000000000..248a04f37
--- /dev/null
+++ b/hasura/migrations/1592324603137_update_permission_user_public_table_payments/up.yaml
@@ -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
diff --git a/hasura/migrations/1592324618856_update_permission_user_public_table_payments/down.yaml b/hasura/migrations/1592324618856_update_permission_user_public_table_payments/down.yaml
new file mode 100644
index 000000000..87b993f56
--- /dev/null
+++ b/hasura/migrations/1592324618856_update_permission_user_public_table_payments/down.yaml
@@ -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
diff --git a/hasura/migrations/1592324618856_update_permission_user_public_table_payments/up.yaml b/hasura/migrations/1592324618856_update_permission_user_public_table_payments/up.yaml
new file mode 100644
index 000000000..d7f198395
--- /dev/null
+++ b/hasura/migrations/1592324618856_update_permission_user_public_table_payments/up.yaml
@@ -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
diff --git a/hasura/migrations/1592324625348_update_permission_user_public_table_payments/down.yaml b/hasura/migrations/1592324625348_update_permission_user_public_table_payments/down.yaml
new file mode 100644
index 000000000..8bad2eabf
--- /dev/null
+++ b/hasura/migrations/1592324625348_update_permission_user_public_table_payments/down.yaml
@@ -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
diff --git a/hasura/migrations/1592324625348_update_permission_user_public_table_payments/up.yaml b/hasura/migrations/1592324625348_update_permission_user_public_table_payments/up.yaml
new file mode 100644
index 000000000..332aef813
--- /dev/null
+++ b/hasura/migrations/1592324625348_update_permission_user_public_table_payments/up.yaml
@@ -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
diff --git a/hasura/migrations/1592324679227_run_sql_migration/down.yaml b/hasura/migrations/1592324679227_run_sql_migration/down.yaml
new file mode 100644
index 000000000..fe51488c7
--- /dev/null
+++ b/hasura/migrations/1592324679227_run_sql_migration/down.yaml
@@ -0,0 +1 @@
+[]
diff --git a/hasura/migrations/1592324679227_run_sql_migration/up.yaml b/hasura/migrations/1592324679227_run_sql_migration/up.yaml
new file mode 100644
index 000000000..6215879b1
--- /dev/null
+++ b/hasura/migrations/1592324679227_run_sql_migration/up.yaml
@@ -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
diff --git a/hasura/migrations/1592325045380_run_sql_migration/down.yaml b/hasura/migrations/1592325045380_run_sql_migration/down.yaml
new file mode 100644
index 000000000..fe51488c7
--- /dev/null
+++ b/hasura/migrations/1592325045380_run_sql_migration/down.yaml
@@ -0,0 +1 @@
+[]
diff --git a/hasura/migrations/1592325045380_run_sql_migration/up.yaml b/hasura/migrations/1592325045380_run_sql_migration/up.yaml
new file mode 100644
index 000000000..35ecb17d1
--- /dev/null
+++ b/hasura/migrations/1592325045380_run_sql_migration/up.yaml
@@ -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
diff --git a/hasura/migrations/1592325133932_update_permission_user_public_table_payments/down.yaml b/hasura/migrations/1592325133932_update_permission_user_public_table_payments/down.yaml
new file mode 100644
index 000000000..d7f198395
--- /dev/null
+++ b/hasura/migrations/1592325133932_update_permission_user_public_table_payments/down.yaml
@@ -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
diff --git a/hasura/migrations/1592325133932_update_permission_user_public_table_payments/up.yaml b/hasura/migrations/1592325133932_update_permission_user_public_table_payments/up.yaml
new file mode 100644
index 000000000..7485e333c
--- /dev/null
+++ b/hasura/migrations/1592325133932_update_permission_user_public_table_payments/up.yaml
@@ -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
diff --git a/hasura/migrations/1592325262313_run_sql_migration/down.yaml b/hasura/migrations/1592325262313_run_sql_migration/down.yaml
new file mode 100644
index 000000000..fe51488c7
--- /dev/null
+++ b/hasura/migrations/1592325262313_run_sql_migration/down.yaml
@@ -0,0 +1 @@
+[]
diff --git a/hasura/migrations/1592325262313_run_sql_migration/up.yaml b/hasura/migrations/1592325262313_run_sql_migration/up.yaml
new file mode 100644
index 000000000..5d464f7e1
--- /dev/null
+++ b/hasura/migrations/1592325262313_run_sql_migration/up.yaml
@@ -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
diff --git a/hasura/migrations/1592325288329_run_sql_migration/down.yaml b/hasura/migrations/1592325288329_run_sql_migration/down.yaml
new file mode 100644
index 000000000..fe51488c7
--- /dev/null
+++ b/hasura/migrations/1592325288329_run_sql_migration/down.yaml
@@ -0,0 +1 @@
+[]
diff --git a/hasura/migrations/1592325288329_run_sql_migration/up.yaml b/hasura/migrations/1592325288329_run_sql_migration/up.yaml
new file mode 100644
index 000000000..4439c7f6f
--- /dev/null
+++ b/hasura/migrations/1592325288329_run_sql_migration/up.yaml
@@ -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
diff --git a/hasura/migrations/1592325952533_alter_table_public_payments_add_column_exportedat/down.yaml b/hasura/migrations/1592325952533_alter_table_public_payments_add_column_exportedat/down.yaml
new file mode 100644
index 000000000..101187382
--- /dev/null
+++ b/hasura/migrations/1592325952533_alter_table_public_payments_add_column_exportedat/down.yaml
@@ -0,0 +1,5 @@
+- args:
+ cascade: false
+ read_only: false
+ sql: ALTER TABLE "public"."payments" DROP COLUMN "exportedat";
+ type: run_sql
diff --git a/hasura/migrations/1592325952533_alter_table_public_payments_add_column_exportedat/up.yaml b/hasura/migrations/1592325952533_alter_table_public_payments_add_column_exportedat/up.yaml
new file mode 100644
index 000000000..8d48bae0a
--- /dev/null
+++ b/hasura/migrations/1592325952533_alter_table_public_payments_add_column_exportedat/up.yaml
@@ -0,0 +1,5 @@
+- args:
+ cascade: false
+ read_only: false
+ sql: ALTER TABLE "public"."payments" ADD COLUMN "exportedat" timestamptz NULL;
+ type: run_sql
diff --git a/hasura/migrations/1592325964121_update_permission_user_public_table_payments/down.yaml b/hasura/migrations/1592325964121_update_permission_user_public_table_payments/down.yaml
new file mode 100644
index 000000000..248a04f37
--- /dev/null
+++ b/hasura/migrations/1592325964121_update_permission_user_public_table_payments/down.yaml
@@ -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
diff --git a/hasura/migrations/1592325964121_update_permission_user_public_table_payments/up.yaml b/hasura/migrations/1592325964121_update_permission_user_public_table_payments/up.yaml
new file mode 100644
index 000000000..101107d75
--- /dev/null
+++ b/hasura/migrations/1592325964121_update_permission_user_public_table_payments/up.yaml
@@ -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
diff --git a/hasura/migrations/1592325969484_update_permission_user_public_table_payments/down.yaml b/hasura/migrations/1592325969484_update_permission_user_public_table_payments/down.yaml
new file mode 100644
index 000000000..7485e333c
--- /dev/null
+++ b/hasura/migrations/1592325969484_update_permission_user_public_table_payments/down.yaml
@@ -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
diff --git a/hasura/migrations/1592325969484_update_permission_user_public_table_payments/up.yaml b/hasura/migrations/1592325969484_update_permission_user_public_table_payments/up.yaml
new file mode 100644
index 000000000..bc5c01b3a
--- /dev/null
+++ b/hasura/migrations/1592325969484_update_permission_user_public_table_payments/up.yaml
@@ -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
diff --git a/hasura/migrations/1592325975305_update_permission_user_public_table_payments/down.yaml b/hasura/migrations/1592325975305_update_permission_user_public_table_payments/down.yaml
new file mode 100644
index 000000000..332aef813
--- /dev/null
+++ b/hasura/migrations/1592325975305_update_permission_user_public_table_payments/down.yaml
@@ -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
diff --git a/hasura/migrations/1592325975305_update_permission_user_public_table_payments/up.yaml b/hasura/migrations/1592325975305_update_permission_user_public_table_payments/up.yaml
new file mode 100644
index 000000000..ca990d8e4
--- /dev/null
+++ b/hasura/migrations/1592325975305_update_permission_user_public_table_payments/up.yaml
@@ -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
diff --git a/hasura/migrations/metadata.yaml b/hasura/migrations/metadata.yaml
index c33d6373a..576eac1c7 100644
--- a/hasura/migrations/metadata.yaml
+++ b/hasura/migrations/metadata.yaml
@@ -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