Add Expense as another entity interface

This commit is contained in:
qowevisa 2024-11-16 11:46:06 +02:00
parent 9cd5286163
commit 1358951735

View File

@ -26,10 +26,20 @@ export interface Category {
parent_id: number; parent_id: number;
} }
export interface Expense {
id: number;
card_id: number;
type_id: number;
value: number;
comment: string;
date: string;
}
export const EntityTypes = { export const EntityTypes = {
card: "Card", card: "Card",
type: "Type", type: "Type",
category: "Category", category: "Category",
expense: "Expense",
} as const; } as const;
export type EntityName = keyof typeof EntityTypes; export type EntityName = keyof typeof EntityTypes;
@ -37,6 +47,7 @@ export type EntityType<T extends EntityName> =
T extends "card" ? Card : T extends "card" ? Card :
T extends "type" ? Type : T extends "type" ? Type :
T extends "category" ? Category : T extends "category" ? Category :
T extends "expense" ? Expense :
never; never;
// //