Browse Source

Prettify code

pull/2163/head
Thomas 2 years ago
parent
commit
1e4a8436b7
  1. 5
      apps/api/src/app/auth/auth.controller.ts
  2. 10
      apps/api/src/app/health/health.controller.ts
  3. 20
      apps/api/src/app/portfolio/portfolio.service.ts
  4. 5
      apps/api/src/app/subscription/subscription.service.ts
  5. 10
      apps/api/src/services/data-gathering/data-gathering.service.ts
  6. 12
      apps/api/src/services/data-provider/data-enhancer/trackinsight/trackinsight.service.ts
  7. 5
      apps/api/src/services/data-provider/data-enhancer/yahoo-finance/yahoo-finance.service.ts
  8. 5
      apps/api/src/services/twitter-bot/twitter-bot.service.ts
  9. 2
      apps/client/src/app/components/admin-market-data-detail/admin-market-data-detail.component.html
  10. 2
      apps/client/src/index.html
  11. 2
      libs/ui/.storybook/preview-head.html
  12. 2
      libs/ui/src/lib/activities-table/activities-table.component.html
  13. 2
      libs/ui/src/lib/fire-calculator/fire-calculator.component.html

5
apps/api/src/app/auth/auth.controller.ts

@ -41,9 +41,8 @@ export class AuthController {
@Param('accessToken') accessToken: string
): Promise<OAuthResponse> {
try {
const authToken = await this.authService.validateAnonymousLogin(
accessToken
);
const authToken =
await this.authService.validateAnonymousLogin(accessToken);
return { authToken };
} catch {
throw new HttpException(

10
apps/api/src/app/health/health.controller.ts

@ -20,9 +20,8 @@ export class HealthController {
@Get('data-enhancer/:name')
public async getHealthOfDataEnhancer(@Param('name') name: string) {
const hasResponse = await this.healthService.hasResponseFromDataEnhancer(
name
);
const hasResponse =
await this.healthService.hasResponseFromDataEnhancer(name);
if (hasResponse !== true) {
throw new HttpException(
@ -44,9 +43,8 @@ export class HealthController {
);
}
const hasResponse = await this.healthService.hasResponseFromDataProvider(
dataSource
);
const hasResponse =
await this.healthService.hasResponseFromDataProvider(dataSource);
if (hasResponse !== true) {
throw new HttpException(

20
apps/api/src/app/portfolio/portfolio.service.ts

@ -470,9 +470,8 @@ export class PortfolioService {
transactionPoints[0]?.date ?? format(new Date(), DATE_FORMAT)
);
const startDate = this.getStartDate(dateRange, portfolioStart);
const currentPositions = await portfolioCalculator.getCurrentPositions(
startDate
);
const currentPositions =
await portfolioCalculator.getCurrentPositions(startDate);
const cashDetails = await this.accountService.getCashDetails({
filters,
@ -810,9 +809,8 @@ export class PortfolioService {
const transactionPoints = portfolioCalculator.getTransactionPoints();
const portfolioStart = parseDate(transactionPoints[0].date);
const currentPositions = await portfolioCalculator.getCurrentPositions(
portfolioStart
);
const currentPositions =
await portfolioCalculator.getCurrentPositions(portfolioStart);
const position = currentPositions.positions.find(
(item) => item.symbol === aSymbol
@ -1046,9 +1044,8 @@ export class PortfolioService {
const portfolioStart = parseDate(transactionPoints[0].date);
const startDate = this.getStartDate(dateRange, portfolioStart);
const currentPositions = await portfolioCalculator.getCurrentPositions(
startDate
);
const currentPositions =
await portfolioCalculator.getCurrentPositions(startDate);
const positions = currentPositions.positions.filter(
(item) => !item.quantity.eq(0)
@ -1238,9 +1235,8 @@ export class PortfolioService {
portfolioCalculator.setTransactionPoints(transactionPoints);
const portfolioStart = parseDate(transactionPoints[0].date);
const currentPositions = await portfolioCalculator.getCurrentPositions(
portfolioStart
);
const currentPositions =
await portfolioCalculator.getCurrentPositions(portfolioStart);
const positions = currentPositions.positions.filter(
(item) => !item.quantity.eq(0)

5
apps/api/src/app/subscription/subscription.service.ts

@ -93,9 +93,8 @@ export class SubscriptionService {
public async createSubscriptionViaStripe(aCheckoutSessionId: string) {
try {
const session = await this.stripe.checkout.sessions.retrieve(
aCheckoutSessionId
);
const session =
await this.stripe.checkout.sessions.retrieve(aCheckoutSessionId);
await this.createSubscription({
price: session.amount_total / 100,

10
apps/api/src/services/data-gathering/data-gathering.service.ts

@ -127,12 +127,10 @@ export class DataGatheringService {
uniqueAssets = await this.getUniqueAssets();
}
const assetProfiles = await this.dataProviderService.getAssetProfiles(
uniqueAssets
);
const symbolProfiles = await this.symbolProfileService.getSymbolProfiles(
uniqueAssets
);
const assetProfiles =
await this.dataProviderService.getAssetProfiles(uniqueAssets);
const symbolProfiles =
await this.symbolProfileService.getSymbolProfiles(uniqueAssets);
for (const [symbol, assetProfile] of Object.entries(assetProfiles)) {
const symbolMapping = symbolProfiles.find((symbolProfile) => {

12
apps/api/src/services/data-provider/data-enhancer/trackinsight/trackinsight.service.ts

@ -38,9 +38,9 @@ export class TrackinsightDataEnhancerService implements DataEnhancerInterface {
.json<any>()
.catch(() => {
return got(
`${TrackinsightDataEnhancerService.baseUrl}/funds/${
symbol.split('.')?.[0]
}.json`
`${TrackinsightDataEnhancerService.baseUrl}/funds/${symbol.split(
'.'
)?.[0]}.json`
)
.json<any>()
.catch(() => {
@ -60,9 +60,9 @@ export class TrackinsightDataEnhancerService implements DataEnhancerInterface {
.json<any>()
.catch(() => {
return got(
`${TrackinsightDataEnhancerService.baseUrl}/holdings/${
symbol.split('.')?.[0]
}.json`
`${TrackinsightDataEnhancerService.baseUrl}/holdings/${symbol.split(
'.'
)?.[0]}.json`
)
.json<any>()
.catch(() => {

5
apps/api/src/services/data-provider/data-enhancer/yahoo-finance/yahoo-finance.service.ts

@ -99,9 +99,8 @@ export class YahooFinanceDataEnhancerService implements DataEnhancerInterface {
yahooSymbol = quotes[0].symbol;
}
const { countries, sectors, url } = await this.getAssetProfile(
yahooSymbol
);
const { countries, sectors, url } =
await this.getAssetProfile(yahooSymbol);
if (countries) {
response.countries = countries;

5
apps/api/src/services/twitter-bot/twitter-bot.service.ts

@ -65,9 +65,8 @@ export class TwitterBotService {
status += benchmarkListing;
}
const { data: createdTweet } = await this.twitterClient.v2.tweet(
status
);
const { data: createdTweet } =
await this.twitterClient.v2.tweet(status);
Logger.log(
`Fear & Greed Index has been tweeted: https://twitter.com/ghostfolio_/status/${createdTweet.id}`,

2
apps/client/src/app/components/admin-market-data-detail/admin-market-data-detail.component.html

@ -29,7 +29,7 @@
}"
[title]="
(itemByMonth.key + '-' + (i + 1 < 10 ? '0' + (i + 1) : i + 1)
| date : defaultDateFormat) ?? ''
| date: defaultDateFormat) ?? ''
"
(click)="
onOpenMarketDataDetail({

2
apps/client/src/index.html

@ -1,4 +1,4 @@
<!DOCTYPE html>
<!doctype html>
<html class="h-100 position-relative" lang="${languageCode}">
<head>
<title>${title}</title>

2
libs/ui/.storybook/preview-head.html

@ -1,6 +1,6 @@
<script
type="module"
src="https://unpkg.com/ionicons@5.5.1/dist/ionicons/ionicons.esm.js"
type="module"
></script>
<script
nomodule

2
libs/ui/src/lib/activities-table/activities-table.component.html

@ -145,7 +145,7 @@
</th>
<td *matCellDef="let element" class="px-1" mat-cell>
<div class="d-flex">
{{ element.date | date : defaultDateFormat }}
{{ element.date | date: defaultDateFormat }}
</div>
</td>
<td *matFooterCellDef class="px-1" i18n mat-footer-cell>Total</td>

2
libs/ui/src/lib/fire-calculator/fire-calculator.component.html

@ -33,7 +33,7 @@
<div>
{{
calculatorForm.controls['retirementDate'].value
| date : 'MMMM YYYY'
| date: 'MMMM YYYY'
}}
</div>
<input

Loading…
Cancel
Save