@eeplatform/basic-edu 1.5.0 → 1.5.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +12 -0
- package/dist/index.d.ts +148 -21
- package/dist/index.js +2290 -1333
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +2381 -1421
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
package/dist/index.d.ts
CHANGED
|
@@ -4,25 +4,14 @@ import { ObjectId, ClientSession } from 'mongodb';
|
|
|
4
4
|
import * as bson from 'bson';
|
|
5
5
|
import { Request, Response, NextFunction } from 'express';
|
|
6
6
|
|
|
7
|
-
type TCurriculumSubject = {
|
|
8
|
-
educationLevel: string;
|
|
9
|
-
gradeLevel: string;
|
|
10
|
-
subjectCode: string;
|
|
11
|
-
subjectName: string;
|
|
12
|
-
subjectType: string;
|
|
13
|
-
sessionFrequency: number;
|
|
14
|
-
sessionDuration: number;
|
|
15
|
-
totalMinutesPerWeek: number;
|
|
16
|
-
};
|
|
17
7
|
type TCurriculum = {
|
|
18
8
|
_id?: ObjectId;
|
|
19
|
-
|
|
20
|
-
code: string;
|
|
9
|
+
name: string;
|
|
21
10
|
effectiveSchoolYear: string;
|
|
22
11
|
maxTeachingHoursPerDay: number;
|
|
23
|
-
subjects?: TCurriculumSubject[];
|
|
24
12
|
curriculumMemoRef?: string;
|
|
25
|
-
status?:
|
|
13
|
+
status?: "active" | "pilot" | "inactive" | "deprecated";
|
|
14
|
+
whitelist?: (ObjectId | string)[];
|
|
26
15
|
createdAt?: Date | string;
|
|
27
16
|
updatedAt?: Date | string;
|
|
28
17
|
deletedAt?: Date | string;
|
|
@@ -33,13 +22,12 @@ type TCurriculum = {
|
|
|
33
22
|
declare const schemaCurriculum: Joi.ObjectSchema<any>;
|
|
34
23
|
declare function MCurriculum(value: TCurriculum): {
|
|
35
24
|
_id: ObjectId | undefined;
|
|
36
|
-
|
|
37
|
-
code: string;
|
|
25
|
+
name: string;
|
|
38
26
|
effectiveSchoolYear: string;
|
|
39
27
|
maxTeachingHoursPerDay: number;
|
|
40
|
-
subjects: TCurriculumSubject[];
|
|
41
28
|
curriculumMemoRef: string;
|
|
42
|
-
status:
|
|
29
|
+
status: "active" | "pilot" | "inactive" | "deprecated";
|
|
30
|
+
whitelist: (string | ObjectId)[];
|
|
43
31
|
createdAt: string | Date;
|
|
44
32
|
updatedAt: string | Date;
|
|
45
33
|
deletedAt: string | Date;
|
|
@@ -64,11 +52,18 @@ declare function useCurriculumRepo(): {
|
|
|
64
52
|
}>;
|
|
65
53
|
getById: (_id: string | ObjectId) => Promise<TCurriculum | null>;
|
|
66
54
|
updateById: (_id: ObjectId | string, value: {
|
|
67
|
-
|
|
55
|
+
name?: string;
|
|
56
|
+
effectiveSchoolYear?: string;
|
|
68
57
|
maxTeachingHoursPerDay?: number;
|
|
69
58
|
curriculumMemoRef?: string;
|
|
59
|
+
status?: "active" | "pilot" | "inactive" | "deprecated";
|
|
60
|
+
whitelist?: (ObjectId | string)[];
|
|
70
61
|
}, session?: ClientSession) => Promise<mongodb.UpdateResult<bson.Document>>;
|
|
71
62
|
deleteById: (_id: string | ObjectId, session?: ClientSession) => Promise<mongodb.UpdateResult<bson.Document>>;
|
|
63
|
+
canSchoolAccessCurriculum: (curriculumId: string | ObjectId, schoolId: string | ObjectId) => Promise<boolean>;
|
|
64
|
+
getAvailableForSchool: (schoolId: string | ObjectId) => Promise<TCurriculum[]>;
|
|
65
|
+
addSchoolToPilotWhitelist: (curriculumId: string | ObjectId, schoolId: string | ObjectId, session?: ClientSession) => Promise<mongodb.UpdateResult<bson.Document>>;
|
|
66
|
+
removeSchoolFromPilotWhitelist: (curriculumId: string | ObjectId, schoolId: string | ObjectId, session?: ClientSession) => Promise<mongodb.UpdateResult<bson.Document>>;
|
|
72
67
|
};
|
|
73
68
|
|
|
74
69
|
declare function useCurriculumController(): {
|
|
@@ -77,6 +72,119 @@ declare function useCurriculumController(): {
|
|
|
77
72
|
getById: (req: Request, res: Response, next: NextFunction) => Promise<void>;
|
|
78
73
|
updateById: (req: Request, res: Response, next: NextFunction) => Promise<void>;
|
|
79
74
|
deleteById: (req: Request, res: Response, next: NextFunction) => Promise<void>;
|
|
75
|
+
checkSchoolAccess: (req: Request, res: Response, next: NextFunction) => Promise<void>;
|
|
76
|
+
getAvailableForSchool: (req: Request, res: Response, next: NextFunction) => Promise<void>;
|
|
77
|
+
addToPilotWhitelist: (req: Request, res: Response, next: NextFunction) => Promise<void>;
|
|
78
|
+
removeFromPilotWhitelist: (req: Request, res: Response, next: NextFunction) => Promise<void>;
|
|
79
|
+
};
|
|
80
|
+
|
|
81
|
+
type TCurriculumSubject = {
|
|
82
|
+
_id?: ObjectId;
|
|
83
|
+
curriculum: ObjectId | string;
|
|
84
|
+
curriculumName: string;
|
|
85
|
+
effectiveSchoolYear?: number[];
|
|
86
|
+
educationLevel: string;
|
|
87
|
+
gradeLevel: string;
|
|
88
|
+
subjectCode: string;
|
|
89
|
+
subjectName: string;
|
|
90
|
+
subjectType: string;
|
|
91
|
+
sessionFrequency: number;
|
|
92
|
+
sessionDuration: number;
|
|
93
|
+
totalMinutesPerWeek: number;
|
|
94
|
+
status?: string;
|
|
95
|
+
createdAt?: Date | string;
|
|
96
|
+
updatedAt?: Date | string;
|
|
97
|
+
deletedAt?: Date | string;
|
|
98
|
+
createdBy?: string;
|
|
99
|
+
updatedBy?: string;
|
|
100
|
+
deletedBy?: string;
|
|
101
|
+
};
|
|
102
|
+
declare const schemaCurriculumSubject: Joi.ObjectSchema<any>;
|
|
103
|
+
declare const schemaCurriculumSubjectAdd: Joi.ObjectSchema<any>;
|
|
104
|
+
declare function MCurriculumSubject(value: TCurriculumSubject): {
|
|
105
|
+
_id: ObjectId | undefined;
|
|
106
|
+
curriculum: ObjectId;
|
|
107
|
+
curriculumName: string;
|
|
108
|
+
effectiveSchoolYear: number[];
|
|
109
|
+
educationLevel: string;
|
|
110
|
+
gradeLevel: string;
|
|
111
|
+
subjectCode: string;
|
|
112
|
+
subjectName: string;
|
|
113
|
+
subjectType: string;
|
|
114
|
+
sessionFrequency: number;
|
|
115
|
+
sessionDuration: number;
|
|
116
|
+
totalMinutesPerWeek: number;
|
|
117
|
+
status: string;
|
|
118
|
+
createdAt: string | Date;
|
|
119
|
+
updatedAt: string | Date;
|
|
120
|
+
deletedAt: string | Date;
|
|
121
|
+
createdBy: string;
|
|
122
|
+
updatedBy: string;
|
|
123
|
+
deletedBy: string;
|
|
124
|
+
};
|
|
125
|
+
|
|
126
|
+
declare function useCurriculumSubjectRepo(): {
|
|
127
|
+
createIndexes: () => Promise<void>;
|
|
128
|
+
add: (value: TCurriculumSubject, session?: ClientSession) => Promise<ObjectId>;
|
|
129
|
+
getAll: ({ search, page, limit, sort, status, curriculum, educationLevel, gradeLevel, schoolYear, }?: {
|
|
130
|
+
search?: string;
|
|
131
|
+
page?: number;
|
|
132
|
+
limit?: number;
|
|
133
|
+
sort?: Record<string, number>;
|
|
134
|
+
status?: string;
|
|
135
|
+
curriculum?: string;
|
|
136
|
+
educationLevel?: string;
|
|
137
|
+
gradeLevel?: string;
|
|
138
|
+
schoolYear?: number;
|
|
139
|
+
}) => Promise<Record<string, any> | {
|
|
140
|
+
items: any[];
|
|
141
|
+
pages: number;
|
|
142
|
+
pageRange: string;
|
|
143
|
+
}>;
|
|
144
|
+
getById: (_id: string | ObjectId) => Promise<bson.Document | TCurriculumSubject>;
|
|
145
|
+
getByCurriculum: (curriculumId: string | ObjectId) => Promise<TCurriculumSubject[] | mongodb.WithId<bson.Document>[]>;
|
|
146
|
+
updateById: (_id: ObjectId | string, value: Partial<TCurriculumSubject>, session?: ClientSession) => Promise<mongodb.UpdateResult<bson.Document>>;
|
|
147
|
+
deleteById: (_id: string | ObjectId, session?: ClientSession) => Promise<mongodb.UpdateResult<bson.Document>>;
|
|
148
|
+
deleteByCurriculum: (curriculumId: string | ObjectId, session?: ClientSession) => Promise<mongodb.UpdateResult<bson.Document>>;
|
|
149
|
+
};
|
|
150
|
+
|
|
151
|
+
declare function useCurriculumSubjectController(): {
|
|
152
|
+
add: (req: Request, res: Response, next: NextFunction) => Promise<void>;
|
|
153
|
+
addMany: (value: {
|
|
154
|
+
curriculum: string;
|
|
155
|
+
curriculumName: string;
|
|
156
|
+
effectiveSchoolYear?: number[];
|
|
157
|
+
educationLevel: string;
|
|
158
|
+
gradeLevel: string[];
|
|
159
|
+
subjectCode: string;
|
|
160
|
+
subjectName: string;
|
|
161
|
+
subjectType: string;
|
|
162
|
+
sessionFrequency: number;
|
|
163
|
+
sessionDuration: number;
|
|
164
|
+
totalMinutesPerWeek: number;
|
|
165
|
+
}) => Promise<string>;
|
|
166
|
+
getAll: (req: Request, res: Response, next: NextFunction) => Promise<void>;
|
|
167
|
+
getById: (req: Request, res: Response, next: NextFunction) => Promise<void>;
|
|
168
|
+
getByCurriculum: (req: Request, res: Response, next: NextFunction) => Promise<void>;
|
|
169
|
+
updateById: (req: Request, res: Response, next: NextFunction) => Promise<void>;
|
|
170
|
+
deleteById: (req: Request, res: Response, next: NextFunction) => Promise<void>;
|
|
171
|
+
deleteByCurriculum: (req: Request, res: Response, next: NextFunction) => Promise<void>;
|
|
172
|
+
};
|
|
173
|
+
|
|
174
|
+
declare function useCurriculumSubjectService(): {
|
|
175
|
+
addMany: (value: {
|
|
176
|
+
curriculum: string;
|
|
177
|
+
curriculumName: string;
|
|
178
|
+
effectiveSchoolYear?: number[];
|
|
179
|
+
educationLevel: string;
|
|
180
|
+
gradeLevel: string[];
|
|
181
|
+
subjectCode: string;
|
|
182
|
+
subjectName: string;
|
|
183
|
+
subjectType: string;
|
|
184
|
+
sessionFrequency: number;
|
|
185
|
+
sessionDuration: number;
|
|
186
|
+
totalMinutesPerWeek: number;
|
|
187
|
+
}) => Promise<string>;
|
|
80
188
|
};
|
|
81
189
|
|
|
82
190
|
type TLearner = {
|
|
@@ -321,7 +429,7 @@ declare function useGradeLevelRepo(): {
|
|
|
321
429
|
school?: ObjectId | string;
|
|
322
430
|
}, session?: ClientSession) => Promise<mongodb.UpdateResult<bson.Document>>;
|
|
323
431
|
deleteById: (_id: string | ObjectId, session?: ClientSession) => Promise<mongodb.UpdateResult<bson.Document>>;
|
|
324
|
-
getByEducationLevel: (educationLevel: string, school?: string) => Promise<
|
|
432
|
+
getByEducationLevel: (educationLevel: string, school?: string) => Promise<mongodb.WithId<bson.Document>[] | TGradeLevel[]>;
|
|
325
433
|
getByGradeLevel: (value: {
|
|
326
434
|
school: string | ObjectId;
|
|
327
435
|
gradeLevel: string;
|
|
@@ -885,4 +993,23 @@ declare function useSectionController(): {
|
|
|
885
993
|
deleteById: (req: Request, res: Response, next: NextFunction) => Promise<void>;
|
|
886
994
|
};
|
|
887
995
|
|
|
888
|
-
|
|
996
|
+
type TSectionStudent = {
|
|
997
|
+
_id?: ObjectId;
|
|
998
|
+
section: ObjectId | string;
|
|
999
|
+
student: string;
|
|
1000
|
+
studentName: string;
|
|
1001
|
+
status?: string;
|
|
1002
|
+
assignedAt?: Date | string;
|
|
1003
|
+
updatedAt?: Date | string;
|
|
1004
|
+
};
|
|
1005
|
+
declare const allowedSectionStudentStatuses: string[];
|
|
1006
|
+
declare const schemaSectionStudent: Joi.ObjectSchema<any>;
|
|
1007
|
+
declare function modelSectionStudent(value: TSectionStudent): TSectionStudent;
|
|
1008
|
+
|
|
1009
|
+
declare function useSectionStudentRepo(): {
|
|
1010
|
+
createIndexes: () => Promise<void>;
|
|
1011
|
+
delCachedData: () => void;
|
|
1012
|
+
add: (value: TSectionStudent, session?: ClientSession) => Promise<bson.ObjectId>;
|
|
1013
|
+
};
|
|
1014
|
+
|
|
1015
|
+
export { MAsset, MCurriculum, MCurriculumSubject, MGradeLevel, MLearner, MPlantilla, MStockCard, TAddress, TAddressInformation, TAsset, TBasicEduCount, TCurriculum, TCurriculumSubject, TDivision, TGradeLevel, TLearner, TLearnerInfo, TLearningModality, TParentGuardianInfo, TPersonContact, TPlantilla, TRegion, TReturningLearnerInfo, TSchool, TSection, TSectionPreset, TSectionStudent, TSeniorHighInformation, TStockCard, allowedSectionStudentStatuses, modelBasicEduCount, modelDivision, modelRegion, modelSchool, modelSection, modelSectionPreset, modelSectionStudent, schemaAsset, schemaAssetUpdateOption, schemaBasicEduCount, schemaCurriculum, schemaCurriculumSubject, schemaCurriculumSubjectAdd, schemaDivision, schemaDivisionUpdate, schemaEnrollment, schemaGenerateSections, schemaGradeLevel, schemaPlantilla, schemaRegion, schemaSchool, schemaSchoolUpdate, schemaSection, schemaSectionPreset, schemaSectionStudent, schemaStockCard, schemaUpdateStatus, useAssetController, useAssetRepo, useBasicEduCountRepo, useCurriculumController, useCurriculumRepo, useCurriculumSubjectController, useCurriculumSubjectRepo, useCurriculumSubjectService, useDivisionController, useDivisionRepo, useDivisionService, useEnrollmentController, useEnrollmentRepo, useEnrollmentService, useGradeLevelController, useGradeLevelRepo, useLearnerController, useLearnerRepo, usePlantillaController, usePlantillaRepo, usePlantillaService, useRegionController, useRegionRepo, useSchoolController, useSchoolRepo, useSchoolService, useSectionController, useSectionPresetController, useSectionPresetRepo, useSectionRepo, useSectionStudentRepo, useStockCardController, useStockCardRepository, useStockCardService };
|