Browse Source
Task/extend rule settings interface by locale (#5802)
* Extend rule settings interface by locale
pull/5805/head^2
Dibyendu Sahoo
5 days ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
17 changed files with
93 additions and
16 deletions
-
apps/api/src/models/interfaces/rule-settings.interface.ts
-
apps/api/src/models/rules/account-cluster-risk/current-investment.ts
-
apps/api/src/models/rules/account-cluster-risk/single-account.ts
-
apps/api/src/models/rules/asset-class-cluster-risk/equity.ts
-
apps/api/src/models/rules/asset-class-cluster-risk/fixed-income.ts
-
apps/api/src/models/rules/currency-cluster-risk/base-currency-current-investment.ts
-
apps/api/src/models/rules/currency-cluster-risk/current-investment.ts
-
apps/api/src/models/rules/economic-market-cluster-risk/developed-markets.ts
-
apps/api/src/models/rules/economic-market-cluster-risk/emerging-markets.ts
-
apps/api/src/models/rules/emergency-fund/emergency-fund-setup.ts
-
apps/api/src/models/rules/fees/fee-ratio-initial-investment.ts
-
apps/api/src/models/rules/liquidity/buying-power.ts
-
apps/api/src/models/rules/regional-market-cluster-risk/asia-pacific.ts
-
apps/api/src/models/rules/regional-market-cluster-risk/emerging-markets.ts
-
apps/api/src/models/rules/regional-market-cluster-risk/europe.ts
-
apps/api/src/models/rules/regional-market-cluster-risk/japan.ts
-
apps/api/src/models/rules/regional-market-cluster-risk/north-america.ts
|
|
|
@ -1,3 +1,4 @@ |
|
|
|
export interface RuleSettings { |
|
|
|
isActive: boolean; |
|
|
|
locale: string; |
|
|
|
} |
|
|
|
|
|
|
|
@ -121,9 +121,14 @@ export class AccountClusterRiskCurrentInvestment extends Rule<Settings> { |
|
|
|
}); |
|
|
|
} |
|
|
|
|
|
|
|
public getSettings({ baseCurrency, xRayRules }: UserSettings): Settings { |
|
|
|
public getSettings({ |
|
|
|
baseCurrency, |
|
|
|
locale, |
|
|
|
xRayRules |
|
|
|
}: UserSettings): Settings { |
|
|
|
return { |
|
|
|
baseCurrency, |
|
|
|
locale, |
|
|
|
isActive: xRayRules?.[this.getKey()]?.isActive ?? true, |
|
|
|
thresholdMax: xRayRules?.[this.getKey()]?.thresholdMax ?? 0.5 |
|
|
|
}; |
|
|
|
|
|
|
|
@ -72,8 +72,9 @@ export class AccountClusterRiskSingleAccount extends Rule<RuleSettings> { |
|
|
|
}); |
|
|
|
} |
|
|
|
|
|
|
|
public getSettings({ xRayRules }: UserSettings): RuleSettings { |
|
|
|
public getSettings({ locale, xRayRules }: UserSettings): RuleSettings { |
|
|
|
return { |
|
|
|
locale, |
|
|
|
isActive: xRayRules?.[this.getKey()]?.isActive ?? true |
|
|
|
}; |
|
|
|
} |
|
|
|
|
|
|
|
@ -109,9 +109,14 @@ export class AssetClassClusterRiskEquity extends Rule<Settings> { |
|
|
|
}); |
|
|
|
} |
|
|
|
|
|
|
|
public getSettings({ baseCurrency, xRayRules }: UserSettings): Settings { |
|
|
|
public getSettings({ |
|
|
|
baseCurrency, |
|
|
|
locale, |
|
|
|
xRayRules |
|
|
|
}: UserSettings): Settings { |
|
|
|
return { |
|
|
|
baseCurrency, |
|
|
|
locale, |
|
|
|
isActive: xRayRules?.[this.getKey()]?.isActive ?? true, |
|
|
|
thresholdMax: xRayRules?.[this.getKey()]?.thresholdMax ?? 0.82, |
|
|
|
thresholdMin: xRayRules?.[this.getKey()]?.thresholdMin ?? 0.78 |
|
|
|
|
|
|
|
@ -109,9 +109,14 @@ export class AssetClassClusterRiskFixedIncome extends Rule<Settings> { |
|
|
|
}); |
|
|
|
} |
|
|
|
|
|
|
|
public getSettings({ baseCurrency, xRayRules }: UserSettings): Settings { |
|
|
|
public getSettings({ |
|
|
|
baseCurrency, |
|
|
|
locale, |
|
|
|
xRayRules |
|
|
|
}: UserSettings): Settings { |
|
|
|
return { |
|
|
|
baseCurrency, |
|
|
|
locale, |
|
|
|
isActive: xRayRules?.[this.getKey()]?.isActive ?? true, |
|
|
|
thresholdMax: xRayRules?.[this.getKey()]?.thresholdMax ?? 0.22, |
|
|
|
thresholdMin: xRayRules?.[this.getKey()]?.thresholdMin ?? 0.18 |
|
|
|
|
|
|
|
@ -97,9 +97,14 @@ export class CurrencyClusterRiskBaseCurrencyCurrentInvestment extends Rule<Setti |
|
|
|
}); |
|
|
|
} |
|
|
|
|
|
|
|
public getSettings({ baseCurrency, xRayRules }: UserSettings): Settings { |
|
|
|
public getSettings({ |
|
|
|
baseCurrency, |
|
|
|
locale, |
|
|
|
xRayRules |
|
|
|
}: UserSettings): Settings { |
|
|
|
return { |
|
|
|
baseCurrency, |
|
|
|
locale, |
|
|
|
isActive: xRayRules?.[this.getKey()]?.isActive ?? true |
|
|
|
}; |
|
|
|
} |
|
|
|
|
|
|
|
@ -98,9 +98,14 @@ export class CurrencyClusterRiskCurrentInvestment extends Rule<Settings> { |
|
|
|
}); |
|
|
|
} |
|
|
|
|
|
|
|
public getSettings({ baseCurrency, xRayRules }: UserSettings): Settings { |
|
|
|
public getSettings({ |
|
|
|
baseCurrency, |
|
|
|
locale, |
|
|
|
xRayRules |
|
|
|
}: UserSettings): Settings { |
|
|
|
return { |
|
|
|
baseCurrency, |
|
|
|
locale, |
|
|
|
isActive: xRayRules?.[this.getKey()]?.isActive ?? true, |
|
|
|
thresholdMax: xRayRules?.[this.getKey()]?.thresholdMax ?? 0.5 |
|
|
|
}; |
|
|
|
|
|
|
|
@ -104,9 +104,14 @@ export class EconomicMarketClusterRiskDevelopedMarkets extends Rule<Settings> { |
|
|
|
}); |
|
|
|
} |
|
|
|
|
|
|
|
public getSettings({ baseCurrency, xRayRules }: UserSettings): Settings { |
|
|
|
public getSettings({ |
|
|
|
baseCurrency, |
|
|
|
locale, |
|
|
|
xRayRules |
|
|
|
}: UserSettings): Settings { |
|
|
|
return { |
|
|
|
baseCurrency, |
|
|
|
locale, |
|
|
|
isActive: xRayRules?.[this.getKey()]?.isActive ?? true, |
|
|
|
thresholdMax: xRayRules?.[this.getKey()]?.thresholdMax ?? 0.72, |
|
|
|
thresholdMin: xRayRules?.[this.getKey()]?.thresholdMin ?? 0.68 |
|
|
|
|
|
|
|
@ -104,9 +104,14 @@ export class EconomicMarketClusterRiskEmergingMarkets extends Rule<Settings> { |
|
|
|
}); |
|
|
|
} |
|
|
|
|
|
|
|
public getSettings({ baseCurrency, xRayRules }: UserSettings): Settings { |
|
|
|
public getSettings({ |
|
|
|
baseCurrency, |
|
|
|
locale, |
|
|
|
xRayRules |
|
|
|
}: UserSettings): Settings { |
|
|
|
return { |
|
|
|
baseCurrency, |
|
|
|
locale, |
|
|
|
isActive: xRayRules?.[this.getKey()]?.isActive ?? true, |
|
|
|
thresholdMax: xRayRules?.[this.getKey()]?.thresholdMax ?? 0.32, |
|
|
|
thresholdMin: xRayRules?.[this.getKey()]?.thresholdMin ?? 0.28 |
|
|
|
|
|
|
|
@ -59,9 +59,14 @@ export class EmergencyFundSetup extends Rule<Settings> { |
|
|
|
}); |
|
|
|
} |
|
|
|
|
|
|
|
public getSettings({ baseCurrency, xRayRules }: UserSettings): Settings { |
|
|
|
public getSettings({ |
|
|
|
baseCurrency, |
|
|
|
locale, |
|
|
|
xRayRules |
|
|
|
}: UserSettings): Settings { |
|
|
|
return { |
|
|
|
baseCurrency, |
|
|
|
locale, |
|
|
|
isActive: xRayRules?.[this.getKey()]?.isActive ?? true |
|
|
|
}; |
|
|
|
} |
|
|
|
|
|
|
|
@ -82,9 +82,14 @@ export class FeeRatioInitialInvestment extends Rule<Settings> { |
|
|
|
}); |
|
|
|
} |
|
|
|
|
|
|
|
public getSettings({ baseCurrency, xRayRules }: UserSettings): Settings { |
|
|
|
public getSettings({ |
|
|
|
baseCurrency, |
|
|
|
locale, |
|
|
|
xRayRules |
|
|
|
}: UserSettings): Settings { |
|
|
|
return { |
|
|
|
baseCurrency, |
|
|
|
locale, |
|
|
|
isActive: xRayRules?.[this.getKey()]?.isActive ?? true, |
|
|
|
thresholdMax: xRayRules?.[this.getKey()]?.thresholdMax ?? 0.01 |
|
|
|
}; |
|
|
|
|
|
|
|
@ -86,9 +86,14 @@ export class BuyingPower extends Rule<Settings> { |
|
|
|
}); |
|
|
|
} |
|
|
|
|
|
|
|
public getSettings({ baseCurrency, xRayRules }: UserSettings): Settings { |
|
|
|
public getSettings({ |
|
|
|
baseCurrency, |
|
|
|
locale, |
|
|
|
xRayRules |
|
|
|
}: UserSettings): Settings { |
|
|
|
return { |
|
|
|
baseCurrency, |
|
|
|
locale, |
|
|
|
isActive: xRayRules?.[this.getKey()]?.isActive ?? true, |
|
|
|
thresholdMin: xRayRules?.[this.getKey()]?.thresholdMin ?? 0 |
|
|
|
}; |
|
|
|
|
|
|
|
@ -94,9 +94,14 @@ export class RegionalMarketClusterRiskAsiaPacific extends Rule<Settings> { |
|
|
|
}); |
|
|
|
} |
|
|
|
|
|
|
|
public getSettings({ baseCurrency, xRayRules }: UserSettings): Settings { |
|
|
|
public getSettings({ |
|
|
|
baseCurrency, |
|
|
|
locale, |
|
|
|
xRayRules |
|
|
|
}: UserSettings): Settings { |
|
|
|
return { |
|
|
|
baseCurrency, |
|
|
|
locale, |
|
|
|
isActive: xRayRules?.[this.getKey()]?.isActive ?? true, |
|
|
|
thresholdMax: xRayRules?.[this.getKey()]?.thresholdMax ?? 0.03, |
|
|
|
thresholdMin: xRayRules?.[this.getKey()]?.thresholdMin ?? 0.02 |
|
|
|
|
|
|
|
@ -96,9 +96,14 @@ export class RegionalMarketClusterRiskEmergingMarkets extends Rule<Settings> { |
|
|
|
}); |
|
|
|
} |
|
|
|
|
|
|
|
public getSettings({ baseCurrency, xRayRules }: UserSettings): Settings { |
|
|
|
public getSettings({ |
|
|
|
baseCurrency, |
|
|
|
locale, |
|
|
|
xRayRules |
|
|
|
}: UserSettings): Settings { |
|
|
|
return { |
|
|
|
baseCurrency, |
|
|
|
locale, |
|
|
|
isActive: xRayRules?.[this.getKey()]?.isActive ?? true, |
|
|
|
thresholdMax: xRayRules?.[this.getKey()]?.thresholdMax ?? 0.12, |
|
|
|
thresholdMin: xRayRules?.[this.getKey()]?.thresholdMin ?? 0.08 |
|
|
|
|
|
|
|
@ -94,9 +94,14 @@ export class RegionalMarketClusterRiskEurope extends Rule<Settings> { |
|
|
|
}); |
|
|
|
} |
|
|
|
|
|
|
|
public getSettings({ baseCurrency, xRayRules }: UserSettings): Settings { |
|
|
|
public getSettings({ |
|
|
|
baseCurrency, |
|
|
|
locale, |
|
|
|
xRayRules |
|
|
|
}: UserSettings): Settings { |
|
|
|
return { |
|
|
|
baseCurrency, |
|
|
|
locale, |
|
|
|
isActive: xRayRules?.[this.getKey()]?.isActive ?? true, |
|
|
|
thresholdMax: xRayRules?.[this.getKey()]?.thresholdMax ?? 0.15, |
|
|
|
thresholdMin: xRayRules?.[this.getKey()]?.thresholdMin ?? 0.11 |
|
|
|
|
|
|
|
@ -94,9 +94,14 @@ export class RegionalMarketClusterRiskJapan extends Rule<Settings> { |
|
|
|
}); |
|
|
|
} |
|
|
|
|
|
|
|
public getSettings({ baseCurrency, xRayRules }: UserSettings): Settings { |
|
|
|
public getSettings({ |
|
|
|
baseCurrency, |
|
|
|
locale, |
|
|
|
xRayRules |
|
|
|
}: UserSettings): Settings { |
|
|
|
return { |
|
|
|
baseCurrency, |
|
|
|
locale, |
|
|
|
isActive: xRayRules?.[this.getKey()]?.isActive ?? true, |
|
|
|
thresholdMax: xRayRules?.[this.getKey()]?.thresholdMax ?? 0.06, |
|
|
|
thresholdMin: xRayRules?.[this.getKey()]?.thresholdMin ?? 0.04 |
|
|
|
|
|
|
|
@ -94,9 +94,14 @@ export class RegionalMarketClusterRiskNorthAmerica extends Rule<Settings> { |
|
|
|
}); |
|
|
|
} |
|
|
|
|
|
|
|
public getSettings({ baseCurrency, xRayRules }: UserSettings): Settings { |
|
|
|
public getSettings({ |
|
|
|
baseCurrency, |
|
|
|
locale, |
|
|
|
xRayRules |
|
|
|
}: UserSettings): Settings { |
|
|
|
return { |
|
|
|
baseCurrency, |
|
|
|
locale, |
|
|
|
isActive: xRayRules?.[this.getKey()]?.isActive ?? true, |
|
|
|
thresholdMax: xRayRules?.[this.getKey()]?.thresholdMax ?? 0.69, |
|
|
|
thresholdMin: xRayRules?.[this.getKey()]?.thresholdMin ?? 0.65 |
|
|
|
|