Files
Condopay/types.ts
frakarr 26fc451871 feat: Add email configuration and alert system
Introduces SMTP configuration settings and alert definitions to enable automated email notifications.
This includes new types for `SmtpConfig` and `AlertDefinition`, and integrates these into the settings page and mock database.
Adds styling for select elements and scrollbar hiding in the main HTML.
Updates mock database logic to potentially support local development without a backend.
2025-12-06 23:01:02 +01:00

72 lines
1.4 KiB
TypeScript

export interface Family {
id: string;
name: string;
unitNumber: string; // Internal apartment number
contactEmail?: string;
balance: number; // Calculated balance (positive = credit, negative = debt)
}
export interface Payment {
id: string;
familyId: string;
amount: number;
datePaid: string; // ISO Date string
forMonth: number; // 1-12
forYear: number;
notes?: string;
}
export interface SmtpConfig {
host: string;
port: number;
user: string;
pass: string;
secure: boolean;
fromEmail: string;
}
export interface AlertDefinition {
id: string;
subject: string;
body: string;
daysOffset: number; // Number of days
offsetType: 'before_next_month' | 'after_current_month';
sendHour: number; // 0-23
active: boolean;
lastSent?: string; // ISO Date of last execution
}
export interface AppSettings {
defaultMonthlyQuota: number;
condoName: string;
currentYear: number; // The active fiscal year
smtpConfig?: SmtpConfig;
}
export enum PaymentStatus {
PAID = 'PAID',
UNPAID = 'UNPAID', // Past due
UPCOMING = 'UPCOMING', // Future
PENDING = 'PENDING'
}
export interface MonthStatus {
monthIndex: number; // 0-11
status: PaymentStatus;
payment?: Payment;
}
export interface User {
id: string;
email: string;
name?: string;
role?: 'admin' | 'poweruser' | 'user';
phone?: string;
familyId?: string | null;
receiveAlerts?: boolean;
}
export interface AuthResponse {
token: string;
user: User;
}