feat(frontend): add async admin form foundations

This commit is contained in:
2026-06-14 00:04:22 +03:30
parent 25bd46ea2a
commit 9080b0caea
9 changed files with 668 additions and 80 deletions

View File

@@ -18,6 +18,27 @@ export interface TokenSchema {
export interface MajorOption {
code: string;
label: string;
id?: number;
name?: string;
user_count?: number;
}
export interface MetaOptionSchema {
id: number;
code: string;
name: string;
label: string;
user_count?: number;
}
export interface PagedMetaOptionSchema {
count: number;
results: MetaOptionSchema[];
}
export interface MetaOptionWriteSchema {
code: string;
name: string;
}
export interface UserProfileSchema {
@@ -62,6 +83,19 @@ export interface UserListSchema {
full_name?: string | null;
university?: string | null;
major?: string | null;
profile_picture?: string | null;
profile_picture_thumbnail_url?: string | null;
profile_picture_preview_url?: string | null;
student_id?: string | null;
year_of_study?: number | null;
bio?: string | null;
is_email_verified?: boolean;
is_mobile_verified?: boolean;
is_deleted?: boolean;
deleted_at?: string | null;
can_access_blog_admin?: boolean;
can_write_blog_posts?: boolean;
can_review_blog_posts?: boolean;
is_active: boolean;
is_staff: boolean;
is_superuser: boolean;
@@ -524,6 +558,12 @@ export interface EventGalleryItem {
absolute_image_blur_url?: string | null;
width?: number;
height?: number;
file_size_mb?: number;
markdown_url?: string;
image?: string;
alt_text?: string | null;
is_public?: boolean;
created_at?: string;
}
export interface EventDetailSchema extends EventListItemSchema {
@@ -536,19 +576,28 @@ export interface EventDetailSchema extends EventListItemSchema {
export interface EventCreateSchema {
title: string;
description: string;
start_date: string;
end_date?: string;
location: string;
capacity?: number;
event_image?: string;
requirements?: string;
is_registration_open?: boolean;
slug?: string | null;
event_type: 'online' | 'on_site' | 'hybrid';
address?: string | null;
location?: string | null;
online_link?: string | null;
start_time: string;
end_time: string;
registration_start_date?: string | null;
registration_end_date?: string | null;
capacity?: number | null;
price?: number | null;
status?: 'draft' | 'published' | 'cancelled' | 'completed';
registration_success_markdown?: string | null;
gallery_image_ids?: number[] | null;
}
export interface PaymentAdminSchema {
id: number;
authority?: string | null;
ref_id?: string | null;
card_pan?: string | null;
card_hash?: string | null;
status: number;
status_label: string;
base_amount: number;
@@ -573,6 +622,14 @@ export interface RegistrationAdminSchema {
first_name: string;
last_name: string;
email: string;
mobile?: string | null;
profile_picture?: string | null;
profile_picture_thumbnail_url?: string | null;
profile_picture_preview_url?: string | null;
university?: string | null;
major?: string | null;
student_id?: string | null;
year_of_study?: number | null;
};
payments: PaymentAdminSchema[];
}
@@ -582,6 +639,7 @@ export interface EventAdminDetailSchema extends EventDetailSchema {
}
export interface EventUpdateSchema {
title?: string;
slug?: string | null;
description?: string;
event_type?: 'online' | 'on_site' | 'hybrid';
address?: string | null;
@@ -594,9 +652,47 @@ export interface EventUpdateSchema {
capacity?: number | null;
price?: number | null;
status?: 'draft' | 'published' | 'cancelled' | 'completed';
registration_success_markdown?: string | null;
gallery_image_ids?: number[] | null;
}
export interface DiscountCodeSchema {
id: number;
code: string;
type: 'percent' | 'fixed';
value: number;
max_discount?: number | null;
is_active: boolean;
starts_at?: string | null;
ends_at?: string | null;
usage_limit_total?: number | null;
usage_limit_per_user?: number | null;
min_amount?: number | null;
applicable_event_ids: number[];
usage_count: number;
created_at: string;
updated_at: string;
}
export interface PagedDiscountCodeSchema {
count: number;
results: DiscountCodeSchema[];
}
export interface DiscountCodeWriteSchema {
code: string;
type: 'percent' | 'fixed';
value: number;
max_discount?: number | null;
is_active?: boolean;
starts_at?: string | null;
ends_at?: string | null;
usage_limit_total?: number | null;
usage_limit_per_user?: number | null;
min_amount?: number | null;
applicable_event_ids?: number[];
}
export interface EventRegistrationSchema {
id: number;
status: 'pending' | 'confirmed' | 'cancelled' | 'attended';