def addTransaction(portfolioId):
    data = request.get_json()
    ack = portfolioData.addTransaction(client, portfolioId,
                                       data[pc.ASSET_CODE],
                                       data[pc.ASSET_NAME],
                                       data[portfolioData.TXN_CASHFLOW],
                                       data[pc.TXN_QUANTITY],
                                       dtu.dateParser(data[pc.TXN_DATE]),
                                       data.get(pc.TXN_TYPE))
    return webio.json(ack)
def portfolioNav(portfolioId):
    return webio.json(webio.ts2dict(Portfolio(portfolioId, client).nav()))
def portfolioHoldings(portfolioId):
    return webio.json(webio.df2dict(Portfolio(portfolioId, client).holdings()))
def removeTransaction(portfolioId, transactionId):
    # todo: add elif for PUT (Modify)
    if request.method == 'DELETE':
        ack = portfolioData.removeTransaction(client, portfolioId,
                                              int(transactionId))
        return webio.json(ack)
def uploadTransactions(portfolioId):
    file = webio.getUploadedFile()
    failed = txnUpload.importFundTransactionsFromFile(client, portfolioId,
                                                      file)
    return webio.json(failed)
Example #6
0
def getFundListOnDate(navDate):
    return webio.json(fundData.fundList(client, dtu.dateParser(navDate)))
def getPortfolioTransactions(portfolioId):
    return webio.json(Portfolio(portfolioId, client).transactions())
def getClientPortfolio(clientName):
    return webio.json(portfolioData.getClientPortfolio(client, clientName))
def getPortfolioData(portfolioId):
    return webio.json(Portfolio(portfolioId, client).portfolioData())
Example #10
0
def getFundNav(Id):
    return webio.json(webio.ts2dict(Fund(Id, client).nav()))
Example #11
0
def getFundReturn(Id, window):
    return webio.json(webio.ts2dict(Fund(Id, client).rollingReturn(window)))
Example #12
0
def updateFundInfo(Id):
    fundInfo = request.get_json()
    return webio.json(fundData.updateFundInfo(client, Id, fundInfo))
Example #13
0
def enrichedFundInfo(Id):
    return webio.json(fundData.enrichedFundInfo(client, Id))
Example #14
0
def getFundInfo(Id):
    return webio.json(Fund(Id, client).fundInfo())
def portfolioReturn(portfolioId, window):
    return webio.json(
        webio.ts2dict(Portfolio(portfolioId, client).rollingReturn(window)))
def addPortfolio():
    clientName = request[pc.CLIENT_NAME].strip()
    portfolioName = request[pc.PORTFOLIO_NAME].strip()
    portfolioId = portfolioData.addPortfolio(client, clientName, portfolioName)
    return webio.json(portfolioId)
def portfolioReturnStats(portfolioId):
    return webio.json(Portfolio(portfolioId, client).returnStats())
Example #18
0
def getFundList():
    return webio.json(fundData.fundList(client))