Initial Version
This commit is contained in:
72
frontend/src/types/index.ts
Normal file
72
frontend/src/types/index.ts
Normal file
@@ -0,0 +1,72 @@
|
||||
export interface Grocery {
|
||||
id: number;
|
||||
name: string;
|
||||
price: number;
|
||||
category: string;
|
||||
organic: boolean;
|
||||
weight?: number;
|
||||
weight_unit: string;
|
||||
created_at: string;
|
||||
updated_at?: string;
|
||||
}
|
||||
|
||||
export interface GroceryCreate {
|
||||
name: string;
|
||||
price: number;
|
||||
category: string;
|
||||
organic: boolean;
|
||||
weight?: number;
|
||||
weight_unit: string;
|
||||
}
|
||||
|
||||
export interface Shop {
|
||||
id: number;
|
||||
name: string;
|
||||
city: string;
|
||||
address?: string;
|
||||
created_at: string;
|
||||
}
|
||||
|
||||
export interface ShopCreate {
|
||||
name: string;
|
||||
city: string;
|
||||
address?: string;
|
||||
}
|
||||
|
||||
export interface GroceryInEvent {
|
||||
grocery_id: number;
|
||||
amount: number;
|
||||
}
|
||||
|
||||
export interface ShoppingEvent {
|
||||
id: number;
|
||||
shop_id: number;
|
||||
date: string;
|
||||
total_amount?: number;
|
||||
notes?: string;
|
||||
created_at: string;
|
||||
shop: Shop;
|
||||
groceries: Grocery[];
|
||||
}
|
||||
|
||||
export interface ShoppingEventCreate {
|
||||
shop_id: number;
|
||||
date?: string;
|
||||
total_amount?: number;
|
||||
notes?: string;
|
||||
groceries: GroceryInEvent[];
|
||||
}
|
||||
|
||||
export interface CategoryStats {
|
||||
category: string;
|
||||
total_spent: number;
|
||||
item_count: number;
|
||||
avg_price: number;
|
||||
}
|
||||
|
||||
export interface ShopStats {
|
||||
shop_name: string;
|
||||
total_spent: number;
|
||||
visit_count: number;
|
||||
avg_per_visit: number;
|
||||
}
|
||||
Reference in New Issue
Block a user