Portfolio service
A service to manage all portfolio calls across regions and manage the net-worth totals
Overview
The purpose of this service is to allow developers to easily access all the portfolio responses that a client is eligible for. Based on the client auth response flags, the service will store all the portfolio calls in the state store. Additionally, it will also calculate the net-worth of all the portfolio calls. You can also configure witch portfolio call to exclude form the net-worth.
Usage
in your component.ts file, add the following
import {PortfolioService} from "@investec-online/platform-services";
constructor(private _portfolio: PortfolioService) { }
Making a portfolio call
this._portfolio.getPrivateBankZAPortfolio(this.defaultCurrency).then((res) => {
console.log(res)
})
Making all portfolio calls eligible for the client
this._portfolio.getAllPortfolios(this.defaultCurrency).then(() => {
console.log('done laoding')
})
Reading available portfolios and net-worth
this._store.select(PortfolioState.getPortfolio).subscribe(res => this.portfolioData = res)
Portfolio Interface
export interface PortfolioInterface {
portfolios?: {},
contactData?: {
privateBanker?: PrivateBankerInterface,
wealthManager?: WealthManagerInterface,
lifeAdviser?: LifeAdvisorInterface
}
callResultMap?: {flag:string,result:boolean}[],
excludes?: {flag:string,result:boolean}[],
currency?: string,
totals?: {PortfolioAssets, PortfolioLiabilities, PortfolioAvailableBalance}
}
Note: you can access the contact data related to Banking SA , Wealth SA and Life SA
Excluding a specific portfolio form net-worth total
this._store.dispatch(new UpdatePortfolioExcludes([{flag:'ManuelHoldings',result:true}]))
Available flags (portfolios) to pass through the
PrivateBankZA
PrivateBankUK
PrivateBankUKMortgages
PrivateBankCI
PrivateBankMU
WealthAndInvestmentZA
WealthAndInvestmentGU
WealthAndInvestmentClick
WealthAndInvestmentCI
ManuelHoldings
Pfm
A true result will remove the portfolio assets, liabilities and available balance from the net worth object for that specific flag.