feat: Add tickets module and PayPal integration

Introduces a new 'Tickets' module for users to submit and manage issues within their condominium. This includes defining ticket types, statuses, priorities, and categories.

Additionally, this commit integrates PayPal as a payment option for family fee payments, enabling users to pay directly via PayPal using their client ID.

Key changes:
- Added `Ticket` related types and enums.
- Implemented `TicketService` functions for CRUD operations.
- Integrated `@paypal/react-paypal-js` library.
- Added `paypalClientId` to `AppSettings` and `Condo` types.
- Updated `FamilyDetail` page to include PayPal payment option.
- Added 'Segnalazioni' navigation link to `Layout`.
This commit is contained in:
2025-12-07 19:49:59 +01:00
parent 2566b406e1
commit 5311400615
14 changed files with 977 additions and 146 deletions

View File

@@ -9,6 +9,7 @@ export interface Condo {
zipCode?: string; // CAP
notes?: string; // Note
iban?: string;
paypalClientId?: string; // PayPal Client ID for receiving payments
defaultMonthlyQuota: number;
image?: string; // Optional placeholder for logo
}
@@ -108,3 +109,51 @@ export interface AuthResponse {
token: string;
user: User;
}
// --- TICKETS ---
export enum TicketStatus {
OPEN = 'OPEN',
IN_PROGRESS = 'IN_PROGRESS',
RESOLVED = 'RESOLVED',
CLOSED = 'CLOSED'
}
export enum TicketPriority {
LOW = 'LOW',
MEDIUM = 'MEDIUM',
HIGH = 'HIGH',
URGENT = 'URGENT'
}
export enum TicketCategory {
MAINTENANCE = 'MAINTENANCE', // Manutenzione
ADMINISTRATIVE = 'ADMINISTRATIVE', // Amministrativa
NOISE = 'NOISE', // Disturbo/Rumori
CLEANING = 'CLEANING', // Pulizie
OTHER = 'OTHER' // Altro
}
export interface TicketAttachment {
id: string;
ticketId: string;
fileName: string;
fileType: string; // MIME type
data: string; // Base64 Data URI
}
export interface Ticket {
id: string;
condoId: string;
userId: string;
title: string;
description: string;
status: TicketStatus;
priority: TicketPriority;
category: TicketCategory;
createdAt: string;
updatedAt: string;
attachments?: TicketAttachment[];
userName?: string; // Joined field
userEmail?: string; // Joined field
}