diff --git a/_business_logic/NewShopSetup.md b/_business_logic/NewShopSetup.md index dc17f03f0..389582d25 100644 --- a/_business_logic/NewShopSetup.md +++ b/_business_logic/NewShopSetup.md @@ -49,3 +49,6 @@ --\* Set the region for the shop. -Counter Record - type: ronum + + +Create an in house vendor record and add it to the bodyshop record. \ No newline at end of file diff --git a/bodyshop_translations.babel b/bodyshop_translations.babel index 4aefc114b..45c53caf6 100644 --- a/bodyshop_translations.babel +++ b/bodyshop_translations.babel @@ -2699,6 +2699,27 @@ actions + + new + false + + + + + + en-US + false + + + es-MX + false + + + fr-CA + false + + + return false @@ -5797,6 +5818,27 @@ + + line_no + false + + + + + + en-US + false + + + es-MX + false + + + fr-CA + false + + + mod_lb_hrs false @@ -11663,6 +11705,27 @@ + + quantity + false + + + + + + en-US + false + + + es-MX + false + + + fr-CA + false + + + diff --git a/client/src/components/courtesy-cars-list/courtesy-cars-list.component.jsx b/client/src/components/courtesy-cars-list/courtesy-cars-list.component.jsx index 5fa6e003e..06b2128ad 100644 --- a/client/src/components/courtesy-cars-list/courtesy-cars-list.component.jsx +++ b/client/src/components/courtesy-cars-list/courtesy-cars-list.component.jsx @@ -1,4 +1,4 @@ -import { Table } from "antd"; +import { Table, Button } from "antd"; import React, { useState } from "react"; import { useTranslation } from "react-i18next"; import { Link } from "react-router-dom"; @@ -7,7 +7,7 @@ import { alphaSort } from "../../utils/sorters"; export default function CourtesyCarsList({ loading, courtesycars }) { const [state, setState] = useState({ sortedInfo: {}, - filteredInfo: { text: "" } + filteredInfo: { text: "" }, }); const { t } = useTranslation(); @@ -19,7 +19,7 @@ export default function CourtesyCarsList({ loading, courtesycars }) { key: "fleetnumber", sorter: (a, b) => alphaSort(a.fleetnumber, b.fleetnumber), sortOrder: - state.sortedInfo.columnKey === "fleetnumber" && state.sortedInfo.order + state.sortedInfo.columnKey === "fleetnumber" && state.sortedInfo.order, }, { title: t("courtesycars.fields.vin"), @@ -29,7 +29,7 @@ export default function CourtesyCarsList({ loading, courtesycars }) { sortOrder: state.sortedInfo.columnKey === "vin" && state.sortedInfo.order, render: (text, record) => ( {record.vin} - ) + ), }, { title: t("courtesycars.fields.status"), @@ -38,21 +38,23 @@ export default function CourtesyCarsList({ loading, courtesycars }) { sorter: (a, b) => alphaSort(a.status, b.status), sortOrder: state.sortedInfo.columnKey === "status" && state.sortedInfo.order, - render: (text, record) => t(record.status) + render: (text, record) => t(record.status), }, { title: t("courtesycars.fields.year"), dataIndex: "year", key: "year", sorter: (a, b) => alphaSort(a.year, b.year), - sortOrder: state.sortedInfo.columnKey === "year" && state.sortedInfo.order + sortOrder: + state.sortedInfo.columnKey === "year" && state.sortedInfo.order, }, { title: t("courtesycars.fields.make"), dataIndex: "make", key: "make", sorter: (a, b) => alphaSort(a.make, b.make), - sortOrder: state.sortedInfo.columnKey === "make" && state.sortedInfo.order + sortOrder: + state.sortedInfo.columnKey === "make" && state.sortedInfo.order, }, { title: t("courtesycars.fields.model"), @@ -60,8 +62,8 @@ export default function CourtesyCarsList({ loading, courtesycars }) { key: "model", sorter: (a, b) => alphaSort(a.model, b.model), sortOrder: - state.sortedInfo.columnKey === "model" && state.sortedInfo.order - } + state.sortedInfo.columnKey === "model" && state.sortedInfo.order, + }, ]; const handleTableChange = (pagination, filters, sorter) => { @@ -71,9 +73,14 @@ export default function CourtesyCarsList({ loading, courtesycars }) { return ( ( + + + + )} size="small" pagination={{ position: "top" }} - columns={columns.map(item => ({ ...item }))} + columns={columns.map((item) => ({ ...item }))} rowKey="id" dataSource={courtesycars} onChange={handleTableChange} diff --git a/client/src/components/invoices-list-table/invoices-list-table.component.jsx b/client/src/components/invoices-list-table/invoices-list-table.component.jsx index 6f3cdebb6..b49e3d326 100644 --- a/client/src/components/invoices-list-table/invoices-list-table.component.jsx +++ b/client/src/components/invoices-list-table/invoices-list-table.component.jsx @@ -64,7 +64,9 @@ export default function InvoicesListTableComponent({ dataIndex: "actions", key: "actions", render: (text, record) => ( - + ), diff --git a/client/src/components/parts-order-modal/parts-order-modal.component.jsx b/client/src/components/parts-order-modal/parts-order-modal.component.jsx index c4f5a4874..446e16dd1 100644 --- a/client/src/components/parts-order-modal/parts-order-modal.component.jsx +++ b/client/src/components/parts-order-modal/parts-order-modal.component.jsx @@ -1,12 +1,12 @@ import { DeleteFilled } from "@ant-design/icons"; -import { DatePicker, Form, Input, Radio } from "antd"; +import { DatePicker, Form, Input, Radio, InputNumber } from "antd"; import React from "react"; import { useTranslation } from "react-i18next"; import VendorSearchSelect from "../vendor-search-select/vendor-search-select.component"; import CurrencyInput from "../form-items-formatted/currency-form-item.component"; export default function PartsOrderModalComponent({ vendorList, - sendTypeState + sendTypeState, }) { const [sendType, setSendType] = sendTypeState; @@ -20,8 +20,8 @@ export default function PartsOrderModalComponent({ rules={[ { required: true, - message: t("general.validation.required") - } + message: t("general.validation.required"), + }, ]} > @@ -31,8 +31,8 @@ export default function PartsOrderModalComponent({ rules={[ { required: true, - message: t("general.validation.required") - } + message: t("general.validation.required"), + }, ]} label={t("parts_orders.fields.deliver_by")} > @@ -54,8 +54,8 @@ export default function PartsOrderModalComponent({ rules={[ { required: true, - message: t("general.validation.required") - } + message: t("general.validation.required"), + }, ]} > @@ -81,6 +81,13 @@ export default function PartsOrderModalComponent({ > + + + { remove(field.name); @@ -95,7 +102,7 @@ export default function PartsOrderModalComponent({ setSendType(e.target.value)} + onChange={(e) => setSendType(e.target.value)} > {t("parts_orders.labels.email")} {t("parts_orders.labels.print")} diff --git a/client/src/components/parts-order-modal/parts-order-modal.container.jsx b/client/src/components/parts-order-modal/parts-order-modal.container.jsx index 9dc1d5020..b5fbecc01 100644 --- a/client/src/components/parts-order-modal/parts-order-modal.container.jsx +++ b/client/src/components/parts-order-modal/parts-order-modal.container.jsx @@ -8,6 +8,7 @@ import { EmailSettings } from "../../emails/constants"; import { UPDATE_JOB_LINE_STATUS } from "../../graphql/jobs-lines.queries"; import { INSERT_NEW_PARTS_ORDERS } from "../../graphql/parts-orders.queries"; import { QUERY_ALL_VENDORS_FOR_ORDER } from "../../graphql/vendors.queries"; +import { INSERT_NEW_INVOICE } from "../../graphql/invoices.queries"; import { setEmailOptions } from "../../redux/email/email.actions"; import { toggleModalVisible } from "../../redux/modals/modals.actions"; import { selectPartsOrder } from "../../redux/modals/modals.selectors"; @@ -52,8 +53,11 @@ export function PartsOrderModalContainer({ }); const [insertPartOrder] = useMutation(INSERT_NEW_PARTS_ORDERS); const [updateJobLines] = useMutation(UPDATE_JOB_LINE_STATUS); + const [insertInvoice] = useMutation(INSERT_NEW_INVOICE); + + const handleFinish = async (values) => { + //Check if this was actuall an inhouse invoice - const handleFinish = (values) => { insertPartOrder({ variables: { po: [ @@ -77,6 +81,39 @@ export function PartsOrderModalContainer({ notification["success"]({ message: t("parts_orders.successes.created"), }); + + if (values.vendorid === bodyshop.inhousevendorid) { + console.log("Inhouse Invoice needs to be psoted."); + let invoiceToPost = { + vendorid: bodyshop.inhousevendorid, + jobid: jobId, + total: 0, + invoice_number: `${jobId}`, //TODO Add INhouse invoice generation? + federal_tax_rate: + bodyshop.invoice_tax_rates.federal_tax_rate || 0, + state_tax_rate: bodyshop.invoice_tax_rates.state_tax_rate || 0, + local_tax_rate: bodyshop.invoice_tax_rates.local_tax_rate || 0, + invoicelines: { + data: values.parts_order_lines.data.map((p) => { + return { + joblineid: p.job_line_id, + actual_price: 0, + actual_cost: 0, + line_desc: p.line_desc, + quantity: p.quantity || 1, + cost_center: + bodyshop.md_responsibility_centers.defaults.PAO || + "Other*", + }; + }), + }, + }; + + const invoiceResult = insertInvoice({ + variables: { invoice: invoiceToPost }, + }); + } + if (refetch) refetch(); toggleModalVisible(); @@ -84,10 +121,6 @@ export function PartsOrderModalContainer({ //TODO Remove hardcoding setEmailOptions({ messageOptions: { - from: { - name: bodyshop.shopname || EmailSettings.fromNameDefault, - address: EmailSettings.fromAddress, - }, to: data.vendors.filter((item) => item.id === values.id)[0] || null, @@ -127,6 +160,7 @@ export function PartsOrderModalContainer({ oem_partno: value.oem_partno, db_price: value.db_price, act_price: value.act_price, + quantity: value.part_qty, job_line_id: value.id, status: bodyshop.md_order_statuses.default_ordered || "Ordered*", }); diff --git a/client/src/components/vendors-form/vendors-form.container.jsx b/client/src/components/vendors-form/vendors-form.container.jsx index bf3c198b4..8b72a0bac 100644 --- a/client/src/components/vendors-form/vendors-form.container.jsx +++ b/client/src/components/vendors-form/vendors-form.container.jsx @@ -25,7 +25,7 @@ function VendorsFormContainer({ selectedVendor, refetch, bodyshop }) { const { loading, error, data } = useQuery(QUERY_VENDOR_BY_ID, { variables: { id: (selectedVendor && selectedVendor.id) || null }, fetchPolicy: "network-only", - skip: !selectedVendor + skip: !!!selectedVendor }); const [updateVendor] = useMutation(UPDATE_VENDOR); const [insertvendor] = useMutation(INSERT_NEW_VENDOR); diff --git a/client/src/components/vendors-list/vendors-list.container.jsx b/client/src/components/vendors-list/vendors-list.container.jsx index b15f5f196..f0d91889d 100644 --- a/client/src/components/vendors-list/vendors-list.container.jsx +++ b/client/src/components/vendors-list/vendors-list.container.jsx @@ -6,14 +6,13 @@ import VendorsListComponent from "./vendors-list.component"; export default function VendorsListContainer({ selectedVendorState }) { const [selectedVendor, setSelectedVendor] = selectedVendorState; - const { loading, error, data } = useQuery(QUERY_ALL_VENDORS, { - fetchPolicy: "network-only" - }); + const { loading, error, data } = useQuery(QUERY_ALL_VENDORS); + const handleNewVendor = () => { setSelectedVendor({}); }; - const handleOnRowClick = record => { + const handleOnRowClick = (record) => { if (record) { setSelectedVendor(record); } else setSelectedVendor(null); diff --git a/client/src/graphql/bodyshop.queries.js b/client/src/graphql/bodyshop.queries.js index ac1ec745c..8e37b4cbc 100644 --- a/client/src/graphql/bodyshop.queries.js +++ b/client/src/graphql/bodyshop.queries.js @@ -28,6 +28,7 @@ export const QUERY_BODYSHOP = gql` textid production_config invoice_tax_rates + inhousevendorid employees { id first_name diff --git a/client/src/graphql/invoices.queries.js b/client/src/graphql/invoices.queries.js index 6390c724d..f6cb7c443 100644 --- a/client/src/graphql/invoices.queries.js +++ b/client/src/graphql/invoices.queries.js @@ -41,6 +41,7 @@ export const QUERY_INVOICES_BY_JOBID = gql` query QUERY_INVOICES_BY_JOBID($jobid: uuid!) { invoices(where: { jobid: { _eq: $jobid } }, order_by: { date: desc }) { id + vendorid vendor { id name diff --git a/client/src/translations/en_us/common.json b/client/src/translations/en_us/common.json index 6d52e376f..8bb03437e 100644 --- a/client/src/translations/en_us/common.json +++ b/client/src/translations/en_us/common.json @@ -184,6 +184,7 @@ }, "courtesycars": { "actions": { + "new": "New Courtesy Car", "return": "Return Car" }, "errors": { @@ -402,6 +403,7 @@ "db_price": "Database Price", "line_desc": "Line Description", "line_ind": "S#", + "line_no": "Line #", "mod_lb_hrs": "Labor Hours", "mod_lbr_ty": "Labor Type", "oem_partno": "OEM Part #", @@ -742,7 +744,8 @@ "job_line_id": "Job Line Id", "line_desc": "Line Description", "line_remarks": "Remarks", - "lineremarks": "Line Remarks" + "lineremarks": "Line Remarks", + "quantity": "Qty." }, "labels": { "email": "Send by Email", diff --git a/client/src/translations/es/common.json b/client/src/translations/es/common.json index 9b870e178..5b2e026d8 100644 --- a/client/src/translations/es/common.json +++ b/client/src/translations/es/common.json @@ -184,6 +184,7 @@ }, "courtesycars": { "actions": { + "new": "", "return": "" }, "errors": { @@ -402,6 +403,7 @@ "db_price": "Precio de base de datos", "line_desc": "Descripción de línea", "line_ind": "S#", + "line_no": "", "mod_lb_hrs": "Horas laborales", "mod_lbr_ty": "Tipo de trabajo", "oem_partno": "OEM parte #", @@ -742,7 +744,8 @@ "job_line_id": "", "line_desc": "", "line_remarks": "", - "lineremarks": "Comentarios de línea" + "lineremarks": "Comentarios de línea", + "quantity": "" }, "labels": { "email": "Enviar por correo electrónico", diff --git a/client/src/translations/fr/common.json b/client/src/translations/fr/common.json index 7c9bc62be..cf02b0c0d 100644 --- a/client/src/translations/fr/common.json +++ b/client/src/translations/fr/common.json @@ -184,6 +184,7 @@ }, "courtesycars": { "actions": { + "new": "", "return": "" }, "errors": { @@ -402,6 +403,7 @@ "db_price": "Prix de la base de données", "line_desc": "Description de la ligne", "line_ind": "S#", + "line_no": "", "mod_lb_hrs": "Heures de travail", "mod_lbr_ty": "Type de travail", "oem_partno": "Pièce OEM #", @@ -742,7 +744,8 @@ "job_line_id": "", "line_desc": "", "line_remarks": "", - "lineremarks": "Remarques sur la ligne" + "lineremarks": "Remarques sur la ligne", + "quantity": "" }, "labels": { "email": "Envoyé par email", diff --git a/hasura/migrations/1589220968554_alter_table_public_bodyshops_add_column_inhousevendorid/down.yaml b/hasura/migrations/1589220968554_alter_table_public_bodyshops_add_column_inhousevendorid/down.yaml new file mode 100644 index 000000000..7206ea7d4 --- /dev/null +++ b/hasura/migrations/1589220968554_alter_table_public_bodyshops_add_column_inhousevendorid/down.yaml @@ -0,0 +1,5 @@ +- args: + cascade: false + read_only: false + sql: ALTER TABLE "public"."bodyshops" DROP COLUMN "inhousevendorid"; + type: run_sql diff --git a/hasura/migrations/1589220968554_alter_table_public_bodyshops_add_column_inhousevendorid/up.yaml b/hasura/migrations/1589220968554_alter_table_public_bodyshops_add_column_inhousevendorid/up.yaml new file mode 100644 index 000000000..4069e563e --- /dev/null +++ b/hasura/migrations/1589220968554_alter_table_public_bodyshops_add_column_inhousevendorid/up.yaml @@ -0,0 +1,5 @@ +- args: + cascade: false + read_only: false + sql: ALTER TABLE "public"."bodyshops" ADD COLUMN "inhousevendorid" uuid NULL; + type: run_sql diff --git a/hasura/migrations/1589220979739_update_permission_user_public_table_bodyshops/down.yaml b/hasura/migrations/1589220979739_update_permission_user_public_table_bodyshops/down.yaml new file mode 100644 index 000000000..e047a4088 --- /dev/null +++ b/hasura/migrations/1589220979739_update_permission_user_public_table_bodyshops/down.yaml @@ -0,0 +1,48 @@ +- args: + role: user + table: + name: bodyshops + schema: public + type: drop_select_permission +- args: + permission: + allow_aggregations: false + columns: + - address1 + - address2 + - city + - country + - created_at + - email + - federal_tax_id + - id + - insurance_vendor_id + - invoice_tax_rates + - logo_img_path + - md_order_statuses + - md_responsibility_centers + - md_ro_statuses + - messagingservicesid + - production_config + - region_config + - shopname + - shoprates + - state + - state_tax_id + - template_header + - textid + - updated_at + - zip_post + computed_fields: [] + filter: + associations: + bodyshop: + associations: + user: + authid: + _eq: X-Hasura-User-Id + role: user + table: + name: bodyshops + schema: public + type: create_select_permission diff --git a/hasura/migrations/1589220979739_update_permission_user_public_table_bodyshops/up.yaml b/hasura/migrations/1589220979739_update_permission_user_public_table_bodyshops/up.yaml new file mode 100644 index 000000000..5cdd042d5 --- /dev/null +++ b/hasura/migrations/1589220979739_update_permission_user_public_table_bodyshops/up.yaml @@ -0,0 +1,49 @@ +- args: + role: user + table: + name: bodyshops + schema: public + type: drop_select_permission +- args: + permission: + allow_aggregations: false + columns: + - address1 + - address2 + - city + - country + - created_at + - email + - federal_tax_id + - id + - inhousevendorid + - insurance_vendor_id + - invoice_tax_rates + - logo_img_path + - md_order_statuses + - md_responsibility_centers + - md_ro_statuses + - messagingservicesid + - production_config + - region_config + - shopname + - shoprates + - state + - state_tax_id + - template_header + - textid + - updated_at + - zip_post + computed_fields: [] + filter: + associations: + bodyshop: + associations: + user: + authid: + _eq: X-Hasura-User-Id + role: user + table: + name: bodyshops + schema: public + type: create_select_permission diff --git a/hasura/migrations/1589220986849_update_permission_user_public_table_bodyshops/down.yaml b/hasura/migrations/1589220986849_update_permission_user_public_table_bodyshops/down.yaml new file mode 100644 index 000000000..345dd574c --- /dev/null +++ b/hasura/migrations/1589220986849_update_permission_user_public_table_bodyshops/down.yaml @@ -0,0 +1,46 @@ +- args: + role: user + table: + name: bodyshops + schema: public + type: drop_update_permission +- args: + permission: + columns: + - address1 + - address2 + - city + - country + - created_at + - email + - federal_tax_id + - id + - insurance_vendor_id + - invoice_tax_rates + - logo_img_path + - md_order_statuses + - md_responsibility_centers + - md_ro_statuses + - production_config + - shopname + - shoprates + - state + - state_tax_id + - updated_at + - zip_post + filter: + associations: + bodyshop: + associations: + user: + authid: + _eq: X-Hasura-User-Id + localPresets: + - key: "" + value: "" + set: {} + role: user + table: + name: bodyshops + schema: public + type: create_update_permission diff --git a/hasura/migrations/1589220986849_update_permission_user_public_table_bodyshops/up.yaml b/hasura/migrations/1589220986849_update_permission_user_public_table_bodyshops/up.yaml new file mode 100644 index 000000000..529715952 --- /dev/null +++ b/hasura/migrations/1589220986849_update_permission_user_public_table_bodyshops/up.yaml @@ -0,0 +1,47 @@ +- args: + role: user + table: + name: bodyshops + schema: public + type: drop_update_permission +- args: + permission: + columns: + - address1 + - address2 + - city + - country + - created_at + - email + - federal_tax_id + - id + - inhousevendorid + - insurance_vendor_id + - invoice_tax_rates + - logo_img_path + - md_order_statuses + - md_responsibility_centers + - md_ro_statuses + - production_config + - shopname + - shoprates + - state + - state_tax_id + - updated_at + - zip_post + filter: + associations: + bodyshop: + associations: + user: + authid: + _eq: X-Hasura-User-Id + localPresets: + - key: "" + value: "" + set: {} + role: user + table: + name: bodyshops + schema: public + type: create_update_permission diff --git a/hasura/migrations/1589225896113_alter_table_public_parts_order_lines_add_column_quantity/down.yaml b/hasura/migrations/1589225896113_alter_table_public_parts_order_lines_add_column_quantity/down.yaml new file mode 100644 index 000000000..ca30c5c80 --- /dev/null +++ b/hasura/migrations/1589225896113_alter_table_public_parts_order_lines_add_column_quantity/down.yaml @@ -0,0 +1,5 @@ +- args: + cascade: false + read_only: false + sql: ALTER TABLE "public"."parts_order_lines" DROP COLUMN "quantity"; + type: run_sql diff --git a/hasura/migrations/1589225896113_alter_table_public_parts_order_lines_add_column_quantity/up.yaml b/hasura/migrations/1589225896113_alter_table_public_parts_order_lines_add_column_quantity/up.yaml new file mode 100644 index 000000000..abe92d82f --- /dev/null +++ b/hasura/migrations/1589225896113_alter_table_public_parts_order_lines_add_column_quantity/up.yaml @@ -0,0 +1,6 @@ +- args: + cascade: false + read_only: false + sql: ALTER TABLE "public"."parts_order_lines" ADD COLUMN "quantity" numeric NOT + NULL DEFAULT 1; + type: run_sql diff --git a/hasura/migrations/1589225907303_update_permission_user_public_table_parts_order_lines/down.yaml b/hasura/migrations/1589225907303_update_permission_user_public_table_parts_order_lines/down.yaml new file mode 100644 index 000000000..484182ba8 --- /dev/null +++ b/hasura/migrations/1589225907303_update_permission_user_public_table_parts_order_lines/down.yaml @@ -0,0 +1,40 @@ +- args: + role: user + table: + name: parts_order_lines + schema: public + type: drop_insert_permission +- args: + permission: + check: + parts_order: + job: + bodyshop: + associations: + _and: + - user: + authid: + _eq: X-Hasura-User-Id + - active: + _eq: true + columns: + - id + - created_at + - updated_at + - orderid + - job_line_id + - line_desc + - oem_partno + - db_price + - act_price + - status + - line_remarks + localPresets: + - key: "" + value: "" + set: {} + role: user + table: + name: parts_order_lines + schema: public + type: create_insert_permission diff --git a/hasura/migrations/1589225907303_update_permission_user_public_table_parts_order_lines/up.yaml b/hasura/migrations/1589225907303_update_permission_user_public_table_parts_order_lines/up.yaml new file mode 100644 index 000000000..dfdecc4bb --- /dev/null +++ b/hasura/migrations/1589225907303_update_permission_user_public_table_parts_order_lines/up.yaml @@ -0,0 +1,41 @@ +- args: + role: user + table: + name: parts_order_lines + schema: public + type: drop_insert_permission +- args: + permission: + check: + parts_order: + job: + bodyshop: + associations: + _and: + - user: + authid: + _eq: X-Hasura-User-Id + - active: + _eq: true + columns: + - act_price + - created_at + - db_price + - id + - job_line_id + - line_desc + - line_remarks + - oem_partno + - orderid + - quantity + - status + - updated_at + localPresets: + - key: "" + value: "" + set: {} + role: user + table: + name: parts_order_lines + schema: public + type: create_insert_permission diff --git a/hasura/migrations/1589225914182_update_permission_user_public_table_parts_order_lines/down.yaml b/hasura/migrations/1589225914182_update_permission_user_public_table_parts_order_lines/down.yaml new file mode 100644 index 000000000..f147077ae --- /dev/null +++ b/hasura/migrations/1589225914182_update_permission_user_public_table_parts_order_lines/down.yaml @@ -0,0 +1,38 @@ +- args: + role: user + table: + name: parts_order_lines + schema: public + type: drop_select_permission +- args: + permission: + allow_aggregations: false + columns: + - act_price + - db_price + - line_desc + - line_remarks + - oem_partno + - status + - created_at + - updated_at + - id + - job_line_id + - orderid + computed_fields: [] + filter: + parts_order: + job: + bodyshop: + associations: + _and: + - user: + authid: + _eq: X-Hasura-User-Id + - active: + _eq: true + role: user + table: + name: parts_order_lines + schema: public + type: create_select_permission diff --git a/hasura/migrations/1589225914182_update_permission_user_public_table_parts_order_lines/up.yaml b/hasura/migrations/1589225914182_update_permission_user_public_table_parts_order_lines/up.yaml new file mode 100644 index 000000000..e057ea23a --- /dev/null +++ b/hasura/migrations/1589225914182_update_permission_user_public_table_parts_order_lines/up.yaml @@ -0,0 +1,39 @@ +- args: + role: user + table: + name: parts_order_lines + schema: public + type: drop_select_permission +- args: + permission: + allow_aggregations: false + columns: + - act_price + - created_at + - db_price + - id + - job_line_id + - line_desc + - line_remarks + - oem_partno + - orderid + - quantity + - status + - updated_at + computed_fields: [] + filter: + parts_order: + job: + bodyshop: + associations: + _and: + - user: + authid: + _eq: X-Hasura-User-Id + - active: + _eq: true + role: user + table: + name: parts_order_lines + schema: public + type: create_select_permission diff --git a/hasura/migrations/1589225921325_update_permission_user_public_table_parts_order_lines/down.yaml b/hasura/migrations/1589225921325_update_permission_user_public_table_parts_order_lines/down.yaml new file mode 100644 index 000000000..84f9e1e6d --- /dev/null +++ b/hasura/migrations/1589225921325_update_permission_user_public_table_parts_order_lines/down.yaml @@ -0,0 +1,40 @@ +- args: + role: user + table: + name: parts_order_lines + schema: public + type: drop_update_permission +- args: + permission: + columns: + - act_price + - db_price + - line_desc + - line_remarks + - oem_partno + - status + - created_at + - updated_at + - id + - job_line_id + - orderid + filter: + parts_order: + job: + bodyshop: + associations: + _and: + - user: + authid: + _eq: X-Hasura-User-Id + - active: + _eq: true + localPresets: + - key: "" + value: "" + set: {} + role: user + table: + name: parts_order_lines + schema: public + type: create_update_permission diff --git a/hasura/migrations/1589225921325_update_permission_user_public_table_parts_order_lines/up.yaml b/hasura/migrations/1589225921325_update_permission_user_public_table_parts_order_lines/up.yaml new file mode 100644 index 000000000..6588e2ab3 --- /dev/null +++ b/hasura/migrations/1589225921325_update_permission_user_public_table_parts_order_lines/up.yaml @@ -0,0 +1,41 @@ +- args: + role: user + table: + name: parts_order_lines + schema: public + type: drop_update_permission +- args: + permission: + columns: + - act_price + - created_at + - db_price + - id + - job_line_id + - line_desc + - line_remarks + - oem_partno + - orderid + - quantity + - status + - updated_at + filter: + parts_order: + job: + bodyshop: + associations: + _and: + - user: + authid: + _eq: X-Hasura-User-Id + - active: + _eq: true + localPresets: + - key: "" + value: "" + set: {} + role: user + table: + name: parts_order_lines + schema: public + type: create_update_permission diff --git a/hasura/migrations/metadata.yaml b/hasura/migrations/metadata.yaml index 03f57ab22..2c6ac0874 100644 --- a/hasura/migrations/metadata.yaml +++ b/hasura/migrations/metadata.yaml @@ -438,6 +438,7 @@ tables: - email - federal_tax_id - id + - inhousevendorid - insurance_vendor_id - invoice_tax_rates - logo_img_path @@ -474,6 +475,7 @@ tables: - email - federal_tax_id - id + - inhousevendorid - insurance_vendor_id - invoice_tax_rates - logo_img_path @@ -2746,32 +2748,34 @@ tables: - active: _eq: true columns: - - id + - act_price - created_at - - updated_at - - orderid + - db_price + - id - job_line_id - line_desc - - oem_partno - - db_price - - act_price - - status - line_remarks + - oem_partno + - orderid + - quantity + - status + - updated_at select_permissions: - role: user permission: columns: - act_price + - created_at - db_price + - id + - job_line_id - line_desc - line_remarks - oem_partno - - status - - created_at - - updated_at - - id - - job_line_id - orderid + - quantity + - status + - updated_at filter: parts_order: job: @@ -2788,16 +2792,17 @@ tables: permission: columns: - act_price + - created_at - db_price + - id + - job_line_id - line_desc - line_remarks - oem_partno - - status - - created_at - - updated_at - - id - - job_line_id - orderid + - quantity + - status + - updated_at filter: parts_order: job: