BOD-62 WIP total calculations. PST rates is still missing.

This commit is contained in:
Patrick Fic
2020-04-07 17:06:34 -07:00
parent 6bf9ba5be0
commit ed9b2a57fb
18 changed files with 366 additions and 71 deletions

View File

@@ -1,4 +1,4 @@
<babeledit_project be_version="2.6.1" version="1.2"> <babeledit_project version="1.2" be_version="2.6.1">
<!-- <!--
BabelEdit project file BabelEdit project file
@@ -8609,6 +8609,32 @@
</translation> </translation>
</translations> </translations>
</concept_node> </concept_node>
<folder_node>
<name>ratetotals</name>
<children>
<concept_node>
<name>lab</name>
<definition_loaded>false</definition_loaded>
<description></description>
<comment></comment>
<default_text></default_text>
<translations>
<translation>
<language>en-US</language>
<approved>false</approved>
</translation>
<translation>
<language>es-MX</language>
<approved>false</approved>
</translation>
<translation>
<language>fr-CA</language>
<approved>false</approved>
</translation>
</translations>
</concept_node>
</children>
</folder_node>
<concept_node> <concept_node>
<name>vehicle_info</name> <name>vehicle_info</name>
<definition_loaded>false</definition_loaded> <definition_loaded>false</definition_loaded>

View File

@@ -3,13 +3,11 @@ import { List } from "antd";
import Icon from "@ant-design/icons"; import Icon from "@ant-design/icons";
import { FaArrowRight } from "react-icons/fa"; import { FaArrowRight } from "react-icons/fa";
export default function AuditTrailValuesComponent({ oldV, newV }) { export default function AuditTrailValuesComponent({ oldV, newV }) {
console.log("(!oldV & !newV)", !oldV && !newV);
console.log("(!oldV & newV)", !oldV && newV);
if (!oldV && !newV) return <div></div>; if (!oldV && !newV) return <div></div>;
if (!oldV && newV) if (!oldV && newV)
return ( return (
<List style={{ width: "800px" }} bordered size="small"> <List style={{ width: "800px" }} bordered size='small'>
{Object.keys(newV).map((key, idx) => ( {Object.keys(newV).map((key, idx) => (
<List.Item key={idx} value={key}> <List.Item key={idx} value={key}>
{key}: {JSON.stringify(newV[key])} {key}: {JSON.stringify(newV[key])}
@@ -19,7 +17,7 @@ export default function AuditTrailValuesComponent({ oldV, newV }) {
); );
return ( return (
<List style={{ width: "800px" }} bordered size="small"> <List style={{ width: "800px" }} bordered size='small'>
{Object.keys(oldV).map((key, idx) => ( {Object.keys(oldV).map((key, idx) => (
<List.Item key={idx}> <List.Item key={idx}>
{key}: {oldV[key]} <Icon component={FaArrowRight} /> {key}: {oldV[key]} <Icon component={FaArrowRight} />

View File

@@ -1,9 +1,54 @@
import React from "react"; import React from "react";
import { List, Row, Col } from "antd";
import { useTranslation } from "react-i18next";
export default function JobsTotalsTableComponent({ totals }) { export default function JobsTotalsTableComponent({ totals }) {
const { t } = useTranslation();
if (!!!totals) return null;
return ( return (
<div> <Row>
<div>{JSON.stringify(totals, null, 2)}</div> <Col span={8}>
</div> <strong>Rates</strong>
<List size='small'>
<List.Item>{`rate_laa - ${totals.rates.rate_laa.total} (${totals.rates.rate_laa.hours} @ ${totals.rates.rate_laa.rate})`}</List.Item>
<List.Item>{`LAB - ${totals.rates.rate_lab.total} (${totals.rates.rate_lab.hours} @ ${totals.rates.rate_lab.rate})`}</List.Item>
<List.Item>{`rate_lad - ${totals.rates.rate_lad.total} (${totals.rates.rate_lad.hours} @ ${totals.rates.rate_lad.rate})`}</List.Item>
<List.Item>{`rate_lae - ${totals.rates.rate_lae.total} (${totals.rates.rate_lae.hours} @ ${totals.rates.rate_lae.rate})`}</List.Item>
<List.Item>{`rate_laf - ${totals.rates.rate_laf.total} (${totals.rates.rate_laf.hours} @ ${totals.rates.rate_laf.rate})`}</List.Item>
<List.Item>{`rate_lag - ${totals.rates.rate_lag.total} (${totals.rates.rate_lag.hours} @ ${totals.rates.rate_lag.rate})`}</List.Item>
<List.Item>{`rate_lam - ${totals.rates.rate_lam.total} (${totals.rates.rate_lam.hours} @ ${totals.rates.rate_lam.rate})`}</List.Item>
<List.Item>{`rate_lar - ${totals.rates.rate_lar.total} (${totals.rates.rate_lar.hours} @ ${totals.rates.rate_lar.rate})`}</List.Item>
<List.Item>{`rate_las - ${totals.rates.rate_las.total} (${totals.rates.rate_las.hours} @ ${totals.rates.rate_las.rate})`}</List.Item>
<List.Item>{`rate_lau - ${totals.rates.rate_lau.total} (${totals.rates.rate_lau.hours} @ ${totals.rates.rate_lau.rate})`}</List.Item>
<List.Item>{`LA1 - ${totals.rates.rate_la1.total} (${totals.rates.rate_la1.hours} @ ${totals.rates.rate_la1.rate})`}</List.Item>
<List.Item>{`LA2 - ${totals.rates.rate_la2.total} (${totals.rates.rate_la2.hours} @ ${totals.rates.rate_la2.rate})`}</List.Item>
<List.Item>{`LA3 - ${totals.rates.rate_la3.total} (${totals.rates.rate_la3.hours} @ ${totals.rates.rate_la3.rate})`}</List.Item>
<List.Item>{`rate_la4 - ${totals.rates.rate_la4.total} (${totals.rates.rate_la4.hours} @ ${totals.rates.rate_la4.rate})`}</List.Item>
<List.Item>{`paint_mat - ${totals.rates.paint_mat.total} (${totals.rates.paint_mat.hours} @ ${totals.rates.paint_mat.rate})`}</List.Item>
<List.Item>{`shop_mat - ${totals.rates.shop_mat.total} (${totals.rates.shop_mat.hours} @ ${totals.rates.shop_mat.rate})`}</List.Item>
<List.Item>{`rate_atp - ${totals.rates.rate_atp.total} (${totals.rates.rate_atp.hours} @ ${totals.rates.rate_atp.rate})`}</List.Item>
</List>
{`Subtotal: ${totals.rates.subtotal}`}
</Col>
<Col span={8}>
<strong>Parts & Sublet</strong>
<List size='small'>
<List.Item>{`Parts - ${totals.parts.parts.total} (${totals.parts.parts.subtotal} +- ${totals.parts.parts.adjustments})`}</List.Item>
<List.Item>{`Sublet - ${totals.parts.sublets.total} (${totals.parts.sublets.subtotal} +- ${totals.parts.sublets.adjustments})`}</List.Item>
</List>
</Col>
<Col span={8}>
<strong>Totals</strong>
<List size='small'>
<List.Item>{`Subtotal - ${totals.totals.subtotal}`}</List.Item>
<List.Item>{`GST - ${totals.totals.federal_tax}`}</List.Item>
<List.Item>{`PST - ${totals.totals.state_tax}`}</List.Item>
<List.Item>{`Local - ${totals.totals.local_tax}`}</List.Item>
<List.Item>{`Total Payable - ${totals.totals.total_repairs}`}</List.Item>
<List.Item>{`Net Repairs - ${totals.totals.net_repairs}`}</List.Item>
</List>
</Col>
</Row>
); );
} }

View File

@@ -4,30 +4,27 @@ import { QUERY_JOB_FINANCIALS } from "../../graphql/jobs.queries";
import AlertComponent from "../alert/alert.component"; import AlertComponent from "../alert/alert.component";
import LoadingSpinner from "../loading-spinner/loading-spinner.component"; import LoadingSpinner from "../loading-spinner/loading-spinner.component";
import JobTotalsTableComponent from "./job-totals-table.component"; import JobTotalsTableComponent from "./job-totals-table.component";
import { import { CalculateJob } from "./job-totals.utility";
CalculateRatesTotals,
CalculatePartsTotals,
CalculateCustPayable
} from "./job-totals.utility";
export default function JobTotalsTableContainer({ jobId }) { import { connect } from "react-redux";
import { createStructuredSelector } from "reselect";
import { selectBodyshop } from "../../redux/user/user.selectors";
const mapStateToProps = createStructuredSelector({
bodyshop: selectBodyshop
});
export function JobTotalsTableContainer({ jobId, bodyshop }) {
const { loading, error, data } = useQuery(QUERY_JOB_FINANCIALS, { const { loading, error, data } = useQuery(QUERY_JOB_FINANCIALS, {
variables: { jobId: jobId } variables: { jobId: jobId }
}); });
const [totals, setTotals] = useState({}); const [totals, setTotals] = useState(null);
useEffect(() => { useEffect(() => {
if (!!data) { if (!!data) {
setTotals({ setTotals(CalculateJob(data.jobs_by_pk, bodyshop.shoprates));
parts: CalculatePartsTotals(data.jobs_by_pk.joblines),
rates: CalculateRatesTotals(data.jobs_by_pk),
custPayable: CalculateCustPayable(data.jobs_by_pk)
});
} }
}, [data]); }, [data, setTotals, bodyshop.shoprates]);
console.log("totals", totals);
if (loading) return <LoadingSpinner />; if (loading) return <LoadingSpinner />;
if (error) return <AlertComponent message={error.message} type='error' />; if (error) return <AlertComponent message={error.message} type='error' />;
@@ -35,22 +32,8 @@ export default function JobTotalsTableContainer({ jobId }) {
return ( return (
<div> <div>
<JobTotalsTableComponent totals={totals} /> <JobTotalsTableComponent totals={totals} />
<div>
<div>STL Data</div>
<div>
{data
? JSON.stringify(data.jobs_by_pk.cieca_stl.data, null, 2)
: null}
</div>
</div>
<div>
<div>ttl Data</div>
<div>
{data
? JSON.stringify(data.jobs_by_pk.cieca_ttl.data, null, 2)
: null}
</div>
</div>
</div> </div>
); );
} }
export default connect(mapStateToProps, null)(JobTotalsTableContainer);

View File

@@ -1,19 +1,48 @@
export function CalculateRatesTotals(ratesList) { export function CalculateJob(job, shoprates) {
let ret = {
parts: CalculatePartsTotals(job.joblines),
rates: CalculateRatesTotals(job, shoprates),
custPayable: CalculateCustPayable(job)
};
ret.totals = CalculateTaxesTotals(job, ret);
return ret;
}
function CalculateTaxesTotals(job, otherTotals) {
const subtotal =
otherTotals.parts.parts.subtotal +
otherTotals.parts.sublets.subtotal +
otherTotals.rates.subtotal;
let ret = {
subtotal: subtotal,
federal_tax: subtotal * job.federal_tax_rate || 0,
state_tax: subtotal * job.state_tax_rate || 0,
local_tax: subtotal * job.local_tax_rate || 0
};
ret.total_repairs =
ret.subtotal + ret.federal_tax + ret.state_tax + ret.local_tax;
ret.net_repairs = ret.total_repairs - otherTotals.custPayable.total;
return ret;
}
function CalculateRatesTotals(ratesList, shoprates) {
const jobLines = ratesList.joblines; const jobLines = ratesList.joblines;
let ret = { let ret = {
rate_la1: { rate_la1: {
hours: jobLines hours: jobLines
.filter(item => item.mod_lbr_ty === "LA1") .filter(item => item.mod_lbr_ty === "LA1")
.reduce((acc, value) => acc + value.mod_lb_hrs, 0) .reduce((acc, value) => acc + value.mod_lb_hrs, 0),
.toFixed(2),
rate: ratesList.rate_la1 rate: ratesList.rate_la1
}, },
rate_la2: { rate_la2: {
hours: jobLines hours: jobLines
.filter(item => item.mod_lbr_ty === "LA2") .filter(item => item.mod_lbr_ty === "LA2")
.reduce((acc, value) => acc + value.mod_lb_hrs, 0) .reduce((acc, value) => acc + value.mod_lb_hrs, 0),
.toFixed(2),
rate: ratesList.rate_la2 rate: ratesList.rate_la2
}, },
rate_la3: { rate_la3: {
@@ -21,97 +50,113 @@ export function CalculateRatesTotals(ratesList) {
hours: jobLines hours: jobLines
.filter(item => item.mod_lbr_ty === "LA3") .filter(item => item.mod_lbr_ty === "LA3")
.reduce((acc, value) => acc + value.mod_lb_hrs, 0) .reduce((acc, value) => acc + value.mod_lb_hrs, 0)
.toFixed(2)
}, },
rate_la4: { rate_la4: {
rate: ratesList.rate_la4, rate: ratesList.rate_la4,
hours: jobLines hours: jobLines
.filter(item => item.mod_lbr_ty === "LA4") .filter(item => item.mod_lbr_ty === "LA4")
.reduce((acc, value) => acc + value.mod_lb_hrs, 0) .reduce((acc, value) => acc + value.mod_lb_hrs, 0)
.toFixed(2)
}, },
rate_laa: { rate_laa: {
rate: ratesList.rate_laa, rate: ratesList.rate_laa,
hours: jobLines hours: jobLines
.filter(item => item.mod_lbr_ty === "LAA") .filter(item => item.mod_lbr_ty === "LAA")
.reduce((acc, value) => acc + value.mod_lb_hrs, 0) .reduce((acc, value) => acc + value.mod_lb_hrs, 0)
.toFixed(2)
}, },
rate_lab: { rate_lab: {
rate: ratesList.rate_lab, rate: ratesList.rate_lab,
hours: jobLines hours: jobLines
.filter(item => item.mod_lbr_ty === "LAB") .filter(item => item.mod_lbr_ty === "LAB")
.reduce((acc, value) => acc + value.mod_lb_hrs, 0) .reduce((acc, value) => acc + value.mod_lb_hrs, 0)
.toFixed(2)
}, },
rate_lad: { rate_lad: {
rate: ratesList.rate_lad, rate: ratesList.rate_lad,
hours: jobLines hours: jobLines
.filter(item => item.mod_lbr_ty === "LAD") .filter(item => item.mod_lbr_ty === "LAD")
.reduce((acc, value) => acc + value.mod_lb_hrs, 0) .reduce((acc, value) => acc + value.mod_lb_hrs, 0)
.toFixed(2)
}, },
rate_lae: { rate_lae: {
rate: ratesList.rate_lae, rate: ratesList.rate_lae,
hours: jobLines hours: jobLines
.filter(item => item.mod_lbr_ty === "LAE") .filter(item => item.mod_lbr_ty === "LAE")
.reduce((acc, value) => acc + value.mod_lb_hrs, 0) .reduce((acc, value) => acc + value.mod_lb_hrs, 0)
.toFixed(2)
}, },
rate_laf: { rate_laf: {
rate: ratesList.rate_laf, rate: ratesList.rate_laf,
hours: jobLines hours: jobLines
.filter(item => item.mod_lbr_ty === "LAF") .filter(item => item.mod_lbr_ty === "LAF")
.reduce((acc, value) => acc + value.mod_lb_hrs, 0) .reduce((acc, value) => acc + value.mod_lb_hrs, 0)
.toFixed(2)
}, },
rate_lag: { rate_lag: {
rate: ratesList.rate_lag, rate: ratesList.rate_lag,
hours: jobLines hours: jobLines
.filter(item => item.mod_lbr_ty === "LAG") .filter(item => item.mod_lbr_ty === "LAG")
.reduce((acc, value) => acc + value.mod_lb_hrs, 0) .reduce((acc, value) => acc + value.mod_lb_hrs, 0)
.toFixed(2)
}, },
rate_lam: { rate_lam: {
rate: ratesList.rate_lam, rate: ratesList.rate_lam,
hours: jobLines hours: jobLines
.filter(item => item.mod_lbr_ty === "LAM") .filter(item => item.mod_lbr_ty === "LAM")
.reduce((acc, value) => acc + value.mod_lb_hrs, 0) .reduce((acc, value) => acc + value.mod_lb_hrs, 0)
.toFixed(2)
}, },
rate_lar: { rate_lar: {
rate: ratesList.rate_lar, rate: ratesList.rate_lar,
hours: jobLines hours: jobLines
.filter(item => item.mod_lbr_ty === "LAR") .filter(item => item.mod_lbr_ty === "LAR")
.reduce((acc, value) => acc + value.mod_lb_hrs, 0) .reduce((acc, value) => acc + value.mod_lb_hrs, 0)
.toFixed(2)
}, },
rate_las: { rate_las: {
rate: ratesList.rate_las, rate: ratesList.rate_las,
hours: jobLines hours: jobLines
.filter(item => item.mod_lbr_ty === "LAS") .filter(item => item.mod_lbr_ty === "LAS")
.reduce((acc, value) => acc + value.mod_lb_hrs, 0) .reduce((acc, value) => acc + value.mod_lb_hrs, 0)
.toFixed(2)
}, },
rate_lau: { rate_lau: {
rate: ratesList.rate_lau, rate: ratesList.rate_lau,
hours: jobLines hours: jobLines
.filter(item => item.mod_lbr_ty === "LAU") .filter(item => item.mod_lbr_ty === "LAU")
.reduce((acc, value) => acc + value.mod_lb_hrs, 0) .reduce((acc, value) => acc + value.mod_lb_hrs, 0)
.toFixed(2) },
rate_atp: {
rate: shoprates.rate_atp || 0,
hours: jobLines
.filter(
item =>
item.mod_lbr_ty !== "LA1" &&
item.mod_lbr_ty !== "LA2" &&
item.mod_lbr_ty !== "LA3" &&
item.mod_lbr_ty !== "LA4" &&
item.mod_lbr_ty !== "LAU" &&
item.mod_lbr_ty !== "LAG" &&
item.mod_lbr_ty !== "LAS" &&
item.mod_lbr_ty !== "LAA"
)
.reduce((acc, value) => acc + value.mod_lb_hrs, 0)
},
paint_mat: {
rate: ratesList.rate_mapa,
hours: jobLines
.filter(item => item.mod_lbr_ty === "LAR")
.reduce((acc, value) => acc + value.mod_lb_hrs, 0)
},
shop_mat: {
rate: ratesList.rate_mash,
hours: jobLines
.filter(item => item.mod_lbr_ty !== "LAR")
.reduce((acc, value) => acc + value.mod_lb_hrs, 0)
} }
}; };
let subtotal = 0; let subtotal = 0;
for (const property in ret) { for (const property in ret) {
ret[property].total = (ret[property].hours * ret[property].rate).toFixed(2); ret[property].total = ret[property].hours * ret[property].rate;
subtotal = subtotal + ret[property].hours * ret[property].rate; subtotal = subtotal + ret[property].hours * ret[property].rate;
} }
ret.subtotal = subtotal.toFixed(2); ret.subtotal = subtotal;
return ret; return ret;
} }
export function CalculatePartsTotals(jobLines) { function CalculatePartsTotals(jobLines) {
const ret = jobLines.reduce( const ret = jobLines.reduce(
(acc, value) => { (acc, value) => {
switch (value.part_type) { switch (value.part_type) {
@@ -121,8 +166,6 @@ export function CalculatePartsTotals(jobLines) {
case "PAL": case "PAL":
case "PAM": case "PAM":
case "PAN": case "PAN":
case "PAND":
case "PANF":
case "PAO": case "PAO":
case "PAP": case "PAP":
case "PAR": case "PAR":
@@ -163,7 +206,7 @@ export function CalculatePartsTotals(jobLines) {
}; };
} }
export function CalculateCustPayable(job) { function CalculateCustPayable(job) {
return { return {
deductible: job.ded_amt || 0, deductible: job.ded_amt || 0,
federal_tax: job.federal_tax_payable || 0, federal_tax: job.federal_tax_payable || 0,

View File

@@ -48,7 +48,6 @@ export default function JobsDetailFinancials({ job }) {
<InputNumber /> <InputNumber />
</Form.Item> </Form.Item>
<Divider /> <Divider />
Totals Table
<Form.Item <Form.Item
label={t("jobs.fields.labor_rate_desc")} label={t("jobs.fields.labor_rate_desc")}
name='labor_rate_desc'> name='labor_rate_desc'>
@@ -125,7 +124,7 @@ export default function JobsDetailFinancials({ job }) {
<InputNumber /> <InputNumber />
</Form.Item> </Form.Item>
</Col> </Col>
<Col offset={2} span={10}> <Col offset={1} span={12}>
<JobTotalsTableContainer jobId={job.id} /> <JobTotalsTableContainer jobId={job.id} />
</Col> </Col>
</Row> </Row>

View File

@@ -97,8 +97,8 @@ export default function JobsFindModalComponent({
width: "8%", width: "8%",
ellipsis: true, ellipsis: true,
render: (text, record) => { render: (text, record) => {
return record.vehicle.plate_no ? ( return record.plate_no ? (
<span>{record.vehicle.plate_no}</span> <span>{record.plate_no}</span>
) : ( ) : (
t("general.labels.unknown") t("general.labels.unknown")
); );
@@ -134,10 +134,10 @@ export default function JobsFindModalComponent({
<div> <div>
<Table <Table
title={() => t("jobs.labels.existing_jobs")} title={() => t("jobs.labels.existing_jobs")}
size="small" size='small'
pagination={{ position: "bottom" }} pagination={{ position: "bottom" }}
columns={columns.map(item => ({ ...item }))} columns={columns.map(item => ({ ...item }))}
rowKey="id" rowKey='id'
loading={jobsListLoading} loading={jobsListLoading}
dataSource={jobsList} dataSource={jobsList}
rowSelection={{ rowSelection={{
@@ -163,8 +163,7 @@ export default function JobsFindModalComponent({
...importOptions, ...importOptions,
overrideHeaders: e.target.checked overrideHeaders: e.target.checked
}) })
} }>
>
{t("jobs.labels.override_header")} {t("jobs.labels.override_header")}
</Checkbox> </Checkbox>
</div> </div>

View File

@@ -20,6 +20,7 @@ export const QUERY_BODYSHOP = gql`
state_tax_id state_tax_id
updated_at updated_at
zip_post zip_post
shoprates
region_config region_config
md_responsibility_centers md_responsibility_centers
messagingservicesid messagingservicesid

View File

@@ -396,6 +396,12 @@ export const QUERY_JOB_FINANCIALS = gql`
depreciation_taxes depreciation_taxes
federal_tax_payable federal_tax_payable
other_amount_payable other_amount_payable
adjustment_bottom_line
towing_payable
storage_payable
federal_tax_rate
state_tax_rate
local_tax_rate
rate_atp rate_atp
rate_la1 rate_la1
rate_la2 rate_la2

View File

@@ -550,6 +550,9 @@
"override_header": "Override estimate header on import?", "override_header": "Override estimate header on import?",
"parts": "Parts", "parts": "Parts",
"rates": "Rates", "rates": "Rates",
"ratetotals": {
"lab": "Body Total"
},
"vehicle_info": "Vehicle" "vehicle_info": "Vehicle"
}, },
"successes": { "successes": {

View File

@@ -550,6 +550,9 @@
"override_header": "¿Anular encabezado estimado al importar?", "override_header": "¿Anular encabezado estimado al importar?",
"parts": "Partes", "parts": "Partes",
"rates": "Tarifas", "rates": "Tarifas",
"ratetotals": {
"lab": ""
},
"vehicle_info": "Vehículo" "vehicle_info": "Vehículo"
}, },
"successes": { "successes": {

View File

@@ -550,6 +550,9 @@
"override_header": "Remplacer l'en-tête d'estimation à l'importation?", "override_header": "Remplacer l'en-tête d'estimation à l'importation?",
"parts": "les pièces", "parts": "les pièces",
"rates": "Les taux", "rates": "Les taux",
"ratetotals": {
"lab": ""
},
"vehicle_info": "Véhicule" "vehicle_info": "Véhicule"
}, },
"successes": { "successes": {

View File

@@ -0,0 +1,5 @@
- args:
cascade: false
read_only: false
sql: ALTER TABLE "public"."bodyshops" DROP COLUMN "shoprates";
type: run_sql

View File

@@ -0,0 +1,5 @@
- args:
cascade: false
read_only: false
sql: ALTER TABLE "public"."bodyshops" ADD COLUMN "shoprates" jsonb NULL;
type: run_sql

View File

@@ -0,0 +1,43 @@
- args:
role: user
table:
name: bodyshops
schema: public
type: drop_select_permission
- args:
permission:
allow_aggregations: false
columns:
- id
- shopname
- created_at
- updated_at
- address1
- address2
- city
- state
- zip_post
- country
- email
- federal_tax_id
- insurance_vendor_id
- state_tax_id
- logo_img_path
- md_ro_statuses
- region_config
- md_order_statuses
- md_responsibility_centers
- messagingservicesid
computed_fields: []
filter:
associations:
bodyshop:
associations:
user:
authid:
_eq: X-Hasura-User-Id
role: user
table:
name: bodyshops
schema: public
type: create_select_permission

View File

@@ -0,0 +1,44 @@
- 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
- logo_img_path
- md_order_statuses
- md_responsibility_centers
- md_ro_statuses
- messagingservicesid
- region_config
- shopname
- shoprates
- state
- state_tax_id
- 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

View File

@@ -0,0 +1,44 @@
- args:
role: user
table:
name: bodyshops
schema: public
type: drop_update_permission
- args:
permission:
columns:
- md_order_statuses
- md_responsibility_centers
- md_ro_statuses
- address1
- address2
- city
- country
- email
- federal_tax_id
- insurance_vendor_id
- logo_img_path
- region_config
- shopname
- state
- state_tax_id
- zip_post
- created_at
- updated_at
- id
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

View File

@@ -0,0 +1,45 @@
- 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
- logo_img_path
- md_order_statuses
- md_responsibility_centers
- md_ro_statuses
- region_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