115 lines
2.3 KiB
TypeScript
115 lines
2.3 KiB
TypeScript
/**
|
|
* File: api.ts
|
|
* Created by: AI Assistant
|
|
* Date: 2025-11-29
|
|
* Purpose: API response type definitions for kreatiVortex platform
|
|
* Part of: kreatiVortex - Platform Pembelajaran Tari Online
|
|
*/
|
|
|
|
export interface ApiResponse<T = unknown> {
|
|
success: boolean;
|
|
message: string;
|
|
data?: T;
|
|
error?: string;
|
|
pagination?: {
|
|
page: number;
|
|
limit: number;
|
|
total: number;
|
|
totalPages: number;
|
|
};
|
|
}
|
|
|
|
export interface PaginationParams {
|
|
page?: number;
|
|
limit?: number;
|
|
search?: string;
|
|
sortBy?: string;
|
|
sortOrder?: 'asc' | 'desc';
|
|
}
|
|
|
|
export interface VideoFilters extends PaginationParams {
|
|
uploaderId?: string;
|
|
classId?: string;
|
|
videoType?: 'YOUTUBE' | 'LOCAL';
|
|
isPublic?: boolean;
|
|
}
|
|
|
|
export interface ForumFilters extends PaginationParams {
|
|
type?: 'GENERAL' | 'CLASS';
|
|
classId?: string;
|
|
authorId?: string;
|
|
}
|
|
|
|
export interface AssignmentFilters extends PaginationParams {
|
|
classId?: string;
|
|
educatorId?: string;
|
|
status?: 'ACTIVE' | 'INACTIVE' | 'DUE_SOON' | 'OVERDUE';
|
|
}
|
|
|
|
export interface ClassFilters extends PaginationParams {
|
|
educatorId?: string;
|
|
isActive?: boolean;
|
|
}
|
|
|
|
export interface UserFilters extends PaginationParams {
|
|
role?: 'ADMINISTRATOR' | 'PENDIDIK' | 'CALON_PENDIDIK' | 'UMUM';
|
|
isActive?: boolean;
|
|
}
|
|
|
|
export interface CreateVideoData {
|
|
title: string;
|
|
description?: string;
|
|
videoUrl: string;
|
|
videoType: 'YOUTUBE' | 'LOCAL';
|
|
thumbnailUrl?: string;
|
|
classId?: string;
|
|
isPublic: boolean;
|
|
}
|
|
|
|
export interface CreateForumData {
|
|
title: string;
|
|
description?: string;
|
|
type: 'GENERAL' | 'CLASS';
|
|
classId?: string;
|
|
}
|
|
|
|
export interface CreateForumPostData {
|
|
title: string;
|
|
content: string;
|
|
forumId: string;
|
|
parentId?: string;
|
|
}
|
|
|
|
export interface CreateAssignmentData {
|
|
title: string;
|
|
description: string;
|
|
dueDate: Date;
|
|
classId: string;
|
|
maxScore: number;
|
|
}
|
|
|
|
export interface CreateClassData {
|
|
name: string;
|
|
description: string;
|
|
code: string;
|
|
maxStudents?: number;
|
|
}
|
|
|
|
export interface CreateCommentData {
|
|
content: string;
|
|
videoId?: string;
|
|
forumPostId?: string;
|
|
parentId?: string;
|
|
}
|
|
|
|
export interface UpdateUserData {
|
|
name?: string;
|
|
email?: string;
|
|
role?: 'ADMINISTRATOR' | 'PENDIDIK' | 'CALON_PENDIDIK' | 'UMUM';
|
|
profile?: {
|
|
phone?: string;
|
|
address?: string;
|
|
bio?: string;
|
|
avatar?: string;
|
|
};
|
|
} |