Browse Source

feat(client): enforce encapsulation

pull/7050/head
KenTandrian 3 months ago
parent
commit
a21159b108
  1. 121
      apps/client/src/app/components/holding-detail-dialog/holding-detail-dialog.component.ts

121
apps/client/src/app/components/holding-detail-dialog/holding-detail-dialog.component.ts

@ -108,64 +108,65 @@ import { HoldingDetailDialogParams } from './interfaces/interfaces';
templateUrl: 'holding-detail-dialog.html' templateUrl: 'holding-detail-dialog.html'
}) })
export class GfHoldingDetailDialogComponent implements OnInit { export class GfHoldingDetailDialogComponent implements OnInit {
public activitiesCount: number; protected accounts: Account[];
public accounts: Account[]; protected activitiesCount: number;
public assetClass: string; protected assetClass: string;
public assetSubClass: string; protected assetSubClass: string;
public averagePrice: number; protected averagePrice: number;
public averagePricePrecision = 2; protected averagePricePrecision = 2;
public benchmarkDataItems: NullableLineChartItem[]; protected benchmarkDataItems: NullableLineChartItem[];
public benchmarkLabel = $localize`Average Unit Price`; protected benchmarkLabel = $localize`Average Unit Price`;
public countries: { protected countries: {
[code: string]: { name: string; value: number }; [code: string]: { name: string; value: number };
}; };
public dataProviderInfo: DataProviderInfo; protected dataProviderInfo: DataProviderInfo;
public dataSource: MatTableDataSource<Activity>; protected dataSource: MatTableDataSource<Activity>;
public dateOfFirstActivity: string; protected dateOfFirstActivity: string;
public dividendInBaseCurrency: number; protected dividendInBaseCurrency: number;
public dividendInBaseCurrencyPrecision = 2; protected dividendInBaseCurrencyPrecision = 2;
public dividendYieldPercentWithCurrencyEffect: number; protected dividendYieldPercentWithCurrencyEffect: number;
public feeInBaseCurrency: number; protected feeInBaseCurrency: number;
public getCountryName = getCountryName; protected getCountryName = getCountryName;
public hasPermissionToCreateOwnTag: boolean; protected hasPermissionToCreateOwnTag: boolean;
public hasPermissionToReadMarketDataOfOwnAssetProfile: boolean; protected hasPermissionToReadMarketDataOfOwnAssetProfile: boolean;
public historicalDataItems: LineChartItem[]; protected historicalDataItems: LineChartItem[];
public holdingForm: FormGroup; protected holdingForm: FormGroup;
public investmentInBaseCurrencyWithCurrencyEffect: number; protected investmentInBaseCurrencyWithCurrencyEffect: number;
public investmentInBaseCurrencyWithCurrencyEffectPrecision = 2; protected investmentInBaseCurrencyWithCurrencyEffectPrecision = 2;
public isUUID = isUUID; protected isUUID = isUUID;
public marketDataItems: MarketData[] = []; protected marketDataItems: MarketData[] = [];
public marketPrice: number; protected marketPrice: number;
public marketPriceMax: number; protected marketPriceMax: number;
public marketPriceMaxPrecision = 2; protected marketPriceMaxPrecision = 2;
public marketPriceMin: number; protected marketPriceMin: number;
public marketPriceMinPrecision = 2; protected marketPriceMinPrecision = 2;
public marketPricePrecision = 2; protected marketPricePrecision = 2;
public netPerformance: number; protected netPerformancePercentWithCurrencyEffect: number;
public netPerformancePrecision = 2; protected netPerformancePercentWithCurrencyEffectPrecision = 2;
public netPerformancePercent: number; protected netPerformanceWithCurrencyEffect: number;
public netPerformancePercentWithCurrencyEffect: number; protected netPerformanceWithCurrencyEffectPrecision = 2;
public netPerformancePercentWithCurrencyEffectPrecision = 2; protected pageIndex = 0;
public netPerformanceWithCurrencyEffect: number; protected pageSize = DEFAULT_PAGE_SIZE;
public netPerformanceWithCurrencyEffectPrecision = 2; protected quantity: number;
public pageIndex = 0; protected quantityPrecision = 2;
public pageSize = DEFAULT_PAGE_SIZE; protected reportDataGlitchMail: string;
public quantity: number; protected routerLinkAdminControlMarketData =
public quantityPrecision = 2;
public reportDataGlitchMail: string;
public routerLinkAdminControlMarketData =
internalRoutes.adminControl.subRoutes.marketData.routerLink; internalRoutes.adminControl.subRoutes.marketData.routerLink;
public sectors: { protected sectors: {
[name: string]: { name: string; value: number }; [name: string]: { name: string; value: number };
}; };
public sortColumn = 'date'; protected sortColumn = 'date';
public sortDirection: SortDirection = 'desc'; protected sortDirection: SortDirection = 'desc';
public SymbolProfile: EnhancedSymbolProfile; protected SymbolProfile: EnhancedSymbolProfile;
public tags: Tag[]; protected tagsAvailable: Tag[];
public tagsAvailable: Tag[]; protected translate = translate;
public translate = translate; protected user: User;
public user: User; protected value: number;
public value: number;
private netPerformance: number;
private netPerformancePrecision = 2;
private netPerformancePercent: number;
private tags: Tag[];
public constructor( public constructor(
private changeDetectorRef: ChangeDetectorRef, private changeDetectorRef: ChangeDetectorRef,
@ -543,13 +544,13 @@ export class GfHoldingDetailDialogComponent implements OnInit {
}); });
} }
public onChangePage(page: PageEvent) { protected onChangePage(page: PageEvent) {
this.pageIndex = page.pageIndex; this.pageIndex = page.pageIndex;
this.fetchActivities(); this.fetchActivities();
} }
public onCloneActivity(aActivity: Activity) { protected onCloneActivity(aActivity: Activity) {
this.router.navigate( this.router.navigate(
internalRoutes.portfolio.subRoutes.activities.routerLink, internalRoutes.portfolio.subRoutes.activities.routerLink,
{ {
@ -560,11 +561,11 @@ export class GfHoldingDetailDialogComponent implements OnInit {
this.dialogRef.close(); this.dialogRef.close();
} }
public onClose() { protected onClose() {
this.dialogRef.close(); this.dialogRef.close();
} }
public onCloseHolding() { protected onCloseHolding() {
const today = new Date(); const today = new Date();
const activity: CreateOrderDto = { const activity: CreateOrderDto = {
@ -595,7 +596,7 @@ export class GfHoldingDetailDialogComponent implements OnInit {
}); });
} }
public onExport() { protected onExport() {
const activityIds = this.dataSource.data.map(({ id }) => { const activityIds = this.dataSource.data.map(({ id }) => {
return id; return id;
}); });
@ -615,13 +616,13 @@ export class GfHoldingDetailDialogComponent implements OnInit {
}); });
} }
public onMarketDataChanged(withRefresh = false) { protected onMarketDataChanged(withRefresh = false) {
if (withRefresh) { if (withRefresh) {
this.fetchMarketData(); this.fetchMarketData();
} }
} }
public onUpdateActivity(aActivity: Activity) { protected onUpdateActivity(aActivity: Activity) {
this.router.navigate( this.router.navigate(
internalRoutes.portfolio.subRoutes.activities.routerLink, internalRoutes.portfolio.subRoutes.activities.routerLink,
{ {

Loading…
Cancel
Save