- Refactor Profile and Login screens to use AuthContext for user data
- Enhance RequestPermitModal with multiple time-off types and validation - Implement CalendarWidget for visualizing time-off requests - Improve API error handling and token management - Add utility functions for consistent date and time formatting - Clean up unused mock data and update types
This commit is contained in:
@ -1,5 +1,7 @@
|
||||
// --- TYPES & export INTERFACES (File: types.ts) ---
|
||||
|
||||
import { DateType } from "react-native-ui-datepicker";
|
||||
|
||||
export interface UserData {
|
||||
name: string;
|
||||
surname: string;
|
||||
@ -35,16 +37,24 @@ export interface OfficeItem {
|
||||
power: number;
|
||||
}
|
||||
|
||||
export type ScreenName = 'home' | 'attendance' | 'documents' | 'smart-office' | 'profile';
|
||||
|
||||
export type PermitType = 'Ferie' | 'Permesso' | 'Malattia';
|
||||
|
||||
export interface PermitRecord {
|
||||
export interface TimeOffRequestType {
|
||||
id: number;
|
||||
type: PermitType;
|
||||
startDate: string;
|
||||
endDate?: string; // Opzionale per permessi giornalieri
|
||||
startTime?: string; // Solo per permessi
|
||||
endTime?: string; // Solo per permessi
|
||||
status: 'Approvato' | 'In Attesa' | 'Rifiutato';
|
||||
name: string;
|
||||
color: string;
|
||||
abbreviation: string;
|
||||
time_required: number; // backend usa 0/1
|
||||
deleted: number; // backend usa 0/1
|
||||
}
|
||||
|
||||
export interface TimeOffRequest {
|
||||
id: number;
|
||||
id_type: number;
|
||||
id_user: number;
|
||||
start_date: DateType;
|
||||
end_date?: DateType | null;
|
||||
start_time?: string | null;
|
||||
end_time?: string | null;
|
||||
message?: string | null;
|
||||
status: number;
|
||||
timeOffRequestType: TimeOffRequestType;
|
||||
}
|
||||
Reference in New Issue
Block a user