From 135895173504c9382829d62ddadab4a09bedd438 Mon Sep 17 00:00:00 2001 From: qowevisa Date: Sat, 16 Nov 2024 11:46:06 +0200 Subject: [PATCH] Add Expense as another entity interface --- src/lib/entities.ts | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/lib/entities.ts b/src/lib/entities.ts index 6e238c9..789f400 100644 --- a/src/lib/entities.ts +++ b/src/lib/entities.ts @@ -26,10 +26,20 @@ export interface Category { parent_id: number; } +export interface Expense { + id: number; + card_id: number; + type_id: number; + value: number; + comment: string; + date: string; +} + export const EntityTypes = { card: "Card", type: "Type", category: "Category", + expense: "Expense", } as const; export type EntityName = keyof typeof EntityTypes; @@ -37,6 +47,7 @@ export type EntityType = T extends "card" ? Card : T extends "type" ? Type : T extends "category" ? Category : + T extends "expense" ? Expense : never; //