diff --git a/bodyshop_translations.babel b/bodyshop_translations.babel index a978d8765..d0c55020b 100644 --- a/bodyshop_translations.babel +++ b/bodyshop_translations.babel @@ -9403,6 +9403,48 @@ + + employee_body + false + + + + + + en-US + false + + + es-MX + false + + + fr-CA + false + + + + + employee_refinish + false + + + + + + en-US + false + + + es-MX + false + + + fr-CA + false + + + est_addr1 false @@ -12216,6 +12258,27 @@ + + employeeassignments + false + + + + + + en-US + false + + + es-MX + false + + + fr-CA + false + + + existing_jobs false diff --git a/client/src/components/job-detail-lines/job-lines.component.jsx b/client/src/components/job-detail-lines/job-lines.component.jsx index d6569f064..734b5e9ac 100644 --- a/client/src/components/job-detail-lines/job-lines.component.jsx +++ b/client/src/components/job-detail-lines/job-lines.component.jsx @@ -8,9 +8,9 @@ import { setModalContext } from "../../redux/modals/modals.actions"; import { onlyUnique } from "../../utils/arrayHelper"; import CurrencyFormatter from "../../utils/CurrencyFormatter"; import { alphaSort } from "../../utils/sorters"; -import AllocationsAssignmentContainer from "../allocations-assignment/allocations-assignment.container"; -import AllocationsBulkAssignmentContainer from "../allocations-bulk-assignment/allocations-bulk-assignment.container"; -import AllocationsEmployeeLabelContainer from "../allocations-employee-label/allocations-employee-label.container"; +// import AllocationsAssignmentContainer from "../allocations-assignment/allocations-assignment.container"; +// import AllocationsBulkAssignmentContainer from "../allocations-bulk-assignment/allocations-bulk-assignment.container"; +// import AllocationsEmployeeLabelContainer from "../allocations-employee-label/allocations-employee-label.container"; import PartsOrderModalContainer from "../parts-order-modal/parts-order-modal.container"; const mapDispatchToProps = (dispatch) => ({ @@ -173,35 +173,35 @@ export function JobLinesComponent({ [], onFilter: (value, record) => value.includes(record.status), }, - { - title: t("allocations.fields.employee"), - dataIndex: "employee", - key: "employee", - sorter: (a, b) => - alphaSort( - a.allocations[0] && - a.allocations[0].employee.first_name + - a.allocations[0].employee.last_name, - b.allocations[0] && - b.allocations[0].employee.first_name + - b.allocations[0].employee.last_name - ), - sortOrder: - state.sortedInfo.columnKey === "employee" && state.sortedInfo.order, - render: (text, record) => ( - - {record.allocations && record.allocations.length > 0 - ? record.allocations.map((item) => ( - - )) - : null} - - ), - }, + // { + // title: t("allocations.fields.employee"), + // dataIndex: "employee", + // key: "employee", + // sorter: (a, b) => + // alphaSort( + // a.allocations[0] && + // a.allocations[0].employee.first_name + + // a.allocations[0].employee.last_name, + // b.allocations[0] && + // b.allocations[0].employee.first_name + + // b.allocations[0].employee.last_name + // ), + // sortOrder: + // state.sortedInfo.columnKey === "employee" && state.sortedInfo.order, + // render: (text, record) => ( + // + // {record.allocations && record.allocations.length > 0 + // ? record.allocations.map((item) => ( + // + // )) + // : null} + // + // ), + // }, { title: t("general.labels.actions"), dataIndex: "actions", @@ -217,12 +217,14 @@ export function JobLinesComponent({ }}> {t("general.actions.edit")} - + { + // + } ), }, @@ -278,10 +280,12 @@ export function JobLinesComponent({ {t("jobs.actions.mark")} - + { + // + } { setJobLineEditContext({ diff --git a/client/src/components/job-employee-assignments/job-employee-assignments.component.jsx b/client/src/components/job-employee-assignments/job-employee-assignments.component.jsx new file mode 100644 index 000000000..7c5ca4c0e --- /dev/null +++ b/client/src/components/job-employee-assignments/job-employee-assignments.component.jsx @@ -0,0 +1,112 @@ +import React, { useState } from "react"; +import DataLabel from "../data-label/data-label.component"; +import { useTranslation } from "react-i18next"; +import { PlusCircleFilled, MinusOutlined } from "@ant-design/icons"; +import { Select, Button, Popover } from "antd"; +import { connect } from "react-redux"; +import { createStructuredSelector } from "reselect"; +import { selectBodyshop } from "../../redux/user/user.selectors"; +const mapStateToProps = createStructuredSelector({ + bodyshop: selectBodyshop, +}); +const mapDispatchToProps = (dispatch) => ({ + //setUserLanguage: language => dispatch(setUserLanguage(language)) +}); + +export function JobEmployeeAssignments({ + bodyshop, + body, + refinish, + handleAdd, + handleRemove, +}) { + const { t } = useTranslation(); + const [assignment, setAssignment] = useState({ + operation: null, + employeeid: null, + }); + const [visibility, setVisibility] = useState(false); + + const onChange = (e) => { + setAssignment({ ...assignment, employeeid: e }); + }; + + const popContent = ( + + + option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0 + }> + {bodyshop.employees.map((emp) => ( + + {`${emp.first_name} ${emp.last_name}`} + + ))} + + { + handleAdd(assignment); + setVisibility(false); + }}> + Assign + + setVisibility(false)}>Close + + ); + + return ( + + + + {body ? ( + + {`${body.first_name || ""} ${body.last_name || ""}`} + handleRemove("body")} + /> + + ) : ( + { + setAssignment({ operation: "body" }); + setVisibility(true); + }} + /> + )} + + + {refinish ? ( + + {`${refinish.first_name || ""} ${ + refinish.last_name || "" + }`} + handleRemove("refinish")} + /> + + ) : ( + { + setAssignment({ operation: "refinish" }); + setVisibility(true); + }} + /> + )} + + + + ); +} +export default connect( + mapStateToProps, + mapDispatchToProps +)(JobEmployeeAssignments); diff --git a/client/src/components/job-employee-assignments/job-employee-assignments.container.jsx b/client/src/components/job-employee-assignments/job-employee-assignments.container.jsx new file mode 100644 index 000000000..eec5f0080 --- /dev/null +++ b/client/src/components/job-employee-assignments/job-employee-assignments.container.jsx @@ -0,0 +1,70 @@ +import { useMutation } from "@apollo/react-hooks"; +import { notification } from "antd"; +import React from "react"; +import { useTranslation } from "react-i18next"; +import { UPDATE_JOB } from "../../graphql/jobs.queries"; +import JobEmployeeAssignmentsComponent from "./job-employee-assignments.component"; + +export default function JobEmployeeAssignmentsContainer({ job }) { + const { t } = useTranslation(); + const [updateJob] = useMutation(UPDATE_JOB); + + const handleAdd = async (assignment) => { + const { operation, employeeid } = assignment; + + let empAssignment = determineFieldName(operation); + + const result = await updateJob({ + variables: { jobId: job.id, job: { [empAssignment]: employeeid } }, + refetchQueries: ["GET_JOB_BY_PK"], + awaitRefetchQueries: true, + }); + + if (!!result.errors) { + notification["error"]({ + message: t("jobs.errors.assigning", { + message: JSON.stringify(result.errors), + }), + }); + } + }; + const handleRemove = async (operation) => { + console.log("handleRemove -> operation", operation); + let empAssignment = determineFieldName(operation); + const result = await updateJob({ + variables: { jobId: job.id, job: { [empAssignment]: null } }, + refetchQueries: ["GET_JOB_BY_PK"], + awaitRefetchQueries: true, + }); + + if (!!result.errors) { + notification["error"]({ + message: t("jobs.errors.assigning", { + message: JSON.stringify(result.errors), + }), + }); + } + }; + + return ( + + + + ); +} + +const determineFieldName = (operation) => { + switch (operation) { + case "body": + return "employee_body"; + break; + case "refinish": + return "employee_refinish"; + break; + } +}; 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 4bc40e2b0..3904127fa 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 @@ -7,7 +7,7 @@ import { Menu, notification, PageHeader, - Tag + Tag, } from "antd"; import React from "react"; import { useTranslation } from "react-i18next"; @@ -21,6 +21,7 @@ import CurrencyFormatter from "../../utils/CurrencyFormatter"; import JobsDetailHeaderActions from "../jobs-detail-header-actions/jobs-detail-header-actions.component"; import OwnerTagPopoverComponent from "../owner-tag-popover/owner-tag-popover.component"; import VehicleTagPopoverComponent from "../vehicle-tag-popover/vehicle-tag-popover.component"; +import JobEmployeeAssignments from "../job-employee-assignments/job-employee-assignments.container"; import "./jobs-detail-header.styles.scss"; const mapStateToProps = createStructuredSelector({ @@ -130,7 +131,9 @@ export function JobsDetailHeader({ , ]} extra={menuExtra}> - + {job.clm_total} @@ -165,6 +168,11 @@ export function JobsDetailHeader({ ))} + + + ); diff --git a/client/src/graphql/jobs-lines.queries.js b/client/src/graphql/jobs-lines.queries.js index d72dca82e..892ec6708 100644 --- a/client/src/graphql/jobs-lines.queries.js +++ b/client/src/graphql/jobs-lines.queries.js @@ -33,15 +33,6 @@ export const GET_JOB_LINES_BY_PK = gql` } } } - allocations { - id - hours - employee { - id - first_name - last_name - } - } } } `; diff --git a/client/src/graphql/jobs.queries.js b/client/src/graphql/jobs.queries.js index d633762c4..fe87986e8 100644 --- a/client/src/graphql/jobs.queries.js +++ b/client/src/graphql/jobs.queries.js @@ -75,6 +75,16 @@ export const QUERY_JOBS_IN_PRODUCTION = gql` production_vars labhrs larhrs + employee_body_rel { + id + first_name + last_name + } + employee_refinish_rel { + id + first_name + last_name + } } } `; @@ -106,6 +116,16 @@ export const SUBSCRIPTION_JOBS_IN_PRODUCTION = gql` larhrs partcount kanbanparent + employee_body_rel { + id + first_name + last_name + } + employee_refinish_rel { + id + first_name + last_name + } } } `; @@ -114,6 +134,16 @@ export const GET_JOB_BY_PK = gql` query GET_JOB_BY_PK($id: uuid!) { jobs_by_pk(id: $id) { updated_at + employee_body_rel { + id + first_name + last_name + } + employee_refinish_rel { + id + first_name + last_name + } csr loss_desc kmin @@ -295,6 +325,8 @@ export const QUERY_JOB_CARD_DETAILS = gql` query QUERY_JOB_CARD_DETAILS($id: uuid!) { jobs_by_pk(id: $id) { ownr_fn + employee_body + employee_refinish ownr_ln ownr_ph1 ownr_ea @@ -401,6 +433,8 @@ export const QUERY_TECH_JOB_DETAILS = gql` date_closed date_scheduled date_estimated + employee_body + employee_refinish joblines { id unq_seq @@ -763,6 +797,8 @@ export const QUERY_ALL_JOB_FIELDS = gql` status tax_part unq_seq + employee_body + employee_refinish } } } @@ -828,8 +864,6 @@ export const QUERY_ALL_JOBS_PAGINATED = gql` } `; - - export const QUERY_JOB_CLOSE_DETAILS = gql` query QUERY_JOB_CLOSE_DETAILS($id: uuid!) { jobs_by_pk(id: $id) { diff --git a/client/src/translations/en_us/common.json b/client/src/translations/en_us/common.json index 702675463..6c959ee4b 100644 --- a/client/src/translations/en_us/common.json +++ b/client/src/translations/en_us/common.json @@ -616,6 +616,8 @@ "ded_amt": "Deductible", "ded_status": "Deductible Status", "depreciation_taxes": "Depreciation/Taxes", + "employee_body": "Body", + "employee_refinish": "Refinish", "est_addr1": "Appraiser Address", "est_co_nm": "Appraiser", "est_ct_fn": "Appraiser First Name", @@ -757,6 +759,7 @@ "difference": "Difference", "documents": "Documents", "duplicateconfirm": "Are you sure you want to duplicate this job? Some elements of this job will not be duplicated.", + "employeeassignments": "Employee Assignments", "existing_jobs": "Existing Jobs", "federal_tax_amt": "Federal Taxes", "hrs_claimed": "Hours Claimed", diff --git a/client/src/translations/es/common.json b/client/src/translations/es/common.json index 369cff5f1..4ddd5c446 100644 --- a/client/src/translations/es/common.json +++ b/client/src/translations/es/common.json @@ -616,6 +616,8 @@ "ded_amt": "Deducible", "ded_status": "Estado deducible", "depreciation_taxes": "Depreciación / Impuestos", + "employee_body": "", + "employee_refinish": "", "est_addr1": "Dirección del tasador", "est_co_nm": "Tasador", "est_ct_fn": "Nombre del tasador", @@ -757,6 +759,7 @@ "difference": "", "documents": "documentos", "duplicateconfirm": "", + "employeeassignments": "", "existing_jobs": "Empleos existentes", "federal_tax_amt": "", "hrs_claimed": "", diff --git a/client/src/translations/fr/common.json b/client/src/translations/fr/common.json index 3bb646697..0946f8184 100644 --- a/client/src/translations/fr/common.json +++ b/client/src/translations/fr/common.json @@ -616,6 +616,8 @@ "ded_amt": "Déductible", "ded_status": "Statut de franchise", "depreciation_taxes": "Amortissement / taxes", + "employee_body": "", + "employee_refinish": "", "est_addr1": "Adresse de l'évaluateur", "est_co_nm": "Expert", "est_ct_fn": "Prénom de l'évaluateur", @@ -757,6 +759,7 @@ "difference": "", "documents": "Les documents", "duplicateconfirm": "", + "employeeassignments": "", "existing_jobs": "Emplois existants", "federal_tax_amt": "", "hrs_claimed": "", diff --git a/hasura/migrations/1594921658592_alter_table_public_jobs_add_column_employee_body/down.yaml b/hasura/migrations/1594921658592_alter_table_public_jobs_add_column_employee_body/down.yaml new file mode 100644 index 000000000..82630d41b --- /dev/null +++ b/hasura/migrations/1594921658592_alter_table_public_jobs_add_column_employee_body/down.yaml @@ -0,0 +1,5 @@ +- args: + cascade: false + read_only: false + sql: ALTER TABLE "public"."jobs" DROP COLUMN "employee_body"; + type: run_sql diff --git a/hasura/migrations/1594921658592_alter_table_public_jobs_add_column_employee_body/up.yaml b/hasura/migrations/1594921658592_alter_table_public_jobs_add_column_employee_body/up.yaml new file mode 100644 index 000000000..40e980024 --- /dev/null +++ b/hasura/migrations/1594921658592_alter_table_public_jobs_add_column_employee_body/up.yaml @@ -0,0 +1,5 @@ +- args: + cascade: false + read_only: false + sql: ALTER TABLE "public"."jobs" ADD COLUMN "employee_body" uuid NULL; + type: run_sql diff --git a/hasura/migrations/1594921667947_alter_table_public_jobs_add_column_employee_refinish/down.yaml b/hasura/migrations/1594921667947_alter_table_public_jobs_add_column_employee_refinish/down.yaml new file mode 100644 index 000000000..bb1d0e1b9 --- /dev/null +++ b/hasura/migrations/1594921667947_alter_table_public_jobs_add_column_employee_refinish/down.yaml @@ -0,0 +1,5 @@ +- args: + cascade: false + read_only: false + sql: ALTER TABLE "public"."jobs" DROP COLUMN "employee_refinish"; + type: run_sql diff --git a/hasura/migrations/1594921667947_alter_table_public_jobs_add_column_employee_refinish/up.yaml b/hasura/migrations/1594921667947_alter_table_public_jobs_add_column_employee_refinish/up.yaml new file mode 100644 index 000000000..cf89fdb9b --- /dev/null +++ b/hasura/migrations/1594921667947_alter_table_public_jobs_add_column_employee_refinish/up.yaml @@ -0,0 +1,5 @@ +- args: + cascade: false + read_only: false + sql: ALTER TABLE "public"."jobs" ADD COLUMN "employee_refinish" uuid NULL; + type: run_sql diff --git a/hasura/migrations/1594921687862_set_fk_public_jobs_employee_body/down.yaml b/hasura/migrations/1594921687862_set_fk_public_jobs_employee_body/down.yaml new file mode 100644 index 000000000..d49240e28 --- /dev/null +++ b/hasura/migrations/1594921687862_set_fk_public_jobs_employee_body/down.yaml @@ -0,0 +1,5 @@ +- args: + cascade: false + read_only: false + sql: alter table "public"."jobs" drop constraint "jobs_employee_body_fkey"; + type: run_sql diff --git a/hasura/migrations/1594921687862_set_fk_public_jobs_employee_body/up.yaml b/hasura/migrations/1594921687862_set_fk_public_jobs_employee_body/up.yaml new file mode 100644 index 000000000..b175a8faa --- /dev/null +++ b/hasura/migrations/1594921687862_set_fk_public_jobs_employee_body/up.yaml @@ -0,0 +1,10 @@ +- args: + cascade: false + read_only: false + sql: |- + alter table "public"."jobs" + add constraint "jobs_employee_body_fkey" + foreign key ("employee_body") + references "public"."employees" + ("id") on update set null on delete set null; + type: run_sql diff --git a/hasura/migrations/1594921705289_set_fk_public_jobs_employee_refinish/down.yaml b/hasura/migrations/1594921705289_set_fk_public_jobs_employee_refinish/down.yaml new file mode 100644 index 000000000..2b23b593c --- /dev/null +++ b/hasura/migrations/1594921705289_set_fk_public_jobs_employee_refinish/down.yaml @@ -0,0 +1,5 @@ +- args: + cascade: false + read_only: false + sql: alter table "public"."jobs" drop constraint "jobs_employee_refinish_fkey"; + type: run_sql diff --git a/hasura/migrations/1594921705289_set_fk_public_jobs_employee_refinish/up.yaml b/hasura/migrations/1594921705289_set_fk_public_jobs_employee_refinish/up.yaml new file mode 100644 index 000000000..6b00138db --- /dev/null +++ b/hasura/migrations/1594921705289_set_fk_public_jobs_employee_refinish/up.yaml @@ -0,0 +1,10 @@ +- args: + cascade: false + read_only: false + sql: |- + alter table "public"."jobs" + add constraint "jobs_employee_refinish_fkey" + foreign key ("employee_refinish") + references "public"."employees" + ("id") on update set null on delete set null; + type: run_sql diff --git a/hasura/migrations/1594921899352_track_all_relationships/down.yaml b/hasura/migrations/1594921899352_track_all_relationships/down.yaml new file mode 100644 index 000000000..448bee39c --- /dev/null +++ b/hasura/migrations/1594921899352_track_all_relationships/down.yaml @@ -0,0 +1,24 @@ +- args: + relationship: employee + table: + name: jobs + schema: public + type: drop_relationship +- args: + relationship: employeeByEmployeeBody + table: + name: jobs + schema: public + type: drop_relationship +- args: + relationship: jobs + table: + name: employees + schema: public + type: drop_relationship +- args: + relationship: jobsByEmployeeRefinish + table: + name: employees + schema: public + type: drop_relationship diff --git a/hasura/migrations/1594921899352_track_all_relationships/up.yaml b/hasura/migrations/1594921899352_track_all_relationships/up.yaml new file mode 100644 index 000000000..a5f7a2c41 --- /dev/null +++ b/hasura/migrations/1594921899352_track_all_relationships/up.yaml @@ -0,0 +1,40 @@ +- args: + name: employee + table: + name: jobs + schema: public + using: + foreign_key_constraint_on: employee_refinish + type: create_object_relationship +- args: + name: employeeByEmployeeBody + table: + name: jobs + schema: public + using: + foreign_key_constraint_on: employee_body + type: create_object_relationship +- args: + name: jobs + table: + name: employees + schema: public + using: + foreign_key_constraint_on: + column: employee_body + table: + name: jobs + schema: public + type: create_array_relationship +- args: + name: jobsByEmployeeRefinish + table: + name: employees + schema: public + using: + foreign_key_constraint_on: + column: employee_refinish + table: + name: jobs + schema: public + type: create_array_relationship diff --git a/hasura/migrations/1594923683074_update_permission_user_public_table_jobs/down.yaml b/hasura/migrations/1594923683074_update_permission_user_public_table_jobs/down.yaml new file mode 100644 index 000000000..8aa9cc00c --- /dev/null +++ b/hasura/migrations/1594923683074_update_permission_user_public_table_jobs/down.yaml @@ -0,0 +1,255 @@ +- args: + role: user + table: + name: jobs + schema: public + type: drop_insert_permission +- args: + permission: + check: + bodyshop: + associations: + _and: + - user: + authid: + _eq: X-Hasura-User-Id + - active: + _eq: true + columns: + - actual_completion + - actual_delivery + - actual_in + - adj_g_disc + - adj_strdis + - adj_towdis + - adjustment_bottom_line + - 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 + - area_of_damage + - asgn_date + - asgn_no + - asgn_type + - cat_no + - cieca_stl + - cieca_ttl + - 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_total + - clm_zip + - converted + - created_at + - csr + - cust_pr + - date_closed + - date_estimated + - date_exported + - date_invoiced + - date_open + - date_scheduled + - ded_amt + - ded_status + - depreciation_taxes + - est_addr1 + - est_addr2 + - est_city + - est_co_nm + - est_ct_fn + - est_ct_ln + - est_ctry + - est_ea + - est_number + - est_ph1 + - est_st + - est_zip + - federal_tax_payable + - federal_tax_rate + - g_bett_amt + - id + - inproduction + - 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 + - ins_ea + - ins_fax + - ins_faxx + - ins_memo + - ins_ph1 + - ins_ph1x + - ins_ph2 + - ins_ph2x + - ins_st + - ins_title + - ins_zip + - 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 + - intakechecklist + - invoice_allocation + - invoice_date + - job_totals + - kanbanparent + - kmin + - kmout + - labor_rate_desc + - labor_rate_id + - local_tax_rate + - loss_cat + - loss_date + - loss_desc + - loss_type + - other_amount_payable + - owner_owing + - ownerid + - 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 + - parts_tax_rates + - pay_amt + - pay_chknm + - pay_date + - pay_type + - payee_nms + - plate_no + - plate_st + - po_number + - policy_no + - production_vars + - rate_atp + - rate_la1 + - rate_la2 + - rate_la3 + - rate_la4 + - rate_laa + - 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 + - referral_source + - regie_number + - ro_number + - scheduled_completion + - scheduled_delivery + - scheduled_in + - selling_dealer + - selling_dealer_contact + - servicing_dealer + - servicing_dealer_contact + - shopid + - special_coverage_policy + - state_tax_rate + - status + - statusid + - storage_payable + - tax_lbr_rt + - tax_levies_rt + - tax_paint_mat_rt + - tax_predis + - tax_prethr + - tax_pstthr + - tax_str_rt + - tax_sub_rt + - tax_thramt + - tax_tow_rt + - theft_ind + - tlos_ind + - towing_payable + - unit_number + - updated_at + - v_color + - v_make_desc + - v_model_desc + - v_model_yr + - v_vin + - vehicleid + set: {} + role: user + table: + name: jobs + schema: public + type: create_insert_permission diff --git a/hasura/migrations/1594923683074_update_permission_user_public_table_jobs/up.yaml b/hasura/migrations/1594923683074_update_permission_user_public_table_jobs/up.yaml new file mode 100644 index 000000000..0178be5a6 --- /dev/null +++ b/hasura/migrations/1594923683074_update_permission_user_public_table_jobs/up.yaml @@ -0,0 +1,257 @@ +- args: + role: user + table: + name: jobs + schema: public + type: drop_insert_permission +- args: + permission: + check: + bodyshop: + associations: + _and: + - user: + authid: + _eq: X-Hasura-User-Id + - active: + _eq: true + columns: + - actual_completion + - actual_delivery + - actual_in + - adj_g_disc + - adj_strdis + - adj_towdis + - adjustment_bottom_line + - 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 + - area_of_damage + - asgn_date + - asgn_no + - asgn_type + - cat_no + - cieca_stl + - cieca_ttl + - 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_total + - clm_zip + - converted + - created_at + - csr + - cust_pr + - date_closed + - date_estimated + - date_exported + - date_invoiced + - date_open + - date_scheduled + - ded_amt + - ded_status + - depreciation_taxes + - employee_body + - employee_refinish + - est_addr1 + - est_addr2 + - est_city + - est_co_nm + - est_ct_fn + - est_ct_ln + - est_ctry + - est_ea + - est_number + - est_ph1 + - est_st + - est_zip + - federal_tax_payable + - federal_tax_rate + - g_bett_amt + - id + - inproduction + - 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 + - ins_ea + - ins_fax + - ins_faxx + - ins_memo + - ins_ph1 + - ins_ph1x + - ins_ph2 + - ins_ph2x + - ins_st + - ins_title + - ins_zip + - 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 + - intakechecklist + - invoice_allocation + - invoice_date + - job_totals + - kanbanparent + - kmin + - kmout + - labor_rate_desc + - labor_rate_id + - local_tax_rate + - loss_cat + - loss_date + - loss_desc + - loss_type + - other_amount_payable + - owner_owing + - ownerid + - 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 + - parts_tax_rates + - pay_amt + - pay_chknm + - pay_date + - pay_type + - payee_nms + - plate_no + - plate_st + - po_number + - policy_no + - production_vars + - rate_atp + - rate_la1 + - rate_la2 + - rate_la3 + - rate_la4 + - rate_laa + - 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 + - referral_source + - regie_number + - ro_number + - scheduled_completion + - scheduled_delivery + - scheduled_in + - selling_dealer + - selling_dealer_contact + - servicing_dealer + - servicing_dealer_contact + - shopid + - special_coverage_policy + - state_tax_rate + - status + - statusid + - storage_payable + - tax_lbr_rt + - tax_levies_rt + - tax_paint_mat_rt + - tax_predis + - tax_prethr + - tax_pstthr + - tax_str_rt + - tax_sub_rt + - tax_thramt + - tax_tow_rt + - theft_ind + - tlos_ind + - towing_payable + - unit_number + - updated_at + - v_color + - v_make_desc + - v_model_desc + - v_model_yr + - v_vin + - vehicleid + set: {} + role: user + table: + name: jobs + schema: public + type: create_insert_permission diff --git a/hasura/migrations/1594923695014_update_permission_user_public_table_jobs/down.yaml b/hasura/migrations/1594923695014_update_permission_user_public_table_jobs/down.yaml new file mode 100644 index 000000000..26e7035b1 --- /dev/null +++ b/hasura/migrations/1594923695014_update_permission_user_public_table_jobs/down.yaml @@ -0,0 +1,256 @@ +- args: + role: user + table: + name: jobs + schema: public + type: drop_select_permission +- args: + permission: + allow_aggregations: true + columns: + - actual_completion + - actual_delivery + - actual_in + - adj_g_disc + - adj_strdis + - adj_towdis + - adjustment_bottom_line + - 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 + - area_of_damage + - asgn_date + - asgn_no + - asgn_type + - cat_no + - cieca_stl + - cieca_ttl + - 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_total + - clm_zip + - converted + - created_at + - csr + - cust_pr + - date_closed + - date_estimated + - date_exported + - date_invoiced + - date_open + - date_scheduled + - ded_amt + - ded_status + - depreciation_taxes + - est_addr1 + - est_addr2 + - est_city + - est_co_nm + - est_ct_fn + - est_ct_ln + - est_ctry + - est_ea + - est_number + - est_ph1 + - est_st + - est_zip + - federal_tax_payable + - federal_tax_rate + - g_bett_amt + - id + - inproduction + - 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 + - ins_ea + - ins_fax + - ins_faxx + - ins_memo + - ins_ph1 + - ins_ph1x + - ins_ph2 + - ins_ph2x + - ins_st + - ins_title + - ins_zip + - 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 + - intakechecklist + - invoice_allocation + - invoice_date + - job_totals + - kanbanparent + - kmin + - kmout + - labor_rate_desc + - labor_rate_id + - local_tax_rate + - loss_cat + - loss_date + - loss_desc + - loss_type + - other_amount_payable + - owner_owing + - ownerid + - 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 + - parts_tax_rates + - pay_amt + - pay_chknm + - pay_date + - pay_type + - payee_nms + - plate_no + - plate_st + - po_number + - policy_no + - production_vars + - rate_atp + - rate_la1 + - rate_la2 + - rate_la3 + - rate_la4 + - rate_laa + - 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 + - referral_source + - regie_number + - ro_number + - scheduled_completion + - scheduled_delivery + - scheduled_in + - selling_dealer + - selling_dealer_contact + - servicing_dealer + - servicing_dealer_contact + - shopid + - special_coverage_policy + - state_tax_rate + - status + - statusid + - storage_payable + - tax_lbr_rt + - tax_levies_rt + - tax_paint_mat_rt + - tax_predis + - tax_prethr + - tax_pstthr + - tax_str_rt + - tax_sub_rt + - tax_thramt + - tax_tow_rt + - theft_ind + - tlos_ind + - towing_payable + - unit_number + - updated_at + - v_color + - v_make_desc + - v_model_desc + - v_model_yr + - v_vin + - 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/1594923695014_update_permission_user_public_table_jobs/up.yaml b/hasura/migrations/1594923695014_update_permission_user_public_table_jobs/up.yaml new file mode 100644 index 000000000..e157ffd56 --- /dev/null +++ b/hasura/migrations/1594923695014_update_permission_user_public_table_jobs/up.yaml @@ -0,0 +1,258 @@ +- args: + role: user + table: + name: jobs + schema: public + type: drop_select_permission +- args: + permission: + allow_aggregations: true + columns: + - actual_completion + - actual_delivery + - actual_in + - adj_g_disc + - adj_strdis + - adj_towdis + - adjustment_bottom_line + - 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 + - area_of_damage + - asgn_date + - asgn_no + - asgn_type + - cat_no + - cieca_stl + - cieca_ttl + - 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_total + - clm_zip + - converted + - created_at + - csr + - cust_pr + - date_closed + - date_estimated + - date_exported + - date_invoiced + - date_open + - date_scheduled + - ded_amt + - ded_status + - depreciation_taxes + - employee_body + - employee_refinish + - est_addr1 + - est_addr2 + - est_city + - est_co_nm + - est_ct_fn + - est_ct_ln + - est_ctry + - est_ea + - est_number + - est_ph1 + - est_st + - est_zip + - federal_tax_payable + - federal_tax_rate + - g_bett_amt + - id + - inproduction + - 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 + - ins_ea + - ins_fax + - ins_faxx + - ins_memo + - ins_ph1 + - ins_ph1x + - ins_ph2 + - ins_ph2x + - ins_st + - ins_title + - ins_zip + - 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 + - intakechecklist + - invoice_allocation + - invoice_date + - job_totals + - kanbanparent + - kmin + - kmout + - labor_rate_desc + - labor_rate_id + - local_tax_rate + - loss_cat + - loss_date + - loss_desc + - loss_type + - other_amount_payable + - owner_owing + - ownerid + - 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 + - parts_tax_rates + - pay_amt + - pay_chknm + - pay_date + - pay_type + - payee_nms + - plate_no + - plate_st + - po_number + - policy_no + - production_vars + - rate_atp + - rate_la1 + - rate_la2 + - rate_la3 + - rate_la4 + - rate_laa + - 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 + - referral_source + - regie_number + - ro_number + - scheduled_completion + - scheduled_delivery + - scheduled_in + - selling_dealer + - selling_dealer_contact + - servicing_dealer + - servicing_dealer_contact + - shopid + - special_coverage_policy + - state_tax_rate + - status + - statusid + - storage_payable + - tax_lbr_rt + - tax_levies_rt + - tax_paint_mat_rt + - tax_predis + - tax_prethr + - tax_pstthr + - tax_str_rt + - tax_sub_rt + - tax_thramt + - tax_tow_rt + - theft_ind + - tlos_ind + - towing_payable + - unit_number + - updated_at + - v_color + - v_make_desc + - v_model_desc + - v_model_yr + - v_vin + - 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/1594923702147_update_permission_user_public_table_jobs/down.yaml b/hasura/migrations/1594923702147_update_permission_user_public_table_jobs/down.yaml new file mode 100644 index 000000000..8d2013ec2 --- /dev/null +++ b/hasura/migrations/1594923702147_update_permission_user_public_table_jobs/down.yaml @@ -0,0 +1,255 @@ +- args: + role: user + table: + name: jobs + schema: public + type: drop_update_permission +- args: + permission: + columns: + - actual_completion + - actual_delivery + - actual_in + - adj_g_disc + - adj_strdis + - adj_towdis + - adjustment_bottom_line + - 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 + - area_of_damage + - asgn_date + - asgn_no + - asgn_type + - cat_no + - cieca_stl + - cieca_ttl + - 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_total + - clm_zip + - converted + - created_at + - csr + - cust_pr + - date_closed + - date_estimated + - date_exported + - date_invoiced + - date_open + - date_scheduled + - ded_amt + - ded_status + - depreciation_taxes + - est_addr1 + - est_addr2 + - est_city + - est_co_nm + - est_ct_fn + - est_ct_ln + - est_ctry + - est_ea + - est_number + - est_ph1 + - est_st + - est_zip + - federal_tax_payable + - federal_tax_rate + - g_bett_amt + - id + - inproduction + - 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 + - ins_ea + - ins_fax + - ins_faxx + - ins_memo + - ins_ph1 + - ins_ph1x + - ins_ph2 + - ins_ph2x + - ins_st + - ins_title + - ins_zip + - 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 + - intakechecklist + - invoice_allocation + - invoice_date + - job_totals + - kanbanparent + - kmin + - kmout + - labor_rate_desc + - labor_rate_id + - local_tax_rate + - loss_cat + - loss_date + - loss_desc + - loss_type + - other_amount_payable + - owner_owing + - ownerid + - 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 + - parts_tax_rates + - pay_amt + - pay_chknm + - pay_date + - pay_type + - payee_nms + - plate_no + - plate_st + - po_number + - policy_no + - production_vars + - rate_atp + - rate_la1 + - rate_la2 + - rate_la3 + - rate_la4 + - rate_laa + - 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 + - referral_source + - regie_number + - ro_number + - scheduled_completion + - scheduled_delivery + - scheduled_in + - selling_dealer + - selling_dealer_contact + - servicing_dealer + - servicing_dealer_contact + - shopid + - special_coverage_policy + - state_tax_rate + - status + - statusid + - storage_payable + - tax_lbr_rt + - tax_levies_rt + - tax_paint_mat_rt + - tax_predis + - tax_prethr + - tax_pstthr + - tax_str_rt + - tax_sub_rt + - tax_thramt + - tax_tow_rt + - theft_ind + - tlos_ind + - towing_payable + - unit_number + - updated_at + - v_color + - v_make_desc + - v_model_desc + - v_model_yr + - v_vin + - vehicleid + filter: + bodyshop: + associations: + _and: + - user: + authid: + _eq: X-Hasura-User-Id + - active: + _eq: true + set: {} + role: user + table: + name: jobs + schema: public + type: create_update_permission diff --git a/hasura/migrations/1594923702147_update_permission_user_public_table_jobs/up.yaml b/hasura/migrations/1594923702147_update_permission_user_public_table_jobs/up.yaml new file mode 100644 index 000000000..4e85e20cd --- /dev/null +++ b/hasura/migrations/1594923702147_update_permission_user_public_table_jobs/up.yaml @@ -0,0 +1,257 @@ +- args: + role: user + table: + name: jobs + schema: public + type: drop_update_permission +- args: + permission: + columns: + - actual_completion + - actual_delivery + - actual_in + - adj_g_disc + - adj_strdis + - adj_towdis + - adjustment_bottom_line + - 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 + - area_of_damage + - asgn_date + - asgn_no + - asgn_type + - cat_no + - cieca_stl + - cieca_ttl + - 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_total + - clm_zip + - converted + - created_at + - csr + - cust_pr + - date_closed + - date_estimated + - date_exported + - date_invoiced + - date_open + - date_scheduled + - ded_amt + - ded_status + - depreciation_taxes + - employee_body + - employee_refinish + - est_addr1 + - est_addr2 + - est_city + - est_co_nm + - est_ct_fn + - est_ct_ln + - est_ctry + - est_ea + - est_number + - est_ph1 + - est_st + - est_zip + - federal_tax_payable + - federal_tax_rate + - g_bett_amt + - id + - inproduction + - 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 + - ins_ea + - ins_fax + - ins_faxx + - ins_memo + - ins_ph1 + - ins_ph1x + - ins_ph2 + - ins_ph2x + - ins_st + - ins_title + - ins_zip + - 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 + - intakechecklist + - invoice_allocation + - invoice_date + - job_totals + - kanbanparent + - kmin + - kmout + - labor_rate_desc + - labor_rate_id + - local_tax_rate + - loss_cat + - loss_date + - loss_desc + - loss_type + - other_amount_payable + - owner_owing + - ownerid + - 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 + - parts_tax_rates + - pay_amt + - pay_chknm + - pay_date + - pay_type + - payee_nms + - plate_no + - plate_st + - po_number + - policy_no + - production_vars + - rate_atp + - rate_la1 + - rate_la2 + - rate_la3 + - rate_la4 + - rate_laa + - 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 + - referral_source + - regie_number + - ro_number + - scheduled_completion + - scheduled_delivery + - scheduled_in + - selling_dealer + - selling_dealer_contact + - servicing_dealer + - servicing_dealer_contact + - shopid + - special_coverage_policy + - state_tax_rate + - status + - statusid + - storage_payable + - tax_lbr_rt + - tax_levies_rt + - tax_paint_mat_rt + - tax_predis + - tax_prethr + - tax_pstthr + - tax_str_rt + - tax_sub_rt + - tax_thramt + - tax_tow_rt + - theft_ind + - tlos_ind + - towing_payable + - unit_number + - updated_at + - v_color + - v_make_desc + - v_model_desc + - v_model_yr + - v_vin + - vehicleid + filter: + bodyshop: + associations: + _and: + - user: + authid: + _eq: X-Hasura-User-Id + - active: + _eq: true + set: {} + role: user + table: + name: jobs + schema: public + type: create_update_permission diff --git a/hasura/migrations/1594925500847_rename_relationship_employee_to_employee_refinish_rel_schema_public_table_jobs/down.yaml b/hasura/migrations/1594925500847_rename_relationship_employee_to_employee_refinish_rel_schema_public_table_jobs/down.yaml new file mode 100644 index 000000000..31423f50b --- /dev/null +++ b/hasura/migrations/1594925500847_rename_relationship_employee_to_employee_refinish_rel_schema_public_table_jobs/down.yaml @@ -0,0 +1,7 @@ +- args: + name: employee_refinish_rel + new_name: employee + table: + name: jobs + schema: public + type: rename_relationship diff --git a/hasura/migrations/1594925500847_rename_relationship_employee_to_employee_refinish_rel_schema_public_table_jobs/up.yaml b/hasura/migrations/1594925500847_rename_relationship_employee_to_employee_refinish_rel_schema_public_table_jobs/up.yaml new file mode 100644 index 000000000..27fa63b3b --- /dev/null +++ b/hasura/migrations/1594925500847_rename_relationship_employee_to_employee_refinish_rel_schema_public_table_jobs/up.yaml @@ -0,0 +1,7 @@ +- args: + name: employee + new_name: employee_refinish_rel + table: + name: jobs + schema: public + type: rename_relationship diff --git a/hasura/migrations/1594925511356_rename_relationship_employeeByEmployeeBody_to_employee_body_rel_schema_public_table_jobs/down.yaml b/hasura/migrations/1594925511356_rename_relationship_employeeByEmployeeBody_to_employee_body_rel_schema_public_table_jobs/down.yaml new file mode 100644 index 000000000..1dcfe0459 --- /dev/null +++ b/hasura/migrations/1594925511356_rename_relationship_employeeByEmployeeBody_to_employee_body_rel_schema_public_table_jobs/down.yaml @@ -0,0 +1,7 @@ +- args: + name: employee_body_rel + new_name: employeeByEmployeeBody + table: + name: jobs + schema: public + type: rename_relationship diff --git a/hasura/migrations/1594925511356_rename_relationship_employeeByEmployeeBody_to_employee_body_rel_schema_public_table_jobs/up.yaml b/hasura/migrations/1594925511356_rename_relationship_employeeByEmployeeBody_to_employee_body_rel_schema_public_table_jobs/up.yaml new file mode 100644 index 000000000..74881e299 --- /dev/null +++ b/hasura/migrations/1594925511356_rename_relationship_employeeByEmployeeBody_to_employee_body_rel_schema_public_table_jobs/up.yaml @@ -0,0 +1,7 @@ +- args: + name: employeeByEmployeeBody + new_name: employee_body_rel + table: + name: jobs + schema: public + type: rename_relationship diff --git a/hasura/migrations/1594932730719_run_sql_migration/down.yaml b/hasura/migrations/1594932730719_run_sql_migration/down.yaml new file mode 100644 index 000000000..fe51488c7 --- /dev/null +++ b/hasura/migrations/1594932730719_run_sql_migration/down.yaml @@ -0,0 +1 @@ +[] diff --git a/hasura/migrations/1594932730719_run_sql_migration/up.yaml b/hasura/migrations/1594932730719_run_sql_migration/up.yaml new file mode 100644 index 000000000..7bc1377bd --- /dev/null +++ b/hasura/migrations/1594932730719_run_sql_migration/up.yaml @@ -0,0 +1,20 @@ +- args: + cascade: true + read_only: false + sql: "CREATE OR REPLACE VIEW \"public\".\"productionview\" AS \n SELECT j.id,\n + \ j.status,\n j.ro_number,\n j.est_number,\n j.ownr_fn,\n j.ownr_ln,\n + \ j.v_model_yr,\n j.v_model_desc,\n j.clm_no,\n j.v_make_desc,\n + \ j.v_color,\n j.plate_no,\n j.actual_in,\n j.scheduled_completion,\n + \ j.scheduled_delivery,\n j.ins_co_nm,\n j.clm_total,\n j.ownr_ph1,\n + \ j.special_coverage_policy,\n j.production_vars,\n lab.labhrs,\n lar.larhrs,\n + \ j.shopid,\n parts.partcount,\n j.kanbanparent,\n j.employee_body,\n + \ j.employee_refinish\n FROM (((jobs j\n LEFT JOIN ( SELECT l.jobid,\n + \ sum(l.mod_lb_hrs) AS labhrs\n FROM joblines l\n WHERE + (l.mod_lbr_ty = 'LAB'::text)\n GROUP BY l.jobid) lab ON ((lab.jobid + = j.id)))\n LEFT JOIN ( SELECT l2.jobid,\n sum(l2.mod_lb_hrs) + AS larhrs\n FROM joblines l2\n WHERE (l2.mod_lbr_ty = 'LAR'::text)\n + \ GROUP BY l2.jobid) lar ON ((lar.jobid = j.id)))\n LEFT JOIN ( + SELECT l3.jobid,\n json_agg(l3.status) AS partcount\n FROM + joblines l3\n WHERE (l3.part_type IS NOT NULL)\n GROUP BY + l3.jobid) parts ON ((parts.jobid = j.id)))\n WHERE (j.inproduction = true);" + type: run_sql diff --git a/hasura/migrations/1594932762413_create_relationship_employee_refinish_rel_public_table_productionview/down.yaml b/hasura/migrations/1594932762413_create_relationship_employee_refinish_rel_public_table_productionview/down.yaml new file mode 100644 index 000000000..e29526af1 --- /dev/null +++ b/hasura/migrations/1594932762413_create_relationship_employee_refinish_rel_public_table_productionview/down.yaml @@ -0,0 +1,6 @@ +- args: + relationship: employee_refinish_rel + table: + name: productionview + schema: public + type: drop_relationship diff --git a/hasura/migrations/1594932762413_create_relationship_employee_refinish_rel_public_table_productionview/up.yaml b/hasura/migrations/1594932762413_create_relationship_employee_refinish_rel_public_table_productionview/up.yaml new file mode 100644 index 000000000..5ee8b08b6 --- /dev/null +++ b/hasura/migrations/1594932762413_create_relationship_employee_refinish_rel_public_table_productionview/up.yaml @@ -0,0 +1,13 @@ +- args: + name: employee_refinish_rel + table: + name: productionview + schema: public + using: + manual_configuration: + column_mapping: + employee_refinish: id + remote_table: + name: employees + schema: public + type: create_object_relationship diff --git a/hasura/migrations/1594932786764_create_relationship_employee_body_rel_public_table_productionview/down.yaml b/hasura/migrations/1594932786764_create_relationship_employee_body_rel_public_table_productionview/down.yaml new file mode 100644 index 000000000..580a35af6 --- /dev/null +++ b/hasura/migrations/1594932786764_create_relationship_employee_body_rel_public_table_productionview/down.yaml @@ -0,0 +1,6 @@ +- args: + relationship: employee_body_rel + table: + name: productionview + schema: public + type: drop_relationship diff --git a/hasura/migrations/1594932786764_create_relationship_employee_body_rel_public_table_productionview/up.yaml b/hasura/migrations/1594932786764_create_relationship_employee_body_rel_public_table_productionview/up.yaml new file mode 100644 index 000000000..8a3bbec81 --- /dev/null +++ b/hasura/migrations/1594932786764_create_relationship_employee_body_rel_public_table_productionview/up.yaml @@ -0,0 +1,13 @@ +- args: + name: employee_body_rel + table: + name: productionview + schema: public + using: + manual_configuration: + column_mapping: + employee_body: id + remote_table: + name: employees + schema: public + type: create_object_relationship diff --git a/hasura/migrations/metadata.yaml b/hasura/migrations/metadata.yaml index f61352519..4e0a88851 100644 --- a/hasura/migrations/metadata.yaml +++ b/hasura/migrations/metadata.yaml @@ -1193,6 +1193,20 @@ tables: table: schema: public name: allocations + - name: jobs + using: + foreign_key_constraint_on: + column: employee_body + table: + schema: public + name: jobs + - name: jobsByEmployeeRefinish + using: + foreign_key_constraint_on: + column: employee_refinish + table: + schema: public + name: jobs - name: timetickets using: foreign_key_constraint_on: @@ -1826,6 +1840,12 @@ tables: - name: bodyshop using: foreign_key_constraint_on: shopid + - name: employee_body_rel + using: + foreign_key_constraint_on: employee_body + - name: employee_refinish_rel + using: + foreign_key_constraint_on: employee_refinish - name: invoice using: manual_configuration: @@ -2015,6 +2035,8 @@ tables: - ded_amt - ded_status - depreciation_taxes + - employee_body + - employee_refinish - est_addr1 - est_addr2 - est_city @@ -2250,6 +2272,8 @@ tables: - ded_amt - ded_status - depreciation_taxes + - employee_body + - employee_refinish - est_addr1 - est_addr2 - est_city @@ -2495,6 +2519,8 @@ tables: - ded_amt - ded_status - depreciation_taxes + - employee_body + - employee_refinish - est_addr1 - est_addr2 - est_city @@ -3339,6 +3365,22 @@ tables: name: bodyshops column_mapping: shopid: id + - name: employee_body_rel + using: + manual_configuration: + remote_table: + schema: public + name: employees + column_mapping: + employee_body: id + - name: employee_refinish_rel + using: + manual_configuration: + remote_table: + schema: public + name: employees + column_mapping: + employee_refinish: id select_permissions: - role: user permission: