index.ts70 lines, 1.2 KB
| 1 | export interface ApiResponse<T> { |
| 2 | success: boolean; |
| 3 | data: T; |
| 4 | meta: { |
| 5 | timestamp: string; |
| 6 | path: string; |
| 7 | method: string; |
| 8 | }; |
| 9 | } |
| 10 | |
| 11 | export interface ApiErrorResponse { |
| 12 | success: false; |
| 13 | error: { |
| 14 | code: string; |
| 15 | message: string; |
| 16 | details?: unknown[]; |
| 17 | timestamp: string; |
| 18 | path: string; |
| 19 | }; |
| 20 | } |
| 21 | |
| 22 | export interface User { |
| 23 | id: string; |
| 24 | email: string; |
| 25 | name: string; |
| 26 | role: 'USER' | 'ORGANIZER' | 'ADMIN'; |
| 27 | createdAt: string; |
| 28 | updatedAt: string; |
| 29 | } |
| 30 | |
| 31 | export interface Event { |
| 32 | id: string; |
| 33 | title: string; |
| 34 | description: string | null; |
| 35 | date: string; |
| 36 | location: string; |
| 37 | capacity: number; |
| 38 | price: number; |
| 39 | status: 'DRAFT' | 'PUBLISHED' | 'CANCELLED'; |
| 40 | organizerId: string; |
| 41 | createdAt: string; |
| 42 | updatedAt: string; |
| 43 | } |
| 44 | |
| 45 | export interface Ticket { |
| 46 | id: string; |
| 47 | ticketCode: string; |
| 48 | eventId: string; |
| 49 | userId: string; |
| 50 | quantity: number; |
| 51 | status: 'PENDING' | 'CONFIRMED' | 'CANCELLED' | 'CHECKED_IN'; |
| 52 | createdAt: string; |
| 53 | updatedAt: string; |
| 54 | } |
| 55 | |
| 56 | export interface LoginCredentials { |
| 57 | email: string; |
| 58 | password: string; |
| 59 | } |
| 60 | |
| 61 | export interface RegisterData { |
| 62 | email: string; |
| 63 | password: string; |
| 64 | name: string; |
| 65 | } |
| 66 | |
| 67 | export interface AuthResponse { |
| 68 | accessToken: string; |
| 69 | user: User; |
| 70 | } |