@@ -69,6 +69,14 @@ def create_value(self):
6969 start = object .get ("start" , None )
7070 expiration = object .get ("expiration" , None )
7171 meta = object .get ("meta" , {})
72+ key = self .field ("key" , key , cast = str )
73+ amount = self .field ("amount" , amount , cast = float )
74+ currency = self .field ("currency" , currency , cast = str )
75+ usage_limit = self .field ("usage_limit" , usage_limit , cast = int )
76+ unlimited = self .field ("unlimited" , unlimited , cast = bool )
77+ start = self .field ("start" , start , cast = int )
78+ expiration = self .field ("expiration" , expiration , cast = int )
79+ meta = self .field ("meta" , meta , cast = dict )
7280 voucher = budy .Voucher .create_value_s (
7381 key , amount , currency , usage_limit , unlimited , start , expiration , meta
7482 )
@@ -85,6 +93,14 @@ def create_percentage(self):
8593 start = object .get ("start" , None )
8694 expiration = object .get ("expiration" , None )
8795 meta = object .get ("meta" , {})
96+ unlimited = object .get ("unlimited" , None )
97+ key = self .field ("key" , key , cast = str )
98+ percentage = self .field ("percentage" , percentage , cast = float )
99+ usage_limit = self .field ("usage_limit" , usage_limit , cast = int )
100+ start = self .field ("start" , start , cast = int )
101+ expiration = self .field ("expiration" , expiration , cast = int )
102+ meta = self .field ("meta" , meta , cast = dict )
103+ unlimited = self .field ("unlimited" , unlimited , cast = bool )
88104 voucher = budy .Voucher .create_percentage_s (
89105 key , percentage , usage_limit , start , expiration , meta
90106 )
0 commit comments