@campusiq/sdk
Version:
Official JavaScript/TypeScript SDK for CampusIQ - A comprehensive school management system API
100 lines • 2.77 kB
TypeScript
import { BaseResource } from './base';
import { Student, ListResponse, PaginationParams } from '../types';
export interface CreateStudentData {
firstName: string;
lastName: string;
email: string;
grade: string;
dateOfBirth: string;
enrollmentDate?: string;
address: {
street: string;
city: string;
state: string;
zipCode: string;
country?: string;
};
parentContact: {
name: string;
email: string;
phone: string;
relationship?: string;
};
emergencyContacts?: Array<{
name: string;
email: string;
phone: string;
relationship?: string;
}>;
medicalInfo?: {
allergies?: string[];
medications?: string[];
conditions?: string[];
};
}
export interface UpdateStudentData extends Partial<CreateStudentData> {
status?: 'active' | 'inactive' | 'graduated';
}
export interface StudentFilters extends PaginationParams {
grade?: string;
status?: 'active' | 'inactive' | 'graduated';
search?: string;
enrollmentDateFrom?: string;
enrollmentDateTo?: string;
}
export declare class StudentsResource extends BaseResource {
/**
* List all students with optional filtering and pagination
*/
list(filters?: StudentFilters): Promise<ListResponse<Student>>;
/**
* Get a specific student by ID
*/
get(studentId: string): Promise<Student>;
/**
* Create a new student
*/
create(data: CreateStudentData): Promise<Student>;
/**
* Update an existing student
*/
update(studentId: string, data: UpdateStudentData): Promise<Student>;
/**
* Delete a student
*/
delete(studentId: string): Promise<{
success: boolean;
message: string;
}>;
/**
* Get student's enrollment history
*/
getEnrollments(studentId: string, filters?: PaginationParams): Promise<ListResponse<any>>;
/**
* Get student's grades
*/
getGrades(studentId: string, filters?: PaginationParams & {
courseId?: string;
semester?: string;
}): Promise<ListResponse<any>>;
/**
* Get student's attendance records
*/
getAttendance(studentId: string, filters?: PaginationParams & {
courseId?: string;
dateFrom?: string;
dateTo?: string;
}): Promise<ListResponse<any>>;
/**
* Bulk create students
*/
bulkCreate(students: CreateStudentData[]): Promise<{
created: Student[];
errors: any[];
}>;
/**
* Search students by name or email
*/
search(query: string, filters?: Omit<StudentFilters, 'search'>): Promise<ListResponse<Student>>;
}
//# sourceMappingURL=students.d.ts.map