From 514a76d7c7a7904c229c0c17f8229fa515ef67e1 Mon Sep 17 00:00:00 2001 From: Samer Salameh Date: Thu, 19 Nov 2026 11:47:34 +0300 Subject: [PATCH] =?UTF-8?q?Billing:=20raise=20max=20sent=20weight=20(?= =?UTF-8?q?=D8=A7=D9=84=D9=88=D8=B2=D9=86=20=D8=A7=D9=84=D9=85=D8=B1=D8=B3?= =?UTF-8?q?=D9=84)=20from=2050000=20to=2060000?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Claude Sonnet 5.5 --- src/NTP.Application/Grains/Orders/OrdersRules.cs | 6 +++--- tests/NTP.Tests/OrdersRulesTests.cs | 4 ++-- web/src/features/grains-orders/meta/billing.tsx | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/NTP.Application/Grains/Orders/OrdersRules.cs b/src/NTP.Application/Grains/Orders/OrdersRules.cs index 79b7b0b..d71d2c6 100644 --- a/src/NTP.Application/Grains/Orders/OrdersRules.cs +++ b/src/NTP.Application/Grains/Orders/OrdersRules.cs @@ -34,7 +34,7 @@ public static class OrdersErrors new("BILLING_DNW_MISSING", "الوزن المستلم مطلوب"); public static BusinessException SentWeightRange() => - new("BILLING_LNW_RANGE", "يجب أن يكون الوزن بين 0 - 50000"); + new("BILLING_LNW_RANGE", "يجب أن يكون الوزن بين 0 - 60000"); public static BusinessException PriceNotDefined() => new("BILLING_PRICE_NOT_DEFINED", "لا تسطيع الإضافة - السعر لهذه الوجهة غير معرف"); @@ -176,8 +176,8 @@ public static class BillingCalculator /// Page JS checkDate: discharge date must not be before load date. public static bool IsDischargeAfterLoad(DateTime load, DateTime discharge) => discharge.Date >= load.Date; - /// Page JS checkNumber: sent weight between 0 and 50000. - public static bool IsSentWeightInRange(decimal lnw) => lnw >= 0 && lnw <= 50000; + /// Page JS checkNumber: sent weight between 0 and 60000 (legacy limit was 50000). + public static bool IsSentWeightInRange(decimal lnw) => lnw >= 0 && lnw <= 60000; } public static class GrainsWeightRules diff --git a/tests/NTP.Tests/OrdersRulesTests.cs b/tests/NTP.Tests/OrdersRulesTests.cs index 657cd58..1de1b9f 100644 --- a/tests/NTP.Tests/OrdersRulesTests.cs +++ b/tests/NTP.Tests/OrdersRulesTests.cs @@ -114,8 +114,8 @@ public class BillingCalculatorTests [Theory] [InlineData(0, true)] - [InlineData(50000, true)] - [InlineData(50001, false)] + [InlineData(60000, true)] + [InlineData(60001, false)] [InlineData(-1, false)] public void Sent_weight_range(int w, bool ok) => Assert.Equal(ok, BillingCalculator.IsSentWeightInRange(w)); diff --git a/web/src/features/grains-orders/meta/billing.tsx b/web/src/features/grains-orders/meta/billing.tsx index 11619e7..091fbcb 100644 --- a/web/src/features/grains-orders/meta/billing.tsx +++ b/web/src/features/grains-orders/meta/billing.tsx @@ -57,7 +57,7 @@ export const billingForm: FormMeta = { { name: 'destination', type: 'select', label: { en: 'To', ar: 'الى' }, required: true, options: billingDestinationOptions }, { name: 'cargoType', type: 'select', label: { en: 'Cargo type', ar: 'نوع المادة' }, required: true, options: cargoTypeOptions }, { name: 'tn', type: 'text', label: { en: 'Truck number', ar: 'رقم السيارة' }, required: true, inputKind: 'plate', maxLength: 20 }, - { name: 'lnw', type: 'number', label: { en: 'Sent weight', ar: 'الوزن المرسل' }, required: true, min: 0, max: 50000 }, + { name: 'lnw', type: 'number', label: { en: 'Sent weight', ar: 'الوزن المرسل' }, required: true, min: 0, max: 60000 }, { name: 'dnw', type: 'number', label: { en: 'Received weight', ar: 'الوزن المستلم' }, required: true, min: 0 }, { name: 'demurrageFine', type: 'number', label: { en: 'Delay fine', ar: 'غرامة التاخير' }, min: 0 }, { name: 'otherFine', type: 'number', label: { en: 'Other fines', ar: 'غرامات أخرى' }, min: 0 },