mirror of
https://github.com/Tria-plc/edr-platform.git
synced 2026-08-29 07:10:57 +00:00
add hard capacity ceiling to weight limit rules
This commit is contained in:
@@ -341,6 +341,10 @@ const RuleEngineResourcePage = () => {
|
||||
} else if (config.slug === "priority-configs") {
|
||||
// Label is required by the backend but hidden in the UI for now.
|
||||
payload = { ...values, label: String(Date.now()) };
|
||||
} else if (config.slug === "weight-limit-rules") {
|
||||
// Empty max capacity means "no ceiling" — send null explicitly so an
|
||||
// edit can clear a previously-set ceiling (omitting the key keeps it).
|
||||
payload = { ...values, maxCapacityTons: values.maxCapacityTons ?? null };
|
||||
}
|
||||
|
||||
if (editing?.id) {
|
||||
|
||||
@@ -374,6 +374,12 @@ export const RULE_ENGINE_RESOURCES: RuleEngineResourceConfig[] = [
|
||||
},
|
||||
{ id: "tradeDirection", header: "Direction", accessorKey: "tradeDirection" },
|
||||
{ id: "maxVgmTons", header: "Max VGM (t)", accessorKey: "maxVgmTons", format: "number" },
|
||||
{
|
||||
id: "maxCapacityTons",
|
||||
header: "Max capacity (t)",
|
||||
accessorKey: "maxCapacityTons",
|
||||
format: "number",
|
||||
},
|
||||
],
|
||||
formFields: [
|
||||
{
|
||||
@@ -391,6 +397,14 @@ export const RULE_ENGINE_RESOURCES: RuleEngineResourceConfig[] = [
|
||||
options: TRADE_DIRECTIONS,
|
||||
},
|
||||
{ name: "maxVgmTons", label: "Max VGM (tons)", type: "number", required: true },
|
||||
{
|
||||
name: "maxCapacityTons",
|
||||
label: "Max capacity (tons)",
|
||||
type: "number",
|
||||
optional: true,
|
||||
description:
|
||||
"Hard ceiling — a booking whose line weight exceeds this cannot be created at all. Leave empty for no ceiling (overweight surcharge only).",
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user