Skip to content

Commit

Permalink
Finalised bank-dating
Browse files Browse the repository at this point in the history
  • Loading branch information
NoelMarjanovic committed Oct 29, 2023
1 parent 8034591 commit aa818d9
Show file tree
Hide file tree
Showing 14 changed files with 186 additions and 135 deletions.
259 changes: 152 additions & 107 deletions bank-dating/src/app/app.component.ts
Expand Up @@ -2,7 +2,7 @@ import { Component } from '@angular/core';
import {User} from './models/user.interface';
import {Account} from './models/account.interface';
import {Transaction} from './models/transaction.interface';
import {formatDate} from './util/date.util';
import {formatDate} from './util/data.util';
import {DataService} from './services/data.service';

@Component({
Expand All @@ -16,7 +16,7 @@ export class AppComponent {
currentUser = {} as User;
currentAccount = {} as Account;
users = [] as User[];
accounts = [] as Account[];
accounts = [{}] as Account[];
constructor(private dataService: DataService) {}
ngOnInit() {
this.mockValuesFromDevPortal();
Expand All @@ -27,136 +27,181 @@ export class AppComponent {
}

requestValuesFromDevPortal() {}

mockValuesFromDevPortal() {
this.currentUser = {
userId: '1',
firstname: 'Esra',
lastname: 'Doerksen',
birthdate: new Date('2002-08-05'),
city: 'Basel',
sex: 'Männlich',
} as User;
userId: '1',
firstname: 'Penny',
lastname: 'Pennyworth',
birthdate: '10.05.1991',
sex: 'Female',
city: 'Zürich',
} as User;

this.currentAccount = {
userId: '1',
balance: 23000,
balance: 5000,
transactions: [
{
timeStamp: formatDate(new Date()),
amount: 275,
description: 'Zusatz Krankenkasse',
location: 'Assura',
standingOrder: true,
} as Transaction,
{
timeStamp: formatDate(new Date()),
amount: 200,
description: 'Krankenkasse',
location: 'Atupri',
standingOrder: true,
} as Transaction,
{
timeStamp: formatDate(new Date()),
amount: 900,
description: 'Drone',
location: 'Media Markt',
description: 'Coop',
location: 'Zürich HB',
timestamp: '27.10.2023, 14:20',
amount: 25,
standingOrder: false,
} as Transaction,
},
{
timeStamp: formatDate(new Date()),
amount: 302,
description: 'Drone',
location: 'Media Markt',
description: 'myprotein.ch',
location: 'Switzerland',
timestamp: '26.10.2023, 21:00',
amount: 101,
standingOrder: false,
} as Transaction,
},
{
timeStamp: formatDate(new Date()),
amount: 500,
description: 'Drone',
location: 'Media Markt',
description: 'Shell Station',
location: 'Zürich',
timestamp: '25.10.2023, 12:10',
amount: 118,
standingOrder: false,
} as Transaction,
},
{
timeStamp: formatDate(new Date()),
amount: 700,
description: 'Drone',
location: 'Media Markt',
description: 'Zürich Versicherung',
location: 'Zürich',
timestamp: '25.10.2023, 08:00',
amount: 500,
standingOrder: false,
} as Transaction,
},
{
timeStamp: formatDate(new Date()),
amount: 700,
description: 'Drone',
location: 'Media Markt',
description: 'Restaurant Aurora',
location: 'Zürich',
timestamp: '25.10.2023, 18:00',
amount: 80,
standingOrder: false,
} as Transaction,
],
} as Account;

this.users = [{
userId: '2',
firstname: 'Esra',
lastname: 'Doerksen',
birthdate: new Date('2002-08-05'),
city: 'Basel',
sex: 'Männlich',
}] as User[];

this.accounts = [{
userId: '2',
balance: 23000,
transactions: [
{
timeStamp: formatDate(new Date()),
amount: 275,
description: 'Zusatz Krankenkasse',
location: 'Assura',
standingOrder: true,
} as Transaction,
{
timeStamp: formatDate(new Date()),
amount: 200,
description: 'Krankenkasse',
location: 'Atupri',
standingOrder: true,
} as Transaction,
},
{
timeStamp: formatDate(new Date()),
amount: 900,
description: 'Drone',
location: 'Media Markt',
description: 'Zalando',
location: 'Berlin',
timestamp: '25.10.2023, 08:00',
amount: 118,
standingOrder: false,
} as Transaction,
},
{
timeStamp: formatDate(new Date()),
amount: 302,
description: 'Drone',
location: 'Media Markt',
description: 'Louis Vuitton',
location: 'Zürich',
timestamp: '24.10.2023, 13:15',
amount: 2400,
standingOrder: false,
} as Transaction,
},
{
timeStamp: formatDate(new Date()),
amount: 500,
description: 'Drone',
location: 'Media Markt',
description: 'GymShark',
location: 'Switzerland',
timestamp: '23.10.2023, 21:20',
amount: 185,
standingOrder: false,
} as Transaction,
},
{
timeStamp: formatDate(new Date()),
amount: 700,
description: 'Drone',
location: 'Media Markt',
description: 'Grasshopper-Club Zürich Sektion Squash',
location: 'Zürich',
timestamp: '21.10.2023, 09:00',
amount: 50,
standingOrder: false,
} as Transaction,
},
{
timeStamp: formatDate(new Date()),
amount: 700,
description: 'Drone',
location: 'Media Markt',
description: 'Alnatura Bio Supermarkt',
location: 'Zürich',
timestamp: '21.10.2023, 13:00',
amount: 20,
standingOrder: false,
} as Transaction,
],
}] as Account[];
},
] as Transaction[],
} as Account;

this.users = [
{
userId: '2',
firstname: 'Donny',
lastname: 'Dollarsign',
birthdate: '16.08.1990',
sex: 'Male',
city: 'Pratteln',
},
] as User[];

this.accounts = [
{
userId: '2',
balance: 8500,
transactions: [
{
description: 'GymShark',
location: 'Switzerland',
timestamp: '27.10.2023, 21:10',
amount: 210,
standingOrder: false,
},
{
description: 'Restaurant Artigiano',
location: 'Basel-Stadt',
timestamp: '26.10.2023, 18:00',
amount: 60,
standingOrder: false,
},
{
description: 'myprotein.ch',
location: 'Switzerland',
timestamp: '25.10.2023, 08:00',
amount: 150,
standingOrder: false,
},
{
description: 'Gucci',
location: 'Zürich',
timestamp: '25.10.2023, 17:00',
amount: 2100,
standingOrder: false,
},
{
description: 'Vitis Sportcenter',
location: 'Allschwill',
timestamp: '24.10.2023, 18:00',
amount: 50,
standingOrder: false,
},
{
description: 'Zalando ',
location: 'Berlin',
timestamp: '24.10.2023, 21:00',
amount: 250,
standingOrder: false,
},
{
description: 'Restaurant Boo',
location: 'Bankverein, Basel-Stadt',
timestamp: '24.10.2023, 13:15',
amount: 40,
standingOrder: false,
},
{
description: 'Coop',
location: 'Bahnhof SBB, Basel',
timestamp: '23.10.2023, 18:20',
amount: 25,
standingOrder: false,
},
{
description: 'Zara',
location: 'Freie Strasse, Basel-Stadt',
timestamp: '21.10.2023, 15:15',
amount: 300,
standingOrder: false,
},
{
description: 'Restaurant Molino',
location: 'Basel-Stadt',
timestamp: '21.10.2023, 18:00',
amount: 100,
standingOrder: false,
},
] as Transaction[],
}
] as Account[];
}
}
2 changes: 1 addition & 1 deletion bank-dating/src/app/chat-entry/chat-entry.component.html
Expand Up @@ -2,7 +2,7 @@
<div class="row justify-content-between">
<div id="description" class="col ms-4 p-2">
<h4 class="float-right">
Name
{{ name }}
</h4>
</div>
<div class="col me-4 text-center p-2">
Expand Down
5 changes: 3 additions & 2 deletions bank-dating/src/app/chat-entry/chat-entry.component.ts
@@ -1,10 +1,11 @@
import { Component } from '@angular/core';
import {Component, Input} from '@angular/core';
import {User} from "../models/user.interface";

@Component({
selector: 'app-chat-entry',
templateUrl: './chat-entry.component.html',
styleUrls: ['./chat-entry.component.css']
})
export class ChatEntryComponent {

@Input() name = '';
}
7 changes: 2 additions & 5 deletions bank-dating/src/app/chat-list/chat-list.component.html
@@ -1,7 +1,4 @@
<div>
<app-chat-entry></app-chat-entry>
<app-chat-entry></app-chat-entry>
<app-chat-entry></app-chat-entry>
<app-chat-entry></app-chat-entry>
<div *ngFor="let name of names">
<app-chat-entry [name]="name"></app-chat-entry>
</div>

6 changes: 6 additions & 0 deletions bank-dating/src/app/chat-list/chat-list.component.ts
Expand Up @@ -8,4 +8,10 @@ import {User} from '../models/user.interface';
})
export class ChatListComponent {
@Input() user: User = {} as User;

names = [
'Billy Billford',
'Bob Dimepiece',
'Hamudi Goldstein',
]
}
3 changes: 2 additions & 1 deletion bank-dating/src/app/enums/match-reasons.enum.ts
@@ -1,7 +1,8 @@
export enum matchReasonsEnum {
sex = 'Opposite gender',
age = 'No big age gap',
balance = 'Same-ish amount of balance',
transactionType = 'Purchased similar items',
transactionLocation = 'Purchased items at similar location',
transactionLocation = 'Purchased items at similar location and time',

}
2 changes: 1 addition & 1 deletion bank-dating/src/app/matches/matches.component.ts
Expand Up @@ -2,7 +2,7 @@ import { Component } from '@angular/core';
import {User} from '../models/user.interface';
import {DataService} from '../services/data.service';
import {Account} from '../models/account.interface';
import {getMatches} from '../util/date.util';
import {getMatches} from '../util/data.util';
import {Match} from '../models/match.interface';

@Component({
Expand Down
2 changes: 1 addition & 1 deletion bank-dating/src/app/models/match.interface.ts
Expand Up @@ -2,7 +2,7 @@ export interface Match {
userId: string;
firstname: string;
lastname: string;
birthdate: Date;
birthdate: string;
sex: string;
city: string;
reason: string;
Expand Down
4 changes: 2 additions & 2 deletions bank-dating/src/app/models/transaction.interface.ts
@@ -1,7 +1,7 @@
export interface Transaction {
timeStamp: string;
timestamp: string;
description: string;
amount: number;
location: string;
amount: number;
standingOrder: boolean;
}
2 changes: 1 addition & 1 deletion bank-dating/src/app/models/user.interface.ts
Expand Up @@ -2,7 +2,7 @@ export interface User {
userId: string;
firstname: string;
lastname: string;
birthdate: Date;
birthdate: string;
sex: string;
city: string;
}

0 comments on commit aa818d9

Please sign in to comment.