Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
34044b6
commit 8990768
Showing
9 changed files
with
98 additions
and
59 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
bank-advisor/src/app/components/all-expenses/all-expenses.component.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
<div class="margin-x"> | ||
<app-big-expenses></app-big-expenses> | ||
<!--<app-big-expenses></app-big-expenses> | ||
<app-regular-expenses></app-regular-expenses> | ||
<app-contract-expenses></app-contract-expenses> | ||
<app-contract-expenses></app-contract-expenses>--> | ||
</div> |
19 changes: 3 additions & 16 deletions
19
bank-advisor/src/app/components/big-expenses/big-expenses.component.css
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,4 @@ | ||
.text-orange { | ||
border-color: orange; | ||
} | ||
|
||
.text-red { | ||
border-color: red; | ||
} | ||
|
||
.red { | ||
fill: red; | ||
color: red; | ||
background-color: red; | ||
} | ||
|
||
.bg-grey { | ||
background-color: grey; | ||
.margin-x { | ||
margin-left: 15%; | ||
margin-right: 15%; | ||
} |
71 changes: 37 additions & 34 deletions
71
bank-advisor/src/app/components/big-expenses/big-expenses.component.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
.margin-x { | ||
margin-left: 15%; | ||
margin-right: 15%; | ||
} |
15 changes: 14 additions & 1 deletion
15
bank-advisor/src/app/components/contract-expenses/contract-expenses.component.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,24 @@ | ||
import { Component, Input } from '@angular/core'; | ||
import { Transaction } from 'src/app/models/transaction.interface'; | ||
import { User } from '../../models/user.interface'; | ||
import { Account } from '../../models/account.interface'; | ||
import { DataService } from '../../services/data.service'; | ||
|
||
@Component({ | ||
selector: 'app-contract-expenses', | ||
templateUrl: './contract-expenses.component.html', | ||
styleUrls: ['./contract-expenses.component.css'], | ||
}) | ||
export class ContractExpensesComponent { | ||
@Input() contractTransactions: Transaction[] = []; | ||
private user: User = {} as User; | ||
private account: Account = {} as Account; | ||
contractTransactions: Transaction[] = []; | ||
|
||
constructor(dataService: DataService) { | ||
this.user = dataService.getUser(); | ||
this.account = dataService.getAccount(); | ||
this.contractTransactions = this.account.transactions.filter( | ||
(t) => t.standingOrder | ||
); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
.margin-x { | ||
margin-left: 15%; | ||
margin-right: 15%; | ||
} |
25 changes: 24 additions & 1 deletion
25
bank-advisor/src/app/components/regular-expenses/regular-expenses.component.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,34 @@ | ||
import { Component, Input } from '@angular/core'; | ||
import { Transaction } from 'src/app/models/transaction.interface'; | ||
import { DataService } from '../../services/data.service'; | ||
import { Account } from '../../models/account.interface'; | ||
import { User } from '../../models/user.interface'; | ||
|
||
@Component({ | ||
selector: 'app-regular-expenses', | ||
templateUrl: './regular-expenses.component.html', | ||
styleUrls: ['./regular-expenses.component.css'], | ||
}) | ||
export class RegularExpensesComponent { | ||
@Input() regularTransactions: Transaction[] = []; | ||
private user: User = {} as User; | ||
private account: Account = {} as Account; | ||
regularTransactions: Transaction[] = []; | ||
|
||
constructor(dataService: DataService) { | ||
this.user = dataService.getUser(); | ||
this.account = dataService.getAccount(); | ||
const transactionCounts: { [key: string]: number } = {}; | ||
|
||
this.account.transactions.forEach((t) => { | ||
if (transactionCounts[t.location]) { | ||
transactionCounts[t.location]++; | ||
} else { | ||
transactionCounts[t.location] = 1; | ||
} | ||
}); | ||
|
||
this.regularTransactions = this.account.transactions.filter( | ||
(t) => transactionCounts[t.location] > 2 | ||
); | ||
} | ||
} |