Add expense tracking system with receipt management and currency conversion
- Add expense list and detail views with filtering capabilities - Implement receipt image viewer and PDF export functionality - Add currency conversion support with automatic rate updates - Create API endpoints for expense CRUD operations - Integrate with NocoDB for expense data persistence - Add expense menu item to dashboard navigation
This commit is contained in:
@@ -221,3 +221,63 @@ export interface Interest {
|
||||
export interface InterestsResponse {
|
||||
list: Interest[];
|
||||
}
|
||||
|
||||
// Expense tracking types
|
||||
export interface ExpenseReceipt {
|
||||
id: string;
|
||||
url: string;
|
||||
signedUrl: string;
|
||||
title: string;
|
||||
mimetype: string;
|
||||
size: number;
|
||||
width: number;
|
||||
height: number;
|
||||
thumbnails: {
|
||||
tiny: { signedUrl: string };
|
||||
small: { signedUrl: string };
|
||||
card_cover: { signedUrl: string };
|
||||
};
|
||||
}
|
||||
|
||||
export type ExpenseCategory = "Food/Drinks" | "Shop" | "Online" | "Other";
|
||||
export type PaymentMethod = "Cash" | "Card";
|
||||
|
||||
export interface Expense {
|
||||
Id: number;
|
||||
"Establishment Name": string;
|
||||
Price: string; // Format: "45.99" (numeric value only)
|
||||
currency: string; // ISO currency code: "EUR", "USD", "GBP", etc.
|
||||
"Payment Method": PaymentMethod;
|
||||
Category: ExpenseCategory;
|
||||
Payer: string;
|
||||
Time: string; // Format: "YYYY-MM-DD HH:mm:ss"
|
||||
Contents: string; // Long text description
|
||||
Receipt: ExpenseReceipt[];
|
||||
Paid: boolean;
|
||||
CreatedAt: string;
|
||||
UpdatedAt: string;
|
||||
|
||||
// Computed properties (added by API)
|
||||
PriceNumber?: number; // Parsed price as number for calculations
|
||||
CurrencySymbol?: string; // Display symbol: "€", "$", "£"
|
||||
PriceUSD?: number; // Converted USD amount
|
||||
ConversionRate?: number; // Exchange rate used (from currency to USD)
|
||||
ConversionDate?: string; // When rate was fetched
|
||||
DisplayPrice?: string; // "€45.99 ($48.12)" or just "€45.99" if USD
|
||||
DisplayPriceUSD?: string; // "$48.12" formatted USD amount
|
||||
FormattedDate?: string; // Formatted date string
|
||||
FormattedTime?: string; // Formatted time string
|
||||
FormattedDateTime?: string; // Formatted date-time string
|
||||
}
|
||||
|
||||
export interface ExpenseFilters {
|
||||
startDate?: string;
|
||||
endDate?: string;
|
||||
payer?: string;
|
||||
category?: ExpenseCategory;
|
||||
}
|
||||
|
||||
export interface ExpensesResponse {
|
||||
list: Expense[];
|
||||
PageInfo: PageInfo;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user