diff --git a/README.MD b/README.MD index 560bb2d4b..6e060741a 100644 --- a/README.MD +++ b/README.MD @@ -9,4 +9,4 @@ To Start Hasura CLI: npx hasura console --admin-secret Dev-BodyShopAppBySnaptSoftware! Migrating to Staging: -npx hasura migrate apply --endpoint https://bodyshop-staging-db.herokuapp.com/ --admin-secret Staging-BodyShopAppBySnaptSoftware! \ No newline at end of file +npx hasura migrate apply --up 10 --endpoint https://bodyshop-staging-db.herokuapp.com/ --admin-secret Staging-BodyShopAppBySnaptSoftware! \ No newline at end of file diff --git a/bodyshop_translations.babel b/bodyshop_translations.babel index a8e589448..319a8d546 100644 --- a/bodyshop_translations.babel +++ b/bodyshop_translations.babel @@ -217,6 +217,27 @@ labels + + actions + false + + + + + + en-US + false + + + es-MX + false + + + fr-CA + false + + + in false @@ -441,6 +462,121 @@ + + joblines + + + fields + + + act_price + false + + + + + + en-US + false + + + es-MX + false + + + fr-CA + false + + + + + db_price + false + + + + + + en-US + false + + + es-MX + false + + + fr-CA + false + + + + + line_desc + false + + + + + + en-US + false + + + es-MX + false + + + fr-CA + false + + + + + part_type + false + + + + + + en-US + false + + + es-MX + false + + + fr-CA + false + + + + + unq_seq + false + + + + + + en-US + false + + + es-MX + false + + + fr-CA + false + + + + + + + jobs @@ -557,6 +693,48 @@ errors + + creating + false + + + + + + en-US + false + + + es-MX + false + + + fr-CA + false + + + + + deleted + false + + + + + + en-US + false + + + es-MX + false + + + fr-CA + false + + + noaccess false @@ -814,6 +992,27 @@ + + cieca_id + false + + + + + + en-US + false + + + es-MX + false + + + fr-CA + false + + + claim_total false @@ -2074,6 +2273,48 @@ + + updated_at + false + + + + + + en-US + false + + + es-MX + false + + + fr-CA + false + + + + + uploaded_by + false + + + + + + en-US + false + + + es-MX + false + + + fr-CA + false + + + vehicle false @@ -2100,6 +2341,27 @@ labels + + available_new_jobs + false + + + + + + en-US + false + + + es-MX + false + + + fr-CA + false + + + cards @@ -2357,6 +2619,27 @@ + + creating_new_job + false + + + + + + en-US + false + + + es-MX + false + + + fr-CA + false + + + documents false @@ -2488,6 +2771,27 @@ successes + + all_deleted + false + + + + + + en-US + false + + + es-MX + false + + + fr-CA + false + + + converted false @@ -2509,6 +2813,48 @@ + + created + false + + + + + + en-US + false + + + es-MX + false + + + fr-CA + false + + + + + deleted + false + + + + + + en-US + false + + + es-MX + false + + + fr-CA + false + + + save false @@ -3193,6 +3539,168 @@ + + owners + + + fields + + + ownr_addr1 + false + + + + + + en-US + false + + + es-MX + false + + + fr-CA + false + + + + + ownr_city + false + + + + + + en-US + false + + + es-MX + false + + + fr-CA + false + + + + + ownr_ea + false + + + + + + en-US + false + + + es-MX + false + + + fr-CA + false + + + + + ownr_fn + false + + + + + + en-US + false + + + es-MX + false + + + fr-CA + false + + + + + ownr_ln + false + + + + + + en-US + false + + + es-MX + false + + + fr-CA + false + + + + + ownr_ph1 + false + + + + + + en-US + false + + + es-MX + false + + + fr-CA + false + + + + + + + labels + + + existing_owners + false + + + + + + en-US + false + + + es-MX + false + + + fr-CA + false + + + + + + + profile diff --git a/client/package.json b/client/package.json index 8223defa3..6485f4584 100644 --- a/client/package.json +++ b/client/package.json @@ -54,6 +54,7 @@ ] }, "devDependencies": { + "@apollo/react-testing": "^3.1.3", "enzyme": "^3.11.0", "enzyme-adapter-react-16": "^1.15.2" } diff --git a/client/src/App/App.container.jsx b/client/src/App/App.container.jsx index b9d91afa1..fa2168fce 100644 --- a/client/src/App/App.container.jsx +++ b/client/src/App/App.container.jsx @@ -126,6 +126,8 @@ class AppContainer extends Component { //Init local state. } + componentWillUnmount() {} + render() { const { client, loaded } = this.state; diff --git a/client/src/App/App.test.js b/client/src/App/App.test.js index a754b201b..945ec6f4a 100644 --- a/client/src/App/App.test.js +++ b/client/src/App/App.test.js @@ -1,9 +1,18 @@ -import React from 'react'; -import ReactDOM from 'react-dom'; -import App from './App'; +import React from "react"; +import ReactDOM from "react-dom"; +import App from "./App.container"; +import { MockedProvider } from "@apollo/react-testing"; +const div = document.createElement("div"); -it('renders without crashing', () => { - const div = document.createElement('div'); - ReactDOM.render(, div); +it("renders without crashing", () => { + ReactDOM.render( + + + , + div + ); +}); + +it("unmounts without crashing", () => { ReactDOM.unmountComponentAtNode(div); }); diff --git a/client/src/components/alert/alert.component.test.js b/client/src/components/alert/alert.component.test.js new file mode 100644 index 000000000..4e850158f --- /dev/null +++ b/client/src/components/alert/alert.component.test.js @@ -0,0 +1,11 @@ +import React from "react"; +import ReactDOM from "react-dom"; +import Alert from "./alert.component"; +import { MockedProvider } from "@apollo/react-testing"; +import { shallow } from "enzyme"; + +const div = document.createElement("div"); + +it("renders without crashing", () => { + shallow(); +}); diff --git a/client/src/components/header/header.container.jsx b/client/src/components/header/header.container.jsx index d2081292c..db3d0e9f2 100644 --- a/client/src/components/header/header.container.jsx +++ b/client/src/components/header/header.container.jsx @@ -1,46 +1,45 @@ import React from "react"; import "./header.styles.scss"; import { useQuery } from "react-apollo"; -import { - GET_LANDING_NAV_ITEMS, - GET_NAV_ITEMS -} from "../../graphql/metadata.queries"; +// //import { +// GET_LANDING_NAV_ITEMS, +// GET_NAV_ITEMS +// } from "../../graphql/metadata.queries"; import { GET_CURRENT_SELECTED_NAV_ITEM } from "../../graphql/local.queries"; -import LoadingSpinner from "../loading-spinner/loading-spinner.component"; -import AlertComponent from "../alert/alert.component"; +//import LoadingSpinner from "../loading-spinner/loading-spinner.component"; +//import AlertComponent from "../alert/alert.component"; import HeaderComponent from "./header.component"; export default ({ landingHeader, signedIn }) => { const hookSelectedNavItem = useQuery(GET_CURRENT_SELECTED_NAV_ITEM); - let hookNavItems; - if (landingHeader) { - hookNavItems = useQuery(GET_LANDING_NAV_ITEMS, { - fetchPolicy: "network-only" - }); - } else { - hookNavItems = useQuery(GET_NAV_ITEMS, { - fetchPolicy: "network-only" - }); - } + // let hookNavItems; + // if (landingHeader) { + // hookNavItems = useQuery(GET_LANDING_NAV_ITEMS, { + // fetchPolicy: "network-only" + // }); + // } else { + // hookNavItems = useQuery(GET_NAV_ITEMS, { + // fetchPolicy: "network-only" + // }); + // } - if (hookNavItems.loading || hookSelectedNavItem.loading) - return ; - if (hookNavItems.error) - return ; - if (hookSelectedNavItem.error) - return console.log( - "Unable to load Selected Navigation Item.", - hookSelectedNavItem.error - ); + // if (hookNavItems.loading || hookSelectedNavItem.loading) + // return ; + // if (hookNavItems.error) + // return ; + // if (hookSelectedNavItem.error) + // return console.log( + // "Unable to load Selected Navigation Item.", + // hookSelectedNavItem.error + // ); const { selectedNavItem } = hookSelectedNavItem.data; - const navItems = JSON.parse(hookNavItems.data.masterdata_by_pk.value); + // const navItems = JSON.parse(hookNavItems.data.masterdata_by_pk.value); return ( ); diff --git a/client/src/components/job-detail-cards/job-detail-cards.insurance.component.jsx b/client/src/components/job-detail-cards/job-detail-cards.insurance.component.jsx index 54602f2d8..0e4cf4935 100644 --- a/client/src/components/job-detail-cards/job-detail-cards.insurance.component.jsx +++ b/client/src/components/job-detail-cards/job-detail-cards.insurance.component.jsx @@ -27,7 +27,6 @@ export default function JobDetailCardsInsuranceComponent({ loading, data }) {
- TODO: {t("jobs.labels.cards.appraiser")} {data?.est_ea ? ( diff --git a/client/src/components/job-detail-lines/job-lines-cell.component.jsx b/client/src/components/job-detail-lines/job-lines-cell.component.jsx new file mode 100644 index 000000000..1ea38f1b2 --- /dev/null +++ b/client/src/components/job-detail-lines/job-lines-cell.component.jsx @@ -0,0 +1,52 @@ +import React from "react"; +import { Form, Input, InputNumber } from "antd"; +import JobDetailFormContext from "../../pages/jobs-detail/jobs-detail.page.context"; + +export default class EditableCell extends React.Component { + getInput = () => { + if (this.props.inputType === "number") { + return ; + } + return ; + }; + + renderCell = ({ getFieldDecorator }) => { + const { + editing, + dataIndex, + title, + inputType, + record, + index, + children, + ...restProps + } = this.props; + return ( + + {editing ? ( + + {getFieldDecorator(dataIndex, { + rules: [ + { + required: true, + message: `Please Input ${title}!` + } + ], + initialValue: record[dataIndex] + })(this.getInput())} + + ) : ( + children + )} + + ); + }; + + render() { + return ( + + {this.renderCell} + + ); + } +} diff --git a/client/src/components/job-detail-lines/job-lines.component.jsx b/client/src/components/job-detail-lines/job-lines.component.jsx new file mode 100644 index 000000000..135dc6dea --- /dev/null +++ b/client/src/components/job-detail-lines/job-lines.component.jsx @@ -0,0 +1,124 @@ +import { Table, Button } from "antd"; +import React, { useContext, useState } from "react"; +import { useTranslation } from "react-i18next"; +import JobDetailFormContext from "../../pages/jobs-detail/jobs-detail.page.context"; +import CurrencyFormatter from "../../utils/CurrencyFormatter"; +import { alphaSort } from "../../utils/sorters"; +import EditableCell from "./job-lines-cell.component"; + +export default function JobLinesComponent({ job }) { + //const form = useContext(JobDetailFormContext); + //const { getFieldDecorator } = form; + const [state, setState] = useState({ + sortedInfo: {}, + filteredInfo: { text: "" } + }); + const [editingKey, setEditingKey] = useState(""); + const { t } = useTranslation(); + + const columns = [ + { + title: t("joblines.fields.unq_seq"), + dataIndex: "joblines.unq_seq", + key: "joblines.unq_seq", + // onFilter: (value, record) => record.ro_number.includes(value), + // filteredValue: state.filteredInfo.text || null, + sorter: (a, b) => alphaSort(a, b), + sortOrder: + state.sortedInfo.columnKey === "unq_seq" && state.sortedInfo.order, + //ellipsis: true, + editable: true + }, + { + title: t("joblines.fields.line_desc"), + dataIndex: "line_desc", + key: "joblines.line_desc", + sorter: (a, b) => alphaSort(a.line_desc, b.line_desc), + sortOrder: + state.sortedInfo.columnKey === "line_desc" && state.sortedInfo.order, + ellipsis: true, + editable: true + }, + { + title: t("joblines.fields.part_type"), + dataIndex: "part_type", + key: "joblines.part_type", + sorter: (a, b) => alphaSort(a.part_type, b.part_type), + sortOrder: + state.sortedInfo.columnKey === "part_type" && state.sortedInfo.order, + ellipsis: true, + editable: true + }, + { + title: t("joblines.fields.db_price"), + dataIndex: "db_price", + key: "joblines.db_price", + sorter: (a, b) => a.db_price - b.db_price, + sortOrder: + state.sortedInfo.columnKey === "db_price" && state.sortedInfo.order, + ellipsis: true, + render: (text, record) => ( + {record.db_price} + ) + }, + { + title: t("joblines.fields.act_price"), + dataIndex: "act_price", + key: "joblines.act_price", + sorter: (a, b) => a.act_price - b.act_price, + sortOrder: + state.sortedInfo.columnKey === "act_price" && state.sortedInfo.order, + ellipsis: true, + render: (text, record) => ( +
+ {" "} + {record.act_price}{" "} + +
+ ) + } + ]; + + const handleTableChange = (pagination, filters, sorter) => { + setState({ ...state, filteredInfo: filters, sortedInfo: sorter }); + }; + + // const handleChange = event => { + // const { value } = event.target; + // setState({ ...state, filterinfo: { text: [value] } }); + // }; + return ( + { + if (!col.editable) { + return col; + } + return { + ...col, + onCell: record => ({ + record, + inputType: col.dataIndex === "age" ? "number" : "text", + dataIndex: col.dataIndex, + title: col.title, + editing: editingKey === record.id + }) + }; + })} + components={{ + body: { + cell: EditableCell + } + }} + rowKey='id' + dataSource={job.joblines} + onChange={handleTableChange} + /> + ); +} diff --git a/client/src/components/job-lines/job-lines.container.component.jsx b/client/src/components/job-detail-lines/job-lines.container.jsx similarity index 89% rename from client/src/components/job-lines/job-lines.container.component.jsx rename to client/src/components/job-detail-lines/job-lines.container.jsx index 70e74c7c5..cf59100b2 100644 --- a/client/src/components/job-lines/job-lines.container.component.jsx +++ b/client/src/components/job-detail-lines/job-lines.container.jsx @@ -1,7 +1,7 @@ import React from "react"; import JobLinesComponent from "./job-lines.component"; import { useQuery } from "@apollo/react-hooks"; -import AlertComponent from "../../components/alert/alert.component"; +import AlertComponent from "../alert/alert.component"; import { GET_JOB_LINES_BY_PK } from "../../graphql/jobs-lines.queries"; @@ -16,3 +16,4 @@ export default function JobLinesContainer({ jobId }) { ); } + \ No newline at end of file diff --git a/client/src/components/job-lines/job-lines.component.jsx b/client/src/components/job-lines/job-lines.component.jsx deleted file mode 100644 index 7b1f6cca8..000000000 --- a/client/src/components/job-lines/job-lines.component.jsx +++ /dev/null @@ -1,53 +0,0 @@ -import React, { useState } from "react"; -import { Table } from "antd"; -import { alphaSort } from "../../utils/sorters"; - -export default function JobLinesComponent({ loading, joblines }) { - const [state, setState] = useState({ - sortedInfo: {}, - filteredInfo: { text: "" } - }); - - const columns = [ - { - title: "Line #", - dataIndex: "line_ind", - key: "line_ind", - // onFilter: (value, record) => record.ro_number.includes(value), - // filteredValue: state.filteredInfo.text || null, - sorter: (a, b) => alphaSort(a, b), - sortOrder: - state.sortedInfo.columnKey === "line_ind" && state.sortedInfo.order, - ellipsis: true - }, - { - title: "Description", - dataIndex: "line_desc", - key: "line_desc", - sorter: (a, b) => alphaSort(a, b), - sortOrder: - state.sortedInfo.columnKey === "line_desc" && state.sortedInfo.order, - ellipsis: true - } - ]; - - const handleTableChange = (pagination, filters, sorter) => { - setState({ ...state, filteredInfo: filters, sortedInfo: sorter }); - }; - - // const handleChange = event => { - // const { value } = event.target; - // setState({ ...state, filterinfo: { text: [value] } }); - // }; - - return ( -
({ ...item }))} - rowKey='id' - dataSource={joblines} - onChange={handleTableChange} - /> - ); -} diff --git a/client/src/components/jobs-available-new/jobs-available-new.component.jsx b/client/src/components/jobs-available-new/jobs-available-new.component.jsx new file mode 100644 index 000000000..b7dd1d880 --- /dev/null +++ b/client/src/components/jobs-available-new/jobs-available-new.component.jsx @@ -0,0 +1,212 @@ +import { Button, Icon, Input, notification, Table } from "antd"; +import React, { useState } from "react"; +import { useTranslation } from "react-i18next"; +import { DateTimeFormatter } from "../../utils/DateFormatter"; +import { alphaSort } from "../../utils/sorters"; +import OwnerFindModalContainer from "../owner-find-modal/owner-find-modal.container"; +export default function JobsAvailableComponent({ + loading, + data, + refetch, + deleteJob, + deleteAllNewJobs, + onModalOk, + onModalCancel, + modalVisible, + setModalVisible, + selectedOwner, + setSelectedOwner, + loadEstData, + estData +}) { + const { t } = useTranslation(); + + const [state, setState] = useState({ + sortedInfo: {}, + filteredInfo: { text: "" } + }); + + const handleTableChange = (pagination, filters, sorter) => { + setState({ ...state, filteredInfo: filters, sortedInfo: sorter }); + }; + + const columns = [ + { + title: t("jobs.fields.cieca_id"), + dataIndex: "cieca_id", + key: "cieca_id", + //width: "8%", + // onFilter: (value, record) => record.ro_number.includes(value), + // filteredValue: state.filteredInfo.text || null, + sorter: (a, b) => alphaSort(a, b), + sortOrder: + state.sortedInfo.columnKey === "cieca_id" && state.sortedInfo.order + }, + { + title: t("jobs.fields.owner"), + dataIndex: "ownr_name", + key: "ownr_name", + ellipsis: true, + sorter: (a, b) => alphaSort(a.ownr_ln, b.ownr_ln), + //width: "25%", + sortOrder: + state.sortedInfo.columnKey === "ownr_name" && state.sortedInfo.order + }, + { + title: t("jobs.fields.vehicle"), + dataIndex: "vehicle_info", + key: "vehicle_info", + sorter: (a, b) => alphaSort(a.vehicle_info, b.vehicle_info), + sortOrder: + state.sortedInfo.columnKey === "vehicle_info" && state.sortedInfo.order + //ellipsis: true + }, + { + title: t("jobs.fields.clm_no"), + dataIndex: "clm_no", + key: "clm_no", + sorter: (a, b) => alphaSort(a.clm_no, b.clm_no), + sortOrder: + state.sortedInfo.columnKey === "clm_no" && state.sortedInfo.order + //width: "12%", + //ellipsis: true + }, + { + title: t("jobs.fields.clm_total"), + dataIndex: "clm_amt", + key: "clm_amt", + sorter: (a, b) => a.clm_amt - b.clm_amt, + sortOrder: + state.sortedInfo.columnKey === "clm_amt" && state.sortedInfo.order + //width: "12%", + //ellipsis: true + }, + { + title: t("jobs.fields.uploaded_by"), + dataIndex: "uploaded_by", + key: "uploaded_by", + sorter: (a, b) => alphaSort(a.uploaded_by, b.uploaded_by), + sortOrder: + state.sortedInfo.columnKey === "uploaded_by" && state.sortedInfo.order + //width: "12%", + //ellipsis: true + }, + { + title: t("jobs.fields.updated_at"), + dataIndex: "updated_at", + key: "updated_at", + sorter: (a, b) => new Date(a.updated_at) - new Date(b.updated_at), + sortOrder: + state.sortedInfo.columnKey === "updated_at" && state.sortedInfo.order, + render: (text, record) => ( + {record.updated_at} + ) + //width: "12%", + //ellipsis: true + }, + { + title: t("general.labels.actions"), + key: "actions", + render: (text, record) => ( + + + + + ) + //width: "12%", + //ellipsis: true + } + ]; + + const owner = + estData.data && + estData.data.available_jobs_by_pk && + estData.data.available_jobs_by_pk.est_data && + estData.data.available_jobs_by_pk.est_data.owner && + estData.data.available_jobs_by_pk.est_data.owner.data + ? estData.data.available_jobs_by_pk.est_data.owner.data + : null; + + return ( +
+ + +
{ + return ( +
+ { + console.log(value); + }} + enterButton + /> + + +
+ ); + }} + size="small" + pagination={{ position: "top" }} + columns={columns.map(item => ({ ...item }))} + rowKey="id" + dataSource={data && data.available_jobs} + onChange={handleTableChange} + /> + + ); +} diff --git a/client/src/components/jobs-available-new/jobs-available-new.container.jsx b/client/src/components/jobs-available-new/jobs-available-new.container.jsx new file mode 100644 index 000000000..7c1932d9d --- /dev/null +++ b/client/src/components/jobs-available-new/jobs-available-new.container.jsx @@ -0,0 +1,125 @@ +import { notification } from "antd"; +import React, { useState } from "react"; +import { useMutation, useQuery } from "react-apollo"; +import { useTranslation } from "react-i18next"; +import { withRouter } from "react-router-dom"; +import { DELETE_ALL_AVAILABLE_NEW_JOBS, QUERY_AVAILABLE_NEW_JOBS } from "../../graphql/available-jobs.queries"; +import { INSERT_NEW_JOB } from "../../graphql/jobs.queries"; +import AlertComponent from "../alert/alert.component"; +import LoadingSpinner from "../loading-spinner/loading-spinner.component"; +import JobsAvailableComponent from "./jobs-available-new.component"; + +export default withRouter(function JobsAvailableContainer({ + deleteJob, + estDataLazyLoad, + history +}) { + const { loading, error, data, refetch } = useQuery(QUERY_AVAILABLE_NEW_JOBS, { + fetchPolicy: "network-only" + }); + + const { t } = useTranslation(); + + const [modalVisible, setModalVisible] = useState(false); + const [selectedOwner, setSelectedOwner] = useState(null); + const [insertLoading, setInsertLoading] = useState(false); + const [deleteAllNewJobs] = useMutation(DELETE_ALL_AVAILABLE_NEW_JOBS); + const [insertNewJob] = useMutation(INSERT_NEW_JOB); + const [loadEstData, estData] = estDataLazyLoad; + + const onModalOk = () => { + setModalVisible(false); + console.log("selectedOwner", selectedOwner); + setInsertLoading(true); + console.log( + "logitest", + estData.data && + estData.data.available_jobs_by_pk && + estData.data.available_jobs_by_pk.est_data + ); + + if ( + !( + estData.data && + estData.data.available_jobs_by_pk && + estData.data.available_jobs_by_pk.est_data + ) + ) { + //We don't have the right data. Error! + setInsertLoading(false); + notification["error"]({ + message: t("jobs.errors.creating", { error: "No job data present." }) + }); + } else { + insertNewJob({ + variables: { + job: selectedOwner + ? Object.assign( + {}, + estData.data.available_jobs_by_pk.est_data, + { owner: null }, + { ownerid: selectedOwner } + ) + : estData.data.available_jobs_by_pk.est_data + } + }) + .then(r => { + notification["success"]({ + message: t("jobs.successes.created"), + onClick: () => { + console.log("r", r); + history.push( + `/manage/jobs/${r.data.insert_jobs.returning[0].id}` + ); + } + }); + //Job has been inserted. Clean up the available jobs record. + deleteJob({ + variables: { id: estData.data.available_jobs_by_pk.id } + }).then(r => { + refetch(); + setInsertLoading(false); + }); + }) + .catch(r => { + //error while inserting + notification["error"]({ + message: t("jobs.errors.creating", { error: r.message }) + }); + refetch(); + setInsertLoading(false); + }); + } + }; + + const onModalCancel = () => { + setModalVisible(false); + setSelectedOwner(null); + }; + + if (error) return ; + return ( + + + + ); +}); diff --git a/client/src/components/jobs-available-supplement/jobs-available-supplement.component.jsx b/client/src/components/jobs-available-supplement/jobs-available-supplement.component.jsx new file mode 100644 index 000000000..a6c44f5df --- /dev/null +++ b/client/src/components/jobs-available-supplement/jobs-available-supplement.component.jsx @@ -0,0 +1,193 @@ +import { Input, Table, Button, Icon, notification } from "antd"; +import React, { useState } from "react"; +import { useTranslation } from "react-i18next"; +import { alphaSort } from "../../utils/sorters"; +import { DateTimeFormatter } from "../../utils/DateFormatter"; +export default function JobsAvailableSupplementComponent({ + loading, + data, + refetch, + deleteJob, + deleteAllNewJobs, + estDataLazyLoad +}) { + const { t } = useTranslation(); + + const [state, setState] = useState({ + sortedInfo: {}, + filteredInfo: { text: "" } + }); + + const handleTableChange = (pagination, filters, sorter) => { + setState({ ...state, filteredInfo: filters, sortedInfo: sorter }); + }; + + const columns = [ + { + title: t("jobs.fields.cieca_id"), + dataIndex: "cieca_id", + key: "cieca_id", + //width: "8%", + // onFilter: (value, record) => record.ro_number.includes(value), + // filteredValue: state.filteredInfo.text || null, + sorter: (a, b) => alphaSort(a, b), + sortOrder: + state.sortedInfo.columnKey === "cieca_id" && state.sortedInfo.order + }, + { + title: t("jobs.fields.ro_number"), + dataIndex: "job_id", + key: "job_id", + //width: "8%", + // onFilter: (value, record) => record.ro_number.includes(value), + // filteredValue: state.filteredInfo.text || null, + sorter: (a, b) => alphaSort(a, b), + sortOrder: + state.sortedInfo.columnKey === "cieca_id" && state.sortedInfo.order, + render: (text, record) =>
{record.job && record.job.ro_number}
+ }, + { + title: t("jobs.fields.owner"), + dataIndex: "ownr_name", + key: "ownr_name", + ellipsis: true, + sorter: (a, b) => alphaSort(a.ownr_ln, b.ownr_ln), + //width: "25%", + sortOrder: + state.sortedInfo.columnKey === "ownr_name" && state.sortedInfo.order + }, + { + title: t("jobs.fields.vehicle"), + dataIndex: "vehicle_info", + key: "vehicle_info", + sorter: (a, b) => alphaSort(a.vehicle_info, b.vehicle_info), + sortOrder: + state.sortedInfo.columnKey === "vehicle_info" && state.sortedInfo.order + //ellipsis: true + }, + { + title: t("jobs.fields.clm_no"), + dataIndex: "clm_no", + key: "clm_no", + sorter: (a, b) => alphaSort(a.clm_no, b.clm_no), + sortOrder: + state.sortedInfo.columnKey === "clm_no" && state.sortedInfo.order + //width: "12%", + //ellipsis: true + }, + { + title: t("jobs.fields.clm_total"), + dataIndex: "clm_amt", + key: "clm_amt", + sorter: (a, b) => a.clm_amt - b.clm_amt, + sortOrder: + state.sortedInfo.columnKey === "clm_amt" && state.sortedInfo.order + //width: "12%", + //ellipsis: true + }, + { + title: t("jobs.fields.uploaded_by"), + dataIndex: "uploaded_by", + key: "uploaded_by", + sorter: (a, b) => alphaSort(a.uploaded_by, b.uploaded_by), + sortOrder: + state.sortedInfo.columnKey === "uploaded_by" && state.sortedInfo.order + //width: "12%", + //ellipsis: true + }, + { + title: t("jobs.fields.updated_at"), + dataIndex: "updated_at", + key: "updated_at", + sorter: (a, b) => new Date(a.updated_at) - new Date(b.updated_at), + sortOrder: + state.sortedInfo.columnKey === "updated_at" && state.sortedInfo.order, + render: (text, record) => ( + {record.updated_at} + ) + //width: "12%", + //ellipsis: true + }, + { + title: t("general.labels.actions"), + key: "actions", + render: (text, record) => ( + + + + + ) + //width: "12%", + //ellipsis: true + } + ]; + + return ( +
{ + return ( +
+ { + console.log(value); + }} + enterButton + /> + + +
+ ); + }} + size="small" + pagination={{ position: "top" }} + columns={columns.map(item => ({ ...item }))} + rowKey="id" + dataSource={data && data.available_jobs} + onChange={handleTableChange} + /> + ); +} diff --git a/client/src/components/jobs-available-supplement/jobs-available-supplement.container.jsx b/client/src/components/jobs-available-supplement/jobs-available-supplement.container.jsx new file mode 100644 index 000000000..306ba3a3d --- /dev/null +++ b/client/src/components/jobs-available-supplement/jobs-available-supplement.container.jsx @@ -0,0 +1,30 @@ +import React from "react"; +import { useMutation, useQuery } from "react-apollo"; +import { DELETE_ALL_AVAILABLE_SUPPLEMENT_JOBS, QUERY_AVAILABLE_SUPPLEMENT_JOBS } from "../../graphql/available-jobs.queries"; +import AlertComponent from "../alert/alert.component"; +import JobsAvailableSupplementComponent from "./jobs-available-supplement.component"; + +export default function JobsAvailableSupplementContainer({ + deleteJob, + estDataLazyLoad +}) { + const { loading, error, data, refetch } = useQuery( + QUERY_AVAILABLE_SUPPLEMENT_JOBS, + { + fetchPolicy: "network-only" + } + ); + const [deleteAllNewJobs] = useMutation(DELETE_ALL_AVAILABLE_SUPPLEMENT_JOBS); + + if (error) return ; + return ( + + ); +} diff --git a/client/src/components/jobs-detail-header/jobs-detail-header.component.jsx b/client/src/components/jobs-detail-header/jobs-detail-header.component.jsx index 4d8148ac6..b9da502d5 100644 --- a/client/src/components/jobs-detail-header/jobs-detail-header.component.jsx +++ b/client/src/components/jobs-detail-header/jobs-detail-header.component.jsx @@ -1,4 +1,12 @@ -import { Avatar, Button, Checkbox, Descriptions, notification, PageHeader, Tag } from "antd"; +import { + Avatar, + Button, + Checkbox, + Descriptions, + notification, + PageHeader, + Tag +} from "antd"; import React from "react"; import { useTranslation } from "react-i18next"; import Moment from "react-moment"; @@ -16,7 +24,7 @@ export default function JobsDetailHeader({ const tombstoneTitle = (
- + {`${t("jobs.fields.ro_number")} ${ job.ro_number ? job.ro_number : t("general.labels.na") }`} @@ -25,26 +33,34 @@ export default function JobsDetailHeader({ const tombstoneSubtitle = (
- {job.owner - ? (job.owner.first_name || "") + " " + (job.owner.last_name || "") - : t("jobs.errors.noowner")} + + {job.owner ? ( + + {`${job.ownr_co_nm || ""}${job.ownr_fn || ""} ${job.ownr_ln || ""}`} + + ) : ( + t("jobs.errors.noowner") + )} + - {job.vehicle ? ( - - {job.vehicle.v_model_yr || t("general.labels.na")}{" "} - {job.vehicle.v_make_desc || t("general.labels.na")}{" "} - {job.vehicle.v_model_desc || t("general.labels.na")} |{" "} - {job.vehicle.plate_no || t("general.labels.na")} |{" "} - {job.vehicle.v_vin || t("general.labels.na")} - - ) : null} + + {job.vehicle ? ( + + {job.vehicle.v_model_yr || t("general.labels.na")}{" "} + {job.vehicle.v_make_desc || t("general.labels.na")}{" "} + {job.vehicle.v_model_desc || t("general.labels.na")} |{" "} + {job.vehicle.plate_no || t("general.labels.na")} |{" "} + {job.vehicle.v_vin || t("general.labels.na")} + + ) : null} +
); const menuExtra = [ , - ]; @@ -72,14 +89,15 @@ export default function JobsDetailHeader({ title={tombstoneTitle} subTitle={tombstoneSubtitle} tags={ - + {job.job_status ? ( - {job.job_status.name} + {job.job_status.name} ) : null} } - extra={menuExtra}> - + extra={menuExtra} + > + {job.claim_total} @@ -94,7 +112,7 @@ export default function JobsDetailHeader({ {job.scheduled_completion ? ( - {job.scheduled_completion} + {job.scheduled_completion} ) : null} diff --git a/client/src/components/loading-spinner/loading-spinner.component.jsx b/client/src/components/loading-spinner/loading-spinner.component.jsx index 94c35d8b0..98ab9e422 100644 --- a/client/src/components/loading-spinner/loading-spinner.component.jsx +++ b/client/src/components/loading-spinner/loading-spinner.component.jsx @@ -2,6 +2,16 @@ import React from "react"; import { Spin } from "antd"; import "./loading-spinner.styles.scss"; -export default function LoadingSpinner() { - return ; +export default function LoadingSpinner({ loading = true, message, ...props }) { + return ( + + {props.children} + + ); } diff --git a/client/src/components/owner-find-modal/owner-find-modal.component.jsx b/client/src/components/owner-find-modal/owner-find-modal.component.jsx new file mode 100644 index 000000000..c9631e54b --- /dev/null +++ b/client/src/components/owner-find-modal/owner-find-modal.component.jsx @@ -0,0 +1,125 @@ +import { Checkbox, Divider, Table } from "antd"; +import React from "react"; +import { useTranslation } from "react-i18next"; +import PhoneFormatter from "../../utils/PhoneFormatter"; + +export default function OwnerFindModalComponent({ + selectedOwner, + setSelectedOwner, + ownersListLoading, + ownersList +}) { + //setSelectedOwner is used to set the record id of the owner to use for adding the job. + const { t } = useTranslation(); + + const columns = [ + { + title: t("owners.fields.ownr_ln"), + dataIndex: "ownr_ln", + key: "ownr_ln" + //width: "8%", + // onFilter: (value, record) => record.ro_number.includes(value), + // // filteredValue: state.filteredInfo.text || null, + // sorter: (a, b) => alphaSort(a, b), + // sortOrder: + // state.sortedInfo.columnKey === "cieca_id" && state.sortedInfo.order + }, + { + title: t("owners.fields.ownr_fn"), + dataIndex: "ownr_fn", + key: "ownr_fn" + // ellipsis: true, + // sorter: (a, b) => alphaSort(a.ownr_ln, b.ownr_ln), + // //width: "25%", + // sortOrder: + // state.sortedInfo.columnKey === "ownr_name" && state.sortedInfo.order + }, + { + title: t("owners.fields.ownr_addr1"), + dataIndex: "ownr_addr1", + key: "ownr_addr1" + // sorter: (a, b) => alphaSort(a.vehicle_info, b.vehicle_info), + // sortOrder: + // state.sortedInfo.columnKey === "vehicle_info" && state.sortedInfo.order + //ellipsis: true + }, + { + title: t("owners.fields.ownr_city"), + dataIndex: "ownr_city", + key: "ownr_city" + // sorter: (a, b) => alphaSort(a.clm_no, b.clm_no), + // sortOrder: + // state.sortedInfo.columnKey === "clm_no" && state.sortedInfo.order + //width: "12%", + //ellipsis: true + }, + { + title: t("owners.fields.ownr_ea"), + dataIndex: "ownr_ea", + key: "ownr_ea" + // sorter: (a, b) => a.clm_amt - b.clm_amt, + // sortOrder: + // state.sortedInfo.columnKey === "clm_amt" && state.sortedInfo.order + //width: "12%", + //ellipsis: true + }, + { + title: t("owners.fields.ownr_ph1"), + dataIndex: "ownr_ph1", + key: "ownr_ph1", + render: (text, record) => ( + {record.ownr_ph1} + ) + // sorter: (a, b) => alphaSort(a.uploaded_by, b.uploaded_by), + // sortOrder: + // state.sortedInfo.columnKey === "uploaded_by" && state.sortedInfo.order + //width: "12%", + //ellipsis: true + } + ]; + + const handleOnRowClick = record => { + if (record) { + if (record.id) { + setSelectedOwner(record.id); + return; + } + } + setSelectedOwner(null); + }; + + return ( +
+
t("owners.labels.existing_owners")} + size="small" + pagination={{ position: "bottom" }} + columns={columns.map(item => ({ ...item }))} + rowKey="id" + loading={ownersListLoading} + dataSource={ownersList} + rowSelection={{ + onSelect: props => { + setSelectedOwner(props.id); + }, + type: "radio", + selectedRowKeys: [selectedOwner] + }} + onRow={(record, rowIndex) => { + return { + onClick: event => { + handleOnRowClick(record); + } + }; + }} + /> + + setSelectedOwner(null)} + > + Create a new Owner record for this job. + + + ); +} diff --git a/client/src/components/owner-find-modal/owner-find-modal.container.jsx b/client/src/components/owner-find-modal/owner-find-modal.container.jsx new file mode 100644 index 000000000..bd12e1559 --- /dev/null +++ b/client/src/components/owner-find-modal/owner-find-modal.container.jsx @@ -0,0 +1,53 @@ +import { Modal } from "antd"; +import React from "react"; +import { useQuery } from "react-apollo"; +import { useTranslation } from "react-i18next"; +import { QUERY_SEARCH_OWNER_BY_IDX } from "../../graphql/owners.queries"; +import AlertComponent from "../alert/alert.component"; +import LoadingSpinner from "../loading-spinner/loading-spinner.component"; +import OwnerFindModalComponent from "./owner-find-modal.component"; + +export default function OwnerFindModalContainer({ + loading, + error, + owner, + selectedOwner, + setSelectedOwner, + ...modalProps +}) { + //use owner object to run query and find what possible owners there are. + const { t } = useTranslation(); + + const ownersList = useQuery(QUERY_SEARCH_OWNER_BY_IDX, { + variables: { + search: owner + ? `${owner.ownr_fn} ${owner.ownr_ln} ${owner.ownr_addr1} ${owner.ownr_city} ${owner.ownr_zip} ${owner.ownr_ea} ${owner.ownr_ph1} ${owner.ownr_ph2}` + : null + }, + skip: !owner, + fetchPolicy: "network-only" + }); + + return ( + + {loading ? : null} + {error ? : null} + {owner ? ( + + ) : null} + + ); +} diff --git a/client/src/graphql/apollo-error-handling.js b/client/src/graphql/apollo-error-handling.js index 6b5b74677..c38c13d78 100644 --- a/client/src/graphql/apollo-error-handling.js +++ b/client/src/graphql/apollo-error-handling.js @@ -1,10 +1,10 @@ import { onError } from "apollo-link-error"; -//import { Observable } from "apollo-link"; +import { Observable } from "apollo-link"; import { auth } from "../firebase/firebase.utils"; //https://stackoverflow.com/questions/57163454/refreshing-a-token-with-apollo-client-firebase-auth + 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); @@ -26,59 +26,68 @@ const errorLink = onError( //User access token has expired //props.history.push("/network-error"); console.log("We need a new token!"); - if (access_token && access_token !== "undefined") { - // Let's refresh token through async request + // Let's refresh token through async request - auth.currentUser.getIdToken(true).then(token => { - if (token) { - window.localStorage.setItem("token", token); - operation.setContext(({ headers = {} }) => ({ - headers: { - ...headers, - authorization: token ? `Bearer ${token}` : "" - } - })); - return forward(operation); - } - }); + auth.currentUser.getIdToken(true).then(token => { + if (token) { + console.log("Got the new token.", token); + window.localStorage.setItem("token", token); + operation.setContext(({ headers = {} }) => ({ + headers: { + ...headers, + authorization: token ? `Bearer ${token}` : "" + } + })); - // return new Observable(observer => { - // auth.currentUser - // .getIdToken(true) - // .then(function(idToken) { - // if (!idToken) { - // window.localStorage.removeItem("token"); - // return console.log("Refresh token has expired"); - // } - // console.log("Got a new token", idToken); - // window.localStorage.setItem("token", idToken); + return new Observable(observer => { + const subscriber = { + next: observer.next.bind(observer), + error: observer.error.bind(observer), + complete: observer.complete.bind(observer) + }; + console.log("About to resend the request."); + // Retry last failed request + forward(operation).subscribe(subscriber); + }); + } + }); - // // reset the headers - // operation.setContext(({ headers = {} }) => ({ - // headers: { - // // Re-add old headers - // ...headers, - // // Switch out old access token for new one - // authorization: idToken ? `Bearer ${idToken}` : "" - // } - // })); + // return new Observable(observer => { + // auth.currentUser + // .getIdToken(true) + // .then(function(idToken) { + // if (!idToken) { + // window.localStorage.removeItem("token"); + // return console.log("Refresh token has expired"); + // } + // console.log("Got a new token", idToken); + // window.localStorage.setItem("token", idToken); - // const subscriber = { - // next: observer.next.bind(observer), - // error: observer.error.bind(observer), - // complete: observer.complete.bind(observer) - // }; - // console.log("About to resend the request."); - // // Retry last failed request - // forward(operation).subscribe(subscriber); - // }) - // .catch(error => { - // // No refresh or client token available, we force user to login - // console.log("Hit an error."); - // observer.error(error); - // }); - // }); - } + // // reset the headers + // operation.setContext(({ headers = {} }) => ({ + // headers: { + // // Re-add old headers + // ...headers, + // // Switch out old access token for new one + // authorization: idToken ? `Bearer ${idToken}` : "" + // } + // })); + + // const subscriber = { + // next: observer.next.bind(observer), + // error: observer.error.bind(observer), + // complete: observer.complete.bind(observer) + // }; + // console.log("About to resend the request."); + // // Retry last failed request + // forward(operation).subscribe(subscriber); + // }) + // .catch(error => { + // // No refresh or client token available, we force user to login + // console.log("Hit an error."); + // observer.error(error); + // }); + // }); } } ); diff --git a/client/src/graphql/available-jobs.queries.js b/client/src/graphql/available-jobs.queries.js new file mode 100644 index 000000000..cd23481fd --- /dev/null +++ b/client/src/graphql/available-jobs.queries.js @@ -0,0 +1,81 @@ +import { gql } from "apollo-boost"; + +export const QUERY_AVAILABLE_NEW_JOBS = gql` + query QUERY_AVAILABLE_NEW_JOBS { + available_jobs( + where: { issupplement: { _eq: false } } + order_by: { updated_at: desc } + ) { + cieca_id + clm_amt + clm_no + created_at + id + issupplement + ownr_name + source_system + supplement_number + updated_at + uploaded_by + vehicle_info + } + } +`; + +export const QUERY_AVAILABLE_SUPPLEMENT_JOBS = gql` + query QUERY_AVAILABLE_SUPPLEMENT_JOBS { + available_jobs( + where: { issupplement: { _eq: true } } + order_by: { updated_at: desc } + ) { + cieca_id + clm_amt + clm_no + created_at + id + issupplement + ownr_name + source_system + supplement_number + updated_at + uploaded_by + vehicle_info + job { + ro_number + } + } + } +`; + +export const DELETE_AVAILABLE_JOB = gql` + mutation DELETE_AVAILABLE_JOB($id: uuid) { + delete_available_jobs(where: { id: { _eq: $id } }) { + affected_rows + } + } +`; + +export const DELETE_ALL_AVAILABLE_NEW_JOBS = gql` + mutation DELETE_ALL_AVAILABLE_NEW_JOBS { + delete_available_jobs(where: { issupplement: { _eq: false } }) { + affected_rows + } + } +`; + +export const DELETE_ALL_AVAILABLE_SUPPLEMENT_JOBS = gql` + mutation DELETE_ALL_AVAILABLE_NEW_JOBS { + delete_available_jobs(where: { issupplement: { _eq: true } }) { + affected_rows + } + } +`; + +export const QUERY_AVAILABLE_NEW_JOBS_EST_DATA_BY_PK = gql` + query QUERY_AVAILABLE_NEW_JOBS_EST_DATA_BY_PK($id: uuid!) { + available_jobs_by_pk(id: $id) { + id + est_data + } + } +`; diff --git a/client/src/graphql/jobs.queries.js b/client/src/graphql/jobs.queries.js index 6fe497459..f90290794 100644 --- a/client/src/graphql/jobs.queries.js +++ b/client/src/graphql/jobs.queries.js @@ -152,6 +152,30 @@ export const GET_JOB_BY_PK = gql` towing_payable storage_payable adjustment_bottom_line + ownr_fn + ownr_ln + owner{ + id + ownr_fn + ownr_ln + } + + joblines{ + id + unq_seq + line_ind + line_desc + part_type + oem_partno + db_price + act_price + part_qty + mod_lbr_ty + db_hrs + mod_lb_hrs + lbr_op + lbr_amt + } } } `; @@ -250,3 +274,13 @@ export const CONVERT_JOB_TO_RO = gql` } } `; + +export const INSERT_NEW_JOB = gql` + mutation INSERT_JOB($job: [jobs_insert_input!]!) { + insert_jobs(objects: $job) { + returning { + id + } + } + } +`; diff --git a/client/src/graphql/owners.queries.js b/client/src/graphql/owners.queries.js new file mode 100644 index 000000000..0945e48b0 --- /dev/null +++ b/client/src/graphql/owners.queries.js @@ -0,0 +1,20 @@ +import { gql } from "apollo-boost"; + +export const QUERY_SEARCH_OWNER_BY_IDX = gql` + query QUERY_SEARCH_OWNER_BY_IDX($search: String!) { + search_owners(args: { search: $search }) { + ownr_fn + ownr_ln + ownr_ph1 + ownr_ph2 + ownr_addr1 + ownr_addr2 + ownr_city + ownr_ctry + ownr_ea + ownr_st + ownr_zip + id + } + } +`; diff --git a/client/src/pages/jobs-available/jobs-available.page.component.jsx b/client/src/pages/jobs-available/jobs-available.page.component.jsx index 9dc5b81fe..b239bd1d3 100644 --- a/client/src/pages/jobs-available/jobs-available.page.component.jsx +++ b/client/src/pages/jobs-available/jobs-available.page.component.jsx @@ -1,9 +1,23 @@ -import React from 'react' +import React from "react"; +import JobsAvailableContainer from "../../components/jobs-available-new/jobs-available-new.container"; +import JobsAvailableSupplementContainer from "../../components/jobs-available-supplement/jobs-available-supplement.container"; -export default function JobsAvailablePageComponent() { - return ( -
- JobsAvailablePageComponent -
- ) +export default function JobsAvailablePageComponent({ + deleteJob, + estDataLazyLoad +}) { + return ( +
+ Available New Jobs + + Available Supplements (//TODO: LOGIC HAS NOT YET BEEN COPIED FROM OTHER COMPONENT) + +
+ ); } diff --git a/client/src/pages/jobs-available/jobs-available.page.container.jsx b/client/src/pages/jobs-available/jobs-available.page.container.jsx index 6a146ea6a..9dc54c321 100644 --- a/client/src/pages/jobs-available/jobs-available.page.container.jsx +++ b/client/src/pages/jobs-available/jobs-available.page.container.jsx @@ -1,10 +1,26 @@ -import React from 'react' -import JobsAvailablePageComponent from './jobs-available.page.component' +import React from "react"; +import { useMutation, useLazyQuery } from "react-apollo"; +import { + DELETE_AVAILABLE_JOB, + QUERY_AVAILABLE_NEW_JOBS_EST_DATA_BY_PK +} from "../../graphql/available-jobs.queries"; +import JobsAvailablePageComponent from "./jobs-available.page.component"; export default function JobsAvailablePageContainer() { - return ( -
- -
- ) + const [deleteJob] = useMutation(DELETE_AVAILABLE_JOB); + + const estDataLazyLoad = useLazyQuery( + QUERY_AVAILABLE_NEW_JOBS_EST_DATA_BY_PK, + { + fetchPolicy: "network-only" + } + ); + return ( +
+ +
+ ); } diff --git a/client/src/pages/jobs-detail/jobs-detail.page.component.jsx b/client/src/pages/jobs-detail/jobs-detail.page.component.jsx index 7f7c27aa7..beb249db2 100644 --- a/client/src/pages/jobs-detail/jobs-detail.page.component.jsx +++ b/client/src/pages/jobs-detail/jobs-detail.page.component.jsx @@ -7,7 +7,7 @@ import { FaRegStickyNote, FaShieldAlt } from "react-icons/fa"; -import JobLinesContainer from "../../components/job-lines/job-lines.container.component"; +import JobsLines from '../../components/job-detail-lines/job-lines.component' import JobsDetailClaims from "../../components/jobs-detail-claims/jobs-detail-claims.component"; import JobsDetailFinancials from "../../components/jobs-detail-financial/jobs-detail-financial.component"; import JobsDetailHeader from "../../components/jobs-detail-header/jobs-detail-header.component"; @@ -94,7 +94,7 @@ export default function JobsDetailPage({ } key="repairdata" > - + {props.children || ""}; +} + +export function DateTimeFormatter(props) { + return {props.children || ""}; +} diff --git a/client/yarn.lock b/client/yarn.lock index 87f7832b9..d73e081cd 100644 --- a/client/yarn.lock +++ b/client/yarn.lock @@ -79,6 +79,15 @@ "@apollo/react-hooks" "^3.1.3" tslib "^1.10.0" +"@apollo/react-testing@^3.1.3": + version "3.1.3" + resolved "https://registry.yarnpkg.com/@apollo/react-testing/-/react-testing-3.1.3.tgz#d8dd318f58fb6a404976bfa3f8a79e976a5c6562" + integrity sha512-58R7gROl4TZMHm5kS76Nof9FfZhD703AU3SmJTA2f7naiMqC9Qd8pZ4oNCBafcab0SYN//UtWvLcluK5O7V/9g== + dependencies: + "@apollo/react-common" "^3.1.3" + fast-json-stable-stringify "^2.0.0" + tslib "^1.10.0" + "@babel/code-frame@7.5.5", "@babel/code-frame@^7.0.0", "@babel/code-frame@^7.5.5": version "7.5.5" resolved "https://registry.yarnpkg.com/@babel/code-frame/-/code-frame-7.5.5.tgz#bc0782f6d69f7b7d49531219699b988f669a8f9d" @@ -11051,6 +11060,8 @@ rxjs@^6.4.0, rxjs@^6.5.3: version "6.5.4" resolved "https://registry.yarnpkg.com/rxjs/-/rxjs-6.5.4.tgz#e0777fe0d184cec7872df147f303572d414e211c" integrity sha512-naMQXcgEo3csAEGvw/NydRA0fuS2nDZJiw1YUWFKU7aPPAPGZEsD4Iimit96qwCieH6y614MCLYwdkrWx7z/7Q== + dependencies: + tslib "^1.9.0" safe-buffer@5.1.2, safe-buffer@~5.1.0, safe-buffer@~5.1.1: version "5.1.2" diff --git a/hasura/migrations/1580237327073_create_table_public_available_jobs/down.yaml b/hasura/migrations/1580237327073_create_table_public_available_jobs/down.yaml new file mode 100644 index 000000000..06b5056e9 --- /dev/null +++ b/hasura/migrations/1580237327073_create_table_public_available_jobs/down.yaml @@ -0,0 +1,3 @@ +- args: + sql: DROP TABLE "public"."available_jobs" + type: run_sql diff --git a/hasura/migrations/1580237327073_create_table_public_available_jobs/up.yaml b/hasura/migrations/1580237327073_create_table_public_available_jobs/up.yaml new file mode 100644 index 000000000..d75401021 --- /dev/null +++ b/hasura/migrations/1580237327073_create_table_public_available_jobs/up.yaml @@ -0,0 +1,25 @@ +- args: + sql: CREATE EXTENSION IF NOT EXISTS pgcrypto; + type: run_sql +- args: + sql: "CREATE TABLE \"public\".\"available_jobs\"(\"id\" uuid NOT NULL DEFAULT + gen_random_uuid(), \"created_at\" timestamptz NOT NULL DEFAULT now(), \"updated_at\" + timestamptz NOT NULL DEFAULT now(), \"uploaded_by\" text NOT NULL, \"cieca_id\" + text NOT NULL, \"bodyshopid\" uuid NOT NULL, \"est_data\" jsonb NOT NULL, \"issupplement\" + boolean NOT NULL DEFAULT false, \"jobid\" uuid, \"supplement_number\" integer, + \"ownr_name\" text, \"vehicle_info\" text, \"clm_amt\" numeric, \"clm_no\" text, + \"source_system\" text, PRIMARY KEY (\"id\") , FOREIGN KEY (\"bodyshopid\") + REFERENCES \"public\".\"bodyshops\"(\"id\") ON UPDATE cascade ON DELETE cascade, + FOREIGN KEY (\"jobid\") REFERENCES \"public\".\"jobs\"(\"id\") ON UPDATE restrict + 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_available_jobs_updated_at\"\nBEFORE + UPDATE ON \"public\".\"available_jobs\"\nFOR EACH ROW\nEXECUTE PROCEDURE \"public\".\"set_current_timestamp_updated_at\"();\nCOMMENT + ON TRIGGER \"set_public_available_jobs_updated_at\" ON \"public\".\"available_jobs\" + \nIS 'trigger to set value of column \"updated_at\" to current timestamp on + row update';\n" + type: run_sql +- args: + name: available_jobs + schema: public + type: add_existing_table_or_view diff --git a/hasura/migrations/1580237346108_track_all_relationships/down.yaml b/hasura/migrations/1580237346108_track_all_relationships/down.yaml new file mode 100644 index 000000000..d0e83782e --- /dev/null +++ b/hasura/migrations/1580237346108_track_all_relationships/down.yaml @@ -0,0 +1,24 @@ +- args: + relationship: bodyshop + table: + name: available_jobs + schema: public + type: drop_relationship +- args: + relationship: job + table: + name: available_jobs + schema: public + type: drop_relationship +- args: + relationship: available_jobs + table: + name: bodyshops + schema: public + type: drop_relationship +- args: + relationship: available_jobs + table: + name: jobs + schema: public + type: drop_relationship diff --git a/hasura/migrations/1580237346108_track_all_relationships/up.yaml b/hasura/migrations/1580237346108_track_all_relationships/up.yaml new file mode 100644 index 000000000..5f0bb6804 --- /dev/null +++ b/hasura/migrations/1580237346108_track_all_relationships/up.yaml @@ -0,0 +1,40 @@ +- args: + name: bodyshop + table: + name: available_jobs + schema: public + using: + foreign_key_constraint_on: bodyshopid + type: create_object_relationship +- args: + name: job + table: + name: available_jobs + schema: public + using: + foreign_key_constraint_on: jobid + type: create_object_relationship +- args: + name: available_jobs + table: + name: bodyshops + schema: public + using: + foreign_key_constraint_on: + column: bodyshopid + table: + name: available_jobs + schema: public + type: create_array_relationship +- args: + name: available_jobs + table: + name: jobs + schema: public + using: + foreign_key_constraint_on: + column: jobid + table: + name: available_jobs + schema: public + type: create_array_relationship diff --git a/hasura/migrations/1580237387921_update_permission_user_public_table_available_jobs/down.yaml b/hasura/migrations/1580237387921_update_permission_user_public_table_available_jobs/down.yaml new file mode 100644 index 000000000..5cdb25469 --- /dev/null +++ b/hasura/migrations/1580237387921_update_permission_user_public_table_available_jobs/down.yaml @@ -0,0 +1,6 @@ +- args: + role: user + table: + name: available_jobs + schema: public + type: drop_insert_permission diff --git a/hasura/migrations/1580237387921_update_permission_user_public_table_available_jobs/up.yaml b/hasura/migrations/1580237387921_update_permission_user_public_table_available_jobs/up.yaml new file mode 100644 index 000000000..6d55f1a31 --- /dev/null +++ b/hasura/migrations/1580237387921_update_permission_user_public_table_available_jobs/up.yaml @@ -0,0 +1,37 @@ +- args: + permission: + allow_upsert: true + check: + bodyshop: + associations: + _and: + - user: + authid: + _eq: X-Hasura-User-Id + - active: + _eq: true + columns: + - id + - created_at + - updated_at + - uploaded_by + - cieca_id + - bodyshopid + - est_data + - issupplement + - jobid + - supplement_number + - ownr_name + - vehicle_info + - clm_amt + - clm_no + - source_system + localPresets: + - key: "" + value: "" + set: {} + role: user + table: + name: available_jobs + schema: public + type: create_insert_permission diff --git a/hasura/migrations/1580237392798_update_permission_user_public_table_available_jobs/down.yaml b/hasura/migrations/1580237392798_update_permission_user_public_table_available_jobs/down.yaml new file mode 100644 index 000000000..3a94b077d --- /dev/null +++ b/hasura/migrations/1580237392798_update_permission_user_public_table_available_jobs/down.yaml @@ -0,0 +1,6 @@ +- args: + role: user + table: + name: available_jobs + schema: public + type: drop_select_permission diff --git a/hasura/migrations/1580237392798_update_permission_user_public_table_available_jobs/up.yaml b/hasura/migrations/1580237392798_update_permission_user_public_table_available_jobs/up.yaml new file mode 100644 index 000000000..d3b07cbf7 --- /dev/null +++ b/hasura/migrations/1580237392798_update_permission_user_public_table_available_jobs/up.yaml @@ -0,0 +1,34 @@ +- args: + permission: + allow_aggregations: false + columns: + - issupplement + - supplement_number + - est_data + - clm_amt + - cieca_id + - clm_no + - ownr_name + - source_system + - uploaded_by + - vehicle_info + - created_at + - updated_at + - bodyshopid + - id + - jobid + filter: + bodyshop: + associations: + _and: + - user: + authid: + _eq: X-Hasura-User-Id + - active: + _eq: true + limit: null + role: user + table: + name: available_jobs + schema: public + type: create_select_permission diff --git a/hasura/migrations/1580237398522_update_permission_user_public_table_available_jobs/down.yaml b/hasura/migrations/1580237398522_update_permission_user_public_table_available_jobs/down.yaml new file mode 100644 index 000000000..d0f2b05b4 --- /dev/null +++ b/hasura/migrations/1580237398522_update_permission_user_public_table_available_jobs/down.yaml @@ -0,0 +1,6 @@ +- args: + role: user + table: + name: available_jobs + schema: public + type: drop_update_permission diff --git a/hasura/migrations/1580237398522_update_permission_user_public_table_available_jobs/up.yaml b/hasura/migrations/1580237398522_update_permission_user_public_table_available_jobs/up.yaml new file mode 100644 index 000000000..cf6c14ee3 --- /dev/null +++ b/hasura/migrations/1580237398522_update_permission_user_public_table_available_jobs/up.yaml @@ -0,0 +1,21 @@ +- args: + permission: + columns: [] + filter: + bodyshop: + associations: + _and: + - user: + authid: + _eq: X-Hasura-User-Id + - active: + _eq: true + localPresets: + - key: "" + value: "" + set: {} + role: user + table: + name: available_jobs + schema: public + type: create_update_permission diff --git a/hasura/migrations/1580237406816_update_permission_user_public_table_available_jobs/down.yaml b/hasura/migrations/1580237406816_update_permission_user_public_table_available_jobs/down.yaml new file mode 100644 index 000000000..610466236 --- /dev/null +++ b/hasura/migrations/1580237406816_update_permission_user_public_table_available_jobs/down.yaml @@ -0,0 +1,6 @@ +- args: + role: user + table: + name: available_jobs + schema: public + type: drop_delete_permission diff --git a/hasura/migrations/1580237406816_update_permission_user_public_table_available_jobs/up.yaml b/hasura/migrations/1580237406816_update_permission_user_public_table_available_jobs/up.yaml new file mode 100644 index 000000000..76e638642 --- /dev/null +++ b/hasura/migrations/1580237406816_update_permission_user_public_table_available_jobs/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: available_jobs + schema: public + type: create_delete_permission diff --git a/hasura/migrations/1580319118370_alter_table_public_owners_alter_column_first_name/down.yaml b/hasura/migrations/1580319118370_alter_table_public_owners_alter_column_first_name/down.yaml new file mode 100644 index 000000000..87a64b81f --- /dev/null +++ b/hasura/migrations/1580319118370_alter_table_public_owners_alter_column_first_name/down.yaml @@ -0,0 +1,6 @@ +- args: + sql: COMMENT ON COLUMN "public"."owners"."first_name" IS E'null' + type: run_sql +- args: + sql: alter table "public"."owners" rename column "ownr_fn" to "first_name"; + type: run_sql diff --git a/hasura/migrations/1580319118370_alter_table_public_owners_alter_column_first_name/up.yaml b/hasura/migrations/1580319118370_alter_table_public_owners_alter_column_first_name/up.yaml new file mode 100644 index 000000000..c593c078b --- /dev/null +++ b/hasura/migrations/1580319118370_alter_table_public_owners_alter_column_first_name/up.yaml @@ -0,0 +1,6 @@ +- args: + sql: COMMENT ON COLUMN "public"."owners"."first_name" IS E'' + type: run_sql +- args: + sql: alter table "public"."owners" rename column "first_name" to "ownr_fn"; + type: run_sql diff --git a/hasura/migrations/1580319128633_alter_table_public_owners_alter_column_last_name/down.yaml b/hasura/migrations/1580319128633_alter_table_public_owners_alter_column_last_name/down.yaml new file mode 100644 index 000000000..40b47b5cb --- /dev/null +++ b/hasura/migrations/1580319128633_alter_table_public_owners_alter_column_last_name/down.yaml @@ -0,0 +1,6 @@ +- args: + sql: COMMENT ON COLUMN "public"."owners"."last_name" IS E'null' + type: run_sql +- args: + sql: alter table "public"."owners" rename column "ownr_ln" to "last_name"; + type: run_sql diff --git a/hasura/migrations/1580319128633_alter_table_public_owners_alter_column_last_name/up.yaml b/hasura/migrations/1580319128633_alter_table_public_owners_alter_column_last_name/up.yaml new file mode 100644 index 000000000..c32e1b096 --- /dev/null +++ b/hasura/migrations/1580319128633_alter_table_public_owners_alter_column_last_name/up.yaml @@ -0,0 +1,6 @@ +- args: + sql: COMMENT ON COLUMN "public"."owners"."last_name" IS E'' + type: run_sql +- args: + sql: alter table "public"."owners" rename column "last_name" to "ownr_ln"; + type: run_sql diff --git a/hasura/migrations/1580319140706_alter_table_public_owners_alter_column_address1/down.yaml b/hasura/migrations/1580319140706_alter_table_public_owners_alter_column_address1/down.yaml new file mode 100644 index 000000000..91f18eab1 --- /dev/null +++ b/hasura/migrations/1580319140706_alter_table_public_owners_alter_column_address1/down.yaml @@ -0,0 +1,6 @@ +- args: + sql: COMMENT ON COLUMN "public"."owners"."address1" IS E'null' + type: run_sql +- args: + sql: alter table "public"."owners" rename column "ownr_addr1" to "address1"; + type: run_sql diff --git a/hasura/migrations/1580319140706_alter_table_public_owners_alter_column_address1/up.yaml b/hasura/migrations/1580319140706_alter_table_public_owners_alter_column_address1/up.yaml new file mode 100644 index 000000000..0224619e8 --- /dev/null +++ b/hasura/migrations/1580319140706_alter_table_public_owners_alter_column_address1/up.yaml @@ -0,0 +1,6 @@ +- args: + sql: COMMENT ON COLUMN "public"."owners"."address1" IS E'' + type: run_sql +- args: + sql: alter table "public"."owners" rename column "address1" to "ownr_addr1"; + type: run_sql diff --git a/hasura/migrations/1580319150628_alter_table_public_owners_alter_column_address2/down.yaml b/hasura/migrations/1580319150628_alter_table_public_owners_alter_column_address2/down.yaml new file mode 100644 index 000000000..a25f8b213 --- /dev/null +++ b/hasura/migrations/1580319150628_alter_table_public_owners_alter_column_address2/down.yaml @@ -0,0 +1,6 @@ +- args: + sql: COMMENT ON COLUMN "public"."owners"."address2" IS E'null' + type: run_sql +- args: + sql: alter table "public"."owners" rename column "ownr_addr2" to "address2"; + type: run_sql diff --git a/hasura/migrations/1580319150628_alter_table_public_owners_alter_column_address2/up.yaml b/hasura/migrations/1580319150628_alter_table_public_owners_alter_column_address2/up.yaml new file mode 100644 index 000000000..fc5367abd --- /dev/null +++ b/hasura/migrations/1580319150628_alter_table_public_owners_alter_column_address2/up.yaml @@ -0,0 +1,6 @@ +- args: + sql: COMMENT ON COLUMN "public"."owners"."address2" IS E'' + type: run_sql +- args: + sql: alter table "public"."owners" rename column "address2" to "ownr_addr2"; + type: run_sql diff --git a/hasura/migrations/1580319161723_alter_table_public_owners_alter_column_city/down.yaml b/hasura/migrations/1580319161723_alter_table_public_owners_alter_column_city/down.yaml new file mode 100644 index 000000000..410b346dd --- /dev/null +++ b/hasura/migrations/1580319161723_alter_table_public_owners_alter_column_city/down.yaml @@ -0,0 +1,6 @@ +- args: + sql: COMMENT ON COLUMN "public"."owners"."city" IS E'null' + type: run_sql +- args: + sql: alter table "public"."owners" rename column "ownr_city" to "city"; + type: run_sql diff --git a/hasura/migrations/1580319161723_alter_table_public_owners_alter_column_city/up.yaml b/hasura/migrations/1580319161723_alter_table_public_owners_alter_column_city/up.yaml new file mode 100644 index 000000000..81bf2fdcf --- /dev/null +++ b/hasura/migrations/1580319161723_alter_table_public_owners_alter_column_city/up.yaml @@ -0,0 +1,6 @@ +- args: + sql: COMMENT ON COLUMN "public"."owners"."city" IS E'' + type: run_sql +- args: + sql: alter table "public"."owners" rename column "city" to "ownr_city"; + type: run_sql diff --git a/hasura/migrations/1580319174013_alter_table_public_owners_alter_column_state/down.yaml b/hasura/migrations/1580319174013_alter_table_public_owners_alter_column_state/down.yaml new file mode 100644 index 000000000..5c2d9fe32 --- /dev/null +++ b/hasura/migrations/1580319174013_alter_table_public_owners_alter_column_state/down.yaml @@ -0,0 +1,6 @@ +- args: + sql: COMMENT ON COLUMN "public"."owners"."state" IS E'null' + type: run_sql +- args: + sql: alter table "public"."owners" rename column "ownr_st" to "state"; + type: run_sql diff --git a/hasura/migrations/1580319174013_alter_table_public_owners_alter_column_state/up.yaml b/hasura/migrations/1580319174013_alter_table_public_owners_alter_column_state/up.yaml new file mode 100644 index 000000000..c3499e5e1 --- /dev/null +++ b/hasura/migrations/1580319174013_alter_table_public_owners_alter_column_state/up.yaml @@ -0,0 +1,6 @@ +- args: + sql: COMMENT ON COLUMN "public"."owners"."state" IS E'' + type: run_sql +- args: + sql: alter table "public"."owners" rename column "state" to "ownr_st"; + type: run_sql diff --git a/hasura/migrations/1580319185312_alter_table_public_owners_alter_column_zip/down.yaml b/hasura/migrations/1580319185312_alter_table_public_owners_alter_column_zip/down.yaml new file mode 100644 index 000000000..55aeb38f1 --- /dev/null +++ b/hasura/migrations/1580319185312_alter_table_public_owners_alter_column_zip/down.yaml @@ -0,0 +1,6 @@ +- args: + sql: COMMENT ON COLUMN "public"."owners"."zip" IS E'null' + type: run_sql +- args: + sql: alter table "public"."owners" rename column "ownr_zip" to "zip"; + type: run_sql diff --git a/hasura/migrations/1580319185312_alter_table_public_owners_alter_column_zip/up.yaml b/hasura/migrations/1580319185312_alter_table_public_owners_alter_column_zip/up.yaml new file mode 100644 index 000000000..c2f32b926 --- /dev/null +++ b/hasura/migrations/1580319185312_alter_table_public_owners_alter_column_zip/up.yaml @@ -0,0 +1,6 @@ +- args: + sql: COMMENT ON COLUMN "public"."owners"."zip" IS E'' + type: run_sql +- args: + sql: alter table "public"."owners" rename column "zip" to "ownr_zip"; + type: run_sql diff --git a/hasura/migrations/1580319194956_alter_table_public_owners_alter_column_country/down.yaml b/hasura/migrations/1580319194956_alter_table_public_owners_alter_column_country/down.yaml new file mode 100644 index 000000000..a36da5733 --- /dev/null +++ b/hasura/migrations/1580319194956_alter_table_public_owners_alter_column_country/down.yaml @@ -0,0 +1,6 @@ +- args: + sql: COMMENT ON COLUMN "public"."owners"."country" IS E'null' + type: run_sql +- args: + sql: alter table "public"."owners" rename column "ownr_ctry" to "country"; + type: run_sql diff --git a/hasura/migrations/1580319194956_alter_table_public_owners_alter_column_country/up.yaml b/hasura/migrations/1580319194956_alter_table_public_owners_alter_column_country/up.yaml new file mode 100644 index 000000000..17ba0867f --- /dev/null +++ b/hasura/migrations/1580319194956_alter_table_public_owners_alter_column_country/up.yaml @@ -0,0 +1,6 @@ +- args: + sql: COMMENT ON COLUMN "public"."owners"."country" IS E'' + type: run_sql +- args: + sql: alter table "public"."owners" rename column "country" to "ownr_ctry"; + type: run_sql diff --git a/hasura/migrations/1580319215835_alter_table_public_owners_alter_column_email/down.yaml b/hasura/migrations/1580319215835_alter_table_public_owners_alter_column_email/down.yaml new file mode 100644 index 000000000..dc998c0d2 --- /dev/null +++ b/hasura/migrations/1580319215835_alter_table_public_owners_alter_column_email/down.yaml @@ -0,0 +1,6 @@ +- args: + sql: COMMENT ON COLUMN "public"."owners"."email" IS E'null' + type: run_sql +- args: + sql: alter table "public"."owners" rename column "ownr_ea" to "email"; + type: run_sql diff --git a/hasura/migrations/1580319215835_alter_table_public_owners_alter_column_email/up.yaml b/hasura/migrations/1580319215835_alter_table_public_owners_alter_column_email/up.yaml new file mode 100644 index 000000000..045b0b101 --- /dev/null +++ b/hasura/migrations/1580319215835_alter_table_public_owners_alter_column_email/up.yaml @@ -0,0 +1,6 @@ +- args: + sql: COMMENT ON COLUMN "public"."owners"."email" IS E'' + type: run_sql +- args: + sql: alter table "public"."owners" rename column "email" to "ownr_ea"; + type: run_sql diff --git a/hasura/migrations/1580319231505_alter_table_public_owners_alter_column_phone/down.yaml b/hasura/migrations/1580319231505_alter_table_public_owners_alter_column_phone/down.yaml new file mode 100644 index 000000000..4e4b328cc --- /dev/null +++ b/hasura/migrations/1580319231505_alter_table_public_owners_alter_column_phone/down.yaml @@ -0,0 +1,6 @@ +- args: + sql: COMMENT ON COLUMN "public"."owners"."phone" IS E'null' + type: run_sql +- args: + sql: alter table "public"."owners" rename column "ownr_ph1" to "phone"; + type: run_sql diff --git a/hasura/migrations/1580319231505_alter_table_public_owners_alter_column_phone/up.yaml b/hasura/migrations/1580319231505_alter_table_public_owners_alter_column_phone/up.yaml new file mode 100644 index 000000000..28ad46d6e --- /dev/null +++ b/hasura/migrations/1580319231505_alter_table_public_owners_alter_column_phone/up.yaml @@ -0,0 +1,6 @@ +- args: + sql: COMMENT ON COLUMN "public"."owners"."phone" IS E'' + type: run_sql +- args: + sql: alter table "public"."owners" rename column "phone" to "ownr_ph1"; + type: run_sql diff --git a/hasura/migrations/1580319283586_alter_table_public_owners_add_column_ownr_ph2/down.yaml b/hasura/migrations/1580319283586_alter_table_public_owners_add_column_ownr_ph2/down.yaml new file mode 100644 index 000000000..323204856 --- /dev/null +++ b/hasura/migrations/1580319283586_alter_table_public_owners_add_column_ownr_ph2/down.yaml @@ -0,0 +1,3 @@ +- args: + sql: ALTER TABLE "public"."owners" DROP COLUMN "ownr_ph2"; + type: run_sql diff --git a/hasura/migrations/1580319283586_alter_table_public_owners_add_column_ownr_ph2/up.yaml b/hasura/migrations/1580319283586_alter_table_public_owners_add_column_ownr_ph2/up.yaml new file mode 100644 index 000000000..41e34c325 --- /dev/null +++ b/hasura/migrations/1580319283586_alter_table_public_owners_add_column_ownr_ph2/up.yaml @@ -0,0 +1,3 @@ +- args: + sql: ALTER TABLE "public"."owners" ADD COLUMN "ownr_ph2" text NULL; + type: run_sql diff --git a/hasura/migrations/1580319295873_update_permission_user_public_table_owners/down.yaml b/hasura/migrations/1580319295873_update_permission_user_public_table_owners/down.yaml new file mode 100644 index 000000000..f2f87a705 --- /dev/null +++ b/hasura/migrations/1580319295873_update_permission_user_public_table_owners/down.yaml @@ -0,0 +1,43 @@ +- args: + role: user + table: + name: owners + schema: public + type: drop_insert_permission +- args: + permission: + check: + bodyshop: + associations: + _and: + - user: + authid: + _eq: X-Hasura-User-Id + - active: + _eq: true + columns: + - allow_text_message + - ownr_addr1 + - ownr_addr2 + - ownr_city + - ownr_ctry + - ownr_ea + - ownr_fn + - ownr_ln + - ownr_ph1 + - preferred_contact + - ownr_st + - ownr_zip + - created_at + - updated_at + - id + - shopid + localPresets: + - key: "" + value: "" + set: {} + role: user + table: + name: owners + schema: public + type: create_insert_permission diff --git a/hasura/migrations/1580319295873_update_permission_user_public_table_owners/up.yaml b/hasura/migrations/1580319295873_update_permission_user_public_table_owners/up.yaml new file mode 100644 index 000000000..699ba86d6 --- /dev/null +++ b/hasura/migrations/1580319295873_update_permission_user_public_table_owners/up.yaml @@ -0,0 +1,44 @@ +- args: + role: user + table: + name: owners + schema: public + type: drop_insert_permission +- args: + permission: + check: + bodyshop: + associations: + _and: + - user: + authid: + _eq: X-Hasura-User-Id + - active: + _eq: true + columns: + - id + - created_at + - updated_at + - ownr_fn + - ownr_ln + - ownr_addr1 + - ownr_addr2 + - ownr_city + - ownr_st + - ownr_zip + - ownr_ctry + - ownr_ea + - ownr_ph1 + - preferred_contact + - allow_text_message + - shopid + - ownr_ph2 + localPresets: + - key: "" + value: "" + set: {} + role: user + table: + name: owners + schema: public + type: create_insert_permission diff --git a/hasura/migrations/1580319301454_update_permission_user_public_table_owners/down.yaml b/hasura/migrations/1580319301454_update_permission_user_public_table_owners/down.yaml new file mode 100644 index 000000000..e37bbfa01 --- /dev/null +++ b/hasura/migrations/1580319301454_update_permission_user_public_table_owners/down.yaml @@ -0,0 +1,41 @@ +- args: + role: user + table: + name: owners + schema: public + type: drop_select_permission +- args: + permission: + allow_aggregations: false + columns: + - id + - created_at + - updated_at + - ownr_fn + - ownr_ln + - ownr_addr1 + - ownr_addr2 + - ownr_city + - ownr_st + - ownr_zip + - ownr_ctry + - ownr_ea + - ownr_ph1 + - preferred_contact + - allow_text_message + - shopid + computed_fields: [] + filter: + bodyshop: + associations: + _and: + - user: + authid: + _eq: X-Hasura-User-Id + - active: + _eq: true + role: user + table: + name: owners + schema: public + type: create_select_permission diff --git a/hasura/migrations/1580319301454_update_permission_user_public_table_owners/up.yaml b/hasura/migrations/1580319301454_update_permission_user_public_table_owners/up.yaml new file mode 100644 index 000000000..979378d18 --- /dev/null +++ b/hasura/migrations/1580319301454_update_permission_user_public_table_owners/up.yaml @@ -0,0 +1,42 @@ +- args: + role: user + table: + name: owners + schema: public + type: drop_select_permission +- args: + permission: + allow_aggregations: false + columns: + - allow_text_message + - ownr_addr1 + - ownr_addr2 + - ownr_city + - ownr_ctry + - ownr_ea + - ownr_fn + - ownr_ln + - ownr_ph1 + - ownr_ph2 + - ownr_st + - ownr_zip + - preferred_contact + - created_at + - updated_at + - id + - shopid + computed_fields: [] + filter: + bodyshop: + associations: + _and: + - user: + authid: + _eq: X-Hasura-User-Id + - active: + _eq: true + role: user + table: + name: owners + schema: public + type: create_select_permission diff --git a/hasura/migrations/1580319306963_update_permission_user_public_table_owners/down.yaml b/hasura/migrations/1580319306963_update_permission_user_public_table_owners/down.yaml new file mode 100644 index 000000000..d61f0c925 --- /dev/null +++ b/hasura/migrations/1580319306963_update_permission_user_public_table_owners/down.yaml @@ -0,0 +1,42 @@ +- args: + role: user + table: + name: owners + schema: public + type: drop_update_permission +- args: + permission: + columns: + - ownr_addr1 + - ownr_addr2 + - allow_text_message + - ownr_city + - ownr_ctry + - created_at + - ownr_ea + - ownr_fn + - ownr_ln + - ownr_ph1 + - preferred_contact + - shopid + - ownr_st + - updated_at + - ownr_zip + filter: + bodyshop: + associations: + _and: + - user: + authid: + _eq: X-Hasura-User-Id + - active: + _eq: true + localPresets: + - key: "" + value: "" + set: {} + role: user + table: + name: owners + schema: public + type: create_update_permission diff --git a/hasura/migrations/1580319306963_update_permission_user_public_table_owners/up.yaml b/hasura/migrations/1580319306963_update_permission_user_public_table_owners/up.yaml new file mode 100644 index 000000000..8aa9459b9 --- /dev/null +++ b/hasura/migrations/1580319306963_update_permission_user_public_table_owners/up.yaml @@ -0,0 +1,44 @@ +- args: + role: user + table: + name: owners + schema: public + type: drop_update_permission +- args: + permission: + columns: + - allow_text_message + - ownr_addr1 + - ownr_addr2 + - ownr_city + - ownr_ctry + - ownr_ea + - ownr_fn + - ownr_ln + - ownr_ph1 + - ownr_ph2 + - ownr_st + - ownr_zip + - preferred_contact + - created_at + - updated_at + - id + - shopid + filter: + bodyshop: + associations: + _and: + - user: + authid: + _eq: X-Hasura-User-Id + - active: + _eq: true + localPresets: + - key: "" + value: "" + set: {} + role: user + table: + name: owners + schema: public + type: create_update_permission diff --git a/hasura/migrations/1580321100336_owner_gin_idx/down.yaml b/hasura/migrations/1580321100336_owner_gin_idx/down.yaml new file mode 100644 index 000000000..fe51488c7 --- /dev/null +++ b/hasura/migrations/1580321100336_owner_gin_idx/down.yaml @@ -0,0 +1 @@ +[] diff --git a/hasura/migrations/1580321100336_owner_gin_idx/up.yaml b/hasura/migrations/1580321100336_owner_gin_idx/up.yaml new file mode 100644 index 000000000..63a8fc27c --- /dev/null +++ b/hasura/migrations/1580321100336_owner_gin_idx/up.yaml @@ -0,0 +1,6 @@ +- args: + cascade: true + sql: "\r\nCREATE INDEX owner_gin_idx ON owners\r\nUSING GIN ((ownr_fn || ' ' + || ownr_ln || ' ' || ownr_addr1 || ' ' || ownr_city || ' ' || ownr_zip || + ' ' || ownr_ea || ' ' || ownr_ph1 || ' ' || ownr_ph2 ) gin_trgm_ops);\r\n" + type: run_sql diff --git a/hasura/migrations/1580321202242_owner_search_function/down.yaml b/hasura/migrations/1580321202242_owner_search_function/down.yaml new file mode 100644 index 000000000..fe51488c7 --- /dev/null +++ b/hasura/migrations/1580321202242_owner_search_function/down.yaml @@ -0,0 +1 @@ +[] diff --git a/hasura/migrations/1580321202242_owner_search_function/up.yaml b/hasura/migrations/1580321202242_owner_search_function/up.yaml new file mode 100644 index 000000000..a3b38952d --- /dev/null +++ b/hasura/migrations/1580321202242_owner_search_function/up.yaml @@ -0,0 +1,14 @@ +- args: + cascade: true + sql: "CREATE FUNCTION search_owners(search text)\r\nRETURNS SETOF owners AS $$\r\n + \ SELECT *\r\n FROM owners\r\n WHERE\r\n search <% (ownr_fn || + ' ' || ownr_ln || ' ' || ownr_addr1 || ' ' || ownr_city || ' ' || ownr_zip + \ || ' ' || ownr_ea || ' ' || ownr_ph1 || ' ' || ownr_ph2)\r\n ORDER BY\r\n + \ similarity(search, (ownr_fn || ' ' || ownr_ln || ' ' || ownr_addr1 || + ' ' || ownr_city || ' ' || ownr_zip || ' ' || ownr_ea || ' ' || ownr_ph1 || + ' ' || ownr_ph2)) DESC\r\n LIMIT 20;\r\n$$ LANGUAGE sql STABLE;" + type: run_sql +- args: + name: search_owners + schema: public + type: track_function diff --git a/hasura/migrations/1580322212941_alter_table_public_owners_add_column_ownr_co_nm/down.yaml b/hasura/migrations/1580322212941_alter_table_public_owners_add_column_ownr_co_nm/down.yaml new file mode 100644 index 000000000..eaea08f41 --- /dev/null +++ b/hasura/migrations/1580322212941_alter_table_public_owners_add_column_ownr_co_nm/down.yaml @@ -0,0 +1,3 @@ +- args: + sql: ALTER TABLE "public"."owners" DROP COLUMN "ownr_co_nm"; + type: run_sql diff --git a/hasura/migrations/1580322212941_alter_table_public_owners_add_column_ownr_co_nm/up.yaml b/hasura/migrations/1580322212941_alter_table_public_owners_add_column_ownr_co_nm/up.yaml new file mode 100644 index 000000000..fea96b1a3 --- /dev/null +++ b/hasura/migrations/1580322212941_alter_table_public_owners_add_column_ownr_co_nm/up.yaml @@ -0,0 +1,3 @@ +- args: + sql: ALTER TABLE "public"."owners" ADD COLUMN "ownr_co_nm" text NULL; + type: run_sql diff --git a/hasura/migrations/1580322221407_update_permission_user_public_table_owners/down.yaml b/hasura/migrations/1580322221407_update_permission_user_public_table_owners/down.yaml new file mode 100644 index 000000000..699ba86d6 --- /dev/null +++ b/hasura/migrations/1580322221407_update_permission_user_public_table_owners/down.yaml @@ -0,0 +1,44 @@ +- args: + role: user + table: + name: owners + schema: public + type: drop_insert_permission +- args: + permission: + check: + bodyshop: + associations: + _and: + - user: + authid: + _eq: X-Hasura-User-Id + - active: + _eq: true + columns: + - id + - created_at + - updated_at + - ownr_fn + - ownr_ln + - ownr_addr1 + - ownr_addr2 + - ownr_city + - ownr_st + - ownr_zip + - ownr_ctry + - ownr_ea + - ownr_ph1 + - preferred_contact + - allow_text_message + - shopid + - ownr_ph2 + localPresets: + - key: "" + value: "" + set: {} + role: user + table: + name: owners + schema: public + type: create_insert_permission diff --git a/hasura/migrations/1580322221407_update_permission_user_public_table_owners/up.yaml b/hasura/migrations/1580322221407_update_permission_user_public_table_owners/up.yaml new file mode 100644 index 000000000..55880362e --- /dev/null +++ b/hasura/migrations/1580322221407_update_permission_user_public_table_owners/up.yaml @@ -0,0 +1,45 @@ +- args: + role: user + table: + name: owners + schema: public + type: drop_insert_permission +- args: + permission: + check: + bodyshop: + associations: + _and: + - user: + authid: + _eq: X-Hasura-User-Id + - active: + _eq: true + columns: + - id + - created_at + - updated_at + - ownr_fn + - ownr_ln + - ownr_addr1 + - ownr_addr2 + - ownr_city + - ownr_st + - ownr_zip + - ownr_ctry + - ownr_ea + - ownr_ph1 + - preferred_contact + - allow_text_message + - shopid + - ownr_ph2 + - ownr_co_nm + localPresets: + - key: "" + value: "" + set: {} + role: user + table: + name: owners + schema: public + type: create_insert_permission diff --git a/hasura/migrations/1580322225907_update_permission_user_public_table_owners/down.yaml b/hasura/migrations/1580322225907_update_permission_user_public_table_owners/down.yaml new file mode 100644 index 000000000..979378d18 --- /dev/null +++ b/hasura/migrations/1580322225907_update_permission_user_public_table_owners/down.yaml @@ -0,0 +1,42 @@ +- args: + role: user + table: + name: owners + schema: public + type: drop_select_permission +- args: + permission: + allow_aggregations: false + columns: + - allow_text_message + - ownr_addr1 + - ownr_addr2 + - ownr_city + - ownr_ctry + - ownr_ea + - ownr_fn + - ownr_ln + - ownr_ph1 + - ownr_ph2 + - ownr_st + - ownr_zip + - preferred_contact + - created_at + - updated_at + - id + - shopid + computed_fields: [] + filter: + bodyshop: + associations: + _and: + - user: + authid: + _eq: X-Hasura-User-Id + - active: + _eq: true + role: user + table: + name: owners + schema: public + type: create_select_permission diff --git a/hasura/migrations/1580322225907_update_permission_user_public_table_owners/up.yaml b/hasura/migrations/1580322225907_update_permission_user_public_table_owners/up.yaml new file mode 100644 index 000000000..1802dbbf4 --- /dev/null +++ b/hasura/migrations/1580322225907_update_permission_user_public_table_owners/up.yaml @@ -0,0 +1,43 @@ +- args: + role: user + table: + name: owners + schema: public + type: drop_select_permission +- args: + permission: + allow_aggregations: false + columns: + - allow_text_message + - ownr_addr1 + - ownr_addr2 + - ownr_city + - ownr_co_nm + - ownr_ctry + - ownr_ea + - ownr_fn + - ownr_ln + - ownr_ph1 + - ownr_ph2 + - ownr_st + - ownr_zip + - preferred_contact + - created_at + - updated_at + - id + - shopid + computed_fields: [] + filter: + bodyshop: + associations: + _and: + - user: + authid: + _eq: X-Hasura-User-Id + - active: + _eq: true + role: user + table: + name: owners + schema: public + type: create_select_permission diff --git a/hasura/migrations/1580322230561_update_permission_user_public_table_owners/down.yaml b/hasura/migrations/1580322230561_update_permission_user_public_table_owners/down.yaml new file mode 100644 index 000000000..8aa9459b9 --- /dev/null +++ b/hasura/migrations/1580322230561_update_permission_user_public_table_owners/down.yaml @@ -0,0 +1,44 @@ +- args: + role: user + table: + name: owners + schema: public + type: drop_update_permission +- args: + permission: + columns: + - allow_text_message + - ownr_addr1 + - ownr_addr2 + - ownr_city + - ownr_ctry + - ownr_ea + - ownr_fn + - ownr_ln + - ownr_ph1 + - ownr_ph2 + - ownr_st + - ownr_zip + - preferred_contact + - created_at + - updated_at + - id + - shopid + filter: + bodyshop: + associations: + _and: + - user: + authid: + _eq: X-Hasura-User-Id + - active: + _eq: true + localPresets: + - key: "" + value: "" + set: {} + role: user + table: + name: owners + schema: public + type: create_update_permission diff --git a/hasura/migrations/1580322230561_update_permission_user_public_table_owners/up.yaml b/hasura/migrations/1580322230561_update_permission_user_public_table_owners/up.yaml new file mode 100644 index 000000000..26c35bd8f --- /dev/null +++ b/hasura/migrations/1580322230561_update_permission_user_public_table_owners/up.yaml @@ -0,0 +1,45 @@ +- args: + role: user + table: + name: owners + schema: public + type: drop_update_permission +- args: + permission: + columns: + - allow_text_message + - ownr_addr1 + - ownr_addr2 + - ownr_city + - ownr_co_nm + - ownr_ctry + - ownr_ea + - ownr_fn + - ownr_ln + - ownr_ph1 + - ownr_ph2 + - ownr_st + - ownr_zip + - preferred_contact + - created_at + - updated_at + - id + - shopid + filter: + bodyshop: + associations: + _and: + - user: + authid: + _eq: X-Hasura-User-Id + - active: + _eq: true + localPresets: + - key: "" + value: "" + set: {} + role: user + table: + name: owners + schema: public + type: create_update_permission diff --git a/hasura/migrations/1580332913585_alter_table_public_owners_add_column_ownr_title/down.yaml b/hasura/migrations/1580332913585_alter_table_public_owners_add_column_ownr_title/down.yaml new file mode 100644 index 000000000..ca71eb499 --- /dev/null +++ b/hasura/migrations/1580332913585_alter_table_public_owners_add_column_ownr_title/down.yaml @@ -0,0 +1,3 @@ +- args: + sql: ALTER TABLE "public"."owners" DROP COLUMN "ownr_title"; + type: run_sql diff --git a/hasura/migrations/1580332913585_alter_table_public_owners_add_column_ownr_title/up.yaml b/hasura/migrations/1580332913585_alter_table_public_owners_add_column_ownr_title/up.yaml new file mode 100644 index 000000000..be8c2ce7b --- /dev/null +++ b/hasura/migrations/1580332913585_alter_table_public_owners_add_column_ownr_title/up.yaml @@ -0,0 +1,3 @@ +- args: + sql: ALTER TABLE "public"."owners" ADD COLUMN "ownr_title" text NULL; + type: run_sql diff --git a/hasura/migrations/1580332923811_update_permission_user_public_table_owners/down.yaml b/hasura/migrations/1580332923811_update_permission_user_public_table_owners/down.yaml new file mode 100644 index 000000000..55880362e --- /dev/null +++ b/hasura/migrations/1580332923811_update_permission_user_public_table_owners/down.yaml @@ -0,0 +1,45 @@ +- args: + role: user + table: + name: owners + schema: public + type: drop_insert_permission +- args: + permission: + check: + bodyshop: + associations: + _and: + - user: + authid: + _eq: X-Hasura-User-Id + - active: + _eq: true + columns: + - id + - created_at + - updated_at + - ownr_fn + - ownr_ln + - ownr_addr1 + - ownr_addr2 + - ownr_city + - ownr_st + - ownr_zip + - ownr_ctry + - ownr_ea + - ownr_ph1 + - preferred_contact + - allow_text_message + - shopid + - ownr_ph2 + - ownr_co_nm + localPresets: + - key: "" + value: "" + set: {} + role: user + table: + name: owners + schema: public + type: create_insert_permission diff --git a/hasura/migrations/1580332923811_update_permission_user_public_table_owners/up.yaml b/hasura/migrations/1580332923811_update_permission_user_public_table_owners/up.yaml new file mode 100644 index 000000000..21addc58a --- /dev/null +++ b/hasura/migrations/1580332923811_update_permission_user_public_table_owners/up.yaml @@ -0,0 +1,46 @@ +- args: + role: user + table: + name: owners + schema: public + type: drop_insert_permission +- args: + permission: + check: + bodyshop: + associations: + _and: + - user: + authid: + _eq: X-Hasura-User-Id + - active: + _eq: true + columns: + - id + - created_at + - updated_at + - ownr_fn + - ownr_ln + - ownr_addr1 + - ownr_addr2 + - ownr_city + - ownr_st + - ownr_zip + - ownr_ctry + - ownr_ea + - ownr_ph1 + - preferred_contact + - allow_text_message + - shopid + - ownr_ph2 + - ownr_co_nm + - ownr_title + localPresets: + - key: "" + value: "" + set: {} + role: user + table: + name: owners + schema: public + type: create_insert_permission diff --git a/hasura/migrations/1580332931020_update_permission_user_public_table_owners/down.yaml b/hasura/migrations/1580332931020_update_permission_user_public_table_owners/down.yaml new file mode 100644 index 000000000..1802dbbf4 --- /dev/null +++ b/hasura/migrations/1580332931020_update_permission_user_public_table_owners/down.yaml @@ -0,0 +1,43 @@ +- args: + role: user + table: + name: owners + schema: public + type: drop_select_permission +- args: + permission: + allow_aggregations: false + columns: + - allow_text_message + - ownr_addr1 + - ownr_addr2 + - ownr_city + - ownr_co_nm + - ownr_ctry + - ownr_ea + - ownr_fn + - ownr_ln + - ownr_ph1 + - ownr_ph2 + - ownr_st + - ownr_zip + - preferred_contact + - created_at + - updated_at + - id + - shopid + computed_fields: [] + filter: + bodyshop: + associations: + _and: + - user: + authid: + _eq: X-Hasura-User-Id + - active: + _eq: true + role: user + table: + name: owners + schema: public + type: create_select_permission diff --git a/hasura/migrations/1580332931020_update_permission_user_public_table_owners/up.yaml b/hasura/migrations/1580332931020_update_permission_user_public_table_owners/up.yaml new file mode 100644 index 000000000..85ab7c994 --- /dev/null +++ b/hasura/migrations/1580332931020_update_permission_user_public_table_owners/up.yaml @@ -0,0 +1,44 @@ +- args: + role: user + table: + name: owners + schema: public + type: drop_select_permission +- args: + permission: + allow_aggregations: false + columns: + - allow_text_message + - ownr_addr1 + - ownr_addr2 + - ownr_city + - ownr_co_nm + - ownr_ctry + - ownr_ea + - ownr_fn + - ownr_ln + - ownr_ph1 + - ownr_ph2 + - ownr_st + - ownr_title + - ownr_zip + - preferred_contact + - created_at + - updated_at + - id + - shopid + computed_fields: [] + filter: + bodyshop: + associations: + _and: + - user: + authid: + _eq: X-Hasura-User-Id + - active: + _eq: true + role: user + table: + name: owners + schema: public + type: create_select_permission diff --git a/hasura/migrations/1580332936658_update_permission_user_public_table_owners/down.yaml b/hasura/migrations/1580332936658_update_permission_user_public_table_owners/down.yaml new file mode 100644 index 000000000..26c35bd8f --- /dev/null +++ b/hasura/migrations/1580332936658_update_permission_user_public_table_owners/down.yaml @@ -0,0 +1,45 @@ +- args: + role: user + table: + name: owners + schema: public + type: drop_update_permission +- args: + permission: + columns: + - allow_text_message + - ownr_addr1 + - ownr_addr2 + - ownr_city + - ownr_co_nm + - ownr_ctry + - ownr_ea + - ownr_fn + - ownr_ln + - ownr_ph1 + - ownr_ph2 + - ownr_st + - ownr_zip + - preferred_contact + - created_at + - updated_at + - id + - shopid + filter: + bodyshop: + associations: + _and: + - user: + authid: + _eq: X-Hasura-User-Id + - active: + _eq: true + localPresets: + - key: "" + value: "" + set: {} + role: user + table: + name: owners + schema: public + type: create_update_permission diff --git a/hasura/migrations/1580332936658_update_permission_user_public_table_owners/up.yaml b/hasura/migrations/1580332936658_update_permission_user_public_table_owners/up.yaml new file mode 100644 index 000000000..9609517ec --- /dev/null +++ b/hasura/migrations/1580332936658_update_permission_user_public_table_owners/up.yaml @@ -0,0 +1,46 @@ +- args: + role: user + table: + name: owners + schema: public + type: drop_update_permission +- args: + permission: + columns: + - allow_text_message + - ownr_addr1 + - ownr_addr2 + - ownr_city + - ownr_co_nm + - ownr_ctry + - ownr_ea + - ownr_fn + - ownr_ln + - ownr_ph1 + - ownr_ph2 + - ownr_st + - ownr_title + - ownr_zip + - preferred_contact + - created_at + - updated_at + - id + - shopid + filter: + bodyshop: + associations: + _and: + - user: + authid: + _eq: X-Hasura-User-Id + - active: + _eq: true + localPresets: + - key: "" + value: "" + set: {} + role: user + table: + name: owners + schema: public + type: create_update_permission diff --git a/hasura/migrations/1580338993317_run_sql_migration/down.yaml b/hasura/migrations/1580338993317_run_sql_migration/down.yaml new file mode 100644 index 000000000..fe51488c7 --- /dev/null +++ b/hasura/migrations/1580338993317_run_sql_migration/down.yaml @@ -0,0 +1 @@ +[] diff --git a/hasura/migrations/1580338993317_run_sql_migration/up.yaml b/hasura/migrations/1580338993317_run_sql_migration/up.yaml new file mode 100644 index 000000000..50d9e6d4d --- /dev/null +++ b/hasura/migrations/1580338993317_run_sql_migration/up.yaml @@ -0,0 +1,6 @@ +- args: + cascade: true + sql: "ALTER TABLE jobs ALTER COLUMN theft_ind DROP DEFAULT;\r\nALTER TABLE jobs + ALTER theft_ind TYPE bool USING CASE WHEN true THEN FALSE ELSE TRUE END;\r\nALTER + TABLE jobs ALTER COLUMN theft_ind SET DEFAULT FALSE;" + type: run_sql diff --git a/hasura/migrations/1580339054130_run_sql_migration/down.yaml b/hasura/migrations/1580339054130_run_sql_migration/down.yaml new file mode 100644 index 000000000..fe51488c7 --- /dev/null +++ b/hasura/migrations/1580339054130_run_sql_migration/down.yaml @@ -0,0 +1 @@ +[] diff --git a/hasura/migrations/1580339054130_run_sql_migration/up.yaml b/hasura/migrations/1580339054130_run_sql_migration/up.yaml new file mode 100644 index 000000000..377757ec8 --- /dev/null +++ b/hasura/migrations/1580339054130_run_sql_migration/up.yaml @@ -0,0 +1,6 @@ +- args: + cascade: true + sql: "ALTER TABLE jobs ALTER COLUMN tlos_ind DROP DEFAULT;\r\nALTER TABLE jobs + ALTER tlos_ind TYPE bool USING CASE WHEN true THEN FALSE ELSE TRUE END;\r\nALTER + TABLE jobs ALTER COLUMN tlos_ind SET DEFAULT FALSE;" + type: run_sql diff --git a/hasura/migrations/1580342466510_alter_table_public_jobs_add_column_parts_tax_rate/down.yaml b/hasura/migrations/1580342466510_alter_table_public_jobs_add_column_parts_tax_rate/down.yaml new file mode 100644 index 000000000..d5601bc2c --- /dev/null +++ b/hasura/migrations/1580342466510_alter_table_public_jobs_add_column_parts_tax_rate/down.yaml @@ -0,0 +1,3 @@ +- args: + sql: ALTER TABLE "public"."jobs" DROP COLUMN "parts_tax_rate"; + type: run_sql diff --git a/hasura/migrations/1580342466510_alter_table_public_jobs_add_column_parts_tax_rate/up.yaml b/hasura/migrations/1580342466510_alter_table_public_jobs_add_column_parts_tax_rate/up.yaml new file mode 100644 index 000000000..24910de15 --- /dev/null +++ b/hasura/migrations/1580342466510_alter_table_public_jobs_add_column_parts_tax_rate/up.yaml @@ -0,0 +1,3 @@ +- args: + sql: ALTER TABLE "public"."jobs" ADD COLUMN "parts_tax_rate" numeric NULL; + type: run_sql diff --git a/hasura/migrations/1580342506429_alter_table_public_jobs_alter_column_parts_tax_rate/down.yaml b/hasura/migrations/1580342506429_alter_table_public_jobs_alter_column_parts_tax_rate/down.yaml new file mode 100644 index 000000000..48652bba7 --- /dev/null +++ b/hasura/migrations/1580342506429_alter_table_public_jobs_alter_column_parts_tax_rate/down.yaml @@ -0,0 +1,6 @@ +- args: + sql: COMMENT ON COLUMN "public"."jobs"."parts_tax_rate" IS E'null' + type: run_sql +- args: + sql: alter table "public"."jobs" rename column "tax_pstthr" to "parts_tax_rate"; + type: run_sql diff --git a/hasura/migrations/1580342506429_alter_table_public_jobs_alter_column_parts_tax_rate/up.yaml b/hasura/migrations/1580342506429_alter_table_public_jobs_alter_column_parts_tax_rate/up.yaml new file mode 100644 index 000000000..3a0211519 --- /dev/null +++ b/hasura/migrations/1580342506429_alter_table_public_jobs_alter_column_parts_tax_rate/up.yaml @@ -0,0 +1,6 @@ +- args: + sql: COMMENT ON COLUMN "public"."jobs"."parts_tax_rate" IS E'' + type: run_sql +- args: + sql: alter table "public"."jobs" rename column "parts_tax_rate" to "tax_pstthr"; + type: run_sql diff --git a/hasura/migrations/1580342523444_alter_table_public_jobs_alter_column_tax_pstthr/down.yaml b/hasura/migrations/1580342523444_alter_table_public_jobs_alter_column_tax_pstthr/down.yaml new file mode 100644 index 000000000..c27db234f --- /dev/null +++ b/hasura/migrations/1580342523444_alter_table_public_jobs_alter_column_tax_pstthr/down.yaml @@ -0,0 +1,3 @@ +- args: + sql: COMMENT ON COLUMN "public"."jobs"."tax_pstthr" IS E'null' + type: run_sql diff --git a/hasura/migrations/1580342523444_alter_table_public_jobs_alter_column_tax_pstthr/up.yaml b/hasura/migrations/1580342523444_alter_table_public_jobs_alter_column_tax_pstthr/up.yaml new file mode 100644 index 000000000..94dea43fb --- /dev/null +++ b/hasura/migrations/1580342523444_alter_table_public_jobs_alter_column_tax_pstthr/up.yaml @@ -0,0 +1,3 @@ +- args: + sql: COMMENT ON COLUMN "public"."jobs"."tax_pstthr" IS E'PST for Parts' + type: run_sql diff --git a/hasura/migrations/1580342644474_alter_table_public_jobs_add_column_tax_tow_rt/down.yaml b/hasura/migrations/1580342644474_alter_table_public_jobs_add_column_tax_tow_rt/down.yaml new file mode 100644 index 000000000..1fcc511d5 --- /dev/null +++ b/hasura/migrations/1580342644474_alter_table_public_jobs_add_column_tax_tow_rt/down.yaml @@ -0,0 +1,3 @@ +- args: + sql: ALTER TABLE "public"."jobs" DROP COLUMN "tax_tow_rt"; + type: run_sql diff --git a/hasura/migrations/1580342644474_alter_table_public_jobs_add_column_tax_tow_rt/up.yaml b/hasura/migrations/1580342644474_alter_table_public_jobs_add_column_tax_tow_rt/up.yaml new file mode 100644 index 000000000..865d7bbfb --- /dev/null +++ b/hasura/migrations/1580342644474_alter_table_public_jobs_add_column_tax_tow_rt/up.yaml @@ -0,0 +1,3 @@ +- args: + sql: ALTER TABLE "public"."jobs" ADD COLUMN "tax_tow_rt" numeric NULL; + type: run_sql diff --git a/hasura/migrations/1580342652067_alter_table_public_jobs_alter_column_tax_tow_rt/down.yaml b/hasura/migrations/1580342652067_alter_table_public_jobs_alter_column_tax_tow_rt/down.yaml new file mode 100644 index 000000000..c748246fa --- /dev/null +++ b/hasura/migrations/1580342652067_alter_table_public_jobs_alter_column_tax_tow_rt/down.yaml @@ -0,0 +1,3 @@ +- args: + sql: COMMENT ON COLUMN "public"."jobs"."tax_tow_rt" IS E'null' + type: run_sql diff --git a/hasura/migrations/1580342652067_alter_table_public_jobs_alter_column_tax_tow_rt/up.yaml b/hasura/migrations/1580342652067_alter_table_public_jobs_alter_column_tax_tow_rt/up.yaml new file mode 100644 index 000000000..050699106 --- /dev/null +++ b/hasura/migrations/1580342652067_alter_table_public_jobs_alter_column_tax_tow_rt/up.yaml @@ -0,0 +1,3 @@ +- args: + sql: COMMENT ON COLUMN "public"."jobs"."tax_tow_rt" IS E'Taxing tow Rate' + type: run_sql diff --git a/hasura/migrations/1580342697226_alter_table_public_jobs_add_column_tax_sub_rt/down.yaml b/hasura/migrations/1580342697226_alter_table_public_jobs_add_column_tax_sub_rt/down.yaml new file mode 100644 index 000000000..3c2faedff --- /dev/null +++ b/hasura/migrations/1580342697226_alter_table_public_jobs_add_column_tax_sub_rt/down.yaml @@ -0,0 +1,3 @@ +- args: + sql: ALTER TABLE "public"."jobs" DROP COLUMN "tax_sub_rt"; + type: run_sql diff --git a/hasura/migrations/1580342697226_alter_table_public_jobs_add_column_tax_sub_rt/up.yaml b/hasura/migrations/1580342697226_alter_table_public_jobs_add_column_tax_sub_rt/up.yaml new file mode 100644 index 000000000..b77cd85bd --- /dev/null +++ b/hasura/migrations/1580342697226_alter_table_public_jobs_add_column_tax_sub_rt/up.yaml @@ -0,0 +1,3 @@ +- args: + sql: ALTER TABLE "public"."jobs" ADD COLUMN "tax_sub_rt" numeric NULL; + type: run_sql diff --git a/hasura/migrations/1580342709854_alter_table_public_jobs_alter_column_tax_sub_rt/down.yaml b/hasura/migrations/1580342709854_alter_table_public_jobs_alter_column_tax_sub_rt/down.yaml new file mode 100644 index 000000000..a8957d602 --- /dev/null +++ b/hasura/migrations/1580342709854_alter_table_public_jobs_alter_column_tax_sub_rt/down.yaml @@ -0,0 +1,3 @@ +- args: + sql: COMMENT ON COLUMN "public"."jobs"."tax_sub_rt" IS E'null' + type: run_sql diff --git a/hasura/migrations/1580342709854_alter_table_public_jobs_alter_column_tax_sub_rt/up.yaml b/hasura/migrations/1580342709854_alter_table_public_jobs_alter_column_tax_sub_rt/up.yaml new file mode 100644 index 000000000..3796212ba --- /dev/null +++ b/hasura/migrations/1580342709854_alter_table_public_jobs_alter_column_tax_sub_rt/up.yaml @@ -0,0 +1,3 @@ +- args: + sql: COMMENT ON COLUMN "public"."jobs"."tax_sub_rt" IS E'Sublet Tax Rate' + type: run_sql diff --git a/hasura/migrations/1580342722401_alter_table_public_jobs_alter_column_tax_pstthr/down.yaml b/hasura/migrations/1580342722401_alter_table_public_jobs_alter_column_tax_pstthr/down.yaml new file mode 100644 index 000000000..94dea43fb --- /dev/null +++ b/hasura/migrations/1580342722401_alter_table_public_jobs_alter_column_tax_pstthr/down.yaml @@ -0,0 +1,3 @@ +- args: + sql: COMMENT ON COLUMN "public"."jobs"."tax_pstthr" IS E'PST for Parts' + type: run_sql diff --git a/hasura/migrations/1580342722401_alter_table_public_jobs_alter_column_tax_pstthr/up.yaml b/hasura/migrations/1580342722401_alter_table_public_jobs_alter_column_tax_pstthr/up.yaml new file mode 100644 index 000000000..94caad8e1 --- /dev/null +++ b/hasura/migrations/1580342722401_alter_table_public_jobs_alter_column_tax_pstthr/up.yaml @@ -0,0 +1,3 @@ +- args: + sql: COMMENT ON COLUMN "public"."jobs"."tax_pstthr" IS E'Parts Tax Rate' + type: run_sql diff --git a/hasura/migrations/1580342734703_alter_table_public_jobs_alter_column_tax_tow_rt/down.yaml b/hasura/migrations/1580342734703_alter_table_public_jobs_alter_column_tax_tow_rt/down.yaml new file mode 100644 index 000000000..050699106 --- /dev/null +++ b/hasura/migrations/1580342734703_alter_table_public_jobs_alter_column_tax_tow_rt/down.yaml @@ -0,0 +1,3 @@ +- args: + sql: COMMENT ON COLUMN "public"."jobs"."tax_tow_rt" IS E'Taxing tow Rate' + type: run_sql diff --git a/hasura/migrations/1580342734703_alter_table_public_jobs_alter_column_tax_tow_rt/up.yaml b/hasura/migrations/1580342734703_alter_table_public_jobs_alter_column_tax_tow_rt/up.yaml new file mode 100644 index 000000000..ae024a852 --- /dev/null +++ b/hasura/migrations/1580342734703_alter_table_public_jobs_alter_column_tax_tow_rt/up.yaml @@ -0,0 +1,3 @@ +- args: + sql: COMMENT ON COLUMN "public"."jobs"."tax_tow_rt" IS E'Towing Tax Rate' + type: run_sql diff --git a/hasura/migrations/1580343246214_update_permission_user_public_table_jobs/down.yaml b/hasura/migrations/1580343246214_update_permission_user_public_table_jobs/down.yaml new file mode 100644 index 000000000..a0210b669 --- /dev/null +++ b/hasura/migrations/1580343246214_update_permission_user_public_table_jobs/down.yaml @@ -0,0 +1,230 @@ +- 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: + - id + - created_at + - updated_at + - shopid + - ro_number + - ownerid + - vehicleid + - labor_rate_id + - labor_rate_desc + - rate_lab + - rate_lad + - rate_lae + - rate_lar + - rate_las + - rate_laf + - rate_lam + - rate_lag + - rate_atp + - rate_lau + - rate_la1 + - rate_la2 + - rate_la3 + - rate_la4 + - rate_mapa + - rate_mash + - rate_mahw + - rate_ma2s + - rate_ma3s + - rate_ma2t + - rate_mabl + - rate_macs + - rate_matd + - federal_tax_rate + - state_tax_rate + - local_tax_rate + - est_co_nm + - est_addr1 + - est_addr2 + - est_city + - est_st + - est_zip + - est_ctry + - est_ph1 + - est_ea + - est_ct_ln + - est_ct_fn + - scheduled_in + - actual_in + - scheduled_completion + - actual_completion + - scheduled_delivery + - actual_delivery + - regie_number + - invoice_date + - claim_total + - deductible + - inproduction + - statusid + - ins_co_id + - ins_co_nm + - ins_addr1 + - ins_addr2 + - ins_city + - ins_st + - ins_zip + - ins_ctry + - ins_ph1 + - ins_ph1x + - ins_ph2 + - ins_ph2x + - ins_fax + - ins_faxx + - ins_ct_ln + - ins_ct_fn + - ins_title + - ins_ct_ph + - ins_ct_phx + - ins_ea + - ins_memo + - policy_no + - ded_amt + - ded_status + - asgn_no + - asgn_date + - asgn_type + - clm_no + - clm_ofc_id + - date_estimated + - date_open + - date_scheduled + - date_invoiced + - date_closed + - date_exported + - clm_total + - owner_owing + - converted + - ciecaid + - loss_date + - clm_ofc_nm + - clm_addr1 + - clm_addr2 + - clm_city + - clm_st + - clm_zip + - clm_ctry + - clm_ph1 + - clm_ph1x + - clm_ph2 + - clm_ph2x + - clm_fax + - clm_faxx + - clm_ct_ln + - clm_ct_fn + - clm_title + - clm_ct_ph + - clm_ct_phx + - clm_ea + - payee_nms + - pay_type + - pay_date + - pay_chknm + - pay_amt + - agt_co_id + - agt_co_nm + - agt_addr1 + - agt_addr2 + - agt_city + - agt_st + - agt_zip + - agt_ctry + - agt_ph1 + - agt_ph1x + - agt_ph2 + - agt_ph2x + - agt_fax + - agt_faxx + - agt_ct_ln + - agt_ct_fn + - agt_ct_ph + - agt_ct_phx + - agt_ea + - agt_lic_no + - loss_type + - loss_desc + - theft_ind + - cat_no + - tlos_ind + - cust_pr + - insd_ln + - insd_fn + - insd_title + - insd_co_nm + - insd_addr1 + - insd_addr2 + - insd_city + - insd_st + - insd_zip + - insd_ctry + - insd_ph1 + - insd_ph1x + - insd_ph2 + - insd_ph2x + - insd_fax + - insd_faxx + - insd_ea + - ownr_ln + - ownr_fn + - ownr_title + - ownr_co_nm + - ownr_addr1 + - ownr_addr2 + - ownr_city + - ownr_st + - ownr_zip + - ownr_ctry + - ownr_ph1 + - ownr_ph1x + - ownr_ph2 + - ownr_ph2x + - ownr_fax + - ownr_faxx + - ownr_ea + - area_of_damage + - loss_cat + - est_number + - service_car + - special_coverage_policy + - csr + - po_number + - unit_number + - kmin + - kmout + - referral_source + - selling_dealer + - servicing_dealer + - servicing_dealer_contact + - selling_dealer_contact + - depreciation_taxes + - federal_tax_payable + - other_amount_payable + - towing_payable + - storage_payable + - adjustment_bottom_line + localPresets: + - key: "" + value: "" + set: {} + role: user + table: + name: jobs + schema: public + type: create_insert_permission diff --git a/hasura/migrations/1580343246214_update_permission_user_public_table_jobs/up.yaml b/hasura/migrations/1580343246214_update_permission_user_public_table_jobs/up.yaml new file mode 100644 index 000000000..5e96a692b --- /dev/null +++ b/hasura/migrations/1580343246214_update_permission_user_public_table_jobs/up.yaml @@ -0,0 +1,233 @@ +- 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: + - id + - created_at + - updated_at + - shopid + - ro_number + - ownerid + - vehicleid + - labor_rate_id + - labor_rate_desc + - rate_lab + - rate_lad + - rate_lae + - rate_lar + - rate_las + - rate_laf + - rate_lam + - rate_lag + - rate_atp + - rate_lau + - rate_la1 + - rate_la2 + - rate_la3 + - rate_la4 + - rate_mapa + - rate_mash + - rate_mahw + - rate_ma2s + - rate_ma3s + - rate_ma2t + - rate_mabl + - rate_macs + - rate_matd + - federal_tax_rate + - state_tax_rate + - local_tax_rate + - est_co_nm + - est_addr1 + - est_addr2 + - est_city + - est_st + - est_zip + - est_ctry + - est_ph1 + - est_ea + - est_ct_ln + - est_ct_fn + - scheduled_in + - actual_in + - scheduled_completion + - actual_completion + - scheduled_delivery + - actual_delivery + - regie_number + - invoice_date + - claim_total + - deductible + - inproduction + - statusid + - ins_co_id + - ins_co_nm + - ins_addr1 + - ins_addr2 + - ins_city + - ins_st + - ins_zip + - ins_ctry + - ins_ph1 + - ins_ph1x + - ins_ph2 + - ins_ph2x + - ins_fax + - ins_faxx + - ins_ct_ln + - ins_ct_fn + - ins_title + - ins_ct_ph + - ins_ct_phx + - ins_ea + - ins_memo + - policy_no + - ded_amt + - ded_status + - asgn_no + - asgn_date + - asgn_type + - clm_no + - clm_ofc_id + - date_estimated + - date_open + - date_scheduled + - date_invoiced + - date_closed + - date_exported + - clm_total + - owner_owing + - converted + - ciecaid + - loss_date + - clm_ofc_nm + - clm_addr1 + - clm_addr2 + - clm_city + - clm_st + - clm_zip + - clm_ctry + - clm_ph1 + - clm_ph1x + - clm_ph2 + - clm_ph2x + - clm_fax + - clm_faxx + - clm_ct_ln + - clm_ct_fn + - clm_title + - clm_ct_ph + - clm_ct_phx + - clm_ea + - payee_nms + - pay_type + - pay_date + - pay_chknm + - pay_amt + - agt_co_id + - agt_co_nm + - agt_addr1 + - agt_addr2 + - agt_city + - agt_st + - agt_zip + - agt_ctry + - agt_ph1 + - agt_ph1x + - agt_ph2 + - agt_ph2x + - agt_fax + - agt_faxx + - agt_ct_ln + - agt_ct_fn + - agt_ct_ph + - agt_ct_phx + - agt_ea + - agt_lic_no + - loss_type + - loss_desc + - theft_ind + - cat_no + - tlos_ind + - cust_pr + - insd_ln + - insd_fn + - insd_title + - insd_co_nm + - insd_addr1 + - insd_addr2 + - insd_city + - insd_st + - insd_zip + - insd_ctry + - insd_ph1 + - insd_ph1x + - insd_ph2 + - insd_ph2x + - insd_fax + - insd_faxx + - insd_ea + - ownr_ln + - ownr_fn + - ownr_title + - ownr_co_nm + - ownr_addr1 + - ownr_addr2 + - ownr_city + - ownr_st + - ownr_zip + - ownr_ctry + - ownr_ph1 + - ownr_ph1x + - ownr_ph2 + - ownr_ph2x + - ownr_fax + - ownr_faxx + - ownr_ea + - area_of_damage + - loss_cat + - est_number + - service_car + - special_coverage_policy + - csr + - po_number + - unit_number + - kmin + - kmout + - referral_source + - selling_dealer + - servicing_dealer + - servicing_dealer_contact + - selling_dealer_contact + - depreciation_taxes + - federal_tax_payable + - other_amount_payable + - towing_payable + - storage_payable + - adjustment_bottom_line + - tax_pstthr + - tax_tow_rt + - tax_sub_rt + localPresets: + - key: "" + value: "" + set: {} + role: user + table: + name: jobs + schema: public + type: create_insert_permission diff --git a/hasura/migrations/1580343251291_update_permission_user_public_table_jobs/down.yaml b/hasura/migrations/1580343251291_update_permission_user_public_table_jobs/down.yaml new file mode 100644 index 000000000..e18ccedb9 --- /dev/null +++ b/hasura/migrations/1580343251291_update_permission_user_public_table_jobs/down.yaml @@ -0,0 +1,228 @@ +- args: + role: user + table: + name: jobs + schema: public + type: drop_select_permission +- args: + permission: + allow_aggregations: false + columns: + - converted + - inproduction + - special_coverage_policy + - asgn_date + - invoice_date + - loss_date + - pay_date + - kmin + - kmout + - est_number + - area_of_damage + - adjustment_bottom_line + - claim_total + - clm_total + - ded_amt + - deductible + - depreciation_taxes + - federal_tax_payable + - federal_tax_rate + - local_tax_rate + - other_amount_payable + - owner_owing + - pay_amt + - 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 + - storage_payable + - towing_payable + - agt_addr1 + - agt_addr2 + - agt_city + - agt_co_id + - agt_co_nm + - agt_ct_fn + - agt_ct_ln + - agt_ct_ph + - agt_ct_phx + - agt_ctry + - agt_ea + - agt_fax + - agt_faxx + - agt_lic_no + - agt_ph1 + - agt_ph1x + - agt_ph2 + - agt_ph2x + - agt_st + - agt_zip + - asgn_no + - asgn_type + - cat_no + - ciecaid + - clm_addr1 + - clm_addr2 + - clm_city + - clm_ct_fn + - clm_ct_ln + - clm_ct_ph + - clm_ct_phx + - clm_ctry + - clm_ea + - clm_fax + - clm_faxx + - clm_no + - clm_ofc_id + - clm_ofc_nm + - clm_ph1 + - clm_ph1x + - clm_ph2 + - clm_ph2x + - clm_st + - clm_title + - clm_zip + - csr + - cust_pr + - ded_status + - est_addr1 + - est_addr2 + - est_city + - est_co_nm + - est_ct_fn + - est_ct_ln + - est_ctry + - est_ea + - est_ph1 + - est_st + - est_zip + - ins_addr1 + - ins_addr2 + - ins_city + - ins_co_id + - ins_co_nm + - ins_ct_fn + - ins_ct_ln + - ins_ct_ph + - ins_ct_phx + - ins_ctry + - insd_addr1 + - insd_addr2 + - insd_city + - insd_co_nm + - insd_ctry + - insd_ea + - insd_fax + - insd_faxx + - insd_fn + - insd_ln + - insd_ph1 + - insd_ph1x + - insd_ph2 + - insd_ph2x + - insd_st + - insd_title + - insd_zip + - ins_ea + - ins_fax + - ins_faxx + - ins_memo + - ins_ph1 + - ins_ph1x + - ins_ph2 + - ins_ph2x + - ins_st + - ins_title + - ins_zip + - labor_rate_desc + - labor_rate_id + - loss_cat + - loss_desc + - loss_type + - ownr_addr1 + - ownr_addr2 + - ownr_city + - ownr_co_nm + - ownr_ctry + - ownr_ea + - ownr_fax + - ownr_faxx + - ownr_fn + - ownr_ln + - ownr_ph1 + - ownr_ph1x + - ownr_ph2 + - ownr_ph2x + - ownr_st + - ownr_title + - ownr_zip + - pay_chknm + - payee_nms + - pay_type + - policy_no + - po_number + - referral_source + - regie_number + - ro_number + - selling_dealer + - selling_dealer_contact + - service_car + - servicing_dealer + - servicing_dealer_contact + - theft_ind + - tlos_ind + - unit_number + - actual_completion + - actual_delivery + - actual_in + - created_at + - date_closed + - date_estimated + - date_exported + - date_invoiced + - date_open + - date_scheduled + - scheduled_completion + - scheduled_delivery + - scheduled_in + - updated_at + - id + - ownerid + - shopid + - statusid + - 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 diff --git a/hasura/migrations/1580343251291_update_permission_user_public_table_jobs/up.yaml b/hasura/migrations/1580343251291_update_permission_user_public_table_jobs/up.yaml new file mode 100644 index 000000000..e7684a905 --- /dev/null +++ b/hasura/migrations/1580343251291_update_permission_user_public_table_jobs/up.yaml @@ -0,0 +1,231 @@ +- args: + role: user + table: + name: jobs + schema: public + type: drop_select_permission +- args: + permission: + allow_aggregations: false + columns: + - converted + - inproduction + - special_coverage_policy + - theft_ind + - tlos_ind + - asgn_date + - invoice_date + - loss_date + - pay_date + - kmin + - kmout + - est_number + - area_of_damage + - adjustment_bottom_line + - claim_total + - clm_total + - ded_amt + - deductible + - depreciation_taxes + - federal_tax_payable + - federal_tax_rate + - local_tax_rate + - other_amount_payable + - owner_owing + - pay_amt + - 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 + - storage_payable + - towing_payable + - agt_addr1 + - agt_addr2 + - agt_city + - agt_co_id + - agt_co_nm + - agt_ct_fn + - agt_ct_ln + - agt_ct_ph + - agt_ct_phx + - agt_ctry + - agt_ea + - agt_fax + - agt_faxx + - agt_lic_no + - agt_ph1 + - agt_ph1x + - agt_ph2 + - agt_ph2x + - agt_st + - agt_zip + - asgn_no + - asgn_type + - cat_no + - ciecaid + - clm_addr1 + - clm_addr2 + - clm_city + - clm_ct_fn + - clm_ct_ln + - clm_ct_ph + - clm_ct_phx + - clm_ctry + - clm_ea + - clm_fax + - clm_faxx + - clm_no + - clm_ofc_id + - clm_ofc_nm + - clm_ph1 + - clm_ph1x + - clm_ph2 + - clm_ph2x + - clm_st + - clm_title + - clm_zip + - csr + - cust_pr + - ded_status + - est_addr1 + - est_addr2 + - est_city + - est_co_nm + - est_ct_fn + - est_ct_ln + - est_ctry + - est_ea + - est_ph1 + - est_st + - est_zip + - ins_addr1 + - ins_addr2 + - ins_city + - ins_co_id + - ins_co_nm + - ins_ct_fn + - ins_ct_ln + - ins_ct_ph + - ins_ct_phx + - ins_ctry + - insd_addr1 + - insd_addr2 + - insd_city + - insd_co_nm + - insd_ctry + - insd_ea + - insd_fax + - insd_faxx + - insd_fn + - insd_ln + - insd_ph1 + - insd_ph1x + - insd_ph2 + - insd_ph2x + - insd_st + - insd_title + - insd_zip + - ins_ea + - ins_fax + - ins_faxx + - ins_memo + - ins_ph1 + - ins_ph1x + - ins_ph2 + - ins_ph2x + - ins_st + - ins_title + - ins_zip + - labor_rate_desc + - labor_rate_id + - loss_cat + - loss_desc + - loss_type + - ownr_addr1 + - ownr_addr2 + - ownr_city + - ownr_co_nm + - ownr_ctry + - ownr_ea + - ownr_fax + - ownr_faxx + - ownr_fn + - ownr_ln + - ownr_ph1 + - ownr_ph1x + - ownr_ph2 + - ownr_ph2x + - ownr_st + - ownr_title + - ownr_zip + - pay_chknm + - payee_nms + - pay_type + - policy_no + - po_number + - referral_source + - regie_number + - ro_number + - selling_dealer + - selling_dealer_contact + - service_car + - servicing_dealer + - servicing_dealer_contact + - unit_number + - actual_completion + - actual_delivery + - actual_in + - created_at + - date_closed + - date_estimated + - date_exported + - date_invoiced + - date_open + - date_scheduled + - scheduled_completion + - scheduled_delivery + - scheduled_in + - updated_at + - id + - ownerid + - shopid + - statusid + - vehicleid + - tax_pstthr + - tax_sub_rt + - tax_tow_rt + 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 diff --git a/hasura/migrations/1580343257730_update_permission_user_public_table_jobs/down.yaml b/hasura/migrations/1580343257730_update_permission_user_public_table_jobs/down.yaml new file mode 100644 index 000000000..56280c418 --- /dev/null +++ b/hasura/migrations/1580343257730_update_permission_user_public_table_jobs/down.yaml @@ -0,0 +1,230 @@ +- args: + role: user + table: + name: jobs + schema: public + type: drop_update_permission +- args: + permission: + columns: + - converted + - inproduction + - special_coverage_policy + - asgn_date + - invoice_date + - loss_date + - pay_date + - kmin + - kmout + - est_number + - area_of_damage + - adjustment_bottom_line + - claim_total + - clm_total + - ded_amt + - deductible + - depreciation_taxes + - federal_tax_payable + - federal_tax_rate + - local_tax_rate + - other_amount_payable + - owner_owing + - pay_amt + - 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 + - storage_payable + - towing_payable + - agt_addr1 + - agt_addr2 + - agt_city + - agt_co_id + - agt_co_nm + - agt_ct_fn + - agt_ct_ln + - agt_ct_ph + - agt_ct_phx + - agt_ctry + - agt_ea + - agt_fax + - agt_faxx + - agt_lic_no + - agt_ph1 + - agt_ph1x + - agt_ph2 + - agt_ph2x + - agt_st + - agt_zip + - asgn_no + - asgn_type + - cat_no + - ciecaid + - clm_addr1 + - clm_addr2 + - clm_city + - clm_ct_fn + - clm_ct_ln + - clm_ct_ph + - clm_ct_phx + - clm_ctry + - clm_ea + - clm_fax + - clm_faxx + - clm_no + - clm_ofc_id + - clm_ofc_nm + - clm_ph1 + - clm_ph1x + - clm_ph2 + - clm_ph2x + - clm_st + - clm_title + - clm_zip + - csr + - cust_pr + - ded_status + - est_addr1 + - est_addr2 + - est_city + - est_co_nm + - est_ct_fn + - est_ct_ln + - est_ctry + - est_ea + - est_ph1 + - est_st + - est_zip + - ins_addr1 + - ins_addr2 + - ins_city + - ins_co_id + - ins_co_nm + - ins_ct_fn + - ins_ct_ln + - ins_ct_ph + - ins_ct_phx + - ins_ctry + - insd_addr1 + - insd_addr2 + - insd_city + - insd_co_nm + - insd_ctry + - insd_ea + - insd_fax + - insd_faxx + - insd_fn + - insd_ln + - insd_ph1 + - insd_ph1x + - insd_ph2 + - insd_ph2x + - insd_st + - insd_title + - insd_zip + - ins_ea + - ins_fax + - ins_faxx + - ins_memo + - ins_ph1 + - ins_ph1x + - ins_ph2 + - ins_ph2x + - ins_st + - ins_title + - ins_zip + - labor_rate_desc + - labor_rate_id + - loss_cat + - loss_desc + - loss_type + - ownr_addr1 + - ownr_addr2 + - ownr_city + - ownr_co_nm + - ownr_ctry + - ownr_ea + - ownr_fax + - ownr_faxx + - ownr_fn + - ownr_ln + - ownr_ph1 + - ownr_ph1x + - ownr_ph2 + - ownr_ph2x + - ownr_st + - ownr_title + - ownr_zip + - pay_chknm + - payee_nms + - pay_type + - policy_no + - po_number + - referral_source + - regie_number + - ro_number + - selling_dealer + - selling_dealer_contact + - service_car + - servicing_dealer + - servicing_dealer_contact + - theft_ind + - tlos_ind + - unit_number + - actual_completion + - actual_delivery + - actual_in + - created_at + - date_closed + - date_estimated + - date_exported + - date_invoiced + - date_open + - date_scheduled + - scheduled_completion + - scheduled_delivery + - scheduled_in + - updated_at + - id + - ownerid + - shopid + - statusid + - 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 diff --git a/hasura/migrations/1580343257730_update_permission_user_public_table_jobs/up.yaml b/hasura/migrations/1580343257730_update_permission_user_public_table_jobs/up.yaml new file mode 100644 index 000000000..8910ace88 --- /dev/null +++ b/hasura/migrations/1580343257730_update_permission_user_public_table_jobs/up.yaml @@ -0,0 +1,233 @@ +- args: + role: user + table: + name: jobs + schema: public + type: drop_update_permission +- args: + permission: + columns: + - converted + - inproduction + - special_coverage_policy + - theft_ind + - tlos_ind + - asgn_date + - invoice_date + - loss_date + - pay_date + - kmin + - kmout + - est_number + - area_of_damage + - adjustment_bottom_line + - claim_total + - clm_total + - ded_amt + - deductible + - depreciation_taxes + - federal_tax_payable + - federal_tax_rate + - local_tax_rate + - other_amount_payable + - owner_owing + - pay_amt + - 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 + - storage_payable + - towing_payable + - agt_addr1 + - agt_addr2 + - agt_city + - agt_co_id + - agt_co_nm + - agt_ct_fn + - agt_ct_ln + - agt_ct_ph + - agt_ct_phx + - agt_ctry + - agt_ea + - agt_fax + - agt_faxx + - agt_lic_no + - agt_ph1 + - agt_ph1x + - agt_ph2 + - agt_ph2x + - agt_st + - agt_zip + - asgn_no + - asgn_type + - cat_no + - ciecaid + - clm_addr1 + - clm_addr2 + - clm_city + - clm_ct_fn + - clm_ct_ln + - clm_ct_ph + - clm_ct_phx + - clm_ctry + - clm_ea + - clm_fax + - clm_faxx + - clm_no + - clm_ofc_id + - clm_ofc_nm + - clm_ph1 + - clm_ph1x + - clm_ph2 + - clm_ph2x + - clm_st + - clm_title + - clm_zip + - csr + - cust_pr + - ded_status + - est_addr1 + - est_addr2 + - est_city + - est_co_nm + - est_ct_fn + - est_ct_ln + - est_ctry + - est_ea + - est_ph1 + - est_st + - est_zip + - ins_addr1 + - ins_addr2 + - ins_city + - ins_co_id + - ins_co_nm + - ins_ct_fn + - ins_ct_ln + - ins_ct_ph + - ins_ct_phx + - ins_ctry + - insd_addr1 + - insd_addr2 + - insd_city + - insd_co_nm + - insd_ctry + - insd_ea + - insd_fax + - insd_faxx + - insd_fn + - insd_ln + - insd_ph1 + - insd_ph1x + - insd_ph2 + - insd_ph2x + - insd_st + - insd_title + - insd_zip + - ins_ea + - ins_fax + - ins_faxx + - ins_memo + - ins_ph1 + - ins_ph1x + - ins_ph2 + - ins_ph2x + - ins_st + - ins_title + - ins_zip + - labor_rate_desc + - labor_rate_id + - loss_cat + - loss_desc + - loss_type + - ownr_addr1 + - ownr_addr2 + - ownr_city + - ownr_co_nm + - ownr_ctry + - ownr_ea + - ownr_fax + - ownr_faxx + - ownr_fn + - ownr_ln + - ownr_ph1 + - ownr_ph1x + - ownr_ph2 + - ownr_ph2x + - ownr_st + - ownr_title + - ownr_zip + - pay_chknm + - payee_nms + - pay_type + - policy_no + - po_number + - referral_source + - regie_number + - ro_number + - selling_dealer + - selling_dealer_contact + - service_car + - servicing_dealer + - servicing_dealer_contact + - unit_number + - actual_completion + - actual_delivery + - actual_in + - created_at + - date_closed + - date_estimated + - date_exported + - date_invoiced + - date_open + - date_scheduled + - scheduled_completion + - scheduled_delivery + - scheduled_in + - updated_at + - id + - ownerid + - shopid + - statusid + - vehicleid + - tax_pstthr + - tax_sub_rt + - tax_tow_rt + 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 diff --git a/hasura/migrations/1580346541910_alter_table_public_jobs_add_column_tax_paint_mat/down.yaml b/hasura/migrations/1580346541910_alter_table_public_jobs_add_column_tax_paint_mat/down.yaml new file mode 100644 index 000000000..389f605db --- /dev/null +++ b/hasura/migrations/1580346541910_alter_table_public_jobs_add_column_tax_paint_mat/down.yaml @@ -0,0 +1,3 @@ +- args: + sql: ALTER TABLE "public"."jobs" DROP COLUMN "tax_paint_mat"; + type: run_sql diff --git a/hasura/migrations/1580346541910_alter_table_public_jobs_add_column_tax_paint_mat/up.yaml b/hasura/migrations/1580346541910_alter_table_public_jobs_add_column_tax_paint_mat/up.yaml new file mode 100644 index 000000000..d3ad68e79 --- /dev/null +++ b/hasura/migrations/1580346541910_alter_table_public_jobs_add_column_tax_paint_mat/up.yaml @@ -0,0 +1,3 @@ +- args: + sql: ALTER TABLE "public"."jobs" ADD COLUMN "tax_paint_mat" numeric NULL; + type: run_sql diff --git a/hasura/migrations/1580346657585_alter_table_public_jobs_add_column_tax_levies/down.yaml b/hasura/migrations/1580346657585_alter_table_public_jobs_add_column_tax_levies/down.yaml new file mode 100644 index 000000000..6a972b65f --- /dev/null +++ b/hasura/migrations/1580346657585_alter_table_public_jobs_add_column_tax_levies/down.yaml @@ -0,0 +1,3 @@ +- args: + sql: ALTER TABLE "public"."jobs" DROP COLUMN "tax_levies"; + type: run_sql diff --git a/hasura/migrations/1580346657585_alter_table_public_jobs_add_column_tax_levies/up.yaml b/hasura/migrations/1580346657585_alter_table_public_jobs_add_column_tax_levies/up.yaml new file mode 100644 index 000000000..13ffaa8ad --- /dev/null +++ b/hasura/migrations/1580346657585_alter_table_public_jobs_add_column_tax_levies/up.yaml @@ -0,0 +1,3 @@ +- args: + sql: ALTER TABLE "public"."jobs" ADD COLUMN "tax_levies" numeric NULL; + type: run_sql diff --git a/hasura/migrations/1580346809511_alter_table_public_jobs_alter_column_tax_paint_mat/down.yaml b/hasura/migrations/1580346809511_alter_table_public_jobs_alter_column_tax_paint_mat/down.yaml new file mode 100644 index 000000000..74c06e879 --- /dev/null +++ b/hasura/migrations/1580346809511_alter_table_public_jobs_alter_column_tax_paint_mat/down.yaml @@ -0,0 +1,6 @@ +- args: + sql: COMMENT ON COLUMN "public"."jobs"."tax_paint_mat" IS E'null' + type: run_sql +- args: + sql: alter table "public"."jobs" rename column "tax_paint_mat_rt" to "tax_paint_mat"; + type: run_sql diff --git a/hasura/migrations/1580346809511_alter_table_public_jobs_alter_column_tax_paint_mat/up.yaml b/hasura/migrations/1580346809511_alter_table_public_jobs_alter_column_tax_paint_mat/up.yaml new file mode 100644 index 000000000..46cacd480 --- /dev/null +++ b/hasura/migrations/1580346809511_alter_table_public_jobs_alter_column_tax_paint_mat/up.yaml @@ -0,0 +1,6 @@ +- args: + sql: COMMENT ON COLUMN "public"."jobs"."tax_paint_mat" IS E'' + type: run_sql +- args: + sql: alter table "public"."jobs" rename column "tax_paint_mat" to "tax_paint_mat_rt"; + type: run_sql diff --git a/hasura/migrations/1580346822949_alter_table_public_jobs_alter_column_tax_levies/down.yaml b/hasura/migrations/1580346822949_alter_table_public_jobs_alter_column_tax_levies/down.yaml new file mode 100644 index 000000000..35a057441 --- /dev/null +++ b/hasura/migrations/1580346822949_alter_table_public_jobs_alter_column_tax_levies/down.yaml @@ -0,0 +1,6 @@ +- args: + sql: COMMENT ON COLUMN "public"."jobs"."tax_levies" IS E'null' + type: run_sql +- args: + sql: alter table "public"."jobs" rename column "tax_levies_rt" to "tax_levies"; + type: run_sql diff --git a/hasura/migrations/1580346822949_alter_table_public_jobs_alter_column_tax_levies/up.yaml b/hasura/migrations/1580346822949_alter_table_public_jobs_alter_column_tax_levies/up.yaml new file mode 100644 index 000000000..5032d0a22 --- /dev/null +++ b/hasura/migrations/1580346822949_alter_table_public_jobs_alter_column_tax_levies/up.yaml @@ -0,0 +1,6 @@ +- args: + sql: COMMENT ON COLUMN "public"."jobs"."tax_levies" IS E'' + type: run_sql +- args: + sql: alter table "public"."jobs" rename column "tax_levies" to "tax_levies_rt"; + type: run_sql diff --git a/hasura/migrations/1580346901283_update_permission_user_public_table_jobs/down.yaml b/hasura/migrations/1580346901283_update_permission_user_public_table_jobs/down.yaml new file mode 100644 index 000000000..5e96a692b --- /dev/null +++ b/hasura/migrations/1580346901283_update_permission_user_public_table_jobs/down.yaml @@ -0,0 +1,233 @@ +- 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: + - id + - created_at + - updated_at + - shopid + - ro_number + - ownerid + - vehicleid + - labor_rate_id + - labor_rate_desc + - rate_lab + - rate_lad + - rate_lae + - rate_lar + - rate_las + - rate_laf + - rate_lam + - rate_lag + - rate_atp + - rate_lau + - rate_la1 + - rate_la2 + - rate_la3 + - rate_la4 + - rate_mapa + - rate_mash + - rate_mahw + - rate_ma2s + - rate_ma3s + - rate_ma2t + - rate_mabl + - rate_macs + - rate_matd + - federal_tax_rate + - state_tax_rate + - local_tax_rate + - est_co_nm + - est_addr1 + - est_addr2 + - est_city + - est_st + - est_zip + - est_ctry + - est_ph1 + - est_ea + - est_ct_ln + - est_ct_fn + - scheduled_in + - actual_in + - scheduled_completion + - actual_completion + - scheduled_delivery + - actual_delivery + - regie_number + - invoice_date + - claim_total + - deductible + - inproduction + - statusid + - ins_co_id + - ins_co_nm + - ins_addr1 + - ins_addr2 + - ins_city + - ins_st + - ins_zip + - ins_ctry + - ins_ph1 + - ins_ph1x + - ins_ph2 + - ins_ph2x + - ins_fax + - ins_faxx + - ins_ct_ln + - ins_ct_fn + - ins_title + - ins_ct_ph + - ins_ct_phx + - ins_ea + - ins_memo + - policy_no + - ded_amt + - ded_status + - asgn_no + - asgn_date + - asgn_type + - clm_no + - clm_ofc_id + - date_estimated + - date_open + - date_scheduled + - date_invoiced + - date_closed + - date_exported + - clm_total + - owner_owing + - converted + - ciecaid + - loss_date + - clm_ofc_nm + - clm_addr1 + - clm_addr2 + - clm_city + - clm_st + - clm_zip + - clm_ctry + - clm_ph1 + - clm_ph1x + - clm_ph2 + - clm_ph2x + - clm_fax + - clm_faxx + - clm_ct_ln + - clm_ct_fn + - clm_title + - clm_ct_ph + - clm_ct_phx + - clm_ea + - payee_nms + - pay_type + - pay_date + - pay_chknm + - pay_amt + - agt_co_id + - agt_co_nm + - agt_addr1 + - agt_addr2 + - agt_city + - agt_st + - agt_zip + - agt_ctry + - agt_ph1 + - agt_ph1x + - agt_ph2 + - agt_ph2x + - agt_fax + - agt_faxx + - agt_ct_ln + - agt_ct_fn + - agt_ct_ph + - agt_ct_phx + - agt_ea + - agt_lic_no + - loss_type + - loss_desc + - theft_ind + - cat_no + - tlos_ind + - cust_pr + - insd_ln + - insd_fn + - insd_title + - insd_co_nm + - insd_addr1 + - insd_addr2 + - insd_city + - insd_st + - insd_zip + - insd_ctry + - insd_ph1 + - insd_ph1x + - insd_ph2 + - insd_ph2x + - insd_fax + - insd_faxx + - insd_ea + - ownr_ln + - ownr_fn + - ownr_title + - ownr_co_nm + - ownr_addr1 + - ownr_addr2 + - ownr_city + - ownr_st + - ownr_zip + - ownr_ctry + - ownr_ph1 + - ownr_ph1x + - ownr_ph2 + - ownr_ph2x + - ownr_fax + - ownr_faxx + - ownr_ea + - area_of_damage + - loss_cat + - est_number + - service_car + - special_coverage_policy + - csr + - po_number + - unit_number + - kmin + - kmout + - referral_source + - selling_dealer + - servicing_dealer + - servicing_dealer_contact + - selling_dealer_contact + - depreciation_taxes + - federal_tax_payable + - other_amount_payable + - towing_payable + - storage_payable + - adjustment_bottom_line + - tax_pstthr + - tax_tow_rt + - tax_sub_rt + localPresets: + - key: "" + value: "" + set: {} + role: user + table: + name: jobs + schema: public + type: create_insert_permission diff --git a/hasura/migrations/1580346901283_update_permission_user_public_table_jobs/up.yaml b/hasura/migrations/1580346901283_update_permission_user_public_table_jobs/up.yaml new file mode 100644 index 000000000..c78859077 --- /dev/null +++ b/hasura/migrations/1580346901283_update_permission_user_public_table_jobs/up.yaml @@ -0,0 +1,235 @@ +- 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: + - id + - created_at + - updated_at + - shopid + - ro_number + - ownerid + - vehicleid + - labor_rate_id + - labor_rate_desc + - rate_lab + - rate_lad + - rate_lae + - rate_lar + - rate_las + - rate_laf + - rate_lam + - rate_lag + - rate_atp + - rate_lau + - rate_la1 + - rate_la2 + - rate_la3 + - rate_la4 + - rate_mapa + - rate_mash + - rate_mahw + - rate_ma2s + - rate_ma3s + - rate_ma2t + - rate_mabl + - rate_macs + - rate_matd + - federal_tax_rate + - state_tax_rate + - local_tax_rate + - est_co_nm + - est_addr1 + - est_addr2 + - est_city + - est_st + - est_zip + - est_ctry + - est_ph1 + - est_ea + - est_ct_ln + - est_ct_fn + - scheduled_in + - actual_in + - scheduled_completion + - actual_completion + - scheduled_delivery + - actual_delivery + - regie_number + - invoice_date + - claim_total + - deductible + - inproduction + - statusid + - ins_co_id + - ins_co_nm + - ins_addr1 + - ins_addr2 + - ins_city + - ins_st + - ins_zip + - ins_ctry + - ins_ph1 + - ins_ph1x + - ins_ph2 + - ins_ph2x + - ins_fax + - ins_faxx + - ins_ct_ln + - ins_ct_fn + - ins_title + - ins_ct_ph + - ins_ct_phx + - ins_ea + - ins_memo + - policy_no + - ded_amt + - ded_status + - asgn_no + - asgn_date + - asgn_type + - clm_no + - clm_ofc_id + - date_estimated + - date_open + - date_scheduled + - date_invoiced + - date_closed + - date_exported + - clm_total + - owner_owing + - converted + - ciecaid + - loss_date + - clm_ofc_nm + - clm_addr1 + - clm_addr2 + - clm_city + - clm_st + - clm_zip + - clm_ctry + - clm_ph1 + - clm_ph1x + - clm_ph2 + - clm_ph2x + - clm_fax + - clm_faxx + - clm_ct_ln + - clm_ct_fn + - clm_title + - clm_ct_ph + - clm_ct_phx + - clm_ea + - payee_nms + - pay_type + - pay_date + - pay_chknm + - pay_amt + - agt_co_id + - agt_co_nm + - agt_addr1 + - agt_addr2 + - agt_city + - agt_st + - agt_zip + - agt_ctry + - agt_ph1 + - agt_ph1x + - agt_ph2 + - agt_ph2x + - agt_fax + - agt_faxx + - agt_ct_ln + - agt_ct_fn + - agt_ct_ph + - agt_ct_phx + - agt_ea + - agt_lic_no + - loss_type + - loss_desc + - theft_ind + - cat_no + - tlos_ind + - cust_pr + - insd_ln + - insd_fn + - insd_title + - insd_co_nm + - insd_addr1 + - insd_addr2 + - insd_city + - insd_st + - insd_zip + - insd_ctry + - insd_ph1 + - insd_ph1x + - insd_ph2 + - insd_ph2x + - insd_fax + - insd_faxx + - insd_ea + - ownr_ln + - ownr_fn + - ownr_title + - ownr_co_nm + - ownr_addr1 + - ownr_addr2 + - ownr_city + - ownr_st + - ownr_zip + - ownr_ctry + - ownr_ph1 + - ownr_ph1x + - ownr_ph2 + - ownr_ph2x + - ownr_fax + - ownr_faxx + - ownr_ea + - area_of_damage + - loss_cat + - est_number + - service_car + - special_coverage_policy + - csr + - po_number + - unit_number + - kmin + - kmout + - referral_source + - selling_dealer + - servicing_dealer + - servicing_dealer_contact + - selling_dealer_contact + - depreciation_taxes + - federal_tax_payable + - other_amount_payable + - towing_payable + - storage_payable + - adjustment_bottom_line + - tax_pstthr + - tax_tow_rt + - tax_sub_rt + - tax_paint_mat_rt + - tax_levies_rt + localPresets: + - key: "" + value: "" + set: {} + role: user + table: + name: jobs + schema: public + type: create_insert_permission diff --git a/hasura/migrations/1580346908847_update_permission_user_public_table_jobs/down.yaml b/hasura/migrations/1580346908847_update_permission_user_public_table_jobs/down.yaml new file mode 100644 index 000000000..e7684a905 --- /dev/null +++ b/hasura/migrations/1580346908847_update_permission_user_public_table_jobs/down.yaml @@ -0,0 +1,231 @@ +- args: + role: user + table: + name: jobs + schema: public + type: drop_select_permission +- args: + permission: + allow_aggregations: false + columns: + - converted + - inproduction + - special_coverage_policy + - theft_ind + - tlos_ind + - asgn_date + - invoice_date + - loss_date + - pay_date + - kmin + - kmout + - est_number + - area_of_damage + - adjustment_bottom_line + - claim_total + - clm_total + - ded_amt + - deductible + - depreciation_taxes + - federal_tax_payable + - federal_tax_rate + - local_tax_rate + - other_amount_payable + - owner_owing + - pay_amt + - 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 + - storage_payable + - towing_payable + - agt_addr1 + - agt_addr2 + - agt_city + - agt_co_id + - agt_co_nm + - agt_ct_fn + - agt_ct_ln + - agt_ct_ph + - agt_ct_phx + - agt_ctry + - agt_ea + - agt_fax + - agt_faxx + - agt_lic_no + - agt_ph1 + - agt_ph1x + - agt_ph2 + - agt_ph2x + - agt_st + - agt_zip + - asgn_no + - asgn_type + - cat_no + - ciecaid + - clm_addr1 + - clm_addr2 + - clm_city + - clm_ct_fn + - clm_ct_ln + - clm_ct_ph + - clm_ct_phx + - clm_ctry + - clm_ea + - clm_fax + - clm_faxx + - clm_no + - clm_ofc_id + - clm_ofc_nm + - clm_ph1 + - clm_ph1x + - clm_ph2 + - clm_ph2x + - clm_st + - clm_title + - clm_zip + - csr + - cust_pr + - ded_status + - est_addr1 + - est_addr2 + - est_city + - est_co_nm + - est_ct_fn + - est_ct_ln + - est_ctry + - est_ea + - est_ph1 + - est_st + - est_zip + - ins_addr1 + - ins_addr2 + - ins_city + - ins_co_id + - ins_co_nm + - ins_ct_fn + - ins_ct_ln + - ins_ct_ph + - ins_ct_phx + - ins_ctry + - insd_addr1 + - insd_addr2 + - insd_city + - insd_co_nm + - insd_ctry + - insd_ea + - insd_fax + - insd_faxx + - insd_fn + - insd_ln + - insd_ph1 + - insd_ph1x + - insd_ph2 + - insd_ph2x + - insd_st + - insd_title + - insd_zip + - ins_ea + - ins_fax + - ins_faxx + - ins_memo + - ins_ph1 + - ins_ph1x + - ins_ph2 + - ins_ph2x + - ins_st + - ins_title + - ins_zip + - labor_rate_desc + - labor_rate_id + - loss_cat + - loss_desc + - loss_type + - ownr_addr1 + - ownr_addr2 + - ownr_city + - ownr_co_nm + - ownr_ctry + - ownr_ea + - ownr_fax + - ownr_faxx + - ownr_fn + - ownr_ln + - ownr_ph1 + - ownr_ph1x + - ownr_ph2 + - ownr_ph2x + - ownr_st + - ownr_title + - ownr_zip + - pay_chknm + - payee_nms + - pay_type + - policy_no + - po_number + - referral_source + - regie_number + - ro_number + - selling_dealer + - selling_dealer_contact + - service_car + - servicing_dealer + - servicing_dealer_contact + - unit_number + - actual_completion + - actual_delivery + - actual_in + - created_at + - date_closed + - date_estimated + - date_exported + - date_invoiced + - date_open + - date_scheduled + - scheduled_completion + - scheduled_delivery + - scheduled_in + - updated_at + - id + - ownerid + - shopid + - statusid + - vehicleid + - tax_pstthr + - tax_sub_rt + - tax_tow_rt + 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 diff --git a/hasura/migrations/1580346908847_update_permission_user_public_table_jobs/up.yaml b/hasura/migrations/1580346908847_update_permission_user_public_table_jobs/up.yaml new file mode 100644 index 000000000..6b5aa011f --- /dev/null +++ b/hasura/migrations/1580346908847_update_permission_user_public_table_jobs/up.yaml @@ -0,0 +1,233 @@ +- args: + role: user + table: + name: jobs + schema: public + type: drop_select_permission +- args: + permission: + allow_aggregations: false + columns: + - converted + - inproduction + - special_coverage_policy + - theft_ind + - tlos_ind + - asgn_date + - invoice_date + - loss_date + - pay_date + - kmin + - kmout + - est_number + - area_of_damage + - adjustment_bottom_line + - claim_total + - clm_total + - ded_amt + - deductible + - depreciation_taxes + - federal_tax_payable + - federal_tax_rate + - local_tax_rate + - other_amount_payable + - owner_owing + - pay_amt + - 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 + - storage_payable + - tax_levies_rt + - tax_paint_mat_rt + - towing_payable + - agt_addr1 + - agt_addr2 + - agt_city + - agt_co_id + - agt_co_nm + - agt_ct_fn + - agt_ct_ln + - agt_ct_ph + - agt_ct_phx + - agt_ctry + - agt_ea + - agt_fax + - agt_faxx + - agt_lic_no + - agt_ph1 + - agt_ph1x + - agt_ph2 + - agt_ph2x + - agt_st + - agt_zip + - asgn_no + - asgn_type + - cat_no + - ciecaid + - clm_addr1 + - clm_addr2 + - clm_city + - clm_ct_fn + - clm_ct_ln + - clm_ct_ph + - clm_ct_phx + - clm_ctry + - clm_ea + - clm_fax + - clm_faxx + - clm_no + - clm_ofc_id + - clm_ofc_nm + - clm_ph1 + - clm_ph1x + - clm_ph2 + - clm_ph2x + - clm_st + - clm_title + - clm_zip + - csr + - cust_pr + - ded_status + - est_addr1 + - est_addr2 + - est_city + - est_co_nm + - est_ct_fn + - est_ct_ln + - est_ctry + - est_ea + - est_ph1 + - est_st + - est_zip + - ins_addr1 + - ins_addr2 + - ins_city + - ins_co_id + - ins_co_nm + - ins_ct_fn + - ins_ct_ln + - ins_ct_ph + - ins_ct_phx + - ins_ctry + - insd_addr1 + - insd_addr2 + - insd_city + - insd_co_nm + - insd_ctry + - insd_ea + - insd_fax + - insd_faxx + - insd_fn + - insd_ln + - insd_ph1 + - insd_ph1x + - insd_ph2 + - insd_ph2x + - insd_st + - insd_title + - insd_zip + - ins_ea + - ins_fax + - ins_faxx + - ins_memo + - ins_ph1 + - ins_ph1x + - ins_ph2 + - ins_ph2x + - ins_st + - ins_title + - ins_zip + - labor_rate_desc + - labor_rate_id + - loss_cat + - loss_desc + - loss_type + - ownr_addr1 + - ownr_addr2 + - ownr_city + - ownr_co_nm + - ownr_ctry + - ownr_ea + - ownr_fax + - ownr_faxx + - ownr_fn + - ownr_ln + - ownr_ph1 + - ownr_ph1x + - ownr_ph2 + - ownr_ph2x + - ownr_st + - ownr_title + - ownr_zip + - pay_chknm + - payee_nms + - pay_type + - policy_no + - po_number + - referral_source + - regie_number + - ro_number + - selling_dealer + - selling_dealer_contact + - service_car + - servicing_dealer + - servicing_dealer_contact + - unit_number + - actual_completion + - actual_delivery + - actual_in + - created_at + - date_closed + - date_estimated + - date_exported + - date_invoiced + - date_open + - date_scheduled + - scheduled_completion + - scheduled_delivery + - scheduled_in + - updated_at + - id + - ownerid + - shopid + - statusid + - vehicleid + - tax_pstthr + - tax_sub_rt + - tax_tow_rt + 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 diff --git a/hasura/migrations/1580346914307_update_permission_user_public_table_jobs/down.yaml b/hasura/migrations/1580346914307_update_permission_user_public_table_jobs/down.yaml new file mode 100644 index 000000000..8910ace88 --- /dev/null +++ b/hasura/migrations/1580346914307_update_permission_user_public_table_jobs/down.yaml @@ -0,0 +1,233 @@ +- args: + role: user + table: + name: jobs + schema: public + type: drop_update_permission +- args: + permission: + columns: + - converted + - inproduction + - special_coverage_policy + - theft_ind + - tlos_ind + - asgn_date + - invoice_date + - loss_date + - pay_date + - kmin + - kmout + - est_number + - area_of_damage + - adjustment_bottom_line + - claim_total + - clm_total + - ded_amt + - deductible + - depreciation_taxes + - federal_tax_payable + - federal_tax_rate + - local_tax_rate + - other_amount_payable + - owner_owing + - pay_amt + - 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 + - storage_payable + - towing_payable + - agt_addr1 + - agt_addr2 + - agt_city + - agt_co_id + - agt_co_nm + - agt_ct_fn + - agt_ct_ln + - agt_ct_ph + - agt_ct_phx + - agt_ctry + - agt_ea + - agt_fax + - agt_faxx + - agt_lic_no + - agt_ph1 + - agt_ph1x + - agt_ph2 + - agt_ph2x + - agt_st + - agt_zip + - asgn_no + - asgn_type + - cat_no + - ciecaid + - clm_addr1 + - clm_addr2 + - clm_city + - clm_ct_fn + - clm_ct_ln + - clm_ct_ph + - clm_ct_phx + - clm_ctry + - clm_ea + - clm_fax + - clm_faxx + - clm_no + - clm_ofc_id + - clm_ofc_nm + - clm_ph1 + - clm_ph1x + - clm_ph2 + - clm_ph2x + - clm_st + - clm_title + - clm_zip + - csr + - cust_pr + - ded_status + - est_addr1 + - est_addr2 + - est_city + - est_co_nm + - est_ct_fn + - est_ct_ln + - est_ctry + - est_ea + - est_ph1 + - est_st + - est_zip + - ins_addr1 + - ins_addr2 + - ins_city + - ins_co_id + - ins_co_nm + - ins_ct_fn + - ins_ct_ln + - ins_ct_ph + - ins_ct_phx + - ins_ctry + - insd_addr1 + - insd_addr2 + - insd_city + - insd_co_nm + - insd_ctry + - insd_ea + - insd_fax + - insd_faxx + - insd_fn + - insd_ln + - insd_ph1 + - insd_ph1x + - insd_ph2 + - insd_ph2x + - insd_st + - insd_title + - insd_zip + - ins_ea + - ins_fax + - ins_faxx + - ins_memo + - ins_ph1 + - ins_ph1x + - ins_ph2 + - ins_ph2x + - ins_st + - ins_title + - ins_zip + - labor_rate_desc + - labor_rate_id + - loss_cat + - loss_desc + - loss_type + - ownr_addr1 + - ownr_addr2 + - ownr_city + - ownr_co_nm + - ownr_ctry + - ownr_ea + - ownr_fax + - ownr_faxx + - ownr_fn + - ownr_ln + - ownr_ph1 + - ownr_ph1x + - ownr_ph2 + - ownr_ph2x + - ownr_st + - ownr_title + - ownr_zip + - pay_chknm + - payee_nms + - pay_type + - policy_no + - po_number + - referral_source + - regie_number + - ro_number + - selling_dealer + - selling_dealer_contact + - service_car + - servicing_dealer + - servicing_dealer_contact + - unit_number + - actual_completion + - actual_delivery + - actual_in + - created_at + - date_closed + - date_estimated + - date_exported + - date_invoiced + - date_open + - date_scheduled + - scheduled_completion + - scheduled_delivery + - scheduled_in + - updated_at + - id + - ownerid + - shopid + - statusid + - vehicleid + - tax_pstthr + - tax_sub_rt + - tax_tow_rt + 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 diff --git a/hasura/migrations/1580346914307_update_permission_user_public_table_jobs/up.yaml b/hasura/migrations/1580346914307_update_permission_user_public_table_jobs/up.yaml new file mode 100644 index 000000000..7d2fcd6cc --- /dev/null +++ b/hasura/migrations/1580346914307_update_permission_user_public_table_jobs/up.yaml @@ -0,0 +1,235 @@ +- args: + role: user + table: + name: jobs + schema: public + type: drop_update_permission +- args: + permission: + columns: + - converted + - inproduction + - special_coverage_policy + - theft_ind + - tlos_ind + - asgn_date + - invoice_date + - loss_date + - pay_date + - kmin + - kmout + - est_number + - area_of_damage + - adjustment_bottom_line + - claim_total + - clm_total + - ded_amt + - deductible + - depreciation_taxes + - federal_tax_payable + - federal_tax_rate + - local_tax_rate + - other_amount_payable + - owner_owing + - pay_amt + - 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 + - storage_payable + - tax_levies_rt + - tax_paint_mat_rt + - towing_payable + - agt_addr1 + - agt_addr2 + - agt_city + - agt_co_id + - agt_co_nm + - agt_ct_fn + - agt_ct_ln + - agt_ct_ph + - agt_ct_phx + - agt_ctry + - agt_ea + - agt_fax + - agt_faxx + - agt_lic_no + - agt_ph1 + - agt_ph1x + - agt_ph2 + - agt_ph2x + - agt_st + - agt_zip + - asgn_no + - asgn_type + - cat_no + - ciecaid + - clm_addr1 + - clm_addr2 + - clm_city + - clm_ct_fn + - clm_ct_ln + - clm_ct_ph + - clm_ct_phx + - clm_ctry + - clm_ea + - clm_fax + - clm_faxx + - clm_no + - clm_ofc_id + - clm_ofc_nm + - clm_ph1 + - clm_ph1x + - clm_ph2 + - clm_ph2x + - clm_st + - clm_title + - clm_zip + - csr + - cust_pr + - ded_status + - est_addr1 + - est_addr2 + - est_city + - est_co_nm + - est_ct_fn + - est_ct_ln + - est_ctry + - est_ea + - est_ph1 + - est_st + - est_zip + - ins_addr1 + - ins_addr2 + - ins_city + - ins_co_id + - ins_co_nm + - ins_ct_fn + - ins_ct_ln + - ins_ct_ph + - ins_ct_phx + - ins_ctry + - insd_addr1 + - insd_addr2 + - insd_city + - insd_co_nm + - insd_ctry + - insd_ea + - insd_fax + - insd_faxx + - insd_fn + - insd_ln + - insd_ph1 + - insd_ph1x + - insd_ph2 + - insd_ph2x + - insd_st + - insd_title + - insd_zip + - ins_ea + - ins_fax + - ins_faxx + - ins_memo + - ins_ph1 + - ins_ph1x + - ins_ph2 + - ins_ph2x + - ins_st + - ins_title + - ins_zip + - labor_rate_desc + - labor_rate_id + - loss_cat + - loss_desc + - loss_type + - ownr_addr1 + - ownr_addr2 + - ownr_city + - ownr_co_nm + - ownr_ctry + - ownr_ea + - ownr_fax + - ownr_faxx + - ownr_fn + - ownr_ln + - ownr_ph1 + - ownr_ph1x + - ownr_ph2 + - ownr_ph2x + - ownr_st + - ownr_title + - ownr_zip + - pay_chknm + - payee_nms + - pay_type + - policy_no + - po_number + - referral_source + - regie_number + - ro_number + - selling_dealer + - selling_dealer_contact + - service_car + - servicing_dealer + - servicing_dealer_contact + - unit_number + - actual_completion + - actual_delivery + - actual_in + - created_at + - date_closed + - date_estimated + - date_exported + - date_invoiced + - date_open + - date_scheduled + - scheduled_completion + - scheduled_delivery + - scheduled_in + - updated_at + - id + - ownerid + - shopid + - statusid + - vehicleid + - tax_pstthr + - tax_sub_rt + - tax_tow_rt + 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 diff --git a/hasura/migrations/1580356194265_alter_line_ref/down.yaml b/hasura/migrations/1580356194265_alter_line_ref/down.yaml new file mode 100644 index 000000000..fe51488c7 --- /dev/null +++ b/hasura/migrations/1580356194265_alter_line_ref/down.yaml @@ -0,0 +1 @@ +[] diff --git a/hasura/migrations/1580356194265_alter_line_ref/up.yaml b/hasura/migrations/1580356194265_alter_line_ref/up.yaml new file mode 100644 index 000000000..94d6095ee --- /dev/null +++ b/hasura/migrations/1580356194265_alter_line_ref/up.yaml @@ -0,0 +1,7 @@ +- args: + cascade: true + sql: "ALTER TABLE joblines ALTER COLUMN line_ref DROP DEFAULT;\r\nALTER TABLE + joblines\r\n ALTER line_ref TYPE numeric USING CASE WHEN true THEN 0 ELSE + 0 END;\r\n \r\n ALTER\r\n TABLE joblines ALTER COLUMN line_ref + SET DEFAULT 0;" + type: run_sql diff --git a/hasura/migrations/1580356212983_alter_table_public_joblines_alter_column_line_ref/down.yaml b/hasura/migrations/1580356212983_alter_table_public_joblines_alter_column_line_ref/down.yaml new file mode 100644 index 000000000..53fa55d89 --- /dev/null +++ b/hasura/migrations/1580356212983_alter_table_public_joblines_alter_column_line_ref/down.yaml @@ -0,0 +1,6 @@ +- args: + sql: ALTER TABLE "public"."joblines" ALTER COLUMN "line_ref" SET DEFAULT 0; + type: run_sql +- args: + sql: COMMENT ON COLUMN "public"."joblines"."line_ref" IS E'null' + type: run_sql diff --git a/hasura/migrations/1580356212983_alter_table_public_joblines_alter_column_line_ref/up.yaml b/hasura/migrations/1580356212983_alter_table_public_joblines_alter_column_line_ref/up.yaml new file mode 100644 index 000000000..1de071e2f --- /dev/null +++ b/hasura/migrations/1580356212983_alter_table_public_joblines_alter_column_line_ref/up.yaml @@ -0,0 +1,6 @@ +- args: + sql: ALTER TABLE "public"."joblines" ALTER COLUMN "line_ref" DROP DEFAULT; + type: run_sql +- args: + sql: COMMENT ON COLUMN "public"."joblines"."line_ref" IS E'' + type: run_sql