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 },