feature/IO-3357-Reynolds-and-Reynolds-DMS-API-Integration - Checkpoint
This commit is contained in:
@@ -14,7 +14,6 @@ import FormListMoveArrows from "../form-list-move-arrows/form-list-move-arrows.c
|
|||||||
import LayoutFormRow from "../layout-form-row/layout-form-row.component";
|
import LayoutFormRow from "../layout-form-row/layout-form-row.component";
|
||||||
import RbacWrapper from "../rbac-wrapper/rbac-wrapper.component";
|
import RbacWrapper from "../rbac-wrapper/rbac-wrapper.component";
|
||||||
import ShopInfoResponsibilitycentersTaxesComponent from "./shop-info.responsibilitycenters.taxes.component";
|
import ShopInfoResponsibilitycentersTaxesComponent from "./shop-info.responsibilitycenters.taxes.component";
|
||||||
import ShopInfoRRConfigurationComponent from "./shop-info.rr-configuration.component";
|
|
||||||
import { bodyshopHasDmsKey } from "../../utils/dmsUtils.js";
|
import { bodyshopHasDmsKey } from "../../utils/dmsUtils.js";
|
||||||
|
|
||||||
const SelectorDiv = styled.div`
|
const SelectorDiv = styled.div`
|
||||||
@@ -67,8 +66,9 @@ export function ShopInfoResponsibilityCenterComponent({ bodyshop, form }) {
|
|||||||
<RbacWrapper action="shop:responsibilitycenter">
|
<RbacWrapper action="shop:responsibilitycenter">
|
||||||
{hasDMSKey && (
|
{hasDMSKey && (
|
||||||
<>
|
<>
|
||||||
{bodyshop.rr_dealerid && <ShopInfoRRConfigurationComponent form={form} />}
|
{bodyshop.rr_dealerid && (
|
||||||
|
<DataLabel label={t("bodyshop.labels.dms.rr_dealerid")}>{form.getFieldValue("rr_dealerid")}</DataLabel>
|
||||||
|
)}
|
||||||
{bodyshop.cdk_dealerid && (
|
{bodyshop.cdk_dealerid && (
|
||||||
<DataLabel label={t("bodyshop.labels.dms.cdk_dealerid")}>{form.getFieldValue("cdk_dealerid")}</DataLabel>
|
<DataLabel label={t("bodyshop.labels.dms.cdk_dealerid")}>{form.getFieldValue("cdk_dealerid")}</DataLabel>
|
||||||
)}
|
)}
|
||||||
@@ -77,6 +77,7 @@ export function ShopInfoResponsibilityCenterComponent({ bodyshop, form }) {
|
|||||||
{form.getFieldValue("pbs_serialnumber")}
|
{form.getFieldValue("pbs_serialnumber")}
|
||||||
</DataLabel>
|
</DataLabel>
|
||||||
)}
|
)}
|
||||||
|
|
||||||
<LayoutFormRow>
|
<LayoutFormRow>
|
||||||
<Form.Item
|
<Form.Item
|
||||||
label={t("bodyshop.fields.dms.default_journal")}
|
label={t("bodyshop.fields.dms.default_journal")}
|
||||||
@@ -177,6 +178,9 @@ export function ShopInfoResponsibilityCenterComponent({ bodyshop, form }) {
|
|||||||
</Form.Item>
|
</Form.Item>
|
||||||
)}
|
)}
|
||||||
</LayoutFormRow>
|
</LayoutFormRow>
|
||||||
|
|
||||||
|
{!bodyshop.rr_dealerid && (
|
||||||
|
<>
|
||||||
<LayoutFormRow header={t("bodyshop.labels.dms.cdk.payers")}>
|
<LayoutFormRow header={t("bodyshop.labels.dms.cdk.payers")}>
|
||||||
<Form.List name={["cdk_configuration", "payers"]}>
|
<Form.List name={["cdk_configuration", "payers"]}>
|
||||||
{(fields, { add, remove, move }) => {
|
{(fields, { add, remove, move }) => {
|
||||||
@@ -313,13 +317,9 @@ export function ShopInfoResponsibilityCenterComponent({ bodyshop, form }) {
|
|||||||
</LayoutFormRow>
|
</LayoutFormRow>
|
||||||
</>
|
</>
|
||||||
)}
|
)}
|
||||||
{bodyshop.pbs_serialnumber && (
|
|
||||||
<>
|
|
||||||
<DataLabel label={t("bodyshop.labels.dms.pbs_serialnumber")}>
|
|
||||||
{form.getFieldValue("pbs_serialnumber")}
|
|
||||||
</DataLabel>
|
|
||||||
</>
|
</>
|
||||||
)}
|
)}
|
||||||
|
|
||||||
{HasFeatureAccess({ featureName: "export", bodyshop }) && (
|
{HasFeatureAccess({ featureName: "export", bodyshop }) && (
|
||||||
<>
|
<>
|
||||||
<LayoutFormRow header={t("bodyshop.labels.responsibilitycenters.costs")} id="costs">
|
<LayoutFormRow header={t("bodyshop.labels.responsibilitycenters.costs")} id="costs">
|
||||||
@@ -592,7 +592,6 @@ export function ShopInfoResponsibilityCenterComponent({ bodyshop, form }) {
|
|||||||
</LayoutFormRow>
|
</LayoutFormRow>
|
||||||
<SelectorDiv>
|
<SelectorDiv>
|
||||||
{hasDMSKey && (
|
{hasDMSKey && (
|
||||||
<>
|
|
||||||
<LayoutFormRow id="mappingname" header={t("bodyshop.labels.dms.dms_allocations")}>
|
<LayoutFormRow id="mappingname" header={t("bodyshop.labels.dms.dms_allocations")}>
|
||||||
<Form.List name={["md_responsibility_centers", "dms_defaults"]}>
|
<Form.List name={["md_responsibility_centers", "dms_defaults"]}>
|
||||||
{(fields, { add, remove }) => {
|
{(fields, { add, remove }) => {
|
||||||
@@ -2216,7 +2215,6 @@ export function ShopInfoResponsibilityCenterComponent({ bodyshop, form }) {
|
|||||||
}}
|
}}
|
||||||
</Form.List>
|
</Form.List>
|
||||||
</LayoutFormRow>
|
</LayoutFormRow>
|
||||||
</>
|
|
||||||
)}
|
)}
|
||||||
|
|
||||||
<LayoutFormRow header={t("bodyshop.labels.defaultcostsmapping")}>
|
<LayoutFormRow header={t("bodyshop.labels.defaultcostsmapping")}>
|
||||||
|
|||||||
@@ -1,130 +0,0 @@
|
|||||||
import { Card, Divider, Form, Input, Select, Switch, Tooltip } from "antd";
|
|
||||||
|
|
||||||
const { Option } = Select;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Reynolds & Reynolds Configuration Section
|
|
||||||
* Stored under bodyshop.rr_configuration (JSONB)
|
|
||||||
*
|
|
||||||
* NOTE:
|
|
||||||
* - Do NOT put credentials/endpoints here. Those live in env secrets.
|
|
||||||
* - These are dealer/location-specific values that the backend reads from rr_configuration.
|
|
||||||
* Keys match server usage: dealer_code, dealer_name, location_id, store_number, branch_number, etc.
|
|
||||||
*/
|
|
||||||
export default function ShopInfoRRConfigurationComponent() {
|
|
||||||
return (
|
|
||||||
<Card title="Reynolds & Reynolds Configuration" variant={false}>
|
|
||||||
{/* Dealer / Location identifiers (dealer-specific, not secrets) */}
|
|
||||||
<Form.Item
|
|
||||||
label="Dealer Code"
|
|
||||||
name={["rr_configuration", "dealer_code"]}
|
|
||||||
tooltip="Your RR Dealer Code / Dealer Number provided in the welcome kit."
|
|
||||||
rules={[{ required: true, message: "Dealer Code is required for RR integration" }]}
|
|
||||||
>
|
|
||||||
<Input placeholder="e.g. 12345" />
|
|
||||||
</Form.Item>
|
|
||||||
|
|
||||||
<Form.Item
|
|
||||||
label="Dealer Name"
|
|
||||||
name={["rr_configuration", "dealer_name"]}
|
|
||||||
tooltip="Optional display name for this dealer as it should appear on outbound requests."
|
|
||||||
>
|
|
||||||
<Input placeholder="e.g. Rome Collision Centre" />
|
|
||||||
</Form.Item>
|
|
||||||
|
|
||||||
<Form.Item
|
|
||||||
label="Location ID"
|
|
||||||
name={["rr_configuration", "location_id"]}
|
|
||||||
tooltip="If your RR account uses Location/Branch identifiers, enter the Location ID here."
|
|
||||||
>
|
|
||||||
<Input placeholder="e.g. 01" />
|
|
||||||
</Form.Item>
|
|
||||||
|
|
||||||
<Form.Item
|
|
||||||
label="Store Number"
|
|
||||||
name={["rr_configuration", "store_number"]}
|
|
||||||
tooltip="Optional: RR Store # (from welcome kit)."
|
|
||||||
>
|
|
||||||
<Input placeholder="e.g. 0001" />
|
|
||||||
</Form.Item>
|
|
||||||
|
|
||||||
<Form.Item
|
|
||||||
label="Branch Number"
|
|
||||||
name={["rr_configuration", "branch_number"]}
|
|
||||||
tooltip="Optional: RR Branch # (from welcome kit)."
|
|
||||||
>
|
|
||||||
<Input placeholder="e.g. 10" />
|
|
||||||
</Form.Item>
|
|
||||||
|
|
||||||
<Form.Item
|
|
||||||
label="Default Advisor ID"
|
|
||||||
name={["rr_configuration", "default_advisor_id"]}
|
|
||||||
tooltip="Default Service Advisor to assign on RO export (can be overridden per export)."
|
|
||||||
>
|
|
||||||
<Input placeholder="e.g. 007" />
|
|
||||||
</Form.Item>
|
|
||||||
|
|
||||||
<Divider />
|
|
||||||
|
|
||||||
{/* Feature flags (safe to store in config) */}
|
|
||||||
<Form.Item
|
|
||||||
label="Enable RR Integration"
|
|
||||||
name={["rr_configuration", "enable_rr_integration"]}
|
|
||||||
valuePropName="checked"
|
|
||||||
tooltip="Master switch to enable/disable RR export for this shop."
|
|
||||||
>
|
|
||||||
<Switch />
|
|
||||||
</Form.Item>
|
|
||||||
|
|
||||||
<Form.Item
|
|
||||||
label="Sandbox Mode"
|
|
||||||
name={["rr_configuration", "sandbox_mode"]}
|
|
||||||
valuePropName="checked"
|
|
||||||
tooltip="Toggles sandbox behavior on the app side. Credentials and URLs remain in env secrets."
|
|
||||||
>
|
|
||||||
<Switch />
|
|
||||||
</Form.Item>
|
|
||||||
|
|
||||||
<Form.Item
|
|
||||||
label="Log XML Requests/Responses"
|
|
||||||
name={["rr_configuration", "log_xml"]}
|
|
||||||
valuePropName="checked"
|
|
||||||
tooltip="When enabled, request/response XML is logged (masked where applicable)."
|
|
||||||
>
|
|
||||||
<Switch />
|
|
||||||
</Form.Item>
|
|
||||||
|
|
||||||
<Divider />
|
|
||||||
|
|
||||||
{/* Optional UX/format defaults */}
|
|
||||||
<Form.Item
|
|
||||||
label="Default RO Prefix"
|
|
||||||
name={["rr_configuration", "default_ro_prefix"]}
|
|
||||||
tooltip="Optional Repair Order prefix used when generating RO numbers."
|
|
||||||
>
|
|
||||||
<Input placeholder="e.g. RO" />
|
|
||||||
</Form.Item>
|
|
||||||
|
|
||||||
<Form.Item
|
|
||||||
label={
|
|
||||||
<span>
|
|
||||||
Timezone{" "}
|
|
||||||
<Tooltip title="Used for date/time fields when building RR payloads.">
|
|
||||||
<span style={{ cursor: "help", color: "var(--ant-color-text-tertiary)" }}>ⓘ</span>
|
|
||||||
</Tooltip>
|
|
||||||
</span>
|
|
||||||
}
|
|
||||||
name={["rr_configuration", "timezone"]}
|
|
||||||
rules={[{ required: true, message: "Timezone is required" }]}
|
|
||||||
>
|
|
||||||
<Select showSearch placeholder="Select timezone">
|
|
||||||
<Option value="America/Toronto">America/Toronto</Option>
|
|
||||||
<Option value="America/New_York">America/New_York</Option>
|
|
||||||
<Option value="America/Chicago">America/Chicago</Option>
|
|
||||||
<Option value="America/Los_Angeles">America/Los_Angeles</Option>
|
|
||||||
<Option value="UTC">UTC</Option>
|
|
||||||
</Select>
|
|
||||||
</Form.Item>
|
|
||||||
</Card>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
@@ -688,6 +688,7 @@
|
|||||||
"payers": "Payers"
|
"payers": "Payers"
|
||||||
},
|
},
|
||||||
"cdk_dealerid": "CDK Dealer ID",
|
"cdk_dealerid": "CDK Dealer ID",
|
||||||
|
"rr_dealerid": "Reynolds Store Number",
|
||||||
"costsmapping": "Costs Mapping",
|
"costsmapping": "Costs Mapping",
|
||||||
"dms_allocations": "DMS Allocations",
|
"dms_allocations": "DMS Allocations",
|
||||||
"pbs_serialnumber": "PBS Serial Number",
|
"pbs_serialnumber": "PBS Serial Number",
|
||||||
|
|||||||
@@ -688,6 +688,7 @@
|
|||||||
"payers": ""
|
"payers": ""
|
||||||
},
|
},
|
||||||
"cdk_dealerid": "",
|
"cdk_dealerid": "",
|
||||||
|
"rr_dealerid": "",
|
||||||
"costsmapping": "",
|
"costsmapping": "",
|
||||||
"dms_allocations": "",
|
"dms_allocations": "",
|
||||||
"pbs_serialnumber": "",
|
"pbs_serialnumber": "",
|
||||||
|
|||||||
@@ -688,6 +688,7 @@
|
|||||||
"payers": ""
|
"payers": ""
|
||||||
},
|
},
|
||||||
"cdk_dealerid": "",
|
"cdk_dealerid": "",
|
||||||
|
"rr_dealerid": "",
|
||||||
"costsmapping": "",
|
"costsmapping": "",
|
||||||
"dms_allocations": "",
|
"dms_allocations": "",
|
||||||
"pbs_serialnumber": "",
|
"pbs_serialnumber": "",
|
||||||
|
|||||||
Reference in New Issue
Block a user