analytica-frontend-lib
Version:
Repositório público dos componentes utilizados nas plataformas da Analytica Ensino
132 lines • 4.02 kB
TypeScript
import type { Lesson } from '../../types/lessons';
import { RecommendedClassDraftType } from '../../types/recommendedLessons';
export type { School, SchoolYear, Class, Student, } from '../../utils/categoryDataUtils';
/**
* Backend filters format for recommended lessons (from API)
*/
export interface LessonBackendFiltersFormat {
subjects?: string[];
topics?: string[];
subtopics?: string[];
contents?: string[];
}
/**
* Input accepted by preFilters prop
* Supports receiving either the filters object directly or wrapped inside a
* `filters` property.
*/
export type RecommendedLessonPreFiltersInput = LessonBackendFiltersFormat | {
filters?: LessonBackendFiltersFormat | null;
};
/**
* Recommended lesson draft response from backend
*/
export interface RecommendedLessonDraftResponse {
message: string;
data: {
id: string;
type: RecommendedClassDraftType;
title: string;
description: string | null;
creatorUserInstitutionId: string;
subjectId: string | null;
filters: LessonBackendFiltersFormat;
startDate: string | null;
finalDate: string | null;
createdAt: string;
updatedAt: string;
lessons?: RecommendedLessonIdWithSequence[] | RecommendedLessonWithData[];
activityDrafts?: RecommendedLessonActivityDraft[];
};
}
/**
* Activity draft ID with sequence for recommended lesson creation
*/
export interface RecommendedLessonActivityDraft {
activityDraftId: string;
sequence: number;
title?: string;
}
/**
* Recommended lesson data object interface for creating/editing
*/
export interface RecommendedLessonData {
id?: string;
type: RecommendedClassDraftType;
title: string;
description?: string | null;
subjectId?: string | null;
filters: LessonBackendFiltersFormat;
lessonIds: string[];
selectedLessons?: Lesson[];
activityDraftIds?: string[];
activityDrafts?: RecommendedLessonActivityDraft[];
updatedAt?: string;
startDate?: string | null;
finalDate?: string | null;
}
/**
* Lesson ID with sequence for recommended lesson creation
*/
export interface RecommendedLessonIdWithSequence {
lessonId: string;
sequence: number;
}
/**
* Lesson with sequence and full lesson data from GET endpoint
*/
export interface RecommendedLessonWithData {
lessonId: string;
sequence: number;
lesson: Lesson;
}
/**
* Recommended lesson creation payload sent to API
*/
export interface RecommendedLessonCreatePayload {
title: string;
description?: string;
subjectId?: string | null;
lessonIds: RecommendedLessonIdWithSequence[];
activityDraftIds?: RecommendedLessonActivityDraft[];
startDate: string;
finalDate: string;
/** Whether attached activities can be retried by the student.
* Only meaningful when activityDraftIds is non-empty. */
canRetry?: boolean;
[key: string]: unknown;
}
/**
* Recommended lesson creation response from API
*/
export interface RecommendedLessonCreateResponse {
message: string;
data: {
/** Legacy flat shape */
id?: string;
title?: string;
description?: string | null;
subjectId?: string | null;
startDate?: string;
finalDate?: string;
createdAt?: string;
updatedAt?: string;
/** Newer shape with recommendedClass wrapper */
recommendedClass?: {
id?: string;
title?: string;
description?: string | null;
subjectId?: string | null;
startDate?: string;
finalDate?: string;
createdAt?: string;
updatedAt?: string;
};
/** Optional metrics returned by the endpoint */
studentsAffected?: number;
activitiesLinked?: number;
lessonsLinked?: number;
};
}
export { RecommendedClassDraftType } from '../../types/recommendedLessons';
//# sourceMappingURL=RecommendedLessonCreate.types.d.ts.map