from fast_tradier.models.account.AccountOrder import AccountOrder

acc_order_json = {'id': 7650946, 'type': 'credit', 'symbol': 'SPX', 'side': 'buy', 'quantity': 2.0, 'status': 'rejected', 'duration': 'day', 'price': 1.2, 'avg_fill_price': 0.0, 'exec_quantity': 0.0, 'last_fill_price': 0.0, 'last_fill_quantity': 0.0, 'remaining_quantity': 0.0, 'create_date': '2023-08-25T00:44:30.471Z', 'transaction_date': '2023-08-25T00:44:30.512Z', 'class': 'multileg', 'num_legs': 2, 'strategy': 'spread', 'reason_description': 'Expiration date must be greater than the current date.', 'leg': [{'id': 7650949, 'type': 'credit', 'symbol': 'SPX', 'side': 'sell_to_open', 'quantity': 1.0, 'status': 'rejected', 'duration': 'day', 'price': 1.2, 'avg_fill_price': 0.0, 'exec_quantity': 0.0, 'last_fill_price': 0.0, 'last_fill_quantity': 0.0, 'remaining_quantity': 0.0, 'create_date': '2023-08-25T00:44:30.471Z', 'transaction_date': '2023-08-25T00:44:30.508Z', 'class': 'option', 'option_symbol': 'SPXW230815C04510000', 'reason_description': 'Expiration date must be greater than the current date.'}, {'id': 7650952, 'type': 'credit', 'symbol': 'SPX', 'side': 'buy_to_open', 'quantity': 1.0, 'status': 'rejected', 'duration': 'day', 'price': 1.2, 'avg_fill_price': 0.0, 'exec_quantity': 0.0, 'last_fill_price': 0.0, 'last_fill_quantity': 0.0, 'remaining_quantity': 0.0, 'create_date': '2023-08-25T00:44:30.471Z', 'transaction_date': '2023-08-25T00:44:30.511Z', 'class': 'option', 'option_symbol': 'SPXW230815C04520000', 'reason_description': 'Expiration date must be greater than the current date.'}]}
acc_order = AccountOrder(acc_order_json)
print('acc_order.price: ', acc_order.price)
print('acc_order to_json: ', acc_order.to_json())