def new_client(self, params): result = self.model.create(params).loc[0] wallet_init_data = { 'client_id': result.loc['client_id'].item(), 'date_updated': datetime.datetime.now(), 'total_daily_credit_award': 0, 'total_credit': result.loc['base_credit'], } models.ClientWalletModel().create(wallet_init_data) return result.loc[['client_id', 'client_name', 'industry_name']].to_json()
def __init__(self): self.model = models.ClientWalletModel() self.holding_model = models.HoldingsModel()
import my_test import models import service import datetime data = my_test.TestData() ''' models.ClientWalletModel().create(data.wallet) models.ClientModel().create(data.client) print(service.ClientWalletService().get_wallet_data(1000)) print(service.ClientService().new_client(data.client)) print(service.ClientService().get_clients(2)) print(service.ClientService().check_credentials({'client_id': 1, 'pwd': 'no'})) print(service.RMService().check_rm_credentials({'rm_email': '*****@*****.**', 'pwd': 'xx'})) ''' ''' print( service.TransactionService().new_transaction( { 'product_id': 1, 'units_traded': 100, 'trade_type': 'sell', 'time_stamp': datetime.datetime.now(), 'client_id':1 } ) ) ''' # print(service.TransactionService().get_trade_history(4))
def __init__(self): self.model = models.ClientWalletModel()