From 6c06a2d129570cd103cbef141ed84f3c755b5d05 Mon Sep 17 00:00:00 2001 From: Simon Date: Wed, 13 Jul 2022 17:45:50 +0200 Subject: [PATCH] feat(webapp): implement bank view --- .../molecules/MoleculeTransactionTable.vue | 56 +++++++++++ src/components/services/currency.service.ts | 14 +++ src/components/services/date.service.ts | 11 +++ src/components/views/BankView.vue | 97 ++++++++++++++++++- src/interfaces/transaction.interface.ts | 5 + 5 files changed, 182 insertions(+), 1 deletion(-) create mode 100644 src/components/molecules/MoleculeTransactionTable.vue create mode 100644 src/components/services/currency.service.ts create mode 100644 src/components/services/date.service.ts create mode 100644 src/interfaces/transaction.interface.ts diff --git a/src/components/molecules/MoleculeTransactionTable.vue b/src/components/molecules/MoleculeTransactionTable.vue new file mode 100644 index 0000000..3d8ab8e --- /dev/null +++ b/src/components/molecules/MoleculeTransactionTable.vue @@ -0,0 +1,56 @@ + + + + + \ No newline at end of file diff --git a/src/components/services/currency.service.ts b/src/components/services/currency.service.ts new file mode 100644 index 0000000..8ff2709 --- /dev/null +++ b/src/components/services/currency.service.ts @@ -0,0 +1,14 @@ +export class CurrencyService { + public static toString(value: number): string { + return `${(value / 100).toLocaleString('de-DE', { + minimumFractionDigits: 2, + maximumFractionDigits: 2, + })} Öro`; + } + public static toSignedString(value: number): string { + return `${value > 0 ? '+' : ''}${(value / 100).toLocaleString('de', { + minimumFractionDigits: 2, + maximumFractionDigits: 2, + })} Öro`; + } +} \ No newline at end of file diff --git a/src/components/services/date.service.ts b/src/components/services/date.service.ts new file mode 100644 index 0000000..7a4a187 --- /dev/null +++ b/src/components/services/date.service.ts @@ -0,0 +1,11 @@ +export class DateService { + public static toString(date: Date): string { + return date.toLocaleDateString('de-DE', { + day: '2-digit', + month: '2-digit', + year: 'numeric', + hour: '2-digit', + minute: '2-digit', + }); + } +} \ No newline at end of file diff --git a/src/components/views/BankView.vue b/src/components/views/BankView.vue index 11b4126..9bc0db0 100644 --- a/src/components/views/BankView.vue +++ b/src/components/views/BankView.vue @@ -1,9 +1,104 @@