From 8a30bcbdf9264d235bf93da3df8e170cfde53d02 Mon Sep 17 00:00:00 2001 From: Joe Carstairs Date: Thu, 12 Dec 2024 08:26:53 +0000 Subject: Removes web GUI --- gui/src/types/account.ts | 33 --------------------------------- 1 file changed, 33 deletions(-) delete mode 100644 gui/src/types/account.ts (limited to 'gui/src/types/account.ts') diff --git a/gui/src/types/account.ts b/gui/src/types/account.ts deleted file mode 100644 index a463304..0000000 --- a/gui/src/types/account.ts +++ /dev/null @@ -1,33 +0,0 @@ -import moment, { Moment } from "moment"; -import Currency from "./currency/currency"; -import Gbp from "./currency/gbp"; - -function newAccountFromDto(dto: unknown): Account { - const dtoDangerous = dto as AccountDto; - return { - id: dtoDangerous.id, - name: dtoDangerous.name, - openingBalance: new Gbp( - Math.floor(Math.abs(dtoDangerous.opening_balance) / 100), - Math.abs(dtoDangerous.opening_balance) % 100, - dtoDangerous.opening_balance < 0 ? -1 : 1, - ), - openingDate: moment(dtoDangerous.opening_date), - }; -} - -interface AccountDto { - readonly id: number; - readonly name: string; - readonly opening_balance: number; - readonly opening_date: string; -} - -interface Account { - readonly id: number; - readonly name: string; - readonly openingBalance: Currency; - readonly openingDate: Moment; -} - -export { type Account, newAccountFromDto }; -- cgit v1.2.3