Files
booking-ewa/src/types/index.ts
T
Kaloyan Danchev 87dadf1def Initial commit: booking-ewa v1.0.0
Embedded Web App for EV charging slot bookings. Express backend with JWT
auth and AMPECO Public API proxy. React SPA with booking CRUD, availability
checking, and runtime design token theming.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-18 19:34:13 +02:00

45 lines
1.0 KiB
TypeScript

export interface Booking {
id: number;
userId: number;
locationId: number;
startAt: string;
endAt: string;
status: BookingStatus;
sessionId?: number | null;
createdAt: string;
lastUpdatedAt: string;
bookedEvses?: { id: number }[];
authorizedTokens?: { id: number; name: string }[];
accessMethods?: string[];
}
export type BookingStatus = 'accepted' | 'reserved' | 'completed' | 'cancelled' | 'no-show' | 'failed';
export interface BookingRequest {
id: number;
type: 'create' | 'update' | 'cancel';
status: 'approved' | 'rejected';
userId: number;
locationId?: number;
startAt?: string;
endAt?: string;
bookingId?: number;
rejectionReason?: string;
createdAt: string;
lastUpdatedAt: string;
}
export interface AvailabilitySlot {
evseId: number;
availableSlots: { startAt: string; endAt: string }[];
}
export interface SessionData {
userId: number | null;
operatorId: number;
appLanguage: string;
appCountry: string;
appTheme: 'LIGHT' | 'DARK';
designTokens?: Record<string, string>;
}