Add Expense as another entity interface
This commit is contained in:
parent
9cd5286163
commit
1358951735
|
@ -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 EntityName> =
|
|||
T extends "card" ? Card :
|
||||
T extends "type" ? Type :
|
||||
T extends "category" ? Category :
|
||||
T extends "expense" ? Expense :
|
||||
never;
|
||||
|
||||
//
|
||||
|
|
Loading…
Reference in New Issue
Block a user