const validation_rules = {
    amount: [
        ['number' , {min: 0, type: 'float'}],
        ['req'    , {message: 'The amount is a required field.'}],
    ],
    barrier_1: [
        ['barrier', {condition: store => store.contract_expiry_type !== 'daily' && store.barrier_count}],
        ['number' , {condition: store => store.contract_expiry_type === 'daily' && store.barrier_count, type: 'float'}],
        ['req'    , {condition: store => store.barrier_count, message: 'The barrier is a required field.'}],
    ],
    barrier_2: [
        ['barrier', {condition: store => store.contract_expiry_type !== 'daily' && store.barrier_count}],
        ['number' , {condition: store => store.contract_expiry_type === 'daily' && store.barrier_count, type: 'float'}],
        ['req'    , {condition: store => store.barrier_count, message: 'The barrier is a required field.'}],
    ],
    duration: [
        ['req'    , {message: 'The duration is a required field.'}],
    ],
};

export default validation_rules;

@@ -48,65 +48,197 @@
   %5B'
-number' , %7Bmin: 0, type: 'float'%7D%5D,%0A        %5B'req'    , %7B
+req'    , %7Bmessage: 'The amount is a required field.'%7D%5D,%0A        %5B'number' , %7Bmin: 0, type: 'float'%7D%5D,%0A    %5D,%0A    barrier_1: %5B%0A        %5B'req'    , %7Bcondition: store =%3E store.barrier_count, 
 mess
@@ -239,38 +239,39 @@
 , message: 'The 
-amount
+barrier
  is a required f
@@ -284,32 +284,8 @@
 %7D%5D,%0A
-    %5D,%0A    barrier_1: %5B%0A
     
@@ -499,32 +499,56 @@
 ype: 'float'%7D%5D,%0A
+    %5D,%0A    barrier_2: %5B%0A
         %5B'req'  
@@ -644,32 +644,8 @@
 %7D%5D,%0A
-    %5D,%0A    barrier_2: %5B%0A
     
@@ -871,117 +871,8 @@
 %7D%5D,%0A
-        %5B'req'    , %7Bcondition: store =%3E store.barrier_count, message: 'The barrier is a required field.'%7D%5D,%0A
     

put validation rules in priority order