@eeplatform/basic-edu 1.10.18 → 1.10.20

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/dist/index.mjs CHANGED
@@ -34602,7 +34602,8 @@ function useSchoolController() {
34602
34602
  updateStatusById: _updateStatusById,
34603
34603
  updateFieldById: _updateFieldById,
34604
34604
  updateById: _updateById,
34605
- deleteById: _deleteById
34605
+ deleteById: _deleteById,
34606
+ getById: _getById
34606
34607
  } = useSchoolRepo();
34607
34608
  const {
34608
34609
  add: _addSchool,
@@ -34843,6 +34844,22 @@ function useSchoolController() {
34843
34844
  next(error2);
34844
34845
  }
34845
34846
  }
34847
+ async function getById(req, res, next) {
34848
+ const schoolId = req.params.id;
34849
+ const validation = Joi15.string().hex().required();
34850
+ const { error } = validation.validate(schoolId);
34851
+ if (error) {
34852
+ next(new BadRequestError23(`Validation error: ${error.message}`));
34853
+ return;
34854
+ }
34855
+ try {
34856
+ const school = await _getById(schoolId);
34857
+ res.status(200).json(school);
34858
+ return;
34859
+ } catch (error2) {
34860
+ next(error2);
34861
+ }
34862
+ }
34846
34863
  return {
34847
34864
  add,
34848
34865
  getAll,
@@ -34853,7 +34870,8 @@ function useSchoolController() {
34853
34870
  addBulk,
34854
34871
  updateFieldById,
34855
34872
  updateById,
34856
- deleteById
34873
+ deleteById,
34874
+ getById
34857
34875
  };
34858
34876
  }
34859
34877
 
@@ -37338,10 +37356,11 @@ function useGradeLevelController() {
37338
37356
  const validation = Joi23.object({
37339
37357
  id: Joi23.string().hex().required(),
37340
37358
  value: Joi23.object({
37341
- school: Joi23.string().hex().optional(),
37342
37359
  educationLevel: Joi23.string().optional(),
37343
37360
  gradeLevel: Joi23.string().optional(),
37344
37361
  teachingStyle: Joi23.string().optional(),
37362
+ maxNumberOfLearners: Joi23.number().min(1).optional(),
37363
+ minNumberOfLearners: Joi23.number().min(1).optional(),
37345
37364
  maxTeachingHoursPerDay: Joi23.number().integer().min(0).optional(),
37346
37365
  maxTeachingHoursPerWeek: Joi23.number().integer().min(0).optional(),
37347
37366
  defaultStartTime: Joi23.string().optional().allow("", null),