feat(extraordinary-expenses): Add module for extraordinary expenses
Introduces a new module to manage and track extraordinary expenses within condominiums. This includes defining expense items, sharing arrangements, and attaching relevant documents. The module adds new types for `ExpenseItem`, `ExpenseShare`, and `ExtraordinaryExpense`. Mock database functions are updated to support fetching, creating, and managing these expenses. UI components in `Layout.tsx` and `Settings.tsx` are modified to include navigation and feature toggling for extraordinary expenses. Additionally, new routes are added in `App.tsx` for both administrative and user-facing views of these expenses.
This commit is contained in:
34
types.ts
34
types.ts
@@ -52,6 +52,7 @@ export interface AppFeatures {
|
||||
payPal: boolean;
|
||||
notices: boolean;
|
||||
reports: boolean;
|
||||
extraordinaryExpenses: boolean;
|
||||
}
|
||||
|
||||
export interface AlertDefinition {
|
||||
@@ -179,3 +180,36 @@ export interface Ticket {
|
||||
userName?: string; // Joined field
|
||||
userEmail?: string; // Joined field
|
||||
}
|
||||
|
||||
// --- EXTRAORDINARY EXPENSES ---
|
||||
|
||||
export interface ExpenseItem {
|
||||
id?: string;
|
||||
description: string;
|
||||
amount: number;
|
||||
}
|
||||
|
||||
export interface ExpenseShare {
|
||||
id?: string;
|
||||
familyId: string;
|
||||
percentage: number;
|
||||
amountDue: number;
|
||||
amountPaid: number;
|
||||
status: 'PAID' | 'PARTIAL' | 'UNPAID';
|
||||
familyName?: string; // Joined
|
||||
}
|
||||
|
||||
export interface ExtraordinaryExpense {
|
||||
id: string;
|
||||
condoId: string;
|
||||
title: string;
|
||||
description: string;
|
||||
startDate: string;
|
||||
endDate?: string;
|
||||
contractorName: string;
|
||||
totalAmount: number;
|
||||
items: ExpenseItem[];
|
||||
shares?: ExpenseShare[]; // For detail view
|
||||
attachments?: { id: string, fileName: string, fileType: string, data: string }[];
|
||||
createdAt: string;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user