@@ -15,8 +15,8 @@ export default Component.extend(FormMixin, {
1515      &&  ! this . get ( 'authManager.currentUser.isVerified' ) ; 
1616  } ) , 
1717
18-   shouldDisableOrderButton : computed ( 'isUnverified ' ,  'hasTicketsInOrder ' ,  function ( )  { 
19-     return  ! this . hasTicketsInOrder ; 
18+   shouldDisableOrderButton : computed ( 'hasTicketsInOrder ' ,  'isDonationPriceValid ' ,  function ( )  { 
19+     return  ! ( this . hasTicketsInOrder   &&   this . isDonationPriceValid ) ; 
2020  } ) , 
2121
2222  showTaxIncludedMessage : computed ( 'taxInfo.isTaxIncludedInPrice' ,  function ( )  { 
@@ -40,7 +40,23 @@ export default Component.extend(FormMixin, {
4040    )  >  0 ; 
4141  } ) , 
4242
43-   total : 
computed ( '[email protected] ' ,  '[email protected] ' ,  function ( )  {  43+   donationTickets : computed . filterBy ( 'data' ,  'type' ,  'donation' ) , 
44+ 
45+   isDonationPriceValid : 
computed ( '[email protected] ' ,  '[email protected] ' ,  function ( )  {  46+     let  returnValue  =  false ; 
47+     this . donationTickets . forEach ( donationTicket  =>  { 
48+       if  ( donationTicket . orderQuantity  >=  0 )  { 
49+         if  ( donationTicket . price  >=  donationTicket . minPrice )  { 
50+           returnValue  =  true ; 
51+         }  else  { 
52+           returnValue  =  false ; 
53+         } 
54+       } 
55+     } ) ; 
56+     return  returnValue ; 
57+   } ) , 
58+ 
59+ 4460    if  ( this . taxInfo  !==  null )  { 
4561      return  sumBy ( this . tickets . toArray ( ) , 
4662        ticket  =>  ( ticket . ticketPriceWithTax  ||  0 )  *  ( ticket . orderQuantity  ||  0 ) 
@@ -190,6 +206,19 @@ export default Component.extend(FormMixin, {
190206              prompt  : this . l10n . t ( 'Please enter the promotional Code' ) 
191207            } 
192208          ] 
209+         } , 
210+         price : { 
211+           identifier  : 'price' , 
212+           rules       : [ 
213+             { 
214+               type    : 'number' , 
215+               prompt  : this . l10n . t ( 'Invalid number' ) 
216+             } , 
217+             { 
218+               type    : 'integer[1..]' , 
219+               prompt  : this . l10n . t ( 'Donation should be greater than 0' ) 
220+             } 
221+           ] 
193222        } 
194223      } 
195224    } ; 
0 commit comments