Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
40 commits
Select commit Hold shift + click to select a range
f748ae7
added migration to refactor
AlexDyakonov Jul 15, 2025
f89eade
added domain models
AlexDyakonov Jul 15, 2025
b3f10da
removed endpoints and rest gateway for registrations/tournament
AlexDyakonov Jul 15, 2025
c579702
refactored usecases
AlexDyakonov Jul 16, 2025
8f4bd33
added basic event endpoints
AlexDyakonov Jul 16, 2025
456cb52
added endpoints
AlexDyakonov Jul 16, 2025
d1443ae
added simple tests
AlexDyakonov Jul 16, 2025
ef4756d
added permission tests
AlexDyakonov Jul 17, 2025
46db03a
added DELETE endpoint
AlexDyakonov Jul 17, 2025
99e9375
refactored event creation and deletion logic to use strategy pattern …
AlexDyakonov Jul 17, 2025
e20ab5e
added registration endpoints for event management ONLY TOURNAMENT, in…
AlexDyakonov Jul 17, 2025
bf2f22c
added 'data' field to event model and updated related database migrat…
AlexDyakonov Jul 17, 2025
d95a9f7
added approval and rejection endpoints for event registrations, allow…
AlexDyakonov Jul 17, 2025
da6834b
refactored tests
AlexDyakonov Jul 18, 2025
f7acfd3
refactored registration logic to enforce game-specific rules; updated…
AlexDyakonov Jul 18, 2025
c345074
fixed migrations
AlexDyakonov Jul 18, 2025
1dada7c
added admin API endpoints
AlexDyakonov Jul 18, 2025
487ccfe
added 'INVITED' registration status to support game invitations; upda…
AlexDyakonov Jul 18, 2025
6916333
db migration refactor
AlexDyakonov Jul 18, 2025
8963180
added admin waitlist endpoint
AlexDyakonov Jul 18, 2025
78e30a4
added new admin panel for EVENTS
AlexDyakonov Jul 18, 2025
df5e271
removed OLD page for tournaments
AlexDyakonov Jul 18, 2025
3df744f
small tests refactor, added migration with needed data
AlexDyakonov Jul 18, 2025
a1ea5c1
Clubs refactor
AlexDyakonov Jul 20, 2025
9b4189e
added registrations/my to retrieve user registrations and updated rel…
AlexDyakonov Jul 20, 2025
2eaf2be
Added example JSON data for game and tournament migrations; implement…
AlexDyakonov Jul 20, 2025
c956147
Enhanced dark theme support in CSS; refactored API types for clubs, c…
AlexDyakonov Jul 22, 2025
e0e97c9
added admin register endpoints
AlexDyakonov Jul 22, 2025
e59d515
Refactored registration API and components; added new RegistrationMod…
AlexDyakonov Jul 22, 2025
6dcc185
added event data update (results/type) TODO: MAKE BETTER
AlexDyakonov Jul 22, 2025
5f4ef6f
Updated API URL in config.js for production; added dark theme styles …
AlexDyakonov Jul 28, 2025
e5200cd
Refactored EventResultsModal to remove unused imports and cleaned up …
AlexDyakonov Jul 28, 2025
caf2aac
Change /events/filter and /registrations/my
vaniog Jul 28, 2025
786cf6d
make swag
vaniog Jul 28, 2025
8624edd
Waitlist auto update
vaniog Aug 1, 2025
8044b95
change waitlist try register order
vaniog Aug 1, 2025
6f77b5d
Fix message text
vaniog Aug 1, 2025
6453c2e
fix link href
vaniog Aug 1, 2025
1edc354
more try register from waitlist
vaniog Aug 1, 2025
892489a
fix typo
vaniog Aug 2, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion admin/public/config.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
window.api = {
// API_URL: "https://gopadel.dev.shamps.dev",
API_URL: 'http://localhost:8000'
API_URL: "https://gopadel.leenky.ru",
// API_URL: 'http://localhost:8888'
};
42 changes: 20 additions & 22 deletions admin/src/api/clubs.ts
Original file line number Diff line number Diff line change
@@ -1,45 +1,43 @@
import { api } from './api';
import type { Club, CreateClub, PatchClub } from '../shared/types';

export interface Club {
id: string;
name: string;
description?: string;
createdAt: string;
userCount?: number;
}

export interface CreateClub {
id: string;
name: string;
description?: string;
}
// Реэкспорт для удобства использования в компонентах
export type { Club, CreateClub, PatchClub };

export interface PatchClub {
// Модель фильтра клубов
export interface FilterClub {
id?: string;
name?: string;
description?: string;
isPrivate?: boolean;
url?: string;
}

export const clubsApi = {
// Получить все клубы
// Получение списка клубов с фильтрацией
filter: async (filter: FilterClub): Promise<Club[]> => {
const response = await api.post<Club[]>('/admin/clubs/filter', filter);
return response.data;
},

// Получение всех клубов
getAll: async (): Promise<Club[]> => {
const response = await api.get('/admin/clubs');
const response = await api.get<Club[]>('/admin/clubs');
return response.data;
},

// Создать новый клуб
// Создание клуба
create: async (data: CreateClub): Promise<Club> => {
const response = await api.post('/admin/clubs', data);
const response = await api.post<Club>('/admin/clubs', data);
return response.data;
},

// Обновить клуб
// Обновление клуба
patch: async (id: string, data: PatchClub): Promise<Club> => {
const response = await api.patch(`/admin/clubs/${id}`, data);
const response = await api.patch<Club>(`/admin/clubs/${id}`, data);
return response.data;
},

// Удалить клуб
// Удаление клуба
delete: async (id: string): Promise<void> => {
await api.delete(`/admin/clubs/${id}`);
},
Expand Down
18 changes: 3 additions & 15 deletions admin/src/api/courts.ts
Original file line number Diff line number Diff line change
@@ -1,20 +1,8 @@
import { api } from './api';
import type { Court, CreateCourt, PatchCourt } from '../shared/types';

export interface Court {
id: string;
name: string;
address: string;
}

export interface CreateCourt {
name: string;
address: string;
}

export interface PatchCourt {
name?: string;
address?: string;
}
// Реэкспорт для удобства использования в компонентах
export type { Court, CreateCourt, PatchCourt };

export const courtsApi = {
async getAll(): Promise<Court[]> {
Expand Down
138 changes: 138 additions & 0 deletions admin/src/api/events.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,138 @@
import { api } from './api';
import type {
Event,
EventType,
EventStatus,
User,
Court,
RegistrationStatus
} from '../shared/types';

// Реэкспорт для удобства использования в компонентах
export type { Event, EventType, EventStatus, User, Court, RegistrationStatus };

// Модель для создания события
export interface CreateEvent {
name: string;
description?: string;
startTime: string;
endTime?: string;
rankMin: number;
rankMax: number;
price: number;
maxUsers: number;
type: EventType;
courtId: string;
clubId?: string;
organizerId?: string;
data?: Record<string, unknown>;
}

// Модель для обновления события
export interface PatchEvent {
name?: string;
description?: string;
startTime?: string;
endTime?: string;
rankMin?: number;
rankMax?: number;
price?: number;
maxUsers?: number;
status?: EventStatus;
type?: EventType;
courtId?: string;
organizerId?: string;
clubId?: string;
data?: Record<string, unknown>;
}

// Модель для обновления события (админ)
export interface AdminPatchEvent {
name?: string;
description?: string;
startTime?: string;
endTime?: string;
rankMin?: number;
rankMax?: number;
price?: number;
maxUsers?: number;
status?: EventStatus;
type?: EventType;
courtId?: string;
organizerId?: string;
clubId?: string;
data?: Record<string, unknown>;
}

// Фильтр для событий
export interface FilterEvent {
id?: string;
name?: string;
status?: EventStatus;
type?: EventType;
notFull?: boolean;
notCompleted?: boolean;
organizerId?: string;
clubId?: string;
filterByUserClubs?: string;
}

// Фильтр для событий (админ)
export interface AdminFilterEvent {
id?: string;
name?: string;
status?: EventStatus;
type?: EventType;
organizerId?: string;
organizerFirstName?: string;
organizerTelegramId?: number;
clubId?: string;
clubName?: string;
}

// Модель регистрации для событий
export interface EventRegistration {
userId: string;
eventId: string;
status: RegistrationStatus;
createdAt: string;
updatedAt: string;
user?: User;
}

export const eventsApi = {
// Получение списка событий с фильтрацией
filter: async (filter: AdminFilterEvent): Promise<Event[]> => {
const response = await api.post<Event[]>('/admin/events/filter', filter);
return response.data;
},

// Получение всех событий
getAll: async (): Promise<Event[]> => {
const response = await api.post<Event[]>('/admin/events/filter', {});
return response.data;
},

// Создание события
create: async (data: CreateEvent): Promise<Event> => {
const response = await api.post<Event>('/admin/events', data);
return response.data;
},

// Обновление события
patch: async (id: string, data: AdminPatchEvent): Promise<Event> => {
const response = await api.patch<Event>(`/admin/events/${id}`, data);
return response.data;
},

// Удаление события
delete: async (id: string): Promise<void> => {
await api.delete(`/admin/events/${id}`);
},

// Обновление статуса события
updateStatus: async (id: string, status: EventStatus): Promise<Event> => {
const response = await api.patch<Event>(`/admin/events/${id}`, { status });
return response.data;
},
};
Loading