@@ -9,8 +9,9 @@ class Adjustment(object):
99 @staticmethod
1010 def to_json (instance ):
1111 json = {
12+ 'sourcePortfolio' : Portfolio .to_json (instance .source_portfolio ),
1213 'targetPortfolio' : Portfolio .to_json (instance .target_portfolio ),
13- 'context ' : AdjustmentContext .to_json (instance .context )
14+ 'schema ' : AdjustmentSchema .to_json (instance .schema )
1415 }
1516 return json
1617
@@ -57,12 +58,12 @@ def target_portfolio(self, value):
5758 self ._target_portfolio = value
5859
5960 @property
60- def context (self ):
61- return self ._context
61+ def schema (self ):
62+ return self ._schema
6263
63- @context .setter
64- def context (self , value ):
65- self ._context = value
64+ @schema .setter
65+ def schema (self , value ):
66+ self ._schema = value
6667
6768 @property
6869 def batches (self ):
@@ -81,41 +82,21 @@ def progress(self, value):
8182 self ._progress = value
8283
8384
84- class AdjustmentContext (object ):
85+ class AdjustmentSchema (object ):
8586 @staticmethod
8687 def to_json (instance ):
8788 json = {
8889 'minOrderValue' : instance .min_order_value ,
8990 'maxOrderValue' : instance .max_order_value ,
9091 'reservedSecurities' : instance .reserved_securities ,
91- 'otherValue' : instance .other_value ,
92- 'totalValueDeviationRate' : instance .total_value_deviation_rate ,
9392 }
9493 return json
9594
96- def __init__ (self , other_value , total_value_deviation_rate , reserved_securities , min_order_value , max_order_value ):
97- self ._other_value = other_value
98- self ._total_value_deviation_rate = total_value_deviation_rate
95+ def __init__ (self , reserved_securities , min_order_value , max_order_value ):
9996 self ._reserved_securities = reserved_securities
10097 self ._min_order_value = min_order_value
10198 self ._max_order_value = max_order_value
10299
103- @property
104- def other_value (self ):
105- return self ._other_value
106-
107- @other_value .setter
108- def other_value (self , value ):
109- self ._other_value = value
110-
111- @property
112- def total_value_deviation_rate (self ):
113- return self ._total_value_deviation_rate
114-
115- @total_value_deviation_rate .setter
116- def total_value_deviation_rate (self , value ):
117- self ._total_value_deviation_rate = value
118-
119100 @property
120101 def reserved_securities (self ):
121102 return self ._reserved_securities
@@ -207,14 +188,18 @@ def to_json(instance):
207188 json = {
208189 'availableCash' : instance .available_cash ,
209190 'totalValue' : instance .total_value ,
191+ 'otherValue' : instance .other_value ,
192+ 'totalValueDeviationRate' : instance .total_value_deviation_rate ,
210193 'positionsValue' : instance .positions_value ,
211194 'positions' : positions_json
212195 }
213196 return json
214197
215- def __init__ (self , available_cash = None , total_value = None ):
198+ def __init__ (self , available_cash = None , total_value = None , other_value = None , total_value_deviation_rate = None ):
216199 self ._available_cash = available_cash
217200 self ._total_value = total_value
201+ self ._other_value = other_value
202+ self ._total_value_deviation_rate = total_value_deviation_rate
218203 self ._positions_value = 0
219204 self ._positions = dict ()
220205
@@ -245,6 +230,22 @@ def total_value(self):
245230 def total_value (self , value ):
246231 self ._total_value = value
247232
233+ @property
234+ def other_value (self ):
235+ return self ._other_value
236+
237+ @other_value .setter
238+ def other_value (self , value ):
239+ self ._other_value = value
240+
241+ @property
242+ def total_value_deviation_rate (self ):
243+ return self ._total_value_deviation_rate
244+
245+ @total_value_deviation_rate .setter
246+ def total_value_deviation_rate (self , value ):
247+ self ._total_value_deviation_rate = value
248+
248249 @property
249250 def positions_value (self ):
250251 return self ._positions_value
0 commit comments