From 6473feb81740a54ad10435318a6d758c62e792b4 Mon Sep 17 00:00:00 2001 From: Patrick Fic <> Date: Fri, 31 Jul 2020 13:18:09 -0700 Subject: [PATCH] Added prepper assignment to job. BOD-214 --- bodyshop_translations.babel | 21 ++ .../job-employee-assignments.component.jsx | 35 ++- .../job-employee-assignments.container.jsx | 4 +- .../job-line-location-popup.component.jsx | 38 +-- client/src/graphql/jobs.queries.js | 17 ++ client/src/translations/en_us/common.json | 1 + client/src/translations/es/common.json | 1 + client/src/translations/fr/common.json | 1 + .../down.yaml | 5 + .../up.yaml | 5 + .../down.yaml | 5 + .../up.yaml | 10 + .../down.yaml | 6 + .../up.yaml | 8 + .../down.yaml | 6 + .../up.yaml | 12 + .../down.yaml | 7 + .../up.yaml | 7 + .../down.yaml | 257 +++++++++++++++++ .../up.yaml | 258 +++++++++++++++++ .../down.yaml | 258 +++++++++++++++++ .../up.yaml | 259 ++++++++++++++++++ .../down.yaml | 257 +++++++++++++++++ .../up.yaml | 258 +++++++++++++++++ hasura/migrations/metadata.yaml | 13 + 25 files changed, 1723 insertions(+), 26 deletions(-) create mode 100644 hasura/migrations/1596225983120_alter_table_public_jobs_add_column_employee_prep/down.yaml create mode 100644 hasura/migrations/1596225983120_alter_table_public_jobs_add_column_employee_prep/up.yaml create mode 100644 hasura/migrations/1596226073397_set_fk_public_jobs_employee_prep/down.yaml create mode 100644 hasura/migrations/1596226073397_set_fk_public_jobs_employee_prep/up.yaml create mode 100644 hasura/migrations/1596226116444_add_relationship_employee_table_public_undefined/down.yaml create mode 100644 hasura/migrations/1596226116444_add_relationship_employee_table_public_undefined/up.yaml create mode 100644 hasura/migrations/1596226119743_add_relationship_jobsByEmployeePrep_table_public_undefined/down.yaml create mode 100644 hasura/migrations/1596226119743_add_relationship_jobsByEmployeePrep_table_public_undefined/up.yaml create mode 100644 hasura/migrations/1596226134655_rename_relationship_employee_to_employee_prep_rel_schema_public_table_jobs/down.yaml create mode 100644 hasura/migrations/1596226134655_rename_relationship_employee_to_employee_prep_rel_schema_public_table_jobs/up.yaml create mode 100644 hasura/migrations/1596226147493_update_permission_user_public_table_jobs/down.yaml create mode 100644 hasura/migrations/1596226147493_update_permission_user_public_table_jobs/up.yaml create mode 100644 hasura/migrations/1596226171391_update_permission_user_public_table_jobs/down.yaml create mode 100644 hasura/migrations/1596226171391_update_permission_user_public_table_jobs/up.yaml create mode 100644 hasura/migrations/1596226179648_update_permission_user_public_table_jobs/down.yaml create mode 100644 hasura/migrations/1596226179648_update_permission_user_public_table_jobs/up.yaml diff --git a/bodyshop_translations.babel b/bodyshop_translations.babel index e16e8e34d..3559357f3 100644 --- a/bodyshop_translations.babel +++ b/bodyshop_translations.babel @@ -10510,6 +10510,27 @@ + + employee_prep + false + + + + + + en-US + false + + + es-MX + false + + + fr-CA + false + + + employee_refinish false 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 index 7c5ca4c0e..f28801ff7 100644 --- a/client/src/components/job-employee-assignments/job-employee-assignments.component.jsx +++ b/client/src/components/job-employee-assignments/job-employee-assignments.component.jsx @@ -17,6 +17,7 @@ export function JobEmployeeAssignments({ bodyshop, body, refinish, + prep, handleAdd, handleRemove, }) { @@ -34,14 +35,15 @@ export function JobEmployeeAssignments({ const popContent = (
@@ -69,7 +72,7 @@ export function JobEmployeeAssignments({
{`${body.first_name || ""} ${body.last_name || ""}`} handleRemove("body")} />
@@ -82,6 +85,24 @@ export function JobEmployeeAssignments({ /> )} + + {prep ? ( +
+ {`${prep.first_name || ""} ${prep.last_name || ""}`} + handleRemove("prep")} + /> +
+ ) : ( + { + setAssignment({ operation: "prep" }); + setVisibility(true); + }} + /> + )} +
{refinish ? (
@@ -89,7 +110,7 @@ export function JobEmployeeAssignments({ refinish.last_name || "" }`} handleRemove("refinish")} />
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 index 0edf3bec0..a5922d59e 100644 --- a/client/src/components/job-employee-assignments/job-employee-assignments.container.jsx +++ b/client/src/components/job-employee-assignments/job-employee-assignments.container.jsx @@ -54,6 +54,7 @@ export default function JobEmployeeAssignmentsContainer({ job }) { @@ -65,7 +66,8 @@ const determineFieldName = (operation) => { switch (operation) { case "body": return "employee_body"; - + case "prep": + return "employee_prep"; case "refinish": return "employee_refinish"; diff --git a/client/src/components/job-line-location-popup/job-line-location-popup.component.jsx b/client/src/components/job-line-location-popup/job-line-location-popup.component.jsx index 8d0d0d138..e4ac65140 100644 --- a/client/src/components/job-line-location-popup/job-line-location-popup.component.jsx +++ b/client/src/components/job-line-location-popup/job-line-location-popup.component.jsx @@ -1,13 +1,13 @@ -import React, { useState, useEffect } from "react"; -import { Input, notification, Select } from "antd"; -import LoadingSpinner from "../loading-spinner/loading-spinner.component"; +import { notification, Select } from "antd"; +import React, { useEffect, useState } from "react"; import { useMutation } from "react-apollo"; -import { UPDATE_JOB_LINE } from "../../graphql/jobs-lines.queries"; import { useTranslation } from "react-i18next"; - import { connect } from "react-redux"; import { createStructuredSelector } from "reselect"; +import { UPDATE_JOB_LINE } from "../../graphql/jobs-lines.queries"; import { selectBodyshop } from "../../redux/user/user.selectors"; +import LoadingSpinner from "../loading-spinner/loading-spinner.component"; + const mapStateToProps = createStructuredSelector({ //currentUser: selectCurrentUser bodyshop: selectBodyshop, @@ -53,19 +53,21 @@ export function JobLineLocationPopup({ bodyshop, jobline }) { if (editing) return (
- + + +
); return ( diff --git a/client/src/graphql/jobs.queries.js b/client/src/graphql/jobs.queries.js index 407964064..d6dff50e2 100644 --- a/client/src/graphql/jobs.queries.js +++ b/client/src/graphql/jobs.queries.js @@ -85,6 +85,11 @@ export const QUERY_JOBS_IN_PRODUCTION = gql` first_name last_name } + employee_prep_rel{ + id + first_name + last_name + } } } `; @@ -126,6 +131,11 @@ export const SUBSCRIPTION_JOBS_IN_PRODUCTION = gql` first_name last_name } + employee_prep_rel { + id + first_name + last_name + } } } `; @@ -234,6 +244,11 @@ export const GET_JOB_BY_PK = gql` first_name last_name } + employee_prep_rel { + id + first_name + last_name + } csr loss_desc kmin @@ -529,6 +544,7 @@ export const QUERY_TECH_JOB_DETAILS = gql` date_estimated employee_body employee_refinish + employee_prep joblines { id unq_seq @@ -894,6 +910,7 @@ export const QUERY_ALL_JOB_FIELDS = gql` } employee_body employee_refinish + employee_prep } } `; diff --git a/client/src/translations/en_us/common.json b/client/src/translations/en_us/common.json index f1ecfbfae..79f5251e1 100644 --- a/client/src/translations/en_us/common.json +++ b/client/src/translations/en_us/common.json @@ -674,6 +674,7 @@ "ded_status": "Deductible Status", "depreciation_taxes": "Depreciation/Taxes", "employee_body": "Body", + "employee_prep": "Prep", "employee_refinish": "Refinish", "est_addr1": "Appraiser Address", "est_co_nm": "Appraiser", diff --git a/client/src/translations/es/common.json b/client/src/translations/es/common.json index d2b2fa502..cca495fa5 100644 --- a/client/src/translations/es/common.json +++ b/client/src/translations/es/common.json @@ -674,6 +674,7 @@ "ded_status": "Estado deducible", "depreciation_taxes": "Depreciación / Impuestos", "employee_body": "", + "employee_prep": "", "employee_refinish": "", "est_addr1": "Dirección del tasador", "est_co_nm": "Tasador", diff --git a/client/src/translations/fr/common.json b/client/src/translations/fr/common.json index 5e2d6d247..a37cc0218 100644 --- a/client/src/translations/fr/common.json +++ b/client/src/translations/fr/common.json @@ -674,6 +674,7 @@ "ded_status": "Statut de franchise", "depreciation_taxes": "Amortissement / taxes", "employee_body": "", + "employee_prep": "", "employee_refinish": "", "est_addr1": "Adresse de l'évaluateur", "est_co_nm": "Expert", diff --git a/hasura/migrations/1596225983120_alter_table_public_jobs_add_column_employee_prep/down.yaml b/hasura/migrations/1596225983120_alter_table_public_jobs_add_column_employee_prep/down.yaml new file mode 100644 index 000000000..00b35af8c --- /dev/null +++ b/hasura/migrations/1596225983120_alter_table_public_jobs_add_column_employee_prep/down.yaml @@ -0,0 +1,5 @@ +- args: + cascade: false + read_only: false + sql: ALTER TABLE "public"."jobs" DROP COLUMN "employee_prep"; + type: run_sql diff --git a/hasura/migrations/1596225983120_alter_table_public_jobs_add_column_employee_prep/up.yaml b/hasura/migrations/1596225983120_alter_table_public_jobs_add_column_employee_prep/up.yaml new file mode 100644 index 000000000..1971d34f6 --- /dev/null +++ b/hasura/migrations/1596225983120_alter_table_public_jobs_add_column_employee_prep/up.yaml @@ -0,0 +1,5 @@ +- args: + cascade: false + read_only: false + sql: ALTER TABLE "public"."jobs" ADD COLUMN "employee_prep" uuid NULL; + type: run_sql diff --git a/hasura/migrations/1596226073397_set_fk_public_jobs_employee_prep/down.yaml b/hasura/migrations/1596226073397_set_fk_public_jobs_employee_prep/down.yaml new file mode 100644 index 000000000..d6b5a3710 --- /dev/null +++ b/hasura/migrations/1596226073397_set_fk_public_jobs_employee_prep/down.yaml @@ -0,0 +1,5 @@ +- args: + cascade: false + read_only: false + sql: alter table "public"."jobs" drop constraint "jobs_employee_prep_fkey"; + type: run_sql diff --git a/hasura/migrations/1596226073397_set_fk_public_jobs_employee_prep/up.yaml b/hasura/migrations/1596226073397_set_fk_public_jobs_employee_prep/up.yaml new file mode 100644 index 000000000..f485e6fda --- /dev/null +++ b/hasura/migrations/1596226073397_set_fk_public_jobs_employee_prep/up.yaml @@ -0,0 +1,10 @@ +- args: + cascade: false + read_only: false + sql: |- + alter table "public"."jobs" + add constraint "jobs_employee_prep_fkey" + foreign key ("employee_prep") + references "public"."employees" + ("id") on update set null on delete set null; + type: run_sql diff --git a/hasura/migrations/1596226116444_add_relationship_employee_table_public_undefined/down.yaml b/hasura/migrations/1596226116444_add_relationship_employee_table_public_undefined/down.yaml new file mode 100644 index 000000000..22b33f78d --- /dev/null +++ b/hasura/migrations/1596226116444_add_relationship_employee_table_public_undefined/down.yaml @@ -0,0 +1,6 @@ +- args: + relationship: employee + table: + name: jobs + schema: public + type: drop_relationship diff --git a/hasura/migrations/1596226116444_add_relationship_employee_table_public_undefined/up.yaml b/hasura/migrations/1596226116444_add_relationship_employee_table_public_undefined/up.yaml new file mode 100644 index 000000000..36322aafc --- /dev/null +++ b/hasura/migrations/1596226116444_add_relationship_employee_table_public_undefined/up.yaml @@ -0,0 +1,8 @@ +- args: + name: employee + table: + name: jobs + schema: public + using: + foreign_key_constraint_on: employee_prep + type: create_object_relationship diff --git a/hasura/migrations/1596226119743_add_relationship_jobsByEmployeePrep_table_public_undefined/down.yaml b/hasura/migrations/1596226119743_add_relationship_jobsByEmployeePrep_table_public_undefined/down.yaml new file mode 100644 index 000000000..a39fa7c33 --- /dev/null +++ b/hasura/migrations/1596226119743_add_relationship_jobsByEmployeePrep_table_public_undefined/down.yaml @@ -0,0 +1,6 @@ +- args: + relationship: jobsByEmployeePrep + table: + name: employees + schema: public + type: drop_relationship diff --git a/hasura/migrations/1596226119743_add_relationship_jobsByEmployeePrep_table_public_undefined/up.yaml b/hasura/migrations/1596226119743_add_relationship_jobsByEmployeePrep_table_public_undefined/up.yaml new file mode 100644 index 000000000..8a6fe1b21 --- /dev/null +++ b/hasura/migrations/1596226119743_add_relationship_jobsByEmployeePrep_table_public_undefined/up.yaml @@ -0,0 +1,12 @@ +- args: + name: jobsByEmployeePrep + table: + name: employees + schema: public + using: + foreign_key_constraint_on: + column: employee_prep + table: + name: jobs + schema: public + type: create_array_relationship diff --git a/hasura/migrations/1596226134655_rename_relationship_employee_to_employee_prep_rel_schema_public_table_jobs/down.yaml b/hasura/migrations/1596226134655_rename_relationship_employee_to_employee_prep_rel_schema_public_table_jobs/down.yaml new file mode 100644 index 000000000..0ef4046b7 --- /dev/null +++ b/hasura/migrations/1596226134655_rename_relationship_employee_to_employee_prep_rel_schema_public_table_jobs/down.yaml @@ -0,0 +1,7 @@ +- args: + name: employee_prep_rel + new_name: employee + table: + name: jobs + schema: public + type: rename_relationship diff --git a/hasura/migrations/1596226134655_rename_relationship_employee_to_employee_prep_rel_schema_public_table_jobs/up.yaml b/hasura/migrations/1596226134655_rename_relationship_employee_to_employee_prep_rel_schema_public_table_jobs/up.yaml new file mode 100644 index 000000000..188732d05 --- /dev/null +++ b/hasura/migrations/1596226134655_rename_relationship_employee_to_employee_prep_rel_schema_public_table_jobs/up.yaml @@ -0,0 +1,7 @@ +- args: + name: employee + new_name: employee_prep_rel + table: + name: jobs + schema: public + type: rename_relationship diff --git a/hasura/migrations/1596226147493_update_permission_user_public_table_jobs/down.yaml b/hasura/migrations/1596226147493_update_permission_user_public_table_jobs/down.yaml new file mode 100644 index 000000000..0178be5a6 --- /dev/null +++ b/hasura/migrations/1596226147493_update_permission_user_public_table_jobs/down.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/1596226147493_update_permission_user_public_table_jobs/up.yaml b/hasura/migrations/1596226147493_update_permission_user_public_table_jobs/up.yaml new file mode 100644 index 000000000..d95c715b5 --- /dev/null +++ b/hasura/migrations/1596226147493_update_permission_user_public_table_jobs/up.yaml @@ -0,0 +1,258 @@ +- 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_prep + - 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/1596226171391_update_permission_user_public_table_jobs/down.yaml b/hasura/migrations/1596226171391_update_permission_user_public_table_jobs/down.yaml new file mode 100644 index 000000000..e157ffd56 --- /dev/null +++ b/hasura/migrations/1596226171391_update_permission_user_public_table_jobs/down.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/1596226171391_update_permission_user_public_table_jobs/up.yaml b/hasura/migrations/1596226171391_update_permission_user_public_table_jobs/up.yaml new file mode 100644 index 000000000..fc0bcd2fc --- /dev/null +++ b/hasura/migrations/1596226171391_update_permission_user_public_table_jobs/up.yaml @@ -0,0 +1,259 @@ +- 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_prep + - 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/1596226179648_update_permission_user_public_table_jobs/down.yaml b/hasura/migrations/1596226179648_update_permission_user_public_table_jobs/down.yaml new file mode 100644 index 000000000..4e85e20cd --- /dev/null +++ b/hasura/migrations/1596226179648_update_permission_user_public_table_jobs/down.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/1596226179648_update_permission_user_public_table_jobs/up.yaml b/hasura/migrations/1596226179648_update_permission_user_public_table_jobs/up.yaml new file mode 100644 index 000000000..8cf8a1bfb --- /dev/null +++ b/hasura/migrations/1596226179648_update_permission_user_public_table_jobs/up.yaml @@ -0,0 +1,258 @@ +- 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_prep + - 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/metadata.yaml b/hasura/migrations/metadata.yaml index 7a23cae45..78dd4bc75 100644 --- a/hasura/migrations/metadata.yaml +++ b/hasura/migrations/metadata.yaml @@ -1243,6 +1243,13 @@ tables: table: schema: public name: jobs + - name: jobsByEmployeePrep + using: + foreign_key_constraint_on: + column: employee_prep + table: + schema: public + name: jobs - name: jobsByEmployeeRefinish using: foreign_key_constraint_on: @@ -1892,6 +1899,9 @@ tables: - name: employee_body_rel using: foreign_key_constraint_on: employee_body + - name: employee_prep_rel + using: + foreign_key_constraint_on: employee_prep - name: employee_refinish_rel using: foreign_key_constraint_on: employee_refinish @@ -2085,6 +2095,7 @@ tables: - ded_status - depreciation_taxes - employee_body + - employee_prep - employee_refinish - est_addr1 - est_addr2 @@ -2322,6 +2333,7 @@ tables: - ded_status - depreciation_taxes - employee_body + - employee_prep - employee_refinish - est_addr1 - est_addr2 @@ -2569,6 +2581,7 @@ tables: - ded_status - depreciation_taxes - employee_body + - employee_prep - employee_refinish - est_addr1 - est_addr2