62 lines
1.4 KiB
TypeScript
62 lines
1.4 KiB
TypeScript
export type PaymentStatus = "pending" | "paid" | "overdue" | "cancelled";
|
|
|
|
export interface Invoice {
|
|
id: string;
|
|
clientEmail: string;
|
|
clientName: string;
|
|
subject: string;
|
|
amount: number;
|
|
currency: string;
|
|
dueDate: string; // ISO date
|
|
sentDate: string; // ISO date
|
|
status: PaymentStatus;
|
|
source: "gmail" | "outlook" | "manual";
|
|
sourceThreadId?: string;
|
|
lastFollowUpDate?: string;
|
|
followUpCount: number;
|
|
followUpSchedule: number[]; // days after sent: default [7, 14, 30]
|
|
notes: string;
|
|
paymentMethod?: "stripe" | "paypal" | "bank" | "other";
|
|
paymentDate?: string;
|
|
createdAt: string;
|
|
updatedAt: string;
|
|
}
|
|
|
|
export interface Client {
|
|
email: string;
|
|
name: string;
|
|
totalInvoiced: number;
|
|
totalPaid: number;
|
|
totalOverdue: number;
|
|
invoiceCount: number;
|
|
}
|
|
|
|
export interface DashboardStats {
|
|
totalOutstanding: number;
|
|
totalPaid: number;
|
|
totalOverdue: number;
|
|
overdueCount: number;
|
|
pendingCount: number;
|
|
paidCount: number;
|
|
}
|
|
|
|
export interface Settings {
|
|
followUpDays: number[];
|
|
defaultCurrency: string;
|
|
enableAutoDetect: boolean;
|
|
enableFollowUpGeneration: boolean;
|
|
userName: string;
|
|
userEmail: string;
|
|
paypalEmail?: string;
|
|
stripeAccountId?: string;
|
|
}
|
|
|
|
export const DEFAULT_SETTINGS: Settings = {
|
|
followUpDays: [7, 14, 30],
|
|
defaultCurrency: "USD",
|
|
enableAutoDetect: true,
|
|
enableFollowUpGeneration: true,
|
|
userName: "",
|
|
userEmail: "",
|
|
};
|