Files
compor-academy/types.ts
Cauê Faleiros 21085e887d
All checks were successful
CI / Validate frontend and API (push) Successful in 2m22s
CI / Build and publish Docker images (push) Successful in 1m6s
feat: finalize academy redesign and production readiness
Align admin, community, search, library, learning and course management with the mockup. Add saved courses, download history, public community feed, instructor directory, backend search, course views, admin content tools and community moderation. Harden API and Nginx for production.
2026-11-05 15:06:53 -03:00

92 lines
2.1 KiB
TypeScript

export type SectionVariant = 'landscape' | 'portrait';
export type AttachmentType = 'pdf' | 'spreadsheet' | 'zip' | 'doc' | 'image' | 'link' | 'video';
export interface Attachment {
id: string;
name: string;
type: AttachmentType;
url: string;
size?: string; // e.g. "4.2 MB"
sizeBytes?: number;
createdAt?: string;
description?: string;
lessonId?: string; // Associated lesson or global course asset
downloadCount?: number;
}
export type LessonMediaStatus = 'processing' | 'ready' | 'failed';
export interface LessonMedia {
id?: string;
provider: string;
externalId: string;
playbackUrl?: string | null;
embedUrl?: string | null;
status: LessonMediaStatus;
durationSeconds?: number | null;
}
export interface Lesson {
id: string;
title: string;
duration: string;
videoUrl: string;
mediaProvider?: string;
media?: LessonMedia[];
isFree: boolean; // true = Public, false = Pro (Login required)
description?: string;
attachments?: Attachment[]; // Lesson-specific downloadable materials
}
export interface Course {
id: string;
title: string;
category: string;
thumbnail: string;
coverImageZoom?: number;
coverImagePositionX?: number;
coverImagePositionY?: number;
lessons: Lesson[];
progress?: number; // 0 to 100
views?: number;
learners?: number;
updatedAt?: string;
duration: string; // Total duration or lesson count
description: string;
instructor?: string;
instructorId?: string;
instructorRole?: string;
tips?: string[]; // Key takeaways / instructor tips
attachments?: Attachment[]; // Downloadable materials across entire course
status?: 'draft' | 'published';
lastActivity?: string;
}
export interface Section {
title: string;
variant: SectionVariant;
courses: Course[];
}
export type UserRole = 'superadmin' | 'professor' | 'student';
export interface User {
id: string;
email: string;
name: string;
role: UserRole;
avatar?: string;
}
export interface Comment {
id: string;
courseId: string;
lessonId?: string;
user: string;
text: string;
date: string;
reply?: string; // Professor's reply
replyDate?: string;
}