diff --git a/bodyshop_translations.babel b/bodyshop_translations.babel index 01e5865c2..bd8a11b7b 100644 --- a/bodyshop_translations.babel +++ b/bodyshop_translations.babel @@ -1316,6 +1316,27 @@ labels + + deductfromlabor + false + + + + + + en-US + false + + + es-MX + false + + + fr-CA + false + + + entered false @@ -2699,6 +2720,27 @@ + + default_adjustment_rate + false + + + + + + en-US + false + + + es-MX + false + + + fr-CA + false + + + deliver @@ -16607,6 +16649,27 @@ + + adjustmentrate + false + + + + + + en-US + false + + + es-MX + false + + + fr-CA + false + + + adjustments false diff --git a/client/src/components/bill-enter-modal/bill-enter-modal.container.jsx b/client/src/components/bill-enter-modal/bill-enter-modal.container.jsx index d92c7226c..55081c128 100644 --- a/client/src/components/bill-enter-modal/bill-enter-modal.container.jsx +++ b/client/src/components/bill-enter-modal/bill-enter-modal.container.jsx @@ -5,15 +5,15 @@ import { useTranslation } from "react-i18next"; import { connect } from "react-redux"; import { createStructuredSelector } from "reselect"; import { INSERT_NEW_BILL } from "../../graphql/bills.queries"; +import { UPDATE_JOB_LINE_STATUS } from "../../graphql/jobs-lines.queries"; import { toggleModalVisible } from "../../redux/modals/modals.actions"; import { selectBillEnterModal } from "../../redux/modals/modals.selectors"; import { selectBodyshop, selectCurrentUser, } from "../../redux/user/user.selectors"; -import { handleUpload } from "../documents-upload/documents-upload.utility"; import BillFormContainer from "../bill-form/bill-form.container"; -import { UPDATE_JOB_LINE_STATUS } from "../../graphql/jobs-lines.queries"; +import { handleUpload } from "../documents-upload/documents-upload.utility"; const mapStateToProps = createStructuredSelector({ billEnterModal: selectBillEnterModal, @@ -37,81 +37,98 @@ function BillEnterModalContainer({ const [updateJobLines] = useMutation(UPDATE_JOB_LINE_STATUS); const [loading, setLoading] = useState(false); - const handleFinish = (values) => { + const handleFinish = async (values) => { + console.log( + "🚀 ~ file: bill-enter-modal.container.jsx ~ line 41 ~ handleFinish ~ values", + values + ); setLoading(true); const { upload, location, ...remainingValues } = values; - insertBill({ + + const adjustmentsToInsert = []; + + const r1 = await insertBill({ variables: { bill: [ - Object.assign({}, remainingValues, { + { + ...remainingValues, billlines: { data: remainingValues.billlines && remainingValues.billlines.map((i) => { + const { deductfromlabor, lbr_adjustment, ...restI } = i; + if (deductfromlabor) { + adjustmentsToInsert.push({ + ...lbr_adjustment, + act_price: i.act_price, + }); + } return { - ...i, + ...restI, joblineid: i.joblineid === "noline" ? null : i.joblineid, }; }), }, - }), + }, ], }, - }) - .then((r) => { - const billId = r.data.insert_bills.returning[0].id; + }); - updateJobLines({ - variables: { - ids: remainingValues.billlines - .filter((il) => il.joblineid !== "noline") - .map((li) => li.joblineid), - status: bodyshop.md_order_statuses.default_received || "Received*", - location: location, - }, - }).then((joblineresult) => { - ///////////////////////// - if (upload && upload.length > 0) { - //insert Each of the documents? - upload.forEach((u) => { - handleUpload( - { file: u.originFileObj }, - { - bodyshop: bodyshop, - uploaded_by: currentUser.email, - jobId: values.jobid, - billId: billId, - tagsArray: null, - callback: null, - } - ); - }); - } - /////////////////////////// - setLoading(false); - notification["success"]({ - message: t("bills.successes.created"), - }); - if (billEnterModal.actions.refetch) billEnterModal.actions.refetch(); - - if (enterAgain) { - form.resetFields(); - form.setFieldsValue({ billlines: [] }); - } else { - toggleModalVisible(); - } - setEnterAgain(false); - }); - }) - .catch((error) => { - setLoading(false); - setEnterAgain(false); - notification["error"]({ - message: t("bills.errors.creating", { - message: JSON.stringify(error), - }), - }); + if (!!r1.errors) { + setLoading(false); + setEnterAgain(false); + notification["error"]({ + message: t("bills.errors.creating", { + message: JSON.stringify(r1.errors), + }), }); + } + + const billId = r1.data.insert_bills.returning[0].id; + + await updateJobLines({ + variables: { + ids: remainingValues.billlines + .filter((il) => il.joblineid !== "noline") + .map((li) => li.joblineid), + status: bodyshop.md_order_statuses.default_received || "Received*", + location: location, + }, + }); + + console.log("adjustmentsToInsert", adjustmentsToInsert); + + ///////////////////////// + if (upload && upload.length > 0) { + //insert Each of the documents? + upload.forEach((u) => { + handleUpload( + { file: u.originFileObj }, + { + bodyshop: bodyshop, + uploaded_by: currentUser.email, + jobId: values.jobid, + billId: billId, + tagsArray: null, + callback: null, + } + ); + }); + } + /////////////////////////// + setLoading(false); + notification["success"]({ + message: t("bills.successes.created"), + }); + if (billEnterModal.actions.refetch) billEnterModal.actions.refetch(); + + if (enterAgain) { + form.resetFields(); + form.setFieldsValue({ billlines: [] }); + } else { + toggleModalVisible(); + } + setEnterAgain(false); }; const handleCancel = () => { diff --git a/client/src/components/bill-form/bill-form.component.jsx b/client/src/components/bill-form/bill-form.component.jsx index adf573c5a..9f12c1b3f 100644 --- a/client/src/components/bill-form/bill-form.component.jsx +++ b/client/src/components/bill-form/bill-form.component.jsx @@ -66,6 +66,14 @@ export function BillFormComponent({ return (
+ + + - - - - + - Click to upload - {() => { const values = form.getFieldsValue([ diff --git a/client/src/components/bill-form/bill-form.lines.component.jsx b/client/src/components/bill-form/bill-form.lines.component.jsx index 40bfea588..11e044c07 100644 --- a/client/src/components/bill-form/bill-form.lines.component.jsx +++ b/client/src/components/bill-form/bill-form.lines.component.jsx @@ -10,11 +10,24 @@ import { } from "antd"; import React from "react"; import { useTranslation } from "react-i18next"; -import CurrencyInput from "../form-items-formatted/currency-form-item.component"; import BillLineSearchSelect from "../bill-line-search-select/bill-line-search-select.component"; +import CurrencyInput from "../form-items-formatted/currency-form-item.component"; import FormListMoveArrows from "../form-list-move-arrows/form-list-move-arrows.component"; import LayoutFormRow from "../layout-form-row/layout-form-row.component"; -export default function BillEnterModalLinesComponent({ + +import { connect } from "react-redux"; +import { createStructuredSelector } from "reselect"; +import { selectBodyshop } from "../../redux/user/user.selectors"; +const mapStateToProps = createStructuredSelector({ + //currentUser: selectCurrentUser + bodyshop: selectBodyshop, +}); +const mapDispatchToProps = (dispatch) => ({ + //setUserLanguage: language => dispatch(setUserLanguage(language)) +}); + +export function BillEnterModalLinesComponent({ + bodyshop, disabled, lineData, discount, @@ -22,7 +35,7 @@ export default function BillEnterModalLinesComponent({ responsibilityCenters, }) { const { t } = useTranslation(); - const { setFieldsValue, getFieldsValue } = form; + const { setFieldsValue, getFieldsValue, getFieldValue } = form; return ( @@ -212,6 +225,110 @@ export default function BillEnterModalLinesComponent({ > + + + + + prev.billlines[index].deductfromlabor !== + cur.billlines[index].deductfromlabor + } + > + {() => { + if ( + getFieldValue([ + "billlines", + field.name, + "deductfromlabor", + ]) + ) + return ( +
+ + + + + + +
+ ); + return ; + }} +
); } + +export default connect( + mapStateToProps, + mapDispatchToProps +)(BillEnterModalLinesComponent); diff --git a/client/src/components/form-items-formatted/phone-form-item.component.jsx b/client/src/components/form-items-formatted/phone-form-item.component.jsx index 728ee4ede..431293b19 100644 --- a/client/src/components/form-items-formatted/phone-form-item.component.jsx +++ b/client/src/components/form-items-formatted/phone-form-item.component.jsx @@ -20,12 +20,16 @@ export default forwardRef(FormItemPhone); export const PhoneItemFormatterValidation = (getFieldValue, name) => ({ async validator(rule, value) { - const p = phone(getFieldValue(name), "us"); - const p2 = phone(getFieldValue(name), "ca"); - if (p.length > 0 || p2.length > 0) { + if (!getFieldValue(name)) { return Promise.resolve(); } else { - return Promise.reject(i18n.t("general.validation.invalidphone")); + const p = phone(getFieldValue(name), "us"); + const p2 = phone(getFieldValue(name), "ca"); + if (p.length > 0 || p2.length > 0) { + return Promise.resolve(); + } else { + return Promise.reject(i18n.t("general.validation.invalidphone")); + } } // PhoneInput({ diff --git a/client/src/components/labor-allocations-adjustment-edit/labor-allocations-adjustment-edit.component.jsx b/client/src/components/labor-allocations-adjustment-edit/labor-allocations-adjustment-edit.component.jsx index 71c07a48e..3281474e9 100644 --- a/client/src/components/labor-allocations-adjustment-edit/labor-allocations-adjustment-edit.component.jsx +++ b/client/src/components/labor-allocations-adjustment-edit/labor-allocations-adjustment-edit.component.jsx @@ -15,7 +15,7 @@ import { UPDATE_JOB } from "../../graphql/jobs.queries"; export default function LaborAllocationsAdjustmentEdit({ jobId, mod_lbr_ty, - adjustments = [], + adjustments, children, }) { const [loading, setLoading] = useState(false); @@ -30,10 +30,10 @@ export default function LaborAllocationsAdjustmentEdit({ variables: { jobId: jobId, job: { - lbr_adjustments: [ - { mod_lbr_ty: values.mod_lbr_ty, hours: values.hours }, - ...adjustments.filter((a) => a.mod_lbr_ty !== values.mod_lbr_ty), - ], + lbr_adjustments: { + ...adjustments, + [values.mod_lbr_ty]: values.hours, + }, }, }, }); @@ -61,8 +61,7 @@ export default function LaborAllocationsAdjustmentEdit({ onFinish={handleFinish} initialValues={{ mod_lbr_ty: mod_lbr_ty, - hours: adjustments.filter((i) => i.mod_lbr_ty === mod_lbr_ty)[0] - ?.hours, + hours: adjustments[mod_lbr_ty], }} > self.indexOf(value) === index && !!value); const ticketCodes = timetickets.map((item) => item.cieca_code); //.filter((value, index, self) => self.indexOf(value) === index && !!value); - const adjustmentCodes = adjustments.map((item) => item.mod_lbr_ty); - //.filter((value, index, self) => self.indexOf(value) === index && !!value); - const allCodes = [...jobCodes, ...ticketCodes, ...adjustmentCodes].filter( + const allCodes = [...jobCodes, ...ticketCodes].filter( (value, index, self) => self.indexOf(value) === index && !!value ); @@ -21,11 +19,7 @@ export const CalculateAllocationsTotals = ( total: joblines.reduce((acc2, val2) => { return val2.mod_lbr_ty === value ? acc2 + val2.mod_lb_hrs : acc2; }, 0), - adjustments: adjustments.reduce((acc3, val3) => { - console.log("acc3", acc3); - console.log("val3", val3); - return val3.mod_lbr_ty === value ? acc3 + val3.hours : acc3; - }, 0), + adjustments: adjustments[value] || 0, claimed: timetickets.reduce((acc3, val3) => { return val3.ciecacode === value ? acc3 + val3.productivehrs : acc3; }, 0), diff --git a/client/src/components/shop-info/shop-info.component.jsx b/client/src/components/shop-info/shop-info.component.jsx index fc9d98c37..c6cc3d7c4 100644 --- a/client/src/components/shop-info/shop-info.component.jsx +++ b/client/src/components/shop-info/shop-info.component.jsx @@ -285,6 +285,18 @@ export default function ShopInfoComponent({ form, saveLoading }) { > + + + {() => { return ( diff --git a/client/src/graphql/bodyshop.queries.js b/client/src/graphql/bodyshop.queries.js index fc16d92f7..8989f5a0b 100644 --- a/client/src/graphql/bodyshop.queries.js +++ b/client/src/graphql/bodyshop.queries.js @@ -75,6 +75,7 @@ export const QUERY_BODYSHOP = gql` schedule_start_time schedule_end_time imexshopid + default_adjustment_rate employees { id first_name @@ -148,6 +149,7 @@ export const UPDATE_SHOP = gql` schedule_start_time schedule_end_time imexshopid + default_adjustment_rate employees { id first_name diff --git a/client/src/translations/en_us/common.json b/client/src/translations/en_us/common.json index d07d563d1..0630d604a 100644 --- a/client/src/translations/en_us/common.json +++ b/client/src/translations/en_us/common.json @@ -97,6 +97,7 @@ "state_tax_applicable": "St. Tax?" }, "labels": { + "deductfromlabor": "Deduct from Labor?", "entered": "Entered", "from": "From", "other": "--Not On Estimate--", @@ -184,6 +185,7 @@ "country": "Country", "dailybodytarget": "Scoreboard - Daily Body Target", "dailypainttarget": "Scoreboard - Daily Paint Target", + "default_adjustment_rate": "Default Labor Deduction Adjustment Rate", "deliver": { "templates": "Delivery Templates" }, @@ -1026,6 +1028,7 @@ }, "labels": { "additionaltotal": "Additional Total", + "adjustmentrate": "Adjustment Rate", "adjustments": "Adjustments", "allocations": "Allocations", "appointmentconfirmation": "Send confirmation to customer?", diff --git a/client/src/translations/es/common.json b/client/src/translations/es/common.json index 854e49f28..9b713b47a 100644 --- a/client/src/translations/es/common.json +++ b/client/src/translations/es/common.json @@ -97,6 +97,7 @@ "state_tax_applicable": "" }, "labels": { + "deductfromlabor": "", "entered": "", "from": "", "other": "", @@ -184,6 +185,7 @@ "country": "", "dailybodytarget": "", "dailypainttarget": "", + "default_adjustment_rate": "", "deliver": { "templates": "" }, @@ -1026,6 +1028,7 @@ }, "labels": { "additionaltotal": "", + "adjustmentrate": "", "adjustments": "", "allocations": "", "appointmentconfirmation": "¿Enviar confirmación al cliente?", diff --git a/client/src/translations/fr/common.json b/client/src/translations/fr/common.json index 6d3c4e7a5..37aa460c7 100644 --- a/client/src/translations/fr/common.json +++ b/client/src/translations/fr/common.json @@ -97,6 +97,7 @@ "state_tax_applicable": "" }, "labels": { + "deductfromlabor": "", "entered": "", "from": "", "other": "", @@ -184,6 +185,7 @@ "country": "", "dailybodytarget": "", "dailypainttarget": "", + "default_adjustment_rate": "", "deliver": { "templates": "" }, @@ -1026,6 +1028,7 @@ }, "labels": { "additionaltotal": "", + "adjustmentrate": "", "adjustments": "", "allocations": "", "appointmentconfirmation": "Envoyer une confirmation au client?", diff --git a/hasura/migrations/1610151515378_alter_table_public_bodyshops_add_column_default_adjustment_rate/down.yaml b/hasura/migrations/1610151515378_alter_table_public_bodyshops_add_column_default_adjustment_rate/down.yaml new file mode 100644 index 000000000..5573d6d5a --- /dev/null +++ b/hasura/migrations/1610151515378_alter_table_public_bodyshops_add_column_default_adjustment_rate/down.yaml @@ -0,0 +1,5 @@ +- args: + cascade: false + read_only: false + sql: ALTER TABLE "public"."bodyshops" DROP COLUMN "default_adjustment_rate"; + type: run_sql diff --git a/hasura/migrations/1610151515378_alter_table_public_bodyshops_add_column_default_adjustment_rate/up.yaml b/hasura/migrations/1610151515378_alter_table_public_bodyshops_add_column_default_adjustment_rate/up.yaml new file mode 100644 index 000000000..088ae9774 --- /dev/null +++ b/hasura/migrations/1610151515378_alter_table_public_bodyshops_add_column_default_adjustment_rate/up.yaml @@ -0,0 +1,6 @@ +- args: + cascade: false + read_only: false + sql: ALTER TABLE "public"."bodyshops" ADD COLUMN "default_adjustment_rate" numeric + NULL; + type: run_sql diff --git a/hasura/migrations/1610151541751_alter_table_public_bodyshops_alter_column_default_adjustment_rate/down.yaml b/hasura/migrations/1610151541751_alter_table_public_bodyshops_alter_column_default_adjustment_rate/down.yaml new file mode 100644 index 000000000..5d447309b --- /dev/null +++ b/hasura/migrations/1610151541751_alter_table_public_bodyshops_alter_column_default_adjustment_rate/down.yaml @@ -0,0 +1,6 @@ +- args: + cascade: false + read_only: false + sql: ALTER TABLE ONLY "public"."bodyshops" ALTER COLUMN "default_adjustment_rate" + DROP DEFAULT; + type: run_sql diff --git a/hasura/migrations/1610151541751_alter_table_public_bodyshops_alter_column_default_adjustment_rate/up.yaml b/hasura/migrations/1610151541751_alter_table_public_bodyshops_alter_column_default_adjustment_rate/up.yaml new file mode 100644 index 000000000..a96099d7b --- /dev/null +++ b/hasura/migrations/1610151541751_alter_table_public_bodyshops_alter_column_default_adjustment_rate/up.yaml @@ -0,0 +1,6 @@ +- args: + cascade: false + read_only: false + sql: ALTER TABLE ONLY "public"."bodyshops" ALTER COLUMN "default_adjustment_rate" + SET DEFAULT 0; + type: run_sql diff --git a/hasura/migrations/1610151569143_update_permission_user_public_table_bodyshops/down.yaml b/hasura/migrations/1610151569143_update_permission_user_public_table_bodyshops/down.yaml new file mode 100644 index 000000000..0acc18430 --- /dev/null +++ b/hasura/migrations/1610151569143_update_permission_user_public_table_bodyshops/down.yaml @@ -0,0 +1,75 @@ +- args: + role: user + table: + name: bodyshops + schema: public + type: drop_select_permission +- args: + permission: + allow_aggregations: false + columns: + - accountingconfig + - address1 + - address2 + - appt_alt_transport + - appt_colors + - appt_length + - bill_tax_rates + - city + - country + - created_at + - deliverchecklist + - email + - enforce_class + - federal_tax_id + - id + - imexshopid + - inhousevendorid + - insurance_vendor_id + - intakechecklist + - logo_img_path + - md_categories + - md_classes + - md_ins_cos + - md_labor_rates + - md_messaging_presets + - md_notes_presets + - md_order_statuses + - md_parts_locations + - md_rbac + - md_referral_sources + - md_responsibility_centers + - md_ro_statuses + - messagingservicesid + - phone + - prodtargethrs + - production_config + - region_config + - schedule_end_time + - schedule_start_time + - scoreboard_target + - shopname + - shoprates + - speedprint + - ssbuckets + - state + - state_tax_id + - stripe_acct_id + - target_touchtime + - 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/1610151569143_update_permission_user_public_table_bodyshops/up.yaml b/hasura/migrations/1610151569143_update_permission_user_public_table_bodyshops/up.yaml new file mode 100644 index 000000000..c49b55fed --- /dev/null +++ b/hasura/migrations/1610151569143_update_permission_user_public_table_bodyshops/up.yaml @@ -0,0 +1,76 @@ +- args: + role: user + table: + name: bodyshops + schema: public + type: drop_select_permission +- args: + permission: + allow_aggregations: false + columns: + - accountingconfig + - address1 + - address2 + - appt_alt_transport + - appt_colors + - appt_length + - bill_tax_rates + - city + - country + - created_at + - default_adjustment_rate + - deliverchecklist + - email + - enforce_class + - federal_tax_id + - id + - imexshopid + - inhousevendorid + - insurance_vendor_id + - intakechecklist + - logo_img_path + - md_categories + - md_classes + - md_ins_cos + - md_labor_rates + - md_messaging_presets + - md_notes_presets + - md_order_statuses + - md_parts_locations + - md_rbac + - md_referral_sources + - md_responsibility_centers + - md_ro_statuses + - messagingservicesid + - phone + - prodtargethrs + - production_config + - region_config + - schedule_end_time + - schedule_start_time + - scoreboard_target + - shopname + - shoprates + - speedprint + - ssbuckets + - state + - state_tax_id + - stripe_acct_id + - target_touchtime + - 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/1610151590206_update_permission_user_public_table_bodyshops/down.yaml b/hasura/migrations/1610151590206_update_permission_user_public_table_bodyshops/down.yaml new file mode 100644 index 000000000..660df165c --- /dev/null +++ b/hasura/migrations/1610151590206_update_permission_user_public_table_bodyshops/down.yaml @@ -0,0 +1,68 @@ +- args: + role: user + table: + name: bodyshops + schema: public + type: drop_update_permission +- args: + permission: + columns: + - accountingconfig + - address1 + - address2 + - appt_alt_transport + - appt_colors + - appt_length + - bill_tax_rates + - city + - country + - created_at + - deliverchecklist + - email + - enforce_class + - federal_tax_id + - id + - inhousevendorid + - insurance_vendor_id + - intakechecklist + - logo_img_path + - md_categories + - md_classes + - md_ins_cos + - md_labor_rates + - md_messaging_presets + - md_notes_presets + - md_order_statuses + - md_parts_locations + - md_rbac + - md_referral_sources + - md_responsibility_centers + - md_ro_statuses + - phone + - prodtargethrs + - production_config + - schedule_end_time + - schedule_start_time + - scoreboard_target + - shopname + - shoprates + - speedprint + - ssbuckets + - state + - state_tax_id + - target_touchtime + - updated_at + - zip_post + filter: + associations: + bodyshop: + associations: + user: + authid: + _eq: X-Hasura-User-Id + set: {} + role: user + table: + name: bodyshops + schema: public + type: create_update_permission diff --git a/hasura/migrations/1610151590206_update_permission_user_public_table_bodyshops/up.yaml b/hasura/migrations/1610151590206_update_permission_user_public_table_bodyshops/up.yaml new file mode 100644 index 000000000..ef19e6f61 --- /dev/null +++ b/hasura/migrations/1610151590206_update_permission_user_public_table_bodyshops/up.yaml @@ -0,0 +1,69 @@ +- args: + role: user + table: + name: bodyshops + schema: public + type: drop_update_permission +- args: + permission: + columns: + - accountingconfig + - address1 + - address2 + - appt_alt_transport + - appt_colors + - appt_length + - bill_tax_rates + - city + - country + - created_at + - default_adjustment_rate + - deliverchecklist + - email + - enforce_class + - federal_tax_id + - id + - inhousevendorid + - insurance_vendor_id + - intakechecklist + - logo_img_path + - md_categories + - md_classes + - md_ins_cos + - md_labor_rates + - md_messaging_presets + - md_notes_presets + - md_order_statuses + - md_parts_locations + - md_rbac + - md_referral_sources + - md_responsibility_centers + - md_ro_statuses + - phone + - prodtargethrs + - production_config + - schedule_end_time + - schedule_start_time + - scoreboard_target + - shopname + - shoprates + - speedprint + - ssbuckets + - state + - state_tax_id + - target_touchtime + - updated_at + - zip_post + filter: + associations: + bodyshop: + associations: + user: + authid: + _eq: X-Hasura-User-Id + set: {} + role: user + table: + name: bodyshops + schema: public + type: create_update_permission diff --git a/hasura/migrations/1610154781199_alter_table_public_jobs_alter_column_lbr_adjustments/down.yaml b/hasura/migrations/1610154781199_alter_table_public_jobs_alter_column_lbr_adjustments/down.yaml new file mode 100644 index 000000000..9c0fd5472 --- /dev/null +++ b/hasura/migrations/1610154781199_alter_table_public_jobs_alter_column_lbr_adjustments/down.yaml @@ -0,0 +1,6 @@ +- args: + cascade: false + read_only: false + sql: ALTER TABLE ONLY "public"."jobs" ALTER COLUMN "lbr_adjustments" SET DEFAULT + jsonb_build_array(); + type: run_sql diff --git a/hasura/migrations/1610154781199_alter_table_public_jobs_alter_column_lbr_adjustments/up.yaml b/hasura/migrations/1610154781199_alter_table_public_jobs_alter_column_lbr_adjustments/up.yaml new file mode 100644 index 000000000..baa82ffbd --- /dev/null +++ b/hasura/migrations/1610154781199_alter_table_public_jobs_alter_column_lbr_adjustments/up.yaml @@ -0,0 +1,6 @@ +- args: + cascade: false + read_only: false + sql: ALTER TABLE ONLY "public"."jobs" ALTER COLUMN "lbr_adjustments" SET DEFAULT + jsonb_build_object(); + type: run_sql diff --git a/hasura/migrations/metadata.yaml b/hasura/migrations/metadata.yaml index 1673ed8b6..b3db13652 100644 --- a/hasura/migrations/metadata.yaml +++ b/hasura/migrations/metadata.yaml @@ -707,6 +707,7 @@ tables: - city - country - created_at + - default_adjustment_rate - deliverchecklist - email - enforce_class @@ -770,6 +771,7 @@ tables: - city - country - created_at + - default_adjustment_rate - deliverchecklist - email - enforce_class